Re: [PATCH 3/8] reiserfs: Convert direct2indirect() to call folio_zero_range()

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

 



On Fri, Dec 16, 2022 at 08:53:42PM +0000, Matthew Wilcox (Oracle) wrote:
> Remove this open-coded call to kmap()/memset()/kunmap() with the
> higher-level abstraction folio_zero_range().
> 
> Signed-off-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx>

LGTM

Reviewed-by: Ira Weiny <ira.weiny@xxxxxxxxx>

> ---
>  fs/reiserfs/tail_conversion.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/reiserfs/tail_conversion.c b/fs/reiserfs/tail_conversion.c
> index a61bca73c45f..ca36bb88b8b0 100644
> --- a/fs/reiserfs/tail_conversion.c
> +++ b/fs/reiserfs/tail_conversion.c
> @@ -151,11 +151,11 @@ int direct2indirect(struct reiserfs_transaction_handle *th, struct inode *inode,
>  	 * out the unused part of the block (it was not up to date before)
>  	 */
>  	if (up_to_date_bh) {
> -		unsigned pgoff =
> -		    (tail_offset + total_tail - 1) & (PAGE_SIZE - 1);
> -		char *kaddr = kmap_atomic(up_to_date_bh->b_page);
> -		memset(kaddr + pgoff, 0, blk_size - total_tail);
> -		kunmap_atomic(kaddr);
> +		size_t start = offset_in_folio(up_to_date_bh->b_folio,
> +					(tail_offset + total_tail - 1));
> +
> +		folio_zero_range(up_to_date_bh->b_folio, start,
> +				blk_size - total_tail);
>  	}
>  
>  	REISERFS_I(inode)->i_first_direct_byte = U32_MAX;
> -- 
> 2.35.1
> 



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux