diff options
author | Anuradha <atalur@redhat.com> | 2014-09-03 19:04:02 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2014-09-18 11:05:47 -0700 |
commit | acc0b3f93e74e914ee345e9e89619c8411596bdf (patch) | |
tree | 14a35cd56cae70fbe433cb5b4e073dce5065d0eb /xlators/cluster/afr/src/afr.h | |
parent | 8f4c223c5f7a7a06c3b73dbb94e85d271bd84fb5 (diff) |
cluster/afr : Mark pending changelog xattrs for new creations
Backport of: http://review.gluster.org/8555
Based on type of file, set appropriate pending changelogs
for new entries.
Change-Id: Icf9af866fe9a9e511210e8ad097e968e2307d8ee
BUG: 1141787
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>
Signed-off-by: Anuradha <atalur@redhat.com>
Reviewed-on: http://review.gluster.org/8748
Reviewed-by: Vijay Bellur <vbellur@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 6348f7cd999..e19ceac3653 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; @@ -940,6 +952,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); |