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

Kirill Tkhai ktkhai at virtuozzo.com
Wed May 20 19:03:59 MSK 2020


This was vz6/7-only function.

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

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) {




More information about the Devel mailing list