diff options
author | David S. Miller <davem@davemloft.net> | 2010-10-21 17:43:05 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-10-21 17:43:05 +0200 |
commit | 2198a10b501fd4443430cb17e065a9e859cc58c9 (patch) | |
tree | 87f3781d293da0f8f8f61615905eb7bf62b7c128 /net/rds/page.c | |
parent | Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/... (diff) | |
parent | Revert d88dca79d3852a3623f606f781e013d61486828a (diff) | |
download | linux-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/page.c')
-rw-r--r-- | net/rds/page.c | 27 |
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); |