aboutsummaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorDavidlohr Bueso <dave@gnu.org>2012-01-20 17:34:01 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-23 11:38:47 -0500
commit2a4e64b8f6bcbf23ddd375b78342051ae8862284 (patch)
tree90e753679ca8ff867dc42e84e5a33c90f813c244 /ipc
parente9a4593cc5e36c6d47c87b439cb41c2568e7395f (diff)
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')
-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,
128 128
129 if (S_ISREG(mode)) { 129 if (S_ISREG(mode)) {
130 struct mqueue_inode_info *info; 130 struct mqueue_inode_info *info;
131 struct task_struct *p = current;
132 unsigned long mq_bytes, mq_msg_tblsz; 131 unsigned long mq_bytes, mq_msg_tblsz;
133 132
134 inode->i_fop = &mqueue_file_operations; 133 inode->i_fop = &mqueue_file_operations;
@@ -159,7 +158,7 @@ static struct inode *mqueue_get_inode(struct super_block *sb,
159 158
160 spin_lock(&mq_lock); 159 spin_lock(&mq_lock);
161 if (u->mq_bytes + mq_bytes < u->mq_bytes || 160 if (u->mq_bytes + mq_bytes < u->mq_bytes ||
162 u->mq_bytes + mq_bytes > task_rlimit(p, RLIMIT_MSGQUEUE)) { 161 u->mq_bytes + mq_bytes > rlimit(RLIMIT_MSGQUEUE)) {
163 spin_unlock(&mq_lock); 162 spin_unlock(&mq_lock);
164 /* mqueue_evict_inode() releases info->messages */ 163 /* mqueue_evict_inode() releases info->messages */
165 ret = -EMFILE; 164 ret = -EMFILE;