summaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorRakib Mullick <rakib.mullick@gmail.com>2011-11-02 21:40:04 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2011-11-03 00:07:03 +0100
commit6d994a7e42ab219ba3c10d5ffccf20990252881e (patch)
treedc10f63454fa7baa3ac379e54550d44832ae7c0c /drivers/misc
parentw1: disable irqs in critical section (diff)
downloadlinux-6d994a7e42ab219ba3c10d5ffccf20990252881e.tar.xz
linux-6d994a7e42ab219ba3c10d5ffccf20990252881e.zip
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>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/vmw_balloon.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/misc/vmw_balloon.c b/drivers/misc/vmw_balloon.c
index 053d36caf955..6983d80563cb 100644
--- a/drivers/misc/vmw_balloon.c
+++ b/drivers/misc/vmw_balloon.c
@@ -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)