summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_super.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2021-08-26 16:55:09 +0300
committerDan Williams <dan.j.williams@intel.com>2021-08-27 02:52:03 +0300
commita384f088e4a102b97a59bc0fdaf8b60bca177679 (patch)
tree34f4e4a80b37d492f90c0bd7c972120488b430de /fs/xfs/xfs_super.c
parent60b8340f0d6587d7b51990689fcdae567f309fbf (diff)
downloadlinux-a384f088e4a102b97a59bc0fdaf8b60bca177679.tar.xz
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 <hch@lst.de> Reviewed-by: Dan Williams <dan.j.williams@intel.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Link: https://lore.kernel.org/r/20210826135510.6293-9-hch@lst.de Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'fs/xfs/xfs_super.c')
-rw-r--r--fs/xfs/xfs_super.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index 2c9e26a44546..5a89bf601d97 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -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.");