diff options
author | Jeff Darcy <jdarcy@redhat.com> | 2015-07-28 12:11:12 -0400 |
---|---|---|
committer | Jeff Darcy <jdarcy@redhat.com> | 2015-09-01 04:55:15 -0700 |
commit | 0773ca67fdb60a142207759fa6c07a69882ce59c (patch) | |
tree | 027101fce644fe17e58c78321b1632f38aaed166 /xlators/features/bit-rot | |
parent | 038dfe57cf0c5944b0392332dbf5a00bb1208150 (diff) |
all: reduce "inline" usage
There are three kinds of inline functions: plain inline, extern inline,
and static inline. All three have been removed from .c files, except
those in "contrib" which aren't our problem. Inlines in .h files, which
are overwhelmingly "static inline" already, have generally been left
alone. Over time we should be able to "lower" these into .c files, but
that has to be done in a case-by-case fashion requiring more manual
effort. This part was easy to do automatically without (as far as I can
tell) any ill effect.
In the process, several pieces of dead code were flagged by the
compiler, and were removed.
Change-Id: I56a5e614735c9e0a6ee420dab949eac22e25c155
BUG: 1245331
Signed-off-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-on: http://review.gluster.org/11769
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Dan Lambright <dlambrig@redhat.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
Diffstat (limited to 'xlators/features/bit-rot')
-rw-r--r-- | xlators/features/bit-rot/src/bitd/bit-rot-scrub.c | 26 | ||||
-rw-r--r-- | xlators/features/bit-rot/src/bitd/bit-rot-tbf.c | 4 | ||||
-rw-r--r-- | xlators/features/bit-rot/src/bitd/bit-rot.c | 36 | ||||
-rw-r--r-- | xlators/features/bit-rot/src/stub/bit-rot-stub.c | 32 |
4 files changed, 44 insertions, 54 deletions
diff --git a/xlators/features/bit-rot/src/bitd/bit-rot-scrub.c b/xlators/features/bit-rot/src/bitd/bit-rot-scrub.c index c5f44b5b52f..4a74bbf7eef 100644 --- a/xlators/features/bit-rot/src/bitd/bit-rot-scrub.c +++ b/xlators/features/bit-rot/src/bitd/bit-rot-scrub.c @@ -43,7 +43,7 @@ struct br_fsscan_entry { * NOTE: On success @xattr is not unref'd as @sign points * to the dictionary value. */ -static inline int32_t +static int32_t bitd_fetch_signature (xlator_t *this, br_child_t *child, fd_t *fd, dict_t **xattr, br_isignature_out_t **sign) { @@ -131,7 +131,7 @@ bitd_scrub_post_compute_check (xlator_t *this, } -static inline int32_t +static int32_t bitd_signature_staleness (xlator_t *this, br_child_t *child, fd_t *fd, int *stale, unsigned long *version) @@ -191,7 +191,7 @@ bitd_scrub_pre_compute_check (xlator_t *this, br_child_t *child, return ret; } -/* static inline int */ +/* static int */ int bitd_compare_ckum (xlator_t *this, br_isignature_out_t *sign, @@ -429,13 +429,13 @@ wait_for_scrubbing (xlator_t *this, struct br_scanfs *fsscan) pthread_cleanup_pop (0); } -static inline void +static void _br_fsscan_inc_entry_count (struct br_scanfs *fsscan) { fsscan->entries++; } -static inline void +static void _br_fsscan_dec_entry_count (struct br_scanfs *fsscan) { if (--fsscan->entries == 0) { @@ -554,7 +554,7 @@ br_fsscan_deactivate (xlator_t *this, br_child_t *child) return 0; } -static inline void +static void br_fsscanner_log_time (xlator_t *this, br_child_t *child, const char *sfx) { struct timeval tv = {0,}; @@ -589,7 +589,7 @@ br_fsscanner_wait_until_kicked (struct br_scanfs *fsscan) pthread_cleanup_pop (0); } -static inline void +static void br_fsscanner_entry_control (xlator_t *this, br_child_t *child) { struct br_scanfs *fsscan = &child->fsscan; @@ -603,7 +603,7 @@ br_fsscanner_entry_control (xlator_t *this, br_child_t *child) UNLOCK (&child->lock); } -static inline void +static void br_fsscanner_exit_control (xlator_t *this, br_child_t *child) { struct br_scanfs *fsscan = &child->fsscan; @@ -690,7 +690,7 @@ br_kickstart_scanner (struct gf_tw_timer_list *timer, } -static inline uint32_t +static uint32_t br_fsscan_calculate_delta (uint32_t times) { return times; @@ -905,7 +905,7 @@ br_scrubber_calc_scale (xlator_t *this, } -static inline br_child_t * +static br_child_t * _br_scrubber_get_next_child (struct br_scrubber *fsscrub) { br_child_t *child = NULL; @@ -916,7 +916,7 @@ _br_scrubber_get_next_child (struct br_scrubber *fsscrub) return child; } -static inline void +static void _br_scrubber_get_entry (br_child_t *child, struct br_fsscan_entry **fsentry) { struct br_scanfs *fsscan = &child->fsscan; @@ -928,7 +928,7 @@ _br_scrubber_get_entry (br_child_t *child, struct br_fsscan_entry **fsentry) list_del_init (&(*fsentry)->list); } -static inline void +static void _br_scrubber_find_scrubbable_entry (struct br_scrubber *fsscrub, struct br_fsscan_entry **fsentry) { @@ -1159,7 +1159,7 @@ br_scrubber_configure (xlator_t *this, br_private_t *priv, return ret; } -static inline int32_t +static int32_t br_scrubber_fetch_option (xlator_t *this, char *opt, dict_t *options, char **value) { diff --git a/xlators/features/bit-rot/src/bitd/bit-rot-tbf.c b/xlators/features/bit-rot/src/bitd/bit-rot-tbf.c index d9543416540..f8b9b75d575 100644 --- a/xlators/features/bit-rot/src/bitd/bit-rot-tbf.c +++ b/xlators/features/bit-rot/src/bitd/bit-rot-tbf.c @@ -55,7 +55,7 @@ typedef struct br_tbf_throttle { */ #define BR_TBF_TOKENGEN_INTERVAL_USEC 600000 -static inline br_tbf_throttle_t * +static br_tbf_throttle_t * br_tbf_init_throttle (unsigned long tokens_required) { br_tbf_throttle_t *throttle = NULL; @@ -137,7 +137,7 @@ void *br_tbf_tokengenerator (void *arg) * under br_tbf_mod() context) and br_tbf_throttle(). *bucket is * updated _after_ all the required variables are initialized. */ -static inline int32_t +static int32_t br_tbf_init_bucket (br_tbf_t *tbf, br_tbf_opspec_t *spec) { int ret = 0; diff --git a/xlators/features/bit-rot/src/bitd/bit-rot.c b/xlators/features/bit-rot/src/bitd/bit-rot.c index d9874660781..d6ae5e2fdd2 100644 --- a/xlators/features/bit-rot/src/bitd/bit-rot.c +++ b/xlators/features/bit-rot/src/bitd/bit-rot.c @@ -118,7 +118,7 @@ br_brick_fini (void *xl, char *brick, void *data) * FIX: Send the string length as part of the signature struct and * change stub to handle this change. */ -static inline br_isignature_t * +static br_isignature_t * br_prepare_signature (const unsigned char *sign, unsigned long hashlen, int8_t hashtype, br_object_t *object) @@ -181,7 +181,7 @@ out: /** * Do a lookup on the gfid present within the object. */ -static inline int32_t +static int32_t br_object_lookup (xlator_t *this, br_object_t *object, struct iatt *iatt, inode_t **linked_inode) { @@ -229,7 +229,7 @@ out: * know that open is being done by bitd because syncop framework does not allow * passing xdata -- may be use frame->root->pid itself. */ -static inline int32_t +static int32_t br_object_open (xlator_t *this, br_object_t *object, inode_t *inode, fd_t **openfd) { @@ -372,14 +372,14 @@ br_calculate_obj_checksum (unsigned char *md, return ret; } -static inline int32_t +static int32_t br_object_checksum (unsigned char *md, br_object_t *object, fd_t *fd, struct iatt *iatt) { return br_calculate_obj_checksum (md, object->child, fd, iatt); } -static inline int32_t +static int32_t br_object_read_sign (inode_t *linked_inode, fd_t *fd, br_object_t *object, struct iatt *iatt) { @@ -452,7 +452,7 @@ br_object_read_sign (inode_t *linked_inode, fd_t *fd, br_object_t *object, return ret; } -static inline int br_object_sign_softerror (int32_t op_errno) +static int br_object_sign_softerror (int32_t op_errno) { return ((op_errno == ENOENT) || (op_errno == ESTALE) || (op_errno == ENODATA)); @@ -562,7 +562,7 @@ br_object_resign (xlator_t *this, * some form of priority scheduling and/or read burstness to avoid starving * (or kicking) client I/O's. */ -static inline int32_t br_sign_object (br_object_t *object) +static int32_t br_sign_object (br_object_t *object) { int32_t ret = -1; inode_t *linked_inode = NULL; @@ -631,7 +631,7 @@ static inline int32_t br_sign_object (br_object_t *object) return ret; } -static inline br_object_t *__br_pick_object (br_private_t *priv) +static br_object_t *__br_pick_object (br_private_t *priv) { br_object_t *object = NULL; @@ -719,7 +719,7 @@ br_add_object_to_queue (struct gf_tw_timer_list *timer, return; } -static inline br_object_t * +static br_object_t * br_initialize_object (xlator_t *this, br_child_t *child, changelog_event_t *ev) { br_object_t *object = NULL; @@ -741,7 +741,7 @@ out: return object; } -static inline struct gf_tw_timer_list * +static struct gf_tw_timer_list * br_initialize_timer (xlator_t *this, br_object_t *object, br_child_t *child, changelog_event_t *ev) { @@ -872,17 +872,7 @@ br_fill_brick_spec (struct gf_brick_spec *brick, char *path) brick->disconnected = NULL; } -static inline gf_boolean_t -br_time_equal (br_child_t *child, struct timeval *tv) -{ - if ((child->tv.tv_sec == tv->tv_sec) && - (child->tv.tv_usec == tv->tv_usec)) - return _gf_true; - - return _gf_false; -} - -static inline gf_boolean_t +static gf_boolean_t br_check_object_need_sign (xlator_t *this, dict_t *xattr, br_child_t *child) { int32_t ret = -1; @@ -1641,7 +1631,7 @@ notify (xlator_t *this, int32_t event, void *data, ...) * Initialize signer specific structures, spawn worker threads. */ -static inline void +static void br_fini_signer (xlator_t *this, br_private_t *priv) { int i = 0; @@ -1653,7 +1643,7 @@ br_fini_signer (xlator_t *this, br_private_t *priv) pthread_cond_destroy (&priv->object_cond); } -static inline int32_t +static int32_t br_init_signer (xlator_t *this, br_private_t *priv) { int i = 0; diff --git a/xlators/features/bit-rot/src/stub/bit-rot-stub.c b/xlators/features/bit-rot/src/stub/bit-rot-stub.c index 9439f0cdfe7..85fad6925c1 100644 --- a/xlators/features/bit-rot/src/stub/bit-rot-stub.c +++ b/xlators/features/bit-rot/src/stub/bit-rot-stub.c @@ -148,7 +148,7 @@ fini (xlator_t *this) return; } -static inline int +static int br_stub_alloc_versions (br_version_t **obuf, br_signature_t **sbuf, size_t signaturelen) { @@ -178,13 +178,13 @@ br_stub_alloc_versions (br_version_t **obuf, return -1; } -static inline void +static void br_stub_dealloc_versions (void *mem) { GF_FREE (mem); } -static inline br_stub_local_t * +static br_stub_local_t * br_stub_alloc_local (xlator_t *this) { br_stub_private_t *priv = this->private; @@ -192,13 +192,13 @@ br_stub_alloc_local (xlator_t *this) return mem_get0 (priv->local_pool); } -static inline void +static void br_stub_dealloc_local (br_stub_local_t *ptr) { mem_put (ptr); } -static inline int +static int br_stub_prepare_version_request (xlator_t *this, dict_t *dict, br_version_t *obuf, unsigned long oversion) { @@ -211,7 +211,7 @@ br_stub_prepare_version_request (xlator_t *this, dict_t *dict, (void *)obuf, sizeof (br_version_t)); } -static inline int +static int br_stub_prepare_signing_request (dict_t *dict, br_signature_t *sbuf, br_isignature_t *sign, size_t signaturelen) @@ -230,7 +230,7 @@ br_stub_prepare_signing_request (dict_t *dict, * context, hence the inode is marked dirty. this routine also * initializes the transient inode version. */ -static inline int +static int br_stub_init_inode_versions (xlator_t *this, fd_t *fd, inode_t *inode, unsigned long version, gf_boolean_t markdirty, gf_boolean_t bad_object) @@ -271,7 +271,7 @@ free_ctx: /** * modify the ongoing version of an inode. */ -static inline int +static int br_stub_mod_inode_versions (xlator_t *this, fd_t *fd, inode_t *inode, unsigned long version) { @@ -296,7 +296,7 @@ unblock: return ret; } -static inline void +static void br_stub_fill_local (br_stub_local_t *local, call_stub_t *stub, fd_t *fd, inode_t *inode, uuid_t gfid, int versioningtype, unsigned long memversion) @@ -311,7 +311,7 @@ br_stub_fill_local (br_stub_local_t *local, gf_uuid_copy (local->u.context.gfid, gfid); } -static inline void +static void br_stub_cleanup_local (br_stub_local_t *local) { local->fopstub = NULL; @@ -597,7 +597,7 @@ br_stub_fd_versioning (xlator_t *this, call_frame_t *frame, return ret; } -static inline int +static int br_stub_perform_incversioning (xlator_t *this, call_frame_t *frame, call_stub_t *stub, fd_t *fd, br_stub_inode_ctx_t *ctx) @@ -703,7 +703,7 @@ orderq (struct list_head *elem1, struct list_head *elem2) return (s1->v > s2->v); } -static inline int +static int br_stub_compare_sign_version (xlator_t *this, inode_t *inode, br_signature_t *sbuf, @@ -753,7 +753,7 @@ br_stub_compare_sign_version (xlator_t *this, return ret; } -static inline int +static int br_stub_prepare_signature (xlator_t *this, dict_t *dict, inode_t *inode, br_isignature_t *sign, int *fakesuccess) @@ -1447,7 +1447,7 @@ br_stub_getxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, return 0; } -static inline void +static void br_stub_send_stub_init_time (call_frame_t *frame, xlator_t *this) { int op_ret = 0; @@ -2268,7 +2268,7 @@ unwind: * successfully allocate the dict? Posix does not treat call back xdata * creattion failure as the lookup failure. */ -static inline int32_t +static int32_t br_stub_lookup_version (xlator_t *this, uuid_t gfid, inode_t *inode, dict_t *xattr) { @@ -2571,7 +2571,7 @@ br_stub_noop (call_frame_t *frame, void *cookie, xlator_t *this, return 0; } -static inline void +static void br_stub_send_ipc_fop (xlator_t *this, fd_t *fd, unsigned long releaseversion, int sign_info) { |