[lkml]   [2001]   [Jun]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: query
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?" -- Dogbert
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:54    [W:0.034 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site