From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shaya Potter Subject: Re: get vfsmount from dentry Date: Sun, 12 Mar 2006 13:23:17 -0500 Message-ID: <1142187797.4954.41.camel@localhost.localdomain> 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> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: Al Viro , linux-fsdevel@vger.kernel.org Return-path: Received: from cs.columbia.edu ([128.59.16.20]:741 "EHLO cs.columbia.edu") by vger.kernel.org with ESMTP id S1751686AbWCLS30 (ORCPT ); Sun, 12 Mar 2006 13:29:26 -0500 To: Ashish Khurange In-Reply-To: <441461D1.6090803@it.iitb.ac.in> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Sun, 2006-03-12 at 23:30 +0530, Ashish Khurange wrote: > > > come on ... > As per my knowledge in vfs layer file is either accessed by pathname or > file structure pointer. In file struct you have both dentry of the file > and vfsmount. When a file is accessed by a name first path look up > happens and its nameidata is created which holds both dentry and > vfsmount. In may function calls only dentry is passed as an argument. > Now I want the path name of the file (forget what I want, as term > pathname is not clear between us). For some reason, I need vfsmount of > the file as well. you don't get it. case a. 1. fd1 = open("/tmp/123") 2. mount bind "/tmp/456" -> "/tmp/123" 3. fd2 = open("/tmp/123") both have the same exact "same" path, but 2 separate dentry. case b. 1. fd1 = open("/tmp/123") 2. mount bind "/tmp/123" -> "/tmp/456" 3. fd2 = open("/tmp/456") both have different paths, but will share the same dentry. linux (and possibly other modern OSs) let us muck with the file system namespace without modifying the underlying file systems. 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.