]>
git.proxmox.com Git - mirror_zfs-debian.git/blob - include/linux/page_compat.h
1 #ifndef _ZFS_PAGE_COMPAT_H
2 #define _ZFS_PAGE_COMPAT_H
5 * We have various enum members moving between two separate enum types,
6 * and accessed by different functions at various times. Centralise the
9 * < v4.8: all enums in zone_stat_item, via global_page_state()
10 * v4.8: some enums moved to node_stat_item, global_node_page_state() introduced
11 * v4.13: some enums moved from zone_stat_item to node_state_item
12 * v4.14: global_page_state() rename to global_zone_page_state()
14 * The defines used here are created by config/kernel-global_page_state.m4
18 * Create our own accessor functions to follow the Linux API changes
20 #if defined(ZFS_GLOBAL_ZONE_PAGE_STATE)
22 /* global_zone_page_state() introduced */
23 #if defined(ZFS_ENUM_NODE_STAT_ITEM_NR_FILE_PAGES)
24 #define nr_file_pages() global_node_page_state(NR_FILE_PAGES)
26 #define nr_file_pages() global_zone_page_state(NR_FILE_PAGES)
28 #if defined(ZFS_ENUM_NODE_STAT_ITEM_NR_INACTIVE_ANON)
29 #define nr_inactive_anon_pages() global_node_page_state(NR_INACTIVE_ANON)
31 #define nr_inactive_anon_pages() global_zone_page_state(NR_INACTIVE_ANON)
33 #if defined(ZFS_ENUM_NODE_STAT_ITEM_NR_INACTIVE_FILE)
34 #define nr_inactive_file_pages() global_node_page_state(NR_INACTIVE_FILE)
36 #define nr_inactive_file_pages() global_zone_page_state(NR_INACTIVE_FILE)
38 #if defined(ZFS_ENUM_NODE_STAT_ITEM_NR_SLAB_RECLAIMABLE)
39 #define nr_slab_reclaimable_pages() global_node_page_state(NR_SLAB_RECLAIMABLE)
41 #define nr_slab_reclaimable_pages() global_zone_page_state(NR_SLAB_RECLAIMABLE)
44 #elif defined(ZFS_GLOBAL_NODE_PAGE_STATE)
46 /* global_node_page_state() introduced */
47 #if defined(ZFS_ENUM_NODE_STAT_ITEM_NR_FILE_PAGES)
48 #define nr_file_pages() global_node_page_state(NR_FILE_PAGES)
50 #define nr_file_pages() global_page_state(NR_FILE_PAGES)
52 #if defined(ZFS_ENUM_NODE_STAT_ITEM_NR_INACTIVE_ANON)
53 #define nr_inactive_anon_pages() global_node_page_state(NR_INACTIVE_ANON)
55 #define nr_inactive_anon_pages() global_page_state(NR_INACTIVE_ANON)
57 #if defined(ZFS_ENUM_NODE_STAT_ITEM_NR_INACTIVE_FILE)
58 #define nr_inactive_file_pages() global_node_page_state(NR_INACTIVE_FILE)
60 #define nr_inactive_file_pages() global_page_state(NR_INACTIVE_FILE)
62 #if defined(ZFS_ENUM_NODE_STAT_ITEM_NR_SLAB_RECLAIMABLE)
63 #define nr_slab_reclaimable_pages() global_node_page_state(NR_SLAB_RECLAIMABLE)
65 #define nr_slab_reclaimable_pages() global_page_state(NR_SLAB_RECLAIMABLE)
70 /* global_page_state() only */
71 #define nr_file_pages() global_page_state(NR_FILE_PAGES)
72 #define nr_inactive_anon_pages() global_page_state(NR_INACTIVE_ANON)
73 #define nr_inactive_file_pages() global_page_state(NR_INACTIVE_FILE)
74 #define nr_slab_reclaimable_pages() global_page_state(NR_SLAB_RECLAIMABLE)
76 #endif /* ZFS_GLOBAL_ZONE_PAGE_STATE */
78 #endif /* _ZFS_PAGE_COMPAT_H */