Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 345999
b: refs/heads/master
c: 18c2d52
h: refs/heads/master
i:
  345997: 5067af2
  345995: eca110b
  345991: 27b0e8b
  345983: 0fa6f10
v: v3
  • Loading branch information
Andreas Gruenbacher authored and Philipp Reisner committed Nov 8, 2012
1 parent 7ed4e74 commit 94732cd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 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: d4da15374ba52009801d4c37c6dae0ba6ec0fca5
refs/heads/master: 18c2d52249fff156ff2db2e18cefe5184078af72
9 changes: 5 additions & 4 deletions trunk/drivers/block/drbd/drbd_receiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,12 @@ static void page_chain_add(struct page **head,
*head = chain_first;
}

static struct page *drbd_pp_first_pages_or_try_alloc(struct drbd_conf *mdev, int number)
static struct page *__drbd_alloc_pages(struct drbd_conf *mdev,
unsigned int number)
{
struct page *page = NULL;
struct page *tmp = NULL;
int i = 0;
unsigned int i = 0;

/* Yes, testing drbd_pp_vacant outside the lock is racy.
* So what. It saves a spin_lock. */
Expand Down Expand Up @@ -247,15 +248,15 @@ static struct page *drbd_pp_alloc(struct drbd_conf *mdev, unsigned number, bool
/* Yes, we may run up to @number over max_buffers. If we
* follow it strictly, the admin will get it wrong anyways. */
if (atomic_read(&mdev->pp_in_use) < mdev->tconn->net_conf->max_buffers)
page = drbd_pp_first_pages_or_try_alloc(mdev, number);
page = __drbd_alloc_pages(mdev, number);

while (page == NULL) {
prepare_to_wait(&drbd_pp_wait, &wait, TASK_INTERRUPTIBLE);

drbd_kick_lo_and_reclaim_net(mdev);

if (atomic_read(&mdev->pp_in_use) < mdev->tconn->net_conf->max_buffers) {
page = drbd_pp_first_pages_or_try_alloc(mdev, number);
page = __drbd_alloc_pages(mdev, number);
if (page)
break;
}
Expand Down

0 comments on commit 94732cd

Please sign in to comment.