From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Joseph D. Wagner" Subject: RE: Why ext3 uses different policies to allocate inodes for dirs and files? Date: Mon, 6 Mar 2006 23:24:25 -0600 Message-ID: <002601c641a7$6687d680$0201a8c0@joe> References: <4ae3c140603061342r26ca2226s2e6e41792104c633@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8BIT Cc: Return-path: Received: from mxsf42.cluster1.charter.net ([209.225.28.174]:35756 "EHLO mxsf42.cluster1.charter.net") by vger.kernel.org with ESMTP id S1751159AbWCGFXT convert rfc822-to-8bit (ORCPT ); Tue, 7 Mar 2006 00:23:19 -0500 To: "'Xin Zhao'" , "'linux-kernel'" In-Reply-To: <4ae3c140603061342r26ca2226s2e6e41792104c633@mail.gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org > The policy seems to distribute dir inodes uniformly on all block > groups. Why do we want to do this? Isn't it better to create a dir > inode close to its parent dir inode? Directories can, and frequently are, moved. If you kept the dir inode close to its parent dir inode, you'd have to move dir inodes around every time you move directories. Less is more. Keeping the dir inodes uniform means the time to perform a name->inode lookup is relatively the same regardless of directory. While admittedly this does not always yield the fastest performance, in this case we prefer consistency over speed. I'm sure there are other good reasons too, but these two are enough to justify it. Joseph D. Wagner