]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: go straight to real allocations for direct I/O COW writes
authorChristoph Hellwig <hch@lst.de>
Tue, 4 Apr 2017 20:37:44 +0000 (15:37 -0500)
committerEric Sandeen <sandeen@redhat.com>
Tue, 4 Apr 2017 20:37:44 +0000 (15:37 -0500)
commitc4b23661de8ea36677cd54eee170efd04f5b5d7d
treecf2c63dc517e52fff7aa1e82c7f5edd9b8f74c13
parent4072e4b45d2988421d876e12e60dd0d422b4e9f4
xfs: go straight to real allocations for direct I/O COW writes

Source kernel commit: a14234c72bf41ac96bc8c98e96e2c84b6d4bd4f2

When we allocate COW fork blocks for direct I/O writes we currently first
create a delayed allocation, and then convert it to a real allocation
once we've got the delayed one.

As there is no good reason for that this patch instead makes use call
xfs_bmapi_write from the COW allocation path.  The only interesting bits
are a few tweaks the low-level allocator to allow for this, most notably
the need to remove the call to xfs_bmap_extsize_align for the cowextsize
in xfs_bmap_btalloc - for the existing convert case it's a no-op, but
for the direct allocation case it would blow up our block reservation
way beyond what we reserved for the transaction.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_bmap.c