All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] btrfs: remove a couple pointless callback wrappers
@ 2024-03-18 12:14 fdmanana
  2024-03-18 12:14 ` [PATCH 1/2] btrfs: remove pointless readahead callback wrapper fdmanana
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: fdmanana @ 2024-03-18 12:14 UTC (permalink / raw)
  To: linux-btrfs

From: Filipe Manana <fdmanana@suse.com>

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(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/2] btrfs: remove pointless readahead callback wrapper
  2024-03-18 12:14 [PATCH 0/2] btrfs: remove a couple pointless callback wrappers fdmanana
@ 2024-03-18 12:14 ` fdmanana
  2024-03-18 12:14 ` [PATCH 2/2] btrfs: remove pointless writepages " fdmanana
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: fdmanana @ 2024-03-18 12:14 UTC (permalink / raw)
  To: linux-btrfs

From: Filipe Manana <fdmanana@suse.com>

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().

Signed-off-by: Filipe Manana <fdmanana@suse.com>
---
 fs/btrfs/extent_io.c | 2 +-
 fs/btrfs/extent_io.h | 2 +-
 fs/btrfs/inode.c     | 5 -----
 3 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 7441245b1ceb..47a299b0fa2d 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -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];
diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h
index e3530d427e1f..eb123b0499e1 100644
--- a/fs/btrfs/extent_io.h
+++ b/fs/btrfs/extent_io.h
@@ -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);
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 37701531eeb1..e447a4f1d926 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -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.
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/2] btrfs: remove pointless writepages callback wrapper
  2024-03-18 12:14 [PATCH 0/2] btrfs: remove a couple pointless callback wrappers fdmanana
  2024-03-18 12:14 ` [PATCH 1/2] btrfs: remove pointless readahead callback wrapper fdmanana
@ 2024-03-18 12:14 ` fdmanana
  2024-03-18 12:56 ` [PATCH 0/2] btrfs: remove a couple pointless callback wrappers Johannes Thumshirn
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: fdmanana @ 2024-03-18 12:14 UTC (permalink / raw)
  To: linux-btrfs

From: Filipe Manana <fdmanana@suse.com>

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().

Signed-off-by: Filipe Manana <fdmanana@suse.com>
---
 fs/btrfs/extent_io.c | 3 +--
 fs/btrfs/extent_io.h | 3 +--
 fs/btrfs/inode.c     | 6 ------
 3 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 47a299b0fa2d..4a684251fd96 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -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;
diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h
index eb123b0499e1..818431b37124 100644
--- a/fs/btrfs/extent_io.h
+++ b/fs/btrfs/extent_io.h
@@ -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);
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index e447a4f1d926..1fd2ea80caef 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -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.
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/2] btrfs: remove a couple pointless callback wrappers
  2024-03-18 12:14 [PATCH 0/2] btrfs: remove a couple pointless callback wrappers fdmanana
  2024-03-18 12:14 ` [PATCH 1/2] btrfs: remove pointless readahead callback wrapper fdmanana
  2024-03-18 12:14 ` [PATCH 2/2] btrfs: remove pointless writepages " fdmanana
@ 2024-03-18 12:56 ` Johannes Thumshirn
  2024-03-18 15:00 ` Anand Jain
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Johannes Thumshirn @ 2024-03-18 12:56 UTC (permalink / raw)
  To: fdmanana, linux-btrfs

On 18.03.24 13:15, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
> 
> 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(-)
> 

Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/2] btrfs: remove a couple pointless callback wrappers
  2024-03-18 12:14 [PATCH 0/2] btrfs: remove a couple pointless callback wrappers fdmanana
                   ` (2 preceding siblings ...)
  2024-03-18 12:56 ` [PATCH 0/2] btrfs: remove a couple pointless callback wrappers Johannes Thumshirn
@ 2024-03-18 15:00 ` Anand Jain
  2024-03-18 18:45 ` David Sterba
  2024-03-18 20:12 ` Qu Wenruo
  5 siblings, 0 replies; 9+ messages in thread
From: Anand Jain @ 2024-03-18 15:00 UTC (permalink / raw)
  To: fdmanana, linux-btrfs

On 3/18/24 17:44, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
> 
> Trivial stuff, details in the change logs.
> 
> Filipe Manana (2):


>    btrfs: remove pointless readahead callback wrapper
>    btrfs: remove pointless writepages callback wrapper

Reviewed-by: Anand Jain <anand.jain@oracle.com>

Thanks.

>   fs/btrfs/extent_io.c |  5 ++---
>   fs/btrfs/extent_io.h |  5 ++---
>   fs/btrfs/inode.c     | 11 -----------
>   3 files changed, 4 insertions(+), 17 deletions(-)
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/2] btrfs: remove a couple pointless callback wrappers
  2024-03-18 12:14 [PATCH 0/2] btrfs: remove a couple pointless callback wrappers fdmanana
                   ` (3 preceding siblings ...)
  2024-03-18 15:00 ` Anand Jain
@ 2024-03-18 18:45 ` David Sterba
  2024-03-18 20:12 ` Qu Wenruo
  5 siblings, 0 replies; 9+ messages in thread
From: David Sterba @ 2024-03-18 18:45 UTC (permalink / raw)
  To: fdmanana; +Cc: linux-btrfs

On Mon, Mar 18, 2024 at 12:14:54PM +0000, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
> 
> Trivial stuff, details in the change logs.
> 
> Filipe Manana (2):
>   btrfs: remove pointless readahead callback wrapper
>   btrfs: remove pointless writepages callback wrapper

Reviewed-by: David Sterba <dsterba@suse.com>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/2] btrfs: remove a couple pointless callback wrappers
  2024-03-18 12:14 [PATCH 0/2] btrfs: remove a couple pointless callback wrappers fdmanana
                   ` (4 preceding siblings ...)
  2024-03-18 18:45 ` David Sterba
@ 2024-03-18 20:12 ` Qu Wenruo
  2024-03-18 20:16   ` Filipe Manana
  2024-03-18 21:44   ` David Sterba
  5 siblings, 2 replies; 9+ messages in thread
