Remove useless run_args->regions check which was always true

This commit is contained in:
Brian Behlendorf 2009-02-19 14:35:41 -08:00
parent 5ae73585fb
commit d51fcd107f
1 changed files with 58 additions and 64 deletions

View File

@ -405,14 +405,11 @@ zpios_cleanup_run(run_args_t *run_args)
sizeof(thread_data_t *) * run_args->thread_count); sizeof(thread_data_t *) * run_args->thread_count);
} }
if (run_args->regions != NULL)
for (i = 0; i < run_args->region_count; i++) for (i = 0; i < run_args->region_count; i++)
mutex_destroy(&run_args->regions[i].lock); mutex_destroy(&run_args->regions[i].lock);
mutex_destroy(&run_args->lock_work); mutex_destroy(&run_args->lock_work);
mutex_destroy(&run_args->lock_ctl); mutex_destroy(&run_args->lock_ctl);
if (run_args->regions != NULL)
size = run_args->region_count * sizeof(zpios_region_t); size = run_args->region_count * sizeof(zpios_region_t);
vmem_free(run_args, sizeof(*run_args) + size); vmem_free(run_args, sizeof(*run_args) + size);
@ -475,24 +472,21 @@ zpios_thread_main(void *data)
thread_data_t *thr = (thread_data_t *)data; thread_data_t *thr = (thread_data_t *)data;
run_args_t *run_args = thr->run_args; run_args_t *run_args = thr->run_args;
zpios_time_t t; zpios_time_t t;
dmu_obj_t obj; dmu_obj_t obj;
__u64 offset; __u64 offset;
__u32 chunk_size; __u32 chunk_size;
zpios_region_t *region; zpios_region_t *region;
char *buf; char *buf;
unsigned int random_int; unsigned int random_int;
int chunk_noise = run_args->chunk_noise; int chunk_noise = run_args->chunk_noise;
int chunk_noise_tmp = 0; int chunk_noise_tmp = 0;
int thread_delay = run_args->thread_delay; int thread_delay = run_args->thread_delay;
int thread_delay_tmp = 0; int thread_delay_tmp = 0;
int i, rc = 0; int i, rc = 0;
if (chunk_noise) { if (chunk_noise) {
get_random_bytes(&random_int, sizeof(unsigned int)); get_random_bytes(&random_int, sizeof(unsigned int));
chunk_noise_tmp = (random_int % (chunk_noise * 2)) - chunk_noise; chunk_noise_tmp = (random_int % (chunk_noise * 2))-chunk_noise;
} }
/* It's OK to vmem_alloc() this memory because it will be copied /* It's OK to vmem_alloc() this memory because it will be copied