2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-22 04:03:58 +08:00

btrfs: clone: use vmalloc only as fallback for nodesize bufer

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2016-04-11 18:40:08 +02:00
parent 2f91306a37
commit 153519559a

View File

@ -3468,13 +3468,16 @@ static int btrfs_clone(struct inode *src, struct inode *inode,
u64 last_dest_end = destoff; u64 last_dest_end = destoff;
ret = -ENOMEM; ret = -ENOMEM;
buf = kmalloc(root->nodesize, GFP_KERNEL | __GFP_NOWARN);
if (!buf) {
buf = vmalloc(root->nodesize); buf = vmalloc(root->nodesize);
if (!buf) if (!buf)
return ret; return ret;
}
path = btrfs_alloc_path(); path = btrfs_alloc_path();
if (!path) { if (!path) {
vfree(buf); kvfree(buf);
return ret; return ret;
} }
@ -3775,7 +3778,7 @@ process_slot:
out: out:
btrfs_free_path(path); btrfs_free_path(path);
vfree(buf); kvfree(buf);
return ret; return ret;
} }