Skip to contentSkip to conversation

f2fs-tools: do not use SG_IO in Android

PATCH New Jaegeuk Kim 1 participant 1 message May 23, 2022 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 f2fs-tools: do not use SG_IO in Android

Android security team does not allow to use SG_IO.

---
 include/android_config.h | 1 -
 lib/libf2fs.c            | 4 ++--
 2 files changed, 2 insertions(+), 3 deletions(-)
include/android_config.h +0 -1
index 4bcd5890313f..5f5c693cbbb3 100644
@@ -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
lib/libf2fs.c +2 -2
index 961e70cb7b1b..ad8d1bd03509 100644
@@ -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';
Signature · 8 lines
2.36.1.124.g0e6072fb45-goog



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel