diff options
author | Madhav Suresh <[email protected]> | 2013-05-10 14:17:03 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2013-06-19 15:14:10 -0700 |
commit | c99c90015ece64746e20b74245caca41d1dbefe1 (patch) | |
tree | cc4e993d3796f076a2dd1de43b4a2bd38ba10cc8 /module/nvpair | |
parent | 9eaf0832ad945fb8584c39fb9aeb5e8578912aeb (diff) |
Illumos #3006
3006 VERIFY[S,U,P] and ASSERT[S,U,P] frequently check if first
argument is zero
Reviewed by Matt Ahrens <[email protected]>
Reviewed by George Wilson <[email protected]>
Approved by Eric Schrock <[email protected]>
References:
illumos/illumos-gate@fb09f5aad449c97fe309678f3f604982b563a96f
https://illumos.org/issues/3006
Requires:
zfsonlinux/spl@1c6d149feb4033e4a56fb987004edc5d45288bcb
Ported-by: Tim Chase <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #1509
Diffstat (limited to 'module/nvpair')
-rw-r--r-- | module/nvpair/fnvpair.c | 116 |
1 files changed, 58 insertions, 58 deletions
diff --git a/module/nvpair/fnvpair.c b/module/nvpair/fnvpair.c index fa28afc75..17583715b 100644 --- a/module/nvpair/fnvpair.c +++ b/module/nvpair/fnvpair.c @@ -50,7 +50,7 @@ nvlist_t * fnvlist_alloc(void) { nvlist_t *nvl; - VERIFY3U(nvlist_alloc(&nvl, NV_UNIQUE_NAME, KM_SLEEP), ==, 0); + VERIFY0(nvlist_alloc(&nvl, NV_UNIQUE_NAME, KM_SLEEP)); return (nvl); } @@ -64,7 +64,7 @@ size_t fnvlist_size(nvlist_t *nvl) { size_t size; - VERIFY3U(nvlist_size(nvl, &size, NV_ENCODE_NATIVE), ==, 0); + VERIFY0(nvlist_size(nvl, &size, NV_ENCODE_NATIVE)); return (size); } @@ -96,7 +96,7 @@ nvlist_t * fnvlist_unpack(char *buf, size_t buflen) { nvlist_t *rv; - VERIFY3U(nvlist_unpack(buf, buflen, &rv, KM_SLEEP), ==, 0); + VERIFY0(nvlist_unpack(buf, buflen, &rv, KM_SLEEP)); return (rv); } @@ -104,195 +104,195 @@ nvlist_t * fnvlist_dup(nvlist_t *nvl) { nvlist_t *rv; - VERIFY3U(nvlist_dup(nvl, &rv, KM_SLEEP), ==, 0); + VERIFY0(nvlist_dup(nvl, &rv, KM_SLEEP)); return (rv); } void fnvlist_merge(nvlist_t *dst, nvlist_t *src) { - VERIFY3U(nvlist_merge(dst, src, KM_SLEEP), ==, 0); + VERIFY0(nvlist_merge(dst, src, KM_SLEEP)); } void fnvlist_add_boolean(nvlist_t *nvl, const char *name) { - VERIFY3U(nvlist_add_boolean(nvl, name), ==, 0); + VERIFY0(nvlist_add_boolean(nvl, name)); } void fnvlist_add_boolean_value(nvlist_t *nvl, const char *name, boolean_t val) { - VERIFY3U(nvlist_add_boolean_value(nvl, name, val), ==, 0); + VERIFY0(nvlist_add_boolean_value(nvl, name, val)); } void fnvlist_add_byte(nvlist_t *nvl, const char *name, uchar_t val) { - VERIFY3U(nvlist_add_byte(nvl, name, val), ==, 0); + VERIFY0(nvlist_add_byte(nvl, name, val)); } void fnvlist_add_int8(nvlist_t *nvl, const char *name, int8_t val) { - VERIFY3U(nvlist_add_int8(nvl, name, val), ==, 0); + VERIFY0(nvlist_add_int8(nvl, name, val)); } void fnvlist_add_uint8(nvlist_t *nvl, const char *name, uint8_t val) { - VERIFY3U(nvlist_add_uint8(nvl, name, val), ==, 0); + VERIFY0(nvlist_add_uint8(nvl, name, val)); } void fnvlist_add_int16(nvlist_t *nvl, const char *name, int16_t val) { - VERIFY3U(nvlist_add_int16(nvl, name, val), ==, 0); + VERIFY0(nvlist_add_int16(nvl, name, val)); } void fnvlist_add_uint16(nvlist_t *nvl, const char *name, uint16_t val) { - VERIFY3U(nvlist_add_uint16(nvl, name, val), ==, 0); + VERIFY0(nvlist_add_uint16(nvl, name, val)); } void fnvlist_add_int32(nvlist_t *nvl, const char *name, int32_t val) { - VERIFY3U(nvlist_add_int32(nvl, name, val), ==, 0); + VERIFY0(nvlist_add_int32(nvl, name, val)); } void fnvlist_add_uint32(nvlist_t *nvl, const char *name, uint32_t val) { - VERIFY3U(nvlist_add_uint32(nvl, name, val), ==, 0); + VERIFY0(nvlist_add_uint32(nvl, name, val)); } void fnvlist_add_int64(nvlist_t *nvl, const char *name, int64_t val) { - VERIFY3U(nvlist_add_int64(nvl, name, val), ==, 0); + VERIFY0(nvlist_add_int64(nvl, name, val)); } void fnvlist_add_uint64(nvlist_t *nvl, const char *name, uint64_t val) { - VERIFY3U(nvlist_add_uint64(nvl, name, val), ==, 0); + VERIFY0(nvlist_add_uint64(nvl, name, val)); } void fnvlist_add_string(nvlist_t *nvl, const char *name, const char *val) { - VERIFY3U(nvlist_add_string(nvl, name, val), ==, 0); + VERIFY0(nvlist_add_string(nvl, name, val)); } void fnvlist_add_nvlist(nvlist_t *nvl, const char *name, nvlist_t *val) { - VERIFY3U(nvlist_add_nvlist(nvl, name, val), ==, 0); + VERIFY0(nvlist_add_nvlist(nvl, name, val)); } void fnvlist_add_nvpair(nvlist_t *nvl, nvpair_t *pair) { - VERIFY3U(nvlist_add_nvpair(nvl, pair), ==, 0); + VERIFY0(nvlist_add_nvpair(nvl, pair)); } void fnvlist_add_boolean_array(nvlist_t *nvl, const char *name, boolean_t *val, uint_t n) { - VERIFY3U(nvlist_add_boolean_array(nvl, name, val, n), ==, 0); + VERIFY0(nvlist_add_boolean_array(nvl, name, val, n)); } void fnvlist_add_byte_array(nvlist_t *nvl, const char *name, uchar_t *val, uint_t n) { - VERIFY3U(nvlist_add_byte_array(nvl, name, val, n), ==, 0); + VERIFY0(nvlist_add_byte_array(nvl, name, val, n)); } void fnvlist_add_int8_array(nvlist_t *nvl, const char *name, int8_t *val, uint_t n) { - VERIFY3U(nvlist_add_int8_array(nvl, name, val, n), ==, 0); + VERIFY0(nvlist_add_int8_array(nvl, name, val, n)); } void fnvlist_add_uint8_array(nvlist_t *nvl, const char *name, uint8_t *val, uint_t n) { - VERIFY3U(nvlist_add_uint8_array(nvl, name, val, n), ==, 0); + VERIFY0(nvlist_add_uint8_array(nvl, name, val, n)); } void fnvlist_add_int16_array(nvlist_t *nvl, const char *name, int16_t *val, uint_t n) { - VERIFY3U(nvlist_add_int16_array(nvl, name, val, n), ==, 0); + VERIFY0(nvlist_add_int16_array(nvl, name, val, n)); } void fnvlist_add_uint16_array(nvlist_t *nvl, const char *name, uint16_t *val, uint_t n) { - VERIFY3U(nvlist_add_uint16_array(nvl, name, val, n), ==, 0); + VERIFY0(nvlist_add_uint16_array(nvl, name, val, n)); } void fnvlist_add_int32_array(nvlist_t *nvl, const char *name, int32_t *val, uint_t n) { - VERIFY3U(nvlist_add_int32_array(nvl, name, val, n), ==, 0); + VERIFY0(nvlist_add_int32_array(nvl, name, val, n)); } void fnvlist_add_uint32_array(nvlist_t *nvl, const char *name, uint32_t *val, uint_t n) { - VERIFY3U(nvlist_add_uint32_array(nvl, name, val, n), ==, 0); + VERIFY0(nvlist_add_uint32_array(nvl, name, val, n)); } void fnvlist_add_int64_array(nvlist_t *nvl, const char *name, int64_t *val, uint_t n) { - VERIFY3U(nvlist_add_int64_array(nvl, name, val, n), ==, 0); + VERIFY0(nvlist_add_int64_array(nvl, name, val, n)); } void fnvlist_add_uint64_array(nvlist_t *nvl, const char *name, uint64_t *val, uint_t n) { - VERIFY3U(nvlist_add_uint64_array(nvl, name, val, n), ==, 0); + VERIFY0(nvlist_add_uint64_array(nvl, name, val, n)); } void fnvlist_add_string_array(nvlist_t *nvl, const char *name, char * const *val, uint_t n) { - VERIFY3U(nvlist_add_string_array(nvl, name, val, n), ==, 0); + VERIFY0(nvlist_add_string_array(nvl, name, val, n)); } void fnvlist_add_nvlist_array(nvlist_t *nvl, const char *name, nvlist_t **val, uint_t n) { - VERIFY3U(nvlist_add_nvlist_array(nvl, name, val, n), ==, 0); + VERIFY0(nvlist_add_nvlist_array(nvl, name, val, n)); } void fnvlist_remove(nvlist_t *nvl, const char *name) { - VERIFY3U(nvlist_remove_all(nvl, name), ==, 0); + VERIFY0(nvlist_remove_all(nvl, name)); } void fnvlist_remove_nvpair(nvlist_t *nvl, nvpair_t *pair) { - VERIFY3U(nvlist_remove_nvpair(nvl, pair), ==, 0); + VERIFY0(nvlist_remove_nvpair(nvl, pair)); } nvpair_t * fnvlist_lookup_nvpair(nvlist_t *nvl, const char *name) { nvpair_t *rv; - VERIFY3U(nvlist_lookup_nvpair(nvl, name, &rv), ==, 0); + VERIFY0(nvlist_lookup_nvpair(nvl, name, &rv)); return (rv); } @@ -307,7 +307,7 @@ boolean_t fnvlist_lookup_boolean_value(nvlist_t *nvl, const char *name) { boolean_t rv; - VERIFY3U(nvlist_lookup_boolean_value(nvl, name, &rv), ==, 0); + VERIFY0(nvlist_lookup_boolean_value(nvl, name, &rv)); return (rv); } @@ -315,7 +315,7 @@ uchar_t fnvlist_lookup_byte(nvlist_t *nvl, const char *name) { uchar_t rv; - VERIFY3U(nvlist_lookup_byte(nvl, name, &rv), ==, 0); + VERIFY0(nvlist_lookup_byte(nvl, name, &rv)); return (rv); } @@ -323,7 +323,7 @@ int8_t fnvlist_lookup_int8(nvlist_t *nvl, const char *name) { int8_t rv; - VERIFY3U(nvlist_lookup_int8(nvl, name, &rv), ==, 0); + VERIFY0(nvlist_lookup_int8(nvl, name, &rv)); return (rv); } @@ -331,7 +331,7 @@ int16_t fnvlist_lookup_int16(nvlist_t *nvl, const char *name) { int16_t rv; - VERIFY3U(nvlist_lookup_int16(nvl, name, &rv), ==, 0); + VERIFY0(nvlist_lookup_int16(nvl, name, &rv)); return (rv); } @@ -339,7 +339,7 @@ int32_t fnvlist_lookup_int32(nvlist_t *nvl, const char *name) { int32_t rv; - VERIFY3U(nvlist_lookup_int32(nvl, name, &rv), ==, 0); + VERIFY0(nvlist_lookup_int32(nvl, name, &rv)); return (rv); } @@ -347,7 +347,7 @@ int64_t fnvlist_lookup_int64(nvlist_t *nvl, const char *name) { int64_t rv; - VERIFY3U(nvlist_lookup_int64(nvl, name, &rv), ==, 0); + VERIFY0(nvlist_lookup_int64(nvl, name, &rv)); return (rv); } @@ -355,7 +355,7 @@ uint8_t fnvlist_lookup_uint8(nvlist_t *nvl, const char *name) { uint8_t rv; - VERIFY3U(nvlist_lookup_uint8(nvl, name, &rv), ==, 0); + VERIFY0(nvlist_lookup_uint8(nvl, name, &rv)); return (rv); } @@ -363,7 +363,7 @@ uint16_t fnvlist_lookup_uint16(nvlist_t *nvl, const char *name) { uint16_t rv; - VERIFY3U(nvlist_lookup_uint16(nvl, name, &rv), ==, 0); + VERIFY0(nvlist_lookup_uint16(nvl, name, &rv)); return (rv); } @@ -371,7 +371,7 @@ uint32_t fnvlist_lookup_uint32(nvlist_t *nvl, const char *name) { uint32_t rv; - VERIFY3U(nvlist_lookup_uint32(nvl, name, &rv), ==, 0); + VERIFY0(nvlist_lookup_uint32(nvl, name, &rv)); return (rv); } @@ -379,7 +379,7 @@ uint64_t fnvlist_lookup_uint64(nvlist_t *nvl, const char *name) { uint64_t rv; - VERIFY3U(nvlist_lookup_uint64(nvl, name, &rv), ==, 0); + VERIFY0(nvlist_lookup_uint64(nvl, name, &rv)); return (rv); } @@ -387,7 +387,7 @@ char * fnvlist_lookup_string(nvlist_t *nvl, const char *name) { char *rv; - VERIFY3U(nvlist_lookup_string(nvl, name, &rv), ==, 0); + VERIFY0(nvlist_lookup_string(nvl, name, &rv)); return (rv); } @@ -395,7 +395,7 @@ nvlist_t * fnvlist_lookup_nvlist(nvlist_t *nvl, const char *name) { nvlist_t *rv; - VERIFY3U(nvlist_lookup_nvlist(nvl, name, &rv), ==, 0); + VERIFY0(nvlist_lookup_nvlist(nvl, name, &rv)); return (rv); } @@ -403,7 +403,7 @@ boolean_t fnvpair_value_boolean_value(nvpair_t *nvp) { boolean_t rv; - VERIFY3U(nvpair_value_boolean_value(nvp, &rv), ==, 0); + VERIFY0(nvpair_value_boolean_value(nvp, &rv)); return (rv); } @@ -411,7 +411,7 @@ uchar_t fnvpair_value_byte(nvpair_t *nvp) { uchar_t rv; - VERIFY3U(nvpair_value_byte(nvp, &rv), ==, 0); + VERIFY0(nvpair_value_byte(nvp, &rv)); return (rv); } @@ -419,7 +419,7 @@ int8_t fnvpair_value_int8(nvpair_t *nvp) { int8_t rv; - VERIFY3U(nvpair_value_int8(nvp, &rv), ==, 0); + VERIFY0(nvpair_value_int8(nvp, &rv)); return (rv); } @@ -427,7 +427,7 @@ int16_t fnvpair_value_int16(nvpair_t *nvp) { int16_t rv; - VERIFY3U(nvpair_value_int16(nvp, &rv), ==, 0); + VERIFY0(nvpair_value_int16(nvp, &rv)); return (rv); } @@ -435,7 +435,7 @@ int32_t fnvpair_value_int32(nvpair_t *nvp) { int32_t rv; - VERIFY3U(nvpair_value_int32(nvp, &rv), ==, 0); + VERIFY0(nvpair_value_int32(nvp, &rv)); return (rv); } @@ -443,7 +443,7 @@ int64_t fnvpair_value_int64(nvpair_t *nvp) { int64_t rv; - VERIFY3U(nvpair_value_int64(nvp, &rv), ==, 0); + VERIFY0(nvpair_value_int64(nvp, &rv)); return (rv); } @@ -451,7 +451,7 @@ uint8_t fnvpair_value_uint8(nvpair_t *nvp) { uint8_t rv; - VERIFY3U(nvpair_value_uint8(nvp, &rv), ==, 0); + VERIFY0(nvpair_value_uint8(nvp, &rv)); return (rv); } @@ -459,7 +459,7 @@ uint16_t fnvpair_value_uint16(nvpair_t *nvp) { uint16_t rv; - VERIFY3U(nvpair_value_uint16(nvp, &rv), ==, 0); + VERIFY0(nvpair_value_uint16(nvp, &rv)); return (rv); } @@ -467,7 +467,7 @@ uint32_t fnvpair_value_uint32(nvpair_t *nvp) { uint32_t rv; - VERIFY3U(nvpair_value_uint32(nvp, &rv), ==, 0); + VERIFY0(nvpair_value_uint32(nvp, &rv)); return (rv); } @@ -475,7 +475,7 @@ uint64_t fnvpair_value_uint64(nvpair_t *nvp) { uint64_t rv; - VERIFY3U(nvpair_value_uint64(nvp, &rv), ==, 0); + VERIFY0(nvpair_value_uint64(nvp, &rv)); return (rv); } @@ -483,7 +483,7 @@ char * fnvpair_value_string(nvpair_t *nvp) { char *rv; - VERIFY3U(nvpair_value_string(nvp, &rv), ==, 0); + VERIFY0(nvpair_value_string(nvp, &rv)); return (rv); } @@ -491,7 +491,7 @@ nvlist_t * fnvpair_value_nvlist(nvpair_t *nvp) { nvlist_t *rv; - VERIFY3U(nvpair_value_nvlist(nvp, &rv), ==, 0); + VERIFY0(nvpair_value_nvlist(nvp, &rv)); return (rv); } |