Commit 2f1c1bd7 authored by Matthew Wilcox (Oracle)'s avatar Matthew Wilcox (Oracle) Committed by Jan Kara

udf: Convert udf_symlink_getattr() to use a folio

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: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
Message-Id: <20240417150416.752929-6-willy@infradead.org>
parent d257d924
...@@ -137,12 +137,12 @@ static int udf_symlink_getattr(struct mnt_idmap *idmap, ...@@ -137,12 +137,12 @@ static int udf_symlink_getattr(struct mnt_idmap *idmap,
{ {
struct dentry *dentry = path->dentry; struct dentry *dentry = path->dentry;
struct inode *inode = d_backing_inode(dentry); struct inode *inode = d_backing_inode(dentry);
struct page *page; struct folio *folio;
generic_fillattr(&nop_mnt_idmap, request_mask, inode, stat); generic_fillattr(&nop_mnt_idmap, request_mask, inode, stat);
page = read_mapping_page(inode->i_mapping, 0, NULL); folio = read_mapping_folio(inode->i_mapping, 0, NULL);
if (IS_ERR(page)) if (IS_ERR(folio))
return PTR_ERR(page); return PTR_ERR(folio);
/* /*
* UDF uses non-trivial encoding of symlinks so i_size does not match * UDF uses non-trivial encoding of symlinks so i_size does not match
* number of characters reported by readlink(2) which apparently some * number of characters reported by readlink(2) which apparently some
...@@ -152,8 +152,8 @@ static int udf_symlink_getattr(struct mnt_idmap *idmap, ...@@ -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 * let's report the length of string returned by readlink(2) for
* st_size. * st_size.
*/ */
stat->size = strlen(page_address(page)); stat->size = strlen(folio_address(folio));
put_page(page); folio_put(folio);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment