summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_bmap_util.c
diff options
context:
space:
mode:
authorChristoph Hellwig2018-07-18 01:51:51 +0200
committerDarrick J. Wong2018-07-30 16:57:48 +0200
commit51d626903083f7bd651d38b031775740ed41758c (patch)
treed9f2de99b862d7723dd848e7bc84c112de68f247 /fs/xfs/xfs_bmap_util.c
parentxfs: remove the xfs_ifork_t typedef (diff)
downloadkernel-qcow2-linux-51d626903083f7bd651d38b031775740ed41758c.tar.gz
kernel-qcow2-linux-51d626903083f7bd651d38b031775740ed41758c.tar.xz
kernel-qcow2-linux-51d626903083f7bd651d38b031775740ed41758c.zip
xfs: introduce a new xfs_inode_has_cow_data helper
We have a few places that already check if an inode has actual data in the COW fork to avoid work on reflink inodes that do not actually have outstanding COW blocks. There are a few more places that can avoid working if doing the same check, so add a documented helper for this condition and use it in all places where it makes sense. 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>
Diffstat (limited to 'fs/xfs/xfs_bmap_util.c')
-rw-r--r--fs/xfs/xfs_bmap_util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c
index c32ec17048f5..412dc58ae54d 100644
--- a/fs/xfs/xfs_bmap_util.c
+++ b/fs/xfs/xfs_bmap_util.c
@@ -1263,7 +1263,7 @@ xfs_prepare_shift(
* we've flushed all the dirty data out to disk to avoid having
* CoW extents at the wrong offsets.
*/
- if (xfs_is_reflink_inode(ip)) {
+ if (xfs_inode_has_cow_data(ip)) {
error = xfs_reflink_cancel_cow_range(ip, offset, NULLFILEOFF,
true);
if (error)