diff options
author | Pranith K <pranithk@gluster.com> | 2011-07-14 06:30:20 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2011-10-19 02:28:02 -0700 |
commit | 94943e213a61c83481308dba6adc6b23c3581d2e (patch) | |
tree | a1664c9d3e16d6278d996f4f8c148ffcef39acf6 /xlators/cluster/afr/src/afr.h | |
parent | 449f31c8ae8f1e6df787cfc1d1203ba7f0312cb6 (diff) |
cluster/afr: Fix conflict files and gfids
Change-Id: I771045aca9f9a811744aeec0d844609a37ae4792
BUG: 3734
Reviewed-on: http://review.gluster.com/611
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr.h')
-rw-r--r-- | xlators/cluster/afr/src/afr.h | 77 |
1 files changed, 76 insertions, 1 deletions
diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h index 8f7f54faf..bc85fd71d 100644 --- a/xlators/cluster/afr/src/afr.h +++ b/xlators/cluster/afr/src/afr.h @@ -37,6 +37,17 @@ struct _pump_private; +typedef int (*afr_expunge_done_cbk_t) (call_frame_t *frame, xlator_t *this, + int child, int32_t op_error, + int32_t op_errno); + +typedef int (*afr_impunge_done_cbk_t) (call_frame_t *frame, xlator_t *this, + int child, int32_t op_error, + int32_t op_errno); +typedef int (*afr_post_remove_call_t) (call_frame_t *frame, xlator_t *this); + +typedef int (*afr_lock_cbk_t) (call_frame_t *frame, xlator_t *this); + typedef struct _afr_private { gf_lock_t lock; /* to guard access to child_count, etc */ unsigned int child_count; /* total number of children */ @@ -101,9 +112,12 @@ typedef struct { /* External interface: These are variables (some optional) that are set by whoever has triggered self-heal */ + inode_t *inode; gf_boolean_t need_data_self_heal; gf_boolean_t need_metadata_self_heal; gf_boolean_t need_entry_self_heal; + gf_boolean_t need_gfid_self_heal; + gf_boolean_t need_missing_entry_self_heal; gf_boolean_t forced_merge; /* Is this a self-heal triggered to forcibly merge the directories? */ @@ -121,20 +135,28 @@ typedef struct { ia_type_t type; /* st_mode of the entry we're doing self-heal on */ + uuid_t sh_gfid_req; /* gfid self-heal needs to be done + with this gfid if it is not null */ /* Function to call to unwind. If self-heal is being done in the background, this function will be called as soon as possible. */ - int (*unwind) (call_frame_t *frame, xlator_t *this); + int (*unwind) (call_frame_t *frame, xlator_t *this, int32_t op_ret, + int32_t op_errno); /* End of external interface members */ /* array of stat's, one for each child */ struct iatt *buf; + struct iatt *parentbufs; struct iatt parentbuf; struct iatt entrybuf; + afr_expunge_done_cbk_t expunge_done; + afr_impunge_done_cbk_t impunge_done; + int32_t impunge_ret_child; + /* array of xattr's, one for each child */ dict_t **xattr; @@ -142,12 +164,19 @@ typedef struct { */ int32_t *child_success; int success_count; + /* array containing the fresh children found in the self-heal process */ + int32_t *fresh_children; + /* array containing the fresh children found in the parent lookup */ + int32_t *fresh_parent_dirs; /* array of errno's, one for each child */ int *child_errno; int32_t **pending_matrix; int32_t **delta_matrix; + int32_t op_ret; + int32_t op_errno; + int *sources; int source; int active_source; @@ -165,6 +194,7 @@ typedef struct { blksize_t block_size; off_t file_size; off_t offset; + afr_post_remove_call_t post_remove_call; loc_t parent_loc; @@ -179,6 +209,7 @@ typedef struct { int (*completion_cbk) (call_frame_t *frame, xlator_t *this); int (*algo_completion_cbk) (call_frame_t *frame, xlator_t *this); int (*algo_abort_cbk) (call_frame_t *frame, xlator_t *this); + void (*gfid_sh_success_cbk) (call_frame_t *sh_frame, xlator_t *this); call_frame_t *sh_frame; } afr_self_heal_t; @@ -343,6 +374,7 @@ typedef struct _afr_local { } statfs; struct { + uuid_t gfid_req; inode_t *inode; struct iatt buf; struct iatt postparent; @@ -958,4 +990,47 @@ int32_t afr_marker_getxattr (call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name,afr_local_t *local, afr_private_t *priv ); +void +afr_get_fresh_children (int32_t *success_children, int32_t *sources, + int32_t *fresh_children, unsigned int child_count); +void +afr_fresh_children_add_child (int32_t *fresh_children, int32_t child, + int32_t child_count); +void +afr_reset_children (int32_t *fresh_children, int32_t child_count); +gf_boolean_t +afr_error_more_important (int32_t old_errno, int32_t new_errno); +int +afr_errno_count (int32_t *children, int *child_errno, + unsigned int child_count, int32_t op_errno); +int +afr_get_children_count (int32_t *fresh_children, unsigned int child_count); +gf_boolean_t +afr_is_child_present (int32_t *success_children, int32_t child_count, + int32_t child); +void +afr_update_gfid_from_iatts (uuid_t uuid, struct iatt *bufs, + int32_t *success_children, + unsigned int child_count); +void +afr_reset_xattr (dict_t **xattr, unsigned int child_count); +gf_boolean_t +afr_conflicting_iattrs (struct iatt *bufs, int32_t *success_children, + unsigned int child_count, const char *path, + const char *xlator_name); +int +afr_gfid_missing_count (const char *xlator_name, int32_t *children, + struct iatt *bufs, unsigned int child_count, + const char *path); +void +afr_xattr_req_prepare (xlator_t *this, dict_t *xattr_req, const char *path); +void +afr_children_copy (int32_t *dst, int32_t *src, unsigned int child_count); +afr_transaction_type +afr_transaction_type_get (ia_type_t ia_type); +int32_t +afr_resultant_errno_get (int32_t *children, + int *child_errno, unsigned int child_count); +int32_t* +afr_fresh_children_create (int32_t child_count); #endif /* __AFR_H__ */ |