diff options
author | Matthew Wilcox <willy@infradead.org> | 2017-11-22 11:41:23 -0500 |
---|---|---|
committer | Matthew Wilcox <willy@infradead.org> | 2018-10-21 10:46:36 -0400 |
commit | ff9c745b81ff1e482167fd73558450e66ad43a33 (patch) | |
tree | 2dd97fba1d7288a615e618b65872dfe032d488ce /include/linux/fs.h | |
parent | 8fa8e538e4be359e9042573737632dda35a8700d (diff) |
mm: Convert page-writeback to XArray
Includes moving mapping_tagged() to fs.h as a static inline, and
changing it to return bool.
Signed-off-by: Matthew Wilcox <willy@infradead.org>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index d126cad0f621..e10278e4db66 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -483,15 +483,18 @@ struct block_device { | |||
483 | struct mutex bd_fsfreeze_mutex; | 483 | struct mutex bd_fsfreeze_mutex; |
484 | } __randomize_layout; | 484 | } __randomize_layout; |
485 | 485 | ||
486 | /* XArray tags, for tagging dirty and writeback pages in the pagecache. */ | ||
487 | #define PAGECACHE_TAG_DIRTY XA_MARK_0 | ||
488 | #define PAGECACHE_TAG_WRITEBACK XA_MARK_1 | ||
489 | #define PAGECACHE_TAG_TOWRITE XA_MARK_2 | ||
490 | |||
486 | /* | 491 | /* |
487 | * Radix-tree tags, for tagging dirty and writeback pages within the pagecache | 492 | * Returns true if any of the pages in the mapping are marked with the tag. |
488 | * radix trees | ||
489 | */ | 493 | */ |
490 | #define PAGECACHE_TAG_DIRTY 0 | 494 | static inline bool mapping_tagged(struct address_space *mapping, xa_mark_t tag) |
491 | #define PAGECACHE_TAG_WRITEBACK 1 | 495 | { |
492 | #define PAGECACHE_TAG_TOWRITE 2 | 496 | return xa_marked(&mapping->i_pages, tag); |
493 | 497 | } | |
494 | int mapping_tagged(struct address_space *mapping, int tag); | ||
495 | 498 | ||
496 | static inline void i_mmap_lock_write(struct address_space *mapping) | 499 | static inline void i_mmap_lock_write(struct address_space *mapping) |
497 | { | 500 | { |