From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Wilcox Subject: Re: Why ext3 uses different policies to allocate inodes for dirs and files? Date: Tue, 7 Mar 2006 08:39:10 -0700 Message-ID: <20060307153910.GC7301@parisc-linux.org> References: <20060307083319.GH6393@schatzie.adilger.int> <001901c641fc$ae8120e0$0201a8c0@joe> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: 'Andreas Dilger' , 'Xin Zhao' , 'linux-kernel' , linux-fsdevel@vger.kernel.org Return-path: Received: from palinux.external.hp.com ([192.25.206.14]:3248 "EHLO palinux.hppa") by vger.kernel.org with ESMTP id S1751221AbWCGPjM (ORCPT ); Tue, 7 Mar 2006 10:39:12 -0500 To: "Joseph D. Wagner" Content-Disposition: inline In-Reply-To: <001901c641fc$ae8120e0$0201a8c0@joe> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Tue, Mar 07, 2006 at 09:34:53AM -0600, Joseph D. Wagner wrote: > > I'm not sure what it is you are saying. Directories may be renamed, but > > the inodes are never moved. > > If the "dir inode" were to be moved closer to the "parent dir inode", this would become quite an expensive "move" operation, as it would have to move all of the "dir inodes" of the "i386-redhat-linux" directory and all subdirectories away from the "parent dir inode" of "/usr/local/lib/" and closer to the "parent dir inode" of "/usr/lib/". inodes are allocated once and never moved. We're talking about initial allocation. So even though files have their inodes allocated near their parent directory's inode, their inode is not moved when moved to another directory. The reason, as Andreas said, is that if we did allocate directory inodes near their parent inode, we would end up just filling up from the start of the drive and never spreading out.