f2fs: avoid AOSP build failure
authorJaegeuk Kim <jaegeuk@kernel.org>
Wed, 12 Oct 2016 21:42:16 +0000 (14:42 -0700)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 12 Oct 2016 21:44:52 +0000 (14:44 -0700)
SCSI-related operations are not permitted to AOSP biuld.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fsck/main.c
lib/libf2fs.c

index f1b065f..75f8c1e 100644 (file)
@@ -510,6 +510,7 @@ fsck_again:
        case DUMP:
                do_dump(sbi);
                break;
+#ifndef WITH_ANDROID
        case DEFRAG:
                ret = do_defrag(sbi);
                if (ret)
@@ -522,6 +523,7 @@ fsck_again:
        case SLOAD:
                do_sload(sbi);
                break;
+#endif
        }
 
        f2fs_do_umount(sbi);
index 6140452..d3311ca 100644 (file)
 #include <sys/stat.h>
 #include <sys/mount.h>
 #include <sys/ioctl.h>
+#ifndef WITH_ANDROID
 #include <scsi/sg.h>
+#endif
 #include <linux/hdreg.h>
 #include <linux/limits.h>
 
 #include <f2fs_fs.h>
 
+#ifndef WITH_ANDROID
 /* SCSI command for standard inquiry*/
 #define MODELINQUIRY   0x12,0x00,0x00,0x00,0x4A,0x00
+#endif
 
 /*
  * UTF conversion codes are Copied from exfat tools.
@@ -652,9 +656,11 @@ int f2fs_get_device_info(void)
 #endif
        struct stat stat_buf;
        struct hd_geometry geom;
+#ifndef WITH_ANDROID
        sg_io_hdr_t io_hdr;
        unsigned char reply_buffer[96];
        unsigned char model_inq[6] = {MODELINQUIRY};
+#endif
        u_int64_t wanted_total_sectors = c.total_sectors;
 
        fd = open(c.device_name, O_RDWR);
@@ -704,6 +710,7 @@ int f2fs_get_device_info(void)
                else
                        c.start_sector = geom.start;
 
+#ifndef WITH_ANDROID
                /* Send INQUIRY command */
                memset(&io_hdr, 0, sizeof(sg_io_hdr_t));
                io_hdr.interface_id = 'S';
@@ -722,6 +729,7 @@ int f2fs_get_device_info(void)
                                printf("%c", reply_buffer[i++]);
                        printf("\n");
                }
+#endif
        } else {
                MSG(0, "\tError: Volume type is not supported!!!\n");
                return -1;
@@ -737,6 +745,7 @@ int f2fs_get_device_info(void)
                return -1;
        }
 
+#ifndef WITH_ANDROID
        if (c.smr_mode) {
                if (zbc_scsi_report_zones()) {
                        MSG(0, "\tError: Not proper SMR drive\n");
@@ -749,6 +758,7 @@ int f2fs_get_device_info(void)
                        c.segs_per_sec = c.zone_sectors /
                                c.sectors_per_blk / DEFAULT_BLOCKS_PER_SEGMENT;
        }
+#endif
        c.segs_per_zone = c.segs_per_sec * c.secs_per_zone;
 
        MSG(0, "Info: Segments per section = %d\n", c.segs_per_sec);