dax: remove dax_capable

Just open code the block size and dax_dev == NULL checks in the callers.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Mike Snitzer <snitzer@redhat.com>
Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com> [erofs]
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/20211129102203.2243509-9-hch@lst.de
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
This commit is contained in:
Christoph Hellwig
2021-11-29 11:21:42 +01:00
committed by Dan Williams
parent 679a99495b
commit 7b0800d00d
11 changed files with 36 additions and 110 deletions

View File

@@ -331,28 +331,23 @@ xfs_set_inode_alloc(
return xfs_is_inode32(mp) ? maxagi : agcount;
}
static bool
xfs_buftarg_is_dax(
struct super_block *sb,
struct xfs_buftarg *bt)
{
return dax_supported(bt->bt_daxdev, bt->bt_bdev, sb->s_blocksize, 0,
bdev_nr_sectors(bt->bt_bdev));
}
static int
xfs_setup_dax_always(
struct xfs_mount *mp)
{
struct super_block *sb = mp->m_super;
if (!xfs_buftarg_is_dax(sb, mp->m_ddev_targp) &&
(!mp->m_rtdev_targp || !xfs_buftarg_is_dax(sb, mp->m_rtdev_targp))) {
if (!mp->m_ddev_targp->bt_daxdev &&
(!mp->m_rtdev_targp || !mp->m_rtdev_targp->bt_daxdev)) {
xfs_alert(mp,
"DAX unsupported by block device. Turning off DAX.");
goto disable_dax;
}
if (mp->m_super->s_blocksize != PAGE_SIZE) {
xfs_alert(mp,
"DAX not supported for blocksize. Turning off DAX.");
goto disable_dax;
}
if (xfs_has_reflink(mp)) {
xfs_alert(mp, "DAX and reflink cannot be used together!");
return -EINVAL;