mpage: convert do_mpage_readpage() to return void type

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 void since the caller doesn't care
about the return value.

Link: https://lkml.kernel.org/r/20250829023659.688649-2-chizhiling@163.com
Signed-off-by: Chi Zhiling <chizhiling@kylinos.cn>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christian Brauner <brauner@kernel.org>
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>
This commit is contained in:
Chi Zhiling
2025-08-29 10:36:59 +08:00
committed by Andrew Morton
parent f6d8c71020
commit 8583bb0f9a

View File

@@ -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 void do_mpage_readpage(struct mpage_readpage_args *args)
{
struct folio *folio = args->folio;
struct inode *inode = folio->mapping->host;
@@ -305,7 +305,7 @@ alloc_new:
else
args->last_block_in_bio = first_block + blocks_per_folio - 1;
out:
return args->bio;
return;
confused:
if (args->bio)
@@ -368,7 +368,7 @@ void mpage_readahead(struct readahead_control *rac, get_block_t get_block)
prefetchw(&folio->flags);
args.folio = folio;
args.nr_pages = readahead_count(rac);
args.bio = do_mpage_readpage(&args);
do_mpage_readpage(&args);
/*
* If read ahead failed synchronously, it may cause by removed
* device, or some filesystem metadata error.
@@ -392,7 +392,7 @@ int mpage_read_folio(struct folio *folio, get_block_t get_block)
.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;