]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mpage: convert do_mpage_readpage() to return int type
authorChi Zhiling <chizhiling@kylinos.cn>
Tue, 12 Aug 2025 07:22:25 +0000 (15:22 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 18 Aug 2025 05:09:07 +0000 (22:09 -0700)
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

index b6510b8dfa2bd79da00cd8b451b6f884866d9d16..07b4317ccedaa2f39c0229af60e3ad9ccb71d4d0 100644 (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 int 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 0;
 
 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 (!folio_test_locked(folio) &&
                    !folio_test_uptodate(folio))
                        break;
@@ -389,7 +389,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;