[rh7,09/30] mm: Kill useless mapping_direct_IO()

Submitted by Kirill Tkhai on May 20, 2020, 4:03 p.m.

Details

Message ID 158999063828.2234365.15361041886086056364.stgit@localhost.localdomain
State New
Series "fs, direct_IO: Switch to iov_iter and allow bio_vec for ext4"
Headers show

Commit Message

Kirill Tkhai May 20, 2020, 4:03 p.m.
This was vz6/7-only function.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 include/linux/fs.h |    7 -------
 mm/filemap.c       |    5 ++---
 mm/page_io.c       |    2 +-
 3 files changed, 3 insertions(+), 11 deletions(-)

Patch hide | download patch | download mbox

diff --git a/include/linux/fs.h b/include/linux/fs.h
index 871505f6e575..d32e9e282c10 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -3651,13 +3651,6 @@  static inline iop_dentry_open_t get_dentry_open_iop(struct inode *inode)
 	return wrapper ? wrapper->dentry_open : NULL;
 }
 
-static inline ssize_t mapping_direct_IO(struct address_space *mapping, int rw,
-			         struct kiocb *iocb, struct iov_iter *iter,
-			         loff_t pos)
-{
-	return mapping->a_ops->direct_IO(rw, iocb, iter, pos);
-}
-
 extern bool path_noexec(const struct path *path);
 
 #endif /* _LINUX_FS_H */
diff --git a/mm/filemap.c b/mm/filemap.c
index 0619290ecd97..1a59ee8d38c1 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -2036,8 +2036,7 @@  generic_file_read_iter(struct kiocb *iocb, struct iov_iter *iter, loff_t pos)
 		retval = filemap_write_and_wait_range(mapping, pos,
 				pos + count - 1);
 		if (!retval) {
-			retval = mapping_direct_IO(mapping, READ,
-						   iocb, iter, pos);
+			retval = mapping->a_ops->direct_IO(READ, iocb, &data, pos);
 		}
 		if (retval > 0) {
 			*ppos = pos + retval;
@@ -2803,7 +2802,7 @@  generic_file_direct_write(struct kiocb *iocb, struct iov_iter *iter,
 		goto out;
 	}
 
-	written = mapping_direct_IO(mapping, WRITE, iocb, iter, pos);
+	written = mapping->a_ops->direct_IO(WRITE, iocb, &data, pos);
 
 	/*
 	 * Finally, try again to invalidate clean pages which might have been
diff --git a/mm/page_io.c b/mm/page_io.c
index d2bd82848946..8611924c59c0 100644
--- a/mm/page_io.c
+++ b/mm/page_io.c
@@ -235,7 +235,7 @@  int __swap_writepage(struct page *page, struct writeback_control *wbc,
 
 		set_page_writeback(page);
 		unlock_page(page);
-		ret = mapping_direct_IO(mapping, KERNEL_WRITE,
+		ret = mapping->a_ops->direct_IO(KERNEL_WRITE,
 					&kiocb, &iter, kiocb.ki_pos);
 		kunmap(page);
 		if (ret == PAGE_SIZE) {