mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Remove NOTE(CONSTCOND) and note.h
These were mostly used to annotate do {} while(0)s
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Issue #12201
This commit is contained in:
@@ -50,7 +50,6 @@ COMMON_H = \
|
||||
mntent.h \
|
||||
mod.h \
|
||||
multilist.h \
|
||||
note.h \
|
||||
nvpair.h \
|
||||
nvpair_impl.h \
|
||||
objlist.h \
|
||||
|
||||
+2
-2
@@ -49,12 +49,12 @@ extern "C" {
|
||||
#define HDR_SET_LSIZE(hdr, x) do { \
|
||||
ASSERT(IS_P2ALIGNED(x, 1U << SPA_MINBLOCKSHIFT)); \
|
||||
(hdr)->b_lsize = ((x) >> SPA_MINBLOCKSHIFT); \
|
||||
_NOTE(CONSTCOND) } while (0)
|
||||
} while (0)
|
||||
|
||||
#define HDR_SET_PSIZE(hdr, x) do { \
|
||||
ASSERT(IS_P2ALIGNED((x), 1U << SPA_MINBLOCKSHIFT)); \
|
||||
(hdr)->b_psize = ((x) >> SPA_MINBLOCKSHIFT); \
|
||||
_NOTE(CONSTCOND) } while (0)
|
||||
} while (0)
|
||||
|
||||
#define HDR_GET_LSIZE(hdr) ((hdr)->b_lsize << SPA_MINBLOCKSHIFT)
|
||||
#define HDR_GET_PSIZE(hdr) ((hdr)->b_psize << SPA_MINBLOCKSHIFT)
|
||||
|
||||
@@ -360,7 +360,6 @@ typedef struct l2arc_lb_ptr_buf {
|
||||
void *tmp = (x);\
|
||||
x = y; \
|
||||
y = tmp; \
|
||||
_NOTE(CONSTCOND)\
|
||||
} while (0)
|
||||
|
||||
#define L2ARC_DEV_HDR_MAGIC 0x5a46534341434845LLU /* ASCII: "ZFSCACHE" */
|
||||
|
||||
@@ -53,13 +53,13 @@ extern "C" {
|
||||
ASSERT3U(val, <, 1U << (len)); \
|
||||
ASSERT3U(low + len, <=, 32); \
|
||||
(x) ^= BF32_ENCODE((x >> low) ^ (val), low, len); \
|
||||
_NOTE(CONSTCOND) } while (0)
|
||||
} while (0)
|
||||
|
||||
#define BF64_SET(x, low, len, val) do { \
|
||||
ASSERT3U(val, <, 1ULL << (len)); \
|
||||
ASSERT3U(low + len, <=, 64); \
|
||||
((x) ^= BF64_ENCODE((x >> low) ^ (val), low, len)); \
|
||||
_NOTE(CONSTCOND) } while (0)
|
||||
} while (0)
|
||||
|
||||
#define BF32_GET_SB(x, low, len, shift, bias) \
|
||||
((BF32_GET(x, low, len) + (bias)) << (shift))
|
||||
@@ -69,19 +69,18 @@ _NOTE(CONSTCOND) } while (0)
|
||||
/*
|
||||
* We use ASSERT3U instead of ASSERT in these macros to prevent a lint error in
|
||||
* the case where val is a constant. We can't fix ASSERT because it's used as
|
||||
* an expression in several places in the kernel; as a result, changing it to
|
||||
* the do{} while() syntax to allow us to _NOTE the CONSTCOND is not an option.
|
||||
* an expression in several places in the kernel.
|
||||
*/
|
||||
#define BF32_SET_SB(x, low, len, shift, bias, val) do { \
|
||||
ASSERT3U(IS_P2ALIGNED(val, 1U << shift), !=, B_FALSE); \
|
||||
ASSERT3S((val) >> (shift), >=, bias); \
|
||||
BF32_SET(x, low, len, ((val) >> (shift)) - (bias)); \
|
||||
_NOTE(CONSTCOND) } while (0)
|
||||
} while (0)
|
||||
#define BF64_SET_SB(x, low, len, shift, bias, val) do { \
|
||||
ASSERT3U(IS_P2ALIGNED(val, 1ULL << shift), !=, B_FALSE); \
|
||||
ASSERT3S((val) >> (shift), >=, bias); \
|
||||
BF64_SET(x, low, len, ((val) >> (shift)) - (bias)); \
|
||||
_NOTE(CONSTCOND) } while (0)
|
||||
} while (0)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
+2
-2
@@ -474,7 +474,7 @@ dbuf_find_dirty_eq(dmu_buf_impl_t *db, uint64_t txg)
|
||||
__db_buf, (dbuf)->db_level, \
|
||||
(u_longlong_t)(dbuf)->db_blkid, __VA_ARGS__); \
|
||||
} \
|
||||
_NOTE(CONSTCOND) } while (0)
|
||||
} while (0)
|
||||
|
||||
#define dprintf_dbuf_bp(db, bp, fmt, ...) do { \
|
||||
if (zfs_flags & ZFS_DEBUG_DPRINTF) { \
|
||||
@@ -483,7 +483,7 @@ _NOTE(CONSTCOND) } while (0)
|
||||
dprintf_dbuf(db, fmt " %s\n", __VA_ARGS__, __blkbuf); \
|
||||
kmem_free(__blkbuf, BP_SPRINTF_LEN); \
|
||||
} \
|
||||
_NOTE(CONSTCOND) } while (0)
|
||||
} while (0)
|
||||
|
||||
#define DBUF_VERIFY(db) dbuf_verify(db)
|
||||
|
||||
|
||||
+1
-1
@@ -607,7 +607,7 @@ extern dnode_stats_t dnode_stats;
|
||||
dprintf_ds((dn)->dn_objset->os_dsl_dataset, "obj=%s " fmt, \
|
||||
__db_buf, __VA_ARGS__); \
|
||||
} \
|
||||
_NOTE(CONSTCOND) } while (0)
|
||||
} while (0)
|
||||
|
||||
#define DNODE_VERIFY(dn) dnode_verify(dn)
|
||||
#define FREE_VERIFY(db, start, end, tx) free_verify(db, start, end, tx)
|
||||
|
||||
@@ -497,7 +497,7 @@ void dsl_dataset_activate_redaction(dsl_dataset_t *ds, uint64_t *redact_snaps,
|
||||
dprintf("ds=%s " fmt, __ds_name, __VA_ARGS__); \
|
||||
kmem_free(__ds_name, ZFS_MAX_DATASET_NAME_LEN); \
|
||||
} \
|
||||
_NOTE(CONSTCOND) } while (0)
|
||||
} while (0)
|
||||
#else
|
||||
#define dprintf_ds(dd, fmt, ...)
|
||||
#endif
|
||||
|
||||
@@ -218,7 +218,7 @@ void dsl_dir_cancel_waiters(dsl_dir_t *dd);
|
||||
dprintf("dd=%s " fmt, __ds_name, __VA_ARGS__); \
|
||||
kmem_free(__ds_name, ZFS_MAX_DATASET_NAME_LEN); \
|
||||
} \
|
||||
_NOTE(CONSTCOND) } while (0)
|
||||
} while (0)
|
||||
#else
|
||||
#define dprintf_dd(dd, fmt, ...)
|
||||
#endif
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License, Version 1.0 only
|
||||
* (the "License"). 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.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 1994 by Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
/*
|
||||
* sys/note.h: interface for annotating source with info for tools
|
||||
*
|
||||
* This is the underlying interface; NOTE (/usr/include/note.h) is the
|
||||
* preferred interface, but all exported header files should include this
|
||||
* file directly and use _NOTE so as not to take "NOTE" from the user's
|
||||
* namespace. For consistency, *all* kernel source should use _NOTE.
|
||||
*
|
||||
* By default, annotations expand to nothing. This file implements
|
||||
* that. Tools using annotations will interpose a different version
|
||||
* of this file that will expand annotations as needed.
|
||||
*/
|
||||
|
||||
#ifndef _SYS_NOTE_H
|
||||
#define _SYS_NOTE_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef _NOTE
|
||||
#define _NOTE(s)
|
||||
#endif
|
||||
|
||||
#define NOTE(s) _NOTE(s)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _SYS_NOTE_H */
|
||||
+7
-7
@@ -328,7 +328,7 @@ typedef struct zio_cksum_salt {
|
||||
#define BPE_SET_ETYPE(bp, t) do { \
|
||||
ASSERT(BP_IS_EMBEDDED(bp)); \
|
||||
BF64_SET((bp)->blk_prop, 40, 8, t); \
|
||||
_NOTE(CONSTCOND) } while (0)
|
||||
} while (0)
|
||||
|
||||
#define BPE_GET_LSIZE(bp) \
|
||||
(ASSERT(BP_IS_EMBEDDED(bp)), \
|
||||
@@ -336,7 +336,7 @@ _NOTE(CONSTCOND) } while (0)
|
||||
#define BPE_SET_LSIZE(bp, x) do { \
|
||||
ASSERT(BP_IS_EMBEDDED(bp)); \
|
||||
BF64_SET_SB((bp)->blk_prop, 0, 25, 0, 1, x); \
|
||||
_NOTE(CONSTCOND) } while (0)
|
||||
} while (0)
|
||||
|
||||
#define BPE_GET_PSIZE(bp) \
|
||||
(ASSERT(BP_IS_EMBEDDED(bp)), \
|
||||
@@ -344,7 +344,7 @@ _NOTE(CONSTCOND) } while (0)
|
||||
#define BPE_SET_PSIZE(bp, x) do { \
|
||||
ASSERT(BP_IS_EMBEDDED(bp)); \
|
||||
BF64_SET_SB((bp)->blk_prop, 25, 7, 0, 1, x); \
|
||||
_NOTE(CONSTCOND) } while (0)
|
||||
} while (0)
|
||||
|
||||
typedef enum bp_embedded_type {
|
||||
BP_EMBEDDED_TYPE_DATA,
|
||||
@@ -419,7 +419,7 @@ typedef struct blkptr {
|
||||
ASSERT(!BP_IS_EMBEDDED(bp)); \
|
||||
BF64_SET_SB((bp)->blk_prop, \
|
||||
0, SPA_LSIZEBITS, SPA_MINBLOCKSHIFT, 1, x); \
|
||||
_NOTE(CONSTCOND) } while (0)
|
||||
} while (0)
|
||||
|
||||
#define BP_GET_PSIZE(bp) \
|
||||
(BP_IS_EMBEDDED(bp) ? 0 : \
|
||||
@@ -428,7 +428,7 @@ _NOTE(CONSTCOND) } while (0)
|
||||
ASSERT(!BP_IS_EMBEDDED(bp)); \
|
||||
BF64_SET_SB((bp)->blk_prop, \
|
||||
16, SPA_PSIZEBITS, SPA_MINBLOCKSHIFT, 1, x); \
|
||||
_NOTE(CONSTCOND) } while (0)
|
||||
} while (0)
|
||||
|
||||
#define BP_GET_COMPRESS(bp) \
|
||||
BF64_GET((bp)->blk_prop, 32, SPA_COMPRESSBITS)
|
||||
@@ -444,7 +444,7 @@ _NOTE(CONSTCOND) } while (0)
|
||||
#define BP_SET_CHECKSUM(bp, x) do { \
|
||||
ASSERT(!BP_IS_EMBEDDED(bp)); \
|
||||
BF64_SET((bp)->blk_prop, 40, 8, x); \
|
||||
_NOTE(CONSTCOND) } while (0)
|
||||
} while (0)
|
||||
|
||||
#define BP_GET_TYPE(bp) BF64_GET((bp)->blk_prop, 48, 8)
|
||||
#define BP_SET_TYPE(bp, x) BF64_SET((bp)->blk_prop, 48, 8, x)
|
||||
@@ -1193,7 +1193,7 @@ int param_set_deadman_failmode(ZFS_MODULE_PARAM_ARGS);
|
||||
dprintf(fmt " %s\n", __VA_ARGS__, __blkbuf); \
|
||||
kmem_free(__blkbuf, BP_SPRINTF_LEN); \
|
||||
} \
|
||||
_NOTE(CONSTCOND) } while (0)
|
||||
} while (0)
|
||||
#else
|
||||
#define dprintf_bp(bp, fmt, ...)
|
||||
#endif
|
||||
|
||||
@@ -41,7 +41,6 @@ extern "C" {
|
||||
* similar environment.
|
||||
*/
|
||||
#if defined(__KERNEL__) || defined(_STANDALONE)
|
||||
#include <sys/note.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/atomic.h>
|
||||
#include <sys/sysmacros.h>
|
||||
@@ -104,7 +103,6 @@ extern "C" {
|
||||
#include <ctype.h>
|
||||
#include <signal.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/note.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/cred.h>
|
||||
#include <sys/sysmacros.h>
|
||||
|
||||
Reference in New Issue
Block a user