summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/send.c
diff options
context:
space:
mode:
authorDavid Sterba2017-05-31 18:40:02 +0200
committerDavid Sterba2017-06-19 18:26:01 +0200
commit818e010bf9d02b144569898506995bcff8918875 (patch)
treeb8d9b0f2cf2c78609c4ccd9f3b9566a762296876 /fs/btrfs/send.c
parentBtrfs: lzo: compressed data size must be less then input size (diff)
downloadkernel-qcow2-linux-818e010bf9d02b144569898506995bcff8918875.tar.gz
kernel-qcow2-linux-818e010bf9d02b144569898506995bcff8918875.tar.xz
kernel-qcow2-linux-818e010bf9d02b144569898506995bcff8918875.zip
btrfs: replace opencoded kvzalloc with the helper
The logic of kmalloc and vmalloc fallback is opencoded in several places, we can now use the existing helper. Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/send.c')
-rw-r--r--fs/btrfs/send.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
index e8185c83f667..924b1d941b53 100644
--- a/fs/btrfs/send.c
+++ b/fs/btrfs/send.c
@@ -6389,13 +6389,10 @@ long btrfs_ioctl_send(struct file *mnt_file, void __user *arg_)
alloc_size = sizeof(struct clone_root) * (arg->clone_sources_count + 1);
- sctx->clone_roots = kzalloc(alloc_size, GFP_KERNEL | __GFP_NOWARN);
+ sctx->clone_roots = kzalloc(alloc_size, GFP_KERNEL);
if (!sctx->clone_roots) {
- sctx->clone_roots = vzalloc(alloc_size);
- if (!sctx->clone_roots) {
- ret = -ENOMEM;
- goto out;
- }
+ ret = -ENOMEM;
+ goto out;
}
alloc_size = arg->clone_sources_count * sizeof(*arg->clone_sources);