From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Sharp Subject: Re: Mountpoint lookup Date: Wed, 5 Feb 2003 11:13:00 -0800 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <20030205191300.GA16314@ccpu.com> References: <1044457119.23738.131.camel@zed.malinux.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org Return-path: To: Florin Malita Content-Disposition: inline In-Reply-To: <1044457119.23738.131.camel@zed.malinux.net> List-Id: linux-fsdevel.vger.kernel.org On Wed, Feb 05, 2003 at 05:02:01PM +0200, Florin Malita wrote: > Is there a way of finding the mountpoint a fs is being mounted on at > read_super time? > > I'm developing a userland filesystem interface (LUFS - > http://lufs.sourceforge.net) and the only way of getting the mountpoint > I found so far is to wait until I get a struct file* (in readdir for > example) and then go through its f_vfsmount, building the mountpoint > path. This is race prone. > > I suspect there's some sort of Zen restriction floating around the > mountpoint (the darn fs shall not need to know its mountpoint) but I'm > relying on it for absolute symlinks remapping. It's the bizarre code of the FS, happy to give you your 'device' but not your mount path. It is, however, almost always in the data pointer. Look at the source for the mount command, or write your own mount command if that regular one isn't giving you what you want. I recently dealt with this exact issue, but I am using my own mount command so it was no biggy. a