]> git.baikalelectronics.ru Git - kernel.git/commitdiff
remap_range: Remove check of uptodate flag
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Wed, 18 May 2022 03:29:06 +0000 (23:29 -0400)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Wed, 29 Jun 2022 12:51:07 +0000 (08:51 -0400)
read_mapping_folio() returns an ERR_PTR if the folio is not
uptodate, so this check is simply dead code.

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

index e112b5424cdb9fdfc843fbe8af336c229f786f18..f1a3795812ce196af4f5b8bed0ec5f74b7f22f71 100644 (file)
@@ -148,16 +148,7 @@ static int generic_remap_check_len(struct inode *inode_in,
 /* Read a page's worth of file data into the page cache. */
 static struct folio *vfs_dedupe_get_folio(struct file *file, loff_t pos)
 {
-       struct folio *folio;
-
-       folio = read_mapping_folio(file->f_mapping, pos >> PAGE_SHIFT, file);
-       if (IS_ERR(folio))
-               return folio;
-       if (!folio_test_uptodate(folio)) {
-               folio_put(folio);
-               return ERR_PTR(-EIO);
-       }
-       return folio;
+       return read_mapping_folio(file->f_mapping, pos >> PAGE_SHIFT, file);
 }
 
 /*