CRIS: UAPI: use generic sembuf.h
[linux-2.6/btrfs-unstable.git] / include / linux / page_ext.h
blobc42981cd99aae91b33d21a0deb4bc9f925a7fbd1
1 #ifndef __LINUX_PAGE_EXT_H
2 #define __LINUX_PAGE_EXT_H
4 #include <linux/types.h>
5 #include <linux/stacktrace.h>
7 struct pglist_data;
8 struct page_ext_operations {
9 bool (*need)(void);
10 void (*init)(void);
13 #ifdef CONFIG_PAGE_EXTENSION
16 * page_ext->flags bits:
18 * PAGE_EXT_DEBUG_POISON is set for poisoned pages. This is used to
19 * implement generic debug pagealloc feature. The pages are filled with
20 * poison patterns and set this flag after free_pages(). The poisoned
21 * pages are verified whether the patterns are not corrupted and clear
22 * the flag before alloc_pages().
25 enum page_ext_flags {
26 PAGE_EXT_DEBUG_POISON, /* Page is poisoned */
27 PAGE_EXT_DEBUG_GUARD,
28 PAGE_EXT_OWNER,
32 * Page Extension can be considered as an extended mem_map.
33 * A page_ext page is associated with every page descriptor. The
34 * page_ext helps us add more information about the page.
35 * All page_ext are allocated at boot or memory hotplug event,
36 * then the page_ext for pfn always exists.
38 struct page_ext {
39 unsigned long flags;
40 #ifdef CONFIG_PAGE_OWNER
41 unsigned int order;
42 gfp_t gfp_mask;
43 unsigned int nr_entries;
44 unsigned long trace_entries[8];
45 #endif
48 extern void pgdat_page_ext_init(struct pglist_data *pgdat);
50 #ifdef CONFIG_SPARSEMEM
51 static inline void page_ext_init_flatmem(void)
54 extern void page_ext_init(void);
55 #else
56 extern void page_ext_init_flatmem(void);
57 static inline void page_ext_init(void)
60 #endif
62 struct page_ext *lookup_page_ext(struct page *page);
64 #else /* !CONFIG_PAGE_EXTENSION */
65 struct page_ext;
67 static inline void pgdat_page_ext_init(struct pglist_data *pgdat)
71 static inline struct page_ext *lookup_page_ext(struct page *page)
73 return NULL;
76 static inline void page_ext_init(void)
80 static inline void page_ext_init_flatmem(void)
83 #endif /* CONFIG_PAGE_EXTENSION */
84 #endif /* __LINUX_PAGE_EXT_H */