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>
Sun, 23 Mar 2008 03:42:51 +0000 (23:42 -0400)
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
fs/namei.c
include/linux/namei.h

index 8d8c8606cb5e53b38567571d7b6cbacbf49f3e0d..e0fb9f262622e739d57a7b0708c3ee71a779b53f 100644 (file)
@@ -1126,6 +1126,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 e378e1fef3f7498a9555adfc0b4e074f8be52355..6e14b4508e8ca057133f642106d4972539ba630c 100644 (file)
@@ -48,6 +48,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
@@ -55,6 +56,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
  */