summaryrefslogtreecommitdiff
path: root/fs/udf/inode.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2023-01-24 12:29:57 +0100
committerJan Kara <jack@suse.cz>2023-01-26 16:46:36 +0100
commit174cb748d88819d8a6420aa5040f9f065fcbdbab (patch)
treeba9cdbbaf55efae8bf7b2d3cd072786f366631e4 /fs/udf/inode.c
parent759e4d74c072aadba7cf7c026434ef7e267e4520 (diff)
udf: Move udf_adinicb_readpage() to inode.c
udf_adinicb_readpage() is only called from aops functions, move it to the same file as its callers and also drop the stale comment - invalidate_lock is protecting us against races with truncate. 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.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/udf/inode.c b/fs/udf/inode.c
index 084b1f319713..b2bad81a253e 100644
--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -215,6 +215,21 @@ static int udf_writepages(struct address_space *mapping,
return write_cache_pages(mapping, wbc, udf_adinicb_writepage, NULL);
}
+static void udf_adinicb_readpage(struct page *page)
+{
+ struct inode *inode = page->mapping->host;
+ char *kaddr;
+ struct udf_inode_info *iinfo = UDF_I(inode);
+ loff_t isize = i_size_read(inode);
+
+ kaddr = kmap_atomic(page);
+ memcpy(kaddr, iinfo->i_data + iinfo->i_lenEAttr, isize);
+ memset(kaddr + isize, 0, PAGE_SIZE - isize);
+ flush_dcache_page(page);
+ SetPageUptodate(page);
+ kunmap_atomic(kaddr);
+}
+
static int udf_read_folio(struct file *file, struct folio *folio)
{
struct udf_inode_info *iinfo = UDF_I(file_inode(file));