]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/blobdiff - fs/btrfs/send.c
treewide: use kv[mz]alloc* rather than opencoded variants
[mirror_ubuntu-eoan-kernel.git] / fs / btrfs / send.c
index a60d5bfb8a49e2bfc3faef10f4ea353a9da5f8b8..3f645cd67b540ac3b066a2727bd012c87895247d 100644 (file)
@@ -6360,22 +6360,16 @@ long btrfs_ioctl_send(struct file *mnt_file, void __user *arg_)
        sctx->clone_roots_cnt = arg->clone_sources_count;
 
        sctx->send_max_size = BTRFS_SEND_BUF_SIZE;
-       sctx->send_buf = kmalloc(sctx->send_max_size, GFP_KERNEL | __GFP_NOWARN);
+       sctx->send_buf = kvmalloc(sctx->send_max_size, GFP_KERNEL);
        if (!sctx->send_buf) {
-               sctx->send_buf = vmalloc(sctx->send_max_size);
-               if (!sctx->send_buf) {
-                       ret = -ENOMEM;
-                       goto out;
-               }
+               ret = -ENOMEM;
+               goto out;
        }
 
-       sctx->read_buf = kmalloc(BTRFS_SEND_READ_SIZE, GFP_KERNEL | __GFP_NOWARN);
+       sctx->read_buf = kvmalloc(BTRFS_SEND_READ_SIZE, GFP_KERNEL);
        if (!sctx->read_buf) {
-               sctx->read_buf = vmalloc(BTRFS_SEND_READ_SIZE);
-               if (!sctx->read_buf) {
-                       ret = -ENOMEM;
-                       goto out;
-               }
+               ret = -ENOMEM;
+               goto out;
        }
 
        sctx->pending_dir_moves = RB_ROOT;
@@ -6396,13 +6390,10 @@ long btrfs_ioctl_send(struct file *mnt_file, void __user *arg_)
        alloc_size = arg->clone_sources_count * sizeof(*arg->clone_sources);
 
        if (arg->clone_sources_count) {
-               clone_sources_tmp = kmalloc(alloc_size, GFP_KERNEL | __GFP_NOWARN);
+               clone_sources_tmp = kvmalloc(alloc_size, GFP_KERNEL);
                if (!clone_sources_tmp) {
-                       clone_sources_tmp = vmalloc(alloc_size);
-                       if (!clone_sources_tmp) {
-                               ret = -ENOMEM;
-                               goto out;
-                       }
+                       ret = -ENOMEM;
+                       goto out;
                }
 
                ret = copy_from_user(clone_sources_tmp, arg->clone_sources,