Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c8f543e0 authored by Akinobu Mita's avatar Akinobu Mita Committed by Alasdair G Kergon
Browse files

dm log: clean up bit little endian bitops



Using __test_and_{set,clear}_bit_le() with ignoring its return value
can be replaced with __{set,clear}_bit_le().

This also removes unnecessary casts.

Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
parent 936688d7
Loading
Loading
Loading
Loading
+4 −5
Original line number Original line Diff line number Diff line
@@ -257,20 +257,20 @@ struct log_c {
 */
 */
static inline int log_test_bit(uint32_t *bs, unsigned bit)
static inline int log_test_bit(uint32_t *bs, unsigned bit)
{
{
	return test_bit_le(bit, (unsigned long *) bs) ? 1 : 0;
	return test_bit_le(bit, bs) ? 1 : 0;
}
}


static inline void log_set_bit(struct log_c *l,
static inline void log_set_bit(struct log_c *l,
			       uint32_t *bs, unsigned bit)
			       uint32_t *bs, unsigned bit)
{
{
	__test_and_set_bit_le(bit, (unsigned long *) bs);
	__set_bit_le(bit, bs);
	l->touched_cleaned = 1;
	l->touched_cleaned = 1;
}
}


static inline void log_clear_bit(struct log_c *l,
static inline void log_clear_bit(struct log_c *l,
				 uint32_t *bs, unsigned bit)
				 uint32_t *bs, unsigned bit)
{
{
	__test_and_clear_bit_le(bit, (unsigned long *) bs);
	__clear_bit_le(bit, bs);
	l->touched_dirtied = 1;
	l->touched_dirtied = 1;
}
}


@@ -745,8 +745,7 @@ static int core_get_resync_work(struct dm_dirty_log *log, region_t *region)
		return 0;
		return 0;


	do {
	do {
		*region = find_next_zero_bit_le(
		*region = find_next_zero_bit_le(lc->sync_bits,
					     (unsigned long *) lc->sync_bits,
					     lc->region_count,
					     lc->region_count,
					     lc->sync_search);
					     lc->sync_search);
		lc->sync_search = *region + 1;
		lc->sync_search = *region + 1;