summaryrefslogtreecommitdiffstats
path: root/include/libzfs_impl.h
diff options
context:
space:
mode:
authorSebastien Roy <[email protected]>2018-11-05 08:40:05 -0700
committerBrian Behlendorf <[email protected]>2018-11-15 11:33:58 -0800
commita10d50f999511d304f910852c7825c70c9c9e303 (patch)
tree636446232088444d7dfab1b7a2dc7ca541ee1f9e /include/libzfs_impl.h
parentaf2e8411dacbc694b1aaf9074e68a9d12270e74c (diff)
OpenZFS 8115 - parallel zfs mount
Porting Notes: * Use thread pools (tpool) API instead of introducing taskq interfaces to libzfs. * Use pthread_mutext for locks as mutex_t isn't available. * Ignore alternative libshare initialization since OpenZFS-7955 is not present on zfsonlinux. Authored by: Sebastien Roy <[email protected]> Reviewed by: Matthew Ahrens <[email protected]> Reviewed by: Pavel Zakharov <[email protected]> Reviewed by: Brad Lewis <[email protected]> Reviewed by: George Wilson <[email protected]> Reviewed by: Paul Dagnelie <[email protected]> Reviewed by: Prashanth Sreenivasa <[email protected]> Authored by: Brian Behlendorf <[email protected]> Approved by: Matt Ahrens <[email protected]> Ported-by: Don Brady <[email protected]> OpenZFS-issue: https://www.illumos.org/issues/8115 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/a3f0e2b569 Closes #8092
Diffstat (limited to 'include/libzfs_impl.h')
-rw-r--r--include/libzfs_impl.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/libzfs_impl.h b/include/libzfs_impl.h
index 568103f4b..9a46b9f12 100644
--- a/include/libzfs_impl.h
+++ b/include/libzfs_impl.h
@@ -21,7 +21,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011, 2015 by Delphix. All rights reserved.
+ * Copyright (c) 2011, 2017 by Delphix. All rights reserved.
* Copyright (c) 2018 Datto Inc.
*/
@@ -60,6 +60,13 @@ struct libzfs_handle {
void *libzfs_sharehdl; /* libshare handle */
uint_t libzfs_shareflags;
boolean_t libzfs_mnttab_enable;
+ /*
+ * We need a lock to handle the case where parallel mount
+ * threads are populating the mnttab cache simultaneously. The
+ * lock only protects the integrity of the avl tree, and does
+ * not protect the contents of the mnttab entries themselves.
+ */
+ pthread_mutex_t libzfs_mnttab_cache_lock;
avl_tree_t libzfs_mnttab_cache;
int libzfs_pool_iter;
char libzfs_chassis_id[256];