]> git.proxmox.com Git - mirror_zfs.git/blobdiff - include/libzfs.h
Restrict kstats and print real pointers
[mirror_zfs.git] / include / libzfs.h
index 65b06f7a806c804820adefd0b9620169b13de46e..b604f1194dc68940b6a2ffe39b80cef2b7b38b14 100644 (file)
@@ -27,7 +27,7 @@
  * Copyright (c) 2016, Intel Corporation.
  * Copyright 2016 Nexenta Systems, Inc.
  * Copyright (c) 2017 Open-E, Inc. All Rights Reserved.
- * Copyright (c) 2018 Datto Inc.
+ * Copyright (c) 2019 Datto Inc.
  */
 
 #ifndef        _LIBZFS_H
@@ -143,6 +143,9 @@ typedef enum zfs_error {
        EZFS_INITIALIZING,      /* currently initializing */
        EZFS_NO_INITIALIZE,     /* no active initialize */
        EZFS_WRONG_PARENT,      /* invalid parent dataset (e.g ZVOL) */
+       EZFS_TRIMMING,          /* currently trimming */
+       EZFS_NO_TRIM,           /* no active trim */
+       EZFS_TRIM_NOTSUP,       /* device does not support trim */
        EZFS_UNKNOWN
 } zfs_error_t;
 
@@ -253,12 +256,26 @@ typedef struct splitflags {
        int name_flags;
 } splitflags_t;
 
+typedef struct trimflags {
+       /* requested vdevs are for the entire pool */
+       boolean_t fullpool;
+
+       /* request a secure trim, requires support from device */
+       boolean_t secure;
+
+       /* trim at the requested rate in bytes/second */
+       uint64_t rate;
+} trimflags_t;
+
 /*
  * Functions to manipulate pool and vdev state
  */
 extern int zpool_scan(zpool_handle_t *, pool_scan_func_t, pool_scrub_cmd_t);
 extern int zpool_initialize(zpool_handle_t *, pool_initialize_func_t,
     nvlist_t *);
+extern int zpool_trim(zpool_handle_t *, pool_trim_func_t, nvlist_t *,
+    trimflags_t *);
+
 extern int zpool_clear(zpool_handle_t *, const char *, nvlist_t *);
 extern int zpool_reguid(zpool_handle_t *);
 extern int zpool_reopen_one(zpool_handle_t *, void *);
@@ -571,8 +588,10 @@ extern int zfs_iter_root(libzfs_handle_t *, zfs_iter_f, void *);
 extern int zfs_iter_children(zfs_handle_t *, zfs_iter_f, void *);
 extern int zfs_iter_dependents(zfs_handle_t *, boolean_t, zfs_iter_f, void *);
 extern int zfs_iter_filesystems(zfs_handle_t *, zfs_iter_f, void *);
-extern int zfs_iter_snapshots(zfs_handle_t *, boolean_t, zfs_iter_f, void *);
-extern int zfs_iter_snapshots_sorted(zfs_handle_t *, zfs_iter_f, void *);
+extern int zfs_iter_snapshots(zfs_handle_t *, boolean_t, zfs_iter_f, void *,
+    uint64_t, uint64_t);
+extern int zfs_iter_snapshots_sorted(zfs_handle_t *, zfs_iter_f, void *,
+    uint64_t, uint64_t);
 extern int zfs_iter_snapspec(zfs_handle_t *, const char *, zfs_iter_f, void *);
 extern int zfs_iter_bookmarks(zfs_handle_t *, zfs_iter_f, void *);
 extern int zfs_iter_mounted(zfs_handle_t *, zfs_iter_f, void *);