diff options
author | Jan Kara <jack@suse.cz> | 2023-01-18 14:32:45 +0100 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2023-01-26 16:46:33 +0100 |
commit | 15a08f51624a252ddadf7ce95ad5256d634873fc (patch) | |
tree | 6abf6b2d111238950d6b3ca149a150d31fba53d8 /fs/udf/symlink.c | |
parent | f33321b29b672d0d1e565e3c1a6886bfd14d4673 (diff) |
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: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf/symlink.c')
-rw-r--r-- | fs/udf/symlink.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/fs/udf/symlink.c b/fs/udf/symlink.c index 451d6d6c701e..a6cabaa5f1c2 100644 --- a/fs/udf/symlink.c +++ b/fs/udf/symlink.c @@ -107,10 +107,9 @@ static int udf_symlink_filler(struct file *file, struct folio *folio) struct inode *inode = page->mapping->host; struct buffer_head *bh = NULL; unsigned char *symlink; - int err; + int err = 0; unsigned char *p = page_address(page); struct udf_inode_info *iinfo = UDF_I(inode); - uint32_t pos; /* We don't support symlinks longer than one block */ if (inode->i_size > inode->i_sb->s_blocksize) { @@ -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) { symlink = iinfo->i_data + iinfo->i_lenEAttr; } else { - pos = udf_block_map(inode, 0); - bh = sb_bread(inode->i_sb, pos); - + bh = udf_bread(inode, 0, 0, &err); if (!bh) { - err = -EIO; + if (!err) + err = -EFSCORRUPTED; goto out_err; } - symlink = bh->b_data; } |