From: Shaya Potter <spotter@cs.columbia.edu>
To: Ashish Khurange <ashishk@it.iitb.ac.in>
Cc: Al Viro <viro@ftp.linux.org.uk>, linux-fsdevel@vger.kernel.org
Subject: Re: get vfsmount from dentry
Date: Sun, 12 Mar 2006 13:23:17 -0500 [thread overview]
Message-ID: <1142187797.4954.41.camel@localhost.localdomain> (raw)
In-Reply-To: <441461D1.6090803@it.iitb.ac.in>
On Sun, 2006-03-12 at 23:30 +0530, Ashish Khurange wrote:
> >
> come on ...
> As per my knowledge in vfs layer file is either accessed by pathname or
> file structure pointer. In file struct you have both dentry of the file
> and vfsmount. When a file is accessed by a name first path look up
> happens and its nameidata is created which holds both dentry and
> vfsmount. In may function calls only dentry is passed as an argument.
> Now I want the path name of the file (forget what I want, as term
> pathname is not clear between us). For some reason, I need vfsmount of
> the file as well.
you don't get it.
case a.
1. fd1 = open("/tmp/123")
2. mount bind "/tmp/456" -> "/tmp/123"
3. fd2 = open("/tmp/123")
both have the same exact "same" path, but 2 separate dentry.
case b.
1. fd1 = open("/tmp/123")
2. mount bind "/tmp/123" -> "/tmp/456"
3. fd2 = open("/tmp/456")
both have different paths, but will share the same dentry.
linux (and possibly other modern OSs) let us muck with the file system
namespace without modifying the underlying file systems.
The question is, what are you trying to do? Why can't you use a "struct
file" (which will have the relevant vfsmnt). If you can't say, then its
hard for people to help you, most people here want to solve something
"right", and without knowing the real problem don't feel its worth
giving a half ass solution.
next prev parent reply other threads:[~2006-03-12 18:29 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-12 13:44 get vfsmount from dentry Ashish Khurange
2006-03-12 13:55 ` Al Viro
2006-03-12 17:20 ` Ashish Khurange
2006-03-12 17:41 ` Al Viro
2006-03-12 18:00 ` Ashish Khurange
2006-03-12 18:23 ` Shaya Potter [this message]
2006-03-12 18:54 ` Ashish Khurange
2006-03-12 19:13 ` Al Viro
2006-03-12 20:34 ` Ashish Khurange
2006-03-12 20:45 ` Shaya Potter
2006-03-13 7:24 ` Jan Hudec
2006-03-12 18:24 ` Al Viro
2006-03-12 19:10 ` Jamie Lokier
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=1142187797.4954.41.camel@localhost.localdomain \
--to=spotter@cs.columbia.edu \
--cc=ashishk@it.iitb.ac.in \
--cc=linux-fsdevel@vger.kernel.org \
--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).