diff mbox series

[19/22] affs: Use pagecache_write_begin() & pagecache_write_end()

Message ID 20220222194820.737755-20-willy@infradead.org (mailing list archive)
State New, archived
Headers show
Series Remove aop flags | expand

Commit Message

Matthew Wilcox Feb. 22, 2022, 7:48 p.m. UTC
Use the convenience wrappers instead of invoking ->write_begin and
->write_end directly.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 fs/affs/file.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Christoph Hellwig Feb. 23, 2022, 7:05 a.m. UTC | #1
On Tue, Feb 22, 2022 at 07:48:17PM +0000, Matthew Wilcox (Oracle) wrote:
> Use the convenience wrappers instead of invoking ->write_begin and
> ->write_end directly.

I'd much rather call the actual implementation used by affs directly.
Same for the following patch.
diff mbox series

Patch

diff --git a/fs/affs/file.c b/fs/affs/file.c
index 06645d05c717..1c18f13e8aa1 100644
--- a/fs/affs/file.c
+++ b/fs/affs/file.c
@@ -887,9 +887,11 @@  affs_truncate(struct inode *inode)
 		loff_t isize = inode->i_size;
 		int res;
 
-		res = mapping->a_ops->write_begin(NULL, mapping, isize, 0, 0, &page, &fsdata);
+		res = pagecache_write_begin(NULL, mapping, isize, 0, &page,
+						&fsdata);
 		if (!res)
-			res = mapping->a_ops->write_end(NULL, mapping, isize, 0, 0, page, fsdata);
+			res = pagecache_write_end(NULL, mapping, isize, 0, 0,
+					page, fsdata);
 		else
 			inode->i_size = AFFS_I(inode)->mmu_private;
 		mark_inode_dirty(inode);