diff options
author | Vijay Bellur <vbellur@redhat.com> | 2013-08-15 00:44:25 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2013-08-15 00:48:04 +0530 |
commit | 4c492eba4a58d69770d4022e46058107c24abfdf (patch) | |
tree | 7e4ec0f9627309c2042291caa43099c99dda5759 | |
parent | c0aa8619ca9628e2f989272d1e90a01ce1ab282e (diff) |
features/marker: Rename friendly changes
Also contains parts of http://review.gluster.org/5389 which have not
yet been pulled in.
Change-Id: I9fca5f2082b86da357478e6adde52c5a0abacd39
Signed-off-by: Vijay Bellur <vbellur@redhat.com>
-rw-r--r-- | xlators/features/marker/src/marker-quota.c | 8 | ||||
-rw-r--r-- | xlators/features/marker/src/marker.c | 21 | ||||
-rw-r--r-- | xlators/features/marker/src/marker.h | 1 |
3 files changed, 23 insertions, 7 deletions
diff --git a/xlators/features/marker/src/marker-quota.c b/xlators/features/marker/src/marker-quota.c index f627011f..fea7c5f0 100644 --- a/xlators/features/marker/src/marker-quota.c +++ b/xlators/features/marker/src/marker-quota.c @@ -2233,8 +2233,12 @@ mq_inspect_file_xattr (xlator_t *this, if (size != contri_int) { mq_initiate_quota_txn (this, loc); } - } else - mq_initiate_quota_txn (this, loc); + } else { + if (size) + mq_initiate_quota_txn (this, loc); + else + mq_set_inode_xattr (this, loc); + } } out: diff --git a/xlators/features/marker/src/marker.c b/xlators/features/marker/src/marker.c index cd798b3f..28599b2e 100644 --- a/xlators/features/marker/src/marker.c +++ b/xlators/features/marker/src/marker.c @@ -802,8 +802,10 @@ marker_unlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this, priv = this->private; - if (priv->feature_enabled & GF_QUOTA) - mq_reduce_parent_size (this, &local->loc, -1); + if (priv->feature_enabled & GF_QUOTA) { + if (!local->skip_txn) + mq_reduce_parent_size (this, &local->loc, -1); + } if (priv->feature_enabled & GF_XTIME) marker_xtime_update_marks (this, local); @@ -869,6 +871,9 @@ 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)) + local->skip_txn = 1; + if (uuid_is_null (loc->gfid) && loc->inode) uuid_copy (loc->gfid, loc->inode->gfid); @@ -914,8 +919,11 @@ marker_link_cbk (call_frame_t *frame, void *cookie, xlator_t *this, priv = this->private; - if (priv->feature_enabled & GF_QUOTA) - mq_initiate_quota_txn (this, &local->loc); + if (priv->feature_enabled & GF_QUOTA) { + if (!local->skip_txn) + mq_set_inode_xattr (this, &local->loc); + } + if (priv->feature_enabled & GF_XTIME) marker_xtime_update_marks (this, local); @@ -946,6 +954,9 @@ 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)) + local->skip_txn = 1; wind: STACK_WIND (frame, marker_link_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->link, oldloc, newloc, xdata); @@ -1006,7 +1017,7 @@ marker_rename_done (call_frame_t *frame, void *cookie, xlator_t *this, newloc.name++; newloc.parent = inode_ref (local->loc.parent); - mq_rename_update_newpath (this, &newloc); + mq_set_inode_xattr (this, &newloc); loc_wipe (&newloc); diff --git a/xlators/features/marker/src/marker.h b/xlators/features/marker/src/marker.h index 2f1feeee..60e58fb0 100644 --- a/xlators/features/marker/src/marker.h +++ b/xlators/features/marker/src/marker.h @@ -111,6 +111,7 @@ struct marker_local{ int xflag; dict_t *xdata; + gf_boolean_t skip_txn; }; typedef struct marker_local marker_local_t; |