zfs_clone_range: use vmem_malloc for large allocation

Just silencing the warning about large allocations.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Kay Pedersen <mail@mkwg.de>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Sponsored-By: OpenDrives Inc.
Sponsored-By: Klara Inc.
Closes #15050
This commit is contained in:
Rob Norris 2023-06-22 13:44:00 +10:00 committed by Brian Behlendorf
parent b9aa32ff39
commit 7698503dca

View File

@ -1212,7 +1212,7 @@ zfs_clone_range(znode_t *inzp, uint64_t *inoffp, znode_t *outzp,
gid = KGID_TO_SGID(ZTOGID(outzp));
projid = outzp->z_projid;
bps = kmem_alloc(sizeof (bps[0]) * maxblocks, KM_SLEEP);
bps = vmem_alloc(sizeof (bps[0]) * maxblocks, KM_SLEEP);
/*
* Clone the file in reasonable size chunks. Each chunk is cloned
@ -1330,7 +1330,7 @@ zfs_clone_range(znode_t *inzp, uint64_t *inoffp, znode_t *outzp,
done += size;
}
kmem_free(bps, sizeof (bps[0]) * maxblocks);
vmem_free(bps, sizeof (bps[0]) * maxblocks);
zfs_znode_update_vfs(outzp);
unlock: