Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 345936
b: refs/heads/master
c: 0da34df
h: refs/heads/master
v: v3
  • Loading branch information
Andreas Gruenbacher authored and Philipp Reisner committed Nov 8, 2012
1 parent aa71bbe commit 9bc9ccc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 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: 1097e9a80cc1820501ae01e35f8c2872628fc86f
refs/heads/master: 0da34df0d05d004c1ec40f4c30a325d8727b0b33
9 changes: 4 additions & 5 deletions trunk/drivers/block/drbd/drbd_req.c
Original file line number Diff line number Diff line change
Expand Up @@ -671,25 +671,24 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
* since size may be bigger than BM_BLOCK_SIZE,
* we may need to check several bits.
*/
static int drbd_may_do_local_read(struct drbd_conf *mdev, sector_t sector, int size)
static bool drbd_may_do_local_read(struct drbd_conf *mdev, sector_t sector, int size)
{
unsigned long sbnr, ebnr;
sector_t esector, nr_sectors;

if (mdev->state.disk == D_UP_TO_DATE)
return 1;
return true;
if (mdev->state.disk != D_INCONSISTENT)
return 0;
return false;
esector = sector + (size >> 9) - 1;

nr_sectors = drbd_get_capacity(mdev->this_bdev);
D_ASSERT(sector < nr_sectors);
D_ASSERT(esector < nr_sectors);

sbnr = BM_SECT_TO_BIT(sector);
ebnr = BM_SECT_TO_BIT(esector);

return 0 == drbd_bm_count_bits(mdev, sbnr, ebnr);
return drbd_bm_count_bits(mdev, sbnr, ebnr) == 0;
}

/*
Expand Down

0 comments on commit 9bc9ccc

Please sign in to comment.