Skip to content

Commit 2f1c1bd

Browse files
Matthew Wilcox (Oracle)jankara
authored andcommitted
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: Matthew Wilcox (Oracle) <[email protected]> Signed-off-by: Jan Kara <[email protected]> Message-Id: <[email protected]>
1 parent d257d92 commit 2f1c1bd

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

fs/udf/symlink.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,12 @@ static int udf_symlink_getattr(struct mnt_idmap *idmap,
137137
{
138138
struct dentry *dentry = path->dentry;
139139
struct inode *inode = d_backing_inode(dentry);
140-
struct page *page;
140+
struct folio *folio;
141141

142142
generic_fillattr(&nop_mnt_idmap, request_mask, inode, stat);
143-
page = read_mapping_page(inode->i_mapping, 0, NULL);
144-
if (IS_ERR(page))
145-
return PTR_ERR(page);
143+
folio = read_mapping_folio(inode->i_mapping, 0, NULL);
144+
if (IS_ERR(folio))
145+
return PTR_ERR(folio);
146146
/*
147147
* UDF uses non-trivial encoding of symlinks so i_size does not match
148148
* number of characters reported by readlink(2) which apparently some
@@ -152,8 +152,8 @@ static int udf_symlink_getattr(struct mnt_idmap *idmap,
152152
* let's report the length of string returned by readlink(2) for
153153
* st_size.
154154
*/
155-
stat->size = strlen(page_address(page));
156-
put_page(page);
155+
stat->size = strlen(folio_address(folio));
156+
folio_put(folio);
157157

158158
return 0;
159159
}

0 commit comments

Comments
 (0)