X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=diskutil.c;h=9fc309563ea55772125f81bd97389d7988cb82fe;hp=92f8caa22238e04908a3b758ade38675b5347fdc;hb=f57a9c59e366aa2f0621aa260bfd5ef5aeb61643;hpb=90b97ac3bc4368b79300207c796bcfbb828d07b9 diff --git a/diskutil.c b/diskutil.c index 92f8caa2..9fc30956 100644 --- a/diskutil.c +++ b/diskutil.c @@ -24,6 +24,14 @@ static void disk_util_free(struct disk_util *du) if (du == last_du) last_du = NULL; + while (!flist_empty(&du->slaves)) { + struct disk_util *slave; + + slave = flist_entry(du->slaves.next, struct disk_util, slavelist); + flist_del(&slave->slavelist); + slave->users--; + } + fio_mutex_remove(du->lock); sfree(du->name); sfree(du); @@ -236,14 +244,16 @@ static void find_add_disk_slaves(struct thread_data *td, char *path, /* Should probably use an assert here. slavedu should * always be present at this point. */ - if (slavedu) + if (slavedu) { + slavedu->users++; flist_add_tail(&slavedu->slavelist, &masterdu->slaves); + } } closedir(dirhandle); } -static struct disk_util *disk_util_add(struct thread_data * td, int majdev, +static struct disk_util *disk_util_add(struct thread_data *td, int majdev, int mindev, char *path) { struct disk_util *du, *__du;