Date: Sun, 07 Jul 2002 01:50:07 +0100 From: Ian Dowse <iedowse@maths.tcd.ie> To: ticso@cicely.de Cc: Matthew Dillon <dillon@apollo.backplane.com>, Bernd Walter <ticso@cicely5.cicely.de>, Terry Lambert <tlambert2@mindspring.com>, Darren Pilgrim <dmp@pantherdragon.org>, freebsd-hackers@FreeBSD.ORG Subject: Re: How does swap work address spacewise? Message-ID: <200207070150.aa91552@salmon.maths.tcd.ie> In-Reply-To: Your message of "Sun, 07 Jul 2002 02:10:19 %2B0200." <20020707001019.GK23704@cicely5.cicely.de>
next in thread | previous in thread | raw e-mail | index | archive | help
In message <20020707001019.GK23704@cicely5.cicely.de>, Bernd Walter writes: >I never saw any negative block numbers in on-disc structures. >Now I wonder if it was just hidden behind macros. >What is the reason to handle it that way? >Do you have some code reference for homework? These logical block numbers are not stored on disk; they are just used by the filesystem code to refer to block numbers within a file relative to the start of the file. The on-disk format uses direct and indirect block pointers to refer to the actual filesystem blocks, and it is easy to get from a lbn to the sequence of indirection blocks necessary to find the on-disk data. See ufs_getlbns() in sys/ufs/ufs/ufs_bmap.c for details. >> These are logical block numbers, which are fragment-sized (1K typically) (lbns are actually in block-sized, not fragment-sized units, since a single file block is always contiguous on the disk even if it does not begin on a disk block boundary or is not a full block in size. Physical UFS block numbers (ufs_daddr_t in the code) are in fragment-sized units.) >> Physical block numbers are 512-byte sized, with a range of 2^32 >> in -stable. This also winds up being 2TB. So increasing the fragment >> size does not help in -stable. >It's a proven fact that there is a 1T limit somewhere which was >explained with physical block numbers beeing signed. Yes, the daddr_t type is signed, so the real limit for filesystems is 1TB I think. Ian To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi? <200207070150.aa91552>