diff options
author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2022-03-03 13:43:29 -0500 |
---|---|---|
committer | Matthew Wilcox (Oracle) <willy@infradead.org> | 2022-05-08 14:45:56 -0400 |
commit | 6e0ee0446570c358bae4e224f6a43a5f53f793a0 (patch) | |
tree | 3dd1ae3a92eadecd9c344017d9cdfa0704632c81 /fs | |
parent | 1b0aa4449cb81e0a7d43cb90d03888c23bacc825 (diff) |
f2fs: 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')
-rw-r--r-- | fs/f2fs/verity.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/f2fs/verity.c b/fs/f2fs/verity.c index 3d793202cc9f..65395ae188aa 100644 --- a/fs/f2fs/verity.c +++ b/fs/f2fs/verity.c @@ -74,6 +74,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; @@ -85,8 +88,7 @@ static int pagecache_write(struct inode *inode, const void *buf, size_t count, void *addr; 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; @@ -94,8 +96,7 @@ static int pagecache_write(struct inode *inode, const void *buf, size_t count, memcpy(addr + offset_in_page(pos), buf, n); kunmap_atomic(addr); - 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) |