Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 320938
b: refs/heads/master
c: 0021b7b
h: refs/heads/master
v: v3
  • Loading branch information
NeilBrown authored and Jens Axboe committed Jul 31, 2012
1 parent dc50a47 commit 93b7e37
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 15 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: 01ff5dbc0925d11c8ad76eed3bdd02d0c7e1e0f5
refs/heads/master: 0021b7bc045e4b0b85d8c53614342aaf84ca96a5
5 changes: 1 addition & 4 deletions trunk/drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,8 +514,7 @@ struct md_plug_cb {
static void plugger_unplug(struct blk_plug_cb *cb)
{
struct md_plug_cb *mdcb = container_of(cb, struct md_plug_cb, cb);
if (atomic_dec_and_test(&mdcb->mddev->plug_cnt))
md_wakeup_thread(mdcb->mddev->thread);
md_wakeup_thread(mdcb->mddev->thread);
kfree(mdcb);
}

Expand Down Expand Up @@ -548,7 +547,6 @@ int mddev_check_plugged(struct mddev *mddev)

mdcb->mddev = mddev;
mdcb->cb.callback = plugger_unplug;
atomic_inc(&mddev->plug_cnt);
list_add(&mdcb->cb.list, &plug->cb_list);
return 1;
}
Expand Down Expand Up @@ -602,7 +600,6 @@ void mddev_init(struct mddev *mddev)
atomic_set(&mddev->active, 1);
atomic_set(&mddev->openers, 0);
atomic_set(&mddev->active_io, 0);
atomic_set(&mddev->plug_cnt, 0);
spin_lock_init(&mddev->write_lock);
atomic_set(&mddev->flush_pending, 0);
init_waitqueue_head(&mddev->sb_wait);
Expand Down
3 changes: 0 additions & 3 deletions trunk/drivers/md/md.h
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,6 @@ struct mddev {
int new_chunk_sectors;
int reshape_backwards;

atomic_t plug_cnt; /* If device is expecting
* more bios soon.
*/
struct md_thread *thread; /* management thread */
struct md_thread *sync_thread; /* doing resync or reconstruct */
sector_t curr_resync; /* last block scheduled */
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/md/raid1.c
Original file line number Diff line number Diff line change
Expand Up @@ -2173,8 +2173,7 @@ static void raid1d(struct mddev *mddev)
blk_start_plug(&plug);
for (;;) {

if (atomic_read(&mddev->plug_cnt) == 0)
flush_pending_writes(conf);
flush_pending_writes(conf);

spin_lock_irqsave(&conf->device_lock, flags);
if (list_empty(head)) {
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/md/raid10.c
Original file line number Diff line number Diff line change
Expand Up @@ -2660,8 +2660,7 @@ static void raid10d(struct mddev *mddev)
blk_start_plug(&plug);
for (;;) {

if (atomic_read(&mddev->plug_cnt) == 0)
flush_pending_writes(conf);
flush_pending_writes(conf);

spin_lock_irqsave(&conf->device_lock, flags);
if (list_empty(head)) {
Expand Down
5 changes: 2 additions & 3 deletions trunk/drivers/md/raid5.c
Original file line number Diff line number Diff line change
Expand Up @@ -4543,7 +4543,7 @@ static void raid5d(struct mddev *mddev)
while (1) {
struct bio *bio;

if (atomic_read(&mddev->plug_cnt) == 0 &&
if (
!list_empty(&conf->bitmap_list)) {
/* Now is a good time to flush some bitmap updates */
conf->seq_flush++;
Expand All @@ -4553,8 +4553,7 @@ static void raid5d(struct mddev *mddev)
conf->seq_write = conf->seq_flush;
activate_bit_delay(conf);
}
if (atomic_read(&mddev->plug_cnt) == 0)
raid5_activate_delayed(conf);
raid5_activate_delayed(conf);

while ((bio = remove_bio_from_retry(conf))) {
int ok;
Expand Down

0 comments on commit 93b7e37

Please sign in to comment.