]> git.proxmox.com Git - mirror_zfs.git/commit
Multi-thread 'zpool import' for blkid
authorBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 23 Jun 2016 22:25:17 +0000 (15:25 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 27 Jul 2016 20:38:46 +0000 (13:38 -0700)
commit8a39abaafad51861daf197b0e9809dfcf77fd3cf
treec5964b86e1e9bf16c339bd6ffbc97db1750ddd4c
parenta64f903b06e9135c07f20bc6f8196e2879d2cf57
Multi-thread 'zpool import' for blkid

Commit 519129f added support to multi-thread 'zpool import' for
the case where block devices are scanned for under /dev/.  This
commit generalizes that logic and applies it to the case where
device names are acquired from libblkid.

The zpool_find_import_scan() and zpool_find_import_blkid()
functions create an AVL tree containing each device name.  Each
entry in this tree is dispatched to a taskq where the function
zpool_open_func() validates the device by opening it and reading
the label.  This may result in additional entries being added
to the tree and those device paths being verified.

This is largely how the upstream OpenZFS code behaves but due to
significant differences the non-Linux code has been dropped for
readability.  Additionally, this code makes use of taskqs and
kmutexs which are normally not available to the command line tools.
Special care has been taken to allow their use in the import
functions.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Olaf Faaland <faaland1@llnl.gov>
Closes #4794
cmd/zpool/zpool_vdev.c
lib/libzfs/libzfs_import.c