From owner-freebsd-hackers Tue Nov 30 12:17:22 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from mail.tvol.com (mail.wgate.com [38.219.83.4]) by hub.freebsd.org (Postfix) with ESMTP id 08861155B6 for ; Tue, 30 Nov 1999 12:17:16 -0800 (PST) (envelope-from rjesup@wgate.com) Received: from jesup.eng.tvol.net (jesup.eng.tvol.net [10.32.2.26]) by mail.tvol.com (8.8.8/8.8.3) with ESMTP id PAA04232; Tue, 30 Nov 1999 15:15:44 -0500 (EST) Reply-To: Randell Jesup To: Robert Watson , freebsd-hackers@freebsd.org Subject: Re: Portable way to compare struct stat's? From: Randell Jesup Date: 30 Nov 1999 15:18:16 -0500 In-Reply-To: Robert Watson's message of "Tue, 16 Nov 1999 10:38:42 -0500 (EST)" Message-ID: X-Mailer: Gnus v5.6.43/Emacs 20.4 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Robert Watson writes: >> On a single system, if st_dev and st_ino are equal, you must be referring >> to the same object. If not, I'd like to hear about it. > >This assumption has always caused lots of pain and suffering for >distributed file system people -- in a distributed file system, the >requirement that you can generate a unique 32 bit number for each file or >directory visible in the FS is a fairly arduous one. Either the number is Quite true, and a real performance problem for some FS designs. Read some SigOS papers for examples (or below). Allowing the application to decide if something is the same or not directly is not a Good Idea. Allowing the OS/FS to determine that for the application is a Good Idea. Witness the SameLock(lock1,lock2) call in some OS's (AmigaOS in particular - SameFileHandle(fh1,fh2) or SameFile(filename1,filename2) are simple derivatives of SameLock()). re: AFS, CODA >each file/directory, only it's 96-bit, which in my book doesn't guarantee >unique mapping onto the 16 bit dev number and 32 bit inode. This means a >hash is required, and collisions are possibly. When a collision occurs on >the hash under Linux, all hell breaks loose :-). Hell breaking loose can be a real pain >Rant rant rant. And a darn good rant at that. Too bad that the "that's the way it's always been done"/"inodes were handed down by God" arguments are so hard to overcome. 1/2 :-) -- Randell Jesup, Worldgate Communications, ex-Scala, ex-Amiga OS team ('88-94) rjesup@wgate.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message