From 9ff89d858075d8f916c76a9ade84b9844da4d23e Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Tue, 14 Sep 2010 02:39:11 +0000 Subject: nfs,nfs3,mnt3: Transition fh resolution to gfid Signed-off-by: Shehjar Tikoo Signed-off-by: Vijay Bellur BUG: 971 (dynamic volume management) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=971 --- xlators/nfs/server/src/nfs-common.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'xlators/nfs/server/src/nfs-common.c') diff --git a/xlators/nfs/server/src/nfs-common.c b/xlators/nfs/server/src/nfs-common.c index 9f68f7146..970eb41c5 100644 --- a/xlators/nfs/server/src/nfs-common.c +++ b/xlators/nfs/server/src/nfs-common.c @@ -264,9 +264,8 @@ err: return ret; } - int -nfs_ino_loc_fill (inode_table_t *itable, uint64_t ino, uint64_t gen, loc_t *loc) +nfs_gfid_loc_fill (inode_table_t *itable, uuid_t gfid, loc_t *loc) { int ret = -EFAULT; inode_t *inode = NULL; @@ -274,7 +273,7 @@ nfs_ino_loc_fill (inode_table_t *itable, uint64_t ino, uint64_t gen, loc_t *loc) if (!loc) return ret; - inode = inode_get (itable, ino, gen); + inode = inode_find (itable, gfid); if (!inode) { ret = -ENOENT; goto err; @@ -289,6 +288,17 @@ err: } +int +nfs_root_loc_fill (inode_table_t *itable, loc_t *loc) +{ + uuid_t rootgfid = {0, }; + + rootgfid[15] = 1; + return nfs_gfid_loc_fill (itable, rootgfid, loc); +} + + + int nfs_parent_inode_loc_fill (inode_t *parent, inode_t *entryinode, char *entry, loc_t *loc) @@ -317,7 +327,7 @@ err: * On other errors, return -3. 0 on success. */ int -nfs_entry_loc_fill (inode_table_t *itable, ino_t ino, uint64_t gen, char *entry, +nfs_entry_loc_fill (inode_table_t *itable, uuid_t pargfid, char *entry, loc_t *loc, int how) { inode_t *parent = NULL; @@ -329,7 +339,7 @@ nfs_entry_loc_fill (inode_table_t *itable, ino_t ino, uint64_t gen, char *entry, if ((!itable) || (!entry) || (!loc)) return ret; - parent = inode_get (itable, ino, gen); + parent = inode_find (itable, pargfid); ret = -1; /* Will need hard resolution now */ -- cgit