gfs2: Add a migrate_folio operation for journalled files
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Wed, 3 Apr 2024 17:23:49 +0000 (18:23 +0100)
committerAndreas Gruenbacher <agruenba@redhat.com>
Fri, 3 May 2024 19:01:02 +0000 (21:01 +0200)
For journalled data, folio migration currently works by writing the folio
back, freeing the folio and faulting the new folio back in.  We can
bypass that by telling the migration code to migrate the buffer_heads
attached to our folios.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/aops.c

index 974aca9c8ea84f4f228983cfb0b6fee8b6cc53ec..10d5acd3f74233ca2094bfe5908cd97b857bfe4d 100644 (file)
@@ -116,8 +116,7 @@ static int gfs2_write_jdata_folio(struct folio *folio,
  * @folio: The folio to write
  * @wbc: The writeback control
  *
- * This is shared between writepage and writepages and implements the
- * core of the writepage operation. If a transaction is required then
+ * Implements the core of write back. If a transaction is required then
  * the checked flag will have been set and the transaction will have
  * already been started before this is called.
  */
@@ -755,6 +754,7 @@ static const struct address_space_operations gfs2_jdata_aops = {
        .readahead = gfs2_readahead,
        .dirty_folio = jdata_dirty_folio,
        .bmap = gfs2_bmap,
+       .migrate_folio = buffer_migrate_folio,
        .invalidate_folio = gfs2_invalidate_folio,
        .release_folio = gfs2_release_folio,
        .is_partially_uptodate = block_is_partially_uptodate,