Skip to content

Commit b591dfb

Browse files
Matthew Wilcox (Oracle)jankara
authored andcommitted
udf: Convert udf_symlink_filler() to use a folio
Remove the conversion to struct page and use folio APIs throughout. Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Signed-off-by: Jan Kara <[email protected]> Message-Id: <[email protected]>
1 parent 9ec2b35 commit b591dfb

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

fs/udf/symlink.c

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -99,18 +99,17 @@ static int udf_pc_to_char(struct super_block *sb, unsigned char *from,
9999

100100
static int udf_symlink_filler(struct file *file, struct folio *folio)
101101
{
102-
struct page *page = &folio->page;
103-
struct inode *inode = page->mapping->host;
102+
struct inode *inode = folio->mapping->host;
104103
struct buffer_head *bh = NULL;
105104
unsigned char *symlink;
106105
int err = 0;
107-
unsigned char *p = page_address(page);
106+
unsigned char *p = folio_address(folio);
108107
struct udf_inode_info *iinfo = UDF_I(inode);
109108

110109
/* We don't support symlinks longer than one block */
111110
if (inode->i_size > inode->i_sb->s_blocksize) {
112111
err = -ENAMETOOLONG;
113-
goto out_unlock;
112+
goto out;
114113
}
115114

116115
if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) {
@@ -120,24 +119,15 @@ static int udf_symlink_filler(struct file *file, struct folio *folio)
120119
if (!bh) {
121120
if (!err)
122121
err = -EFSCORRUPTED;
123-
goto out_err;
122+
goto out;
124123
}
125124
symlink = bh->b_data;
126125
}
127126

128127
err = udf_pc_to_char(inode->i_sb, symlink, inode->i_size, p, PAGE_SIZE);
129128
brelse(bh);
130-
if (err)
131-
goto out_err;
132-
133-
SetPageUptodate(page);
134-
unlock_page(page);
135-
return 0;
136-
137-
out_err:
138-
SetPageError(page);
139-
out_unlock:
140-
unlock_page(page);
129+
out:
130+
folio_end_read(folio, err == 0);
141131
return err;
142132
}
143133

0 commit comments

Comments
 (0)