summaryrefslogtreecommitdiff
path: root/drivers/block
diff options
context:
space:
mode:
authorPhilipp Reisner <philipp.reisner@linbit.com>2010-12-20 15:29:28 +0100
committerPhilipp Reisner <philipp.reisner@linbit.com>2011-03-10 11:43:32 +0100
commitc88d65e2231dbae4b7cd0ad7b2a919857a1be171 (patch)
tree942160fb7738af05e662e327e79138365c4a1499 /drivers/block
parent2265b473aecc1a6fe1f84a0ee272ba39806c2a8a (diff)
drbd: Documenting drbd_should_do_remote() and drbd_should_send_oos()
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/drbd/drbd_req.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c
index 528909090df7..889175110c91 100644
--- a/drivers/block/drbd/drbd_req.c
+++ b/drivers/block/drbd/drbd_req.c
@@ -762,7 +762,7 @@ static int drbd_may_do_local_read(struct drbd_conf *mdev, sector_t sector, int s
return 0 == drbd_bm_count_bits(mdev, sbnr, ebnr);
}
-static int drbd_should_do_remote(struct drbd_conf *mdev)
+static bool drbd_should_do_remote(struct drbd_conf *mdev)
{
union drbd_state s = mdev->state;
@@ -770,13 +770,17 @@ static int drbd_should_do_remote(struct drbd_conf *mdev)
(s.pdsk >= D_INCONSISTENT &&
s.conn >= C_WF_BITMAP_T &&
s.conn < C_AHEAD);
+ /* Before proto 96 that was >= CONNECTED instead of >= C_WF_BITMAP_T.
+ That is equivalent since before 96 IO was frozen in the C_WF_BITMAP*
+ states. */
}
-static int drbd_should_send_oos(struct drbd_conf *mdev)
+static bool drbd_should_send_oos(struct drbd_conf *mdev)
{
union drbd_state s = mdev->state;
- return s.pdsk >= D_INCONSISTENT &&
- (s.conn == C_AHEAD || s.conn == C_WF_BITMAP_S);
+ return s.conn == C_AHEAD || s.conn == C_WF_BITMAP_S;
+ /* pdsk = D_INCONSISTENT as a consequence. Protocol 96 check not necessary
+ since we enter state C_AHEAD only if proto >= 96 */
}
static int drbd_make_request_common(struct drbd_conf *mdev, struct bio *bio, unsigned long start_time)