From 66fddb979d7f33a86869211c06e4a9ef4a54a080 Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Sun, 15 Apr 2012 22:14:38 -0700 Subject: storage/posix: prefer absolute path handles over GFID handles Change-Id: I9afefa2f8a39c5f2c77271ea64aff95249c88821 BUG: 791187 Signed-off-by: Anand Avati Reviewed-on: http://review.gluster.com/3204 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi Reviewed-by: Vijay Bellur --- xlators/storage/posix/src/posix-handle.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/xlators/storage/posix/src/posix-handle.h b/xlators/storage/posix/src/posix-handle.h index a8fd9228a95..ec4baec5b05 100644 --- a/xlators/storage/posix/src/posix-handle.h +++ b/xlators/storage/posix/src/posix-handle.h @@ -74,6 +74,11 @@ "null gfid for path %s", loc->path); \ break; \ } \ + if (LOC_HAS_ABSPATH (loc)) { \ + MAKE_REAL_PATH (rpath, this, loc->path); \ + op_ret = posix_pstat (this, loc->gfid, rpath, iatt_p); \ + break; \ + } \ errno = 0; \ op_ret = posix_istat (this, loc->gfid, NULL, iatt_p); \ if (errno != ELOOP) { \ @@ -81,11 +86,6 @@ break; \ } \ /* __ret == -1 && errno == ELOOP */ \ - if (LOC_HAS_ABSPATH (loc)) { \ - MAKE_REAL_PATH (rpath, this, loc->path); \ - op_ret = posix_pstat (this, loc->gfid, rpath, iatt_p); \ - break; \ - } \ } while (0) @@ -98,6 +98,13 @@ break; \ } \ \ + if (LOC_HAS_ABSPATH (loc)) { \ + MAKE_REAL_PATH (entp, this, loc->path); \ + __parp = strdupa (entp); \ + parp = dirname (__parp); \ + op_ret = posix_pstat (this, NULL, entp, ent_p); \ + break; \ + } \ errno = 0; \ op_ret = posix_istat (this, loc->pargfid, loc->name, ent_p); \ if (errno != ELOOP) { \ @@ -106,13 +113,6 @@ break; \ } \ /* __ret == -1 && errno == ELOOP */ \ - if (LOC_HAS_ABSPATH (loc)) { \ - MAKE_REAL_PATH (entp, this, loc->path); \ - __parp = strdupa (entp); \ - parp = dirname (__parp); \ - op_ret = posix_pstat (this, NULL, entp, ent_p); \ - break; \ - } \ /* expand ELOOP */ \ } while (0) -- cgit