diff options
Diffstat (limited to 'include/linux/pagemap.h')
-rw-r--r-- | include/linux/pagemap.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 5da31c12101c..09164d2c5c27 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
@@ -32,6 +32,28 @@ static inline void mapping_set_error(struct address_space *mapping, int error) | |||
32 | } | 32 | } |
33 | } | 33 | } |
34 | 34 | ||
35 | #ifdef CONFIG_UNEVICTABLE_LRU | ||
36 | #define AS_UNEVICTABLE (__GFP_BITS_SHIFT + 2) /* e.g., ramdisk, SHM_LOCK */ | ||
37 | |||
38 | static inline void mapping_set_unevictable(struct address_space *mapping) | ||
39 | { | ||
40 | set_bit(AS_UNEVICTABLE, &mapping->flags); | ||
41 | } | ||
42 | |||
43 | static inline int mapping_unevictable(struct address_space *mapping) | ||
44 | { | ||
45 | if (mapping && (mapping->flags & AS_UNEVICTABLE)) | ||
46 | return 1; | ||
47 | return 0; | ||
48 | } | ||
49 | #else | ||
50 | static inline void mapping_set_unevictable(struct address_space *mapping) { } | ||
51 | static inline int mapping_unevictable(struct address_space *mapping) | ||
52 | { | ||
53 | return 0; | ||
54 | } | ||
55 | #endif | ||
56 | |||
35 | static inline gfp_t mapping_gfp_mask(struct address_space * mapping) | 57 | static inline gfp_t mapping_gfp_mask(struct address_space * mapping) |
36 | { | 58 | { |
37 | return (__force gfp_t)mapping->flags & __GFP_BITS_MASK; | 59 | return (__force gfp_t)mapping->flags & __GFP_BITS_MASK; |