From owner-freebsd-fs@FreeBSD.ORG Sat Mar 26 03:10:21 2005 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E628216A4CE for ; Sat, 26 Mar 2005 03:10:21 +0000 (GMT) Received: from VARK.MIT.EDU (VARK.MIT.EDU [18.95.3.179]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8F45C43D49 for ; Sat, 26 Mar 2005 03:10:21 +0000 (GMT) (envelope-from das@FreeBSD.ORG) Received: from VARK.MIT.EDU (localhost [127.0.0.1]) by VARK.MIT.EDU (8.13.3/8.13.1) with ESMTP id j2Q3AIVF041632; Fri, 25 Mar 2005 22:10:18 -0500 (EST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by VARK.MIT.EDU (8.13.3/8.13.1/Submit) id j2Q3AIrY041631; Fri, 25 Mar 2005 22:10:18 -0500 (EST) (envelope-from das@FreeBSD.ORG) Date: Fri, 25 Mar 2005 22:10:18 -0500 From: David Schultz To: David Malone Message-ID: <20050326031018.GB41481@VARK.MIT.EDU> Mail-Followup-To: David Malone , freebsd-fs@FreeBSD.ORG References: <200503260011.aa53448@salmon.maths.tcd.ie> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200503260011.aa53448@salmon.maths.tcd.ie> cc: freebsd-fs@FreeBSD.ORG Subject: Re: UFS Subdirectory limit. X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Mar 2005 03:10:22 -0000 On Sat, Mar 26, 2005, David Malone wrote: > There was a discussion on comp.unix.bsd.freebsd.misc about two weeks > ago, where someone had an application that used about 150K > subdirectories of a single directory. They wanted to move this > application to FreeBSD, but discovered that UFS is limited to 32K > subdirectories, because UFS's link count field is a signed 16 bit > quantity. Rewriting the application wasn't an option for them. > > I had a look at how hard it would be to fix this. The obvious route > of increasing the size of the link count field is trickly because > it means changing the struct stat, which has a 16 bit link count > field. This would imply ABI breakage, though it might be worth it. Why not just... - make a new st_nlink field that's 32 bits and put it in the spare 32-bit field in struct stat - rename the old st_nlink to st_onlink and leave it at 16 bits - the kernel would fill in st_onlink with max(st_nlink,SHORT_MAX)