Re: [PATCH 10/15] xfs: remove xfarray_sortinfo.page_kaddr

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jan 03, 2024 at 08:41:21AM +0000, Christoph Hellwig wrote:
> Now that xfile pages don't need kmapping, there is no need to cache
> the kernel virtual address for them.
> 
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>

LGTM!
Reviewed-by: Darrick J. Wong <djwong@xxxxxxxxxx>

--D

> ---
>  fs/xfs/scrub/xfarray.c | 22 ++++------------------
>  fs/xfs/scrub/xfarray.h |  1 -
>  2 files changed, 4 insertions(+), 19 deletions(-)
> 
> diff --git a/fs/xfs/scrub/xfarray.c b/fs/xfs/scrub/xfarray.c
> index 3a44700037924b..c29a240d4e25f4 100644
> --- a/fs/xfs/scrub/xfarray.c
> +++ b/fs/xfs/scrub/xfarray.c
> @@ -570,18 +570,7 @@ xfarray_sort_get_page(
>  	loff_t			pos,
>  	uint64_t		len)
>  {
> -	int			error;
> -
> -	error = xfile_get_page(si->array->xfile, pos, len, &si->xfpage);
> -	if (error)
> -		return error;
> -
> -	/*
> -	 * xfile pages must never be mapped into userspace, so we skip the
> -	 * dcache flush when mapping the page.
> -	 */
> -	si->page_kaddr = page_address(si->xfpage.page);
> -	return 0;
> +	return xfile_get_page(si->array->xfile, pos, len, &si->xfpage);
>  }
>  
>  /* Release a page we grabbed for sorting records. */
> @@ -589,11 +578,8 @@ static inline int
>  xfarray_sort_put_page(
>  	struct xfarray_sortinfo	*si)
>  {
> -	if (!si->page_kaddr)
> +	if (!xfile_page_cached(&si->xfpage))
>  		return 0;
> -
> -	si->page_kaddr = NULL;
> -
>  	return xfile_put_page(si->array->xfile, &si->xfpage);
>  }
>  
> @@ -636,7 +622,7 @@ xfarray_pagesort(
>  		return error;
>  
>  	xfarray_sort_bump_heapsorts(si);
> -	startp = si->page_kaddr + offset_in_page(lo_pos);
> +	startp = page_address(si->xfpage.page) + offset_in_page(lo_pos);
>  	sort(startp, hi - lo + 1, si->array->obj_size, si->cmp_fn, NULL);
>  
>  	xfarray_sort_bump_stores(si);
> @@ -883,7 +869,7 @@ xfarray_sort_load_cached(
>  			return error;
>  	}
>  
> -	memcpy(ptr, si->page_kaddr + offset_in_page(idx_pos),
> +	memcpy(ptr, page_address(si->xfpage.page) + offset_in_page(idx_pos),
>  			si->array->obj_size);
>  	return 0;
>  }
> diff --git a/fs/xfs/scrub/xfarray.h b/fs/xfs/scrub/xfarray.h
> index 62b9c506fdd1b7..6f2862054e194d 100644
> --- a/fs/xfs/scrub/xfarray.h
> +++ b/fs/xfs/scrub/xfarray.h
> @@ -107,7 +107,6 @@ struct xfarray_sortinfo {
>  
>  	/* Cache a page here for faster access. */
>  	struct xfile_page	xfpage;
> -	void			*page_kaddr;
>  
>  #ifdef DEBUG
>  	/* Performance statistics. */
> -- 
> 2.39.2
> 
> 




[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux