K 10 svn:author V 3 avg K 8 svn:date V 27 2017-10-02T11:15:32.019073Z K 7 svn:log V 1337 MFV r323795: 8604 Avoid unnecessary work search in VFS when unmounting snapshots illumos/illumos-gate@ed992b0aac4e5b70dc1273b1d055c0d471fbb4b1 https://github.com/illumos/illumos-gate/commit/ed992b0aac4e5b70dc1273b1d055c0d471fbb4b1 https://www.illumos.org/issues/8604 Every time we want to unmount a snapshot (happens during snapshot deletion or renaming) we unnecessarily iterate through all the mountpoints in the VFS layer (see zfs_get_vfs). Ideally we would just put a hold on the snapshot and access its respective VFS resource directly. Reviewed by: Matt Ahrens Reviewed by: George Wilson Reviewed by: Andy Stormont Approved by: Robert Mustacchi Author: Serapheim Dimitropoulos FreeBSD note: I added a FreeBSD specific function getzfsvfs_ref() which is like getzfsvfs() but returns a filesystem referenced, not busied. We want a busied filesystem in most cases, because we access its private data and, thus, we need to prevent the filesystem from being unmounted and its private data destroyed. But in some cases we can either get away with just a referenced filesystem or we must not busy the filesystem. Unmounting the filesystem is one of such cases. MFC after: 5 weeks X-MFC after: r324163 END