From: Nitin Gupta <ngupta@vflare.org>
To: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: Greg KH <greg@kroah.com>, linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/3] use lock for 64-bit stats
Date: Wed, 27 Jan 2010 21:21:14 +0530 [thread overview]
Message-ID: <4B6060F2.3070702@vflare.org> (raw)
In-Reply-To: <4B605779.9010500@cs.helsinki.fi>
On 01/27/2010 08:40 PM, Pekka Enberg wrote:
> Nitin Gupta wrote:
>> +static void stat_dec(u32 *v)
>> +{
>> + *v = *v - 1;
>> +}
>> +
>> +static void stat64_inc(struct ramzswap *rzs, u64 *v)
>> +{
>> + spin_lock(&rzs->stat64_lock);
>> + *v = *v + 1;
>> + spin_unlock(&rzs->stat64_lock);
>> +}
>> +
>> +static void stat64_dec(struct ramzswap *rzs, u64 *v)
>> +{
>> + spin_lock(&rzs->stat64_lock);
>> + *v = *v - 1;
>> + spin_unlock(&rzs->stat64_lock);
>> +}
>> +
>> +static u64 stat64_read(struct ramzswap *rzs, u64 *v)
>> +{
>> + u64 val;
>> +
>> + spin_lock(&rzs->stat64_lock);
>> + val = *v;
>> + spin_unlock(&rzs->stat64_lock);
>> +
>> + return val;
>> +}
>> +#else
>> +#define stat_inc(v)
>> +#define stat_dec(v)
>> +#define stat64_inc(r, v)
>> +#define stat64_dec(r, v)
>> +#define stat64_read(r, v)
>> +#endif /* CONFIG_RAMZSWAP_STATS */
>
> I think I complained about this before: the names are too generic and
> could collide with core kernel code. I think they ought to be called
> ramzsawp_stat*().
>
I somehow missed this point. I will rename these to rzs_stat*()
('rzs_' prefix is used for other one-liner functions too).
Thanks,
Nitin
next prev parent reply other threads:[~2010-01-27 15:53 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-27 14:24 [PATCH 0/3][linux-next] ramzswap: bug fixes and some cleanups Nitin Gupta
2010-01-27 14:24 ` [PATCH 1/3] use lock for 64-bit stats Nitin Gupta
2010-01-27 15:10 ` Pekka Enberg
2010-01-27 15:51 ` Nitin Gupta [this message]
2010-01-28 2:19 ` [PATCH 1/3][resend] " Nitin Gupta
2010-01-27 14:24 ` [PATCH 2/3] flush block device before reset Nitin Gupta
2010-01-27 14:24 ` [PATCH 3/3] set block size to PAGE_SIZE and some cleanups Nitin Gupta
2010-01-28 3:59 ` [PATCH 3/3][resend] " Nitin Gupta
2010-01-28 4:23 ` Greg KH
2010-01-28 5:37 ` Nitin Gupta
2010-01-28 5:54 ` Greg KH
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=4B6060F2.3070702@vflare.org \
--to=ngupta@vflare.org \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=penberg@cs.helsinki.fi \
/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