summaryrefslogtreecommitdiffstats
path: root/xlators/features/marker/src/marker-quota.c
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendrabhat@gluster.com>2012-01-30 19:34:03 +0530
committerVijay Bellur <vijay@gluster.com>2012-02-02 19:33:11 -0800
commitb1a884aae98927d847085c9794f8b4aa8bebf838 (patch)
tree266769c49e0912064e723e442ffb6652f8e714b1 /xlators/features/marker/src/marker-quota.c
parentc3aa99d907591f72b6302287b9b8899514fb52f1 (diff)
features/marker,quota: Incorporate changes to support nameless lookup
Change-Id: Ic5f00a9891bd835ebee5a3e103ef0f75d0b7fc25 BUG: 783925 Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com> Reviewed-on: http://review.gluster.com/2702 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'xlators/features/marker/src/marker-quota.c')
-rw-r--r--xlators/features/marker/src/marker-quota.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/xlators/features/marker/src/marker-quota.c b/xlators/features/marker/src/marker-quota.c
index 6f324aca361..bc5fc60402b 100644
--- a/xlators/features/marker/src/marker-quota.c
+++ b/xlators/features/marker/src/marker-quota.c
@@ -179,6 +179,7 @@ mq_loc_fill_from_name (xlator_t *this, loc_t *newloc, loc_t *oldloc,
}
newloc->parent = inode_ref (oldloc->inode);
+ uuid_copy (newloc->pargfid, oldloc->inode->gfid);
len = strlen (oldloc->path);
@@ -307,6 +308,10 @@ wind:
if (ret)
goto err;
+ if (uuid_is_null (local->loc.gfid))
+ uuid_copy (local->loc.gfid, local->loc.inode->gfid);
+
+ GF_UUID_ASSERT (local->loc.gfid);
STACK_WIND (frame, mq_release_lock_on_dirty_inode,
FIRST_CHILD(this),
FIRST_CHILD(this)->fops->setxattr,
@@ -373,6 +378,11 @@ mq_update_size_xattr (call_frame_t *frame, void *cookie, xlator_t *this,
if (ret)
goto err;
+ if (uuid_is_null (local->loc.gfid))
+ uuid_copy (local->loc.gfid, local->loc.inode->gfid);
+
+ GF_UUID_ASSERT (local->loc.gfid);
+
STACK_WIND (frame, mq_mark_inode_undirty, FIRST_CHILD(this),
FIRST_CHILD(this)->fops->xattrop, &local->loc,
GF_XATTROP_ADD_ARRAY64, new_dict);
@@ -434,6 +444,11 @@ mq_get_dirty_inode_size (call_frame_t *frame, xlator_t *this)
if (ret)
goto err;
+ if (uuid_is_null (local->loc.gfid))
+ uuid_copy (local->loc.gfid, local->loc.inode->gfid);
+
+ GF_UUID_ASSERT (local->loc.gfid);
+
STACK_WIND (frame, mq_update_size_xattr, FIRST_CHILD(this),
FIRST_CHILD(this)->fops->lookup, &local->loc, dict);
ret =0;
@@ -748,6 +763,10 @@ mq_check_if_still_dirty (call_frame_t *frame,
local->d_off = 0;
+ if (uuid_is_null (local->loc.gfid))
+ uuid_copy (local->loc.gfid, local->loc.inode->gfid);
+
+ GF_UUID_ASSERT (local->loc.gfid);
STACK_WIND(frame,
mq_dirty_inode_readdir,
FIRST_CHILD(this),
@@ -794,6 +813,11 @@ mq_get_dirty_xattr (call_frame_t *frame, void *cookie,
if (ret)
goto err;
+ if (uuid_is_null (local->loc.gfid))
+ uuid_copy (local->loc.gfid, local->loc.inode->gfid);
+
+ GF_UUID_ASSERT (local->loc.gfid);
+
STACK_WIND (frame,
mq_check_if_still_dirty,
FIRST_CHILD(this),
@@ -956,6 +980,9 @@ mq_create_dirty_xattr (call_frame_t *frame, void *cookie, xlator_t *this,
goto err;
}
+ uuid_copy (local->loc.gfid, local->loc.inode->gfid);
+ GF_UUID_ASSERT (local->loc.gfid);
+
STACK_WIND (frame, mq_xattr_creation_release_lock,
FIRST_CHILD(this),
FIRST_CHILD(this)->fops->setxattr,
@@ -1030,6 +1057,9 @@ mq_create_xattr (xlator_t *this, call_frame_t *frame)
goto free_value;
}
+ uuid_copy (local->loc.gfid, local->loc.inode->gfid);
+ GF_UUID_ASSERT (local->loc.gfid);
+
STACK_WIND (frame, mq_create_dirty_xattr, FIRST_CHILD(this),
FIRST_CHILD(this)->fops->xattrop, &local->loc,
GF_XATTROP_ADD_ARRAY64, dict);
@@ -1129,6 +1159,11 @@ mq_get_xattr (call_frame_t *frame, void *cookie, xlator_t *this,
goto err;
}
+ if (uuid_is_null (local->loc.gfid))
+ uuid_copy (local->loc.gfid, local->loc.inode->gfid);
+
+ GF_UUID_ASSERT (local->loc.gfid);
+
STACK_WIND (frame, mq_check_n_set_inode_xattr, FIRST_CHILD(this),
FIRST_CHILD(this)->fops->lookup, &local->loc, xattr_req);
@@ -1434,6 +1469,9 @@ mq_mark_undirty (call_frame_t *frame,
goto err;
}
+ uuid_copy (local->parent_loc.gfid, local->parent_loc.inode->gfid);
+ GF_UUID_ASSERT (local->parent_loc.gfid);
+
STACK_WIND (frame, mq_release_parent_lock,
FIRST_CHILD(this),
FIRST_CHILD(this)->fops->setxattr,
@@ -1516,6 +1554,11 @@ mq_update_parent_size (call_frame_t *frame,
goto err;
}
+ if (uuid_is_null (local->parent_loc.gfid))
+ uuid_copy (local->parent_loc.gfid,
+ local->parent_loc.inode->gfid);
+ GF_UUID_ASSERT (local->parent_loc.gfid);
+
STACK_WIND (frame,
mq_mark_undirty,
FIRST_CHILD(this),
@@ -1637,6 +1680,11 @@ unlock:
goto err;
}
+ if (uuid_is_null (local->loc.gfid))
+ uuid_copy (local->loc.gfid, local->loc.inode->gfid);
+
+ GF_UUID_ASSERT (local->loc.gfid);
+
STACK_WIND (frame,
mq_update_parent_size,
FIRST_CHILD(this),
@@ -1728,6 +1776,11 @@ mq_fetch_child_size_and_contri (call_frame_t *frame, void *cookie,
mq_set_ctx_updation_status (local->ctx, _gf_false);
+ if (uuid_is_null (local->loc.gfid))
+ uuid_copy (local->loc.gfid, local->loc.inode->gfid);
+
+ GF_UUID_ASSERT (local->loc.gfid);
+
STACK_WIND (frame, mq_update_inode_contribution, FIRST_CHILD(this),
FIRST_CHILD(this)->fops->lookup, &local->loc, newdict);
@@ -1785,6 +1838,10 @@ mq_markdirty (call_frame_t *frame, void *cookie,
if (ret == -1)
goto err;
+ uuid_copy (local->parent_loc.gfid,
+ local->parent_loc.inode->gfid);
+ GF_UUID_ASSERT (local->parent_loc.gfid);
+
STACK_WIND (frame, mq_fetch_child_size_and_contri,
FIRST_CHILD(this),
FIRST_CHILD(this)->fops->setxattr,
@@ -2298,6 +2355,9 @@ mq_reduce_parent_size_xattr (call_frame_t *frame, void *cookie,
if (ret < 0)
goto err;
+ uuid_copy (local->parent_loc.gfid,
+ local->parent_loc.inode->gfid);
+ GF_UUID_ASSERT (local->parent_loc.gfid);
STACK_WIND (frame, mq_inode_remove_done, FIRST_CHILD(this),
FIRST_CHILD(this)->fops->xattrop, &local->parent_loc,