From owner-freebsd-hackers@FreeBSD.ORG Sun May 16 12:33:46 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 94F9416A4CE for ; Sun, 16 May 2004 12:33:46 -0700 (PDT) Received: from gw.catspoiler.org (217-ip-163.nccn.net [209.79.217.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0524843D58 for ; Sun, 16 May 2004 12:33:46 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.12.9p2/8.12.9) with ESMTP id i4GJXa7E015975; Sun, 16 May 2004 12:33:41 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <200405161933.i4GJXa7E015975@gw.catspoiler.org> Date: Sun, 16 May 2004 12:33:36 -0700 (PDT) From: Don Lewis To: dwmalone@maths.tcd.ie In-Reply-To: <20040516082823.GA21655@walton.maths.tcd.ie> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii cc: freebsd-hackers@FreeBSD.org Subject: Re: How do inodes work? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 May 2004 19:33:46 -0000 On 16 May, David Malone wrote: > On Sun, May 16, 2004 at 02:25:37AM -0300, Marc G. Fournier wrote: >> so I take there are 'gaps' in the inode list? it doesn't re-use freed >> ones but keeps climbing until maybe it rolls around or something? > > A particular numbered inode always lives in the same place on the > disk. When choosing what inode to use for a new file, the filesystem > tries to pick a inode to put the file close to the directory it is > being created in. This is the dirpref optimisation introduced a few > years ago - previously inodes were chosen from a part of a disk that > had the most nearby free space. The preferred location of inodes for regular files has always been in the same cylinder group as their parent directory. The dirpref optimization changed the policy for selecting the cylinder group when new directories are created.