Skip to content

Commit

Permalink
drbd: Documenting drbd_should_do_remote() and drbd_should_send_oos()
Browse files Browse the repository at this point in the history
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
  • Loading branch information
Philipp Reisner committed Mar 10, 2011
1 parent 2265b47 commit c88d65e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions drivers/block/drbd/drbd_req.c
Original file line number Diff line number Diff line change
Expand Up @@ -762,21 +762,25 @@ 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;

return s.pdsk == D_UP_TO_DATE ||
(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)
Expand Down

0 comments on commit c88d65e

Please sign in to comment.