diff options
author | Matthew Wilcox <willy@infradead.org> | 2023-03-24 19:01:01 +0100 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2023-04-06 19:39:50 +0200 |
commit | e999a5c5a19cf3b679f3d93c49ad5f5c04e4806c (patch) | |
tree | 712cf4371e6126d1c4159078c3e00b02815d7848 /mm/folio-compat.c | |
parent | ext4: Remove the logic to trim inode PAs (diff) | |
download | linux-e999a5c5a19cf3b679f3d93c49ad5f5c04e4806c.tar.xz linux-e999a5c5a19cf3b679f3d93c49ad5f5c04e4806c.zip |
fs: Add FGP_WRITEBEGIN
This particular combination of flags is used by most filesystems
in their ->write_begin method, although it does find use in a
few other places. Before folios, it warranted its own function
(grab_cache_page_write_begin()), but I think that just having specialised
flags is enough. It certainly helps the few places that have been
converted from grab_cache_page_write_begin() to __filemap_get_folio().
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Link: https://lore.kernel.org/r/20230324180129.1220691-2-willy@infradead.org
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'mm/folio-compat.c')
-rw-r--r-- | mm/folio-compat.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/mm/folio-compat.c b/mm/folio-compat.c index cabcd1de9ecb..a71523a06ccd 100644 --- a/mm/folio-compat.c +++ b/mm/folio-compat.c @@ -106,9 +106,7 @@ EXPORT_SYMBOL(pagecache_get_page); struct page *grab_cache_page_write_begin(struct address_space *mapping, pgoff_t index) { - unsigned fgp_flags = FGP_LOCK | FGP_WRITE | FGP_CREAT | FGP_STABLE; - - return pagecache_get_page(mapping, index, fgp_flags, + return pagecache_get_page(mapping, index, FGP_WRITEBEGIN, mapping_gfp_mask(mapping)); } EXPORT_SYMBOL(grab_cache_page_write_begin); |