namei: 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: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
parent 53b524b8
...@@ -5005,6 +5005,7 @@ EXPORT_SYMBOL(page_readlink); ...@@ -5005,6 +5005,7 @@ EXPORT_SYMBOL(page_readlink);
int page_symlink(struct inode *inode, const char *symname, int len) int page_symlink(struct inode *inode, const char *symname, int len)
{ {
struct address_space *mapping = inode->i_mapping; struct address_space *mapping = inode->i_mapping;
const struct address_space_operations *aops = mapping->a_ops;
bool nofs = !mapping_gfp_constraint(mapping, __GFP_FS); bool nofs = !mapping_gfp_constraint(mapping, __GFP_FS);
struct page *page; struct page *page;
void *fsdata; void *fsdata;
...@@ -5014,8 +5015,7 @@ int page_symlink(struct inode *inode, const char *symname, int len) ...@@ -5014,8 +5015,7 @@ int page_symlink(struct inode *inode, const char *symname, int len)
retry: retry:
if (nofs) if (nofs)
flags = memalloc_nofs_save(); flags = memalloc_nofs_save();
err = pagecache_write_begin(NULL, mapping, 0, len-1, err = aops->write_begin(NULL, mapping, 0, len-1, &page, &fsdata);
0, &page, &fsdata);
if (nofs) if (nofs)
memalloc_nofs_restore(flags); memalloc_nofs_restore(flags);
if (err) if (err)
...@@ -5023,7 +5023,7 @@ int page_symlink(struct inode *inode, const char *symname, int len) ...@@ -5023,7 +5023,7 @@ int page_symlink(struct inode *inode, const char *symname, int len)
memcpy(page_address(page), symname, len-1); memcpy(page_address(page), symname, len-1);
err = pagecache_write_end(NULL, mapping, 0, len-1, len-1, err = aops->write_end(NULL, mapping, 0, len-1, len-1,
page, fsdata); page, fsdata);
if (err < 0) if (err < 0)
goto fail; goto fail;
......
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