Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Aug 2003 12:15:03 -0400 (EDT)
From:      Robert Watson <rwatson@freebsd.org>
To:        david ramblewski <poluc@nerim.fr>
Cc:        freebsd hackers <freebsd-hackers@freebsd.org>
Subject:   Re: FFS
Message-ID:  <Pine.NEB.3.96L.1030803121148.97224B-100000@fledge.watson.org>
In-Reply-To: <20030803140545.M99345@nerim.fr>

next in thread | previous in thread | raw e-mail | index | archive | help

On Sun, 3 Aug 2003, david ramblewski wrote:

> I am modifying the mount code and i find this:
> malloc(...,M_UFSMNT,...)
> 
> In malloc.h:
> #define M_UFSMNT 28
> 
> There is a lot of "define" about filesystems in malloc.h and it seems to
> represent every types of memories which can be allocated.  I'm searching
> in the source but i don't know how and why they use it.  Someone knows
> the solution? 

I don't believe code looking like this has existed in FreeBSD since 2.x,
or maybe early 3.x;  what version of the source code are you using?  I
noticed recently that Darwin uses this approach still, however.  In
FreeBSD 4.x and 5.x (and I believe 3.x), malloc types are defined using
the MALLOC_DEFINE() macro, and declared using MALLOC_DECL().  You can read
the malloc(9) man page for some details on how to use the buckets.  If you
use vmstat -m, you can see reports on the bucket sizes and allocation on a
running kernel. 

> Does someone knows where i can find documentations about filesystems
> under BSD (FFS).

I'd suggest starting with the "BSD Book" -- Design and Implementation of
4.4BSD by McKusick, et al.  That should include some basic background on
the fast file system.  More recently, you'll want to read the
USENIX/FREENIX/BSDCON papers on Soft Updates, background file system
checking, snapshotting, et al.  Take a look at the USENIX web site for
these papers.

Robert N M Watson             FreeBSD Core Team, TrustedBSD Projects
robert@fledge.watson.org      Network Associates Laboratories




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1030803121148.97224B-100000>