diff options
author | 2022-02-09 20:21:43 +0000 | |
---|---|---|
committer | 2022-03-15 08:23:30 -0400 | |
commit | ccd16945dba091fdf1036d7711b9f6cbd287ae28 (patch) | |
tree | 0b82a09387c75da64c87f7ab2fa8eefdb08b27e0 /include/linux | |
parent | erofs: Convert from invalidatepage to invalidate_folio (diff) | |
download | linux-dev-ccd16945dba091fdf1036d7711b9f6cbd287ae28.tar.xz linux-dev-ccd16945dba091fdf1036d7711b9f6cbd287ae28.zip |
ext4: Convert invalidatepage to invalidate_folio
Extensive changes, but fairly mechanical.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Tested-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Acked-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Tested-by: Mike Marshall <hubcap@omnibond.com> # orangefs
Tested-by: David Howells <dhowells@redhat.com> # afs
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/jbd2.h | 4 | ||||
-rw-r--r-- | include/linux/pagemap.h | 18 |
2 files changed, 20 insertions, 2 deletions
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index 9c3ada74ffb1..1b9d1e205a2f 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h @@ -1530,8 +1530,8 @@ void jbd2_journal_set_triggers(struct buffer_head *, struct jbd2_buffer_trigger_type *type); extern int jbd2_journal_dirty_metadata (handle_t *, struct buffer_head *); extern int jbd2_journal_forget (handle_t *, struct buffer_head *); -extern int jbd2_journal_invalidatepage(journal_t *, - struct page *, unsigned int, unsigned int); +int jbd2_journal_invalidate_folio(journal_t *, struct folio *, + size_t offset, size_t length); extern int jbd2_journal_try_to_free_buffers(journal_t *journal, struct page *page); extern int jbd2_journal_stop(handle_t *); extern int jbd2_journal_flush(journal_t *journal, unsigned int flags); diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 4503d5baa252..6a9617e9c6bc 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -423,6 +423,24 @@ static inline struct folio *filemap_get_folio(struct address_space *mapping, } /** + * filemap_lock_folio - Find and lock a folio. + * @mapping: The address_space to search. + * @index: The page index. + * + * Looks up the page cache entry at @mapping & @index. If a folio is + * present, it is returned locked with an increased refcount. + * + * Context: May sleep. + * Return: A folio or %NULL if there is no folio in the cache for this + * index. Will not return a shadow, swap or DAX entry. + */ +static inline struct folio *filemap_lock_folio(struct address_space *mapping, + pgoff_t index) +{ + return __filemap_get_folio(mapping, index, FGP_LOCK, 0); +} + +/** * find_get_page - find and get a page reference * @mapping: the address_space to search * @offset: the page index |