summaryrefslogtreecommitdiff
path: root/fs/xfs/libxfs/xfs_alloc.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2021-09-01 11:15:58 -0700
committerDarrick J. Wong <djwong@kernel.org>2021-12-15 17:29:12 -0800
commit361f5659cc86fc6b4ec733ae0148cc8d1be407d7 (patch)
treea7284eea36afe43919253dfb317cfa2b38449113 /fs/xfs/libxfs/xfs_alloc.c
parent689466bfff44adfc8d79e8cc375d6d64b921a337 (diff)
xfs: convert "skip_discard" to a proper flags bitsetextfree-intent-cleanups_2021-12-15
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_alloc.c')
-rw-r--r--fs/xfs/libxfs/xfs_alloc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c
index 9a5c4a34e74d..9c95c4d1d55a 100644
--- a/fs/xfs/libxfs/xfs_alloc.c
+++ b/fs/xfs/libxfs/xfs_alloc.c
@@ -2541,12 +2541,12 @@ xfs_defer_agfl_block(
* The list is maintained sorted (by block number).
*/
void
-__xfs_free_extent_later(
+xfs_free_extent_later(
struct xfs_trans *tp,
xfs_fsblock_t bno,
xfs_filblks_t len,
const struct xfs_owner_info *oinfo,
- bool skip_discard)
+ unsigned int flags)
{
struct xfs_extent_free_item *new; /* new element */
#ifdef DEBUG
@@ -2564,6 +2564,7 @@ __xfs_free_extent_later(
ASSERT(agbno < mp->m_sb.sb_agblocks);
ASSERT(len < mp->m_sb.sb_agblocks);
ASSERT(agbno + len <= mp->m_sb.sb_agblocks);
+ ASSERT(!(flags & ~XFS_FREE_EXTENT_ALL_FLAGS));
#endif
ASSERT(xfs_extfree_item_cache != NULL);
@@ -2571,7 +2572,7 @@ __xfs_free_extent_later(
GFP_KERNEL | __GFP_NOFAIL);
new->xefi_startblock = bno;
new->xefi_blockcount = (xfs_extlen_t)len;
- if (skip_discard)
+ if (flags & XFS_FREE_EXTENT_SKIP_DISCARD)
new->xefi_flags |= XFS_EFI_SKIP_DISCARD;
if (oinfo) {
ASSERT(oinfo->oi_offset == 0);