btrfs: remove a couple pointless callback wrappers
cover btrfs: remove a couple pointless callback wrappers
From: Filipe Manana <[email protected]>
Trivial stuff, details in the change logs.
Filipe Manana (2):
btrfs: remove pointless readahead callback wrapper
btrfs: remove pointless writepages callback wrapper
fs/btrfs/extent_io.c | 5 ++--- fs/btrfs/extent_io.h | 5 ++--- fs/btrfs/inode.c | 11 ----------- 3 files changed, 4 insertions(+), 17 deletions(-)
Signature · 1 line
2.43.0
PATCH 1/2 btrfs: remove pointless readahead callback wrapper
From: Filipe Manana <[email protected]>
There's no point in having a static readahead callback in inode.c that does nothing besides calling extent_readahead() from extent_io.c. So just remove the callback at inode.c and rename extent_readahead() to btrfs_readahead().
--- fs/btrfs/extent_io.c | 2 +- fs/btrfs/extent_io.h | 2 +- fs/btrfs/inode.c | 5 ----- 3 files changed, 2 insertions(+), 7 deletions(-)
fs/btrfs/extent_io.c +1 -1
@@ -2277,7 +2277,7 @@ int extent_writepages(struct address_space *mapping,return ret; } -void extent_readahead (struct readahead_control *rac) +void btrfs_readahead (struct readahead_control *rac) {struct btrfs_bio_ctrl bio_ctrl = { .opf =REQ_OP_READ |REQ_RAHEAD };struct page *pagepool[16 ];
fs/btrfs/extent_io.h +1 -1
@@ -241,7 +241,7 @@ int extent_writepages(struct address_space *mapping, struct writeback_control *wbc);int btree_write_cache_pages (struct address_space *mapping,struct writeback_control *wbc); -void extent_readahead (struct readahead_control *rac); +void btrfs_readahead (struct readahead_control *rac);int extent_fiemap (struct btrfs_inode *inode,struct fiemap_extent_info *fieinfo,u64 start,u64 len);int set_folio_extent_mapped (struct folio *folio);
fs/btrfs/inode.c +0 -5
@@ -7919,11 +7919,6 @@ static int btrfs_writepages(struct address_space *mapping,return extent_writepages (mapping, wbc); } -static void btrfs_readahead (struct readahead_control *rac) -{ -extent_readahead (rac); -} -/* * For release_folio() and invalidate_folio() we have a race window where * folio_end_writeback() is called but the subpage spinlock is not yet released.
Signature · 1 line
2.43.0
PATCH 2/2 btrfs: remove pointless writepages callback wrapper
In reply to [email protected]From: Filipe Manana <[email protected]>
There's no point in having a static writepages callback in inode.c that does nothing besides calling extent_writepages from extent_io.c. So just remove the callback at inode.c and rename extent_writepages() to btrfs_writepages().
--- fs/btrfs/extent_io.c | 3 +-- fs/btrfs/extent_io.h | 3 +-- fs/btrfs/inode.c | 6 ------ 3 files changed, 2 insertions(+), 10 deletions(-)
fs/btrfs/extent_io.c +1 -2
@@ -2256,8 +2256,7 @@ void extent_write_locked_range(struct inode *inode, struct page *locked_page,submit_write_bio (&bio_ctrl, found_error ? ret :0 ); } -int extent_writepages (struct address_space *mapping, -struct writeback_control *wbc) +int btrfs_writepages (struct address_space *mapping,struct writeback_control *wbc) {struct inode *inode = mapping->host;int ret =0 ;
fs/btrfs/extent_io.h +1 -2
@@ -237,8 +237,7 @@ int btrfs_read_folio(struct file *file, struct folio *folio);void extent_write_locked_range (struct inode *inode,struct page *locked_page,u64 start,u64 end,struct writeback_control *wbc,bool pages_dirty); -int extent_writepages (struct address_space *mapping, -struct writeback_control *wbc); +int btrfs_writepages (struct address_space *mapping,struct writeback_control *wbc);int btree_write_cache_pages (struct address_space *mapping,struct writeback_control *wbc);void btrfs_readahead (struct readahead_control *rac);
fs/btrfs/inode.c +0 -6
@@ -7913,12 +7913,6 @@ static int btrfs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,return ret; } -static int btrfs_writepages (struct address_space *mapping, -struct writeback_control *wbc) -{ -return extent_writepages (mapping, wbc); -} -/* * For release_folio() and invalidate_folio() we have a race window where * folio_end_writeback() is called but the subpage spinlock is not yet released.
Signature · 1 line
2.43.0
Quoted 4 lines · On 18.03.24 13:15, [email protected] wrote:
From: Filipe Manana <[email protected]>
Trivial stuff, details in the change logs.
Quoted 9 lines
Filipe Manana (2):
btrfs: remove pointless readahead callback wrapper
btrfs: remove pointless writepages callback wrapperfs/btrfs/extent_io.c | 5 ++--- fs/btrfs/extent_io.h | 5 ++--- fs/btrfs/inode.c | 11 ----------- 3 files changed, 4 insertions(+), 17 deletions(-)
Looks good,
Quoted 9 lines · On 3/18/24 17:44, [email protected] wrote:
From: Filipe Manana <[email protected]>
Trivial stuff, details in the change logs.
Filipe Manana (2):
btrfs: remove pointless readahead callback wrapper
btrfs: remove pointless writepages callback wrapper
Thanks.
Quoted 5 lines
fs/btrfs/extent_io.c | 5 ++--- fs/btrfs/extent_io.h | 5 ++--- fs/btrfs/inode.c | 11 ----------- 3 files changed, 4 insertions(+), 17 deletions(-)
Quoted 7 lines · On Mon, Mar 18, 2024 at 12:14:54PM +0000, [email protected] wrote:
From: Filipe Manana <[email protected]>
Trivial stuff, details in the change logs.
Filipe Manana (2):
btrfs: remove pointless readahead callback wrapper
btrfs: remove pointless writepages callback wrapper
Quoted 3 lines · 在 2024/3/18 22:44, [email protected] 写道:
From: Filipe Manana <[email protected]>
Trivial stuff, details in the change logs.
I guess it's just exposed by some random code reading?
No automatic tools to expose such single line wrapper?
Quoted 4 lines
Filipe Manana (2):
btrfs: remove pointless readahead callback wrapper
btrfs: remove pointless writepages callback wrapper
Anyway looks good to me.
Thanks,
Qu
Quoted 6 lines
fs/btrfs/extent_io.c | 5 ++--- fs/btrfs/extent_io.h | 5 ++--- fs/btrfs/inode.c | 11 ----------- 3 files changed, 4 insertions(+), 17 deletions(-)
Quoted 9 lines · Qu Wenruo
Quoted 3 lines · 在 2024/3/18 22:44, [email protected] 写道:
From: Filipe Manana <[email protected]>
Trivial stuff, details in the change logs.
I guess it's just exposed by some random code reading?
Yes, by reading.
Quoted 2 lines
No automatic tools to expose such single line wrapper?
Not that I know of. Maybe some coccinelle script could do it, dunno.
Quoted 18 lines
Quoted 5 lines
Filipe Manana (2):
btrfs: remove pointless readahead callback wrapper
btrfs: remove pointless writepages callback wrapperAnyway looks good to me.
Reviewed-by Qu Wenruo <[email protected]>Thanks,
QuQuoted 6 lines
fs/btrfs/extent_io.c | 5 ++--- fs/btrfs/extent_io.h | 5 ++--- fs/btrfs/inode.c | 11 ----------- 3 files changed, 4 insertions(+), 17 deletions(-)
Quoted 10 lines · Qu Wenruo
Quoted 3 lines · 在 2024/3/18 22:44, [email protected] 写道:
From: Filipe Manana <[email protected]>
Trivial stuff, details in the change logs.
I guess it's just exposed by some random code reading?
No automatic tools to expose such single line wrapper?
---
dentifier FUNC, CALL;
type TYPE;
@@
TYPE
FUNC(...)
{
* return CALL(...);
}
---
but not all trivial helpers should be removed, some of them have a semantic value or pair another fuction that is not trivial.