Merge commit 'refs/top-bases/linux-configure-branch' into linux-configure-branch

This commit is contained in:
Brian Behlendorf 2010-06-28 11:32:55 -07:00
commit d753fa7a12
8 changed files with 36 additions and 32 deletions

View File

@ -2196,6 +2196,7 @@ dump_block_stats(spa_t *spa)
* it's not part of any space map) is a double allocation, * it's not part of any space map) is a double allocation,
* reference to a freed block, or an unclaimed log block. * reference to a freed block, or an unclaimed log block.
*/ */
bzero(&zcb, sizeof(zdb_cb_t));
zdb_leak_init(spa, &zcb); zdb_leak_init(spa, &zcb);
/* /*

View File

@ -5275,6 +5275,11 @@ ztest_run(ztest_shared_t *zs)
} }
kernel_fini(); 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 static void
@ -5345,12 +5350,8 @@ ztest_freeze(ztest_shared_t *zs)
spa_close(spa, FTAG); spa_close(spa, FTAG);
kernel_fini(); kernel_fini();
list_destroy(&zcl.zcl_callbacks); rw_destroy(&zs->zs_name_lock);
mutex_destroy(&zs->zs_vdev_lock);
(void) mutex_destroy(&zcl.zcl_callbacks_lock);
(void) rw_destroy(&zs->zs_name_lock);
(void) mutex_destroy(&zs->zs_vdev_lock);
} }
void void
@ -5453,6 +5454,7 @@ main(int argc, char **argv)
ztest_random_fd = open("/dev/urandom", O_RDONLY); ztest_random_fd = open("/dev/urandom", O_RDONLY);
dprintf_setup(&argc, argv);
process_options(argc, argv); process_options(argc, argv);
/* Override location of zpool.cache */ /* Override location of zpool.cache */

View File

@ -504,6 +504,7 @@ typedef struct callb_cpr {
#define zone_dataset_visible(x, y) (1) #define zone_dataset_visible(x, y) (1)
#define INGLOBALZONE(z) (1) #define INGLOBALZONE(z) (1)
extern char *kmem_vasprintf(const char *fmt, va_list adx);
extern char *kmem_asprintf(const char *fmt, ...); extern char *kmem_asprintf(const char *fmt, ...);
#define strfree(str) kmem_free((str), strlen(str)+1) #define strfree(str) kmem_free((str), strlen(str)+1)

View File

@ -1120,25 +1120,27 @@ ksiddomain_rele(ksiddomain_t *ksid)
umem_free(ksid, sizeof (ksiddomain_t)); umem_free(ksid, sizeof (ksiddomain_t));
} }
/* char *
* Do not change the length of the returned string; it must be freed kmem_vasprintf(const char *fmt, va_list adx)
* with strfree(). {
*/ 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 * char *
kmem_asprintf(const char *fmt, ...) kmem_asprintf(const char *fmt, ...)
{ {
int size; char *buf = NULL;
va_list adx; va_list adx;
char *buf;
va_start(adx, fmt); va_start(adx, fmt);
size = vsnprintf(NULL, 0, fmt, adx) + 1; VERIFY(vasprintf(&buf, fmt, adx) != -1);
va_end(adx);
buf = kmem_alloc(size, KM_SLEEP);
va_start(adx, fmt);
size = vsnprintf(buf, size, fmt, adx);
va_end(adx); va_end(adx);
return (buf); return (buf);

View File

@ -727,7 +727,7 @@ dmu_write(objset_t *os, uint64_t object, uint64_t offset, uint64_t size,
else else
dmu_buf_will_dirty(db, tx); 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) if (tocpy == db->db_size)
dmu_buf_fill_done(db, tx); dmu_buf_fill_done(db, tx);

View File

@ -432,6 +432,7 @@ log_internal(history_internal_events_t event, spa_t *spa,
dmu_tx_t *tx, const char *fmt, va_list adx) dmu_tx_t *tx, const char *fmt, va_list adx)
{ {
history_arg_t *ha; history_arg_t *ha;
va_list adx_copy;
/* /*
* If this is part of creating a pool, not everything is * 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; return;
ha = kmem_alloc(sizeof (history_arg_t), KM_SLEEP); 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_log_type = LOG_INTERNAL;
ha->ha_event = event; ha->ha_event = event;
ha->ha_zone = NULL; ha->ha_zone = NULL;

View File

@ -234,13 +234,8 @@ kmem_cache_t *spa_buffer_pool;
int spa_mode_global; int spa_mode_global;
#ifdef ZFS_DEBUG #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 */ /* Everything except dprintf is on by default in debug builds */
int zfs_flags = ~ZFS_DEBUG_DPRINTF; int zfs_flags = ~ZFS_DEBUG_DPRINTF;
#endif
#else #else
int zfs_flags = 0; int zfs_flags = 0;
#endif #endif

View File

@ -443,7 +443,7 @@ zpios_dmu_write(run_args_t *run_args, objset_t *os, uint64_t object,
{ {
struct dmu_tx *tx; struct dmu_tx *tx;
int rc, how = TXG_WAIT; int rc, how = TXG_WAIT;
int flags = 0; // int flags = 0;
if (run_args->flags & DMU_WRITE_NOWAIT) if (run_args->flags & DMU_WRITE_NOWAIT)
how = TXG_NOWAIT; how = TXG_NOWAIT;
@ -467,10 +467,10 @@ zpios_dmu_write(run_args_t *run_args, objset_t *os, uint64_t object,
break; break;
} }
if (run_args->flags & DMU_WRITE_ZC) // if (run_args->flags & DMU_WRITE_ZC)
flags |= DMU_WRITE_ZEROCOPY; // 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); dmu_tx_commit(tx);
return 0; return 0;
@ -482,8 +482,8 @@ zpios_dmu_read(run_args_t *run_args, objset_t *os, uint64_t object,
{ {
int flags = 0; int flags = 0;
if (run_args->flags & DMU_READ_ZC) // if (run_args->flags & DMU_READ_ZC)
flags |= DMU_READ_ZEROCOPY; // flags |= DMU_READ_ZEROCOPY;
if (run_args->flags & DMU_READ_NOPF) if (run_args->flags & DMU_READ_NOPF)
flags |= DMU_READ_NO_PREFETCH; flags |= DMU_READ_NO_PREFETCH;