summaryrefslogtreecommitdiff
path: root/usr/src/lib/libzfs/common/libzfs_impl.h
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/lib/libzfs/common/libzfs_impl.h')
-rw-r--r--usr/src/lib/libzfs/common/libzfs_impl.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/usr/src/lib/libzfs/common/libzfs_impl.h b/usr/src/lib/libzfs/common/libzfs_impl.h
index 50f48fd793..cd9a53d91f 100644
--- a/usr/src/lib/libzfs/common/libzfs_impl.h
+++ b/usr/src/lib/libzfs/common/libzfs_impl.h
@@ -22,7 +22,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011 Pawel Jakub Dawidek. All rights reserved.
- * Copyright (c) 2011, 2016 by Delphix. All rights reserved.
+ * Copyright (c) 2011, 2017 by Delphix. All rights reserved.
*/
#ifndef _LIBZFS_IMPL_H
@@ -33,6 +33,7 @@
#include <sys/nvpair.h>
#include <sys/dmu.h>
#include <sys/zfs_ioctl.h>
+#include <synch.h>
#include <libuutil.h>
#include <libzfs.h>
@@ -73,6 +74,13 @@ struct libzfs_handle {
int libzfs_storeerr; /* stuff error messages into buffer */
void *libzfs_sharehdl; /* libshare handle */
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.
+ */
+ mutex_t libzfs_mnttab_cache_lock;
avl_tree_t libzfs_mnttab_cache;
int libzfs_pool_iter;
topo_hdl_t *libzfs_topo_hdl;