提交 43ae077d 编写于 作者: A Andreas Gruenbacher 提交者: Philipp Reisner

drbd: Make the peer_seq updating code more obvious

Make it more clear that update_peer_seq() is supposed to wake up the
seq_wait queue whenever the sequence number changes.
Signed-off-by: NPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: NLars Ellenberg <lars.ellenberg@linbit.com>
上级 6024fece
...@@ -1650,15 +1650,15 @@ static u32 seq_max(u32 a, u32 b) ...@@ -1650,15 +1650,15 @@ static u32 seq_max(u32 a, u32 b)
return seq_greater(a, b) ? a : b; return seq_greater(a, b) ? a : b;
} }
static void update_peer_seq(struct drbd_conf *mdev, unsigned int new_seq) static void update_peer_seq(struct drbd_conf *mdev, unsigned int peer_seq)
{ {
unsigned int m; unsigned int old_peer_seq;
spin_lock(&mdev->peer_seq_lock); spin_lock(&mdev->peer_seq_lock);
m = seq_max(mdev->peer_seq, new_seq); old_peer_seq = mdev->peer_seq;
mdev->peer_seq = m; mdev->peer_seq = seq_max(mdev->peer_seq, peer_seq);
spin_unlock(&mdev->peer_seq_lock); spin_unlock(&mdev->peer_seq_lock);
if (m == new_seq) if (old_peer_seq != peer_seq)
wake_up(&mdev->seq_wait); wake_up(&mdev->seq_wait);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册