diff options
author | Darrick J. Wong <djwong@kernel.org> | 2021-09-01 11:15:58 -0700 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2021-10-22 16:40:58 -0700 |
commit | 5337eb2d71d9de2191aa238afd69cc6141a7062d (patch) | |
tree | 785a6502080d542f178b1a216706df31fcc3c9d2 /fs/xfs/libxfs/xfs_bmap.c | |
parent | 9168e9bfe459112ffcf3f7431a0573bf07e059c5 (diff) |
xfs: convert "skip_discard" to a proper flags bitsetextfree-intent-cleanups_2021-10-22
Convert the boolean to skip discard on free into a proper flags field so
that we can add more flags in the next patch.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/xfs/libxfs/xfs_bmap.c')
-rw-r--r-- | fs/xfs/libxfs/xfs_bmap.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c index 4e4b0fdd5c1f..c95a30c0bb9b 100644 --- a/fs/xfs/libxfs/xfs_bmap.c +++ b/fs/xfs/libxfs/xfs_bmap.c @@ -583,7 +583,7 @@ xfs_bmap_btree_to_extents( if ((error = xfs_btree_check_block(cur, cblock, 0, cbp))) return error; xfs_rmap_ino_bmbt_owner(&oinfo, ip->i_ino, whichfork); - xfs_free_extent_later(cur->bc_tp, cbno, 1, &oinfo, false); + xfs_free_extent_later(cur->bc_tp, cbno, 1, &oinfo, 0); ip->i_nblocks--; xfs_trans_mod_dquot_byino(tp, ip, XFS_TRANS_DQ_BCOUNT, -1L); xfs_trans_binval(tp, cbp); @@ -5290,10 +5290,14 @@ xfs_bmap_del_extent_real( if (xfs_is_reflink_inode(ip) && whichfork == XFS_DATA_FORK) { xfs_refcount_decrease_extent(tp, del); } else { + unsigned int flags = 0; + + if ((bflags & XFS_BMAPI_NODISCARD) || + del->br_state == XFS_EXT_UNWRITTEN) + flags |= XFS_FREE_EXTENT_SKIP_DISCARD; + xfs_free_extent_later(tp, del->br_startblock, - del->br_blockcount, NULL, - (bflags & XFS_BMAPI_NODISCARD) || - del->br_state == XFS_EXT_UNWRITTEN); + del->br_blockcount, NULL, flags); } } |