Current-Users archive

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

UFS2 feature: inode space used for data



I was reading about the history of the Unix File System. In
https://www.usenix.org/legacy/events/bsdcon03/tech/full_papers/mckusick/mckusick_html/
"Enhancements to the Fast Filesystem To Support Multi-Terabyte Storage
Systems"
there is this in section 

    4.1. Dynamic Inodes

    One of the common complaints about the UFS1 filesystem is that it
    preallocates all its inodes at the time that the filesystem is
    created.  For filesystems with millions of files, the initialization
    of the filesystem can take several hours. Additionally, the
    filesystem creation program, newfs, had to assume that every
    filesystem would be filled with many small files and allocate a lot
    more inodes than were likely to ever be used. If a UFS1 filesystem
    uses up all its inodes, the only way to get more is to dump,
    rebuild, and restore the filesystem. The UFS2 filesystem resolves
    these problems by dynamically allocating its inodes.  [...]

    To avoid these costs, UFS2 preallocates a range of inode numbers and
    a set of blocks for each cylinder group. Initially each cylinder
    group has a single block of inodes allocated (a typical block holds
    32 or 64 inodes). When the block fills up, the next block of inodes
    in the set is allocated and initialized. The set of blocks that may
    be allocated to inodes is held as part of the free-space reserve
    until all other space in the filesystem is allocated. Only then can
    it be used for file data. 

I have indeed seen that we have code to delay initializing the inodes.

But the bit at the end: if you don't need so many inodes, but run out of
data space, then unused inode blocks can be re-purposed as data blocks.
It doesn't look like we have that? At least I can't find any comment to
that effect. Code would likely involve looking at and/or modifying
cgp->cg_initediblk, but that field is used very rarely and not for this
purpose. (On the other hand, I can't find such code in FreeBSD either,
and I would expect it to be there, if anywhere.)

Is my impression correct?

-Olaf.
-- 
___ Olaf 'Rhialto' Seibert  -- "What good is a Ring of Power
\X/ rhialto/at/falu.nl      -- if you're unable...to Speak." - Agent Elrond

Attachment: signature.asc
Description: PGP signature



Home | Main Index | Thread Index | Old Index