Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Sep 2003 01:29:28 -0700
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Eno Thereska <eno@andrew.cmu.edu>
Cc:        freebsd-fs@freebsd.org
Subject:   Re: free block bitmap
Message-ID:  <3F5EE0E8.40BF5801@mindspring.com>
References:  <3F5D0663.7020902@andrew.cmu.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
Eno Thereska wrote:
> I am using FreeBSD4.4 with FFS as the underlying file system.
> I need to examine which blocks in the file system
> are currently in use. These blocks can be metadata or data blocks.
> 
> I have looked at the FFS code and it seems the only way to get
> the list of free blocks (or busy blocks) is by querying
> each cylinder group's (cg) bitmap of free blocks.
> 
> Is there a global bitmap that keeps track of busy/free blocks
> over the entire file system or is the only option
> the cg-by-cg lookup?

You can do it two ways:

1)	Iterate over every file in the filesystem, and examine
	their direct and indirect blocks.

2)	Use the CG bitmaps.

Out of curiosity, why aren't the CG bitmaps global enough for
you?  Is your problem that they are logically rather than
physically contiguous?

-- Terry



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3F5EE0E8.40BF5801>