* [PATCH 1/1] quota: remove unnecessary oom message
@ 2021-06-17 9:16 Zhen Lei
2021-06-17 15:01 ` Jan Kara
0 siblings, 1 reply; 3+ messages in thread
From: Zhen Lei @ 2021-06-17 9:16 UTC (permalink / raw)
To: Jan Kara, linux-kernel; +Cc: Zhen Lei
Fixes scripts/checkpatch.pl warning:
WARNING: Possible unnecessary 'out of memory' message
Remove it can help us save a bit of memory.
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
fs/quota/quota_tree.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/fs/quota/quota_tree.c b/fs/quota/quota_tree.c
index c5562c871c8b..b097d02bad94 100644
--- a/fs/quota/quota_tree.c
+++ b/fs/quota/quota_tree.c
@@ -49,11 +49,7 @@ static int qtree_dqstr_in_blk(struct qtree_mem_dqinfo *info)
static char *getdqbuf(size_t size)
{
- char *buf = kmalloc(size, GFP_NOFS);
- if (!buf)
- printk(KERN_WARNING
- "VFS: Not enough memory for quota buffers.\n");
- return buf;
+ return kmalloc(size, GFP_NOFS);
}
static ssize_t read_blk(struct qtree_mem_dqinfo *info, uint blk, char *buf)
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] quota: remove unnecessary oom message
2021-06-17 9:16 [PATCH 1/1] quota: remove unnecessary oom message Zhen Lei
@ 2021-06-17 15:01 ` Jan Kara
2021-06-18 1:20 ` Leizhen (ThunderTown)
0 siblings, 1 reply; 3+ messages in thread
From: Jan Kara @ 2021-06-17 15:01 UTC (permalink / raw)
To: Zhen Lei; +Cc: Jan Kara, linux-kernel
On Thu 17-06-21 17:16:27, Zhen Lei wrote:
> Fixes scripts/checkpatch.pl warning:
> WARNING: Possible unnecessary 'out of memory' message
>
> Remove it can help us save a bit of memory.
>
> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
I agree the message is pointless. But when doing this, I guess we can just
get rid of getdqbuf() altogether and instead call kmalloc() directly in all
the places.
Honza
> diff --git a/fs/quota/quota_tree.c b/fs/quota/quota_tree.c
> index c5562c871c8b..b097d02bad94 100644
> --- a/fs/quota/quota_tree.c
> +++ b/fs/quota/quota_tree.c
> @@ -49,11 +49,7 @@ static int qtree_dqstr_in_blk(struct qtree_mem_dqinfo *info)
>
> static char *getdqbuf(size_t size)
> {
> - char *buf = kmalloc(size, GFP_NOFS);
> - if (!buf)
> - printk(KERN_WARNING
> - "VFS: Not enough memory for quota buffers.\n");
> - return buf;
> + return kmalloc(size, GFP_NOFS);
> }
>
> static ssize_t read_blk(struct qtree_mem_dqinfo *info, uint blk, char *buf)
> --
> 2.25.1
>
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] quota: remove unnecessary oom message
2021-06-17 15:01 ` Jan Kara
@ 2021-06-18 1:20 ` Leizhen (ThunderTown)
0 siblings, 0 replies; 3+ messages in thread
From: Leizhen (ThunderTown) @ 2021-06-18 1:20 UTC (permalink / raw)
To: Jan Kara; +Cc: Jan Kara, linux-kernel
On 2021/6/17 23:01, Jan Kara wrote:
> On Thu 17-06-21 17:16:27, Zhen Lei wrote:
>> Fixes scripts/checkpatch.pl warning:
>> WARNING: Possible unnecessary 'out of memory' message
>>
>> Remove it can help us save a bit of memory.
>>
>> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
>
> I agree the message is pointless. But when doing this, I guess we can just
> get rid of getdqbuf() altogether and instead call kmalloc() directly in all
> the places.
OK, I will get rid of it in v2.
>
> Honza
>
>> diff --git a/fs/quota/quota_tree.c b/fs/quota/quota_tree.c
>> index c5562c871c8b..b097d02bad94 100644
>> --- a/fs/quota/quota_tree.c
>> +++ b/fs/quota/quota_tree.c
>> @@ -49,11 +49,7 @@ static int qtree_dqstr_in_blk(struct qtree_mem_dqinfo *info)
>>
>> static char *getdqbuf(size_t size)
>> {
>> - char *buf = kmalloc(size, GFP_NOFS);
>> - if (!buf)
>> - printk(KERN_WARNING
>> - "VFS: Not enough memory for quota buffers.\n");
>> - return buf;
>> + return kmalloc(size, GFP_NOFS);
>> }
>>
>> static ssize_t read_blk(struct qtree_mem_dqinfo *info, uint blk, char *buf)
>> --
>> 2.25.1
>>
>>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-06-18 1:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-17 9:16 [PATCH 1/1] quota: remove unnecessary oom message Zhen Lei
2021-06-17 15:01 ` Jan Kara
2021-06-18 1:20 ` Leizhen (ThunderTown)
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.