Commit 389a6cfc authored by David Sterba's avatar David Sterba

btrfs: switch kmallocs to GFP_KERNEL in lzo/zlib alloc_workspace

As alloc_workspace is now protected by memalloc_nofs where needed,
we can switch the kmalloc to use GFP_KERNEL.
Reviewed-by: default avatarAnand Jain <anand.jain@oracle.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent fe308533
...@@ -51,7 +51,7 @@ static struct list_head *lzo_alloc_workspace(void) ...@@ -51,7 +51,7 @@ static struct list_head *lzo_alloc_workspace(void)
{ {
struct workspace *workspace; struct workspace *workspace;
workspace = kzalloc(sizeof(*workspace), GFP_NOFS); workspace = kzalloc(sizeof(*workspace), GFP_KERNEL);
if (!workspace) if (!workspace)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
......
...@@ -53,14 +53,14 @@ static struct list_head *zlib_alloc_workspace(void) ...@@ -53,14 +53,14 @@ static struct list_head *zlib_alloc_workspace(void)
struct workspace *workspace; struct workspace *workspace;
int workspacesize; int workspacesize;
workspace = kzalloc(sizeof(*workspace), GFP_NOFS); workspace = kzalloc(sizeof(*workspace), GFP_KERNEL);
if (!workspace) if (!workspace)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
workspacesize = max(zlib_deflate_workspacesize(MAX_WBITS, MAX_MEM_LEVEL), workspacesize = max(zlib_deflate_workspacesize(MAX_WBITS, MAX_MEM_LEVEL),
zlib_inflate_workspacesize()); zlib_inflate_workspacesize());
workspace->strm.workspace = vmalloc(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) if (!workspace->strm.workspace || !workspace->buf)
goto fail; goto fail;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment