Skip to content

Commit a384f08

Browse files
Christoph Hellwigdjbw
authored andcommitted
xfs: factor out a xfs_buftarg_is_dax helper
Refactor the DAX setup code in preparation of removing bdev_dax_supported. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Dan Williams <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dan Williams <[email protected]>
1 parent 60b8340 commit a384f08

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

fs/xfs/xfs_super.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,14 @@ xfs_set_inode_alloc(
314314
return (mp->m_flags & XFS_MOUNT_32BITINODES) ? maxagi : agcount;
315315
}
316316

317+
static bool
318+
xfs_buftarg_is_dax(
319+
struct super_block *sb,
320+
struct xfs_buftarg *bt)
321+
{
322+
return bdev_dax_supported(bt->bt_bdev, sb->s_blocksize);
323+
}
324+
317325
STATIC int
318326
xfs_blkdev_get(
319327
xfs_mount_t *mp,
@@ -1549,11 +1557,10 @@ xfs_fs_fill_super(
15491557
xfs_warn(mp,
15501558
"DAX enabled. Warning: EXPERIMENTAL, use at your own risk");
15511559

1552-
datadev_is_dax = bdev_dax_supported(mp->m_ddev_targp->bt_bdev,
1553-
sb->s_blocksize);
1560+
datadev_is_dax = xfs_buftarg_is_dax(sb, mp->m_ddev_targp);
15541561
if (mp->m_rtdev_targp)
1555-
rtdev_is_dax = bdev_dax_supported(
1556-
mp->m_rtdev_targp->bt_bdev, sb->s_blocksize);
1562+
rtdev_is_dax = xfs_buftarg_is_dax(sb,
1563+
mp->m_rtdev_targp);
15571564
if (!rtdev_is_dax && !datadev_is_dax) {
15581565
xfs_alert(mp,
15591566
"DAX unsupported by block device. Turning off DAX.");

0 commit comments

Comments
 (0)