filemap: Move 'filler' case to the end of do_read_cache_folio()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Thu, 12 May 2022 21:12:21 +0000 (17:12 -0400)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Wed, 29 Jun 2022 12:51:06 +0000 (08:51 -0400)
No functionality change intended; this simply moves code around to
disentangle the function a little.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
mm/filemap.c

index 15399e8..c821bc4 100644 (file)
@@ -3492,20 +3492,7 @@ repeat:
                        return ERR_PTR(err);
                }
 
-filler:
-               err = filler(file, folio);
-               if (err < 0) {
-                       folio_put(folio);
-                       return ERR_PTR(err);
-               }
-
-               folio_wait_locked(folio);
-               if (!folio_test_uptodate(folio)) {
-                       folio_put(folio);
-                       return ERR_PTR(-EIO);
-               }
-
-               goto out;
+               goto filler;
        }
        if (folio_test_uptodate(folio))
                goto out;
@@ -3535,7 +3522,18 @@ filler:
         * set again if read page fails.
         */
        folio_clear_error(folio);
-       goto filler;
+filler:
+       err = filler(file, folio);
+       if (err < 0) {
+               folio_put(folio);
+               return ERR_PTR(err);
+       }
+
+       folio_wait_locked(folio);
+       if (!folio_test_uptodate(folio)) {
+               folio_put(folio);
+               return ERR_PTR(-EIO);
+       }
 
 out:
        folio_mark_accessed(folio);