diff options
author | Anuradha <atalur@redhat.com> | 2014-09-03 19:04:02 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2014-09-03 10:30:26 -0700 |
commit | 6064c220844e8c4963e22ec48c8f7da9da57fc2f (patch) | |
tree | 9f5be98553d381783cab091650a739db8a100bb2 /xlators/cluster/afr/src/afr.h | |
parent | bb2d5f49b5684e6484af16a580870cfe104aecd2 (diff) |
cluster/afr : Mark pending changelog xattrs for new creations
Based on type of file, set appropriate pending changelogs
for new entries.
Change-Id: Ifd124bf9bc54b996ce83ab9f39d03b3ccca7eb3c
BUG: 1130892
Signed-off-by: Anuradha <atalur@redhat.com>
Reviewed-on: http://review.gluster.org/8555
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr.h')
-rw-r--r-- | xlators/cluster/afr/src/afr.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h index 8e7bea79712..4adbd5d5c83 100644 --- a/xlators/cluster/afr/src/afr.h +++ b/xlators/cluster/afr/src/afr.h @@ -187,6 +187,18 @@ afr_index_for_transaction_type (afr_transaction_type type) return -1; /* make gcc happy */ } +static inline int +afr_index_from_ia_type (ia_type_t type) +{ + switch (type) { + case IA_IFDIR: + return afr_index_for_transaction_type (AFR_ENTRY_TRANSACTION); + case IA_IFREG: + return afr_index_for_transaction_type (AFR_DATA_TRANSACTION); + default: return -1; + } +} + typedef struct { loc_t loc; char *basename; @@ -935,6 +947,10 @@ afr_matrix_cleanup (int32_t **pending, unsigned int m); int32_t** afr_matrix_create (unsigned int m, unsigned int n); +int** +afr_mark_pending_changelog (afr_private_t *priv, unsigned char *pending, + dict_t *xattr, ia_type_t iat); + void afr_filter_xattrs (dict_t *xattr); |