Merge commit 'refs/top-bases/linux-zfs-branch' into linux-zfs-branch
This commit is contained in:
commit
4fa43a86d4
|
@ -2196,6 +2196,7 @@ dump_block_stats(spa_t *spa)
|
|||
* 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);
|
||||
|
||||
/*
|
||||
|
|
|
@ -5275,6 +5275,11 @@ ztest_run(ztest_shared_t *zs)
|
|||
}
|
||||
|
||||
kernel_fini();
|
||||
|
||||
list_destroy(&zcl.zcl_callbacks);
|
||||
mutex_destroy(&zcl.zcl_callbacks_lock);
|
||||
rw_destroy(&zs->zs_name_lock);
|
||||
mutex_destroy(&zs->zs_vdev_lock);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -5345,12 +5350,8 @@ ztest_freeze(ztest_shared_t *zs)
|
|||
spa_close(spa, FTAG);
|
||||
kernel_fini();
|
||||
|
||||
list_destroy(&zcl.zcl_callbacks);
|
||||
|
||||
(void) mutex_destroy(&zcl.zcl_callbacks_lock);
|
||||
|
||||
(void) rw_destroy(&zs->zs_name_lock);
|
||||
(void) mutex_destroy(&zs->zs_vdev_lock);
|
||||
rw_destroy(&zs->zs_name_lock);
|
||||
mutex_destroy(&zs->zs_vdev_lock);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -5453,6 +5454,7 @@ main(int argc, char **argv)
|
|||
|
||||
ztest_random_fd = open("/dev/urandom", O_RDONLY);
|
||||
|
||||
dprintf_setup(&argc, argv);
|
||||
process_options(argc, argv);
|
||||
|
||||
/* Override location of zpool.cache */
|
||||
|
|
|
@ -504,6 +504,7 @@ typedef struct callb_cpr {
|
|||
#define zone_dataset_visible(x, y) (1)
|
||||
#define INGLOBALZONE(z) (1)
|
||||
|
||||
extern char *kmem_vasprintf(const char *fmt, va_list adx);
|
||||
extern char *kmem_asprintf(const char *fmt, ...);
|
||||
#define strfree(str) kmem_free((str), strlen(str)+1)
|
||||
|
||||
|
|
|
@ -1120,25 +1120,27 @@ ksiddomain_rele(ksiddomain_t *ksid)
|
|||
umem_free(ksid, sizeof (ksiddomain_t));
|
||||
}
|
||||
|
||||
/*
|
||||
* Do not change the length of the returned string; it must be freed
|
||||
* with strfree().
|
||||
*/
|
||||
char *
|
||||
kmem_vasprintf(const char *fmt, va_list adx)
|
||||
{
|
||||
char *buf = NULL;
|
||||
va_list adx_copy;
|
||||
|
||||
va_copy(adx_copy, adx);
|
||||
VERIFY(vasprintf(&buf, fmt, adx_copy) != -1);
|
||||
va_end(adx_copy);
|
||||
|
||||
return (buf);
|
||||
}
|
||||
|
||||
char *
|
||||
kmem_asprintf(const char *fmt, ...)
|
||||
{
|
||||
int size;
|
||||
char *buf = NULL;
|
||||
va_list adx;
|
||||
char *buf;
|
||||
|
||||
va_start(adx, fmt);
|
||||
size = vsnprintf(NULL, 0, fmt, adx) + 1;
|
||||
va_end(adx);
|
||||
|
||||
buf = kmem_alloc(size, KM_SLEEP);
|
||||
|
||||
va_start(adx, fmt);
|
||||
size = vsnprintf(buf, size, fmt, adx);
|
||||
VERIFY(vasprintf(&buf, fmt, adx) != -1);
|
||||
va_end(adx);
|
||||
|
||||
return (buf);
|
||||
|
|
|
@ -727,7 +727,7 @@ dmu_write(objset_t *os, uint64_t object, uint64_t offset, uint64_t size,
|
|||
else
|
||||
dmu_buf_will_dirty(db, tx);
|
||||
|
||||
bcopy(buf, (char *)db->db_data + bufoff, tocpy);
|
||||
(void) memcpy((char *)db->db_data + bufoff, buf, tocpy);
|
||||
|
||||
if (tocpy == db->db_size)
|
||||
dmu_buf_fill_done(db, tx);
|
||||
|
|
|
@ -432,6 +432,7 @@ log_internal(history_internal_events_t event, spa_t *spa,
|
|||
dmu_tx_t *tx, const char *fmt, va_list adx)
|
||||
{
|
||||
history_arg_t *ha;
|
||||
va_list adx_copy;
|
||||
|
||||
/*
|
||||
* If this is part of creating a pool, not everything is
|
||||
|
@ -441,7 +442,9 @@ log_internal(history_internal_events_t event, spa_t *spa,
|
|||
return;
|
||||
|
||||
ha = kmem_alloc(sizeof (history_arg_t), KM_SLEEP);
|
||||
ha->ha_history_str = kmem_asprintf(fmt, adx);
|
||||
va_copy(adx_copy, adx);
|
||||
ha->ha_history_str = kmem_vasprintf(fmt, adx_copy);
|
||||
va_end(adx_copy);
|
||||
ha->ha_log_type = LOG_INTERNAL;
|
||||
ha->ha_event = event;
|
||||
ha->ha_zone = NULL;
|
||||
|
|
|
@ -234,13 +234,8 @@ kmem_cache_t *spa_buffer_pool;
|
|||
int spa_mode_global;
|
||||
|
||||
#ifdef ZFS_DEBUG
|
||||
#if defined(_KERNEL) && defined(HAVE_SPL)
|
||||
/* All filtering done by the SPL */
|
||||
int zfs_flags = ~0;
|
||||
#else
|
||||
/* Everything except dprintf is on by default in debug builds */
|
||||
int zfs_flags = ~ZFS_DEBUG_DPRINTF;
|
||||
#endif
|
||||
#else
|
||||
int zfs_flags = 0;
|
||||
#endif
|
||||
|
|
|
@ -443,7 +443,7 @@ zpios_dmu_write(run_args_t *run_args, objset_t *os, uint64_t object,
|
|||
{
|
||||
struct dmu_tx *tx;
|
||||
int rc, how = TXG_WAIT;
|
||||
int flags = 0;
|
||||
// int flags = 0;
|
||||
|
||||
if (run_args->flags & DMU_WRITE_NOWAIT)
|
||||
how = TXG_NOWAIT;
|
||||
|
@ -467,10 +467,10 @@ zpios_dmu_write(run_args_t *run_args, objset_t *os, uint64_t object,
|
|||
break;
|
||||
}
|
||||
|
||||
if (run_args->flags & DMU_WRITE_ZC)
|
||||
flags |= DMU_WRITE_ZEROCOPY;
|
||||
// if (run_args->flags & DMU_WRITE_ZC)
|
||||
// flags |= DMU_WRITE_ZEROCOPY;
|
||||
|
||||
dmu_write_impl(os, object, offset, size, buf, tx, flags);
|
||||
dmu_write(os, object, offset, size, buf, tx);
|
||||
dmu_tx_commit(tx);
|
||||
|
||||
return 0;
|
||||
|
@ -482,8 +482,8 @@ zpios_dmu_read(run_args_t *run_args, objset_t *os, uint64_t object,
|
|||
{
|
||||
int flags = 0;
|
||||
|
||||
if (run_args->flags & DMU_READ_ZC)
|
||||
flags |= DMU_READ_ZEROCOPY;
|
||||
// if (run_args->flags & DMU_READ_ZC)
|
||||
// flags |= DMU_READ_ZEROCOPY;
|
||||
|
||||
if (run_args->flags & DMU_READ_NOPF)
|
||||
flags |= DMU_READ_NO_PREFETCH;
|
||||
|
|
Loading…
Reference in New Issue