libf2fs: Track AOSP libsparse API change.
PATCH 1/1 libf2fs: Track AOSP libsparse API change.
The libsparse in AOSP is updating the type for 'len', from 'int' to 'size_t', in the callback parameter of sparse_file_foreach_chunk(). The value represents a chunk size, which could be legitimately larger than INT_MAX. This patch tracks the libsparse API change.
The change is guarded with SPARSE_CALLBACK_USES_SIZE_T that's exposed as part of the libsparse change. This allows f2fs-tools to keep working against older libsparse versions.
--- lib/libf2fs_io.c | 5 +++++ 1 file changed, 5 insertions(+)
lib/libf2fs_io.c +5 -0
@@ -114,8 +114,13 @@ static int sparse_write_blk(__u64 block, int count, const void *buf)return 0 ; } +#ifdef SPARSE_CALLBACK_USES_SIZE_T +static int sparse_import_segment (void *UNUSED (priv ),const void *data, + size_t len, unsigned int block, unsigned int nr_blocks) +#else static int sparse_import_segment (void *UNUSED (priv ),const void *data,int len, unsigned int block, unsigned int nr_blocks) +#endif {/* Ignore chunk headers, only write the data */ if (!nr_blocks || len %F2FS_BLKSIZE )
Signature · 6 lines
2.17.0.484.g0c8726318c-goog ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Merged.
Thanks,
Quoted 43 lines · On 04/26, Tao Bao via Linux-f2fs-devel wrote:
The libsparse in AOSP is updating the type for 'len', from 'int' to '
size_t', in the callback parameter ofsparse_file_foreach_chunk(). The value represents a chunk size, which could be legitimately larger thanINT_MAX. This patch tracks the libsparse API change.The change is guarded with
SPARSE_CALLBACK_USES_SIZE_Tthat's exposed as part of the libsparse change. This allows f2fs-tools to keep working against older libsparse versions.Signed-off-by Tao Bao <[email protected]>--- lib/libf2fs_io.c | 5 +++++ 1 file changed, 5 insertions(+)lib/libf2fs_io.c +5
-0@@ -114,8 +114,13 @@ static int sparse_write_blk(__u64 block, int count, const void *buf)return 0 ; } +#ifdef SPARSE_CALLBACK_USES_SIZE_T +static int sparse_import_segment (void *UNUSED (priv ),const void *data, + size_t len, unsigned int block, unsigned int nr_blocks) +#else static int sparse_import_segment (void *UNUSED (priv ),const void *data,int len, unsigned int block, unsigned int nr_blocks) +#endif {/* Ignore chunk headers, only write the data */ if (!nr_blocks || len %F2FS_BLKSIZE )Signature · 10 lines
2.17.0.484.g0c8726318c-goog ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Quoted 10 lines · On 2018/4/26 15:40, Tao Bao via Linux-f2fs-devel wrote:
The libsparse in AOSP is updating the type for 'len', from 'int' to '
size_t', in the callback parameter ofsparse_file_foreach_chunk(). The value represents a chunk size, which could be legitimately larger thanINT_MAX. This patch tracks the libsparse API change.The change is guarded with
SPARSE_CALLBACK_USES_SIZE_Tthat's exposed as part of the libsparse change. This allows f2fs-tools to keep working against older libsparse versions.Signed-off-by Tao Bao <[email protected]>
Thanks,
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Quoted 6 lines · Chao Yu
Quoted 5 lines · On 2018/4/26 15:40, Tao Bao via Linux-f2fs-devel wrote:
The libsparse in AOSP is updating the type for 'len', from 'int' to '
size_t', in the callback parameter ofsparse_file_foreach_chunk(). The value represents a chunk size, which could be legitimately larger thanINT_MAX. This patch tracks the libsparse API change.
Quoted 7 lines
Quoted 5 lines
The change is guarded with
SPARSE_CALLBACK_USES_SIZE_Tthat's exposed as part of the libsparse change. This allows f2fs-tools to keep working against older libsparse versions.Signed-off-by Tao Bao <[email protected]>Reviewed-by Chao Yu <[email protected]>
Merged already.
Quoted 11 lines
Thanks,
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linux-f2fs-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot