Rename and export the pool counter update interface. Signed-off-by: Andy Whitcroft <[EMAIL PROTECTED]> Acked-by: Adam Litke <[EMAIL PROTECTED]> --- hugetlbfs.h | 2 ++ hugeutils.c | 26 +++++++++++++------------- 2 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/hugetlbfs.h b/hugetlbfs.h index 2103515..fbff43b 100644 --- a/hugetlbfs.h +++ b/hugetlbfs.h @@ -70,6 +70,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 222f06a..5209f55 100644 --- a/hugeutils.c +++ b/hugeutils.c @@ -264,17 +264,6 @@ int select_pool_counter(unsigned int counter, unsigned long pagesize, return 0; } -int set_pool_counter(unsigned long pagesize, unsigned int counter, - unsigned long val) -{ - char file[PATH_MAX+1]; - - if (select_pool_counter(counter, pagesize, file, NULL)) - return -1; - - return file_write_ulong(file, val); -} - static int hpage_size_to_index(unsigned long size) { int i; @@ -720,14 +709,25 @@ long get_huge_page_counter(long pagesize, unsigned int counter) return file_read_ulong(file, key); } +int set_huge_page_counter(long pagesize, unsigned int counter, + unsigned long val) +{ + char file[PATH_MAX+1]; + + if (select_pool_counter(counter, pagesize, file, NULL)) + return -1; + + return file_write_ulong(file, val); +} + 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