All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: <linux-fsdevel@vger.kernel.org>
Cc: Christian Brauner <brauner@kernel.org>,
	aivazian.tigran@gmail.com, Ted Tso <tytso@mit.edu>,
	<linux-ext4@vger.kernel.org>,
	OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>,
	Jan Kara <jack@suse.cz>
Subject: [PATCH v5 20/20] vfs: Remove mmb_fsync()
Date: Mon, 27 Jul 2026 12:49:38 +0200	[thread overview]
Message-ID: <20260727104923.3828017-40-jack@suse.cz> (raw)
In-Reply-To: <20260727101509.21667-1-jack@suse.cz>

Now that everybody has been converted from mmb_fsync() (and it's variant
mmb_fsync_noflush()) to simple_fsync(), we can delete these calls.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/buffer.c                 | 74 -------------------------------------
 include/linux/buffer_head.h |  4 --
 2 files changed, 78 deletions(-)

diff --git a/fs/buffer.c b/fs/buffer.c
index 7e5ad9f4754d..be8b57a635cd 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -628,80 +628,6 @@ int mmb_sync(struct mapping_metadata_bhs *mmb)
 }
 EXPORT_SYMBOL(mmb_sync);
 
-/**
- * mmb_fsync_noflush - fsync implementation for simple filesystems with
- * 		       metadata buffers list
- *
- * @file:	file to synchronize
- * @mmb:	list of metadata bhs to flush
- * @start:	start offset in bytes
- * @end:	end offset in bytes (inclusive)
- * @datasync:	only synchronize essential metadata if true
- *
- * This is an implementation of the fsync method for simple filesystems which
- * track all non-inode metadata in the buffers list hanging off the @mmb
- * structure.
- */
-int mmb_fsync_noflush(struct file *file, struct mapping_metadata_bhs *mmb,
-		      loff_t start, loff_t end, bool datasync)
-{
-	struct inode *inode = file->f_mapping->host;
-	int err;
-	int ret = 0;
-
-	err = file_write_and_wait_range(file, start, end);
-	if (err)
-		return err;
-
-	if (mmb)
-		ret = mmb_sync(mmb);
-	if (!(inode_state_read_once(inode) & (I_DIRTY_ALL | I_SYNC)))
-		goto out;
-	if (datasync &&
-	    !(inode_state_read_once(inode) & (I_DIRTY_DATASYNC | I_SYNC)))
-		goto out;
-
-	err = sync_inode_metadata(inode, 1);
-	if (ret == 0)
-		ret = err;
-
-out:
-	/* check and advance again to catch errors after syncing out buffers */
-	err = file_check_and_advance_wb_err(file);
-	if (ret == 0)
-		ret = err;
-	return ret;
-}
-EXPORT_SYMBOL(mmb_fsync_noflush);
-
-/**
- * mmb_fsync - fsync implementation for simple filesystems with metadata
- * 	       buffers list
- *
- * @file:	file to synchronize
- * @mmb:	list of metadata bhs to flush
- * @start:	start offset in bytes
- * @end:	end offset in bytes (inclusive)
- * @datasync:	only synchronize essential metadata if true
- *
- * This is an implementation of the fsync method for simple filesystems which
- * track all non-inode metadata in the buffers list hanging off the @mmb
- * structure. This also makes sure that a device cache flush operation is
- * called at the end.
- */
-int mmb_fsync(struct file *file, struct mapping_metadata_bhs *mmb,
-	      loff_t start, loff_t end, bool datasync)
-{
-	struct inode *inode = file->f_mapping->host;
-	int ret;
-
-	ret = mmb_fsync_noflush(file, mmb, start, end, datasync);
-	if (!ret)
-		ret = blkdev_issue_flush(inode->i_sb->s_bdev);
-	return ret;
-}
-EXPORT_SYMBOL(mmb_fsync);
-
 /*
  * Called when we've recently written block `bblock', and it is known that
  * `bblock' was for a buffer_boundary() buffer.  This means that the block at
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index 8b23bc9a244c..fd2c7115c054 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -210,10 +210,6 @@ void bh_end_async_write(struct bio *bio);
 
 /* Things to do with metadata buffers list */
 void mmb_mark_buffer_dirty(struct buffer_head *bh, struct mapping_metadata_bhs *mmb);
-int mmb_fsync_noflush(struct file *file, struct mapping_metadata_bhs *mmb,
-		      loff_t start, loff_t end, bool datasync);
-int mmb_fsync(struct file *file, struct mapping_metadata_bhs *mmb,
-	      loff_t start, loff_t end, bool datasync);
 void clean_bdev_aliases(struct block_device *bdev, sector_t block,
 			sector_t len);
 static inline void clean_bdev_bh_alias(struct buffer_head *bh)
-- 
2.51.0


  parent reply	other threads:[~2026-07-27 10:51 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-27 10:49 [PATCH v5 0/20] fs: Fix missed inode write during fsync Jan Kara
2026-07-27 10:49 ` [PATCH v5 01/20] affs: Drop support for metadata bh tracking Jan Kara
2026-07-27 10:49 ` [PATCH v5 02/20] fs: Fix possible UAF in mark_buffer_write_io_error() Jan Kara
2026-07-27 10:49 ` [PATCH v5 03/20] fs: Fix missed inode writeback when racing with __writeback_single_inode Jan Kara
2026-07-27 10:49 ` [PATCH v5 04/20] ext4: Allocate mapping_metadata_bhs struct on demand Jan Kara
2026-07-27 10:49 ` [PATCH v5 05/20] fs: Provide way for filesystem to wait for metadata writeback Jan Kara
2026-07-27 10:49 ` [PATCH v5 06/20] ext2: Fix lost inode updates for IS_SYNC inodes Jan Kara
2026-07-27 10:49 ` [PATCH v5 07/20] ext2: Drop __ext2_write_inode() Jan Kara
2026-07-27 10:49 ` [PATCH v5 08/20] ext2: Avoid unnecessary inode buffer writeback for sync(2) Jan Kara
2026-07-27 10:49 ` [PATCH v5 09/20] ext2: Fix data integrity writeout issues Jan Kara
2026-07-27 10:49 ` [PATCH v5 10/20] udf: " Jan Kara
2026-07-27 10:49 ` [PATCH v5 11/20] udf: Use sync_inode_metadata() to writeout IS_SYNC inode Jan Kara
2026-07-27 10:49 ` [PATCH v5 12/20] udf: Drop udf_sync_inode() Jan Kara
2026-07-27 10:49 ` [PATCH v5 13/20] udf: Use sync_inode_metadata() in udf_evict_inode() Jan Kara
2026-07-27 10:49 ` [PATCH v5 14/20] udf: Fold udf_update_inode() into udf_write_inode() Jan Kara
2026-07-27 10:49 ` [PATCH v5 15/20] bfs: Fix data integrity writeout issues Jan Kara
2026-07-27 10:49 ` [PATCH v5 16/20] minix: " Jan Kara
2026-07-27 10:49 ` [PATCH v5 17/20] ext4: Fix data integrity writeout issues in nojournal mode Jan Kara
2026-07-27 10:49 ` [PATCH v5 18/20] fat: Fix missed inode writeback during fsync(2) Jan Kara
2026-07-27 10:49 ` [PATCH v5 19/20] fat: Replace fat_sync_inode() with sync_inode_metadata() Jan Kara
2026-07-27 10:49 ` Jan Kara [this message]
2026-07-27 15:51 ` [PATCH v5 0/20] fs: Fix missed inode write during fsync Christian Brauner
2026-07-28 19:07   ` Jan Kara
2026-08-09 15:36 ` Askar Safin
2026-08-17 16:05   ` Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260727104923.3828017-40-jack@suse.cz \
    --to=jack@suse.cz \
    --cc=aivazian.tigran@gmail.com \
    --cc=brauner@kernel.org \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.