On Fri, 27 Feb 2015 14:58:10 -0800 Mike Kravetz <mike.kravetz@xxxxxxxxxx> wrote:
Add a boolean to the subpool structure to indicate that the pages for
subpool have been reserved. The hstate pointer in the subpool is
convienient to have when it comes time to unreserve the pages.
subool_reserved() is a handy way to check if reserved and take into
account a NULL subpool.
...
@@ -38,6 +40,10 @@ extern int hugetlb_max_hstate __read_mostly;
#define for_each_hstate(h) \
for ((h) = hstates; (h) < &hstates[hugetlb_max_hstate]; (h)++)
+static inline bool subpool_reserved(struct hugepage_subpool *spool)
+{
+ return spool && spool->reserved;
+}
"subpool_reserved" is not a good identifier.
struct hugepage_subpool *hugepage_new_subpool(long nr_blocks);
void hugepage_put_subpool(struct hugepage_subpool *spool);
See what they did?