Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 208374
b: refs/heads/master
c: 252ac52
h: refs/heads/master
v: v3
  • Loading branch information
NeilBrown committed Jul 26, 2010
1 parent d790b07 commit a8c4918
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2ac8740151b082f045e58010eb92560c3a23a0e9
refs/heads/master: 252ac5221a71be72b7e7c7b7482af91e9c962e8c
15 changes: 12 additions & 3 deletions trunk/drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -4693,6 +4693,7 @@ static void md_clean(mddev_t *mddev)
mddev->bitmap_info.chunksize = 0;
mddev->bitmap_info.daemon_sleep = 0;
mddev->bitmap_info.max_write_behind = 0;
mddev->plug = NULL;
}

void md_stop_writes(mddev_t *mddev)
Expand Down Expand Up @@ -6626,6 +6627,14 @@ int md_allow_write(mddev_t *mddev)
}
EXPORT_SYMBOL_GPL(md_allow_write);

static void md_unplug(mddev_t *mddev)
{
if (mddev->queue)
blk_unplug(mddev->queue);
if (mddev->plug)
mddev->plug->unplug_fn(mddev->plug);
}

#define SYNC_MARKS 10
#define SYNC_MARK_STEP (3*HZ)
void md_do_sync(mddev_t *mddev)
Expand Down Expand Up @@ -6804,7 +6813,7 @@ void md_do_sync(mddev_t *mddev)
>= mddev->resync_max - mddev->curr_resync_completed
)) {
/* time to update curr_resync_completed */
blk_unplug(mddev->queue);
md_unplug(mddev);
wait_event(mddev->recovery_wait,
atomic_read(&mddev->recovery_active) == 0);
mddev->curr_resync_completed =
Expand Down Expand Up @@ -6882,7 +6891,7 @@ void md_do_sync(mddev_t *mddev)
* about not overloading the IO subsystem. (things like an
* e2fsck being done on the RAID array should execute fast)
*/
blk_unplug(mddev->queue);
md_unplug(mddev);
cond_resched();

currspeed = ((unsigned long)(io_sectors-mddev->resync_mark_cnt))/2
Expand All @@ -6901,7 +6910,7 @@ void md_do_sync(mddev_t *mddev)
* this also signals 'finished resyncing' to md_stop
*/
out:
blk_unplug(mddev->queue);
md_unplug(mddev);

wait_event(mddev->recovery_wait, !atomic_read(&mddev->recovery_active));

Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/md/md.h
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,8 @@ struct mddev_s
struct list_head all_mddevs;

struct attribute_group *to_remove;
struct plug_handle *plug; /* if used by personality */

/* Generic barrier handling.
* If there is a pending barrier request, all other
* writes are blocked while the devices are flushed.
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/md/raid5.c
Original file line number Diff line number Diff line change
Expand Up @@ -5189,6 +5189,7 @@ static int run(mddev_t *mddev)
md_set_array_sectors(mddev, raid5_size(mddev, 0, 0));

plugger_init(&conf->plug, raid5_unplug);
mddev->plug = &conf->plug;
if (mddev->queue) {
/* read-ahead size must cover two whole stripes, which
* is 2 * (datadisks) * chunksize where 'n' is the
Expand Down

0 comments on commit a8c4918

Please sign in to comment.