diff options
author | Jan Kara <jack@suse.cz> | 2023-01-24 11:40:28 +0100 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2023-01-26 16:46:35 +0100 |
commit | b7c31e6f14779324a39927cdaf493dc193576da1 (patch) | |
tree | 6a57efdcbdc9abed0d397867083e96654207217a /fs/udf/inode.c | |
parent | f54aa97fb7e5329a373f9df4e5e213ced4fc8759 (diff) |
udf: Unify .read_folio for normal and in-ICB files
Switching address_space_operations while a file is used is difficult to
do in a race-free way. To be able to use single address_space_operations
in UDF, make udf_read_folio() handle both normal and in-ICB files.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf/inode.c')
-rw-r--r-- | fs/udf/inode.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/udf/inode.c b/fs/udf/inode.c index ee440d16411e..a1816f067c14 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c @@ -191,8 +191,15 @@ static int udf_writepages(struct address_space *mapping, return mpage_writepages(mapping, wbc, udf_get_block_wb); } -static int udf_read_folio(struct file *file, struct folio *folio) +int udf_read_folio(struct file *file, struct folio *folio) { + struct udf_inode_info *iinfo = UDF_I(file_inode(file)); + + if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) { + udf_adinicb_readpage(&folio->page); + folio_unlock(folio); + return 0; + } return mpage_read_folio(folio, udf_get_block); } |