Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);

+2 −2
Original line number Diff line number Diff line
@@ -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;