From 6f5c8f6f7fb2742b9baee280e75fc3cd547f7130 Mon Sep 17 00:00:00 2001 From: Erez_Zadok Date: Sun, 29 Apr 2007 19:33:25 -0400 Subject: [PATCH] fsstack: 4th case to do_path_lookup Signed-off-by: Josef 'Jeff' Sipek --- fs/namei.c | 4 ++++ include/linux/namei.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/fs/namei.c b/fs/namei.c index 7720f4fe973..d999c4b7acf 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -1152,6 +1152,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 a83bd12cfa2..abf0f1a8690 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h @@ -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 */ -- 2.43.0