From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: Joe Perches <joe@perches.com>
Cc: Namjae Jeon <linkinjeon@gmail.com>,
linux-kernel@vger.kernel.org,
Amit Sahrawat <amit.sahrawat83@gmail.com>
Subject: Re: [PATCH 1/2] fat: add fat_msg_ratelimit.
Date: Mon, 14 May 2012 01:10:47 +0900 [thread overview]
Message-ID: <877gwgdptk.fsf@devron.myhome.or.jp> (raw)
In-Reply-To: <1336923908.31383.4.camel@joe2Laptop> (Joe Perches's message of "Sun, 13 May 2012 08:45:08 -0700")
Joe Perches <joe@perches.com> writes:
> On Sun, 2012-05-13 at 07:03 -0400, Namjae Jeon wrote:
>> I tried to add fat_msg_ratelimit to limit many message at once.
>>
>> Signed-off-by: Namjae Jeon <linkinjeon@gmail.com>
>> Signed-off-by: Amit Sahrawat <amit.sahrawat83@gmail.com>
>> ---
>> fs/fat/fat.h | 9 +++++++--
>> fs/fat/misc.c | 18 ++++++++++--------
>> 2 files changed, 17 insertions(+), 10 deletions(-)
>>
>> diff --git a/fs/fat/fat.h b/fs/fat/fat.h
>> index 951d12b..3c581c7 100644
>> --- a/fs/fat/fat.h
>> +++ b/fs/fat/fat.h
>> @@ -333,8 +333,13 @@ void __fat_fs_error(struct super_block *sb, int report, const char *fmt, ...);
>> __fat_fs_error(sb, 1, fmt , ## args)
>> #define fat_fs_error_ratelimit(sb, fmt, args...) \
>> __fat_fs_error(sb, __ratelimit(&MSDOS_SB(sb)->ratelimit), fmt , ## args)
>> -__printf(3, 4) __cold
>> -void fat_msg(struct super_block *sb, const char *level, const char *fmt, ...);
>> +__printf(4, 5) __cold
>> +void __fat_msg(struct super_block *sb, int report, const char *level,
>> + const char *fmt, ...);
>> +#define fat_msg(sb, level, fmt, args...) \
>> + __fat_msg(sb, 1, level, fmt, ## args)
>> +#define fat_msg_ratelimit(sb, level, fmt, args...) \
>> + __fat_msg(sb, __ratelimit(&MSDOS_SB(sb)->ratelimit), level, fmt, ## args)
>
> I think it better to move the test above the call
> and not change the fat_msg function at all.
>
> #define fat_msg_ratelimit(sb, level, fmt, args...) \
> do { \
> if (! __ratelimit(&MSDOS_SB(sb)->ratelimit)) \
> fsg_msg(sb, level, fmt, ##args); \
> } while (0)
Looks sane. I myself don't care either "fat_fs_error vs yours" style.
--
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
next prev parent reply other threads:[~2012-05-13 16:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-13 11:03 [PATCH 1/2] fat: add fat_msg_ratelimit Namjae Jeon
2012-05-13 14:24 ` OGAWA Hirofumi
2012-05-13 15:45 ` Joe Perches
2012-05-13 16:10 ` OGAWA Hirofumi [this message]
2012-05-13 18:11 ` Joe Perches
-- strict thread matches above, loose matches on Subject: below --
2012-05-15 14:46 Namjae Jeon
2012-05-15 15:10 ` OGAWA Hirofumi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877gwgdptk.fsf@devron.myhome.or.jp \
--to=hirofumi@mail.parknet.co.jp \
--cc=amit.sahrawat83@gmail.com \
--cc=joe@perches.com \
--cc=linkinjeon@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox