aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fuse
diff options
context:
space:
mode:
authorJohannes Weiner <jweiner@redhat.com>2011-07-25 16:35:34 -0400
committerMiklos Szeredi <mszeredi@suse.cz>2011-08-08 10:08:08 -0400
commitb40cdd56dfa065c0832905e266b39f79419e6914 (patch)
tree38ea1fa5cd6c49a9baedfc92309e8478d5cc32ae /fs/fuse
parent37fb3a30b46237f23cfdf7ee09d49f9888dd13bf (diff)
fuse: delete dead .write_begin and .write_end aops
Ever since 'ea9b990 fuse: implement perform_write', the .write_begin and .write_end aops have been dead code. Their task - acquiring a page from the page cache, sending out a write request and releasing the page again - is now done batch-wise to maximize the number of pages send per userspace request. Signed-off-by: Johannes Weiner <jweiner@redhat.com> Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Diffstat (limited to 'fs/fuse')
-rw-r--r--fs/fuse/file.c70
1 files changed, 0 insertions, 70 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index e32784924355..ab5b84ef4354 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -749,18 +749,6 @@ static size_t fuse_send_write(struct fuse_req *req, struct file *file,
749 return req->misc.write.out.size; 749 return req->misc.write.out.size;
750} 750}
751 751
752static int fuse_write_begin(struct file *file, struct address_space *mapping,
753 loff_t pos, unsigned len, unsigned flags,
754 struct page **pagep, void **fsdata)
755{
756 pgoff_t index = pos >> PAGE_CACHE_SHIFT;
757
758 *pagep = grab_cache_page_write_begin(mapping, index, flags);
759 if (!*pagep)
760 return -ENOMEM;
761 return 0;
762}
763
764void fuse_write_update_size(struct inode *inode, loff_t pos) 752void fuse_write_update_size(struct inode *inode, loff_t pos)
765{ 753{
766 struct fuse_conn *fc = get_fuse_conn(inode); 754 struct fuse_conn *fc = get_fuse_conn(inode);
@@ -773,62 +761,6 @@ void fuse_write_update_size(struct inode *inode, loff_t pos)
773 spin_unlock(&fc->lock); 761 spin_unlock(&fc->lock);
774} 762}
775 763
776static int fuse_buffered_write(struct file *file, struct inode *inode,
777 loff_t pos, unsigned count, struct page *page)
778{
779 int err;
780 size_t nres;
781 struct fuse_conn *fc = get_fuse_conn(inode);
782 unsigned offset = pos & (PAGE_CACHE_SIZE - 1);
783 struct fuse_req *req;
784
785 if (is_bad_inode(inode))
786 return -EIO;
787
788 /*
789 * Make sure writepages on the same page are not mixed up with
790 * plain writes.
791 */
792 fuse_wait_on_page_writeback(inode, page->index);
793
794 req = fuse_get_req(fc);
795 if (IS_ERR(req))
796 return PTR_ERR(req);
797
798 req->in.argpages = 1;
799 req->num_pages = 1;
800 req->pages[0] = page;
801 req->page_offset = offset;
802 nres = fuse_send_write(req, file, pos, count, NULL);
803 err = req->out.h.error;
804 fuse_put_request(fc, req);
805 if (!err && !nres)
806 err = -EIO;
807 if (!err) {
808 pos += nres;
809 fuse_write_update_size(inode, pos);
810 if (count == PAGE_CACHE_SIZE)
811 SetPageUptodate(page);
812 }
813 fuse_invalidate_attr(inode);
814 return err ? err : nres;
815}
816
817static int fuse_write_end(struct file *file, struct address_space *mapping,
818 loff_t pos, unsigned len, unsigned copied,
819 struct page *page, void *fsdata)
820{
821 struct inode *inode = mapping->host;
822 int res = 0;
823
824 if (copied)
825 res = fuse_buffered_write(file, inode, pos, copied, page);
826
827 unlock_page(page);
828 page_cache_release(page);
829 return res;
830}
831
832static size_t fuse_send_write_pages(struct fuse_req *req, struct file *file, 764static size_t fuse_send_write_pages(struct fuse_req *req, struct file *file,
833 struct inode *inode, loff_t pos, 765 struct inode *inode, loff_t pos,
834 size_t count) 766 size_t count)
@@ -2181,8 +2113,6 @@ static const struct address_space_operations fuse_file_aops = {
2181 .readpage = fuse_readpage, 2113 .readpage = fuse_readpage,
2182 .writepage = fuse_writepage, 2114 .writepage = fuse_writepage,
2183 .launder_page = fuse_launder_page, 2115 .launder_page = fuse_launder_page,
2184 .write_begin = fuse_write_begin,
2185 .write_end = fuse_write_end,
2186 .readpages = fuse_readpages, 2116 .readpages = fuse_readpages,
2187 .set_page_dirty = __set_page_dirty_nobuffers, 2117 .set_page_dirty = __set_page_dirty_nobuffers,
2188 .bmap = fuse_bmap, 2118 .bmap = fuse_bmap,