From 33e0df30cbffbfbda5197704d0f788c83cd7ed78 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Thu, 31 Oct 2013 06:35:47 +0530 Subject: cluster/dht: instruct marker whenever it shouldn't do accounting This is needed for two reasons: * since dht-linkfiles are internal, they shouldn't be accounted. * hardlink handling in marker is broken. link/unlink of hardlinks present in same directory can break marker accounting. Hence, if src and dst are in same directory in case of rename, dht - if it breaks rename into link/unlink operations - should instruct marker to not to do accounting. Change-Id: I9c9f7384569f75a2792f6450ee7a5279bf751ae7 BUG: 1022995 Signed-off-by: Raghavendra G Reviewed-on: http://review.gluster.org/6203 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/features/marker/src/marker.c | 42 ++---------------------------------- 1 file changed, 2 insertions(+), 40 deletions(-) (limited to 'xlators/features/marker') diff --git a/xlators/features/marker/src/marker.c b/xlators/features/marker/src/marker.c index e448bc08f..dbe9d530f 100644 --- a/xlators/features/marker/src/marker.c +++ b/xlators/features/marker/src/marker.c @@ -819,37 +819,6 @@ out: } -int32_t -marker_unlink_stat_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf, - dict_t *xdata) -{ - marker_local_t *local = NULL; - - local = frame->local; - if (op_ret < 0) { - goto err; - } - - if (local == NULL) { - op_errno = EINVAL; - goto err; - } - - local->ia_nlink = buf->ia_nlink; - - STACK_WIND (frame, marker_unlink_cbk, FIRST_CHILD(this), - FIRST_CHILD(this)->fops->unlink, &local->loc, local->xflag, - local->xdata); - return 0; -err: - frame->local = NULL; - STACK_UNWIND_STRICT (unlink, frame, -1, op_errno, NULL, NULL, NULL); - marker_local_unref (local); - return 0; -} - - int32_t marker_unlink (call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag, dict_t *xdata) @@ -874,18 +843,11 @@ marker_unlink (call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag, if (ret == -1) goto err; - if (xdata && dict_get (xdata, GLUSTERFS_INTERNAL_FOP_KEY)) { + if (xdata && dict_get (xdata, GLUSTERFS_MARKER_DONT_ACCOUNT_KEY)) { local->skip_txn = 1; goto unlink_wind; } - if (uuid_is_null (loc->gfid) && loc->inode) - uuid_copy (loc->gfid, loc->inode->gfid); - - STACK_WIND (frame, marker_unlink_stat_cbk, FIRST_CHILD(this), - FIRST_CHILD(this)->fops->stat, loc, xdata); - return 0; - unlink_wind: STACK_WIND (frame, marker_unlink_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->unlink, loc, xflag, xdata); @@ -960,7 +922,7 @@ marker_link (call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc, if (ret == -1) goto err; - if (xdata && dict_get (xdata, GLUSTERFS_INTERNAL_FOP_KEY)) + if (xdata && dict_get (xdata, GLUSTERFS_MARKER_DONT_ACCOUNT_KEY)) local->skip_txn = 1; wind: STACK_WIND (frame, marker_link_cbk, FIRST_CHILD(this), -- cgit