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:
Rakib Mullick 2011-11-02 13:40:04 -07:00 коммит произвёл Linus Torvalds
Родитель 3fd306c85a
Коммит 6d994a7e42
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -412,6 +412,7 @@ static int vmballoon_reserve_page(struct vmballoon *b, bool can_sleep)
gfp_t flags; gfp_t flags;
unsigned int hv_status; unsigned int hv_status;
bool locked = false; bool locked = false;
flags = can_sleep ? VMW_PAGE_ALLOC_CANSLEEP : VMW_PAGE_ALLOC_NOSLEEP;
do { do {
if (!can_sleep) if (!can_sleep)
@ -419,7 +420,6 @@ static int vmballoon_reserve_page(struct vmballoon *b, bool can_sleep)
else else
STATS_INC(b->stats.sleep_alloc); STATS_INC(b->stats.sleep_alloc);
flags = can_sleep ? VMW_PAGE_ALLOC_CANSLEEP : VMW_PAGE_ALLOC_NOSLEEP;
page = alloc_page(flags); page = alloc_page(flags);
if (!page) { if (!page) {
if (!can_sleep) if (!can_sleep)