aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fuse
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-04-12 17:49:50 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-12 17:49:50 -0400
commit5166701b368caea89d57b14bf41cf39e819dad51 (patch)
treec73b9d4860809e3afa9359be9d03ba2d8d98a18e /fs/fuse
parent0a7418f5f569512e98789c439198eed4b507cce3 (diff)
parenta786c06d9f2719203c00b3d97b21f9a96980d0b5 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs updates from Al Viro: "The first vfs pile, with deep apologies for being very late in this window. Assorted cleanups and fixes, plus a large preparatory part of iov_iter work. There's a lot more of that, but it'll probably go into the next merge window - it *does* shape up nicely, removes a lot of boilerplate, gets rid of locking inconsistencie between aio_write and splice_write and I hope to get Kent's direct-io rewrite merged into the same queue, but some of the stuff after this point is having (mostly trivial) conflicts with the things already merged into mainline and with some I want more testing. This one passes LTP and xfstests without regressions, in addition to usual beating. BTW, readahead02 in ltp syscalls testsuite has started giving failures since "mm/readahead.c: fix readahead failure for memoryless NUMA nodes and limit readahead pages" - might be a false positive, might be a real regression..." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (63 commits) missing bits of "splice: fix racy pipe->buffers uses" cifs: fix the race in cifs_writev() ceph_sync_{,direct_}write: fix an oops on ceph_osdc_new_request() failure kill generic_file_buffered_write() ocfs2_file_aio_write(): switch to generic_perform_write() ceph_aio_write(): switch to generic_perform_write() xfs_file_buffered_aio_write(): switch to generic_perform_write() export generic_perform_write(), start getting rid of generic_file_buffer_write() generic_file_direct_write(): get rid of ppos argument btrfs_file_aio_write(): get rid of ppos kill the 5th argument of generic_file_buffered_write() kill the 4th argument of __generic_file_aio_write() lustre: don't open-code kernel_recvmsg() ocfs2: don't open-code kernel_recvmsg() drbd: don't open-code kernel_recvmsg() constify blk_rq_map_user_iov() and friends lustre: switch to kernel_sendmsg() ocfs2: don't open-code kernel_sendmsg() take iov_iter stuff to mm/iov_iter.c process_vm_access: tidy up a bit ...
Diffstat (limited to 'fs/fuse')
-rw-r--r--fs/fuse/dev.c14
-rw-r--r--fs/fuse/file.c5
2 files changed, 8 insertions, 11 deletions
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index 0a648bb455ae..aac71ce373e4 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -667,15 +667,15 @@ static void fuse_copy_finish(struct fuse_copy_state *cs)
667 struct pipe_buffer *buf = cs->currbuf; 667 struct pipe_buffer *buf = cs->currbuf;
668 668
669 if (!cs->write) { 669 if (!cs->write) {
670 buf->ops->unmap(cs->pipe, buf, cs->mapaddr); 670 kunmap_atomic(cs->mapaddr);
671 } else { 671 } else {
672 kunmap(buf->page); 672 kunmap_atomic(cs->mapaddr);
673 buf->len = PAGE_SIZE - cs->len; 673 buf->len = PAGE_SIZE - cs->len;
674 } 674 }
675 cs->currbuf = NULL; 675 cs->currbuf = NULL;
676 cs->mapaddr = NULL; 676 cs->mapaddr = NULL;
677 } else if (cs->mapaddr) { 677 } else if (cs->mapaddr) {
678 kunmap(cs->pg); 678 kunmap_atomic(cs->mapaddr);
679 if (cs->write) { 679 if (cs->write) {
680 flush_dcache_page(cs->pg); 680 flush_dcache_page(cs->pg);
681 set_page_dirty_lock(cs->pg); 681 set_page_dirty_lock(cs->pg);
@@ -706,7 +706,7 @@ static int fuse_copy_fill(struct fuse_copy_state *cs)
706 706
707 BUG_ON(!cs->nr_segs); 707 BUG_ON(!cs->nr_segs);
708 cs->currbuf = buf; 708 cs->currbuf = buf;
709 cs->mapaddr = buf->ops->map(cs->pipe, buf, 0); 709 cs->mapaddr = kmap_atomic(buf->page);
710 cs->len = buf->len; 710 cs->len = buf->len;
711 cs->buf = cs->mapaddr + buf->offset; 711 cs->buf = cs->mapaddr + buf->offset;
712 cs->pipebufs++; 712 cs->pipebufs++;
@@ -726,7 +726,7 @@ static int fuse_copy_fill(struct fuse_copy_state *cs)
726 buf->len = 0; 726 buf->len = 0;
727 727
728 cs->currbuf = buf; 728 cs->currbuf = buf;
729 cs->mapaddr = kmap(page); 729 cs->mapaddr = kmap_atomic(page);
730 cs->buf = cs->mapaddr; 730 cs->buf = cs->mapaddr;
731 cs->len = PAGE_SIZE; 731 cs->len = PAGE_SIZE;
732 cs->pipebufs++; 732 cs->pipebufs++;
@@ -745,7 +745,7 @@ static int fuse_copy_fill(struct fuse_copy_state *cs)
745 return err; 745 return err;
746 BUG_ON(err != 1); 746 BUG_ON(err != 1);
747 offset = cs->addr % PAGE_SIZE; 747 offset = cs->addr % PAGE_SIZE;
748 cs->mapaddr = kmap(cs->pg); 748 cs->mapaddr = kmap_atomic(cs->pg);
749 cs->buf = cs->mapaddr + offset; 749 cs->buf = cs->mapaddr + offset;
750 cs->len = min(PAGE_SIZE - offset, cs->seglen); 750 cs->len = min(PAGE_SIZE - offset, cs->seglen);
751 cs->seglen -= cs->len; 751 cs->seglen -= cs->len;
@@ -874,7 +874,7 @@ static int fuse_try_move_page(struct fuse_copy_state *cs, struct page **pagep)
874out_fallback_unlock: 874out_fallback_unlock:
875 unlock_page(newpage); 875 unlock_page(newpage);
876out_fallback: 876out_fallback:
877 cs->mapaddr = buf->ops->map(cs->pipe, buf, 1); 877 cs->mapaddr = kmap_atomic(buf->page);
878 cs->buf = cs->mapaddr + buf->offset; 878 cs->buf = cs->mapaddr + buf->offset;
879 879
880 err = lock_request(cs->fc, cs->req); 880 err = lock_request(cs->fc, cs->req);
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 48992cac714b..13f8bdec5110 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -1086,9 +1086,7 @@ static ssize_t fuse_fill_write_pages(struct fuse_req *req,
1086 if (mapping_writably_mapped(mapping)) 1086 if (mapping_writably_mapped(mapping))
1087 flush_dcache_page(page); 1087 flush_dcache_page(page);
1088 1088
1089 pagefault_disable();
1090 tmp = iov_iter_copy_from_user_atomic(page, ii, offset, bytes); 1089 tmp = iov_iter_copy_from_user_atomic(page, ii, offset, bytes);
1091 pagefault_enable();
1092 flush_dcache_page(page); 1090 flush_dcache_page(page);
1093 1091
1094 mark_page_accessed(page); 1092 mark_page_accessed(page);
@@ -1237,8 +1235,7 @@ static ssize_t fuse_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
1237 goto out; 1235 goto out;
1238 1236
1239 if (file->f_flags & O_DIRECT) { 1237 if (file->f_flags & O_DIRECT) {
1240 written = generic_file_direct_write(iocb, iov, &nr_segs, 1238 written = generic_file_direct_write(iocb, iov, &nr_segs, pos,
1241 pos, &iocb->ki_pos,
1242 count, ocount); 1239 count, ocount);
1243 if (written < 0 || written == count) 1240 if (written < 0 || written == count)
1244 goto out; 1241 goto out;