From 0be8e038d9bf90be94f3e3a7d6ea5bee88da9ecb Mon Sep 17 00:00:00 2001 From: Jeff Darcy Date: Thu, 29 Jun 2017 06:50:56 -0700 Subject: multiple: fix struct/typedef inconsistencies The most common pattern, both in our code and elsewhere, is this: struct _xyz { ... }; typedef struct _xyz xyz_t; These exceptions - especially call_frame/call_stack - have been slowing down code navigation for years. By converging on a single pattern, navigating from xyz_t in code to the actual definition of struct _xyz (i.e. without having to visit the typedef first) might even be automatable. Change-Id: I0e5dd1f51f98e000173c62ef4ddc5b21d9ec44ed Signed-off-by: Jeff Darcy Reviewed-on: https://review.gluster.org/17650 Smoke: Gluster Build System Tested-by: Jeff Darcy CentOS-regression: Gluster Build System Reviewed-by: Amar Tumballi Reviewed-by: Niels de Vos --- xlators/features/locks/src/locks.h | 8 ++++---- xlators/features/upcall/src/upcall.h | 12 ++++++------ xlators/protocol/server/src/server-helpers.h | 6 +++--- 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'xlators') diff --git a/xlators/features/locks/src/locks.h b/xlators/features/locks/src/locks.h index 8eb35da44be..3d3b327f56c 100644 --- a/xlators/features/locks/src/locks.h +++ b/xlators/features/locks/src/locks.h @@ -100,14 +100,14 @@ struct __pl_inode_lock { }; typedef struct __pl_inode_lock pl_inode_lock_t; -struct __pl_rw_req_t { +struct _pl_rw_req { struct list_head list; call_stub_t *stub; posix_lock_t region; }; -typedef struct __pl_rw_req_t pl_rw_req_t; +typedef struct _pl_rw_req pl_rw_req_t; -struct __pl_dom_list_t { +struct _pl_dom_list { struct list_head inode_list; /* list_head back to pl_inode_t */ const char *domain; struct list_head entrylk_list; /* List of entry locks */ @@ -115,7 +115,7 @@ struct __pl_dom_list_t { struct list_head inodelk_list; /* List of inode locks */ struct list_head blocked_inodelks; /* List of all blocked inodelks */ }; -typedef struct __pl_dom_list_t pl_dom_list_t; +typedef struct _pl_dom_list pl_dom_list_t; struct __entry_lock { struct list_head domain_list; /* list_head back to pl_dom_list_t */ diff --git a/xlators/features/upcall/src/upcall.h b/xlators/features/upcall/src/upcall.h index 159193f54e7..3e0d96cd001 100644 --- a/xlators/features/upcall/src/upcall.h +++ b/xlators/features/upcall/src/upcall.h @@ -44,7 +44,7 @@ upcall_local_wipe (__xl, __local); \ } while (0) -struct _upcall_private_t { +struct _upcall_private { gf_boolean_t cache_invalidation_enabled; int32_t cache_invalidation_timeout; struct list_head inode_ctx_list; @@ -55,9 +55,9 @@ struct _upcall_private_t { dict_t *xattrs; /* list of xattrs registered by clients for receiving invalidation */ }; -typedef struct _upcall_private_t upcall_private_t; +typedef struct _upcall_private upcall_private_t; -struct _upcall_client_t { +struct _upcall_client { struct list_head client_list; /* strdup to store client_uid, strdup. Free it explicitly */ char *client_uid; @@ -65,10 +65,10 @@ struct _upcall_client_t { /* the amount of time which client can cache this entry */ uint32_t expire_time_attr; }; -typedef struct _upcall_client_t upcall_client_t; +typedef struct _upcall_client upcall_client_t; /* Upcall entries are maintained in inode_ctx */ -struct _upcall_inode_ctx_t { +struct _upcall_inode_ctx { struct list_head inode_ctx_list; struct list_head client_list; pthread_mutex_t client_list_lock; /* mutex for clients list @@ -76,7 +76,7 @@ struct _upcall_inode_ctx_t { int destroy; uuid_t gfid; /* gfid of the entry */ }; -typedef struct _upcall_inode_ctx_t upcall_inode_ctx_t; +typedef struct _upcall_inode_ctx upcall_inode_ctx_t; struct upcall_local { /* XXX: need to check if we can store diff --git a/xlators/protocol/server/src/server-helpers.h b/xlators/protocol/server/src/server-helpers.h index 02e092b9956..1f47bc9dff1 100644 --- a/xlators/protocol/server/src/server-helpers.h +++ b/xlators/protocol/server/src/server-helpers.h @@ -41,11 +41,11 @@ call_frame_t * get_frame_from_request (rpcsvc_request_t *req); int -server_connection_cleanup (xlator_t *this, struct _client_t *client, +server_connection_cleanup (xlator_t *this, struct _client *client, int32_t flags); gf_boolean_t -server_cancel_grace_timer (xlator_t *this, struct _client_t *client); +server_cancel_grace_timer (xlator_t *this, struct _client *client); int server_build_config (xlator_t *this, server_conf_t *conf); @@ -55,7 +55,7 @@ int serialize_rsp_direntp (gf_dirent_t *entries, gfs3_readdirp_rsp *rsp); int readdirp_rsp_cleanup (gfs3_readdirp_rsp *rsp); int readdir_rsp_cleanup (gfs3_readdir_rsp *rsp); int auth_set_username_passwd (dict_t *input_params, dict_t *config_params, - struct _client_t *client); + struct _client *client); server_ctx_t *server_ctx_get (client_t *client, xlator_t *xlator); int server_process_event_upcall (xlator_t *this, void *data); -- cgit