From: Andreas Dilger <adilger@turbolinux.com>
To: Alexander Viro <viro@math.psu.edu>
Cc: LA Walsh <law@sgi.com>,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: (struct dentry *)->vfsmnt;
Date: Tue, 13 Mar 2001 18:28:03 -0700 (MST) [thread overview]
Message-ID: <200103140128.f2E1S3506105@webber.adilger.int> (raw)
In-Reply-To: <Pine.GSO.4.21.0103092114420.17677-100000@weyl.math.psu.edu> from Alexander Viro at "Mar 9, 2001 09:42:01 pm"
Al, you write:
> If you have the pair (mnt, dentry) - p = d_path(mnt, dentry, buf, buflen);
> will put the path into buf and set p pointing to its beginning.
>
> dentry alone is not enough - it simply doesn't describe a unique point
> in the namespace. It does describe the unique point in the filesystem
> tree, but that tree can occur in several places of the unified tree.
> Thus the need of pair (vfsmount, dentry).
>
> If you ever need to do someting like "let's find any vfsmount that
> could go in pair with our dentry" - you are doing something wrong
> (or I had missed something last Spring). Table below gives the
> list of such pairs.
> vfsmount dentry
> file ->f_vfsmnt ->f_dentry
> nameidata ->mnt ->dentry
> swap component ->swap_vfsmnt ->swap_file
> knfsd export ->exp_mnt ->exp_dentry
> cwd ->pwdmnt ->pwd
> root ->rootmnt ->root
> emul.root ->altrootmnt ->altroot
> mountpoint ->mnt_parent ->mnt_mountpoint
What about if I want to know the mountpoint (inside the filesystem)
when it is mounted? The comments in the code say sb->s_type->kern_mnt
is only valid for in-kernel filesystems (FS_SINGLE).
Would it be possible to put a valid vfsmnt pointer in kern_mnt for
non-FS_SINGLE filesystems? Would only the vfsmnt information (maybe
d_path(kern_mnt, kern_mnt->mnt_mountpoint, buf, buflen)) be enough
to determine the pathname of the filesystem mount point?
Cheers, Andreas
--
Andreas Dilger \ "If a man ate a pound of pasta and a pound of antipasto,
\ would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/ -- Dogbert
next prev parent reply other threads:[~2001-03-14 1:29 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-03-09 23:20 LA Walsh
2001-03-10 1:00 ` Alexander Viro
2001-03-10 1:56 ` LA Walsh
2001-03-10 2:42 ` Alexander Viro
2001-03-14 1:28 ` Andreas Dilger [this message]
2001-03-14 2:32 ` Alexander Viro
2001-03-14 4:27 ` Andreas Dilger
2001-03-14 5:11 ` Alexander Viro
2001-03-14 5:19 ` Andreas Dilger
2001-03-14 5:49 ` Alexander Viro
2001-03-14 6:05 ` Andreas Dilger
2001-03-14 6:50 ` Alexander Viro
2001-03-14 17:26 ` Andreas Dilger
2001-03-14 17:40 ` Matthew Wilcox
2001-03-14 18:06 ` Andreas Dilger
2001-03-14 18:11 ` Alexander Viro
2001-03-14 19:14 ` Andreas Dilger
2001-03-14 19:32 ` Alexander Viro
2001-03-14 20:21 ` Ragnar Kjørstad
2001-03-14 19:31 ` Dave Kleikamp
2001-03-14 19:45 ` Andreas Dilger
2001-03-14 19:51 ` Alexander Viro
2001-03-14 19:57 ` Dave Kleikamp
2001-03-14 21:07 ` Andreas Dilger
2001-03-15 12:21 bsuparna
2001-03-15 12:59 bsuparna
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=200103140128.f2E1S3506105@webber.adilger.int \
--to=adilger@turbolinux.com \
--cc=law@sgi.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@math.psu.edu \
/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®