Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 345850
b: refs/heads/master
c: 3c13b68
h: refs/heads/master
v: v3
  • Loading branch information
Lars Ellenberg authored and Philipp Reisner committed Oct 14, 2011
1 parent d51851a commit 4c21493
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 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: a5df0e199cf6b31400fa86f6c3f73fa6e127e9ed
refs/heads/master: 3c13b680ce210313c6f7ad163435b62979958c09
9 changes: 5 additions & 4 deletions trunk/drivers/block/drbd/drbd_receiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1734,14 +1734,15 @@ static bool need_peer_seq(struct drbd_conf *mdev)

static void update_peer_seq(struct drbd_conf *mdev, unsigned int peer_seq)
{
unsigned int old_peer_seq;
unsigned int newest_peer_seq;

if (need_peer_seq(mdev)) {
spin_lock(&mdev->peer_seq_lock);
old_peer_seq = mdev->peer_seq;
mdev->peer_seq = seq_max(mdev->peer_seq, peer_seq);
newest_peer_seq = seq_max(mdev->peer_seq, peer_seq);
mdev->peer_seq = newest_peer_seq;
spin_unlock(&mdev->peer_seq_lock);
if (old_peer_seq != peer_seq)
/* wake up only if we actually changed mdev->peer_seq */
if (peer_seq == newest_peer_seq)
wake_up(&mdev->seq_wait);
}
}
Expand Down

0 comments on commit 4c21493

Please sign in to comment.