mirror of
https://github.com/torvalds/linux.git
synced 2024-11-21 19:41:42 +00:00
isofs: Convert rock_ridge_symlink_read_folio to use a folio
Remove the conversion back into a page and use the folio APIs throughout. Remove the setting of PG_error instead of converting it; it is unused by core code or by the rest of isofs, so it serves no purpose here. Use folio_end_read() to save an atomic operation and unify the two exit paths. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Link: https://lore.kernel.org/r/20240530202110.2653630-7-willy@infradead.org Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
parent
4c59e914ef
commit
4df37c5f08
@ -688,11 +688,10 @@ int parse_rock_ridge_inode(struct iso_directory_record *de, struct inode *inode,
|
|||||||
*/
|
*/
|
||||||
static int rock_ridge_symlink_read_folio(struct file *file, struct folio *folio)
|
static int rock_ridge_symlink_read_folio(struct file *file, struct folio *folio)
|
||||||
{
|
{
|
||||||
struct page *page = &folio->page;
|
struct inode *inode = folio->mapping->host;
|
||||||
struct inode *inode = page->mapping->host;
|
|
||||||
struct iso_inode_info *ei = ISOFS_I(inode);
|
struct iso_inode_info *ei = ISOFS_I(inode);
|
||||||
struct isofs_sb_info *sbi = ISOFS_SB(inode->i_sb);
|
struct isofs_sb_info *sbi = ISOFS_SB(inode->i_sb);
|
||||||
char *link = page_address(page);
|
char *link = folio_address(folio);
|
||||||
unsigned long bufsize = ISOFS_BUFFER_SIZE(inode);
|
unsigned long bufsize = ISOFS_BUFFER_SIZE(inode);
|
||||||
struct buffer_head *bh;
|
struct buffer_head *bh;
|
||||||
char *rpnt = link;
|
char *rpnt = link;
|
||||||
@ -779,9 +778,10 @@ repeat:
|
|||||||
goto fail;
|
goto fail;
|
||||||
brelse(bh);
|
brelse(bh);
|
||||||
*rpnt = '\0';
|
*rpnt = '\0';
|
||||||
SetPageUptodate(page);
|
ret = 0;
|
||||||
unlock_page(page);
|
end:
|
||||||
return 0;
|
folio_end_read(folio, ret == 0);
|
||||||
|
return ret;
|
||||||
|
|
||||||
/* error exit from macro */
|
/* error exit from macro */
|
||||||
out:
|
out:
|
||||||
@ -795,9 +795,8 @@ out_bad_span:
|
|||||||
fail:
|
fail:
|
||||||
brelse(bh);
|
brelse(bh);
|
||||||
error:
|
error:
|
||||||
SetPageError(page);
|
ret = -EIO;
|
||||||
unlock_page(page);
|
goto end;
|
||||||
return -EIO;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct address_space_operations isofs_symlink_aops = {
|
const struct address_space_operations isofs_symlink_aops = {
|
||||||
|
Loading…
Reference in New Issue
Block a user