diff options
| author | Pranith Kumar K <pkarampu@redhat.com> | 2015-03-06 14:36:52 +0530 |
|---|---|---|
| committer | Raghavendra Bhat <raghavendra@redhat.com> | 2015-03-14 03:13:45 -0700 |
| commit | fe416a671dd6b6ce8cb4d94e64154491a148993c (patch) | |
| tree | 8aa972b9734e081368989d95325a3689cbcf5ef8 /xlators/cluster/afr/src/afr-common.c | |
| parent | bd775bf495bca79ed5fec72450cd884f5a734221 (diff) | |
cluster/afr: Handle getxattr of quota-size key
Backport of http://review.gluster.org/9820
Afr needs to query QUOTA_SIZE_KEY from all the subvolumes and return the
value which is maximum of the readable bricks.
BUG: 1201624
Change-Id: I41725a7323020c1480c38560dc5ae2c2e82d6d47
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/9873
Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra Bhat <raghavendra@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 69e13078652..fde86a459a7 100644 --- a/xlators/cluster/afr/src/afr-common.c +++ b/xlators/cluster/afr/src/afr-common.c @@ -1086,65 +1086,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, |
