Skip to content

Commit

Permalink
=> openzfs#2388: ryao/recv - ZFS_IOC_RECV should only call zvol_creat…
Browse files Browse the repository at this point in the history
…e_minors() on zvols.

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 <ryao@gentoo.org>
  • Loading branch information
ryao authored and FransUrbo committed Sep 5, 2014
1 parent 7bb8be8 commit 21eecef
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions module/zfs/zfs_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -4171,8 +4171,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

/*
Expand Down

0 comments on commit 21eecef

Please sign in to comment.