* [PATCH] unless signed chg cannot become less than 0
@ 2009-01-18 12:42 Roel Kluin
0 siblings, 0 replies; only message in thread
From: Roel Kluin @ 2009-01-18 12:42 UTC (permalink / raw
To: wli; +Cc: lkml
region_chg returns long, so let vma_needs_reservation() forward this to
alloc_huge_page(). and do not store it in an unsigned, since a negative
will go unnoticed. Store it as long as well. all callers treat it as
long anyway.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 618e983..f0eec5e 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -918,7 +918,7 @@ static void return_unused_surplus_pages(struct hstate *h,
* an instantiated the change should be committed via vma_commit_reservation.
* No action is required on failure.
*/
-static int vma_needs_reservation(struct hstate *h,
+static long vma_needs_reservation(struct hstate *h,
struct vm_area_struct *vma, unsigned long addr)
{
struct address_space *mapping = vma->vm_file->f_mapping;
@@ -933,7 +933,7 @@ static int vma_needs_reservation(struct hstate *h,
return 1;
} else {
- int err;
+ long err;
pgoff_t idx = vma_hugecache_offset(h, vma, addr);
struct resv_map *reservations = vma_resv_map(vma);
@@ -969,7 +969,7 @@ static struct page *alloc_huge_page(struct vm_area_struct *vma,
struct page *page;
struct address_space *mapping = vma->vm_file->f_mapping;
struct inode *inode = mapping->host;
- unsigned int chg;
+ long chg;
/*
* Processes that did not create the mapping will have no reserves and
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-01-18 12:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-18 12:42 [PATCH] unless signed chg cannot become less than 0 Roel Kluin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).