aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/libzfs_core.h8
-rw-r--r--include/sys/fs/zfs.h3
-rw-r--r--include/sys/zcp.h28
3 files changed, 26 insertions, 13 deletions
diff --git a/include/libzfs_core.h b/include/libzfs_core.h
index b9e401931..721d90f81 100644
--- a/include/libzfs_core.h
+++ b/include/libzfs_core.h
@@ -20,7 +20,7 @@
*/
/*
- * Copyright (c) 2012, 2016 by Delphix. All rights reserved.
+ * Copyright (c) 2012, 2017 by Delphix. All rights reserved.
* Copyright (c) 2017 Datto Inc.
* Copyright 2017 RackTop Systems.
* Copyright (c) 2017 Open-E, Inc. All Rights Reserved.
@@ -101,8 +101,10 @@ boolean_t lzc_exists(const char *);
int lzc_rollback(const char *, char *, int);
int lzc_rollback_to(const char *, const char *);
-int lzc_channel_program(const char *, const char *, uint64_t, uint64_t,
- nvlist_t *, nvlist_t **);
+int lzc_channel_program(const char *, const char *, uint64_t,
+ uint64_t, nvlist_t *, nvlist_t **);
+int lzc_channel_program_nosync(const char *, const char *, uint64_t,
+ uint64_t, nvlist_t *, nvlist_t **);
int lzc_sync(const char *, nvlist_t *, nvlist_t **);
int lzc_reopen(const char *, boolean_t);
diff --git a/include/sys/fs/zfs.h b/include/sys/fs/zfs.h
index 480cecac9..7b86f6631 100644
--- a/include/sys/fs/zfs.h
+++ b/include/sys/fs/zfs.h
@@ -21,7 +21,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011, 2016 by Delphix. All rights reserved.
+ * Copyright (c) 2011, 2017 by Delphix. All rights reserved.
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2013, 2017 Joyent, Inc. All rights reserved.
* Copyright (c) 2014 Integros [integros.com]
@@ -1204,6 +1204,7 @@ typedef enum {
*/
#define ZCP_ARG_PROGRAM "program"
#define ZCP_ARG_ARGLIST "arg"
+#define ZCP_ARG_SYNC "sync"
#define ZCP_ARG_INSTRLIMIT "instrlimit"
#define ZCP_ARG_MEMLIMIT "memlimit"
diff --git a/include/sys/zcp.h b/include/sys/zcp.h
index df13bf230..b56eda552 100644
--- a/include/sys/zcp.h
+++ b/include/sys/zcp.h
@@ -38,20 +38,25 @@ extern uint64_t zfs_lua_max_memlimit;
int zcp_argerror(lua_State *, int, const char *, ...);
-int zcp_eval(const char *, const char *, uint64_t, uint64_t, nvpair_t *,
- nvlist_t *);
+int zcp_eval(const char *, const char *, boolean_t, uint64_t, uint64_t,
+ nvpair_t *, nvlist_t *);
int zcp_load_list_lib(lua_State *);
int zcp_load_synctask_lib(lua_State *, boolean_t);
typedef void (zcp_cleanup_t)(void *);
+typedef struct zcp_cleanup_handler {
+ zcp_cleanup_t *zch_cleanup_func;
+ void *zch_cleanup_arg;
+ list_node_t zch_node;
+} zcp_cleanup_handler_t;
typedef struct zcp_run_info {
dsl_pool_t *zri_pool;
/*
- * An estimate of the total ammount of space consumed by all
+ * An estimate of the total amount of space consumed by all
* synctasks we have successfully performed so far in this
* channel program. Used to generate ENOSPC errors for syncfuncs.
*/
@@ -89,16 +94,21 @@ typedef struct zcp_run_info {
boolean_t zri_timed_out;
/*
- * The currently registered cleanup function, which will be called
- * with the stored argument if a fatal error occurs.
+ * Boolean indicating whether or not we are running in syncing
+ * context.
*/
- zcp_cleanup_t *zri_cleanup;
- void *zri_cleanup_arg;
+ boolean_t zri_sync;
+
+ /*
+ * List of currently registered cleanup handlers, which will be
+ * triggered in the event of a fatal error.
+ */
+ list_t zri_cleanup_handlers;
} zcp_run_info_t;
zcp_run_info_t *zcp_run_info(lua_State *);
-void zcp_register_cleanup(lua_State *, zcp_cleanup_t, void *);
-void zcp_clear_cleanup(lua_State *);
+zcp_cleanup_handler_t *zcp_register_cleanup(lua_State *, zcp_cleanup_t, void *);
+void zcp_deregister_cleanup(lua_State *, zcp_cleanup_handler_t *);
void zcp_cleanup(lua_State *);
/*