> On Sun, 22 Jul 2001, Steve Lord wrote:
> > > On Sun, 22 Jul 2001 at 08:03, Steve Lord wrote:
> > > > If you create a large number of files in XFS, inodes are allocated
> > > > dynamically for them. If you remove all the files, the inodes are not
> > >
> > > Yes, this is what I was referring to. I was under the impression that thi
> > > was "bad", though, and one effectively "lost space". Are inodes allocated
> > > dynamically for large files different from those allocated dynamically fo
> > > a bunch of small files? Meaning, if inodes are allocated for a large file
> > There is no distinction in XFS, an inode is an inode, no matter what it
> > is used for, they are all the same size (default 256 bytes on disk) and
> > they are allocated in groups of 32 by default (2 filesystem blocks worth).
> I think the question is about density here. Two large files create two
> inodes in a certain amount of disk. If those files are deleted does xfs
> create more inodes in that same amount of disk if small files are placed
> there? Or are there large holes?
OK, where the inodes live and where the file data lives are different
things. As I mentioned in previous email, the filesystem is split into
allocation groups, each allocation group is self contained when it comes
to free space and free inodes.
Within each allocation group free space is indexed as two btrees of
extents. One is organized by disk location, one is organized by size
of the space, the tree which is used for allocation depends on what
you want, next to some other space, or of a certain size. As space
is freed it is placed back into the tree, should it be next to
other free space the two extents are coalesced into a single extent.
Once space is released from a file, it is available for anyone else
to use. If all the free space happens to be in one large chunk and we
only want a small part of it we just use one end of the free space.
So yes, there are large holes, but these holes can be carved up into
lots of small chunks should the need arise, and in turn these small
chunks can be put back together into a large chunk of free space
should they all be freed again.
> James Rich