btrfs: switch kmallocs to GFP_KERNEL in lzo/zlib alloc_workspace
authorDavid Sterba <dsterba@suse.com>
Wed, 31 May 2017 15:21:15 +0000 (17:21 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 19 Jun 2017 16:26:02 +0000 (18:26 +0200)
As alloc_workspace is now protected by memalloc_nofs where needed,
we can switch the kmalloc to use GFP_KERNEL.

Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/lzo.c
fs/btrfs/zlib.c

index 7e8b0d6a7961f355302da4567387c4f427099f42..5ffee3986e1ae5dd8126c5064c2d3f404f222de5 100644 (file)
@@ -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);
 
index d5446e18bb5929978da9f107c45059864c2e28aa..c1db7572283b324626377361e10a7a87490e74f3 100644 (file)
@@ -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;