mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
drivers/misc/vmw_balloon.c: determine page allocation flag can_sleep outside loop
In vmballoon_reserve_page(), flags has been passed from the callee function (vmballoon_inflate here). So, we can determine can_sleep outside the loop. Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com> Acked-by: Dmitry Torokhov <dtor@vmware.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
3fd306c85a
commit
6d994a7e42
1 changed files with 1 additions and 1 deletions
|
@ -412,6 +412,7 @@ static int vmballoon_reserve_page(struct vmballoon *b, bool can_sleep)
|
|||
gfp_t flags;
|
||||
unsigned int hv_status;
|
||||
bool locked = false;
|
||||
flags = can_sleep ? VMW_PAGE_ALLOC_CANSLEEP : VMW_PAGE_ALLOC_NOSLEEP;
|
||||
|
||||
do {
|
||||
if (!can_sleep)
|
||||
|
@ -419,7 +420,6 @@ static int vmballoon_reserve_page(struct vmballoon *b, bool can_sleep)
|
|||
else
|
||||
STATS_INC(b->stats.sleep_alloc);
|
||||
|
||||
flags = can_sleep ? VMW_PAGE_ALLOC_CANSLEEP : VMW_PAGE_ALLOC_NOSLEEP;
|
||||
page = alloc_page(flags);
|
||||
if (!page) {
|
||||
if (!can_sleep)
|
||||
|
|
Loading…
Reference in a new issue