diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2015-03-06 14:36:52 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2015-03-09 02:40:53 -0700 |
commit | 5ab4a17a63acf7215e9dc98276e7547ae527a5a7 (patch) | |
tree | dee953cca4190f2a1ffee54681ac17b848fd1a63 /xlators/cluster/afr/src/afr-common.c | |
parent | 3ceb64f3bd0919c556829c7297e67fb3ba40eaa9 (diff) |
cluster/afr: Handle getxattr of quota-size key
Afr needs to query QUOTA_SIZE_KEY from all the subvolumes and return the
value which is maximum of the readable bricks.
Change-Id: Ibb9064c8652aea0d984796e7a06f8adca72aa971
BUG: 1199431
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/9820
Reviewed-by: Anuradha Talur <atalur@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-common.c')
-rw-r--r-- | xlators/cluster/afr/src/afr-common.c | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c index a28cbf4a2a9..92ecb7fb99b 100644 --- a/xlators/cluster/afr/src/afr-common.c +++ b/xlators/cluster/afr/src/afr-common.c @@ -1092,65 +1092,6 @@ afr_is_entry_possibly_under_txn (afr_local_t *local, xlator_t *this) } -/* - * Quota size xattrs are not maintained by afr. There is a - * possibility that they differ even when both the directory changelog xattrs - * suggest everything is fine. So if there is at least one 'source' check among - * the sources which has the maximum quota size. Otherwise check among all the - * available ones for maximum quota size. This way if there is a source and - * stale copies it always votes for the 'source'. - * */ - -static void -afr_handle_quota_size (call_frame_t *frame, xlator_t *this) -{ - unsigned char *readable = NULL; - afr_local_t *local = NULL; - afr_private_t *priv = NULL; - struct afr_reply *replies = NULL; - int i = 0; - uint64_t size = 0; - uint64_t max_size = 0; - int readable_cnt = 0; - - local = frame->local; - priv = this->private; - replies = local->replies; - - readable = alloca0 (priv->child_count); - - afr_inode_read_subvol_get (local->inode, this, readable, 0, 0); - - readable_cnt = AFR_COUNT (readable, priv->child_count); - - for (i = 0; i < priv->child_count; i++) { - if (!replies[i].valid || replies[i].op_ret == -1) - continue; - if (readable_cnt && !readable[i]) - continue; - if (!replies[i].xdata) - continue; - if (dict_get_uint64 (replies[i].xdata, QUOTA_SIZE_KEY, &size)) - continue; - if (size > max_size) - max_size = size; - } - - if (!max_size) - return; - - for (i = 0; i < priv->child_count; i++) { - if (!replies[i].valid || replies[i].op_ret == -1) - continue; - if (readable_cnt && !readable[i]) - continue; - if (!replies[i].xdata) - continue; - if (dict_set_uint64 (replies[i].xdata, QUOTA_SIZE_KEY, max_size)) - continue; - } -} - static char *afr_ignore_xattrs[] = { GLUSTERFS_OPEN_FD_COUNT, GLUSTERFS_PARENT_ENTRYLK, |