From 8d21c002c6ae9f0d406903821e832698fa32b711 Mon Sep 17 00:00:00 2001 From: Rob Norris Date: Thu, 22 Jun 2023 13:44:00 +1000 Subject: [PATCH] zfs_clone_range: use vmem_malloc for large allocation Just silencing the warning about large allocations. Reviewed-by: Brian Behlendorf Reviewed-by: Kay Pedersen Signed-off-by: Rob Norris Sponsored-By: OpenDrives Inc. Sponsored-By: Klara Inc. Closes #15050 --- module/zfs/zfs_vnops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/zfs/zfs_vnops.c b/module/zfs/zfs_vnops.c index 7bdcc16393..3ebd2d0ff7 100644 --- a/module/zfs/zfs_vnops.c +++ b/module/zfs/zfs_vnops.c @@ -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: