diff options
Diffstat (limited to 'include/sys/zvol_impl.h')
-rw-r--r-- | include/sys/zvol_impl.h | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/include/sys/zvol_impl.h b/include/sys/zvol_impl.h index 94203347066b..3cd0d78c353d 100644 --- a/include/sys/zvol_impl.h +++ b/include/sys/zvol_impl.h @@ -6,7 +6,7 @@ * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. + * or https://opensource.org/licenses/CDDL-1.0. * See the License for the specific language governing permissions * and limitations under the License. * @@ -18,22 +18,19 @@ * * CDDL HEADER END */ +/* + * Copyright (c) 2024, Klara, Inc. + */ #ifndef _SYS_ZVOL_IMPL_H #define _SYS_ZVOL_IMPL_H #include <sys/zfs_context.h> -#define ZVOL_RDONLY 0x1 -/* - * Whether the zvol has been written to (as opposed to ZVOL_RDONLY, which - * specifies whether or not the zvol _can_ be written to) - */ -#define ZVOL_WRITTEN_TO 0x2 - -#define ZVOL_DUMPIFIED 0x4 - -#define ZVOL_EXCL 0x8 +#define ZVOL_RDONLY (1<<0) /* zvol is readonly (writes rejected) */ +#define ZVOL_WRITTEN_TO (1<<1) /* zvol has been written to (needs flush) */ +#define ZVOL_EXCL (1<<2) /* zvol has O_EXCL client right now */ +#define ZVOL_REMOVING (1<<3) /* zvol waiting to remove minor */ /* * The in-core state of each volume. @@ -57,7 +54,9 @@ typedef struct zvol_state { kmutex_t zv_state_lock; /* protects zvol_state_t */ atomic_t zv_suspend_ref; /* refcount for suspend */ krwlock_t zv_suspend_lock; /* suspend lock */ + kcondvar_t zv_removing_cv; /* ready to remove minor */ struct zvol_state_os *zv_zso; /* private platform state */ + boolean_t zv_threading; /* volthreading property */ } zvol_state_t; @@ -81,9 +80,9 @@ void zvol_remove_minors_impl(const char *name); void zvol_last_close(zvol_state_t *zv); void zvol_insert(zvol_state_t *zv); void zvol_log_truncate(zvol_state_t *zv, dmu_tx_t *tx, uint64_t off, - uint64_t len, boolean_t sync); + uint64_t len); void zvol_log_write(zvol_state_t *zv, dmu_tx_t *tx, uint64_t offset, - uint64_t size, int sync); + uint64_t size, boolean_t commit); int zvol_get_data(void *arg, uint64_t arg2, lr_write_t *lr, char *buf, struct lwb *lwb, zio_t *zio); int zvol_init_impl(void); |