Adds a create-global-mounts option that builds and mounts a mount point for each huge page size available. The mounts will be under /var/lib/hugetlbfs/global, they will be owned by root:root and will be set to 1777.
Signed-off-by: Eric B Munson <ebmun...@us.ibm.com> --- Changes from V2: Rebase to new mount point creation code Changes from V2: Update hugeadm man page with new options Changes from V1: Ensure that the base MOUNTS_DIR is readable by all hugeadm.c | 13 ++++++++++++- man/hugeadm.8 | 8 ++++++++ 2 files changed, 20 insertions(+), 1 deletions(-) diff --git a/hugeadm.c b/hugeadm.c index 3e492dc..993ebae 100644 --- a/hugeadm.c +++ b/hugeadm.c @@ -81,6 +81,10 @@ void print_usage() CONT("Creates a mount point for each available huge"); CONT("page size under /var/lib/hugetlbfs/<group>"); CONT("usable by group <group>"); + OPTION("--create-global-mounts", ""); + CONT("Creates a mount point for each available huge"); + CONT("page size under /var/lib/hugetlbfs/global"); + CONT("for use by anyone"); OPTION("--page-sizes", "Display page sizes that a configured pool"); OPTION("--page-sizes-all", @@ -109,7 +113,8 @@ int opt_dry_run = 0; #define LONG_MOUNTS ('m' << 8) #define LONG_CREATE_MOUNTS (LONG_MOUNTS|'C') #define LONG_CREATE_USER_MOUNTS (LONG_MOUNTS|'U') -#define LONG_CREATE_GROUP_MOUNTS (LONG_MOUNTS|'G') +#define LONG_CREATE_GROUP_MOUNTS (LONG_MOUNTS|'g') +#define LONG_CREATE_GLOBAL_MOUNTS (LONG_MOUNTS|'G') #define LONG_LIST_ALL_MOUNTS (LONG_MOUNTS|'A') #define MAX_POOLS 32 @@ -553,6 +558,7 @@ int main(int argc, char** argv) {"create-mounts", no_argument, NULL, LONG_CREATE_MOUNTS}, {"create-user-mounts", required_argument, NULL, LONG_CREATE_USER_MOUNTS}, {"create-group-mounts", required_argument, NULL, LONG_CREATE_GROUP_MOUNTS}, + {"create-global-mounts", no_argument, NULL, LONG_CREATE_GLOBAL_MOUNTS}, {"page-sizes", no_argument, NULL, LONG_PAGE_SIZES}, {"page-sizes-all", no_argument, NULL, LONG_PAGE_AVAIL}, @@ -633,6 +639,11 @@ int main(int argc, char** argv) create_mounts(NULL, optarg, base, S_IRWXG); break; + case LONG_CREATE_GLOBAL_MOUNTS: + snprintf(base, PATH_MAX, "%s/global", MOUNT_DIR); + create_mounts(NULL, NULL, base, S_IRWXU | S_IRWXG | S_IRWXO); + break; + case LONG_PAGE_SIZES: page_sizes(0); break; diff --git a/man/hugeadm.8 b/man/hugeadm.8 index 8cf5b5a..752efec 100644 --- a/man/hugeadm.8 +++ b/man/hugeadm.8 @@ -55,6 +55,14 @@ This creates mount points for each supported huge page size under --create-mounts. After creation they are mounted and are owned by root:<group> with permissions set to 070. +.TP +.B --create-global-mounts + +This creates mount points for each supported huge page size under +/var/lib/hugetlbfs/global. Mount point naming is the same as +--create-mounts. After creation they are mounted and are owned by +root:root with permissions set to 1777. + The following options display information about the pools. .TP -- 1.6.0.3 ------------------------------------------------------------------------------ Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM) software. With Adobe AIR, Ajax developers can use existing skills and code to build responsive, highly engaging applications that combine the power of local resources and data with the reach of the web. Download the Adobe AIR SDK and Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com _______________________________________________ Libhugetlbfs-devel mailing list Libhugetlbfs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel