linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: David Sterba <dsterba@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 2/3] btrfs: switch kmallocs to GFP_KERNEL in lzo/zlib alloc_workspace
Date: Thu, 1 Jun 2017 11:36:29 +0800	[thread overview]
Message-ID: <489acb80-2dac-5de6-af24-aed8c6176645@oracle.com> (raw)
In-Reply-To: <b00f101454e17051d005f9fb28224b665c339cf1.1496245064.git.dsterba@suse.com>



On 05/31/17 23:41, David Sterba wrote:
> As alloc_workspace is now protected by memalloc_nofs where needed,
> we can switch the kmalloc to use GFP_KERNEL.
>
> Signed-off-by: David Sterba <dsterba@suse.com>


Reviewed-by: Anand Jain <anand.jain@oracle.com>

Thanks, Anand

> ---
>  fs/btrfs/lzo.c  | 2 +-
>  fs/btrfs/zlib.c | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/fs/btrfs/lzo.c b/fs/btrfs/lzo.c
> index a554856a5f8a..c556f3f3fbf0 100644
> --- a/fs/btrfs/lzo.c
> +++ b/fs/btrfs/lzo.c
> @@ -51,7 +51,7 @@ static struct list_head *lzo_alloc_workspace(void)
>  {
>  	struct workspace *workspace;
>
> -	workspace = kzalloc(sizeof(*workspace), GFP_NOFS);
> +	workspace = kzalloc(sizeof(*workspace), GFP_KERNEL);
>  	if (!workspace)
>  		return ERR_PTR(-ENOMEM);
>
> diff --git a/fs/btrfs/zlib.c b/fs/btrfs/zlib.c
> index d5446e18bb59..c1db7572283b 100644
> --- a/fs/btrfs/zlib.c
> +++ b/fs/btrfs/zlib.c
> @@ -53,14 +53,14 @@ static struct list_head *zlib_alloc_workspace(void)
>  	struct workspace *workspace;
>  	int workspacesize;
>
> -	workspace = kzalloc(sizeof(*workspace), GFP_NOFS);
> +	workspace = kzalloc(sizeof(*workspace), GFP_KERNEL);
>  	if (!workspace)
>  		return ERR_PTR(-ENOMEM);
>
>  	workspacesize = max(zlib_deflate_workspacesize(MAX_WBITS, MAX_MEM_LEVEL),
>  			zlib_inflate_workspacesize());
>  	workspace->strm.workspace = vmalloc(workspacesize);
> -	workspace->buf = kmalloc(PAGE_SIZE, GFP_NOFS);
> +	workspace->buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
>  	if (!workspace->strm.workspace || !workspace->buf)
>  		goto fail;
>
>

  reply	other threads:[~2017-06-01  3:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-31 15:41 [PATCH 0/3] Update gfp flags in alloc_workspace David Sterba
2017-05-31 15:41 ` [PATCH 1/3] btrfs: add memalloc_nofs protections around alloc_workspace callback David Sterba
2017-06-01  3:36   ` Anand Jain
2017-05-31 15:41 ` [PATCH 2/3] btrfs: switch kmallocs to GFP_KERNEL in lzo/zlib alloc_workspace David Sterba
2017-06-01  3:36   ` Anand Jain [this message]
2017-05-31 15:41 ` [PATCH 3/3] btrfs: switch to kvmalloc and " David Sterba
2017-06-01  3:58   ` Anand Jain
2017-06-01 14:24     ` David Sterba

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=489acb80-2dac-5de6-af24-aed8c6176645@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=dsterba@suse.com \
    --cc=linux-btrfs@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;
as well as URLs for NNTP newsgroup(s).