From: Josef Sipek <jsipek@cs.sunysb.edu>
To: linux-kernel@vger.kernel.org
Cc: linux-fsdevel@vger.kernel.org, hch@infradead.org,
akpm@linux-foundation.org, viro@ftp.linux.org.uk,
Trond.Myklebust@netapp.com, mhalcrow@us.ibm.com
Subject: [PATCH 1/1] fs: add 4th case to do_path_lookup
Date: Sun, 29 Apr 2007 23:30:12 -0400 [thread overview]
Message-ID: <20070430033012.GB32047@filer.fsl.cs.sunysb.edu> (raw)
In-Reply-To: <20070430032624.GA32047@filer.fsl.cs.sunysb.edu>
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
diff --git a/fs/namei.c b/fs/namei.c
index 2995fba..1516a9b 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1125,6 +1125,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);
diff --git a/include/linux/namei.h b/include/linux/namei.h
index 92b422b..aa89d97 100644
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -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
*/
next prev parent reply other threads:[~2007-04-30 3:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-30 3:26 [PATCH 0/1] [RFC] New mode for path_lookup (V1) Josef Sipek
2007-04-30 3:30 ` Josef Sipek [this message]
2007-05-04 7:02 ` [PATCH 1/1] fs: add 4th case to do_path_lookup Andrew Morton
2007-05-04 7:27 ` Christoph Hellwig
2007-05-04 7:34 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070430033012.GB32047@filer.fsl.cs.sunysb.edu \
--to=jsipek@cs.sunysb.edu \
--cc=Trond.Myklebust@netapp.com \
--cc=akpm@linux-foundation.org \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mhalcrow@us.ibm.com \
--cc=viro@ftp.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®