* [PATCH] ipc/mqueue: simplify reading msgqueue limit
@ 2011-11-03 18:31 Davidlohr Bueso
2011-11-07 22:15 ` Davidlohr Bueso
0 siblings, 1 reply; 3+ messages in thread
From: Davidlohr Bueso @ 2011-11-03 18:31 UTC (permalink / raw)
To: Andrew Morton, Jiri Slaby, Wanlong Gao, Nick Piggin; +Cc: lkml
From: Davidlohr Bueso <dave@gnu.org>
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>
---
ipc/mqueue.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index 2e0ecfc..c0e4fbb 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -127,7 +127,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;
@@ -158,7 +157,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;
--
1.7.4.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ipc/mqueue: simplify reading msgqueue limit
2011-11-03 18:31 [PATCH] ipc/mqueue: simplify reading msgqueue limit Davidlohr Bueso
@ 2011-11-07 22:15 ` Davidlohr Bueso
2011-11-16 0:10 ` KOSAKI Motohiro
0 siblings, 1 reply; 3+ messages in thread
From: Davidlohr Bueso @ 2011-11-07 22:15 UTC (permalink / raw)
To: Andrew Morton; +Cc: Jiri Slaby, Wanlong Gao, Nick Piggin, lkml
ping?
On Thu, 2011-11-03 at 15:31 -0300, Davidlohr Bueso wrote:
> From: Davidlohr Bueso <dave@gnu.org>
>
> 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>
> ---
> ipc/mqueue.c | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/ipc/mqueue.c b/ipc/mqueue.c
> index 2e0ecfc..c0e4fbb 100644
> --- a/ipc/mqueue.c
> +++ b/ipc/mqueue.c
> @@ -127,7 +127,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;
> @@ -158,7 +157,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;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ipc/mqueue: simplify reading msgqueue limit
2011-11-07 22:15 ` Davidlohr Bueso
@ 2011-11-16 0:10 ` KOSAKI Motohiro
0 siblings, 0 replies; 3+ messages in thread
From: KOSAKI Motohiro @ 2011-11-16 0:10 UTC (permalink / raw)
To: dave; +Cc: akpm, jslaby, gaowanlong, npiggin, linux-kernel
On 11/7/2011 5:15 PM, Davidlohr Bueso wrote:
> ping?
>
> On Thu, 2011-11-03 at 15:31 -0300, Davidlohr Bueso wrote:
>> From: Davidlohr Bueso <dave@gnu.org>
>>
>> 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>
Sorry for the delay.
Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
>> ---
>> ipc/mqueue.c | 3 +--
>> 1 files changed, 1 insertions(+), 2 deletions(-)
>>
>> diff --git a/ipc/mqueue.c b/ipc/mqueue.c
>> index 2e0ecfc..c0e4fbb 100644
>> --- a/ipc/mqueue.c
>> +++ b/ipc/mqueue.c
>> @@ -127,7 +127,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;
>> @@ -158,7 +157,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;
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-11-16 1:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-03 18:31 [PATCH] ipc/mqueue: simplify reading msgqueue limit Davidlohr Bueso
2011-11-07 22:15 ` Davidlohr Bueso
2011-11-16 0:10 ` KOSAKI Motohiro
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.