diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2005-10-21 02:55:38 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-28 11:16:46 -0400 |
commit | af4ca457eaf2d6682059c18463eb106e2ce58198 (patch) | |
tree | 399ca5ab3b15d723a6aefd04c764a2a06089ed06 /mm | |
parent | 434f1d10c1adb6c2e333d501ce1e42be610e0723 (diff) |
[PATCH] gfp_t: infrastructure
Beginning of gfp_t annotations:
- -Wbitwise added to CHECKFLAGS
- old __bitwise renamed to __bitwise__
- __bitwise defined to either __bitwise__ or nothing, depending on
__CHECK_ENDIAN__ being defined
- gfp_t switched from __nocast to __bitwise__
- force cast to gfp_t added to __GFP_... constants
- new helper - gfp_zone(); extracts zone bits out of gfp_t value and casts
the result to int
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/mempolicy.c | 6 | ||||
-rw-r--r-- | mm/page_alloc.c | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 37af443eb094..1d5c64df1653 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c | |||
@@ -700,7 +700,7 @@ static struct zonelist *zonelist_policy(gfp_t gfp, struct mempolicy *policy) | |||
700 | case MPOL_BIND: | 700 | case MPOL_BIND: |
701 | /* Lower zones don't get a policy applied */ | 701 | /* Lower zones don't get a policy applied */ |
702 | /* Careful: current->mems_allowed might have moved */ | 702 | /* Careful: current->mems_allowed might have moved */ |
703 | if ((gfp & GFP_ZONEMASK) >= policy_zone) | 703 | if (gfp_zone(gfp) >= policy_zone) |
704 | if (cpuset_zonelist_valid_mems_allowed(policy->v.zonelist)) | 704 | if (cpuset_zonelist_valid_mems_allowed(policy->v.zonelist)) |
705 | return policy->v.zonelist; | 705 | return policy->v.zonelist; |
706 | /*FALL THROUGH*/ | 706 | /*FALL THROUGH*/ |
@@ -712,7 +712,7 @@ static struct zonelist *zonelist_policy(gfp_t gfp, struct mempolicy *policy) | |||
712 | nd = 0; | 712 | nd = 0; |
713 | BUG(); | 713 | BUG(); |
714 | } | 714 | } |
715 | return NODE_DATA(nd)->node_zonelists + (gfp & GFP_ZONEMASK); | 715 | return NODE_DATA(nd)->node_zonelists + gfp_zone(gfp); |
716 | } | 716 | } |
717 | 717 | ||
718 | /* Do dynamic interleaving for a process */ | 718 | /* Do dynamic interleaving for a process */ |
@@ -757,7 +757,7 @@ static struct page *alloc_page_interleave(gfp_t gfp, unsigned order, unsigned ni | |||
757 | struct page *page; | 757 | struct page *page; |
758 | 758 | ||
759 | BUG_ON(!node_online(nid)); | 759 | BUG_ON(!node_online(nid)); |
760 | zl = NODE_DATA(nid)->node_zonelists + (gfp & GFP_ZONEMASK); | 760 | zl = NODE_DATA(nid)->node_zonelists + gfp_zone(gfp); |
761 | page = __alloc_pages(gfp, order, zl); | 761 | page = __alloc_pages(gfp, order, zl); |
762 | if (page && page_zone(page) == zl->zones[0]) { | 762 | if (page && page_zone(page) == zl->zones[0]) { |
763 | zone_pcp(zl->zones[0],get_cpu())->interleave_hit++; | 763 | zone_pcp(zl->zones[0],get_cpu())->interleave_hit++; |
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index e1d3d77f4aee..aa43ae3ab8c9 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -1089,7 +1089,7 @@ static unsigned int nr_free_zone_pages(int offset) | |||
1089 | */ | 1089 | */ |
1090 | unsigned int nr_free_buffer_pages(void) | 1090 | unsigned int nr_free_buffer_pages(void) |
1091 | { | 1091 | { |
1092 | return nr_free_zone_pages(GFP_USER & GFP_ZONEMASK); | 1092 | return nr_free_zone_pages(gfp_zone(GFP_USER)); |
1093 | } | 1093 | } |
1094 | 1094 | ||
1095 | /* | 1095 | /* |
@@ -1097,7 +1097,7 @@ unsigned int nr_free_buffer_pages(void) | |||
1097 | */ | 1097 | */ |
1098 | unsigned int nr_free_pagecache_pages(void) | 1098 | unsigned int nr_free_pagecache_pages(void) |
1099 | { | 1099 | { |
1100 | return nr_free_zone_pages(GFP_HIGHUSER & GFP_ZONEMASK); | 1100 | return nr_free_zone_pages(gfp_zone(GFP_HIGHUSER)); |
1101 | } | 1101 | } |
1102 | 1102 | ||
1103 | #ifdef CONFIG_HIGHMEM | 1103 | #ifdef CONFIG_HIGHMEM |