diff options
Diffstat (limited to 'include/linux/pagemap.h')
-rw-r--r-- | include/linux/pagemap.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index a6c78e00ea96..26eabf5ec718 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
@@ -69,6 +69,13 @@ static inline gfp_t mapping_gfp_mask(struct address_space * mapping) | |||
69 | return (__force gfp_t)mapping->flags & __GFP_BITS_MASK; | 69 | return (__force gfp_t)mapping->flags & __GFP_BITS_MASK; |
70 | } | 70 | } |
71 | 71 | ||
72 | /* Restricts the given gfp_mask to what the mapping allows. */ | ||
73 | static inline gfp_t mapping_gfp_constraint(struct address_space *mapping, | ||
74 | gfp_t gfp_mask) | ||
75 | { | ||
76 | return mapping_gfp_mask(mapping) & gfp_mask; | ||
77 | } | ||
78 | |||
72 | /* | 79 | /* |
73 | * This is non-atomic. Only to be used before the mapping is activated. | 80 | * This is non-atomic. Only to be used before the mapping is activated. |
74 | * Probably needs a barrier... | 81 | * Probably needs a barrier... |