static struct fio_mutex *disk_util_mutex;
-FLIST_HEAD(disk_list);
-
static struct disk_util *__init_per_file_disk_util(struct thread_data *td,
int majdev, int mindev, char *path);
}
fio_mutex_remove(du->lock);
+ free(du->sysfs_root);
sfree(du);
}
dprint(FD_DISKUTIL, "add maj/min %d/%d: %s\n", majdev, mindev, path);
du = smalloc(sizeof(*du));
- if (!du) {
- log_err("fio: smalloc() pool exhausted\n");
+ if (!du)
return NULL;
- }
memset(du, 0, sizeof(*du));
INIT_FLIST_HEAD(&du->list);
return NULL;
}
strncpy((char *) du->dus.name, basename(path), FIO_DU_NAME_SZ - 1);
- du->sysfs_root = path;
+ du->sysfs_root = strdup(path);
du->major = majdev;
du->minor = mindev;
INIT_FLIST_HEAD(&du->slavelist);
sprintf(path, "%s", tmp);
}
- if (td->o.ioscheduler && !td->sysfs_root)
- td->sysfs_root = strdup(path);
-
return disk_util_add(td, majdev, mindev, path);
}
mindev);
du = disk_util_exists(majdev, mindev);
- if (du) {
- if (td->o.ioscheduler && !td->sysfs_root)
- td->sysfs_root = strdup(du->sysfs_root);
-
+ if (du)
return du;
- }
/*
* for an fs without a device, we will repeatedly stat through