Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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) <willy@infradead.org>
Signed-off-by: Jan Kara <jack@suse.cz>
Message-Id: <20240417150416.752929-6-willy@infradead.org>

authored by

Matthew Wilcox (Oracle) and committed by
Jan Kara
2f1c1bd7 d257d924

+6 -6
+6 -6
fs/udf/symlink.c
··· 137 137 { 138 138 struct dentry *dentry = path->dentry; 139 139 struct inode *inode = d_backing_inode(dentry); 140 - struct page *page; 140 + struct folio *folio; 141 141 142 142 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); 146 146 /* 147 147 * UDF uses non-trivial encoding of symlinks so i_size does not match 148 148 * number of characters reported by readlink(2) which apparently some ··· 152 152 * let's report the length of string returned by readlink(2) for 153 153 * st_size. 154 154 */ 155 - stat->size = strlen(page_address(page)); 156 - put_page(page); 155 + stat->size = strlen(folio_address(folio)); 156 + folio_put(folio); 157 157 158 158 return 0; 159 159 }