From: Qu Wenruo @ 2024-03-18 20:12 UTC (permalink / raw)
  To: fdmanana, linux-btrfs



在 2024/3/18 22:44, fdmanana@kernel.org 写道:
> From: Filipe Manana <fdmanana@suse.com>
>
> 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?

>
> Filipe Manana (2):
>    btrfs: remove pointless readahead callback wrapper
>    btrfs: remove pointless writepages callback wrapper

Anyway looks good to me.

Reviewed-by: Qu Wenruo <wqu@suse.com>

Thanks,
Qu
>
>   fs/btrfs/extent_io.c |  5 ++---
>   fs/btrfs/extent_io.h |  5 ++---
>   fs/btrfs/inode.c     | 11 -----------
>   3 files changed, 4 insertions(+), 17 deletions(-)
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/2] btrfs: remove a couple pointless callback wrappers
  2024-03-18 20:12 ` Qu Wenruo
@ 2024-03-18 20:16   ` Filipe Manana
  2024-03-18 21:44   ` David Sterba
  1 sibling, 0 replies; 9+ messages in thread
From: Filipe Manana @ 2024-03-18 20:16 UTC (permalink / raw)
  To: Qu Wenruo; +Cc: linux-btrfs

On Mon, Mar 18, 2024 at 8:12 PM Qu Wenruo <quwenruo.btrfs@gmx.com> wrote:
>
>
>
> 在 2024/3/18 22:44, fdmanana@kernel.org 写道:
> > From: Filipe Manana <fdmanana@suse.com>
> >
> > Trivial stuff, details in the change logs.
>
> I guess it's just exposed by some random code reading?

Yes, by reading.

>
> No automatic tools to expose such single line wrapper?

Not that I know of. Maybe some coccinelle script could do it, dunno.

>
> >
> > Filipe Manana (2):
> >    btrfs: remove pointless readahead callback wrapper
> >    btrfs: remove pointless writepages callback wrapper
>
> Anyway looks good to me.
>
> Reviewed-by: Qu Wenruo <wqu@suse.com>
>
> Thanks,
> Qu
> >
> >   fs/btrfs/extent_io.c |  5 ++---
> >   fs/btrfs/extent_io.h |  5 ++---
> >   fs/btrfs/inode.c     | 11 -----------
> >   3 files changed, 4 insertions(+), 17 deletions(-)
> >

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/2] btrfs: remove a couple pointless callback wrappers
  2024-03-18 20:12 ` Qu Wenruo
  2024-03-18 20:16   ` Filipe Manana
@ 2024-03-18 21:44   ` David Sterba
  1 sibling, 0 replies; 9+ messages in thread
From: David Sterba @ 2024-03-18 21:44 UTC (permalink / raw)
  To: Qu Wenruo; +Cc: fdmanana, linux-btrfs

On Tue, Mar 19, 2024 at 06:42:26AM +1030, Qu Wenruo wrote:
> 
> 
> 在 2024/3/18 22:44, fdmanana@kernel.org 写道:
> > From: Filipe Manana <fdmanana@suse.com>
> >
> > 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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-03-18 21:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-18 12:14 [PATCH 0/2] btrfs: remove a couple pointless callback wrappers fdmanana
2024-03-18 12:14 ` [PATCH 1/2] btrfs: remove pointless readahead callback wrapper fdmanana
2024-03-18 12:14 ` [PATCH 2/2] btrfs: remove pointless writepages " fdmanana
2024-03-18 12:56 ` [PATCH 0/2] btrfs: remove a couple pointless callback wrappers Johannes Thumshirn
2024-03-18 15:00 ` Anand Jain
2024-03-18 18:45 ` David Sterba
2024-03-18 20:12 ` Qu Wenruo
2024-03-18 20:16   ` Filipe Manana
2024-03-18 21:44   ` David Sterba

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.