udf: Convert udf_symlink_getattr() to use a folio
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Wed, 17 Apr 2024 15:04:11 +0000 (16:04 +0100)
committerJan Kara <jack@suse.cz>
Tue, 23 Apr 2024 13:37:02 +0000 (15:37 +0200)
We're getting this from the page cache, so it's definitely a folio.
Saves a call to compound_head() hidden in put_page().

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Jan Kara <jack@suse.cz>
Message-Id: <20240417150416.752929-6-willy@infradead.org>

fs/udf/symlink.c

index 0105e7e2ba3d949df940707af9cea423c2517977..fe03745d09b181652c5606a079328ab0a1714d8a 100644 (file)
@@ -137,12 +137,12 @@ static int udf_symlink_getattr(struct mnt_idmap *idmap,
 {
        struct dentry *dentry = path->dentry;
        struct inode *inode = d_backing_inode(dentry);
-       struct page *page;
+       struct folio *folio;
 
        generic_fillattr(&nop_mnt_idmap, request_mask, inode, stat);
-       page = read_mapping_page(inode->i_mapping, 0, NULL);
-       if (IS_ERR(page))
-               return PTR_ERR(page);
+       folio = read_mapping_folio(inode->i_mapping, 0, NULL);
+       if (IS_ERR(folio))
+               return PTR_ERR(folio);
        /*
         * UDF uses non-trivial encoding of symlinks so i_size does not match
         * number of characters reported by readlink(2) which apparently some
@@ -152,8 +152,8 @@ static int udf_symlink_getattr(struct mnt_idmap *idmap,
         * let's report the length of string returned by readlink(2) for
         * st_size.
         */
-       stat->size = strlen(page_address(page));
-       put_page(page);
+       stat->size = strlen(folio_address(folio));
+       folio_put(folio);
 
        return 0;
 }