summaryrefslogtreecommitdiffstats
path: root/xlators/nfs/server/src/nfs-fops.c
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2011-11-16 15:39:29 +0530
committerVijay Bellur <vijay@gluster.com>2011-11-16 03:44:32 -0800
commit14f4e023822a22e0a4902acfd28c8f5ea8c94ccd (patch)
tree580ae84b87adf7f7ce83d6a409c303aa49ba4220 /xlators/nfs/server/src/nfs-fops.c
parent217842180858afff79d06c24389752299c5ed716 (diff)
core: remove 'ino' variable from 'inode_t' structure
Change-Id: I0f078d1753db65d2f2e0380d1b0450c114cf40dd BUG: 3518 Reviewed-on: http://review.gluster.com/522 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/nfs/server/src/nfs-fops.c')
-rw-r--r--xlators/nfs/server/src/nfs-fops.c44
1 files changed, 23 insertions, 21 deletions
diff --git a/xlators/nfs/server/src/nfs-fops.c b/xlators/nfs/server/src/nfs-fops.c
index 95a657a1280..d9b419c4e16 100644
--- a/xlators/nfs/server/src/nfs-fops.c
+++ b/xlators/nfs/server/src/nfs-fops.c
@@ -152,21 +152,22 @@ err:
* for us to determine in the callback whether to funge the ino in the stat buf
* with 1 for the parent.
*/
-#define nfs_fop_save_root_ino(locl, loc) \
- do { \
- if ((loc)->ino == 1) \
- (locl)->rootinode = 1; \
- else if (((loc)->parent) && ((loc)->parent->ino == 1)) \
- (locl)->rootparentinode = 1; \
- } while (0) \
+#define nfs_fop_save_root_ino(locl, loc) \
+ do { \
+ if (((loc)->inode) && \
+ __is_root_gfid ((loc)->inode->gfid)) \
+ (locl)->rootinode = 1; \
+ else if (((loc)->parent) && \
+ __is_root_gfid ((loc)->parent->gfid)) \
+ (locl)->rootparentinode = 1; \
+ } while (0)
/* Do the same for an fd */
-#define nfs_fop_save_root_fd_ino(locl, fdesc) \
- do { \
- if ((fdesc)->inode->ino == 1) \
- (locl)->rootinode = 1; \
- } while (0) \
-
+#define nfs_fop_save_root_fd_ino(locl, fdesc) \
+ do { \
+ if (__is_root_gfid ((fdesc)->inode->gfid)) \
+ (locl)->rootinode = 1; \
+ } while (0)
/* Use the state saved by the previous macro to funge the ino in the appropriate
@@ -200,14 +201,15 @@ err:
/* If the newly created, inode's parent is root, we'll need to funge the ino
* in the parent attr when we receive them in the callback.
*/
-#define nfs_fop_newloc_save_root_ino(locl, newloc) \
- do { \
- if ((newloc)->ino == 1) \
- (locl)->newrootinode = 1; \
- else if (((newloc)->parent) && ((newloc)->parent->ino == 1)) \
- (locl)->newrootparentinode = 1; \
- } while (0) \
-
+#define nfs_fop_newloc_save_root_ino(locl, newloc) \
+ do { \
+ if (((newloc)->inode) && \
+ __is_root_gfid ((newloc)->inode->gfid)) \
+ (locl)->newrootinode = 1; \
+ else if (((newloc)->parent) && \
+ __is_root_gfid ((newloc)->parent->gfid)) \
+ (locl)->newrootparentinode = 1; \
+ } while (0)
#define nfs_fop_newloc_restore_root_ino(locl, fopret, preattr, postattr, prepar, postpar) \
do { \