From 4ac06a16999bde2f9860f6a8713e7f2544b44f9a Mon Sep 17 00:00:00 2001 From: Vijay Bellur Date: Thu, 23 Feb 2012 01:25:47 +0530 Subject: features/marker: Use loc.inode to obtain parent if loc.parent isn't set. Change-Id: I89dddb19168a3ffb269afc9f6bcb2d7e7c9a69cd BUG: 790389 Signed-off-by: Vijay Bellur Reviewed-on: http://review.gluster.com/2802 Tested-by: Gluster Build System Reviewed-by: Raghavendra Bhat --- xlators/features/marker/src/marker.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'xlators') diff --git a/xlators/features/marker/src/marker.c b/xlators/features/marker/src/marker.c index 7f9610066..f29999340 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; } -- cgit