diff options
author | Christoph Hellwig <hch@lst.de> | 2017-04-04 15:37:44 -0500 |
---|---|---|
committer | Eric Sandeen <sandeen@redhat.com> | 2017-04-04 15:37:44 -0500 |
commit | c4b23661de8ea36677cd54eee170efd04f5b5d7d (patch) | |
tree | cf2c63dc517e52fff7aa1e82c7f5edd9b8f74c13 | |
parent | 4072e4b45d2988421d876e12e60dd0d422b4e9f4 (diff) | |
download | xfsprogs-dev-c4b23661de8ea36677cd54eee170efd04f5b5d7d.tar.gz |
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>
-rw-r--r-- | libxfs/xfs_bmap.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c index c0d1e8dd27..a21a1ebd97 100644 --- a/libxfs/xfs_bmap.c +++ b/libxfs/xfs_bmap.c @@ -2886,13 +2886,14 @@ xfs_bmap_add_extent_hole_real( ASSERT(!isnullstartblock(new->br_startblock)); ASSERT(!bma->cur || !(bma->cur->bc_private.b.flags & XFS_BTCUR_BPRV_WASDEL)); - ASSERT(whichfork != XFS_COW_FORK); XFS_STATS_INC(mp, xs_add_exlist); state = 0; if (whichfork == XFS_ATTR_FORK) state |= BMAP_ATTRFORK; + if (whichfork == XFS_COW_FORK) + state |= BMAP_COWFORK; /* * Check and set flags if this segment has a left neighbor. |