diff options
author | Gluster Ant <bugzilla-bot@gluster.org> | 2018-09-12 17:22:48 +0530 |
---|---|---|
committer | Nigel Babu <nigelb@redhat.com> | 2018-09-12 17:22:48 +0530 |
commit | 45a71c0548b6fd2c757aa2e7b7671a1411948894 (patch) | |
tree | 2a5a9b73bae47ab53a41166fd041a06612587f48 /xlators/features/bit-rot/src/bitd | |
parent | be77dbbda692792335a8e9e7c02e0c281f003c40 (diff) |
Land clang-format changes
Change-Id: I6f5d8140a06f3c1b2d196849299f8d483028d33b
Diffstat (limited to 'xlators/features/bit-rot/src/bitd')
-rw-r--r-- | xlators/features/bit-rot/src/bitd/bit-rot-bitd-messages.h | 82 | ||||
-rw-r--r-- | xlators/features/bit-rot/src/bitd/bit-rot-scrub-status.h | 26 | ||||
-rw-r--r-- | xlators/features/bit-rot/src/bitd/bit-rot-scrub.h | 31 | ||||
-rw-r--r-- | xlators/features/bit-rot/src/bitd/bit-rot-ssm.h | 25 | ||||
-rw-r--r-- | xlators/features/bit-rot/src/bitd/bit-rot.h | 313 |
5 files changed, 227 insertions, 250 deletions
diff --git a/xlators/features/bit-rot/src/bitd/bit-rot-bitd-messages.h b/xlators/features/bit-rot/src/bitd/bit-rot-bitd-messages.h index 89a67cc10b1..6f59933a31d 100644 --- a/xlators/features/bit-rot/src/bitd/bit-rot-bitd-messages.h +++ b/xlators/features/bit-rot/src/bitd/bit-rot-bitd-messages.h @@ -23,62 +23,30 @@ * glfs-message-id.h. */ -GLFS_MSGID(BITROT_BITD, - BRB_MSG_FD_CREATE_FAILED, - BRB_MSG_READV_FAILED, - BRB_MSG_BLOCK_READ_FAILED, - BRB_MSG_CALC_CHECKSUM_FAILED, - BRB_MSG_NO_MEMORY, - BRB_MSG_GET_SIGN_FAILED, - BRB_MSG_SET_SIGN_FAILED, - BRB_MSG_OP_FAILED, - BRB_MSG_READ_AND_SIGN_FAILED, - BRB_MSG_SIGN_FAILED, - BRB_MSG_GET_SUBVOL_FAILED, - BRB_MSG_SET_TIMER_FAILED, - BRB_MSG_GET_INFO_FAILED, - BRB_MSG_PATH_FAILED, - BRB_MSG_MARK_BAD_FILE, - BRB_MSG_TRIGGER_SIGN, - BRB_MSG_REGISTER_FAILED, - BRB_MSG_CRAWLING_START, - BRB_MSG_SPAWN_FAILED, - BRB_MSG_INVALID_SUBVOL_CHILD, - BRB_MSG_SKIP_OBJECT, - BRB_MSG_NO_CHILD, - BRB_MSG_CHECKSUM_MISMATCH, - BRB_MSG_MARK_CORRUPTED, - BRB_MSG_CRAWLING_FINISH, - BRB_MSG_CALC_ERROR, - BRB_MSG_LOOKUP_FAILED, - BRB_MSG_PARTIAL_VERSION_PRESENCE, - BRB_MSG_MEM_ACNT_FAILED, - BRB_MSG_TIMER_WHEEL_UNAVAILABLE, - BRB_MSG_BITROT_LOADED, - BRB_MSG_SCALE_DOWN_FAILED, - BRB_MSG_SCALE_UP_FAILED, - BRB_MSG_SCALE_DOWN_SCRUBBER, - BRB_MSG_SCALING_UP_SCRUBBER, - BRB_MSG_UNKNOWN_THROTTLE, - BRB_MSG_RATE_LIMIT_INFO, - BRB_MSG_SCRUB_INFO, - BRB_MSG_CONNECTED_TO_BRICK, - BRB_MSG_BRICK_INFO, - BRB_MSG_SUBVOL_CONNECT_FAILED, - BRB_MSG_INVALID_SUBVOL, - BRB_MSG_RESCHEDULE_SCRUBBER_FAILED, - BRB_MSG_SCRUB_START, - BRB_MSG_SCRUB_FINISH, - BRB_MSG_SCRUB_RUNNING, - BRB_MSG_SCRUB_RESCHEDULED, - BRB_MSG_SCRUB_TUNABLE, - BRB_MSG_SCRUB_THREAD_CLEANUP, - BRB_MSG_SCRUBBER_CLEANED, - BRB_MSG_GENERIC_SSM_INFO, - BRB_MSG_ZERO_TIMEOUT_BUG, - BRB_MSG_BAD_OBJ_READDIR_FAIL, - BRB_MSG_SSM_FAILED, - BRB_MSG_SCRUB_WAIT_FAILED -); +GLFS_MSGID(BITROT_BITD, BRB_MSG_FD_CREATE_FAILED, BRB_MSG_READV_FAILED, + BRB_MSG_BLOCK_READ_FAILED, BRB_MSG_CALC_CHECKSUM_FAILED, + BRB_MSG_NO_MEMORY, BRB_MSG_GET_SIGN_FAILED, BRB_MSG_SET_SIGN_FAILED, + BRB_MSG_OP_FAILED, BRB_MSG_READ_AND_SIGN_FAILED, BRB_MSG_SIGN_FAILED, + BRB_MSG_GET_SUBVOL_FAILED, BRB_MSG_SET_TIMER_FAILED, + BRB_MSG_GET_INFO_FAILED, BRB_MSG_PATH_FAILED, BRB_MSG_MARK_BAD_FILE, + BRB_MSG_TRIGGER_SIGN, BRB_MSG_REGISTER_FAILED, + BRB_MSG_CRAWLING_START, BRB_MSG_SPAWN_FAILED, + BRB_MSG_INVALID_SUBVOL_CHILD, BRB_MSG_SKIP_OBJECT, BRB_MSG_NO_CHILD, + BRB_MSG_CHECKSUM_MISMATCH, BRB_MSG_MARK_CORRUPTED, + BRB_MSG_CRAWLING_FINISH, BRB_MSG_CALC_ERROR, BRB_MSG_LOOKUP_FAILED, + BRB_MSG_PARTIAL_VERSION_PRESENCE, BRB_MSG_MEM_ACNT_FAILED, + BRB_MSG_TIMER_WHEEL_UNAVAILABLE, BRB_MSG_BITROT_LOADED, + BRB_MSG_SCALE_DOWN_FAILED, BRB_MSG_SCALE_UP_FAILED, + BRB_MSG_SCALE_DOWN_SCRUBBER, BRB_MSG_SCALING_UP_SCRUBBER, + BRB_MSG_UNKNOWN_THROTTLE, BRB_MSG_RATE_LIMIT_INFO, + BRB_MSG_SCRUB_INFO, BRB_MSG_CONNECTED_TO_BRICK, BRB_MSG_BRICK_INFO, + BRB_MSG_SUBVOL_CONNECT_FAILED, BRB_MSG_INVALID_SUBVOL, + BRB_MSG_RESCHEDULE_SCRUBBER_FAILED, BRB_MSG_SCRUB_START, + BRB_MSG_SCRUB_FINISH, BRB_MSG_SCRUB_RUNNING, + BRB_MSG_SCRUB_RESCHEDULED, BRB_MSG_SCRUB_TUNABLE, + BRB_MSG_SCRUB_THREAD_CLEANUP, BRB_MSG_SCRUBBER_CLEANED, + BRB_MSG_GENERIC_SSM_INFO, BRB_MSG_ZERO_TIMEOUT_BUG, + BRB_MSG_BAD_OBJ_READDIR_FAIL, BRB_MSG_SSM_FAILED, + BRB_MSG_SCRUB_WAIT_FAILED); #endif /* !_BITROT_BITD_MESSAGES_H_ */ diff --git a/xlators/features/bit-rot/src/bitd/bit-rot-scrub-status.h b/xlators/features/bit-rot/src/bitd/bit-rot-scrub-status.h index 02bd0fab04e..24128b90a66 100644 --- a/xlators/features/bit-rot/src/bitd/bit-rot-scrub-status.h +++ b/xlators/features/bit-rot/src/bitd/bit-rot-scrub-status.h @@ -16,33 +16,33 @@ #include <pthread.h> struct br_scrub_stats { - uint64_t scrubbed_files; /* Total number of scrubbed file */ + uint64_t scrubbed_files; /* Total number of scrubbed file */ - uint64_t unsigned_files; /* Total number of unsigned file */ + uint64_t unsigned_files; /* Total number of unsigned file */ - uint64_t scrub_duration; /* Duration of last scrub */ + uint64_t scrub_duration; /* Duration of last scrub */ - char last_scrub_time[1024]; /*last scrub completion time */ + char last_scrub_time[1024]; /*last scrub completion time */ - struct timeval scrub_start_tv; /* Scrubbing starting time*/ + struct timeval scrub_start_tv; /* Scrubbing starting time*/ - struct timeval scrub_end_tv; /* Scrubbing finishing time */ + struct timeval scrub_end_tv; /* Scrubbing finishing time */ - int8_t scrub_running; /* Scrub running or not */ + int8_t scrub_running; /* Scrub running or not */ - pthread_mutex_t lock; + pthread_mutex_t lock; }; typedef struct br_scrub_stats br_scrub_stats_t; void -br_inc_unsigned_file_count (br_scrub_stats_t *scrub_stat); +br_inc_unsigned_file_count(br_scrub_stats_t *scrub_stat); void -br_inc_scrubbed_file (br_scrub_stats_t *scrub_stat); +br_inc_scrubbed_file(br_scrub_stats_t *scrub_stat); void -br_update_scrub_start_time (br_scrub_stats_t *scrub_stat, struct timeval *tv); +br_update_scrub_start_time(br_scrub_stats_t *scrub_stat, struct timeval *tv); void -br_update_scrub_finish_time (br_scrub_stats_t *scrub_stat, char *timestr, - struct timeval *tv); +br_update_scrub_finish_time(br_scrub_stats_t *scrub_stat, char *timestr, + struct timeval *tv); #endif /* __BIT_ROT_SCRUB_STATUS_H__ */ diff --git a/xlators/features/bit-rot/src/bitd/bit-rot-scrub.h b/xlators/features/bit-rot/src/bitd/bit-rot-scrub.h index 8cc88ec153e..7a3c14abb93 100644 --- a/xlators/features/bit-rot/src/bitd/bit-rot-scrub.h +++ b/xlators/features/bit-rot/src/bitd/bit-rot-scrub.h @@ -14,24 +14,33 @@ #include "xlator.h" #include "bit-rot.h" -void *br_fsscanner (void *); +void * +br_fsscanner(void *); -int32_t br_fsscan_schedule (xlator_t *); -int32_t br_fsscan_reschedule (xlator_t *); -int32_t br_fsscan_activate (xlator_t *); -int32_t br_fsscan_deactivate (xlator_t *); -int32_t br_fsscan_ondemand (xlator_t *); +int32_t +br_fsscan_schedule(xlator_t *); +int32_t +br_fsscan_reschedule(xlator_t *); +int32_t +br_fsscan_activate(xlator_t *); +int32_t +br_fsscan_deactivate(xlator_t *); +int32_t +br_fsscan_ondemand(xlator_t *); -int32_t br_scrubber_handle_options (xlator_t *, br_private_t *, dict_t *); +int32_t +br_scrubber_handle_options(xlator_t *, br_private_t *, dict_t *); int32_t -br_scrubber_monitor_init (xlator_t *, br_private_t *); +br_scrubber_monitor_init(xlator_t *, br_private_t *); -int32_t br_scrubber_init (xlator_t *, br_private_t *); +int32_t +br_scrubber_init(xlator_t *, br_private_t *); -int32_t br_collect_bad_objects_from_children (xlator_t *this, dict_t *dict); +int32_t +br_collect_bad_objects_from_children(xlator_t *this, dict_t *dict); void -br_child_set_scrub_state (br_child_t *, gf_boolean_t); +br_child_set_scrub_state(br_child_t *, gf_boolean_t); #endif /* __BIT_ROT_SCRUB_H__ */ diff --git a/xlators/features/bit-rot/src/bitd/bit-rot-ssm.h b/xlators/features/bit-rot/src/bitd/bit-rot-ssm.h index 8609477180b..f3fbe2928b7 100644 --- a/xlators/features/bit-rot/src/bitd/bit-rot-ssm.h +++ b/xlators/features/bit-rot/src/bitd/bit-rot-ssm.h @@ -14,24 +14,25 @@ #include "xlator.h" typedef enum br_scrub_state { - BR_SCRUB_STATE_INACTIVE = 0, - BR_SCRUB_STATE_PENDING, - BR_SCRUB_STATE_ACTIVE, - BR_SCRUB_STATE_PAUSED, - BR_SCRUB_STATE_IPAUSED, - BR_SCRUB_STATE_STALLED, - BR_SCRUB_MAXSTATES, + BR_SCRUB_STATE_INACTIVE = 0, + BR_SCRUB_STATE_PENDING, + BR_SCRUB_STATE_ACTIVE, + BR_SCRUB_STATE_PAUSED, + BR_SCRUB_STATE_IPAUSED, + BR_SCRUB_STATE_STALLED, + BR_SCRUB_MAXSTATES, } br_scrub_state_t; typedef enum br_scrub_event { - BR_SCRUB_EVENT_SCHEDULE = 0, - BR_SCRUB_EVENT_PAUSE, - BR_SCRUB_EVENT_ONDEMAND, - BR_SCRUB_MAXEVENTS, + BR_SCRUB_EVENT_SCHEDULE = 0, + BR_SCRUB_EVENT_PAUSE, + BR_SCRUB_EVENT_ONDEMAND, + BR_SCRUB_MAXEVENTS, } br_scrub_event_t; struct br_monitor; -int32_t br_scrub_state_machine (xlator_t *, gf_boolean_t); +int32_t +br_scrub_state_machine(xlator_t *, gf_boolean_t); #endif /* __BIT_ROT_SSM_H__ */ diff --git a/xlators/features/bit-rot/src/bitd/bit-rot.h b/xlators/features/bit-rot/src/bitd/bit-rot.h index 670060c8d88..962b4d717e6 100644 --- a/xlators/features/bit-rot/src/bitd/bit-rot.h +++ b/xlators/features/bit-rot/src/bitd/bit-rot.h @@ -37,271 +37,270 @@ #define BR_WORKERS 4 typedef enum scrub_throttle { - BR_SCRUB_THROTTLE_VOID = -1, - BR_SCRUB_THROTTLE_LAZY = 0, - BR_SCRUB_THROTTLE_NORMAL = 1, - BR_SCRUB_THROTTLE_AGGRESSIVE = 2, - BR_SCRUB_THROTTLE_STALLED = 3, + BR_SCRUB_THROTTLE_VOID = -1, + BR_SCRUB_THROTTLE_LAZY = 0, + BR_SCRUB_THROTTLE_NORMAL = 1, + BR_SCRUB_THROTTLE_AGGRESSIVE = 2, + BR_SCRUB_THROTTLE_STALLED = 3, } scrub_throttle_t; typedef enum scrub_freq { - BR_FSSCRUB_FREQ_HOURLY = 1, - BR_FSSCRUB_FREQ_DAILY, - BR_FSSCRUB_FREQ_WEEKLY, - BR_FSSCRUB_FREQ_BIWEEKLY, - BR_FSSCRUB_FREQ_MONTHLY, - BR_FSSCRUB_FREQ_MINUTE, - BR_FSSCRUB_FREQ_STALLED, + BR_FSSCRUB_FREQ_HOURLY = 1, + BR_FSSCRUB_FREQ_DAILY, + BR_FSSCRUB_FREQ_WEEKLY, + BR_FSSCRUB_FREQ_BIWEEKLY, + BR_FSSCRUB_FREQ_MONTHLY, + BR_FSSCRUB_FREQ_MINUTE, + BR_FSSCRUB_FREQ_STALLED, } scrub_freq_t; -#define signature_size(hl) (sizeof (br_isignature_t) + hl + 1) +#define signature_size(hl) (sizeof(br_isignature_t) + hl + 1) struct br_scanfs { - gf_lock_t entrylock; + gf_lock_t entrylock; - pthread_mutex_t waitlock; - pthread_cond_t waitcond; + pthread_mutex_t waitlock; + pthread_cond_t waitcond; - unsigned int entries; - struct list_head queued; - struct list_head ready; + unsigned int entries; + struct list_head queued; + struct list_head ready; }; /* just need three states to track child status */ typedef enum br_child_state { - BR_CHILD_STATE_CONNECTED = 1, - BR_CHILD_STATE_INITIALIZING, - BR_CHILD_STATE_CONNFAILED, - BR_CHILD_STATE_DISCONNECTED, + BR_CHILD_STATE_CONNECTED = 1, + BR_CHILD_STATE_INITIALIZING, + BR_CHILD_STATE_CONNFAILED, + BR_CHILD_STATE_DISCONNECTED, } br_child_state_t; struct br_child { - pthread_mutex_t lock; /* protects child state */ - char witnessed; /* witnessed at least one successful - connection */ - br_child_state_t c_state; /* current state of this child */ + pthread_mutex_t lock; /* protects child state */ + char witnessed; /* witnessed at least one successful + connection */ + br_child_state_t c_state; /* current state of this child */ - char child_up; /* Indicates whether this child is - up or not */ - xlator_t *xl; /* client xlator corresponding to - this child */ - inode_table_t *table; /* inode table for this child */ - char brick_path[PATH_MAX]; /* brick export directory of this - child */ - struct list_head list; /* hook to attach to the list of - UP children */ - xlator_t *this; /* Bit rot xlator */ + char child_up; /* Indicates whether this child is + up or not */ + xlator_t *xl; /* client xlator corresponding to + this child */ + inode_table_t *table; /* inode table for this child */ + char brick_path[PATH_MAX]; /* brick export directory of this + child */ + struct list_head list; /* hook to attach to the list of + UP children */ + xlator_t *this; /* Bit rot xlator */ - pthread_t thread; /* initial crawler for unsigned - object(s) or scrub crawler */ - int threadrunning; /* active thread */ + pthread_t thread; /* initial crawler for unsigned + object(s) or scrub crawler */ + int threadrunning; /* active thread */ - struct mem_pool *timer_pool; /* timer-wheel's timer mem-pool */ + struct mem_pool *timer_pool; /* timer-wheel's timer mem-pool */ - struct timeval tv; + struct timeval tv; - struct br_scanfs fsscan; /* per subvolume FS scanner */ + struct br_scanfs fsscan; /* per subvolume FS scanner */ - gf_boolean_t active_scrubbing; /* Actively scrubbing or not */ + gf_boolean_t active_scrubbing; /* Actively scrubbing or not */ }; typedef struct br_child br_child_t; struct br_obj_n_workers { - struct list_head objects; /* queue of objects expired from the - timer wheel and ready to be picked - up for signing */ - pthread_t workers[BR_WORKERS]; /* Threads which pick up the objects - from the above queue and start - signing each object */ + struct list_head objects; /* queue of objects expired from the + timer wheel and ready to be picked + up for signing */ + pthread_t workers[BR_WORKERS]; /* Threads which pick up the objects + from the above queue and start + signing each object */ }; struct br_scrubber { - xlator_t *this; + xlator_t *this; - scrub_throttle_t throttle; + scrub_throttle_t throttle; - /** - * frequency of scanning for this subvolume. this should - * normally be per-child, but since all children follow the - * same frequency for a volume, this option ends up here - * instead of br_child_t. - */ - scrub_freq_t frequency; + /** + * frequency of scanning for this subvolume. this should + * normally be per-child, but since all children follow the + * same frequency for a volume, this option ends up here + * instead of br_child_t. + */ + scrub_freq_t frequency; - gf_boolean_t frequency_reconf; - gf_boolean_t throttle_reconf; + gf_boolean_t frequency_reconf; + gf_boolean_t throttle_reconf; - pthread_mutex_t mutex; - pthread_cond_t cond; + pthread_mutex_t mutex; + pthread_cond_t cond; - unsigned int nr_scrubbers; - struct list_head scrubbers; + unsigned int nr_scrubbers; + struct list_head scrubbers; - /** - * list of "rotatable" subvolume(s) undergoing scrubbing - */ - struct list_head scrublist; + /** + * list of "rotatable" subvolume(s) undergoing scrubbing + */ + struct list_head scrublist; }; struct br_monitor { - gf_lock_t lock; - pthread_t thread; /* Monitor thread */ - - gf_boolean_t inited; - pthread_mutex_t mutex; - pthread_cond_t cond; /* Thread starts and will be waiting on cond. - First child which is up wakes this up */ - - xlator_t *this; - /* scheduler */ - uint32_t boot; - - int32_t active_child_count; /* Number of children currently scrubbing */ - gf_boolean_t kick; /* This variable tracks the scrubber is - * kicked or not. Both 'kick' and - * 'active_child_count' uses the same pair - * of mutex-cond variable, i.e, wakelock and - * wakecond. */ - - pthread_mutex_t wakelock; - pthread_cond_t wakecond; - - gf_boolean_t done; - pthread_mutex_t donelock; - pthread_cond_t donecond; - - struct gf_tw_timer_list *timer; - br_scrub_state_t state; /* current scrub state */ + gf_lock_t lock; + pthread_t thread; /* Monitor thread */ + + gf_boolean_t inited; + pthread_mutex_t mutex; + pthread_cond_t cond; /* Thread starts and will be waiting on cond. + First child which is up wakes this up */ + + xlator_t *this; + /* scheduler */ + uint32_t boot; + + int32_t active_child_count; /* Number of children currently scrubbing */ + gf_boolean_t kick; /* This variable tracks the scrubber is + * kicked or not. Both 'kick' and + * 'active_child_count' uses the same pair + * of mutex-cond variable, i.e, wakelock and + * wakecond. */ + + pthread_mutex_t wakelock; + pthread_cond_t wakecond; + + gf_boolean_t done; + pthread_mutex_t donelock; + pthread_cond_t donecond; + + struct gf_tw_timer_list *timer; + br_scrub_state_t state; /* current scrub state */ }; typedef struct br_obj_n_workers br_obj_n_workers_t; typedef struct br_private br_private_t; -typedef void (*br_scrubbed_file_update) (br_private_t *priv); +typedef void (*br_scrubbed_file_update)(br_private_t *priv); struct br_private { - pthread_mutex_t lock; + pthread_mutex_t lock; - struct list_head bricks; /* list of bricks from which enents - have been received */ + struct list_head bricks; /* list of bricks from which enents + have been received */ - struct list_head signing; + struct list_head signing; - pthread_cond_t object_cond; /* handling signing of objects */ - int child_count; - br_child_t *children; /* list of subvolumes */ - int up_children; + pthread_cond_t object_cond; /* handling signing of objects */ + int child_count; + br_child_t *children; /* list of subvolumes */ + int up_children; - pthread_cond_t cond; /* handling CHILD_UP notifications */ - pthread_t thread; /* thread for connecting each UP - child with changelog */ + pthread_cond_t cond; /* handling CHILD_UP notifications */ + pthread_t thread; /* thread for connecting each UP + child with changelog */ - struct tvec_base *timer_wheel; /* timer wheel where the objects which - changelog has sent sits and waits - for expiry */ - br_obj_n_workers_t *obj_queue; /* place holder for all the objects - that are expired from timer wheel - and ready to be picked up for - signing and the workers which sign - the objects */ + struct tvec_base *timer_wheel; /* timer wheel where the objects which + changelog has sent sits and waits + for expiry */ + br_obj_n_workers_t *obj_queue; /* place holder for all the objects + that are expired from timer wheel + and ready to be picked up for + signing and the workers which sign + the objects */ - uint32_t expiry_time; /* objects "wait" time */ + uint32_t expiry_time; /* objects "wait" time */ - tbf_t *tbf; /* token bucket filter */ + tbf_t *tbf; /* token bucket filter */ - gf_boolean_t iamscrubber; /* function as a fs scrubber */ + gf_boolean_t iamscrubber; /* function as a fs scrubber */ - struct br_scrub_stats scrub_stat; /* statistics of scrub*/ + struct br_scrub_stats scrub_stat; /* statistics of scrub*/ - struct br_scrubber fsscrub; /* scrubbers for this subvolume */ + struct br_scrubber fsscrub; /* scrubbers for this subvolume */ - struct br_monitor scrub_monitor; /* scrubber monitor */ + struct br_monitor scrub_monitor; /* scrubber monitor */ }; struct br_object { - xlator_t *this; + xlator_t *this; - uuid_t gfid; + uuid_t gfid; - unsigned long signedversion; /* version against which this object will - be signed */ - br_child_t *child; /* object's subvolume */ + unsigned long signedversion; /* version against which this object will + be signed */ + br_child_t *child; /* object's subvolume */ - int sign_info; + int sign_info; - struct list_head list; /* hook to add to the queue once the - object is expired from timer wheel */ - void *data; + struct list_head list; /* hook to add to the queue once the + object is expired from timer wheel */ + void *data; }; typedef struct br_object br_object_t; -typedef int32_t (br_scrub_ssm_call) (xlator_t *); +typedef int32_t(br_scrub_ssm_call)(xlator_t *); void -br_log_object (xlator_t *, char *, uuid_t, int32_t); +br_log_object(xlator_t *, char *, uuid_t, int32_t); void -br_log_object_path (xlator_t *, char *, const char *, int32_t); +br_log_object_path(xlator_t *, char *, const char *, int32_t); int32_t -br_calculate_obj_checksum (unsigned char *, - br_child_t *, fd_t *, struct iatt *); +br_calculate_obj_checksum(unsigned char *, br_child_t *, fd_t *, struct iatt *); int32_t -br_prepare_loc (xlator_t *, br_child_t *, loc_t *, gf_dirent_t *, loc_t *); +br_prepare_loc(xlator_t *, br_child_t *, loc_t *, gf_dirent_t *, loc_t *); gf_boolean_t -bitd_is_bad_file (xlator_t *, br_child_t *, loc_t *, fd_t *); +bitd_is_bad_file(xlator_t *, br_child_t *, loc_t *, fd_t *); static inline void -_br_set_child_state (br_child_t *child, br_child_state_t state) +_br_set_child_state(br_child_t *child, br_child_state_t state) { - child->c_state = state; + child->c_state = state; } static inline int -_br_is_child_connected (br_child_t *child) +_br_is_child_connected(br_child_t *child) { - return (child->c_state == BR_CHILD_STATE_CONNECTED); + return (child->c_state == BR_CHILD_STATE_CONNECTED); } static inline int -_br_is_child_scrub_active (br_child_t *child) +_br_is_child_scrub_active(br_child_t *child) { - return child->active_scrubbing; + return child->active_scrubbing; } static inline int -_br_child_failed_conn (br_child_t *child) +_br_child_failed_conn(br_child_t *child) { - return (child->c_state == BR_CHILD_STATE_CONNFAILED); + return (child->c_state == BR_CHILD_STATE_CONNFAILED); } static inline int -_br_child_witnessed_connection (br_child_t *child) +_br_child_witnessed_connection(br_child_t *child) { - return (child->witnessed == 1); + return (child->witnessed == 1); } /* scrub state */ static inline void -_br_monitor_set_scrub_state (struct br_monitor *scrub_monitor, - br_scrub_state_t state) +_br_monitor_set_scrub_state(struct br_monitor *scrub_monitor, + br_scrub_state_t state) { - scrub_monitor->state = state; + scrub_monitor->state = state; } static inline br_scrub_event_t -_br_child_get_scrub_event (struct br_scrubber *fsscrub) +_br_child_get_scrub_event(struct br_scrubber *fsscrub) { - return (fsscrub->frequency == BR_FSSCRUB_FREQ_STALLED) - ? BR_SCRUB_EVENT_PAUSE : BR_SCRUB_EVENT_SCHEDULE; + return (fsscrub->frequency == BR_FSSCRUB_FREQ_STALLED) + ? BR_SCRUB_EVENT_PAUSE + : BR_SCRUB_EVENT_SCHEDULE; } int32_t -br_get_bad_objects_list (xlator_t *this, dict_t **dict); - +br_get_bad_objects_list(xlator_t *this, dict_t **dict); #endif /* __BIT_ROT_H__ */ |