All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Christoph Hellwig <hch@lst.de>
Cc: linux-xfs@vger.kernel.org,
	Allison Collins <allison.henderson@oracle.com>
Subject: Re: [PATCH 3/9] xfs: remove the mappedbno argument to xfs_da_reada_buf
Date: Mon, 18 Nov 2019 13:22:27 -0800	[thread overview]
Message-ID: <20191118212227.GX6219@magnolia> (raw)
In-Reply-To: <20191116182214.23711-4-hch@lst.de>

On Sat, Nov 16, 2019 at 07:22:08PM +0100, Christoph Hellwig wrote:
> Replace the mappedbno argument with the simple flags for xfs_da_reada_buf
> and xfs_dir3_data_readahead.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

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

--D

> ---
>  fs/xfs/libxfs/xfs_da_btree.c  | 10 ++--------
>  fs/xfs/libxfs/xfs_da_btree.h  |  4 ++--
>  fs/xfs/libxfs/xfs_dir2_data.c |  6 +++---
>  fs/xfs/libxfs/xfs_dir2_priv.h |  4 ++--
>  fs/xfs/scrub/parent.c         |  2 +-
>  fs/xfs/xfs_dir2_readdir.c     |  3 ++-
>  fs/xfs/xfs_file.c             |  2 +-
>  7 files changed, 13 insertions(+), 18 deletions(-)
> 
> diff --git a/fs/xfs/libxfs/xfs_da_btree.c b/fs/xfs/libxfs/xfs_da_btree.c
> index c26f139bcf00..b1b0b38d7747 100644
> --- a/fs/xfs/libxfs/xfs_da_btree.c
> +++ b/fs/xfs/libxfs/xfs_da_btree.c
> @@ -2747,7 +2747,7 @@ int
>  xfs_da_reada_buf(
>  	struct xfs_inode	*dp,
>  	xfs_dablk_t		bno,
> -	xfs_daddr_t		mappedbno,
> +	unsigned int		flags,
>  	int			whichfork,
>  	const struct xfs_buf_ops *ops)
>  {
> @@ -2756,14 +2756,9 @@ xfs_da_reada_buf(
>  	int			nmap;
>  	int			error;
>  
> -	if (mappedbno >= 0)
> -		return -EINVAL;
> -
>  	mapp = &map;
>  	nmap = 1;
> -	error = xfs_dabuf_map(dp, bno,
> -			mappedbno == -1 ? XFS_DABUF_MAP_HOLE_OK : 0,
> -			whichfork, &mapp, &nmap);
> +	error = xfs_dabuf_map(dp, bno, flags, whichfork, &mapp, &nmap);
>  	if (error) {
>  		/* mapping a hole is not an error, but we don't continue */
>  		if (error == -ENOENT)
> @@ -2771,7 +2766,6 @@ xfs_da_reada_buf(
>  		goto out_free;
>  	}
>  
> -	mappedbno = mapp[0].bm_bn;
>  	xfs_buf_readahead_map(dp->i_mount->m_ddev_targp, mapp, nmap, ops);
>  
>  out_free:
> diff --git a/fs/xfs/libxfs/xfs_da_btree.h b/fs/xfs/libxfs/xfs_da_btree.h
> index 9ec0d0243e96..4ba0ded7b973 100644
> --- a/fs/xfs/libxfs/xfs_da_btree.h
> +++ b/fs/xfs/libxfs/xfs_da_btree.h
> @@ -218,8 +218,8 @@ int	xfs_da_read_buf(struct xfs_trans *trans, struct xfs_inode *dp,
>  			       struct xfs_buf **bpp, int whichfork,
>  			       const struct xfs_buf_ops *ops);
>  int	xfs_da_reada_buf(struct xfs_inode *dp, xfs_dablk_t bno,
> -				xfs_daddr_t mapped_bno, int whichfork,
> -				const struct xfs_buf_ops *ops);
> +		unsigned int flags, int whichfork,
> +		const struct xfs_buf_ops *ops);
>  int	xfs_da_shrink_inode(xfs_da_args_t *args, xfs_dablk_t dead_blkno,
>  					  struct xfs_buf *dead_buf);
>  
> diff --git a/fs/xfs/libxfs/xfs_dir2_data.c b/fs/xfs/libxfs/xfs_dir2_data.c
> index 9e471a28b6c6..10680f6422c2 100644
> --- a/fs/xfs/libxfs/xfs_dir2_data.c
> +++ b/fs/xfs/libxfs/xfs_dir2_data.c
> @@ -417,10 +417,10 @@ int
>  xfs_dir3_data_readahead(
>  	struct xfs_inode	*dp,
>  	xfs_dablk_t		bno,
> -	xfs_daddr_t		mapped_bno)
> +	unsigned int		flags)
>  {
> -	return xfs_da_reada_buf(dp, bno, mapped_bno,
> -				XFS_DATA_FORK, &xfs_dir3_data_reada_buf_ops);
> +	return xfs_da_reada_buf(dp, bno, flags, XFS_DATA_FORK,
> +				&xfs_dir3_data_reada_buf_ops);
>  }
>  
>  /*
> diff --git a/fs/xfs/libxfs/xfs_dir2_priv.h b/fs/xfs/libxfs/xfs_dir2_priv.h
> index a22222df4bf2..a730c5223c64 100644
> --- a/fs/xfs/libxfs/xfs_dir2_priv.h
> +++ b/fs/xfs/libxfs/xfs_dir2_priv.h
> @@ -76,8 +76,8 @@ extern xfs_failaddr_t __xfs_dir3_data_check(struct xfs_inode *dp,
>  		struct xfs_buf *bp);
>  extern int xfs_dir3_data_read(struct xfs_trans *tp, struct xfs_inode *dp,
>  		xfs_dablk_t bno, xfs_daddr_t mapped_bno, struct xfs_buf **bpp);
> -extern int xfs_dir3_data_readahead(struct xfs_inode *dp, xfs_dablk_t bno,
> -		xfs_daddr_t mapped_bno);
> +int xfs_dir3_data_readahead(struct xfs_inode *dp, xfs_dablk_t bno,
> +		unsigned int flags);
>  
>  extern struct xfs_dir2_data_free *
>  xfs_dir2_data_freeinsert(struct xfs_dir2_data_hdr *hdr,
> diff --git a/fs/xfs/scrub/parent.c b/fs/xfs/scrub/parent.c
> index c962bd534690..17100a83e23e 100644
> --- a/fs/xfs/scrub/parent.c
> +++ b/fs/xfs/scrub/parent.c
> @@ -80,7 +80,7 @@ xchk_parent_count_parent_dentries(
>  	 */
>  	lock_mode = xfs_ilock_data_map_shared(parent);
>  	if (parent->i_d.di_nextents > 0)
> -		error = xfs_dir3_data_readahead(parent, 0, -1);
> +		error = xfs_dir3_data_readahead(parent, 0, 0);
>  	xfs_iunlock(parent, lock_mode);
>  	if (error)
>  		return error;
> diff --git a/fs/xfs/xfs_dir2_readdir.c b/fs/xfs/xfs_dir2_readdir.c
> index b149cb4a4d86..f23f3b23ec37 100644
> --- a/fs/xfs/xfs_dir2_readdir.c
> +++ b/fs/xfs/xfs_dir2_readdir.c
> @@ -315,7 +315,8 @@ xfs_dir2_leaf_readbuf(
>  				break;
>  			}
>  			if (next_ra > *ra_blk) {
> -				xfs_dir3_data_readahead(dp, next_ra, -2);
> +				xfs_dir3_data_readahead(dp, next_ra,
> +						        XFS_DABUF_MAP_HOLE_OK);
>  				*ra_blk = next_ra;
>  			}
>  			ra_want -= geo->fsbcount;
> diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
> index 865543e41fb4..c93250108952 100644
> --- a/fs/xfs/xfs_file.c
> +++ b/fs/xfs/xfs_file.c
> @@ -1104,7 +1104,7 @@ xfs_dir_open(
>  	 */
>  	mode = xfs_ilock_data_map_shared(ip);
>  	if (ip->i_d.di_nextents > 0)
> -		error = xfs_dir3_data_readahead(ip, 0, -1);
> +		error = xfs_dir3_data_readahead(ip, 0, 0);
>  	xfs_iunlock(ip, mode);
>  	return error;
>  }
> -- 
> 2.20.1
> 

  reply	other threads:[~2019-11-18 21:22 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-16 18:22 RFC: clean up the dabuf mappedbno interface Christoph Hellwig
2019-11-16 18:22 ` [PATCH 1/9] xfs: simplify mappedbno case from xfs_da_get_buf and xfs_da_read_buf Christoph Hellwig
2019-11-18 21:21   ` Darrick J. Wong
2019-11-16 18:22 ` [PATCH 2/9] xfs: improve the xfs_dabuf_map calling conventions Christoph Hellwig
2019-11-17 18:35   ` Darrick J. Wong
2019-11-18  6:25     ` Christoph Hellwig
2019-11-19 17:12       ` Darrick J. Wong
2019-11-19 17:15         ` Christoph Hellwig
2019-11-16 18:22 ` [PATCH 3/9] xfs: remove the mappedbno argument to xfs_da_reada_buf Christoph Hellwig
2019-11-18 21:22   ` Darrick J. Wong [this message]
2019-11-16 18:22 ` [PATCH 4/9] xfs: remove the mappedbno argument to xfs_attr3_leaf_read Christoph Hellwig
2019-11-18 21:22   ` Darrick J. Wong
2019-11-16 18:22 ` [PATCH 5/9] xfs: remove the mappedbno argument to xfs_dir3_leaf_read Christoph Hellwig
2019-11-18 21:23   ` Darrick J. Wong
2019-11-18 21:23   ` Darrick J. Wong
2019-11-16 18:22 ` [PATCH 6/9] xfs: remove the mappedbno argument to xfs_dir3_leafn_read Christoph Hellwig
2019-11-18 21:23   ` Darrick J. Wong
2019-11-16 18:22 ` [PATCH 7/9] xfs: split xfs_da3_node_read Christoph Hellwig
2019-11-18 21:24   ` Darrick J. Wong
2019-11-16 18:22 ` [PATCH 8/9] xfs: remove the mappedbno argument to xfs_da_read_buf Christoph Hellwig
2019-11-18 21:29   ` Darrick J. Wong
2019-11-16 18:22 ` [PATCH 9/9] xfs: remove the mappedbno argument to xfs_da_get_buf Christoph Hellwig
2019-11-18 21:32   ` Darrick J. Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191118212227.GX6219@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=allison.henderson@oracle.com \
    --cc=hch@lst.de \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.