From: Davidlohr Bueso Date: Thu, 8 Dec 2011 04:42:54 +0000 (+1100) Subject: ipc/mqueue: simplify reading msgqueue limit X-Git-Tag: next-20111212~1^2~16 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a6c8aa1d454e0c80215db18c4f4d380877d27799;p=karo-tx-linux.git 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 Signed-off-by: Andrew Morton --- diff --git a/ipc/mqueue.c b/ipc/mqueue.c index 5ac2b273e00a..26a50f0d21eb 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; @@ -163,7 +162,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;