Rename and export the pool counter update interface.

Signed-off-by: Andy Whitcroft <[EMAIL PROTECTED]>
---
 hugetlbfs.h |    2 ++
 hugeutils.c |    8 ++++----
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/hugetlbfs.h b/hugetlbfs.h
index 54fa13b..985e138 100644
--- a/hugetlbfs.h
+++ b/hugetlbfs.h
@@ -71,6 +71,8 @@ enum {                         /* The number of pages of a 
given size that ... */
        HUGEPAGES_MAX_COUNTERS,
 };
 long get_huge_page_counter(long pagesize, unsigned int counter);
+int set_huge_page_counter(long pagesize, unsigned int counter,
+                                                       unsigned long val);
 int set_nr_hugepages(long pagesize, unsigned long val);
 int set_nr_overcommit_hugepages(long pagesize, unsigned long val);
 long read_meminfo(const char *tag);
diff --git a/hugeutils.c b/hugeutils.c
index 3eb9af6..da3afd5 100644
--- a/hugeutils.c
+++ b/hugeutils.c
@@ -189,7 +189,7 @@ static long file_read_ulong(char *file, const char *tag)
                p = buf;
 
        val = strtol(p, &q, 0);
-       if (! isspace(*q)) {
+       if (*q && ! isspace(*q)) {
                ERROR("Couldn't parse %s value\n", file);
                return -1;
        }
@@ -255,7 +255,7 @@ static int select_pool_counter(unsigned int counter, 
unsigned long pagesize,
        return 0;
 }
 
-static int set_pool_counter(long pagesize, unsigned int counter,
+int set_huge_page_counter(long pagesize, unsigned int counter,
                        unsigned long val)
 {
        char file[PATH_MAX+1];
@@ -776,12 +776,12 @@ long get_huge_page_counter(long pagesize, unsigned int 
counter)
 
 int set_nr_hugepages(long pagesize, unsigned long val)
 {
-       return set_pool_counter(pagesize, HUGEPAGES_TOTAL, val);
+       return set_huge_page_counter(pagesize, HUGEPAGES_TOTAL, val);
 }
 
 int set_nr_overcommit_hugepages(long pagesize, unsigned long val)
 {
-       return set_pool_counter(pagesize, HUGEPAGES_OC, val);
+       return set_huge_page_counter(pagesize, HUGEPAGES_OC, val);
 }
 
 /********************************************************************/
-- 
1.6.0.1.451.gc8d31


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Libhugetlbfs-devel mailing list
Libhugetlbfs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel

Reply via email to