diff options
Diffstat (limited to 'include/linux')
33 files changed, 126 insertions, 164 deletions
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h index 9f374cfa1b05..e7d0593bb576 100644 --- a/include/linux/atmdev.h +++ b/include/linux/atmdev.h | |||
@@ -76,6 +76,13 @@ struct atm_dev_stats { | |||
76 | /* set interface ESI */ | 76 | /* set interface ESI */ |
77 | #define ATM_SETESIF _IOW('a',ATMIOC_ITF+13,struct atmif_sioc) | 77 | #define ATM_SETESIF _IOW('a',ATMIOC_ITF+13,struct atmif_sioc) |
78 | /* force interface ESI */ | 78 | /* force interface ESI */ |
79 | #define ATM_ADDLECSADDR _IOW('a', ATMIOC_ITF+14, struct atmif_sioc) | ||
80 | /* register a LECS address */ | ||
81 | #define ATM_DELLECSADDR _IOW('a', ATMIOC_ITF+15, struct atmif_sioc) | ||
82 | /* unregister a LECS address */ | ||
83 | #define ATM_GETLECSADDR _IOW('a', ATMIOC_ITF+16, struct atmif_sioc) | ||
84 | /* retrieve LECS address(es) */ | ||
85 | |||
79 | #define ATM_GETSTAT _IOW('a',ATMIOC_SARCOM+0,struct atmif_sioc) | 86 | #define ATM_GETSTAT _IOW('a',ATMIOC_SARCOM+0,struct atmif_sioc) |
80 | /* get AAL layer statistics */ | 87 | /* get AAL layer statistics */ |
81 | #define ATM_GETSTATZ _IOW('a',ATMIOC_SARCOM+1,struct atmif_sioc) | 88 | #define ATM_GETSTATZ _IOW('a',ATMIOC_SARCOM+1,struct atmif_sioc) |
@@ -328,6 +335,8 @@ struct atm_dev_addr { | |||
328 | struct list_head entry; /* next address */ | 335 | struct list_head entry; /* next address */ |
329 | }; | 336 | }; |
330 | 337 | ||
338 | enum atm_addr_type_t { ATM_ADDR_LOCAL, ATM_ADDR_LECS }; | ||
339 | |||
331 | struct atm_dev { | 340 | struct atm_dev { |
332 | const struct atmdev_ops *ops; /* device operations; NULL if unused */ | 341 | const struct atmdev_ops *ops; /* device operations; NULL if unused */ |
333 | const struct atmphy_ops *phy; /* PHY operations, may be undefined */ | 342 | const struct atmphy_ops *phy; /* PHY operations, may be undefined */ |
@@ -338,6 +347,7 @@ struct atm_dev { | |||
338 | void *phy_data; /* private PHY date */ | 347 | void *phy_data; /* private PHY date */ |
339 | unsigned long flags; /* device flags (ATM_DF_*) */ | 348 | unsigned long flags; /* device flags (ATM_DF_*) */ |
340 | struct list_head local; /* local ATM addresses */ | 349 | struct list_head local; /* local ATM addresses */ |
350 | struct list_head lecs; /* LECS ATM addresses learned via ILMI */ | ||
341 | unsigned char esi[ESI_LEN]; /* ESI ("MAC" addr) */ | 351 | unsigned char esi[ESI_LEN]; /* ESI ("MAC" addr) */ |
342 | struct atm_cirange ci_range; /* VPI/VCI range */ | 352 | struct atm_cirange ci_range; /* VPI/VCI range */ |
343 | struct k_atm_dev_stats stats; /* statistics */ | 353 | struct k_atm_dev_stats stats; /* statistics */ |
@@ -457,7 +467,7 @@ static inline void atm_dev_put(struct atm_dev *dev) | |||
457 | 467 | ||
458 | int atm_charge(struct atm_vcc *vcc,int truesize); | 468 | int atm_charge(struct atm_vcc *vcc,int truesize); |
459 | struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc,int pdu_size, | 469 | struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc,int pdu_size, |
460 | int gfp_flags); | 470 | gfp_t gfp_flags); |
461 | int atm_pcr_goal(struct atm_trafprm *tp); | 471 | int atm_pcr_goal(struct atm_trafprm *tp); |
462 | 472 | ||
463 | void vcc_release_async(struct atm_vcc *vcc, int reply); | 473 | void vcc_release_async(struct atm_vcc *vcc, int reply); |
diff --git a/include/linux/bio.h b/include/linux/bio.h index 6e1c79c8b6bf..3344b4e8e43a 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
@@ -276,8 +276,8 @@ extern void bio_pair_release(struct bio_pair *dbio); | |||
276 | extern struct bio_set *bioset_create(int, int, int); | 276 | extern struct bio_set *bioset_create(int, int, int); |
277 | extern void bioset_free(struct bio_set *); | 277 | extern void bioset_free(struct bio_set *); |
278 | 278 | ||
279 | extern struct bio *bio_alloc(unsigned int __nocast, int); | 279 | extern struct bio *bio_alloc(gfp_t, int); |
280 | extern struct bio *bio_alloc_bioset(unsigned int __nocast, int, struct bio_set *); | 280 | extern struct bio *bio_alloc_bioset(gfp_t, int, struct bio_set *); |
281 | extern void bio_put(struct bio *); | 281 | extern void bio_put(struct bio *); |
282 | extern void bio_free(struct bio *, struct bio_set *); | 282 | extern void bio_free(struct bio *, struct bio_set *); |
283 | 283 | ||
@@ -287,7 +287,7 @@ extern int bio_phys_segments(struct request_queue *, struct bio *); | |||
287 | extern int bio_hw_segments(struct request_queue *, struct bio *); | 287 | extern int bio_hw_segments(struct request_queue *, struct bio *); |
288 | 288 | ||
289 | extern void __bio_clone(struct bio *, struct bio *); | 289 | extern void __bio_clone(struct bio *, struct bio *); |
290 | extern struct bio *bio_clone(struct bio *, unsigned int __nocast); | 290 | extern struct bio *bio_clone(struct bio *, gfp_t); |
291 | 291 | ||
292 | extern void bio_init(struct bio *); | 292 | extern void bio_init(struct bio *); |
293 | 293 | ||
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 90828493791f..6a1d154c0825 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h | |||
@@ -172,7 +172,7 @@ void __brelse(struct buffer_head *); | |||
172 | void __bforget(struct buffer_head *); | 172 | void __bforget(struct buffer_head *); |
173 | void __breadahead(struct block_device *, sector_t block, int size); | 173 | void __breadahead(struct block_device *, sector_t block, int size); |
174 | struct buffer_head *__bread(struct block_device *, sector_t block, int size); | 174 | struct buffer_head *__bread(struct block_device *, sector_t block, int size); |
175 | struct buffer_head *alloc_buffer_head(unsigned int __nocast gfp_flags); | 175 | struct buffer_head *alloc_buffer_head(gfp_t gfp_flags); |
176 | void free_buffer_head(struct buffer_head * bh); | 176 | void free_buffer_head(struct buffer_head * bh); |
177 | void FASTCALL(unlock_buffer(struct buffer_head *bh)); | 177 | void FASTCALL(unlock_buffer(struct buffer_head *bh)); |
178 | void FASTCALL(__lock_buffer(struct buffer_head *bh)); | 178 | void FASTCALL(__lock_buffer(struct buffer_head *bh)); |
diff --git a/include/linux/connector.h b/include/linux/connector.h index 86d4b0a81713..95952cc1f525 100644 --- a/include/linux/connector.h +++ b/include/linux/connector.h | |||
@@ -149,7 +149,7 @@ struct cn_dev { | |||
149 | 149 | ||
150 | int cn_add_callback(struct cb_id *, char *, void (*callback) (void *)); | 150 | int cn_add_callback(struct cb_id *, char *, void (*callback) (void *)); |
151 | void cn_del_callback(struct cb_id *); | 151 | void cn_del_callback(struct cb_id *); |
152 | int cn_netlink_send(struct cn_msg *, u32, int); | 152 | int cn_netlink_send(struct cn_msg *, u32, gfp_t); |
153 | 153 | ||
154 | int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id, void (*callback)(void *)); | 154 | int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id, void (*callback)(void *)); |
155 | void cn_queue_del_callback(struct cn_queue_dev *dev, struct cb_id *id); | 155 | void cn_queue_del_callback(struct cn_queue_dev *dev, struct cb_id *id); |
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index b15826f6e3a2..fe9778301d07 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
@@ -392,4 +392,16 @@ extern cpumask_t cpu_present_map; | |||
392 | #define for_each_online_cpu(cpu) for_each_cpu_mask((cpu), cpu_online_map) | 392 | #define for_each_online_cpu(cpu) for_each_cpu_mask((cpu), cpu_online_map) |
393 | #define for_each_present_cpu(cpu) for_each_cpu_mask((cpu), cpu_present_map) | 393 | #define for_each_present_cpu(cpu) for_each_cpu_mask((cpu), cpu_present_map) |
394 | 394 | ||
395 | /* Find the highest possible smp_processor_id() */ | ||
396 | static inline unsigned int highest_possible_processor_id(void) | ||
397 | { | ||
398 | unsigned int cpu, highest = 0; | ||
399 | |||
400 | for_each_cpu_mask(cpu, cpu_possible_map) | ||
401 | highest = cpu; | ||
402 | |||
403 | return highest; | ||
404 | } | ||
405 | |||
406 | |||
395 | #endif /* __LINUX_CPUMASK_H */ | 407 | #endif /* __LINUX_CPUMASK_H */ |
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h index 24062a1dbf61..6e2deef96b34 100644 --- a/include/linux/cpuset.h +++ b/include/linux/cpuset.h | |||
@@ -23,7 +23,7 @@ void cpuset_init_current_mems_allowed(void); | |||
23 | void cpuset_update_current_mems_allowed(void); | 23 | void cpuset_update_current_mems_allowed(void); |
24 | void cpuset_restrict_to_mems_allowed(unsigned long *nodes); | 24 | void cpuset_restrict_to_mems_allowed(unsigned long *nodes); |
25 | int cpuset_zonelist_valid_mems_allowed(struct zonelist *zl); | 25 | int cpuset_zonelist_valid_mems_allowed(struct zonelist *zl); |
26 | extern int cpuset_zone_allowed(struct zone *z, unsigned int __nocast gfp_mask); | 26 | extern int cpuset_zone_allowed(struct zone *z, gfp_t gfp_mask); |
27 | extern int cpuset_excl_nodes_overlap(const struct task_struct *p); | 27 | extern int cpuset_excl_nodes_overlap(const struct task_struct *p); |
28 | extern struct file_operations proc_cpuset_operations; | 28 | extern struct file_operations proc_cpuset_operations; |
29 | extern char *cpuset_task_status_allowed(struct task_struct *task, char *buffer); | 29 | extern char *cpuset_task_status_allowed(struct task_struct *task, char *buffer); |
@@ -49,8 +49,7 @@ static inline int cpuset_zonelist_valid_mems_allowed(struct zonelist *zl) | |||
49 | return 1; | 49 | return 1; |
50 | } | 50 | } |
51 | 51 | ||
52 | static inline int cpuset_zone_allowed(struct zone *z, | 52 | static inline int cpuset_zone_allowed(struct zone *z, gfp_t gfp_mask) |
53 | unsigned int __nocast gfp_mask) | ||
54 | { | 53 | { |
55 | return 1; | 54 | return 1; |
56 | } | 55 | } |
diff --git a/include/linux/dmapool.h b/include/linux/dmapool.h index 4932ee5c77f0..76f12f46db7f 100644 --- a/include/linux/dmapool.h +++ b/include/linux/dmapool.h | |||
@@ -19,7 +19,7 @@ struct dma_pool *dma_pool_create(const char *name, struct device *dev, | |||
19 | 19 | ||
20 | void dma_pool_destroy(struct dma_pool *pool); | 20 | void dma_pool_destroy(struct dma_pool *pool); |
21 | 21 | ||
22 | void *dma_pool_alloc(struct dma_pool *pool, unsigned int __nocast mem_flags, | 22 | void *dma_pool_alloc(struct dma_pool *pool, gfp_t mem_flags, |
23 | dma_addr_t *handle); | 23 | dma_addr_t *handle); |
24 | 24 | ||
25 | void dma_pool_free(struct dma_pool *pool, void *vaddr, dma_addr_t addr); | 25 | void dma_pool_free(struct dma_pool *pool, void *vaddr, dma_addr_t addr); |
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 4dc990f3b5cc..3010e172394d 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -85,9 +85,9 @@ static inline void arch_free_page(struct page *page, int order) { } | |||
85 | #endif | 85 | #endif |
86 | 86 | ||
87 | extern struct page * | 87 | extern struct page * |
88 | FASTCALL(__alloc_pages(unsigned int, unsigned int, struct zonelist *)); | 88 | FASTCALL(__alloc_pages(gfp_t, unsigned int, struct zonelist *)); |
89 | 89 | ||
90 | static inline struct page *alloc_pages_node(int nid, unsigned int __nocast gfp_mask, | 90 | static inline struct page *alloc_pages_node(int nid, gfp_t gfp_mask, |
91 | unsigned int order) | 91 | unsigned int order) |
92 | { | 92 | { |
93 | if (unlikely(order >= MAX_ORDER)) | 93 | if (unlikely(order >= MAX_ORDER)) |
@@ -98,17 +98,17 @@ static inline struct page *alloc_pages_node(int nid, unsigned int __nocast gfp_m | |||
98 | } | 98 | } |
99 | 99 | ||
100 | #ifdef CONFIG_NUMA | 100 | #ifdef CONFIG_NUMA |
101 | extern struct page *alloc_pages_current(unsigned int __nocast gfp_mask, unsigned order); | 101 | extern struct page *alloc_pages_current(gfp_t gfp_mask, unsigned order); |
102 | 102 | ||
103 | static inline struct page * | 103 | static inline struct page * |
104 | alloc_pages(unsigned int __nocast gfp_mask, unsigned int order) | 104 | alloc_pages(gfp_t gfp_mask, unsigned int order) |
105 | { | 105 | { |
106 | if (unlikely(order >= MAX_ORDER)) | 106 | if (unlikely(order >= MAX_ORDER)) |
107 | return NULL; | 107 | return NULL; |
108 | 108 | ||
109 | return alloc_pages_current(gfp_mask, order); | 109 | return alloc_pages_current(gfp_mask, order); |
110 | } | 110 | } |
111 | extern struct page *alloc_page_vma(unsigned __nocast gfp_mask, | 111 | extern struct page *alloc_page_vma(gfp_t gfp_mask, |
112 | struct vm_area_struct *vma, unsigned long addr); | 112 | struct vm_area_struct *vma, unsigned long addr); |
113 | #else | 113 | #else |
114 | #define alloc_pages(gfp_mask, order) \ | 114 | #define alloc_pages(gfp_mask, order) \ |
@@ -117,8 +117,8 @@ extern struct page *alloc_page_vma(unsigned __nocast gfp_mask, | |||
117 | #endif | 117 | #endif |
118 | #define alloc_page(gfp_mask) alloc_pages(gfp_mask, 0) | 118 | #define alloc_page(gfp_mask) alloc_pages(gfp_mask, 0) |
119 | 119 | ||
120 | extern unsigned long FASTCALL(__get_free_pages(unsigned int __nocast gfp_mask, unsigned int order)); | 120 | extern unsigned long FASTCALL(__get_free_pages(gfp_t gfp_mask, unsigned int order)); |
121 | extern unsigned long FASTCALL(get_zeroed_page(unsigned int __nocast gfp_mask)); | 121 | extern unsigned long FASTCALL(get_zeroed_page(gfp_t gfp_mask)); |
122 | 122 | ||
123 | #define __get_free_page(gfp_mask) \ | 123 | #define __get_free_page(gfp_mask) \ |
124 | __get_free_pages((gfp_mask),0) | 124 | __get_free_pages((gfp_mask),0) |
diff --git a/include/linux/jbd.h b/include/linux/jbd.h index de097269bd7f..ff853b3173c6 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h | |||
@@ -935,7 +935,7 @@ void journal_put_journal_head(struct journal_head *jh); | |||
935 | */ | 935 | */ |
936 | extern kmem_cache_t *jbd_handle_cache; | 936 | extern kmem_cache_t *jbd_handle_cache; |
937 | 937 | ||
938 | static inline handle_t *jbd_alloc_handle(unsigned int __nocast gfp_flags) | 938 | static inline handle_t *jbd_alloc_handle(gfp_t gfp_flags) |
939 | { | 939 | { |
940 | return kmem_cache_alloc(jbd_handle_cache, gfp_flags); | 940 | return kmem_cache_alloc(jbd_handle_cache, gfp_flags); |
941 | } | 941 | } |
diff --git a/include/linux/key-ui.h b/include/linux/key-ui.h index 918c34a8347e..7a2e332067c3 100644 --- a/include/linux/key-ui.h +++ b/include/linux/key-ui.h | |||
@@ -38,97 +38,16 @@ struct keyring_list { | |||
38 | struct key *keys[0]; | 38 | struct key *keys[0]; |
39 | }; | 39 | }; |
40 | 40 | ||
41 | |||
42 | /* | 41 | /* |
43 | * check to see whether permission is granted to use a key in the desired way | 42 | * check to see whether permission is granted to use a key in the desired way |
44 | */ | 43 | */ |
45 | static inline int key_permission(const key_ref_t key_ref, key_perm_t perm) | 44 | extern int key_task_permission(const key_ref_t key_ref, |
46 | { | 45 | struct task_struct *context, |
47 | struct key *key = key_ref_to_ptr(key_ref); | 46 | key_perm_t perm); |
48 | key_perm_t kperm; | ||
49 | |||
50 | if (is_key_possessed(key_ref)) | ||
51 | kperm = key->perm >> 24; | ||
52 | else if (key->uid == current->fsuid) | ||
53 | kperm = key->perm >> 16; | ||
54 | else if (key->gid != -1 && | ||
55 | key->perm & KEY_GRP_ALL && | ||
56 | in_group_p(key->gid) | ||
57 | ) | ||
58 | kperm = key->perm >> 8; | ||
59 | else | ||
60 | kperm = key->perm; | ||
61 | |||
62 | kperm = kperm & perm & KEY_ALL; | ||
63 | |||
64 | return kperm == perm; | ||
65 | } | ||
66 | |||
67 | /* | ||
68 | * check to see whether permission is granted to use a key in at least one of | ||
69 | * the desired ways | ||
70 | */ | ||
71 | static inline int key_any_permission(const key_ref_t key_ref, key_perm_t perm) | ||
72 | { | ||
73 | struct key *key = key_ref_to_ptr(key_ref); | ||
74 | key_perm_t kperm; | ||
75 | |||
76 | if (is_key_possessed(key_ref)) | ||
77 | kperm = key->perm >> 24; | ||
78 | else if (key->uid == current->fsuid) | ||
79 | kperm = key->perm >> 16; | ||
80 | else if (key->gid != -1 && | ||
81 | key->perm & KEY_GRP_ALL && | ||
82 | in_group_p(key->gid) | ||
83 | ) | ||
84 | kperm = key->perm >> 8; | ||
85 | else | ||
86 | kperm = key->perm; | ||
87 | 47 | ||
88 | kperm = kperm & perm & KEY_ALL; | 48 | static inline int key_permission(const key_ref_t key_ref, key_perm_t perm) |
89 | |||
90 | return kperm != 0; | ||
91 | } | ||
92 | |||
93 | static inline int key_task_groups_search(struct task_struct *tsk, gid_t gid) | ||
94 | { | ||
95 | int ret; | ||
96 | |||
97 | task_lock(tsk); | ||
98 | ret = groups_search(tsk->group_info, gid); | ||
99 | task_unlock(tsk); | ||
100 | return ret; | ||
101 | } | ||
102 | |||
103 | static inline int key_task_permission(const key_ref_t key_ref, | ||
104 | struct task_struct *context, | ||
105 | key_perm_t perm) | ||
106 | { | 49 | { |
107 | struct key *key = key_ref_to_ptr(key_ref); | 50 | return key_task_permission(key_ref, current, perm); |
108 | key_perm_t kperm; | ||
109 | |||
110 | if (is_key_possessed(key_ref)) { | ||
111 | kperm = key->perm >> 24; | ||
112 | } | ||
113 | else if (key->uid == context->fsuid) { | ||
114 | kperm = key->perm >> 16; | ||
115 | } | ||
116 | else if (key->gid != -1 && | ||
117 | key->perm & KEY_GRP_ALL && ( | ||
118 | key->gid == context->fsgid || | ||
119 | key_task_groups_search(context, key->gid) | ||
120 | ) | ||
121 | ) { | ||
122 | kperm = key->perm >> 8; | ||
123 | } | ||
124 | else { | ||
125 | kperm = key->perm; | ||
126 | } | ||
127 | |||
128 | kperm = kperm & perm & KEY_ALL; | ||
129 | |||
130 | return kperm == perm; | ||
131 | |||
132 | } | 51 | } |
133 | 52 | ||
134 | extern key_ref_t lookup_user_key(struct task_struct *context, | 53 | extern key_ref_t lookup_user_key(struct task_struct *context, |
diff --git a/include/linux/kfifo.h b/include/linux/kfifo.h index c27cd428d269..48eccd865bd8 100644 --- a/include/linux/kfifo.h +++ b/include/linux/kfifo.h | |||
@@ -35,8 +35,8 @@ struct kfifo { | |||
35 | }; | 35 | }; |
36 | 36 | ||
37 | extern struct kfifo *kfifo_init(unsigned char *buffer, unsigned int size, | 37 | extern struct kfifo *kfifo_init(unsigned char *buffer, unsigned int size, |
38 | unsigned int __nocast gfp_mask, spinlock_t *lock); | 38 | gfp_t gfp_mask, spinlock_t *lock); |
39 | extern struct kfifo *kfifo_alloc(unsigned int size, unsigned int __nocast gfp_mask, | 39 | extern struct kfifo *kfifo_alloc(unsigned int size, gfp_t gfp_mask, |
40 | spinlock_t *lock); | 40 | spinlock_t *lock); |
41 | extern void kfifo_free(struct kfifo *fifo); | 41 | extern void kfifo_free(struct kfifo *fifo); |
42 | extern unsigned int __kfifo_put(struct kfifo *fifo, | 42 | extern unsigned int __kfifo_put(struct kfifo *fifo, |
diff --git a/include/linux/mempool.h b/include/linux/mempool.h index 796220ce47cc..f2427d7394b0 100644 --- a/include/linux/mempool.h +++ b/include/linux/mempool.h | |||
@@ -6,7 +6,7 @@ | |||
6 | 6 | ||
7 | #include <linux/wait.h> | 7 | #include <linux/wait.h> |
8 | 8 | ||
9 | typedef void * (mempool_alloc_t)(unsigned int __nocast gfp_mask, void *pool_data); | 9 | typedef void * (mempool_alloc_t)(gfp_t gfp_mask, void *pool_data); |
10 | typedef void (mempool_free_t)(void *element, void *pool_data); | 10 | typedef void (mempool_free_t)(void *element, void *pool_data); |
11 | 11 | ||
12 | typedef struct mempool_s { | 12 | typedef struct mempool_s { |
@@ -26,17 +26,16 @@ extern mempool_t *mempool_create(int min_nr, mempool_alloc_t *alloc_fn, | |||
26 | extern mempool_t *mempool_create_node(int min_nr, mempool_alloc_t *alloc_fn, | 26 | extern mempool_t *mempool_create_node(int min_nr, mempool_alloc_t *alloc_fn, |
27 | mempool_free_t *free_fn, void *pool_data, int nid); | 27 | mempool_free_t *free_fn, void *pool_data, int nid); |
28 | 28 | ||
29 | extern int mempool_resize(mempool_t *pool, int new_min_nr, | 29 | extern int mempool_resize(mempool_t *pool, int new_min_nr, gfp_t gfp_mask); |
30 | unsigned int __nocast gfp_mask); | ||
31 | extern void mempool_destroy(mempool_t *pool); | 30 | extern void mempool_destroy(mempool_t *pool); |
32 | extern void * mempool_alloc(mempool_t *pool, unsigned int __nocast gfp_mask); | 31 | extern void * mempool_alloc(mempool_t *pool, gfp_t gfp_mask); |
33 | extern void mempool_free(void *element, mempool_t *pool); | 32 | extern void mempool_free(void *element, mempool_t *pool); |
34 | 33 | ||
35 | /* | 34 | /* |
36 | * A mempool_alloc_t and mempool_free_t that get the memory from | 35 | * A mempool_alloc_t and mempool_free_t that get the memory from |
37 | * a slab that is passed in through pool_data. | 36 | * a slab that is passed in through pool_data. |
38 | */ | 37 | */ |
39 | void *mempool_alloc_slab(unsigned int __nocast gfp_mask, void *pool_data); | 38 | void *mempool_alloc_slab(gfp_t gfp_mask, void *pool_data); |
40 | void mempool_free_slab(void *element, void *pool_data); | 39 | void mempool_free_slab(void *element, void *pool_data); |
41 | 40 | ||
42 | #endif /* _LINUX_MEMPOOL_H */ | 41 | #endif /* _LINUX_MEMPOOL_H */ |
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h index 1d5b10ae2399..f08e870100f4 100644 --- a/include/linux/netfilter/nfnetlink.h +++ b/include/linux/netfilter/nfnetlink.h | |||
@@ -41,11 +41,15 @@ enum nfnetlink_groups { | |||
41 | struct nfattr | 41 | struct nfattr |
42 | { | 42 | { |
43 | u_int16_t nfa_len; | 43 | u_int16_t nfa_len; |
44 | u_int16_t nfa_type; | 44 | u_int16_t nfa_type; /* we use 15 bits for the type, and the highest |
45 | * bit to indicate whether the payload is nested */ | ||
45 | } __attribute__ ((packed)); | 46 | } __attribute__ ((packed)); |
46 | 47 | ||
47 | /* FIXME: Shamelessly copy and pasted from rtnetlink.h, it's time | 48 | /* FIXME: Apart from NFNL_NFA_NESTED shamelessly copy and pasted from |
48 | * to put this in a generic file */ | 49 | * rtnetlink.h, it's time to put this in a generic file */ |
50 | |||
51 | #define NFNL_NFA_NEST 0x8000 | ||
52 | #define NFA_TYPE(attr) ((attr)->nfa_type & 0x7fff) | ||
49 | 53 | ||
50 | #define NFA_ALIGNTO 4 | 54 | #define NFA_ALIGNTO 4 |
51 | #define NFA_ALIGN(len) (((len) + NFA_ALIGNTO - 1) & ~(NFA_ALIGNTO - 1)) | 55 | #define NFA_ALIGN(len) (((len) + NFA_ALIGNTO - 1) & ~(NFA_ALIGNTO - 1)) |
@@ -59,7 +63,7 @@ struct nfattr | |||
59 | #define NFA_PAYLOAD(nfa) ((int)((nfa)->nfa_len) - NFA_LENGTH(0)) | 63 | #define NFA_PAYLOAD(nfa) ((int)((nfa)->nfa_len) - NFA_LENGTH(0)) |
60 | #define NFA_NEST(skb, type) \ | 64 | #define NFA_NEST(skb, type) \ |
61 | ({ struct nfattr *__start = (struct nfattr *) (skb)->tail; \ | 65 | ({ struct nfattr *__start = (struct nfattr *) (skb)->tail; \ |
62 | NFA_PUT(skb, type, 0, NULL); \ | 66 | NFA_PUT(skb, (NFNL_NFA_NEST | type), 0, NULL); \ |
63 | __start; }) | 67 | __start; }) |
64 | #define NFA_NEST_END(skb, start) \ | 68 | #define NFA_NEST_END(skb, start) \ |
65 | ({ (start)->nfa_len = ((skb)->tail - (unsigned char *) (start)); \ | 69 | ({ (start)->nfa_len = ((skb)->tail - (unsigned char *) (start)); \ |
diff --git a/include/linux/netfilter/nfnetlink_conntrack.h b/include/linux/netfilter/nfnetlink_conntrack.h index 5c55751c78e4..116fcaced909 100644 --- a/include/linux/netfilter/nfnetlink_conntrack.h +++ b/include/linux/netfilter/nfnetlink_conntrack.h | |||
@@ -70,15 +70,24 @@ enum ctattr_l4proto { | |||
70 | 70 | ||
71 | enum ctattr_protoinfo { | 71 | enum ctattr_protoinfo { |
72 | CTA_PROTOINFO_UNSPEC, | 72 | CTA_PROTOINFO_UNSPEC, |
73 | CTA_PROTOINFO_TCP_STATE, | 73 | CTA_PROTOINFO_TCP, |
74 | __CTA_PROTOINFO_MAX | 74 | __CTA_PROTOINFO_MAX |
75 | }; | 75 | }; |
76 | #define CTA_PROTOINFO_MAX (__CTA_PROTOINFO_MAX - 1) | 76 | #define CTA_PROTOINFO_MAX (__CTA_PROTOINFO_MAX - 1) |
77 | 77 | ||
78 | enum ctattr_protoinfo_tcp { | ||
79 | CTA_PROTOINFO_TCP_UNSPEC, | ||
80 | CTA_PROTOINFO_TCP_STATE, | ||
81 | __CTA_PROTOINFO_TCP_MAX | ||
82 | }; | ||
83 | #define CTA_PROTOINFO_TCP_MAX (__CTA_PROTOINFO_TCP_MAX - 1) | ||
84 | |||
78 | enum ctattr_counters { | 85 | enum ctattr_counters { |
79 | CTA_COUNTERS_UNSPEC, | 86 | CTA_COUNTERS_UNSPEC, |
80 | CTA_COUNTERS_PACKETS, | 87 | CTA_COUNTERS_PACKETS, /* old 64bit counters */ |
81 | CTA_COUNTERS_BYTES, | 88 | CTA_COUNTERS_BYTES, /* old 64bit counters */ |
89 | CTA_COUNTERS32_PACKETS, | ||
90 | CTA_COUNTERS32_BYTES, | ||
82 | __CTA_COUNTERS_MAX | 91 | __CTA_COUNTERS_MAX |
83 | }; | 92 | }; |
84 | #define CTA_COUNTERS_MAX (__CTA_COUNTERS_MAX - 1) | 93 | #define CTA_COUNTERS_MAX (__CTA_COUNTERS_MAX - 1) |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h index 4ced38736813..d078bb91d9e5 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack.h +++ b/include/linux/netfilter_ipv4/ip_conntrack.h | |||
@@ -117,6 +117,10 @@ enum ip_conntrack_events | |||
117 | /* NAT info */ | 117 | /* NAT info */ |
118 | IPCT_NATINFO_BIT = 10, | 118 | IPCT_NATINFO_BIT = 10, |
119 | IPCT_NATINFO = (1 << IPCT_NATINFO_BIT), | 119 | IPCT_NATINFO = (1 << IPCT_NATINFO_BIT), |
120 | |||
121 | /* Counter highest bit has been set */ | ||
122 | IPCT_COUNTER_FILLING_BIT = 11, | ||
123 | IPCT_COUNTER_FILLING = (1 << IPCT_COUNTER_FILLING_BIT), | ||
120 | }; | 124 | }; |
121 | 125 | ||
122 | enum ip_conntrack_expect_events { | 126 | enum ip_conntrack_expect_events { |
@@ -192,8 +196,8 @@ do { \ | |||
192 | 196 | ||
193 | struct ip_conntrack_counter | 197 | struct ip_conntrack_counter |
194 | { | 198 | { |
195 | u_int64_t packets; | 199 | u_int32_t packets; |
196 | u_int64_t bytes; | 200 | u_int32_t bytes; |
197 | }; | 201 | }; |
198 | 202 | ||
199 | struct ip_conntrack_helper; | 203 | struct ip_conntrack_helper; |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_protocol.h b/include/linux/netfilter_ipv4/ip_conntrack_protocol.h index b6b99be8632a..2c76b879e3dc 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_protocol.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_protocol.h | |||
@@ -52,6 +52,9 @@ struct ip_conntrack_protocol | |||
52 | int (*to_nfattr)(struct sk_buff *skb, struct nfattr *nfa, | 52 | int (*to_nfattr)(struct sk_buff *skb, struct nfattr *nfa, |
53 | const struct ip_conntrack *ct); | 53 | const struct ip_conntrack *ct); |
54 | 54 | ||
55 | /* convert nfnetlink attributes to protoinfo */ | ||
56 | int (*from_nfattr)(struct nfattr *tb[], struct ip_conntrack *ct); | ||
57 | |||
55 | int (*tuple_to_nfattr)(struct sk_buff *skb, | 58 | int (*tuple_to_nfattr)(struct sk_buff *skb, |
56 | const struct ip_conntrack_tuple *t); | 59 | const struct ip_conntrack_tuple *t); |
57 | int (*nfattr_to_tuple)(struct nfattr *tb[], | 60 | int (*nfattr_to_tuple)(struct nfattr *tb[], |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_tuple.h b/include/linux/netfilter_ipv4/ip_conntrack_tuple.h index 20e43f018b7c..3232db11a4e5 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_tuple.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_tuple.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef _IP_CONNTRACK_TUPLE_H | 1 | #ifndef _IP_CONNTRACK_TUPLE_H |
2 | #define _IP_CONNTRACK_TUPLE_H | 2 | #define _IP_CONNTRACK_TUPLE_H |
3 | 3 | ||
4 | #include <linux/types.h> | ||
5 | |||
4 | /* A `tuple' is a structure containing the information to uniquely | 6 | /* A `tuple' is a structure containing the information to uniquely |
5 | identify a connection. ie. if two packets have the same tuple, they | 7 | identify a connection. ie. if two packets have the same tuple, they |
6 | are in the same connection; if not, they are not. | 8 | are in the same connection; if not, they are not. |
diff --git a/include/linux/netfilter_ipv4/ip_nat.h b/include/linux/netfilter_ipv4/ip_nat.h index e201ec6e9905..41a107de17cf 100644 --- a/include/linux/netfilter_ipv4/ip_nat.h +++ b/include/linux/netfilter_ipv4/ip_nat.h | |||
@@ -58,10 +58,6 @@ extern rwlock_t ip_nat_lock; | |||
58 | struct ip_nat_info | 58 | struct ip_nat_info |
59 | { | 59 | { |
60 | struct list_head bysource; | 60 | struct list_head bysource; |
61 | |||
62 | /* Helper (NULL if none). */ | ||
63 | struct ip_nat_helper *helper; | ||
64 | |||
65 | struct ip_nat_seq seq[IP_CT_DIR_MAX]; | 61 | struct ip_nat_seq seq[IP_CT_DIR_MAX]; |
66 | }; | 62 | }; |
67 | 63 | ||
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index bdebdc564506..ba25ca874c20 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
@@ -131,7 +131,7 @@ extern struct sock *netlink_kernel_create(int unit, unsigned int groups, void (* | |||
131 | extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); | 131 | extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); |
132 | extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock); | 132 | extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock); |
133 | extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 pid, | 133 | extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 pid, |
134 | __u32 group, unsigned int __nocast allocation); | 134 | __u32 group, gfp_t allocation); |
135 | extern void netlink_set_err(struct sock *ssk, __u32 pid, __u32 group, int code); | 135 | extern void netlink_set_err(struct sock *ssk, __u32 pid, __u32 group, int code); |
136 | extern int netlink_register_notifier(struct notifier_block *nb); | 136 | extern int netlink_register_notifier(struct notifier_block *nb); |
137 | extern int netlink_unregister_notifier(struct notifier_block *nb); | 137 | extern int netlink_unregister_notifier(struct notifier_block *nb); |
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index 5ade54a78dbb..ca5a8733000f 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h | |||
@@ -86,7 +86,7 @@ static inline void netpoll_poll_unlock(void *have) | |||
86 | 86 | ||
87 | #else | 87 | #else |
88 | #define netpoll_rx(a) 0 | 88 | #define netpoll_rx(a) 0 |
89 | #define netpoll_poll_lock(a) 0 | 89 | #define netpoll_poll_lock(a) NULL |
90 | #define netpoll_poll_unlock(a) | 90 | #define netpoll_poll_unlock(a) |
91 | #endif | 91 | #endif |
92 | 92 | ||
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index d9a25647a295..acbf31c154f8 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
@@ -19,7 +19,7 @@ | |||
19 | #define AS_EIO (__GFP_BITS_SHIFT + 0) /* IO error on async write */ | 19 | #define AS_EIO (__GFP_BITS_SHIFT + 0) /* IO error on async write */ |
20 | #define AS_ENOSPC (__GFP_BITS_SHIFT + 1) /* ENOSPC on async write */ | 20 | #define AS_ENOSPC (__GFP_BITS_SHIFT + 1) /* ENOSPC on async write */ |
21 | 21 | ||
22 | static inline unsigned int __nocast mapping_gfp_mask(struct address_space * mapping) | 22 | static inline gfp_t mapping_gfp_mask(struct address_space * mapping) |
23 | { | 23 | { |
24 | return mapping->flags & __GFP_BITS_MASK; | 24 | return mapping->flags & __GFP_BITS_MASK; |
25 | } | 25 | } |
diff --git a/include/linux/posix_acl.h b/include/linux/posix_acl.h index 4caedddaa033..4bc241290c24 100644 --- a/include/linux/posix_acl.h +++ b/include/linux/posix_acl.h | |||
@@ -71,11 +71,11 @@ posix_acl_release(struct posix_acl *acl) | |||
71 | 71 | ||
72 | /* posix_acl.c */ | 72 | /* posix_acl.c */ |
73 | 73 | ||
74 | extern struct posix_acl *posix_acl_alloc(int, unsigned int __nocast); | 74 | extern struct posix_acl *posix_acl_alloc(int, gfp_t); |
75 | extern struct posix_acl *posix_acl_clone(const struct posix_acl *, unsigned int __nocast); | 75 | extern struct posix_acl *posix_acl_clone(const struct posix_acl *, gfp_t); |
76 | extern int posix_acl_valid(const struct posix_acl *); | 76 | extern int posix_acl_valid(const struct posix_acl *); |
77 | extern int posix_acl_permission(struct inode *, const struct posix_acl *, int); | 77 | extern int posix_acl_permission(struct inode *, const struct posix_acl *, int); |
78 | extern struct posix_acl *posix_acl_from_mode(mode_t, unsigned int __nocast); | 78 | extern struct posix_acl *posix_acl_from_mode(mode_t, gfp_t); |
79 | extern int posix_acl_equiv_mode(const struct posix_acl *, mode_t *); | 79 | extern int posix_acl_equiv_mode(const struct posix_acl *, mode_t *); |
80 | extern int posix_acl_create_masq(struct posix_acl *, mode_t *); | 80 | extern int posix_acl_create_masq(struct posix_acl *, mode_t *); |
81 | extern int posix_acl_chmod_masq(struct posix_acl *, mode_t); | 81 | extern int posix_acl_chmod_masq(struct posix_acl *, mode_t); |
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h index 9c51917b1cce..045d4761febc 100644 --- a/include/linux/radix-tree.h +++ b/include/linux/radix-tree.h | |||
@@ -50,7 +50,7 @@ void *radix_tree_delete(struct radix_tree_root *, unsigned long); | |||
50 | unsigned int | 50 | unsigned int |
51 | radix_tree_gang_lookup(struct radix_tree_root *root, void **results, | 51 | radix_tree_gang_lookup(struct radix_tree_root *root, void **results, |
52 | unsigned long first_index, unsigned int max_items); | 52 | unsigned long first_index, unsigned int max_items); |
53 | int radix_tree_preload(unsigned int __nocast gfp_mask); | 53 | int radix_tree_preload(gfp_t gfp_mask); |
54 | void radix_tree_init(void); | 54 | void radix_tree_init(void); |
55 | void *radix_tree_tag_set(struct radix_tree_root *root, | 55 | void *radix_tree_tag_set(struct radix_tree_root *root, |
56 | unsigned long index, int tag); | 56 | unsigned long index, int tag); |
diff --git a/include/linux/sched.h b/include/linux/sched.h index c3ba31f210a9..27519df0f987 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -1018,6 +1018,7 @@ extern int force_sig_info(int, struct siginfo *, struct task_struct *); | |||
1018 | extern int __kill_pg_info(int sig, struct siginfo *info, pid_t pgrp); | 1018 | extern int __kill_pg_info(int sig, struct siginfo *info, pid_t pgrp); |
1019 | extern int kill_pg_info(int, struct siginfo *, pid_t); | 1019 | extern int kill_pg_info(int, struct siginfo *, pid_t); |
1020 | extern int kill_proc_info(int, struct siginfo *, pid_t); | 1020 | extern int kill_proc_info(int, struct siginfo *, pid_t); |
1021 | extern int kill_proc_info_as_uid(int, struct siginfo *, pid_t, uid_t, uid_t); | ||
1021 | extern void do_notify_parent(struct task_struct *, int); | 1022 | extern void do_notify_parent(struct task_struct *, int); |
1022 | extern void force_sig(int, struct task_struct *); | 1023 | extern void force_sig(int, struct task_struct *); |
1023 | extern void force_sig_specific(int, struct task_struct *); | 1024 | extern void force_sig_specific(int, struct task_struct *); |
diff --git a/include/linux/security.h b/include/linux/security.h index 0e43460d374e..627382e74057 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -2634,8 +2634,7 @@ static inline int security_socket_getpeersec(struct socket *sock, char __user *o | |||
2634 | return security_ops->socket_getpeersec(sock, optval, optlen, len); | 2634 | return security_ops->socket_getpeersec(sock, optval, optlen, len); |
2635 | } | 2635 | } |
2636 | 2636 | ||
2637 | static inline int security_sk_alloc(struct sock *sk, int family, | 2637 | static inline int security_sk_alloc(struct sock *sk, int family, gfp_t priority) |
2638 | unsigned int __nocast priority) | ||
2639 | { | 2638 | { |
2640 | return security_ops->sk_alloc_security(sk, family, priority); | 2639 | return security_ops->sk_alloc_security(sk, family, priority); |
2641 | } | 2640 | } |
@@ -2752,8 +2751,7 @@ static inline int security_socket_getpeersec(struct socket *sock, char __user *o | |||
2752 | return -ENOPROTOOPT; | 2751 | return -ENOPROTOOPT; |
2753 | } | 2752 | } |
2754 | 2753 | ||
2755 | static inline int security_sk_alloc(struct sock *sk, int family, | 2754 | static inline int security_sk_alloc(struct sock *sk, int family, gfp_t priority) |
2756 | unsigned int __nocast priority) | ||
2757 | { | 2755 | { |
2758 | return 0; | 2756 | return 0; |
2759 | } | 2757 | } |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 466c879f82b8..8f5d9e7f8734 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -302,37 +302,37 @@ struct sk_buff { | |||
302 | 302 | ||
303 | extern void __kfree_skb(struct sk_buff *skb); | 303 | extern void __kfree_skb(struct sk_buff *skb); |
304 | extern struct sk_buff *__alloc_skb(unsigned int size, | 304 | extern struct sk_buff *__alloc_skb(unsigned int size, |
305 | unsigned int __nocast priority, int fclone); | 305 | gfp_t priority, int fclone); |
306 | static inline struct sk_buff *alloc_skb(unsigned int size, | 306 | static inline struct sk_buff *alloc_skb(unsigned int size, |
307 | unsigned int __nocast priority) | 307 | gfp_t priority) |
308 | { | 308 | { |
309 | return __alloc_skb(size, priority, 0); | 309 | return __alloc_skb(size, priority, 0); |
310 | } | 310 | } |
311 | 311 | ||
312 | static inline struct sk_buff *alloc_skb_fclone(unsigned int size, | 312 | static inline struct sk_buff *alloc_skb_fclone(unsigned int size, |
313 | unsigned int __nocast priority) | 313 | gfp_t priority) |
314 | { | 314 | { |
315 | return __alloc_skb(size, priority, 1); | 315 | return __alloc_skb(size, priority, 1); |
316 | } | 316 | } |
317 | 317 | ||
318 | extern struct sk_buff *alloc_skb_from_cache(kmem_cache_t *cp, | 318 | extern struct sk_buff *alloc_skb_from_cache(kmem_cache_t *cp, |
319 | unsigned int size, | 319 | unsigned int size, |
320 | unsigned int __nocast priority); | 320 | gfp_t priority); |
321 | extern void kfree_skbmem(struct sk_buff *skb); | 321 | extern void kfree_skbmem(struct sk_buff *skb); |
322 | extern struct sk_buff *skb_clone(struct sk_buff *skb, | 322 | extern struct sk_buff *skb_clone(struct sk_buff *skb, |
323 | unsigned int __nocast priority); | 323 | gfp_t priority); |
324 | extern struct sk_buff *skb_copy(const struct sk_buff *skb, | 324 | extern struct sk_buff *skb_copy(const struct sk_buff *skb, |
325 | unsigned int __nocast priority); | 325 | gfp_t priority); |
326 | extern struct sk_buff *pskb_copy(struct sk_buff *skb, | 326 | extern struct sk_buff *pskb_copy(struct sk_buff *skb, |
327 | unsigned int __nocast gfp_mask); | 327 | gfp_t gfp_mask); |
328 | extern int pskb_expand_head(struct sk_buff *skb, | 328 | extern int pskb_expand_head(struct sk_buff *skb, |
329 | int nhead, int ntail, | 329 | int nhead, int ntail, |
330 | unsigned int __nocast gfp_mask); | 330 | gfp_t gfp_mask); |
331 | extern struct sk_buff *skb_realloc_headroom(struct sk_buff *skb, | 331 | extern struct sk_buff *skb_realloc_headroom(struct sk_buff *skb, |
332 | unsigned int headroom); | 332 | unsigned int headroom); |
333 | extern struct sk_buff *skb_copy_expand(const struct sk_buff *skb, | 333 | extern struct sk_buff *skb_copy_expand(const struct sk_buff *skb, |
334 | int newheadroom, int newtailroom, | 334 | int newheadroom, int newtailroom, |
335 | unsigned int __nocast priority); | 335 | gfp_t priority); |
336 | extern struct sk_buff * skb_pad(struct sk_buff *skb, int pad); | 336 | extern struct sk_buff * skb_pad(struct sk_buff *skb, int pad); |
337 | #define dev_kfree_skb(a) kfree_skb(a) | 337 | #define dev_kfree_skb(a) kfree_skb(a) |
338 | extern void skb_over_panic(struct sk_buff *skb, int len, | 338 | extern void skb_over_panic(struct sk_buff *skb, int len, |
@@ -484,7 +484,7 @@ static inline int skb_shared(const struct sk_buff *skb) | |||
484 | * NULL is returned on a memory allocation failure. | 484 | * NULL is returned on a memory allocation failure. |
485 | */ | 485 | */ |
486 | static inline struct sk_buff *skb_share_check(struct sk_buff *skb, | 486 | static inline struct sk_buff *skb_share_check(struct sk_buff *skb, |
487 | unsigned int __nocast pri) | 487 | gfp_t pri) |
488 | { | 488 | { |
489 | might_sleep_if(pri & __GFP_WAIT); | 489 | might_sleep_if(pri & __GFP_WAIT); |
490 | if (skb_shared(skb)) { | 490 | if (skb_shared(skb)) { |
@@ -516,7 +516,7 @@ static inline struct sk_buff *skb_share_check(struct sk_buff *skb, | |||
516 | * %NULL is returned on a memory allocation failure. | 516 | * %NULL is returned on a memory allocation failure. |
517 | */ | 517 | */ |
518 | static inline struct sk_buff *skb_unshare(struct sk_buff *skb, | 518 | static inline struct sk_buff *skb_unshare(struct sk_buff *skb, |
519 | unsigned int __nocast pri) | 519 | gfp_t pri) |
520 | { | 520 | { |
521 | might_sleep_if(pri & __GFP_WAIT); | 521 | might_sleep_if(pri & __GFP_WAIT); |
522 | if (skb_cloned(skb)) { | 522 | if (skb_cloned(skb)) { |
@@ -1017,7 +1017,7 @@ static inline void __skb_queue_purge(struct sk_buff_head *list) | |||
1017 | * %NULL is returned in there is no free memory. | 1017 | * %NULL is returned in there is no free memory. |
1018 | */ | 1018 | */ |
1019 | static inline struct sk_buff *__dev_alloc_skb(unsigned int length, | 1019 | static inline struct sk_buff *__dev_alloc_skb(unsigned int length, |
1020 | unsigned int __nocast gfp_mask) | 1020 | gfp_t gfp_mask) |
1021 | { | 1021 | { |
1022 | struct sk_buff *skb = alloc_skb(length + 16, gfp_mask); | 1022 | struct sk_buff *skb = alloc_skb(length + 16, gfp_mask); |
1023 | if (likely(skb)) | 1023 | if (likely(skb)) |
@@ -1130,8 +1130,8 @@ static inline int skb_can_coalesce(struct sk_buff *skb, int i, | |||
1130 | * If there is no free memory -ENOMEM is returned, otherwise zero | 1130 | * If there is no free memory -ENOMEM is returned, otherwise zero |
1131 | * is returned and the old skb data released. | 1131 | * is returned and the old skb data released. |
1132 | */ | 1132 | */ |
1133 | extern int __skb_linearize(struct sk_buff *skb, unsigned int __nocast gfp); | 1133 | extern int __skb_linearize(struct sk_buff *skb, gfp_t gfp); |
1134 | static inline int skb_linearize(struct sk_buff *skb, unsigned int __nocast gfp) | 1134 | static inline int skb_linearize(struct sk_buff *skb, gfp_t gfp) |
1135 | { | 1135 | { |
1136 | return __skb_linearize(skb, gfp); | 1136 | return __skb_linearize(skb, gfp); |
1137 | } | 1137 | } |
diff --git a/include/linux/slab.h b/include/linux/slab.h index 1f356f3bbc64..5fc04a16ecb0 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
@@ -61,11 +61,11 @@ extern kmem_cache_t *kmem_cache_create(const char *, size_t, size_t, unsigned lo | |||
61 | void (*)(void *, kmem_cache_t *, unsigned long)); | 61 | void (*)(void *, kmem_cache_t *, unsigned long)); |
62 | extern int kmem_cache_destroy(kmem_cache_t *); | 62 | extern int kmem_cache_destroy(kmem_cache_t *); |
63 | extern int kmem_cache_shrink(kmem_cache_t *); | 63 | extern int kmem_cache_shrink(kmem_cache_t *); |
64 | extern void *kmem_cache_alloc(kmem_cache_t *, unsigned int __nocast); | 64 | extern void *kmem_cache_alloc(kmem_cache_t *, gfp_t); |
65 | extern void kmem_cache_free(kmem_cache_t *, void *); | 65 | extern void kmem_cache_free(kmem_cache_t *, void *); |
66 | extern unsigned int kmem_cache_size(kmem_cache_t *); | 66 | extern unsigned int kmem_cache_size(kmem_cache_t *); |
67 | extern const char *kmem_cache_name(kmem_cache_t *); | 67 | extern const char *kmem_cache_name(kmem_cache_t *); |
68 | extern kmem_cache_t *kmem_find_general_cachep(size_t size, unsigned int __nocast gfpflags); | 68 | extern kmem_cache_t *kmem_find_general_cachep(size_t size, gfp_t gfpflags); |
69 | 69 | ||
70 | /* Size description struct for general caches. */ | 70 | /* Size description struct for general caches. */ |
71 | struct cache_sizes { | 71 | struct cache_sizes { |
@@ -74,9 +74,9 @@ struct cache_sizes { | |||
74 | kmem_cache_t *cs_dmacachep; | 74 | kmem_cache_t *cs_dmacachep; |
75 | }; | 75 | }; |
76 | extern struct cache_sizes malloc_sizes[]; | 76 | extern struct cache_sizes malloc_sizes[]; |
77 | extern void *__kmalloc(size_t, unsigned int __nocast); | 77 | extern void *__kmalloc(size_t, gfp_t); |
78 | 78 | ||
79 | static inline void *kmalloc(size_t size, unsigned int __nocast flags) | 79 | static inline void *kmalloc(size_t size, gfp_t flags) |
80 | { | 80 | { |
81 | if (__builtin_constant_p(size)) { | 81 | if (__builtin_constant_p(size)) { |
82 | int i = 0; | 82 | int i = 0; |
@@ -99,7 +99,7 @@ found: | |||
99 | return __kmalloc(size, flags); | 99 | return __kmalloc(size, flags); |
100 | } | 100 | } |
101 | 101 | ||
102 | extern void *kzalloc(size_t, unsigned int __nocast); | 102 | extern void *kzalloc(size_t, gfp_t); |
103 | 103 | ||
104 | /** | 104 | /** |
105 | * kcalloc - allocate memory for an array. The memory is set to zero. | 105 | * kcalloc - allocate memory for an array. The memory is set to zero. |
@@ -107,7 +107,7 @@ extern void *kzalloc(size_t, unsigned int __nocast); | |||
107 | * @size: element size. | 107 | * @size: element size. |
108 | * @flags: the type of memory to allocate. | 108 | * @flags: the type of memory to allocate. |
109 | */ | 109 | */ |
110 | static inline void *kcalloc(size_t n, size_t size, unsigned int __nocast flags) | 110 | static inline void *kcalloc(size_t n, size_t size, gfp_t flags) |
111 | { | 111 | { |
112 | if (n != 0 && size > INT_MAX / n) | 112 | if (n != 0 && size > INT_MAX / n) |
113 | return NULL; | 113 | return NULL; |
@@ -118,15 +118,14 @@ extern void kfree(const void *); | |||
118 | extern unsigned int ksize(const void *); | 118 | extern unsigned int ksize(const void *); |
119 | 119 | ||
120 | #ifdef CONFIG_NUMA | 120 | #ifdef CONFIG_NUMA |
121 | extern void *kmem_cache_alloc_node(kmem_cache_t *, | 121 | extern void *kmem_cache_alloc_node(kmem_cache_t *, gfp_t flags, int node); |
122 | unsigned int __nocast flags, int node); | 122 | extern void *kmalloc_node(size_t size, gfp_t flags, int node); |
123 | extern void *kmalloc_node(size_t size, unsigned int __nocast flags, int node); | ||
124 | #else | 123 | #else |
125 | static inline void *kmem_cache_alloc_node(kmem_cache_t *cachep, int flags, int node) | 124 | static inline void *kmem_cache_alloc_node(kmem_cache_t *cachep, int flags, int node) |
126 | { | 125 | { |
127 | return kmem_cache_alloc(cachep, flags); | 126 | return kmem_cache_alloc(cachep, flags); |
128 | } | 127 | } |
129 | static inline void *kmalloc_node(size_t size, unsigned int __nocast flags, int node) | 128 | static inline void *kmalloc_node(size_t size, gfp_t flags, int node) |
130 | { | 129 | { |
131 | return kmalloc(size, flags); | 130 | return kmalloc(size, flags); |
132 | } | 131 | } |
diff --git a/include/linux/string.h b/include/linux/string.h index dab2652acbd8..369be3264a55 100644 --- a/include/linux/string.h +++ b/include/linux/string.h | |||
@@ -88,7 +88,7 @@ extern int memcmp(const void *,const void *,__kernel_size_t); | |||
88 | extern void * memchr(const void *,int,__kernel_size_t); | 88 | extern void * memchr(const void *,int,__kernel_size_t); |
89 | #endif | 89 | #endif |
90 | 90 | ||
91 | extern char *kstrdup(const char *s, unsigned int __nocast gfp); | 91 | extern char *kstrdup(const char *s, gfp_t gfp); |
92 | 92 | ||
93 | #ifdef __cplusplus | 93 | #ifdef __cplusplus |
94 | } | 94 | } |
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index f2e96fdfaae0..ad15a54806d8 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
@@ -71,5 +71,7 @@ void restore_processor_state(void); | |||
71 | struct saved_context; | 71 | struct saved_context; |
72 | void __save_processor_state(struct saved_context *ctxt); | 72 | void __save_processor_state(struct saved_context *ctxt); |
73 | void __restore_processor_state(struct saved_context *ctxt); | 73 | void __restore_processor_state(struct saved_context *ctxt); |
74 | extern unsigned long get_usable_page(unsigned gfp_mask); | ||
75 | extern void free_eaten_memory(void); | ||
74 | 76 | ||
75 | #endif /* _LINUX_SWSUSP_H */ | 77 | #endif /* _LINUX_SWSUSP_H */ |
diff --git a/include/linux/swap.h b/include/linux/swap.h index 3c9ff0048153..a7bf1a3b1496 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -147,7 +147,7 @@ struct swap_list_t { | |||
147 | #define vm_swap_full() (nr_swap_pages*2 < total_swap_pages) | 147 | #define vm_swap_full() (nr_swap_pages*2 < total_swap_pages) |
148 | 148 | ||
149 | /* linux/mm/oom_kill.c */ | 149 | /* linux/mm/oom_kill.c */ |
150 | extern void out_of_memory(unsigned int __nocast gfp_mask, int order); | 150 | extern void out_of_memory(gfp_t gfp_mask, int order); |
151 | 151 | ||
152 | /* linux/mm/memory.c */ | 152 | /* linux/mm/memory.c */ |
153 | extern void swapin_readahead(swp_entry_t, unsigned long, struct vm_area_struct *); | 153 | extern void swapin_readahead(swp_entry_t, unsigned long, struct vm_area_struct *); |
diff --git a/include/linux/textsearch.h b/include/linux/textsearch.h index 941f45ac117a..515046d1b2f4 100644 --- a/include/linux/textsearch.h +++ b/include/linux/textsearch.h | |||
@@ -158,7 +158,8 @@ extern unsigned int textsearch_find_continuous(struct ts_config *, | |||
158 | #define TS_PRIV_ALIGNTO 8 | 158 | #define TS_PRIV_ALIGNTO 8 |
159 | #define TS_PRIV_ALIGN(len) (((len) + TS_PRIV_ALIGNTO-1) & ~(TS_PRIV_ALIGNTO-1)) | 159 | #define TS_PRIV_ALIGN(len) (((len) + TS_PRIV_ALIGNTO-1) & ~(TS_PRIV_ALIGNTO-1)) |
160 | 160 | ||
161 | static inline struct ts_config *alloc_ts_config(size_t payload, int gfp_mask) | 161 | static inline struct ts_config *alloc_ts_config(size_t payload, |
162 | gfp_t gfp_mask) | ||
162 | { | 163 | { |
163 | struct ts_config *conf; | 164 | struct ts_config *conf; |
164 | 165 | ||
diff --git a/include/linux/types.h b/include/linux/types.h index 2b678c22ca4a..0aee34f9da9f 100644 --- a/include/linux/types.h +++ b/include/linux/types.h | |||
@@ -165,6 +165,10 @@ typedef __u64 __bitwise __le64; | |||
165 | typedef __u64 __bitwise __be64; | 165 | typedef __u64 __bitwise __be64; |
166 | #endif | 166 | #endif |
167 | 167 | ||
168 | #ifdef __KERNEL__ | ||
169 | typedef unsigned __nocast gfp_t; | ||
170 | #endif | ||
171 | |||
168 | struct ustat { | 172 | struct ustat { |
169 | __kernel_daddr_t f_tfree; | 173 | __kernel_daddr_t f_tfree; |
170 | __kernel_ino_t f_tinode; | 174 | __kernel_ino_t f_tinode; |
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index b244f69ef682..3701a0673d2c 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h | |||
@@ -34,8 +34,8 @@ struct vm_struct { | |||
34 | extern void *vmalloc(unsigned long size); | 34 | extern void *vmalloc(unsigned long size); |
35 | extern void *vmalloc_exec(unsigned long size); | 35 | extern void *vmalloc_exec(unsigned long size); |
36 | extern void *vmalloc_32(unsigned long size); | 36 | extern void *vmalloc_32(unsigned long size); |
37 | extern void *__vmalloc(unsigned long size, unsigned int __nocast gfp_mask, pgprot_t prot); | 37 | extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot); |
38 | extern void *__vmalloc_area(struct vm_struct *area, unsigned int __nocast gfp_mask, pgprot_t prot); | 38 | extern void *__vmalloc_area(struct vm_struct *area, gfp_t gfp_mask, pgprot_t prot); |
39 | extern void vfree(void *addr); | 39 | extern void vfree(void *addr); |
40 | 40 | ||
41 | extern void *vmap(struct page **pages, unsigned int count, | 41 | extern void *vmap(struct page **pages, unsigned int count, |