提交 8c387def 编写于 作者: L Lars Ellenberg 提交者: Philipp Reisner

drbd: simplify condition in drbd_may_do_local_read()

fold
	if (x >= (N+1))
		return 0;
	if (x < N)
		return 0;
into
	if (x != N)
		return 0;
Signed-off-by: NPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: NLars Ellenberg <lars.ellenberg@linbit.com>
上级 c670a398
...@@ -663,9 +663,7 @@ static int drbd_may_do_local_read(struct drbd_conf *mdev, sector_t sector, int s ...@@ -663,9 +663,7 @@ static int drbd_may_do_local_read(struct drbd_conf *mdev, sector_t sector, int s
if (mdev->state.disk == D_UP_TO_DATE) if (mdev->state.disk == D_UP_TO_DATE)
return 1; return 1;
if (mdev->state.disk >= D_OUTDATED) if (mdev->state.disk != D_INCONSISTENT)
return 0;
if (mdev->state.disk < D_INCONSISTENT)
return 0; return 0;
esector = sector + (size >> 9) - 1; esector = sector + (size >> 9) - 1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册