xfs: add a xfs_inode_buftarg helper
Add a new xfs_inode_buftarg helper that gets the data I/O buftarg for a given inode. Replace the existing xfs_find_bdev_for_inode and xfs_find_daxdev_for_inode helpers with this new general one and cleanup some of the callers. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
This commit is contained in:

committed by
Darrick J. Wong

parent
25a409572b
commit
30fa529e3b
@@ -1311,10 +1311,9 @@ xfs_ioctl_setattr_dax_invalidate(
|
||||
* have to check the device for dax support or flush pagecache.
|
||||
*/
|
||||
if (fa->fsx_xflags & FS_XFLAG_DAX) {
|
||||
if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode)))
|
||||
return -EINVAL;
|
||||
if (!bdev_dax_supported(xfs_find_bdev_for_inode(VFS_I(ip)),
|
||||
sb->s_blocksize))
|
||||
struct xfs_buftarg *target = xfs_inode_buftarg(ip);
|
||||
|
||||
if (!bdev_dax_supported(target->bt_bdev, sb->s_blocksize))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user