Commit 15a08f51 authored by Jan Kara's avatar Jan Kara

udf: Convert udf_symlink_filler() to use udf_bread()

Convert udf_symlink_filler() to use udf_bread() instead of mapping and
reading buffer head manually.
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent f33321b2
...@@ -107,10 +107,9 @@ static int udf_symlink_filler(struct file *file, struct folio *folio) ...@@ -107,10 +107,9 @@ static int udf_symlink_filler(struct file *file, struct folio *folio)
struct inode *inode = page->mapping->host; struct inode *inode = page->mapping->host;
struct buffer_head *bh = NULL; struct buffer_head *bh = NULL;
unsigned char *symlink; unsigned char *symlink;
int err; int err = 0;
unsigned char *p = page_address(page); unsigned char *p = page_address(page);
struct udf_inode_info *iinfo = UDF_I(inode); struct udf_inode_info *iinfo = UDF_I(inode);
uint32_t pos;
/* We don't support symlinks longer than one block */ /* We don't support symlinks longer than one block */
if (inode->i_size > inode->i_sb->s_blocksize) { if (inode->i_size > inode->i_sb->s_blocksize) {
...@@ -121,14 +120,12 @@ static int udf_symlink_filler(struct file *file, struct folio *folio) ...@@ -121,14 +120,12 @@ static int udf_symlink_filler(struct file *file, struct folio *folio)
if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) { if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) {
symlink = iinfo->i_data + iinfo->i_lenEAttr; symlink = iinfo->i_data + iinfo->i_lenEAttr;
} else { } else {
pos = udf_block_map(inode, 0); bh = udf_bread(inode, 0, 0, &err);
bh = sb_bread(inode->i_sb, pos);
if (!bh) { if (!bh) {
err = -EIO; if (!err)
err = -EFSCORRUPTED;
goto out_err; goto out_err;
} }
symlink = bh->b_data; symlink = bh->b_data;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment