Merge branch 'parisc-4.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller...
[firefly-linux-kernel-4.4.55.git] / include / linux / pagemap.h
index a6c78e00ea9684a784938ed39229c2018ffd8e75..26eabf5ec718a457eb9cef5635f5c475cca0c48d 100644 (file)
@@ -69,6 +69,13 @@ static inline gfp_t mapping_gfp_mask(struct address_space * mapping)
        return (__force gfp_t)mapping->flags & __GFP_BITS_MASK;
 }
 
+/* Restricts the given gfp_mask to what the mapping allows. */
+static inline gfp_t mapping_gfp_constraint(struct address_space *mapping,
+               gfp_t gfp_mask)
+{
+       return mapping_gfp_mask(mapping) & gfp_mask;
+}
+
 /*
  * This is non-atomic.  Only to be used before the mapping is activated.
  * Probably needs a barrier...