libf2fs_io: add unused mactor to avoid build failure
PATCH 1/6 libf2fs_io: add unused mactor to avoid build failure
Signed-off-by Jaegeuk Kim <[email protected]>
--- lib/libf2fs_io.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-)
lib/libf2fs_io.c +16 -3
@@ -501,9 +501,22 @@ static int sparse_merge_blocks(uint64_t start, uint64_t num, int zero) F2FS_BLKSIZE * num, start); }#else -static int sparse_read_blk (__u64 block,int count,void *buf) {return 0 ; } -static int sparse_write_blk (__u64 block,int count,const void *buf) {return 0 ; } -static int sparse_write_zeroed_blk (__u64 block,int count) {return 0 ; } +static int sparse_read_blk (__u64 UNUSED (block ), +int UNUSED (count ),void *UNUSED (buf )) +{ +return 0 ; +} + +static int sparse_write_blk (__u64 UNUSED (block ), +int UNUSED (count ),const void *UNUSED (buf )) +{ +return 0 ; +} + +static int sparse_write_zeroed_blk (__u64 UNUSED (block ),int UNUSED (count )) +{ +return 0 ; +}#endif int dev_read (void *buf,__u64 offset,size_t len)
Signature · 8 lines
2.36.0.rc2.479.g8af0fa9b8e-goog _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
PATCH 2/6 android_config.h: add missing liblz4
Signed-off-by Jaegeuk Kim <[email protected]>
--- include/android_config.h | 2 ++ 1 file changed, 2 insertions(+)
include/android_config.h +2 -0
@@ -31,6 +31,7 @@#define HAVE_SELINUX_ANDROID_H 1#define HAVE_SETMNTENT 1#define HAVE_SPARSE_SPARSE_H 1 +#define HAVE_LIBLZ4 1#ifdef WITH_SLOAD #define HAVE_LIBSELINUX 1
@@ -57,6 +58,7 @@#define HAVE_GETMNTENT 1#define HAVE_LLSEEK 1#define HAVE_MEMSET 1 +#define HAVE_LIBLZ4 1#ifdef WITH_SLOAD #define HAVE_LIBSELINUX 1
Signature · 8 lines
2.36.0.rc2.479.g8af0fa9b8e-goog _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
PATCH 3/6 f2fs-tools: support zoned device in Android
In reply to Jaegeuk KimThis requires to change Android.bp in AOSP.
Signed-off-by Jaegeuk Kim <[email protected]>
Change-Id I28a4a701513cb2420cdf0e0e2aa3f60e712f2fcb
--- configure.ac | 9 ++++++++- fsck/fsck.c | 2 +- include/android_config.h | 3 +++ include/f2fs_fs.h | 4 +++- lib/libf2fs.c | 10 +++------- 5 files changed, 18 insertions(+), 10 deletions(-)
configure.ac +8 -1
@@ -95,6 +95,7 @@ AC_CHECK_HEADERS(m4_flatten([ blkid/blkid.h byteswap.h fcntl.h + kernel/uapi/linux/blkzoned.h linux/blkzoned.h linux/falloc.h linux/fiemap.h
@@ -222,7 +223,13 @@ AC_CONFIG_FILES([ AC_CHECK_MEMBER([struct blk_zone.capacity], [AC_DEFINE(HAVE_BLK_ZONE_REP_V2, [1], [report zones includes zone capacity])], - [], [[#include <linux/blkzoned.h>]]) + [], [[ +#ifdef HAVE_KERNEL_UAPI_LINUX_BLKZONED_H +#include <kernel/uapi/linux/blkzoned.h> +#elif defined(HAVE_LINUX_BLKZONED_H) +#include <linux/blkzoned.h> +#endif + ]]) # export library version info for mkfs/libf2fs_format_la AC_SUBST(FMT_CURRENT, 7)
fsck/fsck.c +1 -1
@@ -2994,7 +2994,7 @@ struct write_pointer_check_data {int dev_index; }; -static int chk_and_fix_wp_with_sit (int i,void *blkzone,void *opaque) +static int chk_and_fix_wp_with_sit (int UNUSED (i ),void *blkzone,void *opaque) {struct blk_zone *blkz = (struct blk_zone *)blkzone;struct write_pointer_check_data *wpd = opaque;
include/android_config.h +3 -0
@@ -1,7 +1,9 @@#if defined(__linux__) +#define HAVE_BLK_ZONE_REP_V2 1#define HAVE_BYTESWAP_H 1#define HAVE_FCNTL_H 1#define HAVE_FALLOC_H 1 +#define HAVE_KERNEL_UAPI_LINUX_BLKZONED_H 1#define HAVE_LINUX_HDREG_H 1#define HAVE_LINUX_LIMITS_H 1#define HAVE_POSIX_ACL_H 1
@@ -19,6 +21,7 @@#define HAVE_SYS_SYSMACROS_H 1#define HAVE_SYS_XATTR_H 1#define HAVE_UNISTD_H 1 +#define HAVE_SCSI_SG_H 1#define HAVE_FALLOCATE 1#define HAVE_FSETXATTR 1
include/f2fs_fs.h +3 -1
@@ -50,7 +50,9 @@#endif #include <sys/types.h> -#ifdef HAVE_LINUX_BLKZONED_H +#ifdef HAVE_KERNEL_UAPI_LINUX_BLKZONED_H +#include <kernel/uapi/linux/blkzoned.h> +#elif defined(HAVE_LINUX_BLKZONED_H )#include <linux/blkzoned.h> #endif
lib/libf2fs.c +3 -7
@@ -34,11 +34,9 @@#ifdef HAVE_SYS_UTSNAME_H #include <sys/utsname.h> #endif -#ifndef WITH_ANDROID #ifdef HAVE_SCSI_SG_H #include <scsi/sg.h> #endif -#endif #ifdef HAVE_LINUX_HDREG_H #include <linux/hdreg.h> #endif
@@ -46,10 +44,8 @@#include <linux/limits.h> #endif -#ifndef WITH_ANDROID /* SCSI command for standard inquiry*/ #define MODELINQUIRY 0x12,0x00,0x00,0x00,0x4A,0x00 -#endif #ifndef _WIN32/* O_BINARY is windows-specific flag */ #define O_BINARY 0
@@ -900,7 +896,7 @@ int get_device_info(int i)#ifdef HDIO_GETGIO struct hd_geometry geom;#endif -#if !defined(WITH_ANDROID ) && defined(__linux__) +#ifdef __linux__sg_io_hdr_t io_hdr;unsigned char reply_buffer[96 ] = {0 };unsigned char model_inq[6 ] = {MODELINQUIRY };
@@ -1002,7 +998,7 @@ int get_device_info(int i)#endif } -#if !defined(WITH_ANDROID ) && defined(__linux__) +#ifdef __linux__/* Send INQUIRY command */ memset (&io_hdr,0 ,sizeof (sg_io_hdr_t)); io_hdr.interface_id ='S' ;
@@ -1033,7 +1029,7 @@ int get_device_info(int i)return -1 ; } -#if !defined(WITH_ANDROID ) && defined(__linux__) +#ifdef __linux__if (S_ISBLK (stat_buf->st_mode)) {if (f2fs_get_zoned_model (i) <0 ) {free (stat_buf);
Signature · 8 lines
2.36.0.rc2.479.g8af0fa9b8e-goog _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Re: [f2fs-dev] [PATCH 3/6 v2] f2fs-tools: support zoned device in Android
This requires to change Android.bp in AOSP.
Signed-off-by Jaegeuk Kim <[email protected]>
Change-Id I28a4a701513cb2420cdf0e0e2aa3f60e712f2fcb
--- configure.ac | 9 ++++++++- fsck/fsck.c | 2 +- include/android_config.h | 4 ++++ include/f2fs_fs.h | 4 +++- lib/libf2fs.c | 10 +++------- 5 files changed, 19 insertions(+), 10 deletions(-)
configure.ac +8 -1
@@ -95,6 +95,7 @@ AC_CHECK_HEADERS(m4_flatten([ blkid/blkid.h byteswap.h fcntl.h + kernel/uapi/linux/blkzoned.h linux/blkzoned.h linux/falloc.h linux/fiemap.h
@@ -222,7 +223,13 @@ AC_CONFIG_FILES([ AC_CHECK_MEMBER([struct blk_zone.capacity], [AC_DEFINE(HAVE_BLK_ZONE_REP_V2, [1], [report zones includes zone capacity])], - [], [[#include <linux/blkzoned.h>]]) + [], [[ +#ifdef HAVE_KERNEL_UAPI_LINUX_BLKZONED_H +#include <kernel/uapi/linux/blkzoned.h> +#elif defined(HAVE_LINUX_BLKZONED_H) +#include <linux/blkzoned.h> +#endif + ]]) # export library version info for mkfs/libf2fs_format_la AC_SUBST(FMT_CURRENT, 7)
fsck/fsck.c +1 -1
@@ -2994,7 +2994,7 @@ struct write_pointer_check_data {int dev_index; }; -static int chk_and_fix_wp_with_sit (int i,void *blkzone,void *opaque) +static int chk_and_fix_wp_with_sit (int UNUSED (i ),void *blkzone,void *opaque) {struct blk_zone *blkz = (struct blk_zone *)blkzone;struct write_pointer_check_data *wpd = opaque;
include/android_config.h +4 -0
@@ -1,7 +1,10 @@#if defined(__linux__) +#define HAVE_BLK_ZONE_REP_V2 1#define HAVE_BYTESWAP_H 1#define HAVE_FCNTL_H 1#define HAVE_FALLOC_H 1 +#define HAVE_KERNEL_UAPI_LINUX_BLKZONED_H 1 +#define HAVE_LINUX_BLKZONED_H 1#define HAVE_LINUX_HDREG_H 1#define HAVE_LINUX_LIMITS_H 1#define HAVE_POSIX_ACL_H 1
@@ -19,6 +22,7 @@#define HAVE_SYS_SYSMACROS_H 1#define HAVE_SYS_XATTR_H 1#define HAVE_UNISTD_H 1 +#define HAVE_SCSI_SG_H 1#define HAVE_FALLOCATE 1#define HAVE_FSETXATTR 1
include/f2fs_fs.h +3 -1
@@ -50,7 +50,9 @@#endif #include <sys/types.h> -#ifdef HAVE_LINUX_BLKZONED_H +#ifdef HAVE_KERNEL_UAPI_LINUX_BLKZONED_H +#include <kernel/uapi/linux/blkzoned.h> +#elif defined(HAVE_LINUX_BLKZONED_H )#include <linux/blkzoned.h> #endif
lib/libf2fs.c +3 -7
@@ -34,11 +34,9 @@#ifdef HAVE_SYS_UTSNAME_H #include <sys/utsname.h> #endif -#ifndef WITH_ANDROID #ifdef HAVE_SCSI_SG_H #include <scsi/sg.h> #endif -#endif #ifdef HAVE_LINUX_HDREG_H #include <linux/hdreg.h> #endif
@@ -46,10 +44,8 @@#include <linux/limits.h> #endif -#ifndef WITH_ANDROID /* SCSI command for standard inquiry*/ #define MODELINQUIRY 0x12,0x00,0x00,0x00,0x4A,0x00 -#endif #ifndef _WIN32/* O_BINARY is windows-specific flag */ #define O_BINARY 0
@@ -900,7 +896,7 @@ int get_device_info(int i)#ifdef HDIO_GETGIO struct hd_geometry geom;#endif -#if !defined(WITH_ANDROID ) && defined(__linux__) +#ifdef __linux__sg_io_hdr_t io_hdr;unsigned char reply_buffer[96 ] = {0 };unsigned char model_inq[6 ] = {MODELINQUIRY };
@@ -1002,7 +998,7 @@ int get_device_info(int i)#endif } -#if !defined(WITH_ANDROID ) && defined(__linux__) +#ifdef __linux__/* Send INQUIRY command */ memset (&io_hdr,0 ,sizeof (sg_io_hdr_t)); io_hdr.interface_id ='S' ;
@@ -1033,7 +1029,7 @@ int get_device_info(int i)return -1 ; } -#if !defined(WITH_ANDROID ) && defined(__linux__) +#ifdef __linux__if (S_ISBLK (stat_buf->st_mode)) {if (f2fs_get_zoned_model (i) <0 ) {free (stat_buf);
Signature · 8 lines
2.36.0.rc2.479.g8af0fa9b8e-goog _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
PATCH 4/6 f2fs-tools: use fsync() in Android
In reply to Jaegeuk KimSigned-off-by Jaegeuk Kim <[email protected]>
--- include/android_config.h | 1 + 1 file changed, 1 insertion(+)
include/android_config.h +1 -0
@@ -3,6 +3,7 @@#define HAVE_BYTESWAP_H 1#define HAVE_FCNTL_H 1#define HAVE_FALLOC_H 1 +#define HAVE_FSYNC 1#define HAVE_KERNEL_UAPI_LINUX_BLKZONED_H 1#define HAVE_LINUX_HDREG_H 1#define HAVE_LINUX_LIMITS_H 1
Signature · 8 lines
2.36.0.rc2.479.g8af0fa9b8e-goog _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
PATCH 5/6 f2fs-tools: use android config only if there's no config.h
In reply to Jaegeuk KimSigned-off-by Jaegeuk Kim <[email protected]>
--- include/f2fs_fs.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
include/f2fs_fs.h +3 -2
@@ -26,10 +26,10 @@#include <stddef.h> #include <string.h> #include <time.h> +#ifdef HAVE_CONFIG_H #include <config.h> -#endif - +#else #ifdef __ANDROID__#define WITH_ANDROID #endif
@@ -43,6 +43,7 @@#define WITH_SLOAD #define WITH_LABEL #endif +#endif /* HAVE_CONFIG_H */ #include <inttypes.h> #ifdef HAVE_LINUX_TYPES_H
Signature · 8 lines
2.36.0.rc2.479.g8af0fa9b8e-goog _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Re: [f2fs-dev] [PATCH 5/6 v2] f2fs-tools: use android config only if there's no config.h
Signed-off-by Jaegeuk Kim <[email protected]>
---
Change log from v1:
- Fix xfstests failure
include/f2fs_fs.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
include/f2fs_fs.h +3 -2
@@ -26,13 +26,14 @@#include <stddef.h> #include <string.h> #include <time.h> +#ifdef HAVE_CONFIG_H #include <config.h> -#endif - +#else #ifdef __ANDROID__#define WITH_ANDROID #endif +#endif /* HAVE_CONFIG_H */ #ifdef WITH_ANDROID #include <android_config.h>
Signature · 7 lines
2.36.0.rc2.479.g8af0fa9b8e-goog _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
PATCH 6/6 mkfs.f2fs: check uuid library
In reply to Jaegeuk KimSigned-off-by Jaegeuk Kim <[email protected]>
--- mkfs/f2fs_format.c | 3 ++- tools/f2fscrypt.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-)
mkfs/f2fs_format.c +2 -1
@@ -24,7 +24,8 @@#include "config.h" #ifdef HAVE_UUID_UUID_H #include <uuid/uuid.h> -#else +#endif +#ifndef HAVE_LIBUUID #define uuid_parse (a, b) -1#define uuid_generate (a)#endif
tools/f2fscrypt.c +2 -2
@@ -356,7 +356,7 @@ static void parse_salt(char *salt_str, int flags)perror ("F2FS_IOC_GET_ENCRYPTION_PWSALT" );exit (1 ); } -#ifdef HAVE_UUID_UUID_H +#ifdef HAVE_LIBUUID if (options &OPT_VERBOSE ) {char tmp[80 ];uuid_unparse (buf, tmp);
@@ -384,7 +384,7 @@ static void parse_salt(char *salt_str, int flags) (((unsigned char )(h - hexchars) <<4 ) + (unsigned char )(l - hexchars)); } -#ifdef HAVE_UUID_UUID_H +#ifdef HAVE_LIBUUID }else if (uuid_parse (cp, buf) ==0 ) { salt_len =16 ;#endif
Signature · 8 lines
2.36.0.rc2.479.g8af0fa9b8e-goog _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel