summaryrefslogtreecommitdiffstats
path: root/xlators/features/marker/src
diff options
context:
space:
mode:
authorVijay Bellur <vijay@gluster.com>2012-02-23 01:25:47 +0530
committerVijay Bellur <vijay@gluster.com>2012-02-22 23:16:59 -0800
commit4ac06a16999bde2f9860f6a8713e7f2544b44f9a (patch)
treea6350e3ac9bfbf340c6df9e57c64df054f3d8bdd /xlators/features/marker/src
parent72187f8e02e7d3aa17636ade033482e4de41657a (diff)
features/marker: Use loc.inode to obtain parent if loc.parent isn't set.
Change-Id: I89dddb19168a3ffb269afc9f6bcb2d7e7c9a69cd BUG: 790389 Signed-off-by: Vijay Bellur <vijay@gluster.com> Reviewed-on: http://review.gluster.com/2802 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra Bhat <raghavendrabhat@gluster.com>
Diffstat (limited to 'xlators/features/marker/src')
-rw-r--r--xlators/features/marker/src/marker.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/xlators/features/marker/src/marker.c b/xlators/features/marker/src/marker.c
index 7f961006634..f2999934089 100644
--- a/xlators/features/marker/src/marker.c
+++ b/xlators/features/marker/src/marker.c
@@ -126,8 +126,17 @@ marker_trav_parent (marker_local_t *local)
{
int32_t ret = 0;
loc_t loc = {0, };
+ inode_t *parent = NULL;
+ int8_t need_unref = 0;
- ret = marker_inode_loc_fill (local->loc.parent, &loc);
+ if (!local->loc.parent) {
+ parent = inode_parent (local->loc.inode, NULL, NULL);
+ if (parent)
+ need_unref = 1;
+ } else
+ parent = local->loc.parent;
+
+ ret = marker_inode_loc_fill (parent, &loc);
if (ret < 0) {
ret = -1;
@@ -138,6 +147,9 @@ marker_trav_parent (marker_local_t *local)
local->loc = loc;
out:
+ if (need_unref)
+ inode_unref (parent);
+
return ret;
}