fsstack: 4th case to do_path_lookup
authorErez_Zadok <ezk@cs.sunysb.edu>
Sun, 29 Apr 2007 23:33:25 +0000 (19:33 -0400)
committerErez_Zadok <ezk@cs.sunysb.edu>
Tue, 3 Jul 2007 22:54:58 +0000 (18:54 -0400)
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
fs/namei.c
include/linux/namei.h

index 25eb42cd21ad5f517be2717e6a9a7d733eeb7552..2e0af128e7d97a75a7dfc490ca54a1865def392d 100644 (file)
@@ -1128,6 +1128,10 @@ static int fastcall do_path_lookup(int dfd, const char *name,
                nd->mnt = mntget(fs->rootmnt);
                nd->dentry = dget(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->mnt = mntget(fs->pwdmnt);
index ec50b3b5b2469312a0c557b4e2e72f90678c9c1d..a272f0c12b0abfdf74b81105f31477f5a547946e 100644 (file)
@@ -43,6 +43,7 @@ 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
@@ -50,6 +51,7 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND};
 #define LOOKUP_PARENT          16
 #define LOOKUP_NOALT           32
 #define LOOKUP_REVAL           64
+#define LOOKUP_ONE            128
 /*
  * Intent data
  */