OSDN Git Service

Btrfs: use memalloc_nofs and kvzalloc() for free space tree bitmaps
authorOmar Sandoval <osandov@fb.com>
Mon, 5 Jun 2017 07:12:31 +0000 (00:12 -0700)
committerDavid Sterba <dsterba@suse.com>
Mon, 19 Jun 2017 16:26:01 +0000 (18:26 +0200)
commit25ff17e82f9612dcd1cf4668acb2148e18305507
tree7266050b74ca54a91eb5bd5065eda3c7fbb93f69
parent4b5faeac4688174fd523f2a22b7d70d5a96842fb
Btrfs: use memalloc_nofs and kvzalloc() for free space tree bitmaps

First, instead of open-coding the vmalloc() fallback, use the new
kvzalloc() helper. Second, use memalloc_nofs_{save,restore}() instead of
GFP_NOFS, as vmalloc() uses some GFP_KERNEL allocations internally which
could lead to deadlocks.

Signed-off-by: Omar Sandoval <osandov@fb.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/free-space-tree.c