[2/3] btrfs: switch kmallocs to GFP_KERNEL in lzo/zlib alloc_workspace
diff mbox

Message ID b00f101454e17051d005f9fb28224b665c339cf1.1496245064.git.dsterba@suse.com
State New
Headers show

Commit Message

David Sterba May 31, 2017, 3:41 p.m. UTC
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>
---
 fs/btrfs/lzo.c  | 2 +-
 fs/btrfs/zlib.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

Comments

Anand Jain June 1, 2017, 3:36 a.m. UTC | #1
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;
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch
diff mbox

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;