aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2022-05-23 13:30:37 -0700
committerJaegeuk Kim <jaegeuk@kernel.org>2022-05-23 13:30:37 -0700
commitdd8d8e54a60c747245f4a67f4bc7b27711fd80aa (patch)
tree01887d401021599b58d297590b1945f2183f0eb8
parent4f216e6b06b13aaa94362ba0f6f36cbae06331e1 (diff)
downloadf2fs-tools-dd8d8e54a60c747245f4a67f4bc7b27711fd80aa.tar.gz
f2fs-tools: do not use SG_IO in Android
Android security team does not allow to use SG_IO. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r--include/android_config.h1
-rw-r--r--lib/libf2fs.c4
2 files changed, 2 insertions, 3 deletions
diff --git a/include/android_config.h b/include/android_config.h
index 4bcd589..5f5c693 100644
--- a/include/android_config.h
+++ b/include/android_config.h
@@ -24,7 +24,6 @@
#define HAVE_SYS_XATTR_H 1
#define HAVE_UNISTD_H 1
#define HAVE_UUID_UUID_H 1
-#define HAVE_SCSI_SG_H 1
#define HAVE_FALLOCATE 1
#define HAVE_FSETXATTR 1
diff --git a/lib/libf2fs.c b/lib/libf2fs.c
index 961e70c..ad8d1bd 100644
--- a/lib/libf2fs.c
+++ b/lib/libf2fs.c
@@ -896,7 +896,7 @@ int get_device_info(int i)
#ifdef HDIO_GETGIO
struct hd_geometry geom;
#endif
-#ifdef __linux__
+#if !defined(WITH_ANDROID) && defined(__linux__)
sg_io_hdr_t io_hdr;
unsigned char reply_buffer[96] = {0};
unsigned char model_inq[6] = {MODELINQUIRY};
@@ -998,7 +998,7 @@ int get_device_info(int i)
#endif
}
-#ifdef __linux__
+#if !defined(WITH_ANDROID) && defined(__linux__)
/* Send INQUIRY command */
memset(&io_hdr, 0, sizeof(sg_io_hdr_t));
io_hdr.interface_id = 'S';