diff mbox series

[01/10] btrfs: Remove btree_readpage

Message ID 20200909094914.29721-2-nborisov@suse.com
State New, archived
Headers show
Series Cleanup metadata page reading path | expand

Commit Message

Nikolay Borisov Sept. 9, 2020, 9:49 a.m. UTC
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
 fs/btrfs/disk-io.c | 6 ------
 1 file changed, 6 deletions(-)

Comments

Johannes Thumshirn Sept. 9, 2020, 10:37 a.m. UTC | #1
On 09/09/2020 11:49, Nikolay Borisov wrote:
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>
> ---
>  fs/btrfs/disk-io.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> index 7147237d9bf0..d63498f3c75f 100644
> --- a/fs/btrfs/disk-io.c
> +++ b/fs/btrfs/disk-io.c
> @@ -949,11 +949,6 @@ static int btree_writepages(struct address_space *mapping,
>  	return btree_write_cache_pages(mapping, wbc);
>  }
>  
> -static int btree_readpage(struct file *file, struct page *page)
> -{
> -	return extent_read_full_page(page, btree_get_extent, 0);
> -}
> -
>  static int btree_releasepage(struct page *page, gfp_t gfp_flags)
>  {
>  	if (PageWriteback(page) || PageDirty(page))
> @@ -993,7 +988,6 @@ static int btree_set_page_dirty(struct page *page)
>  }
>  
>  static const struct address_space_operations btree_aops = {
> -	.readpage	= btree_readpage,
>  	.writepages	= btree_writepages,
>  	.releasepage	= btree_releasepage,
>  	.invalidatepage = btree_invalidatepage,
> 

Maybe you could add a little explanation why we can remove btree_readpage.
Qu Wenruo Sept. 9, 2020, 11:13 a.m. UTC | #2
On 2020/9/9 下午6:37, Johannes Thumshirn wrote:
> On 09/09/2020 11:49, Nikolay Borisov wrote:
>> Signed-off-by: Nikolay Borisov <nborisov@suse.com>
>> ---
>>  fs/btrfs/disk-io.c | 6 ------
>>  1 file changed, 6 deletions(-)
>>
>> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
>> index 7147237d9bf0..d63498f3c75f 100644
>> --- a/fs/btrfs/disk-io.c
>> +++ b/fs/btrfs/disk-io.c
>> @@ -949,11 +949,6 @@ static int btree_writepages(struct address_space *mapping,
>>  	return btree_write_cache_pages(mapping, wbc);
>>  }
>>
>> -static int btree_readpage(struct file *file, struct page *page)
>> -{
>> -	return extent_read_full_page(page, btree_get_extent, 0);
>> -}
>> -
>>  static int btree_releasepage(struct page *page, gfp_t gfp_flags)
>>  {
>>  	if (PageWriteback(page) || PageDirty(page))
>> @@ -993,7 +988,6 @@ static int btree_set_page_dirty(struct page *page)
>>  }
>>
>>  static const struct address_space_operations btree_aops = {
>> -	.readpage	= btree_readpage,
>>  	.writepages	= btree_writepages,
>>  	.releasepage	= btree_releasepage,
>>  	.invalidatepage = btree_invalidatepage,
>>
>
> Maybe you could add a little explanation why we can remove btree_readpage.
>
Same idea here.

The main concern is, wouldn't the exposed readpage callback being used
by some cache or whatever from the VFS layer?

Thanks,
Qu
diff mbox series

Patch

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 7147237d9bf0..d63498f3c75f 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -949,11 +949,6 @@  static int btree_writepages(struct address_space *mapping,
 	return btree_write_cache_pages(mapping, wbc);
 }
 
-static int btree_readpage(struct file *file, struct page *page)
-{
-	return extent_read_full_page(page, btree_get_extent, 0);
-}
-
 static int btree_releasepage(struct page *page, gfp_t gfp_flags)
 {
 	if (PageWriteback(page) || PageDirty(page))
@@ -993,7 +988,6 @@  static int btree_set_page_dirty(struct page *page)
 }
 
 static const struct address_space_operations btree_aops = {
-	.readpage	= btree_readpage,
 	.writepages	= btree_writepages,
 	.releasepage	= btree_releasepage,
 	.invalidatepage = btree_invalidatepage,