Re: [PATCH 24/31] ext4: Convert ext4_mpage_readpages() to work on folios

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

 



On Thu, Jan 26, 2023 at 08:24:08PM +0000, Matthew Wilcox (Oracle) wrote:
>  int ext4_mpage_readpages(struct inode *inode,
> -		struct readahead_control *rac, struct page *page)
> +		struct readahead_control *rac, struct folio *folio)
>  {
>  	struct bio *bio = NULL;
>  	sector_t last_block_in_bio = 0;
> @@ -247,16 +247,15 @@ int ext4_mpage_readpages(struct inode *inode,
>  		int fully_mapped = 1;
>  		unsigned first_hole = blocks_per_page;
>  
> -		if (rac) {
> -			page = readahead_page(rac);
> -			prefetchw(&page->flags);
> -		}
> +		if (rac)
> +			folio = readahead_folio(rac);
> +		prefetchw(&folio->flags);

Unlike readahead_page(), readahead_folio() puts the folio immediately.  Is that
really safe?

> @@ -299,11 +298,11 @@ int ext4_mpage_readpages(struct inode *inode,
>  
>  				if (ext4_map_blocks(NULL, inode, &map, 0) < 0) {
>  				set_error_page:
> -					SetPageError(page);
> -					zero_user_segment(page, 0,
> -							  PAGE_SIZE);
> -					unlock_page(page);
> -					goto next_page;
> +					folio_set_error(folio);
> +					folio_zero_segment(folio, 0,
> +							  folio_size(folio));
> +					folio_unlock(folio);
> +					continue;

This is 'continuing' the inner loop, not the outer loop as it should.

- Eric



[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