From 53498c3b2428545fadc7e8de96fd842822e37629 Mon Sep 17 00:00:00 2001 From: Richard Yao Date: Fri, 16 May 2014 11:17:17 -0400 Subject: [PATCH] ZFS_IOC_RECV should only call zvol_create_minors() on zvols perf profiling revealed significant time spent in these functions on a system without zvols during a recv. I know of one company that is explicitly disabling this in their own builds because they found that it wastes CPU time. This is the intermediate approach. Signed-off-by: Richard Yao --- module/zfs/zfs_ioctl.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/module/zfs/zfs_ioctl.c b/module/zfs/zfs_ioctl.c index db7683ad9c9f..f6d79f57206c 100644 --- a/module/zfs/zfs_ioctl.c +++ b/module/zfs/zfs_ioctl.c @@ -4037,8 +4037,17 @@ zfs_ioc_recv(zfs_cmd_t *zc) #endif #ifdef _KERNEL - if (error == 0) - zvol_create_minors(tofs); + if (error == 0) { + objset_t *os; + boolean_t iszvol; + + dmu_objset_hold(tofs, FTAG, &os); + iszvol = (dmu_objset_type(os) == DMU_OST_ZVOL); + dmu_objset_rele(os, FTAG); + + if (iszvol) + zvol_create_minors(tofs); + } #endif /*