namei: Call aops write_begin() and write_end() directly
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Thu, 3 Mar 2022 18:35:20 +0000 (13:35 -0500)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Sun, 8 May 2022 18:28:45 +0000 (14:28 -0400)
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>
fs/namei.c

index 0c84b4326dc97ad24a8f1c59a25d5e5ed81280df..896ade8b740045de2ac5f542c71f7f542ad7f709 100644 (file)
@@ -5005,6 +5005,7 @@ EXPORT_SYMBOL(page_readlink);
 int page_symlink(struct inode *inode, const char *symname, int len)
 {
        struct address_space *mapping = inode->i_mapping;
+       const struct address_space_operations *aops = mapping->a_ops;
        bool nofs = !mapping_gfp_constraint(mapping, __GFP_FS);
        struct page *page;
        void *fsdata;
@@ -5014,8 +5015,7 @@ int page_symlink(struct inode *inode, const char *symname, int len)
 retry:
        if (nofs)
                flags = memalloc_nofs_save();
-       err = pagecache_write_begin(NULL, mapping, 0, len-1,
-                               0, &page, &fsdata);
+       err = aops->write_begin(NULL, mapping, 0, len-1, &page, &fsdata);
        if (nofs)
                memalloc_nofs_restore(flags);
        if (err)
@@ -5023,7 +5023,7 @@ retry:
 
        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);
        if (err < 0)
                goto fail;