Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 5633
b: refs/heads/master
c: 6b8b3e8
h: refs/heads/master
i:
  5631: 7db0fbd
v: v3
  • Loading branch information
NeilBrown authored and Linus Torvalds committed Aug 4, 2005
1 parent 9702a5c commit 3517edf
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e3b9703e27aab3839dcdb76b00d98428b67d25b0
refs/heads/master: 6b8b3e8a8b3e62b4209eaa36697e3c9df457e196
23 changes: 23 additions & 0 deletions trunk/drivers/md/bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1450,6 +1450,29 @@ static void bitmap_set_memory_bits(struct bitmap *bitmap, sector_t offset)

}

/*
* flush out any pending updates
*/
void bitmap_flush(mddev_t *mddev)
{
struct bitmap *bitmap = mddev->bitmap;
int sleep;

if (!bitmap) /* there was no bitmap */
return;

/* run the daemon_work three time to ensure everything is flushed
* that can be
*/
sleep = bitmap->daemon_sleep;
bitmap->daemon_sleep = 0;
bitmap_daemon_work(bitmap);
bitmap_daemon_work(bitmap);
bitmap_daemon_work(bitmap);
bitmap->daemon_sleep = sleep;
bitmap_update_sb(bitmap);
}

/*
* free memory that was allocated
*/
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -1798,6 +1798,8 @@ static int do_md_stop(mddev_t * mddev, int ro)
goto out;
mddev->ro = 1;
} else {
bitmap_flush(mddev);
wait_event(mddev->sb_wait, atomic_read(&mddev->pending_writes)==0);
if (mddev->ro)
set_disk_ro(disk, 0);
blk_queue_make_request(mddev->queue, md_fail_request);
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/raid/bitmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ struct bitmap {

/* these are used only by md/bitmap */
int bitmap_create(mddev_t *mddev);
void bitmap_flush(mddev_t *mddev);
void bitmap_destroy(mddev_t *mddev);
int bitmap_active(struct bitmap *bitmap);

Expand Down

0 comments on commit 3517edf

Please sign in to comment.