Merge recent zfs vendor changes, sync code and adjust userland DEBUG.
Illumos issued covered: 1884 Empty "used" field for zfs *space commands 3006 VERIFY[S,U,P] and ASSERT[S,U,P] frequently check if first argument is zero 3028 zfs {group,user}space -n prints (null) instead of numeric GID/UID 3048 zfs {user,group}space [-s|-S] is broken 3049 zfs {user,group}space -t doesn't really filter the results 3060 zfs {user,group}space -H output isn't tab-delimited 3061 zfs {user,group}space -o doesn't use specified fields order 3064 usr/src/cmd/zpool/zpool_main.c misspells "successful" 3093 zfs {user,group}space's -i is noop 3098 zfs userspace/groupspace fail without saying why when run as non-root References: https://www.illumos.org/issues/ + [issue_id] Obtained from: illumos (vendor/illumos, vendor/illumos-sys) MFC after: 2 weeks
This commit is contained in:
commit
4c5238d576
@ -137,17 +137,21 @@
|
|||||||
.Fl a | Ar filesystem
|
.Fl a | Ar filesystem
|
||||||
.Nm
|
.Nm
|
||||||
.Cm userspace
|
.Cm userspace
|
||||||
.Op Fl niHp
|
.Op Fl Hinp
|
||||||
.Op Fl o Ar field Ns Op , Ns Ar ...
|
.Op Fl o Ar field Ns Op , Ns Ar ...
|
||||||
.Op Fl sS Ar field
|
.Op Fl s Ar field
|
||||||
|
.Ar ...
|
||||||
|
.Op Fl S Ar field
|
||||||
.Ar ...
|
.Ar ...
|
||||||
.Op Fl t Ar type Ns Op , Ns Ar ...
|
.Op Fl t Ar type Ns Op , Ns Ar ...
|
||||||
.Ar filesystem Ns | Ns Ar snapshot
|
.Ar filesystem Ns | Ns Ar snapshot
|
||||||
.Nm
|
.Nm
|
||||||
.Cm groupspace
|
.Cm groupspace
|
||||||
.Op Fl niHp
|
.Op Fl Hinp
|
||||||
.Op Fl o Ar field Ns Op , Ns Ar ...
|
.Op Fl o Ar field Ns Op , Ns Ar ...
|
||||||
.Op Fl sS Ar field
|
.Op Fl s Ar field
|
||||||
|
.Ar ...
|
||||||
|
.Op Fl S Ar field
|
||||||
.Ar ...
|
.Ar ...
|
||||||
.Op Fl t Ar type Ns Op , Ns Ar ...
|
.Op Fl t Ar type Ns Op , Ns Ar ...
|
||||||
.Ar filesystem Ns | Ns Ar snapshot
|
.Ar filesystem Ns | Ns Ar snapshot
|
||||||
@ -1987,9 +1991,11 @@ Upgrade the specified file system.
|
|||||||
.It Xo
|
.It Xo
|
||||||
.Nm
|
.Nm
|
||||||
.Cm userspace
|
.Cm userspace
|
||||||
.Op Fl niHp
|
.Op Fl Hinp
|
||||||
.Op Fl o Ar field Ns Op , Ns Ar ...
|
.Op Fl o Ar field Ns Op , Ns Ar ...
|
||||||
.Op Fl sS Ar field
|
.Op Fl s Ar field
|
||||||
|
.Ar ...
|
||||||
|
.Op Fl S Ar field
|
||||||
.Ar ...
|
.Ar ...
|
||||||
.Op Fl t Ar type Ns Op , Ns Ar ...
|
.Op Fl t Ar type Ns Op , Ns Ar ...
|
||||||
.Ar filesystem Ns | Ns Ar snapshot
|
.Ar filesystem Ns | Ns Ar snapshot
|
||||||
@ -2007,9 +2013,9 @@ Print numeric ID instead of user/group name.
|
|||||||
.It Fl H
|
.It Fl H
|
||||||
Do not print headers, use tab-delimited output.
|
Do not print headers, use tab-delimited output.
|
||||||
.It Fl p
|
.It Fl p
|
||||||
Use exact (parseable) numeric output.
|
Use exact (parsable) numeric output.
|
||||||
.It Fl o Ar field Ns Op , Ns Ar ...
|
.It Fl o Ar field Ns Op , Ns Ar ...
|
||||||
Display only the specified fields from the following set,
|
Display only the specified fields from the following set:
|
||||||
.Sy type,name,used,quota .
|
.Sy type,name,used,quota .
|
||||||
The default is to display all fields.
|
The default is to display all fields.
|
||||||
.It Fl s Ar field
|
.It Fl s Ar field
|
||||||
@ -2024,7 +2030,7 @@ another. The default is
|
|||||||
Sort by this field in reverse order. See
|
Sort by this field in reverse order. See
|
||||||
.Fl s .
|
.Fl s .
|
||||||
.It Fl t Ar type Ns Op , Ns Ar ...
|
.It Fl t Ar type Ns Op , Ns Ar ...
|
||||||
Print only the specified types from the following set,
|
Print only the specified types from the following set:
|
||||||
.Sy all,posixuser,smbuser,posixgroup,smbgroup .
|
.Sy all,posixuser,smbuser,posixgroup,smbgroup .
|
||||||
.Pp
|
.Pp
|
||||||
The default is
|
The default is
|
||||||
@ -2038,9 +2044,11 @@ Translate SID to POSIX ID. This flag currently has no effect on
|
|||||||
.It Xo
|
.It Xo
|
||||||
.Nm
|
.Nm
|
||||||
.Cm groupspace
|
.Cm groupspace
|
||||||
.Op Fl niHp
|
.Op Fl Hinp
|
||||||
.Op Fl o Ar field Ns Op , Ns Ar ...
|
.Op Fl o Ar field Ns Op , Ns Ar ...
|
||||||
.Op Fl sS Ar field
|
.Op Fl s Ar field
|
||||||
|
.Ar ...
|
||||||
|
.Op Fl S Ar field
|
||||||
.Ar ...
|
.Ar ...
|
||||||
.Op Fl t Ar type Ns Op , Ns Ar ...
|
.Op Fl t Ar type Ns Op , Ns Ar ...
|
||||||
.Ar filesystem Ns | Ns Ar snapshot
|
.Ar filesystem Ns | Ns Ar snapshot
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -3393,7 +3393,7 @@ zpool_do_split(int argc, char **argv)
|
|||||||
if (zpool_get_state(zhp) != POOL_STATE_UNAVAIL &&
|
if (zpool_get_state(zhp) != POOL_STATE_UNAVAIL &&
|
||||||
zpool_enable_datasets(zhp, mntopts, 0) != 0) {
|
zpool_enable_datasets(zhp, mntopts, 0) != 0) {
|
||||||
ret = 1;
|
ret = 1;
|
||||||
(void) fprintf(stderr, gettext("Split was succssful, but "
|
(void) fprintf(stderr, gettext("Split was successful, but "
|
||||||
"the datasets could not all be mounted\n"));
|
"the datasets could not all be mounted\n"));
|
||||||
(void) fprintf(stderr, gettext("Try doing '%s' with a "
|
(void) fprintf(stderr, gettext("Try doing '%s' with a "
|
||||||
"different altroot\n"), "zpool import");
|
"different altroot\n"), "zpool import");
|
||||||
|
@ -981,7 +981,7 @@ ztest_dsl_prop_set_uint64(char *osname, zfs_prop_t prop, uint64_t value,
|
|||||||
ztest_record_enospc(FTAG);
|
ztest_record_enospc(FTAG);
|
||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
ASSERT3U(error, ==, 0);
|
ASSERT0(error);
|
||||||
|
|
||||||
VERIFY3U(dsl_prop_get(osname, propname, sizeof (curval),
|
VERIFY3U(dsl_prop_get(osname, propname, sizeof (curval),
|
||||||
1, &curval, setpoint), ==, 0);
|
1, &curval, setpoint), ==, 0);
|
||||||
@ -1013,7 +1013,7 @@ ztest_spa_prop_set_uint64(zpool_prop_t prop, uint64_t value)
|
|||||||
ztest_record_enospc(FTAG);
|
ztest_record_enospc(FTAG);
|
||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
ASSERT3U(error, ==, 0);
|
ASSERT0(error);
|
||||||
|
|
||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
@ -1710,7 +1710,7 @@ ztest_replay_setattr(ztest_ds_t *zd, lr_setattr_t *lr, boolean_t byteswap)
|
|||||||
|
|
||||||
ASSERT3U(lr->lr_size, >=, sizeof (*bbt));
|
ASSERT3U(lr->lr_size, >=, sizeof (*bbt));
|
||||||
ASSERT3U(lr->lr_size, <=, db->db_size);
|
ASSERT3U(lr->lr_size, <=, db->db_size);
|
||||||
VERIFY3U(dmu_set_bonus(db, lr->lr_size, tx), ==, 0);
|
VERIFY0(dmu_set_bonus(db, lr->lr_size, tx));
|
||||||
bbt = ztest_bt_bonus(db);
|
bbt = ztest_bt_bonus(db);
|
||||||
|
|
||||||
ztest_bt_generate(bbt, os, lr->lr_foid, -1ULL, lr->lr_mode, txg, crtxg);
|
ztest_bt_generate(bbt, os, lr->lr_foid, -1ULL, lr->lr_mode, txg, crtxg);
|
||||||
@ -3045,7 +3045,7 @@ ztest_objset_destroy_cb(const char *name, void *arg)
|
|||||||
error = dmu_object_info(os, ZTEST_DIROBJ, &doi);
|
error = dmu_object_info(os, ZTEST_DIROBJ, &doi);
|
||||||
if (error != ENOENT) {
|
if (error != ENOENT) {
|
||||||
/* We could have crashed in the middle of destroying it */
|
/* We could have crashed in the middle of destroying it */
|
||||||
ASSERT3U(error, ==, 0);
|
ASSERT0(error);
|
||||||
ASSERT3U(doi.doi_type, ==, DMU_OT_ZAP_OTHER);
|
ASSERT3U(doi.doi_type, ==, DMU_OT_ZAP_OTHER);
|
||||||
ASSERT3S(doi.doi_physical_blocks_512, >=, 0);
|
ASSERT3S(doi.doi_physical_blocks_512, >=, 0);
|
||||||
}
|
}
|
||||||
@ -3458,10 +3458,10 @@ ztest_dmu_read_write(ztest_ds_t *zd, uint64_t id)
|
|||||||
*/
|
*/
|
||||||
error = dmu_read(os, packobj, packoff, packsize, packbuf,
|
error = dmu_read(os, packobj, packoff, packsize, packbuf,
|
||||||
DMU_READ_PREFETCH);
|
DMU_READ_PREFETCH);
|
||||||
ASSERT3U(error, ==, 0);
|
ASSERT0(error);
|
||||||
error = dmu_read(os, bigobj, bigoff, bigsize, bigbuf,
|
error = dmu_read(os, bigobj, bigoff, bigsize, bigbuf,
|
||||||
DMU_READ_PREFETCH);
|
DMU_READ_PREFETCH);
|
||||||
ASSERT3U(error, ==, 0);
|
ASSERT0(error);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get a tx for the mods to both packobj and bigobj.
|
* Get a tx for the mods to both packobj and bigobj.
|
||||||
@ -3771,10 +3771,10 @@ ztest_dmu_read_write_zcopy(ztest_ds_t *zd, uint64_t id)
|
|||||||
if (i != 0 || ztest_random(2) != 0) {
|
if (i != 0 || ztest_random(2) != 0) {
|
||||||
error = dmu_read(os, packobj, packoff,
|
error = dmu_read(os, packobj, packoff,
|
||||||
packsize, packbuf, DMU_READ_PREFETCH);
|
packsize, packbuf, DMU_READ_PREFETCH);
|
||||||
ASSERT3U(error, ==, 0);
|
ASSERT0(error);
|
||||||
error = dmu_read(os, bigobj, bigoff, bigsize,
|
error = dmu_read(os, bigobj, bigoff, bigsize,
|
||||||
bigbuf, DMU_READ_PREFETCH);
|
bigbuf, DMU_READ_PREFETCH);
|
||||||
ASSERT3U(error, ==, 0);
|
ASSERT0(error);
|
||||||
}
|
}
|
||||||
compare_and_update_pbbufs(s, packbuf, bigbuf, bigsize,
|
compare_and_update_pbbufs(s, packbuf, bigbuf, bigsize,
|
||||||
n, chunksize, txg);
|
n, chunksize, txg);
|
||||||
@ -4045,7 +4045,7 @@ ztest_zap(ztest_ds_t *zd, uint64_t id)
|
|||||||
if (error == ENOENT)
|
if (error == ENOENT)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ASSERT3U(error, ==, 0);
|
ASSERT0(error);
|
||||||
|
|
||||||
tx = dmu_tx_create(os);
|
tx = dmu_tx_create(os);
|
||||||
dmu_tx_hold_zap(tx, object, B_TRUE, NULL);
|
dmu_tx_hold_zap(tx, object, B_TRUE, NULL);
|
||||||
@ -4241,7 +4241,7 @@ ztest_commit_callback(void *arg, int error)
|
|||||||
data->zcd_called = B_TRUE;
|
data->zcd_called = B_TRUE;
|
||||||
|
|
||||||
if (error == ECANCELED) {
|
if (error == ECANCELED) {
|
||||||
ASSERT3U(data->zcd_txg, ==, 0);
|
ASSERT0(data->zcd_txg);
|
||||||
ASSERT(!data->zcd_added);
|
ASSERT(!data->zcd_added);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -4446,7 +4446,7 @@ ztest_spa_prop_get_set(ztest_ds_t *zd, uint64_t id)
|
|||||||
(void) ztest_spa_prop_set_uint64(ZPOOL_PROP_DEDUPDITTO,
|
(void) ztest_spa_prop_set_uint64(ZPOOL_PROP_DEDUPDITTO,
|
||||||
ZIO_DEDUPDITTO_MIN + ztest_random(ZIO_DEDUPDITTO_MIN));
|
ZIO_DEDUPDITTO_MIN + ztest_random(ZIO_DEDUPDITTO_MIN));
|
||||||
|
|
||||||
VERIFY3U(spa_prop_get(ztest_spa, &props), ==, 0);
|
VERIFY0(spa_prop_get(ztest_spa, &props));
|
||||||
|
|
||||||
if (ztest_opts.zo_verbose >= 6)
|
if (ztest_opts.zo_verbose >= 6)
|
||||||
dump_nvlist(props, 4);
|
dump_nvlist(props, 4);
|
||||||
@ -5271,7 +5271,7 @@ ztest_dataset_open(int d)
|
|||||||
}
|
}
|
||||||
ASSERT(error == 0 || error == EEXIST);
|
ASSERT(error == 0 || error == EEXIST);
|
||||||
|
|
||||||
VERIFY3U(dmu_objset_hold(name, zd, &os), ==, 0);
|
VERIFY0(dmu_objset_hold(name, zd, &os));
|
||||||
(void) rw_unlock(&ztest_name_lock);
|
(void) rw_unlock(&ztest_name_lock);
|
||||||
|
|
||||||
ztest_zd_init(zd, ZTEST_GET_SHARED_DS(d), os);
|
ztest_zd_init(zd, ZTEST_GET_SHARED_DS(d), os);
|
||||||
|
@ -25,6 +25,8 @@
|
|||||||
|
|
||||||
#include "libuutil_common.h"
|
#include "libuutil_common.h"
|
||||||
|
|
||||||
|
#define HAVE_ASSFAIL 1
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <libintl.h>
|
#include <libintl.h>
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||||
* Copyright 2010 Nexenta Systems, Inc. All rights reserved.
|
* Copyright 2012 Nexenta Systems, Inc. All rights reserved.
|
||||||
* Copyright (c) 2011 by Delphix. All rights reserved.
|
* Copyright (c) 2011 by Delphix. All rights reserved.
|
||||||
* Copyright (c) 2012 DEY Storage Systems, Inc. All rights reserved.
|
* Copyright (c) 2012 DEY Storage Systems, Inc. All rights reserved.
|
||||||
* Copyright (c) 2011-2012 Pawel Jakub Dawidek <pawel@dawidek.net>.
|
* Copyright (c) 2011-2012 Pawel Jakub Dawidek <pawel@dawidek.net>.
|
||||||
@ -4077,35 +4077,40 @@ zfs_userspace(zfs_handle_t *zhp, zfs_userquota_prop_t type,
|
|||||||
zfs_userspace_cb_t func, void *arg)
|
zfs_userspace_cb_t func, void *arg)
|
||||||
{
|
{
|
||||||
zfs_cmd_t zc = { 0 };
|
zfs_cmd_t zc = { 0 };
|
||||||
int error;
|
|
||||||
zfs_useracct_t buf[100];
|
zfs_useracct_t buf[100];
|
||||||
|
libzfs_handle_t *hdl = zhp->zfs_hdl;
|
||||||
|
int ret;
|
||||||
|
|
||||||
(void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name));
|
(void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name));
|
||||||
|
|
||||||
zc.zc_objset_type = type;
|
zc.zc_objset_type = type;
|
||||||
zc.zc_nvlist_dst = (uintptr_t)buf;
|
zc.zc_nvlist_dst = (uintptr_t)buf;
|
||||||
|
|
||||||
/* CONSTCOND */
|
for (;;) {
|
||||||
while (1) {
|
|
||||||
zfs_useracct_t *zua = buf;
|
zfs_useracct_t *zua = buf;
|
||||||
|
|
||||||
zc.zc_nvlist_dst_size = sizeof (buf);
|
zc.zc_nvlist_dst_size = sizeof (buf);
|
||||||
error = ioctl(zhp->zfs_hdl->libzfs_fd,
|
if (zfs_ioctl(hdl, ZFS_IOC_USERSPACE_MANY, &zc) != 0) {
|
||||||
ZFS_IOC_USERSPACE_MANY, &zc);
|
char errbuf[ZFS_MAXNAMELEN + 32];
|
||||||
if (error || zc.zc_nvlist_dst_size == 0)
|
|
||||||
|
(void) snprintf(errbuf, sizeof (errbuf),
|
||||||
|
dgettext(TEXT_DOMAIN,
|
||||||
|
"cannot get used/quota for %s"), zc.zc_name);
|
||||||
|
return (zfs_standard_error_fmt(hdl, errno, errbuf));
|
||||||
|
}
|
||||||
|
if (zc.zc_nvlist_dst_size == 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
while (zc.zc_nvlist_dst_size > 0) {
|
while (zc.zc_nvlist_dst_size > 0) {
|
||||||
error = func(arg, zua->zu_domain, zua->zu_rid,
|
if ((ret = func(arg, zua->zu_domain, zua->zu_rid,
|
||||||
zua->zu_space);
|
zua->zu_space)) != 0)
|
||||||
if (error != 0)
|
return (ret);
|
||||||
return (error);
|
|
||||||
zua++;
|
zua++;
|
||||||
zc.zc_nvlist_dst_size -= sizeof (zfs_useracct_t);
|
zc.zc_nvlist_dst_size -= sizeof (zfs_useracct_t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (error);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -34,7 +34,6 @@ extern "C" {
|
|||||||
#define _SYS_RWLOCK_H
|
#define _SYS_RWLOCK_H
|
||||||
#define _SYS_CONDVAR_H
|
#define _SYS_CONDVAR_H
|
||||||
#define _SYS_SYSTM_H
|
#define _SYS_SYSTM_H
|
||||||
#define _SYS_DEBUG_H
|
|
||||||
#define _SYS_T_LOCK_H
|
#define _SYS_T_LOCK_H
|
||||||
#define _SYS_VNODE_H
|
#define _SYS_VNODE_H
|
||||||
#define _SYS_VFS_H
|
#define _SYS_VFS_H
|
||||||
@ -75,7 +74,6 @@ extern "C" {
|
|||||||
#include <sys/mntent.h>
|
#include <sys/mntent.h>
|
||||||
#include <sys/mnttab.h>
|
#include <sys/mnttab.h>
|
||||||
#include <sys/zfs_debug.h>
|
#include <sys/zfs_debug.h>
|
||||||
#include <sys/debug.h>
|
|
||||||
#include <sys/sdt.h>
|
#include <sys/sdt.h>
|
||||||
#include <sys/kstat.h>
|
#include <sys/kstat.h>
|
||||||
#include <sys/u8_textprep.h>
|
#include <sys/u8_textprep.h>
|
||||||
@ -85,6 +83,7 @@ extern "C" {
|
|||||||
#include <sys/sysevent/eventdefs.h>
|
#include <sys/sysevent/eventdefs.h>
|
||||||
#include <sys/sysevent/dev.h>
|
#include <sys/sysevent/dev.h>
|
||||||
#include <machine/atomic.h>
|
#include <machine/atomic.h>
|
||||||
|
#include <sys/debug.h>
|
||||||
|
|
||||||
#define ZFS_EXPORTS_PATH "/etc/zfs/exports"
|
#define ZFS_EXPORTS_PATH "/etc/zfs/exports"
|
||||||
|
|
||||||
@ -124,60 +123,6 @@ extern void vpanic(const char *, __va_list);
|
|||||||
|
|
||||||
extern int aok;
|
extern int aok;
|
||||||
|
|
||||||
/* This definition is copied from assert.h. */
|
|
||||||
#if defined(__STDC__)
|
|
||||||
#if __STDC_VERSION__ - 0 >= 199901L
|
|
||||||
#define zverify(EX) (void)((EX) || (aok) || \
|
|
||||||
(__assert(#EX, __FILE__, __LINE__), 0))
|
|
||||||
#else
|
|
||||||
#define zverify(EX) (void)((EX) || (aok) || \
|
|
||||||
(__assert(#EX, __FILE__, __LINE__), 0))
|
|
||||||
#endif /* __STDC_VERSION__ - 0 >= 199901L */
|
|
||||||
#else
|
|
||||||
#define zverify(EX) (void)((EX) || (aok) || \
|
|
||||||
(_assert("EX", __FILE__, __LINE__), 0))
|
|
||||||
#endif /* __STDC__ */
|
|
||||||
|
|
||||||
|
|
||||||
#define VERIFY zverify
|
|
||||||
#define ASSERT zverify
|
|
||||||
#undef assert
|
|
||||||
#define assert zverify
|
|
||||||
|
|
||||||
extern void __assert(const char *, const char *, int);
|
|
||||||
|
|
||||||
#ifdef lint
|
|
||||||
#define VERIFY3_IMPL(x, y, z, t) if (x == z) ((void)0)
|
|
||||||
#else
|
|
||||||
/* BEGIN CSTYLED */
|
|
||||||
#define VERIFY3_IMPL(LEFT, OP, RIGHT, TYPE) do { \
|
|
||||||
const TYPE __left = (TYPE)(LEFT); \
|
|
||||||
const TYPE __right = (TYPE)(RIGHT); \
|
|
||||||
if (!(__left OP __right) && (!aok)) { \
|
|
||||||
char *__buf = alloca(256); \
|
|
||||||
(void) snprintf(__buf, 256, "%s %s %s (0x%llx %s 0x%llx)", \
|
|
||||||
#LEFT, #OP, #RIGHT, \
|
|
||||||
(u_longlong_t)__left, #OP, (u_longlong_t)__right); \
|
|
||||||
__assert(__buf, __FILE__, __LINE__); \
|
|
||||||
} \
|
|
||||||
_NOTE(CONSTCOND) } while (0)
|
|
||||||
/* END CSTYLED */
|
|
||||||
#endif /* lint */
|
|
||||||
|
|
||||||
#define VERIFY3S(x, y, z) VERIFY3_IMPL(x, y, z, int64_t)
|
|
||||||
#define VERIFY3U(x, y, z) VERIFY3_IMPL(x, y, z, uint64_t)
|
|
||||||
#define VERIFY3P(x, y, z) VERIFY3_IMPL(x, y, z, uintptr_t)
|
|
||||||
|
|
||||||
#ifdef NDEBUG
|
|
||||||
#define ASSERT3S(x, y, z) ((void)0)
|
|
||||||
#define ASSERT3U(x, y, z) ((void)0)
|
|
||||||
#define ASSERT3P(x, y, z) ((void)0)
|
|
||||||
#else
|
|
||||||
#define ASSERT3S(x, y, z) VERIFY3S(x, y, z)
|
|
||||||
#define ASSERT3U(x, y, z) VERIFY3U(x, y, z)
|
|
||||||
#define ASSERT3P(x, y, z) VERIFY3P(x, y, z)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* DTrace SDT probes have different signatures in userland than they do in
|
* DTrace SDT probes have different signatures in userland than they do in
|
||||||
* kernel. If they're being used in kernel code, re-define them out of
|
* kernel. If they're being used in kernel code, re-define them out of
|
||||||
|
@ -64,4 +64,7 @@ NO_PROFILE=
|
|||||||
|
|
||||||
CSTD= c99
|
CSTD= c99
|
||||||
|
|
||||||
|
CFLAGS+= -DDEBUG=1
|
||||||
|
#DEBUG_FLAGS+= -g
|
||||||
|
|
||||||
.include <bsd.lib.mk>
|
.include <bsd.lib.mk>
|
||||||
|
@ -24,4 +24,7 @@ LDADD= -lgeom -lm -lnvpair -lumem -lzpool -lpthread -lavl -lzfs -luutil
|
|||||||
|
|
||||||
CSTD= c99
|
CSTD= c99
|
||||||
|
|
||||||
|
CFLAGS+= -DDEBUG=1
|
||||||
|
#DEBUG_FLAGS+= -g
|
||||||
|
|
||||||
.include <bsd.prog.mk>
|
.include <bsd.prog.mk>
|
||||||
|
@ -27,4 +27,7 @@ DPADD= ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBPTHREAD} ${LIBUMEM} \
|
|||||||
${LIBUUTIL} ${LIBZFS} ${LIBZPOOL}
|
${LIBUUTIL} ${LIBZFS} ${LIBZPOOL}
|
||||||
LDADD= -lgeom -lm -lnvpair -lpthread -lumem -luutil -lzfs -lzpool
|
LDADD= -lgeom -lm -lnvpair -lpthread -lumem -luutil -lzfs -lzpool
|
||||||
|
|
||||||
|
CFLAGS+= -DDEBUG=1
|
||||||
|
#DEBUG_FLAGS+= -g
|
||||||
|
|
||||||
.include <bsd.prog.mk>
|
.include <bsd.prog.mk>
|
||||||
|
@ -26,4 +26,7 @@ DPADD= ${LIBGEOM} ${LIBM} ${LIBNVPAIR} ${LIBPTHREAD} ${LIBUMEM} \
|
|||||||
${LIBUUTIL} ${LIBZFS} ${LIBZPOOL}
|
${LIBUUTIL} ${LIBZFS} ${LIBZPOOL}
|
||||||
LDADD= -lgeom -lm -lnvpair -lpthread -lumem -luutil -lzfs -lzpool
|
LDADD= -lgeom -lm -lnvpair -lpthread -lumem -luutil -lzfs -lzpool
|
||||||
|
|
||||||
|
CFLAGS+= -DDEBUG=1
|
||||||
|
#DEBUG_FLAGS+= -g
|
||||||
|
|
||||||
.include <bsd.prog.mk>
|
.include <bsd.prog.mk>
|
||||||
|
@ -30,14 +30,50 @@
|
|||||||
#define _OPENSOLARIS_SYS_ASSFAIL_H_
|
#define _OPENSOLARIS_SYS_ASSFAIL_H_
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#ifndef _KERNEL
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef _KERNEL
|
||||||
int assfail(const char *, const char *, int);
|
int assfail(const char *, const char *, int);
|
||||||
void assfail3(const char *, uintmax_t, const char *, uintmax_t, const char *,
|
void assfail3(const char *, uintmax_t, const char *, uintmax_t, const char *,
|
||||||
int);
|
int);
|
||||||
|
#else /* !defined(_KERNEL) */
|
||||||
|
|
||||||
|
#ifndef HAVE_ASSFAIL
|
||||||
|
static __inline int
|
||||||
|
__assfail(const char *expr, const char *file, int line)
|
||||||
|
{
|
||||||
|
|
||||||
|
(void)fprintf(stderr, "Assertion failed: (%s), file %s, line %d.\n",
|
||||||
|
expr, file, line);
|
||||||
|
abort();
|
||||||
|
/* NOTREACHED */
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
#define assfail __assfail
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_ASSFAIL3
|
||||||
|
static __inline void
|
||||||
|
__assfail3(const char *expr, uintmax_t lv, const char *op, uintmax_t rv,
|
||||||
|
const char *file, int line) {
|
||||||
|
|
||||||
|
(void)fprintf(stderr,
|
||||||
|
"Assertion failed: %s (0x%jx %s 0x%jx), file %s, line %d.\n",
|
||||||
|
expr, lv, op, rv, file, line);
|
||||||
|
abort();
|
||||||
|
/* NOTREACHED */
|
||||||
|
}
|
||||||
|
#define assfail3 __assfail3
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* !defined(_KERNEL) */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
42
sys/cddl/compat/opensolaris/sys/debug.h
Normal file
42
sys/cddl/compat/opensolaris/sys/debug.h
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
/*-
|
||||||
|
* Copyright (c) 2007 Pawel Jakub Dawidek <pjd@FreeBSD.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
|
||||||
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||||
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
|
* SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
* $FreeBSD$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _OPENSOLARIS_SYS_DEBUG_H_
|
||||||
|
#define _OPENSOLARIS_SYS_DEBUG_H_
|
||||||
|
|
||||||
|
#ifdef _KERNEL
|
||||||
|
#include <sys/systm.h>
|
||||||
|
|
||||||
|
#include_next <sys/debug.h>
|
||||||
|
#else /* !_KERNEL */
|
||||||
|
|
||||||
|
#include_next <sys/debug.h>
|
||||||
|
#include <sys/assfail.h>
|
||||||
|
#endif /* _KERNEL */
|
||||||
|
|
||||||
|
#endif /* _OPENSOLARIS_SYS_DEBUG_H_ */
|
@ -52,7 +52,7 @@ nvlist_t *
|
|||||||
fnvlist_alloc(void)
|
fnvlist_alloc(void)
|
||||||
{
|
{
|
||||||
nvlist_t *nvl;
|
nvlist_t *nvl;
|
||||||
VERIFY3U(nvlist_alloc(&nvl, NV_UNIQUE_NAME, KM_SLEEP), ==, 0);
|
VERIFY0(nvlist_alloc(&nvl, NV_UNIQUE_NAME, KM_SLEEP));
|
||||||
return (nvl);
|
return (nvl);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ size_t
|
|||||||
fnvlist_size(nvlist_t *nvl)
|
fnvlist_size(nvlist_t *nvl)
|
||||||
{
|
{
|
||||||
size_t size;
|
size_t size;
|
||||||
VERIFY3U(nvlist_size(nvl, &size, NV_ENCODE_NATIVE), ==, 0);
|
VERIFY0(nvlist_size(nvl, &size, NV_ENCODE_NATIVE));
|
||||||
return (size);
|
return (size);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,7 +98,7 @@ nvlist_t *
|
|||||||
fnvlist_unpack(char *buf, size_t buflen)
|
fnvlist_unpack(char *buf, size_t buflen)
|
||||||
{
|
{
|
||||||
nvlist_t *rv;
|
nvlist_t *rv;
|
||||||
VERIFY3U(nvlist_unpack(buf, buflen, &rv, KM_SLEEP), ==, 0);
|
VERIFY0(nvlist_unpack(buf, buflen, &rv, KM_SLEEP));
|
||||||
return (rv);
|
return (rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -106,195 +106,195 @@ nvlist_t *
|
|||||||
fnvlist_dup(nvlist_t *nvl)
|
fnvlist_dup(nvlist_t *nvl)
|
||||||
{
|
{
|
||||||
nvlist_t *rv;
|
nvlist_t *rv;
|
||||||
VERIFY3U(nvlist_dup(nvl, &rv, KM_SLEEP), ==, 0);
|
VERIFY0(nvlist_dup(nvl, &rv, KM_SLEEP));
|
||||||
return (rv);
|
return (rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
fnvlist_merge(nvlist_t *dst, nvlist_t *src)
|
fnvlist_merge(nvlist_t *dst, nvlist_t *src)
|
||||||
{
|
{
|
||||||
VERIFY3U(nvlist_merge(dst, src, KM_SLEEP), ==, 0);
|
VERIFY0(nvlist_merge(dst, src, KM_SLEEP));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
fnvlist_add_boolean(nvlist_t *nvl, const char *name)
|
fnvlist_add_boolean(nvlist_t *nvl, const char *name)
|
||||||
{
|
{
|
||||||
VERIFY3U(nvlist_add_boolean(nvl, name), ==, 0);
|
VERIFY0(nvlist_add_boolean(nvl, name));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
fnvlist_add_boolean_value(nvlist_t *nvl, const char *name, boolean_t val)
|
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
|
void
|
||||||
fnvlist_add_byte(nvlist_t *nvl, const char *name, uchar_t val)
|
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
|
void
|
||||||
fnvlist_add_int8(nvlist_t *nvl, const char *name, int8_t val)
|
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
|
void
|
||||||
fnvlist_add_uint8(nvlist_t *nvl, const char *name, uint8_t val)
|
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
|
void
|
||||||
fnvlist_add_int16(nvlist_t *nvl, const char *name, int16_t val)
|
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
|
void
|
||||||
fnvlist_add_uint16(nvlist_t *nvl, const char *name, uint16_t val)
|
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
|
void
|
||||||
fnvlist_add_int32(nvlist_t *nvl, const char *name, int32_t val)
|
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
|
void
|
||||||
fnvlist_add_uint32(nvlist_t *nvl, const char *name, uint32_t val)
|
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
|
void
|
||||||
fnvlist_add_int64(nvlist_t *nvl, const char *name, int64_t val)
|
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
|
void
|
||||||
fnvlist_add_uint64(nvlist_t *nvl, const char *name, uint64_t val)
|
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
|
void
|
||||||
fnvlist_add_string(nvlist_t *nvl, const char *name, const char *val)
|
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
|
void
|
||||||
fnvlist_add_nvlist(nvlist_t *nvl, const char *name, nvlist_t *val)
|
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
|
void
|
||||||
fnvlist_add_nvpair(nvlist_t *nvl, nvpair_t *pair)
|
fnvlist_add_nvpair(nvlist_t *nvl, nvpair_t *pair)
|
||||||
{
|
{
|
||||||
VERIFY3U(nvlist_add_nvpair(nvl, pair), ==, 0);
|
VERIFY0(nvlist_add_nvpair(nvl, pair));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
fnvlist_add_boolean_array(nvlist_t *nvl, const char *name,
|
fnvlist_add_boolean_array(nvlist_t *nvl, const char *name,
|
||||||
boolean_t *val, uint_t n)
|
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
|
void
|
||||||
fnvlist_add_byte_array(nvlist_t *nvl, const char *name, uchar_t *val, uint_t n)
|
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
|
void
|
||||||
fnvlist_add_int8_array(nvlist_t *nvl, const char *name, int8_t *val, uint_t n)
|
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
|
void
|
||||||
fnvlist_add_uint8_array(nvlist_t *nvl, const char *name, uint8_t *val, uint_t n)
|
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
|
void
|
||||||
fnvlist_add_int16_array(nvlist_t *nvl, const char *name, int16_t *val, uint_t n)
|
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
|
void
|
||||||
fnvlist_add_uint16_array(nvlist_t *nvl, const char *name,
|
fnvlist_add_uint16_array(nvlist_t *nvl, const char *name,
|
||||||
uint16_t *val, uint_t n)
|
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
|
void
|
||||||
fnvlist_add_int32_array(nvlist_t *nvl, const char *name, int32_t *val, uint_t n)
|
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
|
void
|
||||||
fnvlist_add_uint32_array(nvlist_t *nvl, const char *name,
|
fnvlist_add_uint32_array(nvlist_t *nvl, const char *name,
|
||||||
uint32_t *val, uint_t n)
|
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
|
void
|
||||||
fnvlist_add_int64_array(nvlist_t *nvl, const char *name, int64_t *val, uint_t n)
|
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
|
void
|
||||||
fnvlist_add_uint64_array(nvlist_t *nvl, const char *name,
|
fnvlist_add_uint64_array(nvlist_t *nvl, const char *name,
|
||||||
uint64_t *val, uint_t n)
|
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
|
void
|
||||||
fnvlist_add_string_array(nvlist_t *nvl, const char *name,
|
fnvlist_add_string_array(nvlist_t *nvl, const char *name,
|
||||||
char * const *val, uint_t n)
|
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
|
void
|
||||||
fnvlist_add_nvlist_array(nvlist_t *nvl, const char *name,
|
fnvlist_add_nvlist_array(nvlist_t *nvl, const char *name,
|
||||||
nvlist_t **val, uint_t n)
|
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
|
void
|
||||||
fnvlist_remove(nvlist_t *nvl, const char *name)
|
fnvlist_remove(nvlist_t *nvl, const char *name)
|
||||||
{
|
{
|
||||||
VERIFY3U(nvlist_remove_all(nvl, name), ==, 0);
|
VERIFY0(nvlist_remove_all(nvl, name));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
fnvlist_remove_nvpair(nvlist_t *nvl, nvpair_t *pair)
|
fnvlist_remove_nvpair(nvlist_t *nvl, nvpair_t *pair)
|
||||||
{
|
{
|
||||||
VERIFY3U(nvlist_remove_nvpair(nvl, pair), ==, 0);
|
VERIFY0(nvlist_remove_nvpair(nvl, pair));
|
||||||
}
|
}
|
||||||
|
|
||||||
nvpair_t *
|
nvpair_t *
|
||||||
fnvlist_lookup_nvpair(nvlist_t *nvl, const char *name)
|
fnvlist_lookup_nvpair(nvlist_t *nvl, const char *name)
|
||||||
{
|
{
|
||||||
nvpair_t *rv;
|
nvpair_t *rv;
|
||||||
VERIFY3U(nvlist_lookup_nvpair(nvl, name, &rv), ==, 0);
|
VERIFY0(nvlist_lookup_nvpair(nvl, name, &rv));
|
||||||
return (rv);
|
return (rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -309,7 +309,7 @@ boolean_t
|
|||||||
fnvlist_lookup_boolean_value(nvlist_t *nvl, const char *name)
|
fnvlist_lookup_boolean_value(nvlist_t *nvl, const char *name)
|
||||||
{
|
{
|
||||||
boolean_t rv;
|
boolean_t rv;
|
||||||
VERIFY3U(nvlist_lookup_boolean_value(nvl, name, &rv), ==, 0);
|
VERIFY0(nvlist_lookup_boolean_value(nvl, name, &rv));
|
||||||
return (rv);
|
return (rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -317,7 +317,7 @@ uchar_t
|
|||||||
fnvlist_lookup_byte(nvlist_t *nvl, const char *name)
|
fnvlist_lookup_byte(nvlist_t *nvl, const char *name)
|
||||||
{
|
{
|
||||||
uchar_t rv;
|
uchar_t rv;
|
||||||
VERIFY3U(nvlist_lookup_byte(nvl, name, &rv), ==, 0);
|
VERIFY0(nvlist_lookup_byte(nvl, name, &rv));
|
||||||
return (rv);
|
return (rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -325,7 +325,7 @@ int8_t
|
|||||||
fnvlist_lookup_int8(nvlist_t *nvl, const char *name)
|
fnvlist_lookup_int8(nvlist_t *nvl, const char *name)
|
||||||
{
|
{
|
||||||
int8_t rv;
|
int8_t rv;
|
||||||
VERIFY3U(nvlist_lookup_int8(nvl, name, &rv), ==, 0);
|
VERIFY0(nvlist_lookup_int8(nvl, name, &rv));
|
||||||
return (rv);
|
return (rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -333,7 +333,7 @@ int16_t
|
|||||||
fnvlist_lookup_int16(nvlist_t *nvl, const char *name)
|
fnvlist_lookup_int16(nvlist_t *nvl, const char *name)
|
||||||
{
|
{
|
||||||
int16_t rv;
|
int16_t rv;
|
||||||
VERIFY3U(nvlist_lookup_int16(nvl, name, &rv), ==, 0);
|
VERIFY0(nvlist_lookup_int16(nvl, name, &rv));
|
||||||
return (rv);
|
return (rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -341,7 +341,7 @@ int32_t
|
|||||||
fnvlist_lookup_int32(nvlist_t *nvl, const char *name)
|
fnvlist_lookup_int32(nvlist_t *nvl, const char *name)
|
||||||
{
|
{
|
||||||
int32_t rv;
|
int32_t rv;
|
||||||
VERIFY3U(nvlist_lookup_int32(nvl, name, &rv), ==, 0);
|
VERIFY0(nvlist_lookup_int32(nvl, name, &rv));
|
||||||
return (rv);
|
return (rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -349,7 +349,7 @@ int64_t
|
|||||||
fnvlist_lookup_int64(nvlist_t *nvl, const char *name)
|
fnvlist_lookup_int64(nvlist_t *nvl, const char *name)
|
||||||
{
|
{
|
||||||
int64_t rv;
|
int64_t rv;
|
||||||
VERIFY3U(nvlist_lookup_int64(nvl, name, &rv), ==, 0);
|
VERIFY0(nvlist_lookup_int64(nvl, name, &rv));
|
||||||
return (rv);
|
return (rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -357,7 +357,7 @@ uint8_t
|
|||||||
fnvlist_lookup_uint8_t(nvlist_t *nvl, const char *name)
|
fnvlist_lookup_uint8_t(nvlist_t *nvl, const char *name)
|
||||||
{
|
{
|
||||||
uint8_t rv;
|
uint8_t rv;
|
||||||
VERIFY3U(nvlist_lookup_uint8(nvl, name, &rv), ==, 0);
|
VERIFY0(nvlist_lookup_uint8(nvl, name, &rv));
|
||||||
return (rv);
|
return (rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -365,7 +365,7 @@ uint16_t
|
|||||||
fnvlist_lookup_uint16(nvlist_t *nvl, const char *name)
|
fnvlist_lookup_uint16(nvlist_t *nvl, const char *name)
|
||||||
{
|
{
|
||||||
uint16_t rv;
|
uint16_t rv;
|
||||||
VERIFY3U(nvlist_lookup_uint16(nvl, name, &rv), ==, 0);
|
VERIFY0(nvlist_lookup_uint16(nvl, name, &rv));
|
||||||
return (rv);
|
return (rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -373,7 +373,7 @@ uint32_t
|
|||||||
fnvlist_lookup_uint32(nvlist_t *nvl, const char *name)
|
fnvlist_lookup_uint32(nvlist_t *nvl, const char *name)
|
||||||
{
|
{
|
||||||
uint32_t rv;
|
uint32_t rv;
|
||||||
VERIFY3U(nvlist_lookup_uint32(nvl, name, &rv), ==, 0);
|
VERIFY0(nvlist_lookup_uint32(nvl, name, &rv));
|
||||||
return (rv);
|
return (rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -381,7 +381,7 @@ uint64_t
|
|||||||
fnvlist_lookup_uint64(nvlist_t *nvl, const char *name)
|
fnvlist_lookup_uint64(nvlist_t *nvl, const char *name)
|
||||||
{
|
{
|
||||||
uint64_t rv;
|
uint64_t rv;
|
||||||
VERIFY3U(nvlist_lookup_uint64(nvl, name, &rv), ==, 0);
|
VERIFY0(nvlist_lookup_uint64(nvl, name, &rv));
|
||||||
return (rv);
|
return (rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -389,7 +389,7 @@ char *
|
|||||||
fnvlist_lookup_string(nvlist_t *nvl, const char *name)
|
fnvlist_lookup_string(nvlist_t *nvl, const char *name)
|
||||||
{
|
{
|
||||||
char *rv;
|
char *rv;
|
||||||
VERIFY3U(nvlist_lookup_string(nvl, name, &rv), ==, 0);
|
VERIFY0(nvlist_lookup_string(nvl, name, &rv));
|
||||||
return (rv);
|
return (rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -397,7 +397,7 @@ nvlist_t *
|
|||||||
fnvlist_lookup_nvlist(nvlist_t *nvl, const char *name)
|
fnvlist_lookup_nvlist(nvlist_t *nvl, const char *name)
|
||||||
{
|
{
|
||||||
nvlist_t *rv;
|
nvlist_t *rv;
|
||||||
VERIFY3U(nvlist_lookup_nvlist(nvl, name, &rv), ==, 0);
|
VERIFY0(nvlist_lookup_nvlist(nvl, name, &rv));
|
||||||
return (rv);
|
return (rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -405,7 +405,7 @@ boolean_t
|
|||||||
fnvpair_value_boolean_value(nvpair_t *nvp)
|
fnvpair_value_boolean_value(nvpair_t *nvp)
|
||||||
{
|
{
|
||||||
boolean_t rv;
|
boolean_t rv;
|
||||||
VERIFY3U(nvpair_value_boolean_value(nvp, &rv), ==, 0);
|
VERIFY0(nvpair_value_boolean_value(nvp, &rv));
|
||||||
return (rv);
|
return (rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -413,7 +413,7 @@ uchar_t
|
|||||||
fnvpair_value_byte(nvpair_t *nvp)
|
fnvpair_value_byte(nvpair_t *nvp)
|
||||||
{
|
{
|
||||||
uchar_t rv;
|
uchar_t rv;
|
||||||
VERIFY3U(nvpair_value_byte(nvp, &rv), ==, 0);
|
VERIFY0(nvpair_value_byte(nvp, &rv));
|
||||||
return (rv);
|
return (rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -421,7 +421,7 @@ int8_t
|
|||||||
fnvpair_value_int8(nvpair_t *nvp)
|
fnvpair_value_int8(nvpair_t *nvp)
|
||||||
{
|
{
|
||||||
int8_t rv;
|
int8_t rv;
|
||||||
VERIFY3U(nvpair_value_int8(nvp, &rv), ==, 0);
|
VERIFY0(nvpair_value_int8(nvp, &rv));
|
||||||
return (rv);
|
return (rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -429,7 +429,7 @@ int16_t
|
|||||||
fnvpair_value_int16(nvpair_t *nvp)
|
fnvpair_value_int16(nvpair_t *nvp)
|
||||||
{
|
{
|
||||||
int16_t rv;
|
int16_t rv;
|
||||||
VERIFY3U(nvpair_value_int16(nvp, &rv), ==, 0);
|
VERIFY0(nvpair_value_int16(nvp, &rv));
|
||||||
return (rv);
|
return (rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -437,7 +437,7 @@ int32_t
|
|||||||
fnvpair_value_int32(nvpair_t *nvp)
|
fnvpair_value_int32(nvpair_t *nvp)
|
||||||
{
|
{
|
||||||
int32_t rv;
|
int32_t rv;
|
||||||
VERIFY3U(nvpair_value_int32(nvp, &rv), ==, 0);
|
VERIFY0(nvpair_value_int32(nvp, &rv));
|
||||||
return (rv);
|
return (rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -445,7 +445,7 @@ int64_t
|
|||||||
fnvpair_value_int64(nvpair_t *nvp)
|
fnvpair_value_int64(nvpair_t *nvp)
|
||||||
{
|
{
|
||||||
int64_t rv;
|
int64_t rv;
|
||||||
VERIFY3U(nvpair_value_int64(nvp, &rv), ==, 0);
|
VERIFY0(nvpair_value_int64(nvp, &rv));
|
||||||
return (rv);
|
return (rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -453,7 +453,7 @@ uint8_t
|
|||||||
fnvpair_value_uint8_t(nvpair_t *nvp)
|
fnvpair_value_uint8_t(nvpair_t *nvp)
|
||||||
{
|
{
|
||||||
uint8_t rv;
|
uint8_t rv;
|
||||||
VERIFY3U(nvpair_value_uint8(nvp, &rv), ==, 0);
|
VERIFY0(nvpair_value_uint8(nvp, &rv));
|
||||||
return (rv);
|
return (rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -461,7 +461,7 @@ uint16_t
|
|||||||
fnvpair_value_uint16(nvpair_t *nvp)
|
fnvpair_value_uint16(nvpair_t *nvp)
|
||||||
{
|
{
|
||||||
uint16_t rv;
|
uint16_t rv;
|
||||||
VERIFY3U(nvpair_value_uint16(nvp, &rv), ==, 0);
|
VERIFY0(nvpair_value_uint16(nvp, &rv));
|
||||||
return (rv);
|
return (rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -469,7 +469,7 @@ uint32_t
|
|||||||
fnvpair_value_uint32(nvpair_t *nvp)
|
fnvpair_value_uint32(nvpair_t *nvp)
|
||||||
{
|
{
|
||||||
uint32_t rv;
|
uint32_t rv;
|
||||||
VERIFY3U(nvpair_value_uint32(nvp, &rv), ==, 0);
|
VERIFY0(nvpair_value_uint32(nvp, &rv));
|
||||||
return (rv);
|
return (rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -477,7 +477,7 @@ uint64_t
|
|||||||
fnvpair_value_uint64(nvpair_t *nvp)
|
fnvpair_value_uint64(nvpair_t *nvp)
|
||||||
{
|
{
|
||||||
uint64_t rv;
|
uint64_t rv;
|
||||||
VERIFY3U(nvpair_value_uint64(nvp, &rv), ==, 0);
|
VERIFY0(nvpair_value_uint64(nvp, &rv));
|
||||||
return (rv);
|
return (rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -485,7 +485,7 @@ char *
|
|||||||
fnvpair_value_string(nvpair_t *nvp)
|
fnvpair_value_string(nvpair_t *nvp)
|
||||||
{
|
{
|
||||||
char *rv;
|
char *rv;
|
||||||
VERIFY3U(nvpair_value_string(nvp, &rv), ==, 0);
|
VERIFY0(nvpair_value_string(nvp, &rv));
|
||||||
return (rv);
|
return (rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -493,6 +493,6 @@ nvlist_t *
|
|||||||
fnvpair_value_nvlist(nvpair_t *nvp)
|
fnvpair_value_nvlist(nvpair_t *nvp)
|
||||||
{
|
{
|
||||||
nvlist_t *rv;
|
nvlist_t *rv;
|
||||||
VERIFY3U(nvpair_value_nvlist(nvp, &rv), ==, 0);
|
VERIFY0(nvpair_value_nvlist(nvp, &rv));
|
||||||
return (rv);
|
return (rv);
|
||||||
}
|
}
|
||||||
|
@ -1213,7 +1213,7 @@ add_reference(arc_buf_hdr_t *ab, kmutex_t *hash_lock, void *tag)
|
|||||||
ASSERT(list_link_active(&ab->b_arc_node));
|
ASSERT(list_link_active(&ab->b_arc_node));
|
||||||
list_remove(list, ab);
|
list_remove(list, ab);
|
||||||
if (GHOST_STATE(ab->b_state)) {
|
if (GHOST_STATE(ab->b_state)) {
|
||||||
ASSERT3U(ab->b_datacnt, ==, 0);
|
ASSERT0(ab->b_datacnt);
|
||||||
ASSERT3P(ab->b_buf, ==, NULL);
|
ASSERT3P(ab->b_buf, ==, NULL);
|
||||||
delta = ab->b_size;
|
delta = ab->b_size;
|
||||||
}
|
}
|
||||||
@ -1878,7 +1878,7 @@ arc_evict(arc_state_t *state, uint64_t spa, int64_t bytes, boolean_t recycle,
|
|||||||
hash_lock = HDR_LOCK(ab);
|
hash_lock = HDR_LOCK(ab);
|
||||||
have_lock = MUTEX_HELD(hash_lock);
|
have_lock = MUTEX_HELD(hash_lock);
|
||||||
if (have_lock || mutex_tryenter(hash_lock)) {
|
if (have_lock || mutex_tryenter(hash_lock)) {
|
||||||
ASSERT3U(refcount_count(&ab->b_refcnt), ==, 0);
|
ASSERT0(refcount_count(&ab->b_refcnt));
|
||||||
ASSERT(ab->b_datacnt > 0);
|
ASSERT(ab->b_datacnt > 0);
|
||||||
while (ab->b_buf) {
|
while (ab->b_buf) {
|
||||||
arc_buf_t *buf = ab->b_buf;
|
arc_buf_t *buf = ab->b_buf;
|
||||||
@ -2778,7 +2778,7 @@ arc_access(arc_buf_hdr_t *buf, kmutex_t *hash_lock)
|
|||||||
* This is a prefetch access...
|
* This is a prefetch access...
|
||||||
* move this block back to the MRU state.
|
* move this block back to the MRU state.
|
||||||
*/
|
*/
|
||||||
ASSERT3U(refcount_count(&buf->b_refcnt), ==, 0);
|
ASSERT0(refcount_count(&buf->b_refcnt));
|
||||||
new_state = arc_mru;
|
new_state = arc_mru;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3122,7 +3122,7 @@ arc_read_nolock(zio_t *pio, spa_t *spa, const blkptr_t *bp,
|
|||||||
/* this block is in the ghost cache */
|
/* this block is in the ghost cache */
|
||||||
ASSERT(GHOST_STATE(hdr->b_state));
|
ASSERT(GHOST_STATE(hdr->b_state));
|
||||||
ASSERT(!HDR_IO_IN_PROGRESS(hdr));
|
ASSERT(!HDR_IO_IN_PROGRESS(hdr));
|
||||||
ASSERT3U(refcount_count(&hdr->b_refcnt), ==, 0);
|
ASSERT0(refcount_count(&hdr->b_refcnt));
|
||||||
ASSERT(hdr->b_buf == NULL);
|
ASSERT(hdr->b_buf == NULL);
|
||||||
|
|
||||||
/* if this is a prefetch, we don't have a reference */
|
/* if this is a prefetch, we don't have a reference */
|
||||||
@ -4811,7 +4811,7 @@ l2arc_write_buffers(spa_t *spa, l2arc_dev_t *dev, uint64_t target_sz)
|
|||||||
mutex_exit(&l2arc_buflist_mtx);
|
mutex_exit(&l2arc_buflist_mtx);
|
||||||
|
|
||||||
if (pio == NULL) {
|
if (pio == NULL) {
|
||||||
ASSERT3U(write_sz, ==, 0);
|
ASSERT0(write_sz);
|
||||||
kmem_cache_free(hdr_cache, head);
|
kmem_cache_free(hdr_cache, head);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ bpobj_alloc_empty(objset_t *os, int blocksize, dmu_tx_t *tx)
|
|||||||
|
|
||||||
if (spa_feature_is_enabled(spa, empty_bpobj_feat)) {
|
if (spa_feature_is_enabled(spa, empty_bpobj_feat)) {
|
||||||
if (!spa_feature_is_active(spa, empty_bpobj_feat)) {
|
if (!spa_feature_is_active(spa, empty_bpobj_feat)) {
|
||||||
ASSERT3U(dp->dp_empty_bpobj, ==, 0);
|
ASSERT0(dp->dp_empty_bpobj);
|
||||||
dp->dp_empty_bpobj =
|
dp->dp_empty_bpobj =
|
||||||
bpobj_alloc(os, SPA_MAXBLOCKSIZE, tx);
|
bpobj_alloc(os, SPA_MAXBLOCKSIZE, tx);
|
||||||
VERIFY(zap_add(os,
|
VERIFY(zap_add(os,
|
||||||
|
@ -94,9 +94,9 @@ bptree_free(objset_t *os, uint64_t obj, dmu_tx_t *tx)
|
|||||||
VERIFY3U(0, ==, dmu_bonus_hold(os, obj, FTAG, &db));
|
VERIFY3U(0, ==, dmu_bonus_hold(os, obj, FTAG, &db));
|
||||||
bt = db->db_data;
|
bt = db->db_data;
|
||||||
ASSERT3U(bt->bt_begin, ==, bt->bt_end);
|
ASSERT3U(bt->bt_begin, ==, bt->bt_end);
|
||||||
ASSERT3U(bt->bt_bytes, ==, 0);
|
ASSERT0(bt->bt_bytes);
|
||||||
ASSERT3U(bt->bt_comp, ==, 0);
|
ASSERT0(bt->bt_comp);
|
||||||
ASSERT3U(bt->bt_uncomp, ==, 0);
|
ASSERT0(bt->bt_uncomp);
|
||||||
dmu_buf_rele(db, FTAG);
|
dmu_buf_rele(db, FTAG);
|
||||||
|
|
||||||
return (dmu_object_free(os, obj, tx));
|
return (dmu_object_free(os, obj, tx));
|
||||||
@ -198,7 +198,7 @@ bptree_iterate(objset_t *os, uint64_t obj, boolean_t free, bptree_itor_t func,
|
|||||||
/* save bookmark for future resume */
|
/* save bookmark for future resume */
|
||||||
ASSERT3U(bte.be_zb.zb_objset, ==,
|
ASSERT3U(bte.be_zb.zb_objset, ==,
|
||||||
ZB_DESTROYED_OBJSET);
|
ZB_DESTROYED_OBJSET);
|
||||||
ASSERT3U(bte.be_zb.zb_level, ==, 0);
|
ASSERT0(bte.be_zb.zb_level);
|
||||||
dmu_write(os, obj, i * sizeof (bte),
|
dmu_write(os, obj, i * sizeof (bte),
|
||||||
sizeof (bte), &bte, tx);
|
sizeof (bte), &bte, tx);
|
||||||
break;
|
break;
|
||||||
@ -214,9 +214,9 @@ bptree_iterate(objset_t *os, uint64_t obj, boolean_t free, bptree_itor_t func,
|
|||||||
|
|
||||||
/* if all blocks are free there should be no used space */
|
/* if all blocks are free there should be no used space */
|
||||||
if (ba.ba_phys->bt_begin == ba.ba_phys->bt_end) {
|
if (ba.ba_phys->bt_begin == ba.ba_phys->bt_end) {
|
||||||
ASSERT3U(ba.ba_phys->bt_bytes, ==, 0);
|
ASSERT0(ba.ba_phys->bt_bytes);
|
||||||
ASSERT3U(ba.ba_phys->bt_comp, ==, 0);
|
ASSERT0(ba.ba_phys->bt_comp);
|
||||||
ASSERT3U(ba.ba_phys->bt_uncomp, ==, 0);
|
ASSERT0(ba.ba_phys->bt_uncomp);
|
||||||
}
|
}
|
||||||
|
|
||||||
dmu_buf_rele(db, FTAG);
|
dmu_buf_rele(db, FTAG);
|
||||||
|
@ -328,7 +328,7 @@ dbuf_verify(dmu_buf_impl_t *db)
|
|||||||
} else if (db->db_blkid == DMU_SPILL_BLKID) {
|
} else if (db->db_blkid == DMU_SPILL_BLKID) {
|
||||||
ASSERT(dn != NULL);
|
ASSERT(dn != NULL);
|
||||||
ASSERT3U(db->db.db_size, >=, dn->dn_bonuslen);
|
ASSERT3U(db->db.db_size, >=, dn->dn_bonuslen);
|
||||||
ASSERT3U(db->db.db_offset, ==, 0);
|
ASSERT0(db->db.db_offset);
|
||||||
} else {
|
} else {
|
||||||
ASSERT3U(db->db.db_offset, ==, db->db_blkid * db->db.db_size);
|
ASSERT3U(db->db.db_offset, ==, db->db_blkid * db->db.db_size);
|
||||||
}
|
}
|
||||||
@ -2308,7 +2308,7 @@ dbuf_sync_leaf(dbuf_dirty_record_t *dr, dmu_tx_t *tx)
|
|||||||
dbuf_dirty_record_t **drp;
|
dbuf_dirty_record_t **drp;
|
||||||
|
|
||||||
ASSERT(*datap != NULL);
|
ASSERT(*datap != NULL);
|
||||||
ASSERT3U(db->db_level, ==, 0);
|
ASSERT0(db->db_level);
|
||||||
ASSERT3U(dn->dn_phys->dn_bonuslen, <=, DN_MAX_BONUSLEN);
|
ASSERT3U(dn->dn_phys->dn_bonuslen, <=, DN_MAX_BONUSLEN);
|
||||||
bcopy(*datap, DN_BONUS(dn->dn_phys), dn->dn_phys->dn_bonuslen);
|
bcopy(*datap, DN_BONUS(dn->dn_phys), dn->dn_phys->dn_bonuslen);
|
||||||
DB_DNODE_EXIT(db);
|
DB_DNODE_EXIT(db);
|
||||||
@ -2511,7 +2511,7 @@ dbuf_write_done(zio_t *zio, arc_buf_t *buf, void *vdb)
|
|||||||
uint64_t txg = zio->io_txg;
|
uint64_t txg = zio->io_txg;
|
||||||
dbuf_dirty_record_t **drp, *dr;
|
dbuf_dirty_record_t **drp, *dr;
|
||||||
|
|
||||||
ASSERT3U(zio->io_error, ==, 0);
|
ASSERT0(zio->io_error);
|
||||||
ASSERT(db->db_blkptr == bp);
|
ASSERT(db->db_blkptr == bp);
|
||||||
|
|
||||||
if (zio->io_flags & ZIO_FLAG_IO_REWRITE) {
|
if (zio->io_flags & ZIO_FLAG_IO_REWRITE) {
|
||||||
|
@ -59,7 +59,7 @@ dump_bytes(dmu_sendarg_t *dsp, void *buf, int len)
|
|||||||
dsl_dataset_t *ds = dsp->dsa_os->os_dsl_dataset;
|
dsl_dataset_t *ds = dsp->dsa_os->os_dsl_dataset;
|
||||||
struct uio auio;
|
struct uio auio;
|
||||||
struct iovec aiov;
|
struct iovec aiov;
|
||||||
ASSERT3U(len % 8, ==, 0);
|
ASSERT0(len % 8);
|
||||||
|
|
||||||
fletcher_4_incremental_native(buf, len, &dsp->dsa_zc);
|
fletcher_4_incremental_native(buf, len, &dsp->dsa_zc);
|
||||||
aiov.iov_base = buf;
|
aiov.iov_base = buf;
|
||||||
@ -1004,7 +1004,7 @@ restore_read(struct restorearg *ra, int len)
|
|||||||
int done = 0;
|
int done = 0;
|
||||||
|
|
||||||
/* some things will require 8-byte alignment, so everything must */
|
/* some things will require 8-byte alignment, so everything must */
|
||||||
ASSERT3U(len % 8, ==, 0);
|
ASSERT0(len % 8);
|
||||||
|
|
||||||
while (done < len) {
|
while (done < len) {
|
||||||
ssize_t resid;
|
ssize_t resid;
|
||||||
@ -1679,7 +1679,7 @@ dmu_recv_existing_end(dmu_recv_cookie_t *drc)
|
|||||||
(void) add_ds_to_guidmap(drc->drc_guid_to_ds_map, ds);
|
(void) add_ds_to_guidmap(drc->drc_guid_to_ds_map, ds);
|
||||||
dsl_dataset_disown(ds, dmu_recv_tag);
|
dsl_dataset_disown(ds, dmu_recv_tag);
|
||||||
myerr = dsl_dataset_destroy(drc->drc_real_ds, dmu_recv_tag, B_FALSE);
|
myerr = dsl_dataset_destroy(drc->drc_real_ds, dmu_recv_tag, B_FALSE);
|
||||||
ASSERT3U(myerr, ==, 0);
|
ASSERT0(myerr);
|
||||||
return (err);
|
return (err);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -176,7 +176,7 @@ static void
|
|||||||
traverse_pause(traverse_data_t *td, const zbookmark_t *zb)
|
traverse_pause(traverse_data_t *td, const zbookmark_t *zb)
|
||||||
{
|
{
|
||||||
ASSERT(td->td_resume != NULL);
|
ASSERT(td->td_resume != NULL);
|
||||||
ASSERT3U(zb->zb_level, ==, 0);
|
ASSERT0(zb->zb_level);
|
||||||
bcopy(zb, td->td_resume, sizeof (*td->td_resume));
|
bcopy(zb, td->td_resume, sizeof (*td->td_resume));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -911,7 +911,7 @@ dmu_tx_try_assign(dmu_tx_t *tx, uint64_t txg_how)
|
|||||||
uint64_t memory, asize, fsize, usize;
|
uint64_t memory, asize, fsize, usize;
|
||||||
uint64_t towrite, tofree, tooverwrite, tounref, tohold, fudge;
|
uint64_t towrite, tofree, tooverwrite, tounref, tohold, fudge;
|
||||||
|
|
||||||
ASSERT3U(tx->tx_txg, ==, 0);
|
ASSERT0(tx->tx_txg);
|
||||||
|
|
||||||
if (tx->tx_err)
|
if (tx->tx_err)
|
||||||
return (tx->tx_err);
|
return (tx->tx_err);
|
||||||
|
@ -140,32 +140,32 @@ dnode_dest(void *arg, void *unused)
|
|||||||
ASSERT(!list_link_active(&dn->dn_dirty_link[i]));
|
ASSERT(!list_link_active(&dn->dn_dirty_link[i]));
|
||||||
avl_destroy(&dn->dn_ranges[i]);
|
avl_destroy(&dn->dn_ranges[i]);
|
||||||
list_destroy(&dn->dn_dirty_records[i]);
|
list_destroy(&dn->dn_dirty_records[i]);
|
||||||
ASSERT3U(dn->dn_next_nblkptr[i], ==, 0);
|
ASSERT0(dn->dn_next_nblkptr[i]);
|
||||||
ASSERT3U(dn->dn_next_nlevels[i], ==, 0);
|
ASSERT0(dn->dn_next_nlevels[i]);
|
||||||
ASSERT3U(dn->dn_next_indblkshift[i], ==, 0);
|
ASSERT0(dn->dn_next_indblkshift[i]);
|
||||||
ASSERT3U(dn->dn_next_bonustype[i], ==, 0);
|
ASSERT0(dn->dn_next_bonustype[i]);
|
||||||
ASSERT3U(dn->dn_rm_spillblk[i], ==, 0);
|
ASSERT0(dn->dn_rm_spillblk[i]);
|
||||||
ASSERT3U(dn->dn_next_bonuslen[i], ==, 0);
|
ASSERT0(dn->dn_next_bonuslen[i]);
|
||||||
ASSERT3U(dn->dn_next_blksz[i], ==, 0);
|
ASSERT0(dn->dn_next_blksz[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
ASSERT3U(dn->dn_allocated_txg, ==, 0);
|
ASSERT0(dn->dn_allocated_txg);
|
||||||
ASSERT3U(dn->dn_free_txg, ==, 0);
|
ASSERT0(dn->dn_free_txg);
|
||||||
ASSERT3U(dn->dn_assigned_txg, ==, 0);
|
ASSERT0(dn->dn_assigned_txg);
|
||||||
ASSERT3U(dn->dn_dirtyctx, ==, 0);
|
ASSERT0(dn->dn_dirtyctx);
|
||||||
ASSERT3P(dn->dn_dirtyctx_firstset, ==, NULL);
|
ASSERT3P(dn->dn_dirtyctx_firstset, ==, NULL);
|
||||||
ASSERT3P(dn->dn_bonus, ==, NULL);
|
ASSERT3P(dn->dn_bonus, ==, NULL);
|
||||||
ASSERT(!dn->dn_have_spill);
|
ASSERT(!dn->dn_have_spill);
|
||||||
ASSERT3P(dn->dn_zio, ==, NULL);
|
ASSERT3P(dn->dn_zio, ==, NULL);
|
||||||
ASSERT3U(dn->dn_oldused, ==, 0);
|
ASSERT0(dn->dn_oldused);
|
||||||
ASSERT3U(dn->dn_oldflags, ==, 0);
|
ASSERT0(dn->dn_oldflags);
|
||||||
ASSERT3U(dn->dn_olduid, ==, 0);
|
ASSERT0(dn->dn_olduid);
|
||||||
ASSERT3U(dn->dn_oldgid, ==, 0);
|
ASSERT0(dn->dn_oldgid);
|
||||||
ASSERT3U(dn->dn_newuid, ==, 0);
|
ASSERT0(dn->dn_newuid);
|
||||||
ASSERT3U(dn->dn_newgid, ==, 0);
|
ASSERT0(dn->dn_newgid);
|
||||||
ASSERT3U(dn->dn_id_flags, ==, 0);
|
ASSERT0(dn->dn_id_flags);
|
||||||
|
|
||||||
ASSERT3U(dn->dn_dbufs_count, ==, 0);
|
ASSERT0(dn->dn_dbufs_count);
|
||||||
list_destroy(&dn->dn_dbufs);
|
list_destroy(&dn->dn_dbufs);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -364,7 +364,7 @@ dnode_rm_spill(dnode_t *dn, dmu_tx_t *tx)
|
|||||||
static void
|
static void
|
||||||
dnode_setdblksz(dnode_t *dn, int size)
|
dnode_setdblksz(dnode_t *dn, int size)
|
||||||
{
|
{
|
||||||
ASSERT3U(P2PHASE(size, SPA_MINBLOCKSIZE), ==, 0);
|
ASSERT0(P2PHASE(size, SPA_MINBLOCKSIZE));
|
||||||
ASSERT3U(size, <=, SPA_MAXBLOCKSIZE);
|
ASSERT3U(size, <=, SPA_MAXBLOCKSIZE);
|
||||||
ASSERT3U(size, >=, SPA_MINBLOCKSIZE);
|
ASSERT3U(size, >=, SPA_MINBLOCKSIZE);
|
||||||
ASSERT3U(size >> SPA_MINBLOCKSHIFT, <,
|
ASSERT3U(size >> SPA_MINBLOCKSHIFT, <,
|
||||||
@ -509,24 +509,24 @@ dnode_allocate(dnode_t *dn, dmu_object_type_t ot, int blocksize, int ibs,
|
|||||||
ASSERT(DMU_OT_IS_VALID(bonustype));
|
ASSERT(DMU_OT_IS_VALID(bonustype));
|
||||||
ASSERT3U(bonuslen, <=, DN_MAX_BONUSLEN);
|
ASSERT3U(bonuslen, <=, DN_MAX_BONUSLEN);
|
||||||
ASSERT(dn->dn_type == DMU_OT_NONE);
|
ASSERT(dn->dn_type == DMU_OT_NONE);
|
||||||
ASSERT3U(dn->dn_maxblkid, ==, 0);
|
ASSERT0(dn->dn_maxblkid);
|
||||||
ASSERT3U(dn->dn_allocated_txg, ==, 0);
|
ASSERT0(dn->dn_allocated_txg);
|
||||||
ASSERT3U(dn->dn_assigned_txg, ==, 0);
|
ASSERT0(dn->dn_assigned_txg);
|
||||||
ASSERT(refcount_is_zero(&dn->dn_tx_holds));
|
ASSERT(refcount_is_zero(&dn->dn_tx_holds));
|
||||||
ASSERT3U(refcount_count(&dn->dn_holds), <=, 1);
|
ASSERT3U(refcount_count(&dn->dn_holds), <=, 1);
|
||||||
ASSERT3P(list_head(&dn->dn_dbufs), ==, NULL);
|
ASSERT3P(list_head(&dn->dn_dbufs), ==, NULL);
|
||||||
|
|
||||||
for (i = 0; i < TXG_SIZE; i++) {
|
for (i = 0; i < TXG_SIZE; i++) {
|
||||||
ASSERT3U(dn->dn_next_nblkptr[i], ==, 0);
|
ASSERT0(dn->dn_next_nblkptr[i]);
|
||||||
ASSERT3U(dn->dn_next_nlevels[i], ==, 0);
|
ASSERT0(dn->dn_next_nlevels[i]);
|
||||||
ASSERT3U(dn->dn_next_indblkshift[i], ==, 0);
|
ASSERT0(dn->dn_next_indblkshift[i]);
|
||||||
ASSERT3U(dn->dn_next_bonuslen[i], ==, 0);
|
ASSERT0(dn->dn_next_bonuslen[i]);
|
||||||
ASSERT3U(dn->dn_next_bonustype[i], ==, 0);
|
ASSERT0(dn->dn_next_bonustype[i]);
|
||||||
ASSERT3U(dn->dn_rm_spillblk[i], ==, 0);
|
ASSERT0(dn->dn_rm_spillblk[i]);
|
||||||
ASSERT3U(dn->dn_next_blksz[i], ==, 0);
|
ASSERT0(dn->dn_next_blksz[i]);
|
||||||
ASSERT(!list_link_active(&dn->dn_dirty_link[i]));
|
ASSERT(!list_link_active(&dn->dn_dirty_link[i]));
|
||||||
ASSERT3P(list_head(&dn->dn_dirty_records[i]), ==, NULL);
|
ASSERT3P(list_head(&dn->dn_dirty_records[i]), ==, NULL);
|
||||||
ASSERT3U(avl_numnodes(&dn->dn_ranges[i]), ==, 0);
|
ASSERT0(avl_numnodes(&dn->dn_ranges[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
dn->dn_type = ot;
|
dn->dn_type = ot;
|
||||||
@ -568,7 +568,7 @@ dnode_reallocate(dnode_t *dn, dmu_object_type_t ot, int blocksize,
|
|||||||
|
|
||||||
ASSERT3U(blocksize, >=, SPA_MINBLOCKSIZE);
|
ASSERT3U(blocksize, >=, SPA_MINBLOCKSIZE);
|
||||||
ASSERT3U(blocksize, <=, SPA_MAXBLOCKSIZE);
|
ASSERT3U(blocksize, <=, SPA_MAXBLOCKSIZE);
|
||||||
ASSERT3U(blocksize % SPA_MINBLOCKSIZE, ==, 0);
|
ASSERT0(blocksize % SPA_MINBLOCKSIZE);
|
||||||
ASSERT(dn->dn_object != DMU_META_DNODE_OBJECT || dmu_tx_private_ok(tx));
|
ASSERT(dn->dn_object != DMU_META_DNODE_OBJECT || dmu_tx_private_ok(tx));
|
||||||
ASSERT(tx->tx_txg != 0);
|
ASSERT(tx->tx_txg != 0);
|
||||||
ASSERT((bonustype == DMU_OT_NONE && bonuslen == 0) ||
|
ASSERT((bonustype == DMU_OT_NONE && bonuslen == 0) ||
|
||||||
@ -1240,9 +1240,9 @@ dnode_setdirty(dnode_t *dn, dmu_tx_t *tx)
|
|||||||
|
|
||||||
ASSERT(!refcount_is_zero(&dn->dn_holds) || list_head(&dn->dn_dbufs));
|
ASSERT(!refcount_is_zero(&dn->dn_holds) || list_head(&dn->dn_dbufs));
|
||||||
ASSERT(dn->dn_datablksz != 0);
|
ASSERT(dn->dn_datablksz != 0);
|
||||||
ASSERT3U(dn->dn_next_bonuslen[txg&TXG_MASK], ==, 0);
|
ASSERT0(dn->dn_next_bonuslen[txg&TXG_MASK]);
|
||||||
ASSERT3U(dn->dn_next_blksz[txg&TXG_MASK], ==, 0);
|
ASSERT0(dn->dn_next_blksz[txg&TXG_MASK]);
|
||||||
ASSERT3U(dn->dn_next_bonustype[txg&TXG_MASK], ==, 0);
|
ASSERT0(dn->dn_next_bonustype[txg&TXG_MASK]);
|
||||||
|
|
||||||
dprintf_ds(os->os_dsl_dataset, "obj=%llu txg=%llu\n",
|
dprintf_ds(os->os_dsl_dataset, "obj=%llu txg=%llu\n",
|
||||||
dn->dn_object, txg);
|
dn->dn_object, txg);
|
||||||
@ -1592,7 +1592,7 @@ dnode_free_range(dnode_t *dn, uint64_t off, uint64_t len, dmu_tx_t *tx)
|
|||||||
else
|
else
|
||||||
tail = P2PHASE(len, blksz);
|
tail = P2PHASE(len, blksz);
|
||||||
|
|
||||||
ASSERT3U(P2PHASE(off, blksz), ==, 0);
|
ASSERT0(P2PHASE(off, blksz));
|
||||||
/* zero out any partial block data at the end of the range */
|
/* zero out any partial block data at the end of the range */
|
||||||
if (tail) {
|
if (tail) {
|
||||||
if (len < tail)
|
if (len < tail)
|
||||||
@ -1774,7 +1774,7 @@ dnode_diduse_space(dnode_t *dn, int64_t delta)
|
|||||||
space += delta;
|
space += delta;
|
||||||
if (spa_version(dn->dn_objset->os_spa) < SPA_VERSION_DNODE_BYTES) {
|
if (spa_version(dn->dn_objset->os_spa) < SPA_VERSION_DNODE_BYTES) {
|
||||||
ASSERT((dn->dn_phys->dn_flags & DNODE_FLAG_USED_BYTES) == 0);
|
ASSERT((dn->dn_phys->dn_flags & DNODE_FLAG_USED_BYTES) == 0);
|
||||||
ASSERT3U(P2PHASE(space, 1<<DEV_BSHIFT), ==, 0);
|
ASSERT0(P2PHASE(space, 1<<DEV_BSHIFT));
|
||||||
dn->dn_phys->dn_used = space >> DEV_BSHIFT;
|
dn->dn_phys->dn_used = space >> DEV_BSHIFT;
|
||||||
} else {
|
} else {
|
||||||
dn->dn_phys->dn_used = space;
|
dn->dn_phys->dn_used = space;
|
||||||
|
@ -274,7 +274,7 @@ free_children(dmu_buf_impl_t *db, uint64_t blkid, uint64_t nblks, int trunc,
|
|||||||
continue;
|
continue;
|
||||||
rw_enter(&dn->dn_struct_rwlock, RW_READER);
|
rw_enter(&dn->dn_struct_rwlock, RW_READER);
|
||||||
err = dbuf_hold_impl(dn, db->db_level-1, i, TRUE, FTAG, &subdb);
|
err = dbuf_hold_impl(dn, db->db_level-1, i, TRUE, FTAG, &subdb);
|
||||||
ASSERT3U(err, ==, 0);
|
ASSERT0(err);
|
||||||
rw_exit(&dn->dn_struct_rwlock);
|
rw_exit(&dn->dn_struct_rwlock);
|
||||||
|
|
||||||
if (free_children(subdb, blkid, nblks, trunc, tx) == ALL) {
|
if (free_children(subdb, blkid, nblks, trunc, tx) == ALL) {
|
||||||
@ -294,7 +294,7 @@ free_children(dmu_buf_impl_t *db, uint64_t blkid, uint64_t nblks, int trunc,
|
|||||||
continue;
|
continue;
|
||||||
else if (i == end && !trunc)
|
else if (i == end && !trunc)
|
||||||
continue;
|
continue;
|
||||||
ASSERT3U(bp->blk_birth, ==, 0);
|
ASSERT0(bp->blk_birth);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
ASSERT(all || blocks_freed == 0 || db->db_last_dirty);
|
ASSERT(all || blocks_freed == 0 || db->db_last_dirty);
|
||||||
@ -350,7 +350,7 @@ dnode_sync_free_range(dnode_t *dn, uint64_t blkid, uint64_t nblks, dmu_tx_t *tx)
|
|||||||
continue;
|
continue;
|
||||||
rw_enter(&dn->dn_struct_rwlock, RW_READER);
|
rw_enter(&dn->dn_struct_rwlock, RW_READER);
|
||||||
err = dbuf_hold_impl(dn, dnlevel-1, i, TRUE, FTAG, &db);
|
err = dbuf_hold_impl(dn, dnlevel-1, i, TRUE, FTAG, &db);
|
||||||
ASSERT3U(err, ==, 0);
|
ASSERT0(err);
|
||||||
rw_exit(&dn->dn_struct_rwlock);
|
rw_exit(&dn->dn_struct_rwlock);
|
||||||
|
|
||||||
if (free_children(db, blkid, nblks, trunc, tx) == ALL) {
|
if (free_children(db, blkid, nblks, trunc, tx) == ALL) {
|
||||||
@ -474,7 +474,7 @@ dnode_sync_free(dnode_t *dn, dmu_tx_t *tx)
|
|||||||
* Our contents should have been freed in dnode_sync() by the
|
* Our contents should have been freed in dnode_sync() by the
|
||||||
* free range record inserted by the caller of dnode_free().
|
* free range record inserted by the caller of dnode_free().
|
||||||
*/
|
*/
|
||||||
ASSERT3U(DN_USED_BYTES(dn->dn_phys), ==, 0);
|
ASSERT0(DN_USED_BYTES(dn->dn_phys));
|
||||||
ASSERT(BP_IS_HOLE(dn->dn_phys->dn_blkptr));
|
ASSERT(BP_IS_HOLE(dn->dn_phys->dn_blkptr));
|
||||||
|
|
||||||
dnode_undirty_dbufs(&dn->dn_dirty_records[txgoff]);
|
dnode_undirty_dbufs(&dn->dn_dirty_records[txgoff]);
|
||||||
|
@ -1549,7 +1549,7 @@ remove_from_next_clones(dsl_dataset_t *ds, uint64_t obj, dmu_tx_t *tx)
|
|||||||
* remove this one.
|
* remove this one.
|
||||||
*/
|
*/
|
||||||
if (err != ENOENT) {
|
if (err != ENOENT) {
|
||||||
VERIFY3U(err, ==, 0);
|
VERIFY0(err);
|
||||||
}
|
}
|
||||||
ASSERT3U(0, ==, zap_count(mos, ds->ds_phys->ds_next_clones_obj,
|
ASSERT3U(0, ==, zap_count(mos, ds->ds_phys->ds_next_clones_obj,
|
||||||
&count));
|
&count));
|
||||||
@ -1636,7 +1636,7 @@ process_old_deadlist(dsl_dataset_t *ds, dsl_dataset_t *ds_prev,
|
|||||||
poa.pio = zio_root(dp->dp_spa, NULL, NULL, ZIO_FLAG_MUSTSUCCEED);
|
poa.pio = zio_root(dp->dp_spa, NULL, NULL, ZIO_FLAG_MUSTSUCCEED);
|
||||||
VERIFY3U(0, ==, bpobj_iterate(&ds_next->ds_deadlist.dl_bpobj,
|
VERIFY3U(0, ==, bpobj_iterate(&ds_next->ds_deadlist.dl_bpobj,
|
||||||
process_old_cb, &poa, tx));
|
process_old_cb, &poa, tx));
|
||||||
VERIFY3U(zio_wait(poa.pio), ==, 0);
|
VERIFY0(zio_wait(poa.pio));
|
||||||
ASSERT3U(poa.used, ==, ds->ds_phys->ds_unique_bytes);
|
ASSERT3U(poa.used, ==, ds->ds_phys->ds_unique_bytes);
|
||||||
|
|
||||||
/* change snapused */
|
/* change snapused */
|
||||||
@ -1671,7 +1671,7 @@ old_synchronous_dataset_destroy(dsl_dataset_t *ds, dmu_tx_t *tx)
|
|||||||
err = traverse_dataset(ds,
|
err = traverse_dataset(ds,
|
||||||
ds->ds_phys->ds_prev_snap_txg, TRAVERSE_POST,
|
ds->ds_phys->ds_prev_snap_txg, TRAVERSE_POST,
|
||||||
kill_blkptr, &ka);
|
kill_blkptr, &ka);
|
||||||
ASSERT3U(err, ==, 0);
|
ASSERT0(err);
|
||||||
ASSERT(!DS_UNIQUE_IS_ACCURATE(ds) || ds->ds_phys->ds_unique_bytes == 0);
|
ASSERT(!DS_UNIQUE_IS_ACCURATE(ds) || ds->ds_phys->ds_unique_bytes == 0);
|
||||||
|
|
||||||
return (err);
|
return (err);
|
||||||
@ -1723,7 +1723,7 @@ dsl_dataset_destroy_sync(void *arg1, void *tag, dmu_tx_t *tx)
|
|||||||
psa.psa_effective_value = 0; /* predict default value */
|
psa.psa_effective_value = 0; /* predict default value */
|
||||||
|
|
||||||
dsl_dataset_set_reservation_sync(ds, &psa, tx);
|
dsl_dataset_set_reservation_sync(ds, &psa, tx);
|
||||||
ASSERT3U(ds->ds_reserved, ==, 0);
|
ASSERT0(ds->ds_reserved);
|
||||||
}
|
}
|
||||||
|
|
||||||
ASSERT(RW_WRITE_HELD(&dp->dp_config_rwlock));
|
ASSERT(RW_WRITE_HELD(&dp->dp_config_rwlock));
|
||||||
@ -1990,7 +1990,7 @@ dsl_dataset_destroy_sync(void *arg1, void *tag, dmu_tx_t *tx)
|
|||||||
|
|
||||||
err = dsl_dataset_snap_lookup(ds_head,
|
err = dsl_dataset_snap_lookup(ds_head,
|
||||||
ds->ds_snapname, &val);
|
ds->ds_snapname, &val);
|
||||||
ASSERT3U(err, ==, 0);
|
ASSERT0(err);
|
||||||
ASSERT3U(val, ==, obj);
|
ASSERT3U(val, ==, obj);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -2497,14 +2497,14 @@ dsl_dataset_snapshot_rename_sync(void *arg1, void *arg2, dmu_tx_t *tx)
|
|||||||
|
|
||||||
VERIFY(0 == dsl_dataset_get_snapname(ds));
|
VERIFY(0 == dsl_dataset_get_snapname(ds));
|
||||||
err = dsl_dataset_snap_remove(hds, ds->ds_snapname, tx);
|
err = dsl_dataset_snap_remove(hds, ds->ds_snapname, tx);
|
||||||
ASSERT3U(err, ==, 0);
|
ASSERT0(err);
|
||||||
dsl_dataset_name(ds, oldname);
|
dsl_dataset_name(ds, oldname);
|
||||||
mutex_enter(&ds->ds_lock);
|
mutex_enter(&ds->ds_lock);
|
||||||
(void) strcpy(ds->ds_snapname, newsnapname);
|
(void) strcpy(ds->ds_snapname, newsnapname);
|
||||||
mutex_exit(&ds->ds_lock);
|
mutex_exit(&ds->ds_lock);
|
||||||
err = zap_add(mos, hds->ds_phys->ds_snapnames_zapobj,
|
err = zap_add(mos, hds->ds_phys->ds_snapnames_zapobj,
|
||||||
ds->ds_snapname, 8, 1, &ds->ds_object, tx);
|
ds->ds_snapname, 8, 1, &ds->ds_object, tx);
|
||||||
ASSERT3U(err, ==, 0);
|
ASSERT0(err);
|
||||||
dsl_dataset_name(ds, newname);
|
dsl_dataset_name(ds, newname);
|
||||||
#ifdef _KERNEL
|
#ifdef _KERNEL
|
||||||
zvol_rename_minors(oldname, newname);
|
zvol_rename_minors(oldname, newname);
|
||||||
@ -2962,7 +2962,7 @@ dsl_dataset_promote_sync(void *arg1, void *arg2, dmu_tx_t *tx)
|
|||||||
zap_cursor_fini(&zc);
|
zap_cursor_fini(&zc);
|
||||||
}
|
}
|
||||||
|
|
||||||
ASSERT3U(dsl_prop_numcb(ds), ==, 0);
|
ASSERT0(dsl_prop_numcb(ds));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -503,10 +503,10 @@ dsl_dir_destroy_sync(void *arg1, void *tag, dmu_tx_t *tx)
|
|||||||
|
|
||||||
dsl_dir_set_reservation_sync(ds, &psa, tx);
|
dsl_dir_set_reservation_sync(ds, &psa, tx);
|
||||||
|
|
||||||
ASSERT3U(dd->dd_phys->dd_used_bytes, ==, 0);
|
ASSERT0(dd->dd_phys->dd_used_bytes);
|
||||||
ASSERT3U(dd->dd_phys->dd_reserved, ==, 0);
|
ASSERT0(dd->dd_phys->dd_reserved);
|
||||||
for (t = 0; t < DD_USED_NUM; t++)
|
for (t = 0; t < DD_USED_NUM; t++)
|
||||||
ASSERT3U(dd->dd_phys->dd_used_breakdown[t], ==, 0);
|
ASSERT0(dd->dd_phys->dd_used_breakdown[t]);
|
||||||
|
|
||||||
VERIFY(0 == zap_destroy(mos, dd->dd_phys->dd_child_dir_zapobj, tx));
|
VERIFY(0 == zap_destroy(mos, dd->dd_phys->dd_child_dir_zapobj, tx));
|
||||||
VERIFY(0 == zap_destroy(mos, dd->dd_phys->dd_props_zapobj, tx));
|
VERIFY(0 == zap_destroy(mos, dd->dd_phys->dd_props_zapobj, tx));
|
||||||
@ -595,7 +595,7 @@ dsl_dir_sync(dsl_dir_t *dd, dmu_tx_t *tx)
|
|||||||
ASSERT(dmu_tx_is_syncing(tx));
|
ASSERT(dmu_tx_is_syncing(tx));
|
||||||
|
|
||||||
mutex_enter(&dd->dd_lock);
|
mutex_enter(&dd->dd_lock);
|
||||||
ASSERT3U(dd->dd_tempreserved[tx->tx_txg&TXG_MASK], ==, 0);
|
ASSERT0(dd->dd_tempreserved[tx->tx_txg&TXG_MASK]);
|
||||||
dprintf_dd(dd, "txg=%llu towrite=%lluK\n", tx->tx_txg,
|
dprintf_dd(dd, "txg=%llu towrite=%lluK\n", tx->tx_txg,
|
||||||
dd->dd_space_towrite[tx->tx_txg&TXG_MASK] / 1024);
|
dd->dd_space_towrite[tx->tx_txg&TXG_MASK] / 1024);
|
||||||
dd->dd_space_towrite[tx->tx_txg&TXG_MASK] = 0;
|
dd->dd_space_towrite[tx->tx_txg&TXG_MASK] = 0;
|
||||||
@ -1330,7 +1330,7 @@ dsl_dir_rename_sync(void *arg1, void *arg2, dmu_tx_t *tx)
|
|||||||
dsl_dir_name(dd, oldname);
|
dsl_dir_name(dd, oldname);
|
||||||
err = zap_remove(mos, dd->dd_parent->dd_phys->dd_child_dir_zapobj,
|
err = zap_remove(mos, dd->dd_parent->dd_phys->dd_child_dir_zapobj,
|
||||||
dd->dd_myname, tx);
|
dd->dd_myname, tx);
|
||||||
ASSERT3U(err, ==, 0);
|
ASSERT0(err);
|
||||||
|
|
||||||
(void) strcpy(dd->dd_myname, ra->mynewname);
|
(void) strcpy(dd->dd_myname, ra->mynewname);
|
||||||
dsl_dir_close(dd->dd_parent, dd);
|
dsl_dir_close(dd->dd_parent, dd);
|
||||||
@ -1341,7 +1341,7 @@ dsl_dir_rename_sync(void *arg1, void *arg2, dmu_tx_t *tx)
|
|||||||
/* add to new parent zapobj */
|
/* add to new parent zapobj */
|
||||||
err = zap_add(mos, ra->newparent->dd_phys->dd_child_dir_zapobj,
|
err = zap_add(mos, ra->newparent->dd_phys->dd_child_dir_zapobj,
|
||||||
dd->dd_myname, 8, 1, &dd->dd_object, tx);
|
dd->dd_myname, 8, 1, &dd->dd_object, tx);
|
||||||
ASSERT3U(err, ==, 0);
|
ASSERT0(err);
|
||||||
dsl_dir_name(dd, newname);
|
dsl_dir_name(dd, newname);
|
||||||
#ifdef _KERNEL
|
#ifdef _KERNEL
|
||||||
zfsvfs_update_fromname(oldname, newname);
|
zfsvfs_update_fromname(oldname, newname);
|
||||||
|
@ -289,7 +289,7 @@ dsl_pool_create(spa_t *spa, nvlist_t *zplprops, uint64_t txg)
|
|||||||
/* create the pool directory */
|
/* create the pool directory */
|
||||||
err = zap_create_claim(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT,
|
err = zap_create_claim(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT,
|
||||||
DMU_OT_OBJECT_DIRECTORY, DMU_OT_NONE, 0, tx);
|
DMU_OT_OBJECT_DIRECTORY, DMU_OT_NONE, 0, tx);
|
||||||
ASSERT3U(err, ==, 0);
|
ASSERT0(err);
|
||||||
|
|
||||||
/* Initialize scan structures */
|
/* Initialize scan structures */
|
||||||
VERIFY3U(0, ==, dsl_scan_init(dp, txg));
|
VERIFY3U(0, ==, dsl_scan_init(dp, txg));
|
||||||
|
@ -161,7 +161,7 @@ dsl_sync_task_group_sync(dsl_sync_task_group_t *dstg, dmu_tx_t *tx)
|
|||||||
dsl_pool_t *dp = dstg->dstg_pool;
|
dsl_pool_t *dp = dstg->dstg_pool;
|
||||||
uint64_t quota, used;
|
uint64_t quota, used;
|
||||||
|
|
||||||
ASSERT3U(dstg->dstg_err, ==, 0);
|
ASSERT0(dstg->dstg_err);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check for sufficient space. We just check against what's
|
* Check for sufficient space. We just check against what's
|
||||||
|
@ -775,7 +775,7 @@ metaslab_fini(metaslab_t *msp)
|
|||||||
for (int t = 0; t < TXG_DEFER_SIZE; t++)
|
for (int t = 0; t < TXG_DEFER_SIZE; t++)
|
||||||
space_map_destroy(&msp->ms_defermap[t]);
|
space_map_destroy(&msp->ms_defermap[t]);
|
||||||
|
|
||||||
ASSERT3S(msp->ms_deferspace, ==, 0);
|
ASSERT0(msp->ms_deferspace);
|
||||||
|
|
||||||
mutex_exit(&msp->ms_lock);
|
mutex_exit(&msp->ms_lock);
|
||||||
mutex_destroy(&msp->ms_lock);
|
mutex_destroy(&msp->ms_lock);
|
||||||
|
@ -5080,7 +5080,7 @@ spa_vdev_remove_evacuate(spa_t *spa, vdev_t *vd)
|
|||||||
* The evacuation succeeded. Remove any remaining MOS metadata
|
* The evacuation succeeded. Remove any remaining MOS metadata
|
||||||
* associated with this vdev, and wait for these changes to sync.
|
* associated with this vdev, and wait for these changes to sync.
|
||||||
*/
|
*/
|
||||||
ASSERT3U(vd->vdev_stat.vs_alloc, ==, 0);
|
ASSERT0(vd->vdev_stat.vs_alloc);
|
||||||
txg = spa_vdev_config_enter(spa);
|
txg = spa_vdev_config_enter(spa);
|
||||||
vd->vdev_removing = B_TRUE;
|
vd->vdev_removing = B_TRUE;
|
||||||
vdev_dirty(vd, 0, NULL, txg);
|
vdev_dirty(vd, 0, NULL, txg);
|
||||||
@ -6073,7 +6073,7 @@ spa_sync(spa_t *spa, uint64_t txg)
|
|||||||
zio_t *zio = zio_root(spa, NULL, NULL, 0);
|
zio_t *zio = zio_root(spa, NULL, NULL, 0);
|
||||||
VERIFY3U(bpobj_iterate(defer_bpo,
|
VERIFY3U(bpobj_iterate(defer_bpo,
|
||||||
spa_free_sync_cb, zio, tx), ==, 0);
|
spa_free_sync_cb, zio, tx), ==, 0);
|
||||||
VERIFY3U(zio_wait(zio), ==, 0);
|
VERIFY0(zio_wait(zio));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -22,6 +22,9 @@
|
|||||||
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
|
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
|
||||||
* Use is subject to license terms.
|
* Use is subject to license terms.
|
||||||
*/
|
*/
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||||
|
*/
|
||||||
|
|
||||||
#include <sys/zfs_context.h>
|
#include <sys/zfs_context.h>
|
||||||
#include <sys/spa.h>
|
#include <sys/spa.h>
|
||||||
@ -80,7 +83,7 @@ void
|
|||||||
space_map_destroy(space_map_t *sm)
|
space_map_destroy(space_map_t *sm)
|
||||||
{
|
{
|
||||||
ASSERT(!sm->sm_loaded && !sm->sm_loading);
|
ASSERT(!sm->sm_loaded && !sm->sm_loading);
|
||||||
VERIFY3U(sm->sm_space, ==, 0);
|
VERIFY0(sm->sm_space);
|
||||||
avl_destroy(&sm->sm_root);
|
avl_destroy(&sm->sm_root);
|
||||||
cv_destroy(&sm->sm_load_cv);
|
cv_destroy(&sm->sm_load_cv);
|
||||||
}
|
}
|
||||||
@ -309,7 +312,7 @@ space_map_load(space_map_t *sm, space_map_ops_t *ops, uint8_t maptype,
|
|||||||
space = smo->smo_alloc;
|
space = smo->smo_alloc;
|
||||||
|
|
||||||
ASSERT(sm->sm_ops == NULL);
|
ASSERT(sm->sm_ops == NULL);
|
||||||
VERIFY3U(sm->sm_space, ==, 0);
|
VERIFY0(sm->sm_space);
|
||||||
|
|
||||||
if (maptype == SM_FREE) {
|
if (maptype == SM_FREE) {
|
||||||
space_map_add(sm, sm->sm_start, sm->sm_size);
|
space_map_add(sm, sm->sm_start, sm->sm_size);
|
||||||
@ -498,7 +501,7 @@ space_map_sync(space_map_t *sm, uint8_t maptype,
|
|||||||
|
|
||||||
zio_buf_free(entry_map, bufsize);
|
zio_buf_free(entry_map, bufsize);
|
||||||
|
|
||||||
VERIFY3U(sm->sm_space, ==, 0);
|
VERIFY0(sm->sm_space);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -597,9 +597,9 @@ vdev_free(vdev_t *vd)
|
|||||||
metaslab_group_destroy(vd->vdev_mg);
|
metaslab_group_destroy(vd->vdev_mg);
|
||||||
}
|
}
|
||||||
|
|
||||||
ASSERT3U(vd->vdev_stat.vs_space, ==, 0);
|
ASSERT0(vd->vdev_stat.vs_space);
|
||||||
ASSERT3U(vd->vdev_stat.vs_dspace, ==, 0);
|
ASSERT0(vd->vdev_stat.vs_dspace);
|
||||||
ASSERT3U(vd->vdev_stat.vs_alloc, ==, 0);
|
ASSERT0(vd->vdev_stat.vs_alloc);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Remove this vdev from its parent's child list.
|
* Remove this vdev from its parent's child list.
|
||||||
@ -1806,7 +1806,7 @@ vdev_dtl_sync(vdev_t *vd, uint64_t txg)
|
|||||||
if (vd->vdev_detached) {
|
if (vd->vdev_detached) {
|
||||||
if (smo->smo_object != 0) {
|
if (smo->smo_object != 0) {
|
||||||
int err = dmu_object_free(mos, smo->smo_object, tx);
|
int err = dmu_object_free(mos, smo->smo_object, tx);
|
||||||
ASSERT3U(err, ==, 0);
|
ASSERT0(err);
|
||||||
smo->smo_object = 0;
|
smo->smo_object = 0;
|
||||||
}
|
}
|
||||||
dmu_tx_commit(tx);
|
dmu_tx_commit(tx);
|
||||||
@ -2006,7 +2006,7 @@ vdev_remove(vdev_t *vd, uint64_t txg)
|
|||||||
tx = dmu_tx_create_assigned(spa_get_dsl(spa), txg);
|
tx = dmu_tx_create_assigned(spa_get_dsl(spa), txg);
|
||||||
|
|
||||||
if (vd->vdev_dtl_smo.smo_object) {
|
if (vd->vdev_dtl_smo.smo_object) {
|
||||||
ASSERT3U(vd->vdev_dtl_smo.smo_alloc, ==, 0);
|
ASSERT0(vd->vdev_dtl_smo.smo_alloc);
|
||||||
(void) dmu_object_free(mos, vd->vdev_dtl_smo.smo_object, tx);
|
(void) dmu_object_free(mos, vd->vdev_dtl_smo.smo_object, tx);
|
||||||
vd->vdev_dtl_smo.smo_object = 0;
|
vd->vdev_dtl_smo.smo_object = 0;
|
||||||
}
|
}
|
||||||
@ -2018,7 +2018,7 @@ vdev_remove(vdev_t *vd, uint64_t txg)
|
|||||||
if (msp == NULL || msp->ms_smo.smo_object == 0)
|
if (msp == NULL || msp->ms_smo.smo_object == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ASSERT3U(msp->ms_smo.smo_alloc, ==, 0);
|
ASSERT0(msp->ms_smo.smo_alloc);
|
||||||
(void) dmu_object_free(mos, msp->ms_smo.smo_object, tx);
|
(void) dmu_object_free(mos, msp->ms_smo.smo_object, tx);
|
||||||
msp->ms_smo.smo_object = 0;
|
msp->ms_smo.smo_object = 0;
|
||||||
}
|
}
|
||||||
@ -2296,7 +2296,7 @@ vdev_offline_locked(spa_t *spa, uint64_t guid, uint64_t flags)
|
|||||||
(void) spa_vdev_state_exit(spa, vd, 0);
|
(void) spa_vdev_state_exit(spa, vd, 0);
|
||||||
goto top;
|
goto top;
|
||||||
}
|
}
|
||||||
ASSERT3U(tvd->vdev_stat.vs_alloc, ==, 0);
|
ASSERT0(tvd->vdev_stat.vs_alloc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -281,7 +281,7 @@ vdev_raidz_map_free_vsd(zio_t *zio)
|
|||||||
{
|
{
|
||||||
raidz_map_t *rm = zio->io_vsd;
|
raidz_map_t *rm = zio->io_vsd;
|
||||||
|
|
||||||
ASSERT3U(rm->rm_freed, ==, 0);
|
ASSERT0(rm->rm_freed);
|
||||||
rm->rm_freed = 1;
|
rm->rm_freed = 1;
|
||||||
|
|
||||||
if (rm->rm_reports == 0)
|
if (rm->rm_reports == 0)
|
||||||
@ -1134,7 +1134,7 @@ vdev_raidz_matrix_invert(raidz_map_t *rm, int n, int nmissing, int *missing,
|
|||||||
*/
|
*/
|
||||||
for (i = 0; i < nmissing; i++) {
|
for (i = 0; i < nmissing; i++) {
|
||||||
for (j = 0; j < missing[i]; j++) {
|
for (j = 0; j < missing[i]; j++) {
|
||||||
ASSERT3U(rows[i][j], ==, 0);
|
ASSERT0(rows[i][j]);
|
||||||
}
|
}
|
||||||
ASSERT3U(rows[i][missing[i]], !=, 0);
|
ASSERT3U(rows[i][missing[i]], !=, 0);
|
||||||
|
|
||||||
@ -1175,7 +1175,7 @@ vdev_raidz_matrix_invert(raidz_map_t *rm, int n, int nmissing, int *missing,
|
|||||||
if (j == missing[i]) {
|
if (j == missing[i]) {
|
||||||
ASSERT3U(rows[i][j], ==, 1);
|
ASSERT3U(rows[i][j], ==, 1);
|
||||||
} else {
|
} else {
|
||||||
ASSERT3U(rows[i][j], ==, 0);
|
ASSERT0(rows[i][j]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -162,7 +162,7 @@ zap_table_grow(zap_t *zap, zap_table_phys_t *tbl,
|
|||||||
} else {
|
} else {
|
||||||
newblk = zap_allocate_blocks(zap, tbl->zt_numblks * 2);
|
newblk = zap_allocate_blocks(zap, tbl->zt_numblks * 2);
|
||||||
tbl->zt_nextblk = newblk;
|
tbl->zt_nextblk = newblk;
|
||||||
ASSERT3U(tbl->zt_blks_copied, ==, 0);
|
ASSERT0(tbl->zt_blks_copied);
|
||||||
dmu_prefetch(zap->zap_objset, zap->zap_object,
|
dmu_prefetch(zap->zap_objset, zap->zap_object,
|
||||||
tbl->zt_blk << bs, tbl->zt_numblks << bs);
|
tbl->zt_blk << bs, tbl->zt_numblks << bs);
|
||||||
}
|
}
|
||||||
@ -339,7 +339,7 @@ zap_grow_ptrtbl(zap_t *zap, dmu_tx_t *tx)
|
|||||||
|
|
||||||
ASSERT3U(zap->zap_f.zap_phys->zap_ptrtbl.zt_shift, ==,
|
ASSERT3U(zap->zap_f.zap_phys->zap_ptrtbl.zt_shift, ==,
|
||||||
ZAP_EMBEDDED_PTRTBL_SHIFT(zap));
|
ZAP_EMBEDDED_PTRTBL_SHIFT(zap));
|
||||||
ASSERT3U(zap->zap_f.zap_phys->zap_ptrtbl.zt_blk, ==, 0);
|
ASSERT0(zap->zap_f.zap_phys->zap_ptrtbl.zt_blk);
|
||||||
|
|
||||||
newblk = zap_allocate_blocks(zap, 1);
|
newblk = zap_allocate_blocks(zap, 1);
|
||||||
err = dmu_buf_hold(zap->zap_objset, zap->zap_object,
|
err = dmu_buf_hold(zap->zap_objset, zap->zap_object,
|
||||||
@ -475,7 +475,7 @@ zap_open_leaf(uint64_t blkid, dmu_buf_t *db)
|
|||||||
* chain. There should be no chained leafs (as we have removed
|
* chain. There should be no chained leafs (as we have removed
|
||||||
* support for them).
|
* support for them).
|
||||||
*/
|
*/
|
||||||
ASSERT3U(l->l_phys->l_hdr.lh_pad1, ==, 0);
|
ASSERT0(l->l_phys->l_hdr.lh_pad1);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* There should be more hash entries than there can be
|
* There should be more hash entries than there can be
|
||||||
@ -658,9 +658,9 @@ zap_expand_leaf(zap_name_t *zn, zap_leaf_t *l, dmu_tx_t *tx, zap_leaf_t **lp)
|
|||||||
zap_leaf_split(l, nl, zap->zap_normflags != 0);
|
zap_leaf_split(l, nl, zap->zap_normflags != 0);
|
||||||
|
|
||||||
/* set sibling pointers */
|
/* set sibling pointers */
|
||||||
for (i = 0; i < (1ULL<<prefix_diff); i++) {
|
for (i = 0; i < (1ULL << prefix_diff); i++) {
|
||||||
err = zap_set_idx_to_blk(zap, sibling+i, nl->l_blkid, tx);
|
err = zap_set_idx_to_blk(zap, sibling+i, nl->l_blkid, tx);
|
||||||
ASSERT3U(err, ==, 0); /* we checked for i/o errors above */
|
ASSERT0(err); /* we checked for i/o errors above */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hash & (1ULL << (64 - l->l_phys->l_hdr.lh_prefix_len))) {
|
if (hash & (1ULL << (64 - l->l_phys->l_hdr.lh_prefix_len))) {
|
||||||
|
@ -517,7 +517,7 @@ zap_lockdir(objset_t *os, uint64_t obj, dmu_tx_t *tx,
|
|||||||
return (mzap_upgrade(zapp, tx, 0));
|
return (mzap_upgrade(zapp, tx, 0));
|
||||||
}
|
}
|
||||||
err = dmu_object_set_blocksize(os, obj, newsz, 0, tx);
|
err = dmu_object_set_blocksize(os, obj, newsz, 0, tx);
|
||||||
ASSERT3U(err, ==, 0);
|
ASSERT0(err);
|
||||||
zap->zap_m.zap_num_chunks =
|
zap->zap_m.zap_num_chunks =
|
||||||
db->db_size / MZAP_ENT_LEN - 1;
|
db->db_size / MZAP_ENT_LEN - 1;
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/zfs_context.h>
|
#include <sys/zfs_context.h>
|
||||||
@ -48,12 +49,12 @@ zfs_dbgmsg_fini(void)
|
|||||||
zfs_dbgmsg_size -= size;
|
zfs_dbgmsg_size -= size;
|
||||||
}
|
}
|
||||||
mutex_destroy(&zfs_dbgmsgs_lock);
|
mutex_destroy(&zfs_dbgmsgs_lock);
|
||||||
ASSERT3U(zfs_dbgmsg_size, ==, 0);
|
ASSERT0(zfs_dbgmsg_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Print these messages by running:
|
* Print these messages by running:
|
||||||
* echo ::zfs_dbgmsg | mdb -k
|
* echo ::zfs_dbgmsg | mdb -k
|
||||||
*
|
*
|
||||||
* Monitor these messages by running:
|
* Monitor these messages by running:
|
||||||
* dtrace -q -n 'zfs-dbgmsg{printf("%s\n", stringof(arg0))}'
|
* dtrace -q -n 'zfs-dbgmsg{printf("%s\n", stringof(arg0))}'
|
||||||
|
@ -1817,7 +1817,7 @@ zfs_ioc_objset_stats_impl(zfs_cmd_t *zc, objset_t *os)
|
|||||||
error = zvol_get_stats(os, nv);
|
error = zvol_get_stats(os, nv);
|
||||||
if (error == EIO)
|
if (error == EIO)
|
||||||
return (error);
|
return (error);
|
||||||
VERIFY3S(error, ==, 0);
|
VERIFY0(error);
|
||||||
}
|
}
|
||||||
error = put_nvlist(zc, nv);
|
error = put_nvlist(zc, nv);
|
||||||
nvlist_free(nv);
|
nvlist_free(nv);
|
||||||
|
@ -22,6 +22,9 @@
|
|||||||
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
|
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
|
||||||
* Use is subject to license terms.
|
* Use is subject to license terms.
|
||||||
*/
|
*/
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file contains the code to implement file range locking in
|
* This file contains the code to implement file range locking in
|
||||||
@ -481,9 +484,9 @@ zfs_range_unlock_reader(znode_t *zp, rl_t *remove)
|
|||||||
cv_destroy(&remove->r_rd_cv);
|
cv_destroy(&remove->r_rd_cv);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ASSERT3U(remove->r_cnt, ==, 0);
|
ASSERT0(remove->r_cnt);
|
||||||
ASSERT3U(remove->r_write_wanted, ==, 0);
|
ASSERT0(remove->r_write_wanted);
|
||||||
ASSERT3U(remove->r_read_wanted, ==, 0);
|
ASSERT0(remove->r_read_wanted);
|
||||||
/*
|
/*
|
||||||
* Find start proxy representing this reader lock,
|
* Find start proxy representing this reader lock,
|
||||||
* then decrement ref count on all proxies
|
* then decrement ref count on all proxies
|
||||||
|
@ -2362,7 +2362,7 @@ zfs_set_version(zfsvfs_t *zfsvfs, uint64_t newvers)
|
|||||||
|
|
||||||
error = zap_add(os, MASTER_NODE_OBJ,
|
error = zap_add(os, MASTER_NODE_OBJ,
|
||||||
ZFS_SA_ATTRS, 8, 1, &sa_obj, tx);
|
ZFS_SA_ATTRS, 8, 1, &sa_obj, tx);
|
||||||
ASSERT3U(error, ==, 0);
|
ASSERT0(error);
|
||||||
|
|
||||||
VERIFY(0 == sa_set_sa_object(os, sa_obj));
|
VERIFY(0 == sa_set_sa_object(os, sa_obj));
|
||||||
sa_register_update_callback(os, zfs_sa_upgrade);
|
sa_register_update_callback(os, zfs_sa_upgrade);
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Portions Copyright 2007 Jeremy Teo */
|
/* Portions Copyright 2007 Jeremy Teo */
|
||||||
@ -1850,7 +1851,7 @@ zfs_remove(vnode_t *dvp, char *name, cred_t *cr, caller_context_t *ct,
|
|||||||
&xattr_obj, sizeof (xattr_obj));
|
&xattr_obj, sizeof (xattr_obj));
|
||||||
if (error == 0 && xattr_obj) {
|
if (error == 0 && xattr_obj) {
|
||||||
error = zfs_zget(zfsvfs, xattr_obj, &xzp);
|
error = zfs_zget(zfsvfs, xattr_obj, &xzp);
|
||||||
ASSERT3U(error, ==, 0);
|
ASSERT0(error);
|
||||||
dmu_tx_hold_sa(tx, zp->z_sa_hdl, B_TRUE);
|
dmu_tx_hold_sa(tx, zp->z_sa_hdl, B_TRUE);
|
||||||
dmu_tx_hold_sa(tx, xzp->z_sa_hdl, B_FALSE);
|
dmu_tx_hold_sa(tx, xzp->z_sa_hdl, B_FALSE);
|
||||||
}
|
}
|
||||||
@ -1928,11 +1929,11 @@ zfs_remove(vnode_t *dvp, char *name, cred_t *cr, caller_context_t *ct,
|
|||||||
error = sa_update(zp->z_sa_hdl,
|
error = sa_update(zp->z_sa_hdl,
|
||||||
SA_ZPL_XATTR(zfsvfs), &null_xattr,
|
SA_ZPL_XATTR(zfsvfs), &null_xattr,
|
||||||
sizeof (uint64_t), tx);
|
sizeof (uint64_t), tx);
|
||||||
ASSERT3U(error, ==, 0);
|
ASSERT0(error);
|
||||||
}
|
}
|
||||||
VI_LOCK(vp);
|
VI_LOCK(vp);
|
||||||
vp->v_count--;
|
vp->v_count--;
|
||||||
ASSERT3U(vp->v_count, ==, 0);
|
ASSERT0(vp->v_count);
|
||||||
VI_UNLOCK(vp);
|
VI_UNLOCK(vp);
|
||||||
mutex_exit(&zp->z_lock);
|
mutex_exit(&zp->z_lock);
|
||||||
zfs_znode_delete(zp, tx);
|
zfs_znode_delete(zp, tx);
|
||||||
@ -3368,7 +3369,7 @@ zfs_setattr(vnode_t *vp, vattr_t *vap, int flags, cred_t *cr,
|
|||||||
zp->z_mode = new_mode;
|
zp->z_mode = new_mode;
|
||||||
ASSERT3U((uintptr_t)aclp, !=, 0);
|
ASSERT3U((uintptr_t)aclp, !=, 0);
|
||||||
err = zfs_aclset_common(zp, aclp, cr, tx);
|
err = zfs_aclset_common(zp, aclp, cr, tx);
|
||||||
ASSERT3U(err, ==, 0);
|
ASSERT0(err);
|
||||||
if (zp->z_acl_cached)
|
if (zp->z_acl_cached)
|
||||||
zfs_acl_free(zp->z_acl_cached);
|
zfs_acl_free(zp->z_acl_cached);
|
||||||
zp->z_acl_cached = aclp;
|
zp->z_acl_cached = aclp;
|
||||||
@ -3896,7 +3897,7 @@ zfs_rename(vnode_t *sdvp, char *snm, vnode_t *tdvp, char *tnm, cred_t *cr,
|
|||||||
|
|
||||||
error = sa_update(szp->z_sa_hdl, SA_ZPL_FLAGS(zfsvfs),
|
error = sa_update(szp->z_sa_hdl, SA_ZPL_FLAGS(zfsvfs),
|
||||||
(void *)&szp->z_pflags, sizeof (uint64_t), tx);
|
(void *)&szp->z_pflags, sizeof (uint64_t), tx);
|
||||||
ASSERT3U(error, ==, 0);
|
ASSERT0(error);
|
||||||
|
|
||||||
error = zfs_link_destroy(sdl, szp, tx, ZRENAMING, NULL);
|
error = zfs_link_destroy(sdl, szp, tx, ZRENAMING, NULL);
|
||||||
if (error == 0) {
|
if (error == 0) {
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Portions Copyright 2007 Jeremy Teo */
|
/* Portions Copyright 2007 Jeremy Teo */
|
||||||
@ -836,7 +837,7 @@ zfs_mknode(znode_t *dzp, vattr_t *vap, dmu_tx_t *tx, cred_t *cr,
|
|||||||
err = zap_create_claim_norm(zfsvfs->z_os, obj,
|
err = zap_create_claim_norm(zfsvfs->z_os, obj,
|
||||||
zfsvfs->z_norm, DMU_OT_DIRECTORY_CONTENTS,
|
zfsvfs->z_norm, DMU_OT_DIRECTORY_CONTENTS,
|
||||||
obj_type, bonuslen, tx);
|
obj_type, bonuslen, tx);
|
||||||
ASSERT3U(err, ==, 0);
|
ASSERT0(err);
|
||||||
} else {
|
} else {
|
||||||
obj = zap_create_norm(zfsvfs->z_os,
|
obj = zap_create_norm(zfsvfs->z_os,
|
||||||
zfsvfs->z_norm, DMU_OT_DIRECTORY_CONTENTS,
|
zfsvfs->z_norm, DMU_OT_DIRECTORY_CONTENTS,
|
||||||
@ -847,7 +848,7 @@ zfs_mknode(znode_t *dzp, vattr_t *vap, dmu_tx_t *tx, cred_t *cr,
|
|||||||
err = dmu_object_claim(zfsvfs->z_os, obj,
|
err = dmu_object_claim(zfsvfs->z_os, obj,
|
||||||
DMU_OT_PLAIN_FILE_CONTENTS, 0,
|
DMU_OT_PLAIN_FILE_CONTENTS, 0,
|
||||||
obj_type, bonuslen, tx);
|
obj_type, bonuslen, tx);
|
||||||
ASSERT3U(err, ==, 0);
|
ASSERT0(err);
|
||||||
} else {
|
} else {
|
||||||
obj = dmu_object_alloc(zfsvfs->z_os,
|
obj = dmu_object_alloc(zfsvfs->z_os,
|
||||||
DMU_OT_PLAIN_FILE_CONTENTS, 0,
|
DMU_OT_PLAIN_FILE_CONTENTS, 0,
|
||||||
@ -1029,7 +1030,7 @@ zfs_mknode(znode_t *dzp, vattr_t *vap, dmu_tx_t *tx, cred_t *cr,
|
|||||||
if (obj_type == DMU_OT_ZNODE ||
|
if (obj_type == DMU_OT_ZNODE ||
|
||||||
acl_ids->z_aclp->z_version < ZFS_ACL_VERSION_FUID) {
|
acl_ids->z_aclp->z_version < ZFS_ACL_VERSION_FUID) {
|
||||||
err = zfs_aclset_common(*zpp, acl_ids->z_aclp, cr, tx);
|
err = zfs_aclset_common(*zpp, acl_ids->z_aclp, cr, tx);
|
||||||
ASSERT3P(err, ==, 0);
|
ASSERT0(err);
|
||||||
}
|
}
|
||||||
if (!(flag & IS_ROOT_NODE)) {
|
if (!(flag & IS_ROOT_NODE)) {
|
||||||
vnode_t *vp;
|
vnode_t *vp;
|
||||||
@ -1525,7 +1526,7 @@ zfs_grow_blocksize(znode_t *zp, uint64_t size, dmu_tx_t *tx)
|
|||||||
|
|
||||||
if (error == ENOTSUP)
|
if (error == ENOTSUP)
|
||||||
return;
|
return;
|
||||||
ASSERT3U(error, ==, 0);
|
ASSERT0(error);
|
||||||
|
|
||||||
/* What blocksize did we actually get? */
|
/* What blocksize did we actually get? */
|
||||||
dmu_object_size_from_db(sa_get_db(zp->z_sa_hdl), &zp->z_blksz, &dummy);
|
dmu_object_size_from_db(sa_get_db(zp->z_sa_hdl), &zp->z_blksz, &dummy);
|
||||||
|
@ -1109,7 +1109,7 @@ zil_lwb_commit(zilog_t *zilog, itx_t *itx, lwb_t *lwb)
|
|||||||
lwb->lwb_nused += reclen + dlen;
|
lwb->lwb_nused += reclen + dlen;
|
||||||
lwb->lwb_max_txg = MAX(lwb->lwb_max_txg, txg);
|
lwb->lwb_max_txg = MAX(lwb->lwb_max_txg, txg);
|
||||||
ASSERT3U(lwb->lwb_nused, <=, lwb->lwb_sz);
|
ASSERT3U(lwb->lwb_nused, <=, lwb->lwb_sz);
|
||||||
ASSERT3U(P2PHASE(lwb->lwb_nused, sizeof (uint64_t)), ==, 0);
|
ASSERT0(P2PHASE(lwb->lwb_nused, sizeof (uint64_t)));
|
||||||
|
|
||||||
return (lwb);
|
return (lwb);
|
||||||
}
|
}
|
||||||
|
@ -2171,7 +2171,7 @@ zio_dva_allocate(zio_t *zio)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ASSERT(BP_IS_HOLE(bp));
|
ASSERT(BP_IS_HOLE(bp));
|
||||||
ASSERT3U(BP_GET_NDVAS(bp), ==, 0);
|
ASSERT0(BP_GET_NDVAS(bp));
|
||||||
ASSERT3U(zio->io_prop.zp_copies, >, 0);
|
ASSERT3U(zio->io_prop.zp_copies, >, 0);
|
||||||
ASSERT3U(zio->io_prop.zp_copies, <=, spa_max_replication(spa));
|
ASSERT3U(zio->io_prop.zp_copies, <=, spa_max_replication(spa));
|
||||||
ASSERT3U(zio->io_size, ==, BP_GET_PSIZE(bp));
|
ASSERT3U(zio->io_size, ==, BP_GET_PSIZE(bp));
|
||||||
|
@ -21,7 +21,10 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
|
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
|
||||||
* Use is subject to license terms.
|
* Use is subject to license terms.
|
||||||
* Copyright 2012 Martin Matuska <mm@FreeBSD.org>. All rights reserved.
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2012 by Delphix. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
|
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
|
||||||
@ -32,9 +35,6 @@
|
|||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/note.h>
|
#include <sys/note.h>
|
||||||
#ifdef _KERNEL
|
|
||||||
#include <sys/systm.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -117,14 +117,18 @@ _NOTE(CONSTCOND) } while (0)
|
|||||||
#define VERIFY3S(x, y, z) VERIFY3_IMPL(x, y, z, int64_t)
|
#define VERIFY3S(x, y, z) VERIFY3_IMPL(x, y, z, int64_t)
|
||||||
#define VERIFY3U(x, y, z) VERIFY3_IMPL(x, y, z, uint64_t)
|
#define VERIFY3U(x, y, z) VERIFY3_IMPL(x, y, z, uint64_t)
|
||||||
#define VERIFY3P(x, y, z) VERIFY3_IMPL(x, y, z, uintptr_t)
|
#define VERIFY3P(x, y, z) VERIFY3_IMPL(x, y, z, uintptr_t)
|
||||||
|
#define VERIFY0(x) VERIFY3_IMPL(x, ==, 0, uintmax_t)
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
#define ASSERT3S(x, y, z) VERIFY3_IMPL(x, y, z, int64_t)
|
#define ASSERT3S(x, y, z) VERIFY3_IMPL(x, y, z, int64_t)
|
||||||
#define ASSERT3U(x, y, z) VERIFY3_IMPL(x, y, z, uint64_t)
|
#define ASSERT3U(x, y, z) VERIFY3_IMPL(x, y, z, uint64_t)
|
||||||
#define ASSERT3P(x, y, z) VERIFY3_IMPL(x, y, z, uintptr_t)
|
#define ASSERT3P(x, y, z) VERIFY3_IMPL(x, y, z, uintptr_t)
|
||||||
|
#define ASSERT0(x) VERIFY3_IMPL(x, ==, 0, uintmax_t)
|
||||||
#else
|
#else
|
||||||
#define ASSERT3S(x, y, z) ((void)0)
|
#define ASSERT3S(x, y, z) ((void)0)
|
||||||
#define ASSERT3U(x, y, z) ((void)0)
|
#define ASSERT3U(x, y, z) ((void)0)
|
||||||
#define ASSERT3P(x, y, z) ((void)0)
|
#define ASSERT3P(x, y, z) ((void)0)
|
||||||
|
#define ASSERT0(x) ((void)0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _KERNEL
|
#ifdef _KERNEL
|
||||||
|
Loading…
Reference in New Issue
Block a user