diff options
author | Jiri Slaby <jslaby@suse.cz> | 2010-02-11 18:40:48 -0500 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2010-02-11 18:40:48 -0500 |
commit | ccbe9f0b11b137c9453771a7ca3bf417dc7ce152 (patch) | |
tree | 0d05240120bb38bb5bfcb4fe3b88aa40cc1dfb94 /drivers/infiniband/core | |
parent | 676ad585531e965416fd958747894541dabcec96 (diff) |
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/core')
-rw-r--r-- | drivers/infiniband/core/umem.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/core/umem.c b/drivers/infiniband/core/umem.c index 6f7c096abf13..4f906f0614f0 100644 --- a/drivers/infiniband/core/umem.c +++ b/drivers/infiniband/core/umem.c | |||
@@ -136,7 +136,7 @@ struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr, | |||
136 | down_write(¤t->mm->mmap_sem); | 136 | down_write(¤t->mm->mmap_sem); |
137 | 137 | ||
138 | locked = npages + current->mm->locked_vm; | 138 | locked = npages + current->mm->locked_vm; |
139 | lock_limit = current->signal->rlim[RLIMIT_MEMLOCK].rlim_cur >> PAGE_SHIFT; | 139 | lock_limit = rlimit(RLIMIT_MEMLOCK) >> PAGE_SHIFT; |
140 | 140 | ||
141 | if ((locked > lock_limit) && !capable(CAP_IPC_LOCK)) { | 141 | if ((locked > lock_limit) && !capable(CAP_IPC_LOCK)) { |
142 | ret = -ENOMEM; | 142 | ret = -ENOMEM; |