diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/slab.h | 17 | ||||
-rw-r--r-- | mm/slub.c | 5 |
2 files changed, 16 insertions, 6 deletions
@@ -262,7 +262,7 @@ static inline struct kmem_cache *cache_from_obj(struct kmem_cache *s, void *x) | |||
262 | } | 262 | } |
263 | #endif | 263 | #endif |
264 | 264 | ||
265 | 265 | #ifndef CONFIG_SLOB | |
266 | /* | 266 | /* |
267 | * The slab lists for all objects. | 267 | * The slab lists for all objects. |
268 | */ | 268 | */ |
@@ -294,5 +294,20 @@ struct kmem_cache_node { | |||
294 | 294 | ||
295 | }; | 295 | }; |
296 | 296 | ||
297 | static inline struct kmem_cache_node *get_node(struct kmem_cache *s, int node) | ||
298 | { | ||
299 | return s->node[node]; | ||
300 | } | ||
301 | |||
302 | /* | ||
303 | * Iterator over all nodes. The body will be executed for each node that has | ||
304 | * a kmem_cache_node structure allocated (which is true for all online nodes) | ||
305 | */ | ||
306 | #define for_each_kmem_cache_node(__s, __node, __n) \ | ||
307 | for (__node = 0; __n = get_node(__s, __node), __node < nr_node_ids; __node++) \ | ||
308 | if (__n) | ||
309 | |||
310 | #endif | ||
311 | |||
297 | void *slab_next(struct seq_file *m, void *p, loff_t *pos); | 312 | void *slab_next(struct seq_file *m, void *p, loff_t *pos); |
298 | void slab_stop(struct seq_file *m, void *p); | 313 | void slab_stop(struct seq_file *m, void *p); |
@@ -233,11 +233,6 @@ static inline void stat(const struct kmem_cache *s, enum stat_item si) | |||
233 | * Core slab cache functions | 233 | * Core slab cache functions |
234 | *******************************************************************/ | 234 | *******************************************************************/ |
235 | 235 | ||
236 | static inline struct kmem_cache_node *get_node(struct kmem_cache *s, int node) | ||
237 | { | ||
238 | return s->node[node]; | ||
239 | } | ||
240 | |||
241 | /* Verify that a pointer has an address that is valid within a slab page */ | 236 | /* Verify that a pointer has an address that is valid within a slab page */ |
242 | static inline int check_valid_pointer(struct kmem_cache *s, | 237 | static inline int check_valid_pointer(struct kmem_cache *s, |
243 | struct page *page, const void *object) | 238 | struct page *page, const void *object) |