From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH -V3] Generic name to handle and open by handle syscalls Date: Mon, 26 Apr 2010 05:56:58 -0400 Message-ID: <20100426095658.GD23020@infradead.org> References: <1271960133-16414-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <20100424110812.40989988@notabene.brown> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Andreas Dilger , Theodore Tso , "Aneesh Kumar K.V" , hch@infradead.org, viro@zeniv.linux.org.uk, corbet@lwn.net, linux-fsdevel@vger.kernel.org, sfrench@us.ibm.com To: Neil Brown Return-path: Received: from bombadil.infradead.org ([18.85.46.34]:38483 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753158Ab0DZJ5B (ORCPT ); Mon, 26 Apr 2010 05:57:01 -0400 Content-Disposition: inline In-Reply-To: <20100424110812.40989988@notabene.brown> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Sat, Apr 24, 2010 at 11:08:12AM +1000, Neil Brown wrote: > Maybe map the filesystem part of the handle from UUID (or whatever) to devno > in userspace, then pass the devno+file-part-of-handle to the kernel to > perform, the final mapping. The device number is not a useful kernel interface at all. Getting a uuid really is easy in kernelspace as it's available in the superblock for every reasonable fs. What's more difficult is finding the right vfsmount instance of a superblock to use - not just due to read only but also things like no* per-vfsmount flags. If you look at libhandle in xfsprogs which wraps the existing xfs handle ioctls for use in application you'll see such a hash table to map to open file descriptors per filesystems due to the limits of the ioctl interface. Doing the uuid lookup in kernelspace sounds much saner as we have a list of mounts there anyway.