projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Split mutex.c and .h each into three files
[fio.git]
/
filesetup.c
diff --git
a/filesetup.c
b/filesetup.c
index 30af085d0b33e3eb4ee6fd490fee0a01018d368b..4b0f40d6f9e458071446ab64becf007260188f1e 100644
(file)
--- a/
filesetup.c
+++ b/
filesetup.c
@@
-15,13
+15,12
@@
#include "os/os.h"
#include "hash.h"
#include "lib/axmap.h"
#include "os/os.h"
#include "hash.h"
#include "lib/axmap.h"
+#include "rwlock.h"
#ifdef CONFIG_LINUX_FALLOCATE
#include <linux/falloc.h>
#endif
#ifdef CONFIG_LINUX_FALLOCATE
#include <linux/falloc.h>
#endif
-static int root_warn;
-
static FLIST_HEAD(filename_list);
/*
static FLIST_HEAD(filename_list);
/*
@@
-490,6
+489,10
@@
static int __file_invalidate_cache(struct thread_data *td, struct fio_file *f,
ret = td->io_ops->invalidate(td, f);
if (ret < 0)
errval = -ret;
ret = td->io_ops->invalidate(td, f);
if (ret < 0)
errval = -ret;
+ } else if (td_ioengine_flagged(td, FIO_DISKLESSIO)) {
+ dprint(FD_IO, "invalidate not supported by ioengine %s\n",
+ td->io_ops->name);
+ ret = 0;
} else if (f->filetype == FIO_TYPE_FILE) {
dprint(FD_IO, "declare unneeded cache %s: %llu/%llu\n",
f->file_name, off, len);
} else if (f->filetype == FIO_TYPE_FILE) {
dprint(FD_IO, "declare unneeded cache %s: %llu/%llu\n",
f->file_name, off, len);
@@
-512,10
+515,9
@@
static int __file_invalidate_cache(struct thread_data *td, struct fio_file *f,
ret = blockdev_invalidate_cache(f);
}
if (ret < 0 && errno == EACCES && geteuid()) {
ret = blockdev_invalidate_cache(f);
}
if (ret < 0 && errno == EACCES && geteuid()) {
- if (!
root_warn
) {
+ if (!
fio_did_warn(FIO_WARN_ROOT_FLUSH)
) {
log_err("fio: only root may flush block "
"devices. Cache flush bypassed!\n");
log_err("fio: only root may flush block "
"devices. Cache flush bypassed!\n");
- root_warn = 1;
}
ret = 0;
}
}
ret = 0;
}
@@
-1035,7
+1037,7
@@
int setup_files(struct thread_data *td)
if (f->io_size == -1ULL)
total_size = -1ULL;
else {
if (f->io_size == -1ULL)
total_size = -1ULL;
else {
- if (o->size_percent) {
+ if (o->size_percent
&& o->size_percent != 100
) {
uint64_t file_size;
file_size = f->io_size + f->file_offset;
uint64_t file_size;
file_size = f->io_size + f->file_offset;
@@
-1480,7
+1482,7
@@
static struct fio_file *alloc_new_file(struct thread_data *td)
if (td_ioengine_flagged(td, FIO_NOFILEHASH))
f = calloc(1, sizeof(*f));
else
if (td_ioengine_flagged(td, FIO_NOFILEHASH))
f = calloc(1, sizeof(*f));
else
- f = s
malloc(
sizeof(*f));
+ f = s
calloc(1,
sizeof(*f));
if (!f) {
assert(0);
return NULL;
if (!f) {
assert(0);
return NULL;