Commit a384f088 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Dan Williams

xfs: factor out a xfs_buftarg_is_dax helper

Refactor the DAX setup code in preparation of removing
bdev_dax_supported.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDan Williams <dan.j.williams@intel.com>
Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/20210826135510.6293-9-hch@lst.deSigned-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 60b8340f
......@@ -314,6 +314,14 @@ xfs_set_inode_alloc(
return (mp->m_flags & XFS_MOUNT_32BITINODES) ? maxagi : agcount;
}
static bool
xfs_buftarg_is_dax(
struct super_block *sb,
struct xfs_buftarg *bt)
{
return bdev_dax_supported(bt->bt_bdev, sb->s_blocksize);
}
STATIC int
xfs_blkdev_get(
xfs_mount_t *mp,
......@@ -1549,11 +1557,10 @@ xfs_fs_fill_super(
xfs_warn(mp,
"DAX enabled. Warning: EXPERIMENTAL, use at your own risk");
datadev_is_dax = bdev_dax_supported(mp->m_ddev_targp->bt_bdev,
sb->s_blocksize);
datadev_is_dax = xfs_buftarg_is_dax(sb, mp->m_ddev_targp);
if (mp->m_rtdev_targp)
rtdev_is_dax = bdev_dax_supported(
mp->m_rtdev_targp->bt_bdev, sb->s_blocksize);
rtdev_is_dax = xfs_buftarg_is_dax(sb,
mp->m_rtdev_targp);
if (!rtdev_is_dax && !datadev_is_dax) {
xfs_alert(mp,
"DAX unsupported by block device. Turning off DAX.");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment