Include sg headers in os/os-linux.h
authorTomohiro Kusumi <tkusumi@tuxera.com>
Tue, 23 May 2017 18:44:48 +0000 (21:44 +0300)
committerJens Axboe <axboe@fb.com>
Wed, 24 May 2017 02:02:42 +0000 (20:02 -0600)
Since sg is Linux kernel's SCSI subsystem specific interface, it's
better to include required headers in os/os-linux.h which also defines
FIO_HAVE_SGIO, rather than conditionally including them in os/os.h.
Android has FIO_HAVE_SGIO disabled, so no need to do this for Android.

Even if another platform implements sg (compatible) ioctls within
their SCSI driver, there is no guarantee the required kernel header
will be "linux/fs.h", which then fails to compile.

Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
os/os-linux.h
os/os.h

index ba53590d01a22611469c3733a3fbd25b1d449684..0e6246ef1d6e5e70166ea55433e5c2f25fc14c83 100644 (file)
@@ -16,6 +16,8 @@
 #include <linux/unistd.h>
 #include <linux/raw.h>
 #include <linux/major.h>
 #include <linux/unistd.h>
 #include <linux/raw.h>
 #include <linux/major.h>
+#include <linux/fs.h>
+#include <scsi/sg.h>
 
 #include "./os-linux-syscall.h"
 #include "binject.h"
 
 #include "./os-linux-syscall.h"
 #include "binject.h"
diff --git a/os/os.h b/os/os.h
index 21b7a9d03a5269e2b02e04517cfe944577977413..3c96b4d11d56a25b62b3c86cb79137120caa45ab 100644 (file)
--- a/os/os.h
+++ b/os/os.h
@@ -60,11 +60,6 @@ typedef struct aiocb os_aiocb_t;
 #endif
 #endif
 
 #endif
 #endif
 
-#ifdef FIO_HAVE_SGIO
-#include <linux/fs.h>
-#include <scsi/sg.h>
-#endif
-
 #ifndef CONFIG_STRSEP
 #include "../oslib/strsep.h"
 #endif
 #ifndef CONFIG_STRSEP
 #include "../oslib/strsep.h"
 #endif