hfsplus: Call hfsplus_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 hfsplus_write_begin() available to
this file and call it directly.
Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
parent cfef1f7b
...@@ -557,12 +557,12 @@ void hfsplus_file_truncate(struct inode *inode) ...@@ -557,12 +557,12 @@ void hfsplus_file_truncate(struct inode *inode)
void *fsdata; void *fsdata;
loff_t size = inode->i_size; loff_t size = inode->i_size;
res = pagecache_write_begin(NULL, mapping, size, 0, 0, res = hfsplus_write_begin(NULL, mapping, size, 0,
&page, &fsdata); &page, &fsdata);
if (res) if (res)
return; return;
res = pagecache_write_end(NULL, mapping, size, res = generic_write_end(NULL, mapping, size, 0, 0,
0, 0, page, fsdata); page, fsdata);
if (res < 0) if (res < 0)
return; return;
mark_inode_dirty(inode); mark_inode_dirty(inode);
......
...@@ -468,6 +468,8 @@ extern const struct address_space_operations hfsplus_aops; ...@@ -468,6 +468,8 @@ extern const struct address_space_operations hfsplus_aops;
extern const struct address_space_operations hfsplus_btree_aops; extern const struct address_space_operations hfsplus_btree_aops;
extern const struct dentry_operations hfsplus_dentry_operations; extern const struct dentry_operations hfsplus_dentry_operations;
int hfsplus_write_begin(struct file *file, struct address_space *mapping,
loff_t pos, unsigned len, struct page **pagep, void **fsdata);
struct inode *hfsplus_new_inode(struct super_block *sb, struct inode *dir, struct inode *hfsplus_new_inode(struct super_block *sb, struct inode *dir,
umode_t mode); umode_t mode);
void hfsplus_delete_inode(struct inode *inode); void hfsplus_delete_inode(struct inode *inode);
......
...@@ -43,9 +43,8 @@ static void hfsplus_write_failed(struct address_space *mapping, loff_t to) ...@@ -43,9 +43,8 @@ static void hfsplus_write_failed(struct address_space *mapping, loff_t to)
} }
} }
static int hfsplus_write_begin(struct file *file, struct address_space *mapping, int hfsplus_write_begin(struct file *file, struct address_space *mapping,
loff_t pos, unsigned len, loff_t pos, unsigned len, struct page **pagep, void **fsdata)
struct page **pagep, void **fsdata)
{ {
int ret; int ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment