Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261454AbTEHNsu (ORCPT ); Thu, 8 May 2003 09:48:50 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261489AbTEHNst (ORCPT ); Thu, 8 May 2003 09:48:49 -0400 Received: from 237.oncolt.com ([213.86.99.237]:58326 "EHLO warthog.warthog") by vger.kernel.org with ESMTP id S261454AbTEHNss (ORCPT ); Thu, 8 May 2003 09:48:48 -0400 To: viro@parcelfarce.linux.theplanet.co.uk cc: chas williams , Christoph Hellwig , David Howells , linux-kernel@vger.kernel.org Subject: Re: [PATCH] add a stub by which a module can bind to the AFS syscall In-Reply-To: <20030430155652.GU10374@parcelfarce.linux.theplanet.co.uk> User-Agent: EMH/1.14.1 SEMI/1.14.4 (Hosorogi) FLIM/1.14.4 (=?ISO-8859-4?Q?Kashiharajing=FE-mae?=) APEL/10.4 Emacs/21.2 (i386-redhat-linux-gnu) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.4 - "Hosorogi") Content-Type: text/plain; charset=US-ASCII Date: Thu, 08 May 2003 15:01:05 +0100 Message-ID: <4992.1052402465@warthog.warthog> From: David Howells Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1814 Lines: 50 Hi Alex, > Which means only one thing - changing that API will affect very few > things. > > Let's keep the kernel side sane. We don't have to mess with multiplexors > and even if we decide to use them, we will be better off by having decoder > outside of AFS proper. Again, take a look at interaction between userland > and knfsd. Right now we have a sane interface (IO on nfsctl files) and > we have a wrapper (sys_nfsctl) that does decode/open/write/read/close. As you suggested on IRC, almost all pioctls can be emulated by either: (1) doing a decode/mount/open/write/read/close on a file on a special internal filesystem if an inode is not required, or: (2) translating the call to get/set/lget/lsetxattr calls if an inode is required. However, there's always an exception. One of the pioctls requires three things: (a) a dentry and inode, (b) an input buffer with a filename in it, (c) an output buffer for holding a fair amount of data. This can't be done easily with (1) because of (a), and it can't be done atomically as (2) because two separate calls would have to be made for (b) and (c) (and the netfs would have to retain some sort of state). How about, instead, for pioctl calls that require an inode, the AFS multiplexor in the kernel invents a temporary file structure, points it at the dentry and calls its open, ioctl and release calls on inode->f_op? Or perhaps you'd consider adding an extra inode operation? struct inode_operations { ... int (*inodectl) (struct dentry *, unsigned int, unsigned long); }; David - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/