* [PATCH] libf2fs: Track AOSP libsparse API change.
@ 2018-04-26 7:40 Tao Bao via Linux-f2fs-devel
2018-04-30 20:45 ` Jaegeuk Kim
2018-05-04 8:52 ` Chao Yu
0 siblings, 2 replies; 4+ messages in thread
From: Tao Bao via Linux-f2fs-devel @ 2018-04-26 7:40 UTC (permalink / raw)
To: linux-f2fs-devel, tbao; +Cc: jaegeuk
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.
Signed-off-by: Tao Bao <tbao@google.com>
---
lib/libf2fs_io.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/lib/libf2fs_io.c b/lib/libf2fs_io.c
index 4781517..76d283d 100644
--- a/lib/libf2fs_io.c
+++ b/lib/libf2fs_io.c
@@ -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)
--
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] libf2fs: Track AOSP libsparse API change.
2018-04-26 7:40 [PATCH] libf2fs: Track AOSP libsparse API change Tao Bao via Linux-f2fs-devel
@ 2018-04-30 20:45 ` Jaegeuk Kim
2018-05-04 8:52 ` Chao Yu
1 sibling, 0 replies; 4+ messages in thread
From: Jaegeuk Kim @ 2018-04-30 20:45 UTC (permalink / raw)
To: Tao Bao; +Cc: jaegeuk, linux-f2fs-devel
Merged.
Thanks,
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 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.
>
> Signed-off-by: Tao Bao <tbao@google.com>
> ---
> lib/libf2fs_io.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/lib/libf2fs_io.c b/lib/libf2fs_io.c
> index 4781517..76d283d 100644
> --- a/lib/libf2fs_io.c
> +++ b/lib/libf2fs_io.c
> @@ -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)
> --
> 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
> Linux-f2fs-devel@lists.sourceforge.net
> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] libf2fs: Track AOSP libsparse API change.
2018-04-26 7:40 [PATCH] libf2fs: Track AOSP libsparse API change Tao Bao via Linux-f2fs-devel
2018-04-30 20:45 ` Jaegeuk Kim
@ 2018-05-04 8:52 ` Chao Yu
2018-05-04 19:16 ` Jaegeuk Kim
1 sibling, 1 reply; 4+ messages in thread
From: Chao Yu @ 2018-05-04 8:52 UTC (permalink / raw)
To: Tao Bao, linux-f2fs-devel, jaegeuk
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 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.
>
> Signed-off-by: Tao Bao <tbao@google.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Thanks,
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] libf2fs: Track AOSP libsparse API change.
2018-05-04 8:52 ` Chao Yu
@ 2018-05-04 19:16 ` Jaegeuk Kim
0 siblings, 0 replies; 4+ messages in thread
From: Jaegeuk Kim @ 2018-05-04 19:16 UTC (permalink / raw)
To: Chao Yu; +Cc: jaegeuk, linux-f2fs-devel
On 05/04, Chao Yu wrote:
> 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 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.
> >
> > Signed-off-by: Tao Bao <tbao@google.com>
>
> Reviewed-by: Chao Yu <yuchao0@huawei.com>
Merged already.
>
> 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
> Linux-f2fs-devel@lists.sourceforge.net
> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-05-04 19:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-26 7:40 [PATCH] libf2fs: Track AOSP libsparse API change Tao Bao via Linux-f2fs-devel
2018-04-30 20:45 ` Jaegeuk Kim
2018-05-04 8:52 ` Chao Yu
2018-05-04 19:16 ` Jaegeuk Kim
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.