Skip to content

Commit 4df37c5

Browse files
Matthew Wilcox (Oracle)brauner
authored andcommitted
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) <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Christian Brauner <[email protected]>
1 parent 4c59e91 commit 4df37c5

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

fs/isofs/rock.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -688,11 +688,10 @@ int parse_rock_ridge_inode(struct iso_directory_record *de, struct inode *inode,
688688
*/
689689
static int rock_ridge_symlink_read_folio(struct file *file, struct folio *folio)
690690
{
691-
struct page *page = &folio->page;
692-
struct inode *inode = page->mapping->host;
691+
struct inode *inode = folio->mapping->host;
693692
struct iso_inode_info *ei = ISOFS_I(inode);
694693
struct isofs_sb_info *sbi = ISOFS_SB(inode->i_sb);
695-
char *link = page_address(page);
694+
char *link = folio_address(folio);
696695
unsigned long bufsize = ISOFS_BUFFER_SIZE(inode);
697696
struct buffer_head *bh;
698697
char *rpnt = link;
@@ -779,9 +778,10 @@ static int rock_ridge_symlink_read_folio(struct file *file, struct folio *folio)
779778
goto fail;
780779
brelse(bh);
781780
*rpnt = '\0';
782-
SetPageUptodate(page);
783-
unlock_page(page);
784-
return 0;
781+
ret = 0;
782+
end:
783+
folio_end_read(folio, ret == 0);
784+
return ret;
785785

786786
/* error exit from macro */
787787
out:
@@ -795,9 +795,8 @@ static int rock_ridge_symlink_read_folio(struct file *file, struct folio *folio)
795795
fail:
796796
brelse(bh);
797797
error:
798-
SetPageError(page);
799-
unlock_page(page);
800-
return -EIO;
798+
ret = -EIO;
799+
goto end;
801800
}
802801

803802
const struct address_space_operations isofs_symlink_aops = {

0 commit comments

Comments
 (0)