Re: [PATCH 04/45] xfs: remove xfs_blkdev_issue_flush

Brian Foster
2021-03-15T14:42:56Z

On Fri, Mar 05, 2021 at 04:11:02PM +1100, Dave Chinner wrote:
> From: Dave Chinner <dchinner@redhat.com>
>
> It's a one line wrapper around blkdev_issue_flush(). Just replace it
> with direct calls to blkdev_issue_flush().
>
> Signed-off-by: Dave Chinner <dchinner@redhat.com>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

> fs/xfs/xfs_buf.c | 2 +-
> fs/xfs/xfs_file.c | 6 +++---
> fs/xfs/xfs_log.c | 2 +-
> fs/xfs/xfs_super.c | 7 -------
> fs/xfs/xfs_super.h | 1 -
> 5 files changed, 5 insertions(+), 13 deletions(-)
>
> diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
> index 37a1d12762d8..7043546a04b8 100644
> --- a/fs/xfs/xfs_buf.c
> +++ b/fs/xfs/xfs_buf.c
> @@ -1958,7 +1958,7 @@ xfs_free_buftarg(
> percpu_counter_destroy(&btp->bt_io_count);
> list_lru_destroy(&btp->bt_lru);
>
> - xfs_blkdev_issue_flush(btp);
> + blkdev_issue_flush(btp->bt_bdev);
>
> kmem_free(btp);
> }
> diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
> index a007ca0711d9..24c7f45fc4eb 100644
> --- a/fs/xfs/xfs_file.c
> +++ b/fs/xfs/xfs_file.c
> @@ -197,9 +197,9 @@ xfs_file_fsync(
> * inode size in case of an extending write.
> */
> if (XFS_IS_REALTIME_INODE(ip))
> - xfs_blkdev_issue_flush(mp->m_rtdev_targp);
> + blkdev_issue_flush(mp->m_rtdev_targp->bt_bdev);
> else if (mp->m_logdev_targp != mp->m_ddev_targp)
> - xfs_blkdev_issue_flush(mp->m_ddev_targp);
> + blkdev_issue_flush(mp->m_ddev_targp->bt_bdev);
>
> /*
> * Any inode that has dirty modifications in the log is pinned. The
> @@ -219,7 +219,7 @@ xfs_file_fsync(
> */
> if (!log_flushed && !XFS_IS_REALTIME_INODE(ip) &&
> mp->m_logdev_targp == mp->m_ddev_targp)
> - xfs_blkdev_issue_flush(mp->m_ddev_targp);
> + blkdev_issue_flush(mp->m_ddev_targp->bt_bdev);
>
> return error;
> }
> diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
> index 317c466232d4..fee76c485727 100644
> --- a/fs/xfs/xfs_log.c
> +++ b/fs/xfs/xfs_log.c
> @@ -1962,7 +1962,7 @@ xlog_sync(
> * layer state machine for preflushes.
> */
> if (log->l_targ != log->l_mp->m_ddev_targp || split) {
> - xfs_blkdev_issue_flush(log->l_mp->m_ddev_targp);
> + blkdev_issue_flush(log->l_mp->m_ddev_targp->bt_bdev);
> need_flush = false;
> }
>
> diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
> index e5e0713bebcd..ca2cb0448b5e 100644
> --- a/fs/xfs/xfs_super.c
> +++ b/fs/xfs/xfs_super.c
> @@ -339,13 +339,6 @@ xfs_blkdev_put(
> blkdev_put(bdev, FMODE_READ|FMODE_WRITE|FMODE_EXCL);
> }
>
> -void
> -xfs_blkdev_issue_flush(
> - xfs_buftarg_t *buftarg)
> -{
> - blkdev_issue_flush(buftarg->bt_bdev);
> -}
> -
> STATIC void
> xfs_close_devices(
> struct xfs_mount *mp)
> diff --git a/fs/xfs/xfs_super.h b/fs/xfs/xfs_super.h
> index 1ca484b8357f..79cb2dece811 100644
> --- a/fs/xfs/xfs_super.h
> +++ b/fs/xfs/xfs_super.h
> @@ -88,7 +88,6 @@ struct block_device;
>
> extern void xfs_quiesce_attr(struct xfs_mount *mp);
> extern void xfs_flush_inodes(struct xfs_mount *mp);
> -extern void xfs_blkdev_issue_flush(struct xfs_buftarg *);
> extern xfs_agnumber_t xfs_set_inode_alloc(struct xfs_mount *,
> xfs_agnumber_t agcount);
>
> --
> 2.28.0
>