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/cluster/dht | |
parent | 038dfe57cf0c5944b0392332dbf5a00bb1208150 (diff) | |
download | glusterfs-0773ca67fdb60a142207759fa6c07a69882ce59c.tar.gz glusterfs-0773ca67fdb60a142207759fa6c07a69882ce59c.tar.xz glusterfs-0773ca67fdb60a142207759fa6c07a69882ce59c.zip |
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/cluster/dht')
-rw-r--r-- | xlators/cluster/dht/src/dht-hashfn.c | 9 | ||||
-rw-r--r-- | xlators/cluster/dht/src/dht-helper.c | 2 | ||||
-rw-r--r-- | xlators/cluster/dht/src/dht-rebalance.c | 10 | ||||
-rw-r--r-- | xlators/cluster/dht/src/dht-selfheal.c | 4 | ||||
-rw-r--r-- | xlators/cluster/dht/src/tier.c | 4 |
5 files changed, 11 insertions, 18 deletions
diff --git a/xlators/cluster/dht/src/dht-hashfn.c b/xlators/cluster/dht/src/dht-hashfn.c index 478d6cea2f..66e3ede736 100644 --- a/xlators/cluster/dht/src/dht-hashfn.c +++ b/xlators/cluster/dht/src/dht-hashfn.c @@ -39,7 +39,7 @@ dht_hash_compute_internal (int type, const char *name, uint32_t *hash_p) } -static inline +static gf_boolean_t dht_munge_name (const char *original, char *modified, size_t len, regex_t *re) { @@ -72,13 +72,6 @@ dht_hash_compute (xlator_t *this, int type, const char *name, uint32_t *hash_p) size_t len = 0; gf_boolean_t munged = _gf_false; - /* - * It wouldn't be safe to use alloca in an inline function that doesn't - * actually get inlined, and it wouldn't be efficient to do a real - * allocation, so we use alloca here (if needed) and pass that to the - * inline. - */ - if (priv->extra_regex_valid) { len = strlen(name) + 1; rsync_friendly_name = alloca(len); diff --git a/xlators/cluster/dht/src/dht-helper.c b/xlators/cluster/dht/src/dht-helper.c index 7107a08576..7a18559ff1 100644 --- a/xlators/cluster/dht/src/dht-helper.c +++ b/xlators/cluster/dht/src/dht-helper.c @@ -25,7 +25,7 @@ dht_free_mig_info (void *data) return; } -static inline int +static int dht_inode_ctx_set_mig_info (xlator_t *this, inode_t *inode, xlator_t *src_subvol, xlator_t *dst_subvol) { diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c index 6b3299c499..3d549b0fb0 100644 --- a/xlators/cluster/dht/src/dht-rebalance.c +++ b/xlators/cluster/dht/src/dht-rebalance.c @@ -367,7 +367,7 @@ out: gf_defrag_handle_hardlink for description of "returning -2") -1 : failure */ -static inline int +static int __is_file_migratable (xlator_t *this, loc_t *loc, struct iatt *stbuf, dict_t *xattrs, int flags, gf_defrag_info_t *defrag) @@ -421,7 +421,7 @@ out: return ret; } -static inline int +static int __dht_rebalance_create_dst_file (xlator_t *to, xlator_t *from, loc_t *loc, struct iatt *stbuf, fd_t **dst_fd, dict_t *xattr) { @@ -577,7 +577,7 @@ out: return ret; } -static inline int +static int __dht_check_free_space (xlator_t *to, xlator_t *from, loc_t *loc, struct iatt *stbuf, int flag) { @@ -687,7 +687,7 @@ out: return ret; } -static inline int +static int __dht_rebalance_migrate_data (xlator_t *from, xlator_t *to, fd_t *src, fd_t *dst, uint64_t ia_size, int hole_exists) { @@ -742,7 +742,7 @@ __dht_rebalance_migrate_data (xlator_t *from, xlator_t *to, fd_t *src, fd_t *dst } -static inline int +static int __dht_rebalance_open_src_file (xlator_t *from, xlator_t *to, loc_t *loc, struct iatt *stbuf, fd_t **src_fd, gf_boolean_t *clean_src) diff --git a/xlators/cluster/dht/src/dht-selfheal.c b/xlators/cluster/dht/src/dht-selfheal.c index 0e84a38082..ab15ca6d66 100644 --- a/xlators/cluster/dht/src/dht-selfheal.c +++ b/xlators/cluster/dht/src/dht-selfheal.c @@ -383,7 +383,7 @@ out: return fixit; } -inline int +int dht_layout_span (dht_layout_t *layout) { int i = 0, count = 0; @@ -1362,7 +1362,7 @@ dht_selfheal_layout_alloc_start (xlator_t *this, loc_t *loc, return start; } -static inline int +static int dht_get_layout_count (xlator_t *this, dht_layout_t *layout, int new_layout) { int i = 0; diff --git a/xlators/cluster/dht/src/tier.c b/xlators/cluster/dht/src/tier.c index 5d6d7983a3..d47932df5c 100644 --- a/xlators/cluster/dht/src/tier.c +++ b/xlators/cluster/dht/src/tier.c @@ -546,7 +546,7 @@ out: return ret; } -static inline int +static int tier_build_migration_qfile (demotion_args_t *args, query_cbk_args_t *query_cbk_args, gf_boolean_t is_promotion) @@ -597,7 +597,7 @@ out: return ret; } -static inline int +static int tier_migrate_files_using_qfile (demotion_args_t *comp, query_cbk_args_t *query_cbk_args, char *qfile) |