[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FFS



On Sun, 3 Aug 2003 18:41:35 -0400 (EDT), Ted Unangst wrote
> 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?
> > What does represent a type of memory?
> 
> depends.  M_UFSMNT is for per mount info.  it should be pretty obvious
> from the source since each type is only used for one thing in most cases.
> look in the ffs source, and see what structure is allocated.
> many ffs structures are also stored in pool memory.

M_UFSMNT is used to allocate ufsmount structures
(/usr/src/sys/ufs/ufs/ufsmount.h).
The structure ufsmount is bigger than 28 bytes ( #define M_UFSMNT  28) so i
didn' t see the utility
of these types of memories used in malloc.
Whereas, after reading many sources, it seems to be used just for statistics
about memory allocations in kernel land.

> 
> > Does someone knows the working of the bread function because it returns me
the
> > EINVAL error. Does it read a logical block or a physical block?
> > I'm trying to read my disk superblock, my creds, vnode and offset seem to be
> > correct but i don't know where is the error and i have no idea about it.
> 
> it takes logical block numbers.  EINVAL is probably because you are
> reading past the end of the partition.

I just read the superblock (less than 100 bytes)

> 
> --
> someone's writing down your mistakes
> someone's documenting your downfall