[3/3] xfs: use xfs_inode_buftarg in xfs_file_ioctl
diff mbox series

Message ID 20191025021852.20172-4-hch@lst.de
State New
Headers show
Series
  • [1/3] xfs: add a xfs_inode_buftarg helper
Related show

Commit Message

Christoph Hellwig Oct. 25, 2019, 2:18 a.m. UTC
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/xfs/xfs_ioctl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Darrick J. Wong Oct. 25, 2019, 5:29 a.m. UTC | #1
On Fri, Oct 25, 2019 at 11:18:52AM +0900, Christoph Hellwig wrote:
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Looks ok,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

> ---
>  fs/xfs/xfs_ioctl.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
> index b7b5c17131cd..0fed56d3175c 100644
> --- a/fs/xfs/xfs_ioctl.c
> +++ b/fs/xfs/xfs_ioctl.c
> @@ -2135,10 +2135,8 @@ xfs_file_ioctl(
>  		return xfs_ioc_space(filp, cmd, &bf);
>  	}
>  	case XFS_IOC_DIOINFO: {
> -		struct dioattr	da;
> -		xfs_buftarg_t	*target =
> -			XFS_IS_REALTIME_INODE(ip) ?
> -			mp->m_rtdev_targp : mp->m_ddev_targp;
> +		struct xfs_buftarg	*target = xfs_inode_buftarg(ip);
> +		struct dioattr		da;
>  
>  		da.d_mem =  da.d_miniosz = target->bt_logical_sectorsize;
>  		da.d_maxiosz = INT_MAX & ~(da.d_miniosz - 1);
> -- 
> 2.20.1
>

Patch
diff mbox series

diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
index b7b5c17131cd..0fed56d3175c 100644
--- a/fs/xfs/xfs_ioctl.c
+++ b/fs/xfs/xfs_ioctl.c
@@ -2135,10 +2135,8 @@  xfs_file_ioctl(
 		return xfs_ioc_space(filp, cmd, &bf);
 	}
 	case XFS_IOC_DIOINFO: {
-		struct dioattr	da;
-		xfs_buftarg_t	*target =
-			XFS_IS_REALTIME_INODE(ip) ?
-			mp->m_rtdev_targp : mp->m_ddev_targp;
+		struct xfs_buftarg	*target = xfs_inode_buftarg(ip);
+		struct dioattr		da;
 
 		da.d_mem =  da.d_miniosz = target->bt_logical_sectorsize;
 		da.d_maxiosz = INT_MAX & ~(da.d_miniosz - 1);