Skip to content

Commit 8b12017

Browse files
Dr. David Alan Gilbertaalexandrovich
authored andcommitted
fs/ntfs3: Remove unused ntfs_flush_inodes
ntfs_flush_inodes() was added in 2021 by commit 82cae26 ("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>
1 parent 1404580 commit 8b12017

File tree

2 files changed

+0
-42
lines changed

2 files changed

+0
-42
lines changed

fs/ntfs3/inode.c

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,46 +1024,6 @@ int ntfs_sync_inode(struct inode *inode)
10241024
return _ni_write_inode(inode, 1);
10251025
}
10261026

1027-
/*
1028-
* writeback_inode - Helper function for ntfs_flush_inodes().
1029-
*
1030-
* This writes both the inode and the file data blocks, waiting
1031-
* for in flight data blocks before the start of the call. It
1032-
* does not wait for any io started during the call.
1033-
*/
1034-
static int writeback_inode(struct inode *inode)
1035-
{
1036-
int ret = sync_inode_metadata(inode, 0);
1037-
1038-
if (!ret)
1039-
ret = filemap_fdatawrite(inode->i_mapping);
1040-
return ret;
1041-
}
1042-
1043-
/*
1044-
* ntfs_flush_inodes
1045-
*
1046-
* Write data and metadata corresponding to i1 and i2. The io is
1047-
* started but we do not wait for any of it to finish.
1048-
*
1049-
* filemap_flush() is used for the block device, so if there is a dirty
1050-
* page for a block already in flight, we will not wait and start the
1051-
* io over again.
1052-
*/
1053-
int ntfs_flush_inodes(struct super_block *sb, struct inode *i1,
1054-
struct inode *i2)
1055-
{
1056-
int ret = 0;
1057-
1058-
if (i1)
1059-
ret = writeback_inode(i1);
1060-
if (!ret && i2)
1061-
ret = writeback_inode(i2);
1062-
if (!ret)
1063-
ret = filemap_flush(sb->s_bdev_file->f_mapping);
1064-
return ret;
1065-
}
1066-
10671027
/*
10681028
* Helper function to read file.
10691029
*/

fs/ntfs3/ntfs_fs.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -713,8 +713,6 @@ int ntfs_write_end(struct file *file, struct address_space *mapping, loff_t pos,
713713
u32 len, u32 copied, struct folio *folio, void *fsdata);
714714
int ntfs3_write_inode(struct inode *inode, struct writeback_control *wbc);
715715
int ntfs_sync_inode(struct inode *inode);
716-
int ntfs_flush_inodes(struct super_block *sb, struct inode *i1,
717-
struct inode *i2);
718716
int inode_read_data(struct inode *inode, void *data, size_t bytes);
719717
int ntfs_create_inode(struct mnt_idmap *idmap, struct inode *dir,
720718
struct dentry *dentry, const struct cpu_str *uni,

0 commit comments

Comments
 (0)