On Wed, 2008-09-10 at 11:11 +1000, David Gibson wrote: > On Tue, Sep 09, 2008 at 08:20:28PM +0000, Adam Litke wrote: > > Allow applications that program to the libhugetlbfs API to specify a page > > size > > when requesting a hugetlbfs fd. If the size is invalid or not configured, > > an > > error will be returned. > > > > Signed-off-by: Adam Litke <[EMAIL PROTECTED]> > > [snip] > > +int hugetlbfs_unlinked_fd_for_size(long page_size) > > { > > const char *path; > > char name[PATH_MAX+1]; > > int fd; > > > > - path = hugetlbfs_find_path(); > > + if (page_size == 0) > > + page_size = hpage_sizes[hpage_sizes_default_idx].pagesize; > > + > > + path = hugetlbfs_find_path_for_size(page_size); > > Can't you just pass page_size through here, even if it's zero. > hugetlbfs_find_path_for_size() already knows how to look up the > default page size.
You are absolutely correct. Thanks for the review. -- Adam Litke - (agl at us.ibm.com) IBM Linux Technology Center ------------------------------------------------------------------------- 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