projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add strong madvise() hint for cache pruning
[fio.git]
/
os
/
os-solaris.h
diff --git
a/os/os-solaris.h
b/os/os-solaris.h
index f00aae1089b19380fd05d2f8017facea2847cea5..5029d38f356e5983992bb58ae04cfffa77773a5d 100644
(file)
--- a/
os/os-solaris.h
+++ b/
os/os-solaris.h
@@
-23,12
+23,15
@@
struct solaris_rand_seed {
typedef psetid_t os_cpu_mask_t;
typedef struct solaris_rand_seed os_random_state_t;
typedef psetid_t os_cpu_mask_t;
typedef struct solaris_rand_seed os_random_state_t;
-/*
- * FIXME
- */
static inline int blockdev_size(int fd, unsigned long long *bytes)
{
static inline int blockdev_size(int fd, unsigned long long *bytes)
{
- return EINVAL;
+ off_t end = lseek(fd, 0, SEEK_END);
+
+ if (end < 0)
+ return errno;
+
+ *bytes = end;
+ return 0;
}
static inline int blockdev_invalidate_cache(int fd)
}
static inline int blockdev_invalidate_cache(int fd)
@@
-105,4
+108,8
@@
static inline int fio_cpuset_exit(os_cpu_mask_t *mask)
*/
#define FIO_MAX_CPUS 16384
*/
#define FIO_MAX_CPUS 16384
+#ifdef MADV_FREE
+#define FIO_MADV_FREE MADV_FREE
+#endif
+
#endif
#endif