#include <sys/arc.h>
#include <sys/ddt.h>
#undef ZFS_MAXNAMELEN
-#undef verify
#include <libzfs.h>
#define ZDB_COMPRESS_NAME(idx) ((idx) < ZIO_COMPRESS_FUNCTIONS ? \
* debugging facilities.
*/
const char *
-_umem_debug_init()
+_umem_debug_init(void)
{
return ("default,verbose"); /* $UMEM_DEBUG setting */
}
sa_attr_type_t *sa_attr_table;
static void
-fuid_table_destroy()
+fuid_table_destroy(void)
{
if (fuid_table_loaded) {
zfs_fuid_table_destroy(&idx_tree, &domain_tree);
exit(1);
}
- if (fstat64(fd, &statbuf) != 0) {
+ if (fstat64_blk(fd, &statbuf) != 0) {
(void) printf("failed to stat '%s': %s\n", path,
strerror(errno));
free(path);
exit(1);
}
- if (S_ISBLK(statbuf.st_mode)) {
- (void) printf("cannot use '%s': character device required\n",
- path);
- free(path);
- (void) close(fd);
- exit(1);
- }
-
psize = statbuf.st_size;
psize = P2ALIGN(psize, (uint64_t)sizeof (vdev_label_t));
static int
dump_block_stats(spa_t *spa)
{
- zdb_cb_t zcb = { 0 };
+ zdb_cb_t zcb;
zdb_blkstats_t *zb, *tzb;
uint64_t norm_alloc, norm_space, total_alloc, total_found;
int flags = TRAVERSE_PRE | TRAVERSE_PREFETCH_METADATA | TRAVERSE_HARD;
* it's not part of any space map) is a double allocation,
* reference to a freed block, or an unclaimed log block.
*/
+ bzero(&zcb, sizeof(zdb_cb_t));
zdb_leak_init(spa, &zcb);
/*
avl_tree_t t;
void *cookie = NULL;
zdb_ddt_entry_t *zdde;
- ddt_histogram_t ddh_total = { 0 };
- ddt_stat_t dds_total = { 0 };
+ ddt_histogram_t ddh_total;
+ ddt_stat_t dds_total;
+
+ bzero(&ddh_total, sizeof (ddt_histogram_t));
+ bzero(&dds_total, sizeof (ddt_stat_t));
avl_create(&t, ddt_entry_compare,
sizeof (zdb_ddt_entry_t), offsetof(zdb_ddt_entry_t, zdde_node));
nvlist_t *match = NULL;
char *name = NULL;
char *sepp = NULL;
- char sep;
+ char sep = 0;
int count = 0;
importargs_t args = { 0 };
}
kernel_init(FREAD);
- g_zfs = libzfs_init();
- ASSERT(g_zfs != NULL);
+ if ((g_zfs = libzfs_init()) == NULL)
+ return (1);
if (dump_all)
verbose = MAX(verbose, 1);