Recent changes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The following changes since commit c3d3178b0e14dc1612b397f115d7853200b62146:

  Take __weak out of the compiler namespace (2011-07-10 20:56:23 +0200)

are available in the git repository at:
  git://git.kernel.dk/fio.git master

Jens Axboe (6):
      Fix bug in $mb_memory keyword
      Fill in os_phys_mem() stub for HP-UX
      Remove old debug printf()
      HP-UX disk query size
      HP-UX: has aio_fsync() and fallocate()
      HP-UX: add fdatasync()

 filesetup.c  |    1 -
 options.c    |    2 +-
 os/os-hpux.h |   37 ++++++++++++++++++++++++++-----------
 3 files changed, 27 insertions(+), 13 deletions(-)

---

Diff of recent changes:

diff --git a/filesetup.c b/filesetup.c
index 6d8aa7a..2a79e74 100644
--- a/filesetup.c
+++ b/filesetup.c
@@ -280,7 +280,6 @@ static int bdev_size(struct thread_data *td, struct fio_file *f)
 	r = blockdev_size(f, &bytes);
 	if (r) {
 		td_verror(td, r, "blockdev_size");
-		printf("fd is %d\n", f->fd);
 		goto err;
 	}
 
diff --git a/options.c b/options.c
index f1c0ea7..b4456a4 100644
--- a/options.c
+++ b/options.c
@@ -2091,7 +2091,7 @@ void fio_keywords_init(void)
 	sprintf(buf, "%lu", page_size);
 	fio_keywords[0].replace = strdup(buf);
 
-	mb_memory = os_phys_mem() / page_size;
+	mb_memory = os_phys_mem() / (1024 * 1024);
 	sprintf(buf, "%llu", mb_memory);
 	fio_keywords[1].replace = strdup(buf);
 
diff --git a/os/os-hpux.h b/os/os-hpux.h
index 38a1441..d7397bf 100644
--- a/os/os-hpux.h
+++ b/os/os-hpux.h
@@ -8,7 +8,9 @@
 #include <sys/fadvise.h>
 #include <sys/mman.h>
 #include <sys/mpctl.h>
-#include <sys/scsi.h>
+#include <sys/diskio.h>
+#include <sys/param.h>
+#include <sys/pstat.h>
 #include <time.h>
 #include <aio.h>
 
@@ -20,6 +22,10 @@
 #define FIO_HAVE_CLOCK_MONOTONIC
 #define FIO_HAVE_PSHARED_MUTEX
 #define FIO_HAVE_FADVISE
+#define FIO_HAVE_CHARDEV_SIZE
+#define FIO_HAVE_FALLOCATE
+#define FIO_HAVE_POSIXAIO_FSYNC
+#define FIO_HAVE_FDATASYNC
 
 #define OS_MAP_ANON		MAP_ANONYMOUS
 #define OS_MSG_DONTWAIT		0
@@ -44,10 +50,13 @@ static inline int blockdev_invalidate_cache(struct fio_file *f)
 
 static inline int blockdev_size(struct fio_file *f, unsigned long long *bytes)
 {
-	struct capacity cap;
+	disk_describe_type_ext_t dext;
 
-	if (!ioctl(f->fd, SIOC_CAPACITY, &cap) == -1) {
-		*bytes = cap.lba * cap.blksz;
+	if (!ioctl(f->fd, DIOC_DESCRIBE_EXT, &dext)) {
+		unsigned long long lba;
+
+		lba = ((uint64_t) dext.maxsva_high << 32) | dext.maxsva_low;
+		*bytes = lba * dext.lgblksz;
 		return 0;
 	}
 
@@ -55,18 +64,24 @@ static inline int blockdev_size(struct fio_file *f, unsigned long long *bytes)
 	return errno;
 }
 
+static inline int chardev_size(struct fio_file *f, unsigned long long *bytes)
+{
+	return blockdev_size(f, bytes);
+}
+
 static inline unsigned long long os_phys_mem(void)
 {
-#if 0
-	long mem = sysconf(_SC_AIX_REALMEM);
+	unsigned long long ret;
+	struct pst_static pst;
+	union pstun pu;
 
-	if (mem == -1)
+	pu.pst_static = &pst;
+	if (pstat(PSTAT_STATIC, pu, sizeof(pst), 0, 0) == -1)
 		return 0;
 
-	return (unsigned long long) mem * 1024;
-#else
-	return 0;
-#endif
+	ret = pst.physical_memory;
+	ret *= pst.page_size;
+	return ret;
 }
 
 #define FIO_HAVE_CPU_ONLINE_SYSCONF
--
To unsubscribe from this list: send the line "unsubscribe fio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux