From: Al Viro Subject: Re: get vfsmount from dentry Date: Sun, 12 Mar 2006 13:55:43 +0000 Message-ID: <20060312135543.GB27946@ftp.linux.org.uk> References: <441425BB.6030604@it.iitb.ac.in> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org Return-path: Received: from zeniv.linux.org.uk ([195.92.253.2]:54764 "EHLO ZenIV.linux.org.uk") by vger.kernel.org with ESMTP id S1751288AbWCLNzo (ORCPT ); Sun, 12 Mar 2006 08:55:44 -0500 To: Ashish Khurange Content-Disposition: inline In-Reply-To: <441425BB.6030604@it.iitb.ac.in> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Sun, Mar 12, 2006 at 07:14:27PM +0530, Ashish Khurange wrote: > Hi, > I'm trying to develop a fmon (file monitor) patch. For that I'm trying > to find complete pathname of the file/directory being changed. If you > have dentry of a file and a corresponding vfsmount struct, I can find > out its entire pathname using following code. Which works exactly the > way I want. > Now the only problem is in many functions in the filesystem code, I have > access only to the dentry and not to its vfsmount. I can do one thing I > can change the function definition and pass corresponding vfsmount as a > parameter to the function, but this will lead to lot of changes. > > Is there any way by which I can found the vfsmount structure of a file > represented by dentry structure? Which one? There is no such thing as pathname of a file. It can be present in any number of places, including 0. Moreover, the pathname that makes sense for one process doesn't have to resolve to the same file (or even resolve at all) for others. So what are you really trying to achieve?