/* writeback related tags are not used */
AS_NO_WRITEBACK_TAGS = 5,
AS_LARGE_FOLIO_SUPPORT = 6,
- AS_RELEASE_ALWAYS = 7, /* Call ->release_folio(), even if no private data */
- AS_UNMOVABLE = 8, /* The mapping cannot be moved, ever */
+ AS_RELEASE_ALWAYS, /* Call ->release_folio(), even if no private data */
+ AS_STABLE_WRITES, /* must wait for writeback before modifying
+ folio contents */
++ AS_UNMOVABLE, /* The mapping cannot be moved, ever */
};
/**
clear_bit(AS_RELEASE_ALWAYS, &mapping->flags);
}
+ static inline bool mapping_stable_writes(const struct address_space *mapping)
+ {
+ return test_bit(AS_STABLE_WRITES, &mapping->flags);
+ }
+
+ static inline void mapping_set_stable_writes(struct address_space *mapping)
+ {
+ set_bit(AS_STABLE_WRITES, &mapping->flags);
+ }
+
+ static inline void mapping_clear_stable_writes(struct address_space *mapping)
+ {
+ clear_bit(AS_STABLE_WRITES, &mapping->flags);
+ }
+
+static inline void mapping_set_unmovable(struct address_space *mapping)
+{
+ /*
+ * It's expected unmovable mappings are also unevictable. Compaction
+ * migrate scanner (isolate_migratepages_block()) relies on this to
+ * reduce page locking.
+ */
+ set_bit(AS_UNEVICTABLE, &mapping->flags);
+ set_bit(AS_UNMOVABLE, &mapping->flags);
+}
+
+static inline bool mapping_unmovable(struct address_space *mapping)
+{
+ return test_bit(AS_UNMOVABLE, &mapping->flags);
+}
+
static inline gfp_t mapping_gfp_mask(struct address_space * mapping)
{
return mapping->gfp_mask;