]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: allocate sparse inode chunks on full chunk allocation failure
authorBrian Foster <bfoster@redhat.com>
Thu, 28 May 2015 23:18:32 +0000 (09:18 +1000)
committerDave Chinner <david@fromorbit.com>
Tue, 23 Jun 2015 05:07:55 +0000 (15:07 +1000)
commit2f577ca8cee9095aa36e643fe4c29dcc2894102f
treef7bdba26a963d5f3c87c52a3dc54e59b186b1033
parent8dff44ecc9a00a7cc0a36a599006e283f2fc4c87
xfs: allocate sparse inode chunks on full chunk allocation failure

xfs_ialloc_ag_alloc() makes several attempts to allocate a full inode
chunk. If all else fails, reduce the allocation to the sparse length and
alignment and attempt to allocate a sparse inode chunk.

If sparse chunk allocation succeeds, check whether an inobt record
already exists that can track the chunk. If so, inherit and update the
existing record. Otherwise, insert a new record for the sparse chunk.

Create helpers to align sparse chunk inode records and insert or update
existing records in the inode btrees. The xfs_inobt_insert_sprec()
helper implements the merge or update semantics required for sparse
inode records with respect to both the inobt and finobt. To update the
inobt, either insert a new record or merge with an existing record. To
update the finobt, use the updated inobt record to either insert or
replace an existing record.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
include/xfs_trace.h
libxfs/libxfs_priv.h
libxfs/xfs_ialloc.c
libxfs/xfs_ialloc_btree.c
libxfs/xfs_ialloc_btree.h