summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/ipath
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2010-02-12 00:40:48 +0100
committerRoland Dreier <rolandd@cisco.com>2010-02-12 00:40:48 +0100
commitccbe9f0b11b137c9453771a7ca3bf417dc7ce152 (patch)
tree0d05240120bb38bb5bfcb4fe3b88aa40cc1dfb94 /drivers/infiniband/hw/ipath
parentMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp (diff)
downloadlinux-ccbe9f0b11b137c9453771a7ca3bf417dc7ce152.tar.xz
linux-ccbe9f0b11b137c9453771a7ca3bf417dc7ce152.zip
RDMA: Use rlimit helpers
Make sure compiler won't do weird things with limits by using the rlimit helpers added in 3e10e716 ("resource: add helpers for fetching rlimits"). E.g. fetching them twice may return 2 different values after writable limits are implemented. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/ipath')
-rw-r--r--drivers/infiniband/hw/ipath/ipath_user_pages.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_user_pages.c b/drivers/infiniband/hw/ipath/ipath_user_pages.c
index 82878e348627..eb7d59abd12d 100644
--- a/drivers/infiniband/hw/ipath/ipath_user_pages.c
+++ b/drivers/infiniband/hw/ipath/ipath_user_pages.c
@@ -59,8 +59,7 @@ static int __get_user_pages(unsigned long start_page, size_t num_pages,
size_t got;
int ret;
- lock_limit = current->signal->rlim[RLIMIT_MEMLOCK].rlim_cur >>
- PAGE_SHIFT;
+ lock_limit = rlimit(RLIMIT_MEMLOCK) >> PAGE_SHIFT;
if (num_pages > lock_limit) {
ret = -ENOMEM;