projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add completion percentiles to results output
[fio.git]
/
filesetup.c
diff --git
a/filesetup.c
b/filesetup.c
index 8f515923bcf9b25c725c9d9a3e94ed2ecb1711a3..446eeaf0801a2772470bb2a47cde0c5368a67d70 100644
(file)
--- a/
filesetup.c
+++ b/
filesetup.c
@@
-849,11
+849,15
@@
int init_random_map(struct thread_data *td)
(unsigned long long) td->o.rw_min_bs;
num_maps = (blocks + BLOCKS_PER_MAP - 1) /
(unsigned long long) BLOCKS_PER_MAP;
(unsigned long long) td->o.rw_min_bs;
num_maps = (blocks + BLOCKS_PER_MAP - 1) /
(unsigned long long) BLOCKS_PER_MAP;
- f->file_map = smalloc(num_maps * sizeof(unsigned long));
- if (f->file_map) {
- f->num_maps = num_maps;
- continue;
- }
+ if (num_maps == (unsigned long) num_maps) {
+ f->file_map = smalloc(num_maps * sizeof(unsigned long));
+ if (f->file_map) {
+ f->num_maps = num_maps;
+ continue;
+ }
+ } else
+ f->file_map = NULL;
+
if (!td->o.softrandommap) {
log_err("fio: failed allocating random map. If running"
" a large number of jobs, try the 'norandommap'"
if (!td->o.softrandommap) {
log_err("fio: failed allocating random map. If running"
" a large number of jobs, try the 'norandommap'"
@@
-922,10
+926,13
@@
static void get_file_type(struct fio_file *f)
else
f->filetype = FIO_TYPE_FILE;
else
f->filetype = FIO_TYPE_FILE;
+ /* \\.\ is the device namespace in Windows, where every file is
+ * a block device */
+ if (strncmp(f->file_name, "\\\\.\\", 4) == 0)
+ f->filetype = FIO_TYPE_BD;
+
if (!stat(f->file_name, &sb)) {
if (!stat(f->file_name, &sb)) {
- /* \\.\ is the device namespace in Windows, where every file is
- * a block device */
- if (S_ISBLK(sb.st_mode) || strncmp(f->file_name, "\\\\.\\", 4) == 0)
+ if (S_ISBLK(sb.st_mode))
f->filetype = FIO_TYPE_BD;
else if (S_ISCHR(sb.st_mode))
f->filetype = FIO_TYPE_CHAR;
f->filetype = FIO_TYPE_BD;
else if (S_ISCHR(sb.st_mode))
f->filetype = FIO_TYPE_CHAR;
@@
-1134,7
+1141,7
@@
static int recurse_dir(struct thread_data *td, const char *dirname)
if (!strcmp(dir->d_name, ".") || !strcmp(dir->d_name, ".."))
continue;
if (!strcmp(dir->d_name, ".") || !strcmp(dir->d_name, ".."))
continue;
- sprintf(full_path, "%s
/%s", dirname
, dir->d_name);
+ sprintf(full_path, "%s
%s%s", dirname, FIO_OS_PATH_SEPARATOR
, dir->d_name);
if (lstat(full_path, &sb) == -1) {
if (errno != ENOENT) {
if (lstat(full_path, &sb) == -1) {
if (errno != ENOENT) {