summaryrefslogtreecommitdiff
path: root/fs/xfs/libxfs/xfs_alloc.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2022-07-14 11:15:26 -0700
committerDarrick J. Wong <djwong@kernel.org>2022-10-14 14:17:12 -0700
commit0bd217fd35635b40137742a2183cb66b72648ba1 (patch)
treed3fbe25e415044cfd1f331cb7bfd5e0ded8c2836 /fs/xfs/libxfs/xfs_alloc.c
parent14b661224091388757e0e337a70356d42bbf94b3 (diff)
xfs: convert "skip_discard" to a proper flags bitsetextfree-intent-cleanups_2022-10-14
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 36bf862112d1..8ec1e6b8ad1d 100644
--- a/fs/xfs/libxfs/xfs_alloc.c
+++ b/fs/xfs/libxfs/xfs_alloc.c
@@ -2560,12 +2560,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
@@ -2583,6 +2583,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);
@@ -2590,7 +2591,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);