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, 13 Jan 2009 01:43:04 +0000 (20:43 -0500)
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
fs/namei.c
include/linux/namei.h

index db845e8856a3bae6f380d5fc10f34f66824659f5..f446600524cd1c87c4df7179eeac545020c440ad 100644 (file)
@@ -1155,6 +1155,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;
index a83bd12cfa237d3ec2f2511ac51f6dc247b1d8b3..abf0f1a8690850d7227e06ca8612fa43b0ea4f06 100644 (file)
@@ -42,6 +42,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
@@ -49,6 +50,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
  */