summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <jaxboe@fusionio.com>2011-01-26 20:43:50 +0100
committerJens Axboe <jaxboe@fusionio.com>2011-01-26 20:43:50 +0100
commit08987f0e7f255968ed4780ba3a8ed0cb1bb63904 (patch)
treeb50bc1087b0e285d9b0ff3280c8a8a3b88581d28
parent6035e7d6d1ed462176402615da37d4f987588c16 (diff)
downloadfio-08987f0e7f255968ed4780ba3a8ed0cb1bb63904.tar.gz
fio-08987f0e7f255968ed4780ba3a8ed0cb1bb63904.tar.bz2
solaris: char dev size fixes
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
-rw-r--r--os/os-solaris.h26
1 files changed, 23 insertions, 3 deletions
diff --git a/os/os-solaris.h b/os/os-solaris.h
index 3e825436..f93a04c8 100644
--- a/os/os-solaris.h
+++ b/os/os-solaris.h
@@ -6,17 +6,19 @@
#include <sys/types.h>
#include <sys/fcntl.h>
#include <sys/pset.h>
+#include <sys/mman.h>
+#include <sys/dkio.h>
#include "../file.h"
#define FIO_HAVE_POSIXAIO
#define FIO_HAVE_SOLARISAIO
-#define FIO_HAVE_FALLOCATE
#define FIO_HAVE_POSIXAIO_FSYNC
#define FIO_HAVE_CPU_AFFINITY
#define FIO_HAVE_PSHARED_MUTEX
-#define FIO_USE_GENERIC_BDEV_SIZE
#define FIO_HAVE_FDATASYNC
+#define FIO_HAVE_CHARDEV_SIZE
+#define FIO_USE_GENERIC_BDEV_SIZE
#define OS_MAP_ANON MAP_ANON
#define OS_RAND_MAX 2147483648UL
@@ -25,12 +27,30 @@ struct solaris_rand_seed {
unsigned short r[3];
};
+#define posix_madvise madvise
+#define POSIX_MADV_DONTNEED MADV_DONTNEED
+#define POSIX_MADV_SEQUENTIAL MADV_SEQUENTIAL
+#define POSIX_MADV_RANDOM MADV_RANDOM
+
typedef psetid_t os_cpu_mask_t;
typedef struct solaris_rand_seed os_random_state_t;
+static inline int chardev_size(struct fio_file *f, unsigned long long *bytes)
+{
+ struct dk_minfo info;
+
+ *bytes = 0;
+
+ if (ioctl(f->fd, DKIOCGMEDIAINFO, &info) < 0)
+ return errno;
+
+ *bytes = info.dki_lbsize * info.dki_capacity;
+ return 0;
+}
+
static inline int blockdev_invalidate_cache(struct fio_file *f)
{
- return EINVAL;
+ return 0;
}
static inline unsigned long long os_phys_mem(void)