diff options
Diffstat (limited to 'drivers/md/bitmap.c')
-rw-r--r-- | drivers/md/bitmap.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index 8e67634e79a0..d6f614738bbd 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c | |||
@@ -536,7 +536,7 @@ static int bitmap_read_sb(struct bitmap *bitmap) | |||
536 | printk(KERN_INFO "%s: bitmap file is out of date (%llu < %llu) " | 536 | printk(KERN_INFO "%s: bitmap file is out of date (%llu < %llu) " |
537 | "-- forcing full recovery\n", bmname(bitmap), events, | 537 | "-- forcing full recovery\n", bmname(bitmap), events, |
538 | (unsigned long long) bitmap->mddev->events); | 538 | (unsigned long long) bitmap->mddev->events); |
539 | sb->state |= BITMAP_STALE; | 539 | sb->state |= cpu_to_le32(BITMAP_STALE); |
540 | } | 540 | } |
541 | success: | 541 | success: |
542 | /* assign fields using values from superblock */ | 542 | /* assign fields using values from superblock */ |
@@ -544,11 +544,11 @@ success: | |||
544 | bitmap->daemon_sleep = daemon_sleep; | 544 | bitmap->daemon_sleep = daemon_sleep; |
545 | bitmap->daemon_lastrun = jiffies; | 545 | bitmap->daemon_lastrun = jiffies; |
546 | bitmap->max_write_behind = write_behind; | 546 | bitmap->max_write_behind = write_behind; |
547 | bitmap->flags |= sb->state; | 547 | bitmap->flags |= le32_to_cpu(sb->state); |
548 | if (le32_to_cpu(sb->version) == BITMAP_MAJOR_HOSTENDIAN) | 548 | if (le32_to_cpu(sb->version) == BITMAP_MAJOR_HOSTENDIAN) |
549 | bitmap->flags |= BITMAP_HOSTENDIAN; | 549 | bitmap->flags |= BITMAP_HOSTENDIAN; |
550 | bitmap->events_cleared = le64_to_cpu(sb->events_cleared); | 550 | bitmap->events_cleared = le64_to_cpu(sb->events_cleared); |
551 | if (sb->state & BITMAP_STALE) | 551 | if (sb->state & cpu_to_le32(BITMAP_STALE)) |
552 | bitmap->events_cleared = bitmap->mddev->events; | 552 | bitmap->events_cleared = bitmap->mddev->events; |
553 | err = 0; | 553 | err = 0; |
554 | out: | 554 | out: |
@@ -578,9 +578,9 @@ static void bitmap_mask_state(struct bitmap *bitmap, enum bitmap_state bits, | |||
578 | spin_unlock_irqrestore(&bitmap->lock, flags); | 578 | spin_unlock_irqrestore(&bitmap->lock, flags); |
579 | sb = (bitmap_super_t *)kmap_atomic(bitmap->sb_page, KM_USER0); | 579 | sb = (bitmap_super_t *)kmap_atomic(bitmap->sb_page, KM_USER0); |
580 | switch (op) { | 580 | switch (op) { |
581 | case MASK_SET: sb->state |= bits; | 581 | case MASK_SET: sb->state |= cpu_to_le32(bits); |
582 | break; | 582 | break; |
583 | case MASK_UNSET: sb->state &= ~bits; | 583 | case MASK_UNSET: sb->state &= cpu_to_le32(~bits); |
584 | break; | 584 | break; |
585 | default: BUG(); | 585 | default: BUG(); |
586 | } | 586 | } |
@@ -1413,7 +1413,7 @@ int bitmap_create(mddev_t *mddev) | |||
1413 | int err; | 1413 | int err; |
1414 | sector_t start; | 1414 | sector_t start; |
1415 | 1415 | ||
1416 | BUG_ON(sizeof(bitmap_super_t) != 256); | 1416 | BUILD_BUG_ON(sizeof(bitmap_super_t) != 256); |
1417 | 1417 | ||
1418 | if (!file && !mddev->bitmap_offset) /* bitmap disabled, nothing to do */ | 1418 | if (!file && !mddev->bitmap_offset) /* bitmap disabled, nothing to do */ |
1419 | return 0; | 1419 | return 0; |