From 45a71c0548b6fd2c757aa2e7b7671a1411948894 Mon Sep 17 00:00:00 2001 From: Gluster Ant Date: Wed, 12 Sep 2018 17:22:48 +0530 Subject: Land clang-format changes Change-Id: I6f5d8140a06f3c1b2d196849299f8d483028d33b --- .../performance/nl-cache/src/nl-cache-mem-types.h | 19 ++- .../performance/nl-cache/src/nl-cache-messages.h | 8 +- xlators/performance/nl-cache/src/nl-cache.h | 162 ++++++++++----------- 3 files changed, 92 insertions(+), 97 deletions(-) (limited to 'xlators/performance/nl-cache') diff --git a/xlators/performance/nl-cache/src/nl-cache-mem-types.h b/xlators/performance/nl-cache/src/nl-cache-mem-types.h index 5952402737a..bc61eeca9da 100644 --- a/xlators/performance/nl-cache/src/nl-cache-mem-types.h +++ b/xlators/performance/nl-cache/src/nl-cache-mem-types.h @@ -8,22 +8,21 @@ * cases as published by the Free Software Foundation. */ - #ifndef __NL_CACHE_MEM_TYPES_H__ #define __NL_CACHE_MEM_TYPES_H__ #include "mem-types.h" enum gf_nlc_mem_types_ { - gf_nlc_mt_conf_t = gf_common_mt_end + 1, - gf_nlc_mt_nlc_conf_t, - gf_nlc_mt_nlc_ctx_t, - gf_nlc_mt_nlc_local_t, - gf_nlc_mt_nlc_pe_t, - gf_nlc_mt_nlc_ne_t, - gf_nlc_mt_nlc_timer_data_t, - gf_nlc_mt_nlc_lru_node, - gf_nlc_mt_end + gf_nlc_mt_conf_t = gf_common_mt_end + 1, + gf_nlc_mt_nlc_conf_t, + gf_nlc_mt_nlc_ctx_t, + gf_nlc_mt_nlc_local_t, + gf_nlc_mt_nlc_pe_t, + gf_nlc_mt_nlc_ne_t, + gf_nlc_mt_nlc_timer_data_t, + gf_nlc_mt_nlc_lru_node, + gf_nlc_mt_end }; #endif /* __NL_CACHE_MEM_TYPES_H__ */ diff --git a/xlators/performance/nl-cache/src/nl-cache-messages.h b/xlators/performance/nl-cache/src/nl-cache-messages.h index 6afa98f691e..17fd96de17c 100644 --- a/xlators/performance/nl-cache/src/nl-cache-messages.h +++ b/xlators/performance/nl-cache/src/nl-cache-messages.h @@ -23,11 +23,7 @@ * glfs-message-id.h. */ -GLFS_MSGID(NLC, - NLC_MSG_NO_MEMORY, - NLC_MSG_EINVAL, - NLC_MSG_NO_TIMER_WHEEL, - NLC_MSG_DICT_FAILURE -); +GLFS_MSGID(NLC, NLC_MSG_NO_MEMORY, NLC_MSG_EINVAL, NLC_MSG_NO_TIMER_WHEEL, + NLC_MSG_DICT_FAILURE); #endif /* __NL_CACHE_MESSAGES_H__ */ diff --git a/xlators/performance/nl-cache/src/nl-cache.h b/xlators/performance/nl-cache/src/nl-cache.h index afc3bec4a7f..9c9682f6396 100644 --- a/xlators/performance/nl-cache/src/nl-cache.h +++ b/xlators/performance/nl-cache/src/nl-cache.h @@ -23,153 +23,153 @@ #define NLC_PE_PARTIAL 0x0002 #define NLC_NE_VALID 0x0004 -#define IS_PE_VALID(state) ((state != NLC_INVALID) && \ - (state & (NLC_PE_FULL | NLC_PE_PARTIAL))) +#define IS_PE_VALID(state) \ + ((state != NLC_INVALID) && (state & (NLC_PE_FULL | NLC_PE_PARTIAL))) #define IS_NE_VALID(state) ((state != NLC_INVALID) && (state & NLC_NE_VALID)) #define IS_PEC_ENABLED(conf) (conf->positive_entry_cache) #define IS_CACHE_ENABLED(conf) ((!conf->cache_disabled)) -#define NLC_STACK_UNWIND(fop, frame, params ...) do { \ - nlc_local_t *__local = NULL; \ - xlator_t *__xl = NULL; \ - if (frame) { \ - __xl = frame->this; \ - __local = frame->local; \ - frame->local = NULL; \ - } \ - STACK_UNWIND_STRICT (fop, frame, params); \ - nlc_local_wipe (__xl, __local); \ -} while (0) +#define NLC_STACK_UNWIND(fop, frame, params...) \ + do { \ + nlc_local_t *__local = NULL; \ + xlator_t *__xl = NULL; \ + if (frame) { \ + __xl = frame->this; \ + __local = frame->local; \ + frame->local = NULL; \ + } \ + STACK_UNWIND_STRICT(fop, frame, params); \ + nlc_local_wipe(__xl, __local); \ + } while (0) enum nlc_cache_clear_reason { - NLC_NONE = 0, - NLC_LRU_PRUNE, + NLC_NONE = 0, + NLC_LRU_PRUNE, }; struct nlc_ne { - struct list_head list; - char *name; + struct list_head list; + char *name; }; typedef struct nlc_ne nlc_ne_t; struct nlc_pe { - struct list_head list; - inode_t *inode; - char *name; + struct list_head list; + inode_t *inode; + char *name; }; typedef struct nlc_pe nlc_pe_t; struct nlc_timer_data { - inode_t *inode; - xlator_t *this; + inode_t *inode; + xlator_t *this; }; typedef struct nlc_timer_data nlc_timer_data_t; struct nlc_lru_node { - inode_t *inode; - struct list_head list; + inode_t *inode; + struct list_head list; }; typedef struct nlc_lru_node nlc_lru_node_t; struct nlc_ctx { - struct list_head pe; /* list of positive entries */ - struct list_head ne; /* list of negative entries */ - uint64_t state; - time_t cache_time; - struct gf_tw_timer_list *timer; - nlc_timer_data_t *timer_data; - size_t cache_size; - uint64_t refd_inodes; - gf_lock_t lock; + struct list_head pe; /* list of positive entries */ + struct list_head ne; /* list of negative entries */ + uint64_t state; + time_t cache_time; + struct gf_tw_timer_list *timer; + nlc_timer_data_t *timer_data; + size_t cache_size; + uint64_t refd_inodes; + gf_lock_t lock; }; typedef struct nlc_ctx nlc_ctx_t; struct nlc_local { - loc_t loc; - loc_t loc2; - inode_t *inode; - inode_t *parent; - fd_t *fd; - char *linkname; - glusterfs_fop_t fop; + loc_t loc; + loc_t loc2; + inode_t *inode; + inode_t *parent; + fd_t *fd; + char *linkname; + glusterfs_fop_t fop; }; typedef struct nlc_local nlc_local_t; struct nlc_statistics { - gf_atomic_t nlc_hit; /* No. of times lookup/stat was served from this xl */ - gf_atomic_t nlc_miss; /* No. of times negative lookups were sent to disk */ - /* More granular counters */ - gf_atomic_t nameless_lookup; - gf_atomic_t getrealfilename_hit; - gf_atomic_t getrealfilename_miss; - gf_atomic_t pe_inode_cnt; - gf_atomic_t ne_inode_cnt; - gf_atomic_t nlc_invals; /* No. of invalidates received from upcall*/ + gf_atomic_t nlc_hit; /* No. of times lookup/stat was served from this xl */ + gf_atomic_t nlc_miss; /* No. of times negative lookups were sent to disk */ + /* More granular counters */ + gf_atomic_t nameless_lookup; + gf_atomic_t getrealfilename_hit; + gf_atomic_t getrealfilename_miss; + gf_atomic_t pe_inode_cnt; + gf_atomic_t ne_inode_cnt; + gf_atomic_t nlc_invals; /* No. of invalidates received from upcall*/ }; struct nlc_conf { - int32_t cache_timeout; - gf_boolean_t positive_entry_cache; - gf_boolean_t negative_entry_cache; - gf_boolean_t disable_cache; - uint64_t cache_size; - gf_atomic_t current_cache_size; - uint64_t inode_limit; - gf_atomic_t refd_inodes; - struct tvec_base *timer_wheel; - time_t last_child_down; - struct list_head lru; - gf_lock_t lock; - struct nlc_statistics nlc_counter; + int32_t cache_timeout; + gf_boolean_t positive_entry_cache; + gf_boolean_t negative_entry_cache; + gf_boolean_t disable_cache; + uint64_t cache_size; + gf_atomic_t current_cache_size; + uint64_t inode_limit; + gf_atomic_t refd_inodes; + struct tvec_base *timer_wheel; + time_t last_child_down; + struct list_head lru; + gf_lock_t lock; + struct nlc_statistics nlc_counter; }; typedef struct nlc_conf nlc_conf_t; gf_boolean_t -nlc_get_real_file_name (xlator_t *this, loc_t *loc, const char *fname, - int32_t *op_ret, int32_t *op_errno, dict_t *dict); +nlc_get_real_file_name(xlator_t *this, loc_t *loc, const char *fname, + int32_t *op_ret, int32_t *op_errno, dict_t *dict); gf_boolean_t -nlc_is_negative_lookup (xlator_t *this, loc_t *loc); +nlc_is_negative_lookup(xlator_t *this, loc_t *loc); void -nlc_set_dir_state (xlator_t *this, inode_t *inode, uint64_t state); +nlc_set_dir_state(xlator_t *this, inode_t *inode, uint64_t state); void -nlc_dir_add_pe (xlator_t *this, inode_t *inode, inode_t *entry_ino, - const char *name); +nlc_dir_add_pe(xlator_t *this, inode_t *inode, inode_t *entry_ino, + const char *name); void -nlc_dir_remove_pe (xlator_t *this, inode_t *inode, inode_t *entry_ino, - const char *name, gf_boolean_t multilink); +nlc_dir_remove_pe(xlator_t *this, inode_t *inode, inode_t *entry_ino, + const char *name, gf_boolean_t multilink); void -nlc_dir_add_ne (xlator_t *this, inode_t *inode, const char *name); +nlc_dir_add_ne(xlator_t *this, inode_t *inode, const char *name); void -nlc_local_wipe (xlator_t *this, nlc_local_t *local); +nlc_local_wipe(xlator_t *this, nlc_local_t *local); nlc_local_t * -nlc_local_init (call_frame_t *frame, xlator_t *this, glusterfs_fop_t fop, - loc_t *loc, loc_t *loc2); +nlc_local_init(call_frame_t *frame, xlator_t *this, glusterfs_fop_t fop, + loc_t *loc, loc_t *loc2); void -nlc_update_child_down_time (xlator_t *this, time_t *now); +nlc_update_child_down_time(xlator_t *this, time_t *now); void -nlc_inode_clear_cache (xlator_t *this, inode_t *inode, - int reason); +nlc_inode_clear_cache(xlator_t *this, inode_t *inode, int reason); void -nlc_dump_inodectx (xlator_t *this, inode_t *inode); +nlc_dump_inodectx(xlator_t *this, inode_t *inode); void -nlc_clear_all_cache (xlator_t *this); +nlc_clear_all_cache(xlator_t *this); void -nlc_disable_cache (xlator_t *this); +nlc_disable_cache(xlator_t *this); void -nlc_lru_prune (xlator_t *this, inode_t *inode); +nlc_lru_prune(xlator_t *this, inode_t *inode); #endif /* __NL_CACHE_H__ */ -- cgit