1 // SPDX-License-Identifier: CDDL-1.0 2 /* 3 * This file and its contents are supplied under the terms of the 4 * Common Development and Distribution License ("CDDL"), version 1.0. 5 * You may only use this file in accordance with the terms of version 6 * 1.0 of the CDDL. 7 * 8 * A full copy of the text of the CDDL should have accompanied this 9 * source. A copy of the CDDL is also available via the Internet at 10 * https://opensource.org/license/CDDL-1.0. 11 */ 12 13 /* 14 * Copyright (c) 2019 Lawrence Livermore National Security, LLC. 15 */ 16 17 #ifndef _SYS_VDEV_TRIM_H 18 #define _SYS_VDEV_TRIM_H 19 20 #include <sys/spa.h> 21 22 #ifdef __cplusplus 23 extern "C" { 24 #endif 25 26 extern unsigned int zfs_trim_metaslab_skip; 27 28 extern void vdev_trim(vdev_t *vd, uint64_t rate, boolean_t partial, 29 boolean_t secure); 30 extern void vdev_trim_stop(vdev_t *vd, vdev_trim_state_t tgt, list_t *vd_list); 31 extern void vdev_trim_stop_all(vdev_t *vd, vdev_trim_state_t tgt_state); 32 extern void vdev_trim_stop_wait(spa_t *spa, list_t *vd_list); 33 extern void vdev_trim_restart(vdev_t *vd); 34 extern void vdev_autotrim(spa_t *spa); 35 extern void vdev_autotrim_kick(spa_t *spa); 36 extern void vdev_autotrim_stop_all(spa_t *spa); 37 extern void vdev_autotrim_stop_wait(vdev_t *vd); 38 extern void vdev_autotrim_restart(spa_t *spa); 39 extern int vdev_trim_simple(vdev_t *vd, uint64_t start, uint64_t size); 40 extern void vdev_trim_l2arc(spa_t *spa); 41 42 #ifdef __cplusplus 43 } 44 #endif 45 46 #endif /* _SYS_VDEV_TRIM_H */ 47