Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 242890
b: refs/heads/master
c: 370a43e
h: refs/heads/master
v: v3
  • Loading branch information
Philipp Reisner committed Mar 10, 2011
1 parent 1b3c8ba commit d3a8d81
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 7 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: 71c78cfba232de8f61a4b1bbb6e876424d133407
refs/heads/master: 370a43e7982dd497822097e0ae6022947ac2e7d4
3 changes: 3 additions & 0 deletions trunk/drivers/block/drbd/drbd_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,7 @@ enum {
GOT_PING_ACK, /* set when we receive a ping_ack packet, misc wait gets woken */
NEW_CUR_UUID, /* Create new current UUID when thawing IO */
AL_SUSPENDED, /* Activity logging is currently suspended. */
AHEAD_TO_SYNC_SOURCE, /* Ahead -> SyncSource queued */
};

struct drbd_bitmap; /* opaque for drbd_conf */
Expand Down Expand Up @@ -961,6 +962,7 @@ struct drbd_conf {
start_resync_work;
struct timer_list resync_timer;
struct timer_list md_sync_timer;
struct timer_list start_resync_timer;
#ifdef DRBD_DEBUG_MD_SYNC
struct {
unsigned int line;
Expand Down Expand Up @@ -1544,6 +1546,7 @@ extern int w_send_oos(struct drbd_conf *, struct drbd_work *, int);
extern int w_start_resync(struct drbd_conf *, struct drbd_work *, int);

extern void resync_timer_fn(unsigned long data);
extern void start_resync_timer_fn(unsigned long data);

/* drbd_receiver.c */
extern int drbd_rs_should_slow_down(struct drbd_conf *mdev, sector_t sector);
Expand Down
4 changes: 4 additions & 0 deletions trunk/drivers/block/drbd/drbd_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2984,12 +2984,16 @@ void drbd_init_set_defaults(struct drbd_conf *mdev)
mdev->go_diskless.cb = w_go_diskless;
mdev->md_sync_work.cb = w_md_sync;
mdev->bm_io_work.w.cb = w_bitmap_io;
mdev->start_resync_work.cb = w_start_resync;
init_timer(&mdev->resync_timer);
init_timer(&mdev->md_sync_timer);
init_timer(&mdev->start_resync_timer);
mdev->resync_timer.function = resync_timer_fn;
mdev->resync_timer.data = (unsigned long) mdev;
mdev->md_sync_timer.function = md_sync_timer_fn;
mdev->md_sync_timer.data = (unsigned long) mdev;
mdev->start_resync_timer.function = start_resync_timer_fn;
mdev->start_resync_timer.data = (unsigned long) mdev;

init_waitqueue_head(&mdev->misc_wait);
init_waitqueue_head(&mdev->state_wait);
Expand Down
8 changes: 3 additions & 5 deletions trunk/drivers/block/drbd/drbd_receiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -4392,11 +4392,9 @@ static int got_BarrierAck(struct drbd_conf *mdev, struct p_header80 *h)

if (mdev->state.conn == C_AHEAD &&
atomic_read(&mdev->ap_in_flight) == 0 &&
atomic_read(&mdev->rs_pending_cnt) == 0 &&
list_empty(&mdev->start_resync_work.list)) {
struct drbd_work *w = &mdev->start_resync_work;
w->cb = w_start_resync;
drbd_queue_work(&mdev->data.work, w);
!test_and_set_bit(AHEAD_TO_SYNC_SOURCE, &mdev->current_epoch->flags)) {
mdev->start_resync_timer.expires = jiffies + HZ;
add_timer(&mdev->start_resync_timer);
}

return true;
Expand Down
16 changes: 15 additions & 1 deletion trunk/drivers/block/drbd/drbd_worker.c
Original file line number Diff line number Diff line change
Expand Up @@ -712,10 +712,24 @@ static int w_make_ov_request(struct drbd_conf *mdev, struct drbd_work *w, int ca
}


void start_resync_timer_fn(unsigned long data)
{
struct drbd_conf *mdev = (struct drbd_conf *) data;

drbd_queue_work(&mdev->data.work, &mdev->start_resync_work);
}

int w_start_resync(struct drbd_conf *mdev, struct drbd_work *w, int cancel)
{
drbd_start_resync(mdev, C_SYNC_SOURCE);
if (atomic_read(&mdev->unacked_cnt) || atomic_read(&mdev->rs_pending_cnt)) {
dev_warn(DEV, "w_start_resync later...\n");
mdev->start_resync_timer.expires = jiffies + HZ/10;
add_timer(&mdev->start_resync_timer);
return 1;
}

drbd_start_resync(mdev, C_SYNC_SOURCE);
clear_bit(AHEAD_TO_SYNC_SOURCE, &mdev->current_epoch->flags);
return 1;
}

Expand Down

0 comments on commit d3a8d81

Please sign in to comment.