From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ashish Khurange Subject: Re: get vfsmount from dentry Date: Mon, 13 Mar 2006 00:24:54 +0530 Message-ID: <44146E7E.8090902@it.iitb.ac.in> References: <441425BB.6030604@it.iitb.ac.in> <20060312135543.GB27946@ftp.linux.org.uk> <44145873.6010802@it.iitb.ac.in> <20060312174149.GC27946@ftp.linux.org.uk> <441461D1.6090803@it.iitb.ac.in> <1142187797.4954.41.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Al Viro , linux-fsdevel@vger.kernel.org Return-path: Received: from smtp1.iitb.ac.in ([59.163.25.49]:19138 "HELO smtp1.iitb.ac.in") by vger.kernel.org with SMTP id S1750879AbWCLSy5 (ORCPT ); Sun, 12 Mar 2006 13:54:57 -0500 To: Shaya Potter In-Reply-To: <1142187797.4954.41.camel@localhost.localdomain> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Shaya Potter wrote: > >The question is, what are you trying to do? Why can't you use a "struct >file" (which will have the relevant vfsmnt). If you can't say, then its >hard for people to help you, most people here want to solve something >"right", and without knowing the real problem don't feel its worth >giving a half ass solution. > > > I'm trying to build file monitor patch. I want to detect all the changes happening to file system. For this I need to insert my code in various functions in fs/open.c, fs/ nami.c. Functions like vfs_mkdir, vfs_rmdir, notify_change, sys_write etc. Whenever a change to file system happens I want to track that change with the name of of the file and the change happened to it. The function which I send in my previous mail can be used to get the full pathname of the file being changed (pathname : lets say the name with which file is accessed). Now for this function I need both dentry and vfsmount struct of the file. In few functions (like sys_fchmod) I have file struct as an argument, which provides me both vfsmount and dentry, hence I can find out pathname of the file being changed. Where as in few functions (like vfs_mkdir) I have only dentry and inode of the directory, which are not sufficient to find the pathname. I hope I am clear now. - Ashish