xfs: only reserve quota blocks if we're mapping into a hole
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)
commit94b941fd7a98cebd6b77b8925c54ef76bbf7473f
treedda99da52df61b529be15b5c0a57efee45970914
parentaa5d0ba0b5dbb5105276214c7f9124855b20f75e
xfs: only reserve quota blocks if we're mapping into a hole

When logging quota block count updates during a reflink operation, we
only log the /delta/ of the block count changes to the dquot.  Since we
now know ahead of time the extent type of both dmap and smap (and that
they have the same length), we know that we only need to reserve quota
blocks for dmap's blockcount if we're mapping it into a hole.

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