2019-11-29 16:34:04

by Ira Weiny

[permalink] [raw]
Subject: [PATCH V3 0/3] Move swap functions out of address space operations

From: Ira Weiny <[email protected]>

As suggested by Jan Kara, move swap_[de]activate to file_operations to simplify
address space operations for coming changes.

For this version (V3):
1) updated to the latest linux-next
2) added documentation patch to the series
3) add reviews/acks
4) fixed up a slight conflict in btrfs pointed out by David

Ira Weiny (3):
fs: Clean up mapping variable
fs: Move swap_[de]activate to file_operations
Documentation/fs: Move swap_[de]activate() to file_operations

Documentation/filesystems/vfs.rst | 24 +--
fs/btrfs/file.c | 341 ++++++++++++++++++++++++++++++
fs/btrfs/inode.c | 340 -----------------------------
fs/f2fs/data.c | 123 -----------
fs/f2fs/file.c | 122 +++++++++++
fs/iomap/swapfile.c | 3 +-
fs/nfs/file.c | 4 +-
fs/xfs/xfs_aops.c | 13 --
fs/xfs/xfs_file.c | 12 ++
include/linux/fs.h | 10 +-
mm/swapfile.c | 12 +-
11 files changed, 500 insertions(+), 504 deletions(-)

--
2.21.0


2019-11-29 16:34:04

by Ira Weiny

[permalink] [raw]
Subject: [PATCH V3 1/3] fs: Clean up mapping variable

From: Ira Weiny <[email protected]>

The mapping variable is not directly used in these functions. Just
remove the additional variable.

Reviewed-by: Darrick J. Wong <[email protected]>
Signed-off-by: Ira Weiny <[email protected]>

---
Changes from V2:
updated Reviews

fs/f2fs/data.c | 3 +--
fs/iomap/swapfile.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index a034cd0ce021..9067c7e68992 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -3147,8 +3147,7 @@ int f2fs_migrate_page(struct address_space *mapping,
/* Copied from generic_swapfile_activate() to check any holes */
static int check_swap_activate(struct file *swap_file, unsigned int max)
{
- struct address_space *mapping = swap_file->f_mapping;
- struct inode *inode = mapping->host;
+ struct inode *inode = swap_file->f_mapping->host;
unsigned blocks_per_page;
unsigned long page_no;
unsigned blkbits;
diff --git a/fs/iomap/swapfile.c b/fs/iomap/swapfile.c
index a648dbf6991e..80571add0180 100644
--- a/fs/iomap/swapfile.c
+++ b/fs/iomap/swapfile.c
@@ -140,8 +140,7 @@ int iomap_swapfile_activate(struct swap_info_struct *sis,
.sis = sis,
.lowest_ppage = (sector_t)-1ULL,
};
- struct address_space *mapping = swap_file->f_mapping;
- struct inode *inode = mapping->host;
+ struct inode *inode = swap_file->f_mapping->host;
loff_t pos = 0;
loff_t len = ALIGN_DOWN(i_size_read(inode), PAGE_SIZE);
loff_t ret;
--
2.21.0