1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

Add dm_bitset_equal to libdevmapper.

This commit is contained in:
Alasdair Kergon 2010-04-20 13:58:22 +00:00
parent c3b712f8a0
commit 49ada7a2c3
4 changed files with 15 additions and 1 deletions

View File

@ -1,6 +1,6 @@
Version 1.02.47 -
=================================
Add dm_bit_and.
Add dm_bit_and and dm_bitset_equal to libdevmapper.
Simplify dm_bitset_create.
Speed up dm_bit_get_next with ffs().

View File

@ -109,6 +109,7 @@ dm_pool_strndup
dm_pool_zalloc
dm_bitset_create
dm_bitset_destroy
dm_bitset_equal
dm_bit_and
dm_bit_union
dm_bit_get_first

View File

@ -42,6 +42,17 @@ void dm_bitset_destroy(dm_bitset_t bs)
dm_free(bs);
}
int dm_bitset_equal(dm_bitset_t in1, dm_bitset_t in2)
{
int i;
for (i = (in1[0] / DM_BITS_PER_INT) + 1; i; i--)
if (in1[i] != in2[i])
return 0;
return 1;
}
void dm_bit_and(dm_bitset_t out, dm_bitset_t in1, dm_bitset_t in2)
{
int i;

View File

@ -600,6 +600,8 @@ typedef uint32_t *dm_bitset_t;
dm_bitset_t dm_bitset_create(struct dm_pool *mem, unsigned num_bits);
void dm_bitset_destroy(dm_bitset_t bs);
int dm_bitset_equal(dm_bitset_t in1, dm_bitset_t in2);
void dm_bit_and(dm_bitset_t out, dm_bitset_t in1, dm_bitset_t in2);
void dm_bit_union(dm_bitset_t out, dm_bitset_t in1, dm_bitset_t in2);
int dm_bit_get_first(dm_bitset_t bs);