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 0/1] [RFC] New mode for path_lookup (V1)
Date: Sun, 29 Apr 2007 23:26:24 -0400 [thread overview]
Message-ID: <20070430032624.GA32047@filer.fsl.cs.sunysb.edu> (raw)
Stackable file systems frequently need to lookup paths or path components
starting from an arbitrary point in the namespace (identified by a dentry
and a vfsmount). Currently, such file systems use lookup_one_len, which is
frowned upon [1] as it does not pass the lookup intent along; not passing a
lookup intent, for example, can trigger BUG_ON's when stacking on top of
NFSv4.
The following patch introduces a new mode to path_lookup to allow lookup to
start from an arbitrary point in the namespace. This approach has been
suggested by Christoph Hellwig at the Linux Storage & Filesystem workshop in
February of this year.
One indicates that the lookup should be relative to a dentry-vfsmnt pair by
using the LOOKUP_ONE flag. For example, the following snippet of code,
looks up "pathcomponent" in a directory pointed to by
parent_{dentry,vfsmnt}:
nd.dentry = parent_dentry;
nd.mnt = parent_vfsmnt;
err = path_lookup("pathcomponent", LOOKUP_ONE, &nd);
if (!err) {
/* exits */
...
/* once done, release the references */
path_release(&nd);
} else if (err == -ENOENT) {
/* doesn't exits */
} else {
/* other error */
}
VFS functions such as lookup_create can be used on the nameidata structure
to pass the create intent to the file system.
Currently, there is no easy way to pass the LOOKUP_OPEN intent. The proper
way would be to call open_namei.
We'd like to get comments about what's necessary to make stackable file
systems do lookups right - this includes potential changes to open_namei.
Josef 'Jeff' Sipek.
[1] http://marc.info/?l=linux-kernel&m=117343337823760&w=2
next reply other threads:[~2007-04-30 3:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-30 3:26 Josef Sipek [this message]
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
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=20070430032624.GA32047@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