affs: convert affs_symlink_read_folio() to use the folio
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Thu, 13 Jul 2023 03:55:07 +0000 (04:55 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 18 Aug 2023 17:12:29 +0000 (10:12 -0700)
Remove use of the old page APIs.  That includes use of setting PageError
on error; simply not setting the uptodate flag is sufficient.

Link: https://lkml.kernel.org/r/20230713035512.4139457-3-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: David Sterba <dsterba@suse.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Jan Kara <jack@suse.com>
Cc: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Pankaj Raghav <p.raghav@samsung.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Tom Rix <trix@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/affs/symlink.c

index 31d6446dc16689eb7336a2a0addba9c0bffc46f1..094aec8d17b88bab9392abdd497ed687cd85584e 100644 (file)
 
 static int affs_symlink_read_folio(struct file *file, struct folio *folio)
 {
-       struct page *page = &folio->page;
        struct buffer_head *bh;
-       struct inode *inode = page->mapping->host;
-       char *link = page_address(page);
+       struct inode *inode = folio->mapping->host;
+       char *link = folio_address(folio);
        struct slink_front *lf;
        int                      i, j;
        char                     c;
@@ -58,12 +57,11 @@ static int affs_symlink_read_folio(struct file *file, struct folio *folio)
        }
        link[i] = '\0';
        affs_brelse(bh);
-       SetPageUptodate(page);
-       unlock_page(page);
+       folio_mark_uptodate(folio);
+       folio_unlock(folio);
        return 0;
 fail:
-       SetPageError(page);
-       unlock_page(page);
+       folio_unlock(folio);
        return -EIO;
 }