Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!shadooby!samsung!cs.utexas.edu!uunet!mcsun!ukc!stl!neon!helium!duncan From: duncan@helium.siesoft.co.uk (Duncan McEwan) Newsgroups: comp.unix.wizards Subject: Re^2: 4BSD file system structure Message-ID: <1727@neon.siesoft.co.uk> Date: 16 Nov 89 16:56:30 GMT Sender: nobody@neon.siesoft.co.uk Lines: 33 chris@mimsy.umd.edu (Chris Torek) writes: >#define blksize(fs, ip, lbn) \ > (((lbn) >= NDADDR || (ip)->i_size >= ((lbn) + 1) << (fs)->fs_bshift) \ > ? (fs)->fs_bsize \ > : (fragroundup(fs, blkoff(fs, (ip)->i_size)))) > ... > >(Thus, files >= 48K (4k/any) or 96K (8K/any) never end in a fragment.) This last statement reminds me of something I have been puzzling over recently. Do the disk addresses kept in the inode and indirect blocks address blocks or fragments? The above seems to indicate blocks, since for the size of a file with indirect blocks (lbn >= NDADDR) to be >= 48K on a 4K/any filesystem each of the NDADDR (12) pointers must address a 4K block. A comment in the "Design and Implementation of 4.3BSD" backs this up. There it says that to ensure files as large as 2^32 can be created with only two levels of indirection, the minimum size of a file system block is 4K. So if as it seems, the pointers do address blocks rather than fragments, how can the file system locate which fragments in a block belong to a the file when the inode only contains a pointer to the block? Answer by mail if the answer is so obvious that there will be many replys to this. I will post the answer if I don't see it here after a reasonable interval. --- Duncan (duncan@siesoft.co.uk, ...!ukc!siesoft!duncan)