diff options
author | Andreas Gruenbacher <agruen@linbit.com> | 2011-04-07 15:08:50 -0400 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2012-11-08 10:45:14 -0500 |
commit | 18c2d52249fff156ff2db2e18cefe5184078af72 (patch) | |
tree | 878ff9ca08767fb4caee9a25d1959015bb0db912 /drivers/block/drbd/drbd_receiver.c | |
parent | d4da15374ba52009801d4c37c6dae0ba6ec0fca5 (diff) |
drbd: Rename drbd_pp_first_pages_or_try_alloc() to __drbd_alloc_pages()
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd/drbd_receiver.c')
-rw-r--r-- | drivers/block/drbd/drbd_receiver.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index 3f68404a17e8..68914a0d3538 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c | |||
@@ -150,11 +150,12 @@ static void page_chain_add(struct page **head, | |||
150 | *head = chain_first; | 150 | *head = chain_first; |
151 | } | 151 | } |
152 | 152 | ||
153 | static struct page *drbd_pp_first_pages_or_try_alloc(struct drbd_conf *mdev, int number) | 153 | static struct page *__drbd_alloc_pages(struct drbd_conf *mdev, |
154 | unsigned int number) | ||
154 | { | 155 | { |
155 | struct page *page = NULL; | 156 | struct page *page = NULL; |
156 | struct page *tmp = NULL; | 157 | struct page *tmp = NULL; |
157 | int i = 0; | 158 | unsigned int i = 0; |
158 | 159 | ||
159 | /* Yes, testing drbd_pp_vacant outside the lock is racy. | 160 | /* Yes, testing drbd_pp_vacant outside the lock is racy. |
160 | * So what. It saves a spin_lock. */ | 161 | * So what. It saves a spin_lock. */ |
@@ -247,7 +248,7 @@ static struct page *drbd_pp_alloc(struct drbd_conf *mdev, unsigned number, bool | |||
247 | /* Yes, we may run up to @number over max_buffers. If we | 248 | /* Yes, we may run up to @number over max_buffers. If we |
248 | * follow it strictly, the admin will get it wrong anyways. */ | 249 | * follow it strictly, the admin will get it wrong anyways. */ |
249 | if (atomic_read(&mdev->pp_in_use) < mdev->tconn->net_conf->max_buffers) | 250 | if (atomic_read(&mdev->pp_in_use) < mdev->tconn->net_conf->max_buffers) |
250 | page = drbd_pp_first_pages_or_try_alloc(mdev, number); | 251 | page = __drbd_alloc_pages(mdev, number); |
251 | 252 | ||
252 | while (page == NULL) { | 253 | while (page == NULL) { |
253 | prepare_to_wait(&drbd_pp_wait, &wait, TASK_INTERRUPTIBLE); | 254 | prepare_to_wait(&drbd_pp_wait, &wait, TASK_INTERRUPTIBLE); |
@@ -255,7 +256,7 @@ static struct page *drbd_pp_alloc(struct drbd_conf *mdev, unsigned number, bool | |||
255 | drbd_kick_lo_and_reclaim_net(mdev); | 256 | drbd_kick_lo_and_reclaim_net(mdev); |
256 | 257 | ||
257 | if (atomic_read(&mdev->pp_in_use) < mdev->tconn->net_conf->max_buffers) { | 258 | if (atomic_read(&mdev->pp_in_use) < mdev->tconn->net_conf->max_buffers) { |
258 | page = drbd_pp_first_pages_or_try_alloc(mdev, number); | 259 | page = __drbd_alloc_pages(mdev, number); |
259 | if (page) | 260 | if (page) |
260 | break; | 261 | break; |
261 | } | 262 | } |