xfs: only reserve quota blocks for bmbt changes if we're changing the data fork
authorDarrick J. Wong <darrick.wong@oracle.com>
Mon, 29 Jun 2020 21:47:19 +0000 (14:47 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Mon, 6 Jul 2020 17:46:57 +0000 (10:46 -0700)
commitaa5d0ba0b5dbb5105276214c7f9124855b20f75e
treee445d2cc344d8f4d0526d5cf229fc23cd9c035c0
parent00fd1d56dd08a8ceaa9e4ee1a41fefd9f6c6bc7d
xfs: only reserve quota blocks for bmbt changes if we're changing the data fork

Now that we've reworked xfs_reflink_remap_extent to remap only one
extent per transaction, we actually know if the extent being removed is
an allocated mapping.  This means that we now know ahead of time if
we're going to be touching the data fork.

Since we only need blocks for a bmbt split if we're going to update the
data fork, we only need to get quota reservation if we know we're going
to touch the data fork.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
fs/xfs/xfs_reflink.c