The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Steven Whitehouse <swhiteho@redhat.com>
To: Fabian Frederick <fabf@skynet.be>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	akpm <akpm@linux-foundation.org>
Subject: Re: [PATCH 1/1] fs/gfs2/quota.c: replace kmalloc - __vmalloc / memset 0
Date: Thu, 27 Feb 2014 12:27:57 +0000	[thread overview]
Message-ID: <1393504077.2729.28.camel@menhir> (raw)
In-Reply-To: <20140226190756.f2f898b9210e6e4cf48f60f7@skynet.be>

Hi,

On Wed, 2014-02-26 at 19:07 +0100, Fabian Frederick wrote:
> Use kzalloc and __vmalloc __GFP_ZERO for clean sd_quota_bitmap allocation.
> 
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
> ---
>  fs/gfs2/quota.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
Thanks for the patch. I've added it to the GFS2 -nmw tree,

Steve.

> diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c
> index 8bec0e31..1ee4b88 100644
> --- a/fs/gfs2/quota.c
> +++ b/fs/gfs2/quota.c
> @@ -1242,14 +1242,13 @@ int gfs2_quota_init(struct gfs2_sbd *sdp)
>  	bm_size = DIV_ROUND_UP(sdp->sd_quota_slots, 8 * sizeof(unsigned long));
>  	bm_size *= sizeof(unsigned long);
>  	error = -ENOMEM;
> -	sdp->sd_quota_bitmap = kmalloc(bm_size, GFP_NOFS|__GFP_NOWARN);
> +	sdp->sd_quota_bitmap = kzalloc(bm_size, GFP_NOFS | __GFP_NOWARN);
>  	if (sdp->sd_quota_bitmap == NULL)
> -		sdp->sd_quota_bitmap = __vmalloc(bm_size, GFP_NOFS, PAGE_KERNEL);
> +		sdp->sd_quota_bitmap = __vmalloc(bm_size, GFP_NOFS |
> +						 __GFP_ZERO, PAGE_KERNEL);
>  	if (!sdp->sd_quota_bitmap)
>  		return error;
>  
> -	memset(sdp->sd_quota_bitmap, 0, bm_size);
> -
>  	for (x = 0; x < blocks; x++) {
>  		struct buffer_head *bh;
>  		const struct gfs2_quota_change *qc;



      reply	other threads:[~2014-02-27 12:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-26 18:07 [PATCH 1/1] fs/gfs2/quota.c: replace kmalloc - __vmalloc / memset 0 Fabian Frederick
2014-02-27 12:27 ` Steven Whitehouse [this message]

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=1393504077.2729.28.camel@menhir \
    --to=swhiteho@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=fabf@skynet.be \
    --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