Messages in this thread | | | From | Andreas Dilger <> | Subject | Re: query | Date | Sun, 3 Jun 2001 08:42:23 -0600 (MDT) |
| |
Chanchal Chawla writes: > i'm writing a file system code, i've a query regarding that, i want you > to help me out if possible, > > is it possible to get the absolute mount point of a device at run time > in that code ? if it is possible then how we can get it ?
It was possible in 2.2 with a minor hack. I did it by passing mountpoint dentry via sb->s_root to filesystem, and using d_path() to do the path lookup inside the filesystem. s_root is overwritten by the filesystem to hold the new fs root dentry, so you need to get the path and store it elsewhere before s_root is overwritten.
In 2.4 I was trying to get Al Viro to tell me the best way to do this, but because it is _possible_ to mount a filesystem multiple times under 2.4 it raises a question about which mountpoint you should use. In 2.4 you need to supply an additional vfsmnt parameter to d_path(), and I never did get an answer out of Al as to how to get a vfsmnt inside the filesystem, even if there is only one mount of the filesystem.
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 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |