Skip to content

Commit

Permalink
callers of iov_copy_from_user_atomic() don't need pagecache_disable()
Browse files Browse the repository at this point in the history
... it does that itself (via kmap_atomic())

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Apr 2, 2014
1 parent c186afb commit 9e8c2af
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 10 deletions.
5 changes: 0 additions & 5 deletions fs/btrfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,13 +425,8 @@ static noinline int btrfs_copy_from_user(loff_t pos, int num_pages,
struct page *page = prepared_pages[pg];
/*
* Copy data from userspace to the current page
*
* Disable pagefault to avoid recursive lock since
* the pages are already locked
*/
pagefault_disable();
copied = iov_iter_copy_from_user_atomic(page, i, offset, count);
pagefault_enable();

/* Flush processor's dcache for this page */
flush_dcache_page(page);
Expand Down
2 changes: 0 additions & 2 deletions fs/fuse/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1003,9 +1003,7 @@ static ssize_t fuse_fill_write_pages(struct fuse_req *req,
if (mapping_writably_mapped(mapping))
flush_dcache_page(page);

pagefault_disable();
tmp = iov_iter_copy_from_user_atomic(page, ii, offset, bytes);
pagefault_enable();
flush_dcache_page(page);

mark_page_accessed(page);
Expand Down
3 changes: 0 additions & 3 deletions mm/filemap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1974,7 +1974,6 @@ size_t iov_iter_copy_from_user_atomic(struct page *page,
char *kaddr;
size_t copied;

BUG_ON(!in_atomic());
kaddr = kmap_atomic(page);
if (likely(i->nr_segs == 1)) {
int left;
Expand Down Expand Up @@ -2348,9 +2347,7 @@ static ssize_t generic_perform_write(struct file *file,
if (mapping_writably_mapped(mapping))
flush_dcache_page(page);

pagefault_disable();
copied = iov_iter_copy_from_user_atomic(page, i, offset, bytes);
pagefault_enable();
flush_dcache_page(page);

mark_page_accessed(page);
Expand Down

0 comments on commit 9e8c2af

Please sign in to comment.