GIT: unionfs2-2.6.27.y: fsstack: 4th case to do_path_lookup

Erez Zadok ezk at fsl.cs.sunysb.edu
Thu Aug 12 23:16:12 EDT 2010


commit 341d894744f4eedbe9c463a6165018bbb2a21574
Author: Erez_Zadok <ezk at cs.sunysb.edu>
Date:   Sun Apr 29 19:33:25 2007 -0400

    fsstack: 4th case to do_path_lookup
    
    Signed-off-by: Josef 'Jeff' Sipek <jsipek at cs.sunysb.edu>

diff --git a/fs/namei.c b/fs/namei.c
index 7dfb3d8..bb45e23 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1070,6 +1070,10 @@ static int do_path_lookup(int dfd, const char *name,
 		nd->path = fs->root;
 		path_get(&fs->root);
 		read_unlock(&fs->lock);
+	} else if (flags & LOOKUP_ONE) {
+		/* nd->mnt and nd->dentry already set, just grab references */
+		mntget(nd->mnt);
+		dget(nd->dentry);
 	} else if (dfd == AT_FDCWD) {
 		read_lock(&fs->lock);
 		nd->path = fs->pwd;
diff --git a/include/linux/namei.h b/include/linux/namei.h
index e96e84b..b49720f 100644
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -42,12 +42,14 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND};
  *  - internal "there are more path compnents" flag
  *  - locked when lookup done with dcache_lock held
  *  - dentry cache is untrusted; force a real lookup
+ *  - lookup path from given dentry/vfsmount pair
  */
 #define LOOKUP_FOLLOW		 1
 #define LOOKUP_DIRECTORY	 2
 #define LOOKUP_CONTINUE		 4
 #define LOOKUP_PARENT		16
 #define LOOKUP_REVAL		64
+#define LOOKUP_ONE	       128
 /*
  * Intent data
  */


More information about the unionfs-cvs mailing list