Re: [PATCH 1/7] udf: Convert udf_symlink_filler() to use a folio

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

 



On Wed 17-04-24 16:04:07, Matthew Wilcox (Oracle) wrote:
> Remove the conversion to struct page and use folio APIs throughout.
> 
> Signed-off-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx>

Looks good. I've just noticed this removes the SetPageError(). Grepping for
a while we seem to set/clear that in quite some places in the filesystems
but nobody is reading it these days (to be fair jfs has one test and btrfs
also one)? And similarly with folio_test_error... I have a recollection
this was actually used in the past but maybe you've removed it as part of
folio overhaul? Anyway, either something should start using the error bit
or we can drop the dead code and free up a page flags bit. Yay.

								Honza

> ---
>  fs/udf/symlink.c | 22 ++++++----------------
>  1 file changed, 6 insertions(+), 16 deletions(-)
> 
> diff --git a/fs/udf/symlink.c b/fs/udf/symlink.c
> index f7eaf7b14594..0105e7e2ba3d 100644
> --- a/fs/udf/symlink.c
> +++ b/fs/udf/symlink.c
> @@ -99,18 +99,17 @@ static int udf_pc_to_char(struct super_block *sb, unsigned char *from,
>  
>  static int udf_symlink_filler(struct file *file, struct folio *folio)
>  {
> -	struct page *page = &folio->page;
> -	struct inode *inode = page->mapping->host;
> +	struct inode *inode = folio->mapping->host;
>  	struct buffer_head *bh = NULL;
>  	unsigned char *symlink;
>  	int err = 0;
> -	unsigned char *p = page_address(page);
> +	unsigned char *p = folio_address(folio);
>  	struct udf_inode_info *iinfo = UDF_I(inode);
>  
>  	/* We don't support symlinks longer than one block */
>  	if (inode->i_size > inode->i_sb->s_blocksize) {
>  		err = -ENAMETOOLONG;
> -		goto out_unlock;
> +		goto out;
>  	}
>  
>  	if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) {
> @@ -120,24 +119,15 @@ static int udf_symlink_filler(struct file *file, struct folio *folio)
>  		if (!bh) {
>  			if (!err)
>  				err = -EFSCORRUPTED;
> -			goto out_err;
> +			goto out;
>  		}
>  		symlink = bh->b_data;
>  	}
>  
>  	err = udf_pc_to_char(inode->i_sb, symlink, inode->i_size, p, PAGE_SIZE);
>  	brelse(bh);
> -	if (err)
> -		goto out_err;
> -
> -	SetPageUptodate(page);
> -	unlock_page(page);
> -	return 0;
> -
> -out_err:
> -	SetPageError(page);
> -out_unlock:
> -	unlock_page(page);
> +out:
> +	folio_end_read(folio, err == 0);
>  	return err;
>  }
>  
> -- 
> 2.43.0
> 
-- 
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR




[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