Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 287397
b: refs/heads/master
c: 3e5ba46
h: refs/heads/master
i:
  287395: 785e85f
v: v3
  • Loading branch information
Danny Kukawka authored and Greg Kroah-Hartman committed Feb 3, 2012
1 parent 834f856 commit e9a9170
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 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: 7c5763b8453a94871d356f20df30f350f8631e8b
refs/heads/master: 3e5ba466d515eb3fb1e0e975a3d8e499126ae2b5
14 changes: 7 additions & 7 deletions trunk/drivers/misc/vmw_balloon.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,25 +314,25 @@ static bool vmballoon_send_get_target(struct vmballoon *b, u32 *new_target)
* fear that guest will need it. Host may reject some pages, we need to
* check the return value and maybe submit a different page.
*/
static bool vmballoon_send_lock_page(struct vmballoon *b, unsigned long pfn,
static int vmballoon_send_lock_page(struct vmballoon *b, unsigned long pfn,
unsigned int *hv_status)
{
unsigned long status, dummy;
u32 pfn32;

pfn32 = (u32)pfn;
if (pfn32 != pfn)
return false;
return -1;

STATS_INC(b->stats.lock);

*hv_status = status = VMWARE_BALLOON_CMD(LOCK, pfn, dummy);
if (vmballoon_check_status(b, status))
return true;
return 0;

pr_debug("%s - ppn %lx, hv returns %ld\n", __func__, pfn, status);
STATS_INC(b->stats.lock_fail);
return false;
return 1;
}

/*
Expand Down Expand Up @@ -411,7 +411,7 @@ static int vmballoon_reserve_page(struct vmballoon *b, bool can_sleep)
struct page *page;
gfp_t flags;
unsigned int hv_status;
bool locked = false;
int locked;
flags = can_sleep ? VMW_PAGE_ALLOC_CANSLEEP : VMW_PAGE_ALLOC_NOSLEEP;

do {
Expand All @@ -431,7 +431,7 @@ static int vmballoon_reserve_page(struct vmballoon *b, bool can_sleep)

/* inform monitor */
locked = vmballoon_send_lock_page(b, page_to_pfn(page), &hv_status);
if (!locked) {
if (locked > 0) {
STATS_INC(b->stats.refused_alloc);

if (hv_status == VMW_BALLOON_ERROR_RESET ||
Expand All @@ -449,7 +449,7 @@ static int vmballoon_reserve_page(struct vmballoon *b, bool can_sleep)
if (++b->n_refused_pages >= VMW_BALLOON_MAX_REFUSED)
return -EIO;
}
} while (!locked);
} while (locked != 0);

/* track allocated page */
list_add(&page->lru, &b->pages);
Expand Down

0 comments on commit e9a9170

Please sign in to comment.