summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/libzfs.h3
-rw-r--r--include/libzfs_core.h1
-rw-r--r--include/sys/dsl_dir.h8
-rw-r--r--include/sys/fs/zfs.h12
4 files changed, 24 insertions, 0 deletions
diff --git a/include/libzfs.h b/include/libzfs.h
index 236a73130..7633579d4 100644
--- a/include/libzfs.h
+++ b/include/libzfs.h
@@ -507,6 +507,9 @@ extern nvlist_t *zfs_get_user_props(zfs_handle_t *);
extern nvlist_t *zfs_get_recvd_props(zfs_handle_t *);
extern nvlist_t *zfs_get_clones_nvl(zfs_handle_t *);
+extern int zfs_wait_status(zfs_handle_t *, zfs_wait_activity_t,
+ boolean_t *, boolean_t *);
+
/*
* zfs encryption management
*/
diff --git a/include/libzfs_core.h b/include/libzfs_core.h
index c4b4f8e71..18ce6994a 100644
--- a/include/libzfs_core.h
+++ b/include/libzfs_core.h
@@ -133,6 +133,7 @@ int lzc_pool_checkpoint_discard(const char *);
int lzc_wait(const char *, zpool_wait_activity_t, boolean_t *);
int lzc_wait_tag(const char *, zpool_wait_activity_t, uint64_t, boolean_t *);
+int lzc_wait_fs(const char *, zfs_wait_activity_t, boolean_t *);
#ifdef __cplusplus
}
diff --git a/include/sys/dsl_dir.h b/include/sys/dsl_dir.h
index bb6921027..88fd61035 100644
--- a/include/sys/dsl_dir.h
+++ b/include/sys/dsl_dir.h
@@ -121,6 +121,11 @@ struct dsl_dir {
bplist_t dd_pending_frees;
bplist_t dd_pending_allocs;
+ kmutex_t dd_activity_lock;
+ kcondvar_t dd_activity_cv;
+ boolean_t dd_activity_cancelled;
+ uint64_t dd_activity_waiters;
+
/* protected by dd_lock; keep at end of struct for better locality */
char dd_myname[ZFS_MAX_DATASET_NAME_LEN];
};
@@ -192,6 +197,9 @@ boolean_t dsl_dir_is_zapified(dsl_dir_t *dd);
void dsl_dir_livelist_open(dsl_dir_t *dd, uint64_t obj);
void dsl_dir_livelist_close(dsl_dir_t *dd);
void dsl_dir_remove_livelist(dsl_dir_t *dd, dmu_tx_t *tx, boolean_t total);
+int dsl_dir_wait(dsl_dir_t *dd, dsl_dataset_t *ds, zfs_wait_activity_t activity,
+ boolean_t *waited);
+void dsl_dir_cancel_waiters(dsl_dir_t *dd);
/* internal reserved dir name */
#define MOS_DIR_NAME "$MOS"
diff --git a/include/sys/fs/zfs.h b/include/sys/fs/zfs.h
index 3484b13e3..477356aa7 100644
--- a/include/sys/fs/zfs.h
+++ b/include/sys/fs/zfs.h
@@ -1282,6 +1282,7 @@ typedef enum zfs_ioc {
ZFS_IOC_REDACT, /* 0x5a51 */
ZFS_IOC_GET_BOOKMARK_PROPS, /* 0x5a52 */
ZFS_IOC_WAIT, /* 0x5a53 */
+ ZFS_IOC_WAIT_FS, /* 0x5a54 */
/*
* Per-platform (Optional) - 6/128 numbers reserved.
@@ -1358,6 +1359,11 @@ typedef enum {
ZPOOL_WAIT_NUM_ACTIVITIES
} zpool_wait_activity_t;
+typedef enum {
+ ZFS_WAIT_DELETEQ,
+ ZFS_WAIT_NUM_ACTIVITIES
+} zfs_wait_activity_t;
+
/*
* Bookmark name values.
*/
@@ -1416,6 +1422,12 @@ typedef enum {
#define ZPOOL_WAIT_WAITED "wait_waited"
/*
+ * The following are names used when invoking ZFS_IOC_WAIT_FS.
+ */
+#define ZFS_WAIT_ACTIVITY "wait_activity"
+#define ZFS_WAIT_WAITED "wait_waited"
+
+/*
* Flags for ZFS_IOC_VDEV_SET_STATE
*/
#define ZFS_ONLINE_CHECKREMOVE 0x1