Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hfs: Call hfs_write_begin() and generic_write_end() directly

There is only one kind of write_begin/write_end aops, so we don't need
to look up which aop it is, just make hfs_write_begin() available to
this file and call it directly.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>

+7 -6
+3 -3
fs/hfs/extent.c
··· 491 491 492 492 /* XXX: Can use generic_cont_expand? */ 493 493 size = inode->i_size - 1; 494 - res = pagecache_write_begin(NULL, mapping, size+1, 0, 0, 495 - &page, &fsdata); 494 + res = hfs_write_begin(NULL, mapping, size + 1, 0, &page, 495 + &fsdata); 496 496 if (!res) { 497 - res = pagecache_write_end(NULL, mapping, size+1, 0, 0, 497 + res = generic_write_end(NULL, mapping, size + 1, 0, 0, 498 498 page, fsdata); 499 499 } 500 500 if (res)
+2
fs/hfs/hfs_fs.h
··· 201 201 extern const struct address_space_operations hfs_aops; 202 202 extern const struct address_space_operations hfs_btree_aops; 203 203 204 + int hfs_write_begin(struct file *file, struct address_space *mapping, 205 + loff_t pos, unsigned len, struct page **pagep, void **fsdata); 204 206 extern struct inode *hfs_new_inode(struct inode *, const struct qstr *, umode_t); 205 207 extern void hfs_inode_write_fork(struct inode *, struct hfs_extent *, __be32 *, __be32 *); 206 208 extern int hfs_write_inode(struct inode *, struct writeback_control *);
+2 -3
fs/hfs/inode.c
··· 49 49 } 50 50 } 51 51 52 - static int hfs_write_begin(struct file *file, struct address_space *mapping, 53 - loff_t pos, unsigned len, 54 - struct page **pagep, void **fsdata) 52 + int hfs_write_begin(struct file *file, struct address_space *mapping, 53 + loff_t pos, unsigned len, struct page **pagep, void **fsdata) 55 54 { 56 55 int ret; 57 56