From mboxrd@z Thu Jan 1 00:00:00 1970 From: Theodore Tso Subject: Re: [RFC 0/2] readdir() as an inode operation Date: Wed, 31 Oct 2007 03:13:53 -0400 Message-ID: <20071031071353.GB20965@thunk.org> References: <20071020100903.717837398@X40.localnet> <20071030152604.GC27039@atrey.karlin.mff.cuni.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Jan Blunck , Christoph Hellwig , Alexander Viro , Linux-Kernel Mailinglist , linux-fsdevel@vger.kernel.org To: Jan Kara Return-path: Received: from THUNK.ORG ([69.25.196.29]:37558 "EHLO thunker.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752884AbXJaHQS (ORCPT ); Wed, 31 Oct 2007 03:16:18 -0400 Content-Disposition: inline In-Reply-To: <20071030152604.GC27039@atrey.karlin.mff.cuni.cz> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Tue, Oct 30, 2007 at 04:26:04PM +0100, Jan Kara wrote: > > This is a first try to move readdir() to become an inode operation. This is > > necessary for a VFS implementation of "something like union-mounts" where a > > readdir() needs to read the directory contents of multiple directories. > > Besides that the new interface is no longer giving the struct file to the > > filesystem implementations anymore. > > > > Comments, please? > Hmm, are you sure there are no users which keep some per-struct-file > information for directories? File offset is one such obvious thing which > you've handled but actually filesystem with more complicated structure > of directory may remember some hints about where we really are, keep > some readahead information or so... For example, the ext3 filesystem, when it is supported hash tree, does exactly this. See ext3_htree_store_dirent() in fs/ext3/dir.c and ext3_htree_fill_tree() in fs/ext3/namei.c. So your patch would break ext3 htree support. - Ted