summaryrefslogtreecommitdiff
path: root/ipc/mqueue.c
diff options
context:
space:
mode:
authorDavidlohr Bueso <dave@gnu.org>2012-01-20 14:34:01 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-23 08:38:47 -0800
commit2a4e64b8f6bcbf23ddd375b78342051ae8862284 (patch)
tree90e753679ca8ff867dc42e84e5a33c90f813c244 /ipc/mqueue.c
parente9a4593cc5e36c6d47c87b439cb41c2568e7395f (diff)
downloadlwn-2a4e64b8f6bcbf23ddd375b78342051ae8862284.tar.gz
lwn-2a4e64b8f6bcbf23ddd375b78342051ae8862284.zip
ipc/mqueue: simplify reading msgqueue limit
Because the current task is being used to get the limit, we can simply use rlimit() instead of task_rlimit(). Signed-off-by: Davidlohr Bueso <dave@gnu.org> Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'ipc/mqueue.c')
-rw-r--r--ipc/mqueue.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index 9b7c8ab7d75c..86ee272de210 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -128,7 +128,6 @@ static struct inode *mqueue_get_inode(struct super_block *sb,
if (S_ISREG(mode)) {
struct mqueue_inode_info *info;
- struct task_struct *p = current;
unsigned long mq_bytes, mq_msg_tblsz;
inode->i_fop = &mqueue_file_operations;
@@ -159,7 +158,7 @@ static struct inode *mqueue_get_inode(struct super_block *sb,
spin_lock(&mq_lock);
if (u->mq_bytes + mq_bytes < u->mq_bytes ||
- u->mq_bytes + mq_bytes > task_rlimit(p, RLIMIT_MSGQUEUE)) {
+ u->mq_bytes + mq_bytes > rlimit(RLIMIT_MSGQUEUE)) {
spin_unlock(&mq_lock);
/* mqueue_evict_inode() releases info->messages */
ret = -EMFILE;