All of lore.kernel.org
 help / color / mirror / Atom feed
* + mpage-convert-do_mpage_readpage-to-return-int-type.patch added to mm-new branch
@ 2025-08-18  2:46 Andrew Morton
  2025-08-18  3:07 ` Matthew Wilcox
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2025-08-18  2:46 UTC (permalink / raw)
  To: mm-commits, Yuezhang.Mo, willy, viro, sj1557.seo, linkinjeon,
	jack, brauner, chizhiling, akpm


The patch titled
     Subject: mpage: convert do_mpage_readpage() to return int type
has been added to the -mm mm-new branch.  Its filename is
     mpage-convert-do_mpage_readpage-to-return-int-type.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mpage-convert-do_mpage_readpage-to-return-int-type.patch

This patch will later appear in the mm-new branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Note, mm-new is a provisional staging ground for work-in-progress
patches, and acceptance into mm-new is a notification for others take
notice and to finish up reviews.  Please do not hesitate to respond to
review feedback and post updated versions to replace or incrementally
fixup patches in mm-new.

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days

------------------------------------------------------
From: Chi Zhiling <chizhiling@kylinos.cn>
Subject: mpage: convert do_mpage_readpage() to return int type
Date: Tue, 12 Aug 2025 15:22:25 +0800

The return value of do_mpage_readpage() is arg->bio, which is already set
in the arg structure.  Returning it again is redundant.

This patch changes the return type to int and always returns 0 since the
caller does not care about the return value.

Link: https://lkml.kernel.org/r/20250812072225.181798-3-chizhiling@163.com
Signed-off-by: Chi Zhiling <chizhiling@kylinos.cn>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Jan Kara <jack@suse.cz>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Namjae Jeon <linkinjeon@kernel.org>
Cc: Sungjong Seo <sj1557.seo@samsung.com>
Cc: Yuezhang Mo <Yuezhang.Mo@sony.com>

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 fs/mpage.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/fs/mpage.c~mpage-convert-do_mpage_readpage-to-return-int-type
+++ a/fs/mpage.c
@@ -148,7 +148,7 @@ struct mpage_readpage_args {
  * represent the validity of its disk mapping and to decide when to do the next
  * get_block() call.
  */
-static struct bio *do_mpage_readpage(struct mpage_readpage_args *args)
+static int do_mpage_readpage(struct mpage_readpage_args *args)
 {
 	struct folio *folio = args->folio;
 	struct inode *inode = folio->mapping->host;
@@ -297,7 +297,7 @@ alloc_new:
 	else
 		args->last_block_in_bio = first_block + blocks_per_folio - 1;
 out:
-	return args->bio;
+	return 0;
 
 confused:
 	if (args->bio)
@@ -360,7 +360,7 @@ void mpage_readahead(struct readahead_co
 		prefetchw(&folio->flags);
 		args.folio = folio;
 		args.nr_pages = readahead_count(rac);
-		args.bio = do_mpage_readpage(&args);
+		do_mpage_readpage(&args);
 		if (!folio_test_locked(folio) &&
 		    !folio_test_uptodate(folio))
 			break;
@@ -381,7 +381,7 @@ int mpage_read_folio(struct folio *folio
 		.get_block = get_block,
 	};
 
-	args.bio = do_mpage_readpage(&args);
+	do_mpage_readpage(&args);
 	if (args.bio)
 		mpage_bio_submit_read(args.bio);
 	return 0;
_

Patches currently in -mm which might be from chizhiling@kylinos.cn are

mm-filemap-do-not-use-is_partially_uptodate-for-entire-folio.patch
mm-filemap-skip-non-uptodate-folio-if-there-are-available-folios.patch
mpage-terminate-read-ahead-on-read-error.patch
mpage-clean-up-do_mpage_readpage.patch
mpage-convert-do_mpage_readpage-to-return-int-type.patch


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

* Re: + mpage-convert-do_mpage_readpage-to-return-int-type.patch added to mm-new branch
  2025-08-18  2:46 + mpage-convert-do_mpage_readpage-to-return-int-type.patch added to mm-new branch Andrew Morton
@ 2025-08-18  3:07 ` Matthew Wilcox
  2025-08-18 10:08   ` Chi Zhiling
  0 siblings, 1 reply; 3+ messages in thread
From: Matthew Wilcox @ 2025-08-18  3:07 UTC (permalink / raw)
  To: Andrew Morton
  Cc: mm-commits, Yuezhang.Mo, viro, sj1557.seo, linkinjeon, jack,
	brauner, chizhiling

On Sun, Aug 17, 2025 at 07:46:03PM -0700, Andrew Morton wrote:
> From: Chi Zhiling <chizhiling@kylinos.cn>
> Subject: mpage: convert do_mpage_readpage() to return int type
> Date: Tue, 12 Aug 2025 15:22:25 +0800
> 
> The return value of do_mpage_readpage() is arg->bio, which is already set
> in the arg structure.  Returning it again is redundant.
> 
> This patch changes the return type to int and always returns 0 since the
> caller does not care about the return value.

This makes no sense.  If the caller doesn't care, then it should return
void.

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

* Re: + mpage-convert-do_mpage_readpage-to-return-int-type.patch added to mm-new branch
  2025-08-18  3:07 ` Matthew Wilcox
@ 2025-08-18 10:08   ` Chi Zhiling
  0 siblings, 0 replies; 3+ messages in thread
From: Chi Zhiling @ 2025-08-18 10:08 UTC (permalink / raw)
  To: Matthew Wilcox, Andrew Morton
  Cc: mm-commits, Yuezhang.Mo, viro, sj1557.seo, linkinjeon, jack,
	brauner, chizhiling

On 2025/8/18 11:07, Matthew Wilcox wrote:
> On Sun, Aug 17, 2025 at 07:46:03PM -0700, Andrew Morton wrote:
>> From: Chi Zhiling <chizhiling@kylinos.cn>
>> Subject: mpage: convert do_mpage_readpage() to return int type
>> Date: Tue, 12 Aug 2025 15:22:25 +0800
>>
>> The return value of do_mpage_readpage() is arg->bio, which is already set
>> in the arg structure.  Returning it again is redundant.
>>
>> This patch changes the return type to int and always returns 0 since the
>> caller does not care about the return value.
> 
> This makes no sense.  If the caller doesn't care, then it should return
> void.

Okay, I will change that.


Thanks,
Chi Zhiling


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

end of thread, other threads:[~2025-08-18 10:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-18  2:46 + mpage-convert-do_mpage_readpage-to-return-int-type.patch added to mm-new branch Andrew Morton
2025-08-18  3:07 ` Matthew Wilcox
2025-08-18 10:08   ` Chi Zhiling

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.