From mboxrd@z Thu Jan 1 00:00:00 1970 From: Trond Myklebust Subject: Re: [patch 01/10] vfs: add path_create() and path_mknod() Date: Wed, 02 Apr 2008 19:19:58 -0400 Message-ID: <1207178398.20254.19.camel@heimdal.trondhjem.org> References: <20080402201247.358430231@szeredi.hu> <20080402201321.062856131@szeredi.hu> <20080402205450.GO9785@ZenIV.linux.org.uk> <20080402214824.GP9785@ZenIV.linux.org.uk> <1207174890.722.12.camel@heimdal.trondhjem.org> <20080402223637.GQ9785@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: Miklos Szeredi , akpm@linux-foundation.org, dave@linux.vnet.ibm.com, ezk@cs.sunysb.edu, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org To: Al Viro Return-path: Received: from pat.uio.no ([129.240.10.15]:58757 "EHLO pat.uio.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756392AbYDBXUn (ORCPT ); Wed, 2 Apr 2008 19:20:43 -0400 In-Reply-To: <20080402223637.GQ9785@ZenIV.linux.org.uk> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, 2008-04-02 at 23:36 +0100, Al Viro wrote: > On Wed, Apr 02, 2008 at 06:21:30PM -0400, Trond Myklebust wrote: > > On Wed, 2008-04-02 at 22:48 +0100, Al Viro wrote: > > > I disagree. First of all, clear separation between operations on > > > _filesystem_, which should all be namespace-agnostic and things > > > that depend on vfsmount is a Good Thing(tm). Think of that as > > > of separation between server (superblock and everything related > > > to it, starting with dentry tree) and clients; mixing those is a > > > bloody bad idea. > > > > Speaking of which: is there any reason why we can't get rid of the > > vfsmount reference in struct file? > > > > Most file operations, don't involve namespace traversal at all: aside > > from fchdir(), and the *at() functions (all of which take file > > descriptors, not pointers to struct file) the only function of that > > vfsmount reference appears to be to prevent the superblock from going > > away. > > Huh? Are you proposing to move that to descriptor table, of all things? > Not to mention SCM_RIGHTS datagrams and hell knows what else... I'm just suggesting splitting out the namespace-specific part of struct file into a separate structure that would be private to the VFS. Something like struct file_descriptor { struct file *file; struct vfsmount *mnt; atomic_t refcount; }; and then having the 'struct file' hold a reference to the superblock instead of holding a reference to the vfsmount. Why would that be problematic for SCM_RIGHTS? We don't allow people to send arbitrary references to 'struct file' using SCM_RIGHTS now; they have to send descriptors.