From: Joe Perches <joe@perches.com>
To: Ryan Mallon <rmallon@gmail.com>
Cc: Jan Harkes <jaharkes@cs.cmu.edu>,
coda@cs.cmu.edu, codalist@TELEMANN.coda.cs.cmu.edu,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/4] coda: Remove unnecessary OOM messages
Date: Tue, 31 Jan 2012 16:21:05 -0800 [thread overview]
Message-ID: <1328055665.14714.5.camel@joe2Laptop> (raw)
In-Reply-To: <4F288178.4040405@gmail.com>
> Since CODA_ALLOC no longer uses __FILE__ and __LINE__ and doesn't use
> the cast argument any more, it can be replaced with a static inline
> function. Something like this (untested, applies on top of your patch):
Hi Ryan.
I didn't want to be quite so invasive
but this looks like a nice cleanup to me.
Maybe because alloc/free functions are
used relatively infrequently, maybe it'd
be better to not declare the functions
inline but add them to coda_linux.c
> +static inline void *coda_alloc(size_t size)
> +{
> + if (size < PAGE_SIZE)
> + return kzalloc(size, GFP_KERNEL);
> + return vzalloc(size);
> +}
[]
> +static inline void coda_free(const void *ptr, size_t size)
> +{
> + if (size < PAGE_SIZE)
> + kfree(ptr);
> + else
> + vfree(ptr);
> +}
next prev parent reply other threads:[~2012-02-01 0:21 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-31 22:42 [PATCH 0/4] fs: Remove unnecessary OOM messages Joe Perches
2012-01-31 22:42 ` [PATCH 1/4] coda: " Joe Perches
2012-02-01 0:04 ` Ryan Mallon
2012-02-01 0:21 ` Joe Perches [this message]
2012-02-01 0:23 ` Ryan Mallon
2012-02-01 0:26 ` Joe Perches
2012-02-01 3:10 ` Jan Harkes
2012-02-01 3:42 ` Joe Perches
2012-01-31 22:42 ` [PATCH 2/4] jffs2: " Joe Perches
2012-02-03 7:00 ` Artem Bityutskiy
2012-01-31 22:42 ` [PATCH 3/4] reiserfs: " Joe Perches
2012-01-31 22:42 ` [PATCH 4/4] udf: " Joe Perches
2012-02-01 11:28 ` Jan Kara
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=1328055665.14714.5.camel@joe2Laptop \
--to=joe@perches.com \
--cc=coda@cs.cmu.edu \
--cc=codalist@TELEMANN.coda.cs.cmu.edu \
--cc=jaharkes@cs.cmu.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=rmallon@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).