From 92d1686a2ad9e5ada480029d698522e1b5bdcda6 Mon Sep 17 00:00:00 2001 From: Rob Norris Date: Sun, 23 Feb 2025 10:46:26 +1100 Subject: [PATCH] include: move zio_priority_t into zfs.h It's included so it's effectively already part of it, but it's not always installed as a userspace header, making zfs.h effectively useless. Might as well just combine it. Sponsored-by: https://despairlabs.com/sponsor/ Reviewed-by: Alexander Motin Reviewed-by: Tony Hutter Signed-off-by: Rob Norris Close #17066 --- include/Makefile.am | 1 - include/sys/dmu.h | 1 - include/sys/fs/zfs.h | 23 +++++++++++++++++-- include/sys/zio.h | 1 - include/sys/zio_priority.h | 47 -------------------------------------- 5 files changed, 21 insertions(+), 52 deletions(-) delete mode 100644 include/sys/zio_priority.h diff --git a/include/Makefile.am b/include/Makefile.am index f173064ef..a9258deab 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -150,7 +150,6 @@ COMMON_H = \ sys/zio_compress.h \ sys/zio_crypt.h \ sys/zio_impl.h \ - sys/zio_priority.h \ sys/zrlock.h \ sys/zthr.h \ \ diff --git a/include/sys/dmu.h b/include/sys/dmu.h index 29f715039..2e49b290b 100644 --- a/include/sys/dmu.h +++ b/include/sys/dmu.h @@ -48,7 +48,6 @@ #include #include #include -#include #include #include diff --git a/include/sys/fs/zfs.h b/include/sys/fs/zfs.h index dc474e373..dc84e66c1 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, 2024 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014, 2016, 2024 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] @@ -37,7 +37,6 @@ #define _SYS_FS_ZFS_H extern __attribute__((visibility("default"))) #include -#include #ifdef __cplusplus extern "C" { @@ -1126,6 +1125,26 @@ typedef enum zio_type { */ #define ZIO_TYPE_IOCTL ZIO_TYPE_FLUSH +/* + * ZIO priority types. Needed to interpret vdev statistics below. + * + * NOTE: PLEASE UPDATE THE ENUM STRINGS IN zfs_valstr.c IF YOU ADD ANOTHER + * VALUE. + */ +typedef enum zio_priority { + ZIO_PRIORITY_SYNC_READ, + ZIO_PRIORITY_SYNC_WRITE, /* ZIL */ + ZIO_PRIORITY_ASYNC_READ, /* prefetch */ + ZIO_PRIORITY_ASYNC_WRITE, /* spa_sync() */ + ZIO_PRIORITY_SCRUB, /* asynchronous scrub/resilver reads */ + ZIO_PRIORITY_REMOVAL, /* reads/writes for vdev removal */ + ZIO_PRIORITY_INITIALIZING, /* initializing I/O */ + ZIO_PRIORITY_TRIM, /* trim I/O (discard) */ + ZIO_PRIORITY_REBUILD, /* reads/writes for vdev rebuild */ + ZIO_PRIORITY_NUM_QUEUEABLE, + ZIO_PRIORITY_NOW, /* non-queued i/os (e.g. free) */ +} zio_priority_t; + /* * Pool statistics. Note: all fields should be 64-bit because this * is passed between kernel and userland as an nvlist uint64 array. diff --git a/include/sys/zio.h b/include/sys/zio.h index 46f5d68ae..741f34b2d 100644 --- a/include/sys/zio.h +++ b/include/sys/zio.h @@ -35,7 +35,6 @@ #ifndef _ZIO_H #define _ZIO_H -#include #include #include #include diff --git a/include/sys/zio_priority.h b/include/sys/zio_priority.h deleted file mode 100644 index bdf5f9b8f..000000000 --- a/include/sys/zio_priority.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * CDDL HEADER START - * - * This file and its contents are supplied under the terms of the - * Common Development and Distribution License ("CDDL"), version 1.0. - * You may only use this file in accordance with the terms of version - * 1.0 of the CDDL. - * - * A full copy of the text of the CDDL should have accompanied this - * source. A copy of the CDDL is also available via the Internet at - * http://www.illumos.org/license/CDDL. - * - * CDDL HEADER END - */ -/* - * Copyright (c) 2014, 2016 by Delphix. All rights reserved. - */ -#ifndef _ZIO_PRIORITY_H -#define _ZIO_PRIORITY_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * NOTE: PLEASE UPDATE THE ENUM STRINGS IN zfs_valstr.c IF YOU ADD ANOTHER - * VALUE. - */ -typedef enum zio_priority { - ZIO_PRIORITY_SYNC_READ, - ZIO_PRIORITY_SYNC_WRITE, /* ZIL */ - ZIO_PRIORITY_ASYNC_READ, /* prefetch */ - ZIO_PRIORITY_ASYNC_WRITE, /* spa_sync() */ - ZIO_PRIORITY_SCRUB, /* asynchronous scrub/resilver reads */ - ZIO_PRIORITY_REMOVAL, /* reads/writes for vdev removal */ - ZIO_PRIORITY_INITIALIZING, /* initializing I/O */ - ZIO_PRIORITY_TRIM, /* trim I/O (discard) */ - ZIO_PRIORITY_REBUILD, /* reads/writes for vdev rebuild */ - ZIO_PRIORITY_NUM_QUEUEABLE, - ZIO_PRIORITY_NOW, /* non-queued i/os (e.g. free) */ -} zio_priority_t; - -#ifdef __cplusplus -} -#endif - -#endif /* _ZIO_PRIORITY_H */