]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
vfs: Remove mmb_fsync()
authorJan Kara <jack@suse.cz>
Mon, 27 Jul 2026 10:49:38 +0000 (12:49 +0200)
committerChristian Brauner <brauner@kernel.org>
Mon, 27 Jul 2026 14:25:34 +0000 (16:25 +0200)
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>
Link: https://patch.msgid.link/20260727104923.3828017-40-jack@suse.cz
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
fs/buffer.c
include/linux/buffer_head.h

index 7e5ad9f4754d5fe9bef4eae40d62366867035932..be8b57a635cd82cc870917cd3bb2f5c6eb917f7b 100644 (file)
@@ -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
index 8b23bc9a244cb31c1bdf2c202ec72ab91a3812e0..fd2c7115c0542774024de88cbfade8825ec97cb1 100644 (file)
@@ -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)