mountpoint information a get_sb
Hi,
the fs Im building needs to know where its being mounted prior to creating its superblock.
struct vfsmount that is passed to my fs specific get_sb has mnt_mountpoint set to NULL.
I assume this is the normal behavior and I am looking for a way to obtain information about the mount point my fs is being mounted on.
any help would be appreciated.
thanks
-M
Quoted 10 lines · Mathieu Dube
Hi,
the fs Im building needs to know where its being mounted prior to creating its superblock.
struct vfsmount that is passed to my fs specific
get_sbhasmnt_mountpointset to NULL.I assume this is the normal behavior and I am looking for a way to obtain information about the mount point my fs is being mounted on.
It might be mounted at any number of places, including 0. Moreover, it might be mounted at some place only to be immediately moved elsewhere.
The question makes no sense.
Quoted 5 lines · Al Viro
It might be mounted at any number of places, including 0. Moreover, it might be mounted at some place only to be immediately moved elsewhere.
The question makes no sense.
Im sorry Im fairly new to this.
youre saying there is no way to know the mount point unless its already mounted?
for instance in kernel 2.2 you had a d_covers pointer to the dentry the mount would be placed on?
I need to know the subtree that will be made invisible once the fs is mounted
is there a way ?
-M
Quoted 6 lines · Mathieu Dube
Quoted 4 lines · Al Viro
It might be mounted at any number of places, including 0. Moreover, it might be mounted at some place only to be immediately moved elsewhere.
Quoted 6 lines
Quoted 1 line
The question makes no sense.
Im sorry Im fairly new to this.
youre saying there is no way to know the mount point unless its already mounted?
He's saying that even if you happen to know where it's currently mounted, there's no guarantee the place where it's mounted might not be changed without your filesystem knowing. Indeed, it can be mounted nowhere at all (and yet still active) or it can be mounted in 2 or more places at the same time. What you've told us you're trying to do is impossible.
Quoted 4 lines
I need to know the subtree that will be made invisible once the fs is mounted
is there a way ?
No way at all. What are you actually trying to do?
Quoted 6 lines · Mathieu Dube
Quoted 4 lines · Al Viro
It might be mounted at any number of places, including 0. Moreover, it might be mounted at some place only to be immediately moved elsewhere.
Quoted 6 lines
Quoted 1 line
The question makes no sense.
Im sorry Im fairly new to this.
youre saying there is no way to know the mount point unless its already mounted?
I am saying that it can be mounted in any number of places at the same time.
Quoted 2 lines
for instance in kernel 2.2 you had a
d_coverspointer to the dentry the mount would be placed on?
Kept in struct vfsmount since 2.4 and there can be many of those for the same superblock.
Quoted 2 lines
I need to know the subtree that will be made invisible once the fs is mounted
If you rely on something becoming invisible - you've got a problem. It might be mounted elsewhere and not obscured there by anything.
If you want pass it *some* subtree, just pass it explicitly in the options, but be ready to have it changed later on (stuff might be mounted there, unmounted, moved around, etc.)
More details of what you are trying to do would be useful...