summaryrefslogtreecommitdiffstats
path: root/net/rds
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-10-21 17:43:05 +0200
committerDavid S. Miller <davem@davemloft.net>2010-10-21 17:43:05 +0200
commit2198a10b501fd4443430cb17e065a9e859cc58c9 (patch)
tree87f3781d293da0f8f8f61615905eb7bf62b7c128 /net/rds
parentMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/... (diff)
parentRevert d88dca79d3852a3623f606f781e013d61486828a (diff)
downloadlinux-2198a10b501fd4443430cb17e065a9e859cc58c9.tar.xz
linux-2198a10b501fd4443430cb17e065a9e859cc58c9.zip
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: net/core/dev.c
Diffstat (limited to 'net/rds')
-rw-r--r--net/rds/page.c27
1 files changed, 7 insertions, 20 deletions
diff --git a/net/rds/page.c b/net/rds/page.c
index a3e2e0ac8a60..d8acdebe3c7c 100644
--- a/net/rds/page.c
+++ b/net/rds/page.c
@@ -58,30 +58,17 @@ int rds_page_copy_user(struct page *page, unsigned long offset,
unsigned long ret;
void *addr;
- if (to_user)
+ addr = kmap(page);
+ if (to_user) {
rds_stats_add(s_copy_to_user, bytes);
- else
+ ret = copy_to_user(ptr, addr + offset, bytes);
+ } else {
rds_stats_add(s_copy_from_user, bytes);
-
- addr = kmap_atomic(page, KM_USER0);
- if (to_user)
- ret = __copy_to_user_inatomic(ptr, addr + offset, bytes);
- else
- ret = __copy_from_user_inatomic(addr + offset, ptr, bytes);
- kunmap_atomic(addr, KM_USER0);
-
- if (ret) {
- addr = kmap(page);
- if (to_user)
- ret = copy_to_user(ptr, addr + offset, bytes);
- else
- ret = copy_from_user(addr + offset, ptr, bytes);
- kunmap(page);
- if (ret)
- return -EFAULT;
+ ret = copy_from_user(addr + offset, ptr, bytes);
}
+ kunmap(page);
- return 0;
+ return ret ? -EFAULT : 0;
}
EXPORT_SYMBOL_GPL(rds_page_copy_user);