summaryrefslogtreecommitdiffstats
path: root/fs/ext4/verity.c
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2022-03-03 13:43:29 -0500
committerMatthew Wilcox (Oracle) <willy@infradead.org>2022-05-08 14:45:56 -0400
commit1b0aa4449cb81e0a7d43cb90d03888c23bacc825 (patch)
treed33c89581900dced21b3e68887deb84b0bd409a2 /fs/ext4/verity.c
parent07a31f728d7a9a3cdc5aa1bdf9e6a6d7524d93ad (diff)
downloadlinux-1b0aa4449cb81e0a7d43cb90d03888c23bacc825.tar.gz
linux-1b0aa4449cb81e0a7d43cb90d03888c23bacc825.tar.bz2
linux-1b0aa4449cb81e0a7d43cb90d03888c23bacc825.zip
ext4: Call aops write_begin() and write_end() directly
pagecache_write_begin() and pagecache_write_end() are now trivial wrappers, so call the aops directly. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/ext4/verity.c')
-rw-r--r--fs/ext4/verity.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/ext4/verity.c b/fs/ext4/verity.c
index eacbd489e3bf..b051d19b5c8a 100644
--- a/fs/ext4/verity.c
+++ b/fs/ext4/verity.c
@@ -69,6 +69,9 @@ static int pagecache_read(struct inode *inode, void *buf, size_t count,
static int pagecache_write(struct inode *inode, const void *buf, size_t count,
loff_t pos)
{
+ struct address_space *mapping = inode->i_mapping;
+ const struct address_space_operations *aops = mapping->a_ops;
+
if (pos + count > inode->i_sb->s_maxbytes)
return -EFBIG;
@@ -79,15 +82,13 @@ static int pagecache_write(struct inode *inode, const void *buf, size_t count,
void *fsdata;
int res;
- res = pagecache_write_begin(NULL, inode->i_mapping, pos, n, 0,
- &page, &fsdata);
+ res = aops->write_begin(NULL, mapping, pos, n, &page, &fsdata);
if (res)
return res;
memcpy_to_page(page, offset_in_page(pos), buf, n);
- res = pagecache_write_end(NULL, inode->i_mapping, pos, n, n,
- page, fsdata);
+ res = aops->write_end(NULL, mapping, pos, n, n, page, fsdata);
if (res < 0)
return res;
if (res != n)