Commit 6b33aff3 authored by Akinobu Mita's avatar Akinobu Mita Committed by Linus Torvalds

md: use little-endian bitops

As a preparation for removing ext2 non-atomic bit operations from
asm/bitops.h.  This converts ext2 non-atomic bit operations to
little-endian bit operations.
Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
Acked-by: default avatarNeilBrown <neilb@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 3cdc7125
...@@ -854,7 +854,7 @@ static void bitmap_file_set_bit(struct bitmap *bitmap, sector_t block) ...@@ -854,7 +854,7 @@ static void bitmap_file_set_bit(struct bitmap *bitmap, sector_t block)
if (bitmap->flags & BITMAP_HOSTENDIAN) if (bitmap->flags & BITMAP_HOSTENDIAN)
set_bit(bit, kaddr); set_bit(bit, kaddr);
else else
ext2_set_bit(bit, kaddr); __test_and_set_bit_le(bit, kaddr);
kunmap_atomic(kaddr, KM_USER0); kunmap_atomic(kaddr, KM_USER0);
PRINTK("set file bit %lu page %lu\n", bit, page->index); PRINTK("set file bit %lu page %lu\n", bit, page->index);
} }
...@@ -1050,7 +1050,7 @@ static int bitmap_init_from_disk(struct bitmap *bitmap, sector_t start) ...@@ -1050,7 +1050,7 @@ static int bitmap_init_from_disk(struct bitmap *bitmap, sector_t start)
if (bitmap->flags & BITMAP_HOSTENDIAN) if (bitmap->flags & BITMAP_HOSTENDIAN)
b = test_bit(bit, paddr); b = test_bit(bit, paddr);
else else
b = ext2_test_bit(bit, paddr); b = test_bit_le(bit, paddr);
kunmap_atomic(paddr, KM_USER0); kunmap_atomic(paddr, KM_USER0);
if (b) { if (b) {
/* if the disk bit is set, set the memory bit */ /* if the disk bit is set, set the memory bit */
...@@ -1226,7 +1226,7 @@ void bitmap_daemon_work(mddev_t *mddev) ...@@ -1226,7 +1226,7 @@ void bitmap_daemon_work(mddev_t *mddev)
clear_bit(file_page_offset(bitmap, j), clear_bit(file_page_offset(bitmap, j),
paddr); paddr);
else else
ext2_clear_bit(file_page_offset(bitmap, j), __test_and_clear_bit_le(file_page_offset(bitmap, j),
paddr); paddr);
kunmap_atomic(paddr, KM_USER0); kunmap_atomic(paddr, KM_USER0);
} else } else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment