summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/features/marker/src/marker-quota.c7
-rw-r--r--xlators/features/marker/src/marker-quota.h2
-rw-r--r--xlators/features/marker/src/marker.c17
3 files changed, 18 insertions, 8 deletions
diff --git a/xlators/features/marker/src/marker-quota.c b/xlators/features/marker/src/marker-quota.c
index 5fe8ab010da..acc13dfee38 100644
--- a/xlators/features/marker/src/marker-quota.c
+++ b/xlators/features/marker/src/marker-quota.c
@@ -1894,7 +1894,7 @@ init_quota_priv (xlator_t *this)
int32_t
-quota_rename_update_newpath (xlator_t *this, loc_t *loc, inode_t *inode)
+quota_rename_update_newpath (xlator_t *this, loc_t *loc)
{
int32_t ret = -1;
quota_inode_ctx_t *ctx = NULL;
@@ -1902,10 +1902,7 @@ quota_rename_update_newpath (xlator_t *this, loc_t *loc, inode_t *inode)
GF_VALIDATE_OR_GOTO ("marker", this, out);
GF_VALIDATE_OR_GOTO ("marker", loc, out);
- GF_VALIDATE_OR_GOTO ("marker", inode, out);
-
- if (loc->inode == NULL)
- loc->inode = inode_ref (inode);
+ GF_VALIDATE_OR_GOTO ("marker", loc->inode, out);
ret = quota_inode_ctx_get (loc->inode, this, &ctx);
if (ret < 0)
diff --git a/xlators/features/marker/src/marker-quota.h b/xlators/features/marker/src/marker-quota.h
index c6ca5bbabb1..2eecd83e8e1 100644
--- a/xlators/features/marker/src/marker-quota.h
+++ b/xlators/features/marker/src/marker-quota.h
@@ -162,7 +162,7 @@ int32_t
reduce_parent_size (xlator_t *, loc_t *);
int32_t
-quota_rename_update_newpath (xlator_t *, loc_t *, inode_t *);
+quota_rename_update_newpath (xlator_t *, loc_t *);
int32_t
quota_forget (xlator_t *, quota_inode_ctx_t *);
diff --git a/xlators/features/marker/src/marker.c b/xlators/features/marker/src/marker.c
index 640e6faf51e..940dc43f4a2 100644
--- a/xlators/features/marker/src/marker.c
+++ b/xlators/features/marker/src/marker.c
@@ -895,6 +895,7 @@ marker_rename_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
marker_conf_t *priv = NULL;
marker_local_t *local = NULL;
marker_local_t *oplocal = NULL;
+ loc_t newloc = {0, };
if (op_ret == -1) {
gf_log (this->name, GF_LOG_TRACE, "%s occured while "
@@ -918,8 +919,20 @@ marker_rename_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (priv->feature_enabled & GF_QUOTA) {
reduce_parent_size (this, &oplocal->loc);
- quota_rename_update_newpath (this, &local->loc,
- oplocal->loc.inode);
+
+ if (local->loc.inode != NULL) {
+ reduce_parent_size (this, &local->loc);
+ }
+
+ newloc.inode = inode_ref (oplocal->loc.inode);
+ newloc.path = gf_strdup (local->loc.path);
+ newloc.name = gf_strdup (local->loc.name);
+ newloc.parent = inode_ref (local->loc.parent);
+ newloc.ino = oplocal->loc.inode->ino;
+
+ quota_rename_update_newpath (this, &newloc);
+
+ loc_wipe (&newloc);
}
if (priv->feature_enabled & GF_XTIME) {