From: Theodore Ts'o Date: Fri, 14 Mar 2003 05:59:42 +0000 (-0500) Subject: badblocks.c (ext2fs_u32_list_count), ext2fs.h: Add new function X-Git-Tag: E2FSPROGS-1_33-WIP-0314~9 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=220c0040fb4a5e8a2a091a9e3a936bb8a85223d8;p=tools%2Fe2fsprogs.git badblocks.c (ext2fs_u32_list_count), ext2fs.h: Add new function which returns the number of entries in the list. --- diff --git a/lib/ext2fs/ChangeLog b/lib/ext2fs/ChangeLog index 36631cc..5e3b37e 100644 --- a/lib/ext2fs/ChangeLog +++ b/lib/ext2fs/ChangeLog @@ -1,3 +1,8 @@ +2003-03-14 Theodore Ts'o + + * badblocks.c (ext2fs_u32_list_count), ext2fs.h: Add new function + which returns the number of entries in the list. + 2003-03-10 Theodore Ts'o * fileio.c (ext2fs_file_lseek): Fix bug added when adding 64-bit diff --git a/lib/ext2fs/badblocks.c b/lib/ext2fs/badblocks.c index 6f9ef95..7e1d24f 100644 --- a/lib/ext2fs/badblocks.c +++ b/lib/ext2fs/badblocks.c @@ -287,3 +287,8 @@ int ext2fs_badblocks_equal(ext2_badblocks_list bb1, ext2_badblocks_list bb2) return ext2fs_u32_list_equal((ext2_u32_list) bb1, (ext2_u32_list) bb2); } + +int ext2fs_u32_list_count(ext2_u32_list bb) +{ + return bb->num; +} diff --git a/lib/ext2fs/ext2fs.h b/lib/ext2fs/ext2fs.h index af3450f..926d5af 100644 --- a/lib/ext2fs/ext2fs.h +++ b/lib/ext2fs/ext2fs.h @@ -501,6 +501,7 @@ extern errcode_t ext2fs_badblocks_copy(ext2_badblocks_list src, ext2_badblocks_list *dest); extern int ext2fs_badblocks_equal(ext2_badblocks_list bb1, ext2_badblocks_list bb2); +extern int ext2fs_u32_list_count(ext2_u32_list bb); /* bb_compat */ extern errcode_t badblocks_list_create(badblocks_list *ret, int size);