]> www.infradead.org Git - nvme.git/commitdiff
fs/ntfs3: Remove unused ntfs_flush_inodes
authorDr. David Alan Gilbert <linux@treblig.org>
Wed, 19 Feb 2025 01:45:56 +0000 (01:45 +0000)
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Thu, 6 Mar 2025 16:53:28 +0000 (19:53 +0300)
ntfs_flush_inodes() was added in 2021 by
commit 82cae269cfa9 ("fs/ntfs3: Add initialization of super block")
but has remained unused.

Remove it, and it's helper function.

Note: There is a commented out call to ntfs_flush_inodes in
ntfs_truncate() - I've left that in place.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
fs/ntfs3/inode.c
fs/ntfs3/ntfs_fs.h

index a1e11228dafd02e7ec34b8eba8c88cd2a1487b8e..3e2957a1e3605c9e66623d3032940b6e24c48687 100644 (file)
@@ -1024,46 +1024,6 @@ int ntfs_sync_inode(struct inode *inode)
        return _ni_write_inode(inode, 1);
 }
 
-/*
- * writeback_inode - Helper function for ntfs_flush_inodes().
- *
- * This writes both the inode and the file data blocks, waiting
- * for in flight data blocks before the start of the call.  It
- * does not wait for any io started during the call.
- */
-static int writeback_inode(struct inode *inode)
-{
-       int ret = sync_inode_metadata(inode, 0);
-
-       if (!ret)
-               ret = filemap_fdatawrite(inode->i_mapping);
-       return ret;
-}
-
-/*
- * ntfs_flush_inodes
- *
- * Write data and metadata corresponding to i1 and i2.  The io is
- * started but we do not wait for any of it to finish.
- *
- * filemap_flush() is used for the block device, so if there is a dirty
- * page for a block already in flight, we will not wait and start the
- * io over again.
- */
-int ntfs_flush_inodes(struct super_block *sb, struct inode *i1,
-                     struct inode *i2)
-{
-       int ret = 0;
-
-       if (i1)
-               ret = writeback_inode(i1);
-       if (!ret && i2)
-               ret = writeback_inode(i2);
-       if (!ret)
-               ret = filemap_flush(sb->s_bdev_file->f_mapping);
-       return ret;
-}
-
 /*
  * Helper function to read file.
  */
index 0e34c944b6220ac1cc725bd784b4b6db98cac6a9..d628977e2556dbd70af7291a11a1d1e875774507 100644 (file)
@@ -713,8 +713,6 @@ int ntfs_write_end(struct file *file, struct address_space *mapping, loff_t pos,
                   u32 len, u32 copied, struct folio *folio, void *fsdata);
 int ntfs3_write_inode(struct inode *inode, struct writeback_control *wbc);
 int ntfs_sync_inode(struct inode *inode);
-int ntfs_flush_inodes(struct super_block *sb, struct inode *i1,
-                     struct inode *i2);
 int inode_read_data(struct inode *inode, void *data, size_t bytes);
 int ntfs_create_inode(struct mnt_idmap *idmap, struct inode *dir,
                      struct dentry *dentry, const struct cpu_str *uni,