From: Christoph Hellwig <hch@infradead.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Josef Sipek <jsipek@cs.sunysb.edu>,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
hch@infradead.org, viro@ftp.linux.org.uk,
Trond.Myklebust@netapp.com, mhalcrow@us.ibm.com
Subject: Re: [PATCH 1/1] fs: add 4th case to do_path_lookup
Date: Fri, 4 May 2007 08:27:34 +0100 [thread overview]
Message-ID: <20070504072734.GA21188@infradead.org> (raw)
In-Reply-To: <20070504000200.d14bd8d9.akpm@linux-foundation.org>
sorry, I proposed Jeff a reply long ago but haven't done yet.
On Fri, May 04, 2007 at 12:02:00AM -0700, Andrew Morton wrote:
> > @@ -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);
>
> Well the patch passes my too-small-to-care-about test ;)
>
> Unless someone objects I'd suggest that you add it to the unionfs tree.
The code is obviously correct. There is one little thing that bothers
me, and that's that nd was purely an output paramter to path_lookup and
do_path_lookup, and no it's an input paramter for the least used case.
It might make sense to just a simple helper ala:
static int path_component_lookup(struct dentry *dentry, struct vfsmount *mnt,
const char *name, unsigned int flags, struct nameidata *nd)
{
int retval;
nd->last_type = LAST_ROOT;
nd->flags = flags;
nd->mnt = mntget(mnt);
nd->dentry = dget(dentry);
nd->depth = 0;
retval = path_walk(name, nd);
if (unlikely(!retval && !audit_dummy_context() &&
nd->dentry && nd->dentry->d_inode))
audit_inode(name, nd->dentry->d_inode);
return retval;
}
instead.
next prev parent reply other threads:[~2007-05-04 7:27 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 ` [PATCH 1/1] fs: add 4th case to do_path_lookup Josef Sipek
2007-05-04 7:02 ` Andrew Morton
2007-05-04 7:27 ` Christoph Hellwig [this message]
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=20070504072734.GA21188@infradead.org \
--to=hch@infradead.org \
--cc=Trond.Myklebust@netapp.com \
--cc=akpm@linux-foundation.org \
--cc=jsipek@cs.sunysb.edu \
--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;
as well as URLs for NNTP newsgroup(s).