Re: [PATCH V2 2/2] fs: Move swap_[de]activate to file_operations

From: David Sterba
Date: Wed Nov 13 2019 - 10:25:25 EST


On Tue, Nov 12, 2019 at 04:42:44PM -0800, ira.weiny@xxxxxxxxx wrote:
> From: Ira Weiny <ira.weiny@xxxxxxxxx>
>
> swap_activate() and swap_deactivate() have nothing to do with address
> spaces. We want to be able to change the address space operations on
> the fly to allow changing inode flags dynamically.
>
> Switching address space operations can be difficult to do reliably.[1]
> Therefore, to simplify switching address space operations we reduce the
> number of functions in those operations by moving swap_activate() and
> swap_deactivate() out of the address space operations.
>
> No functionality is changed with this patch.
>
> This has been tested with XFS but not NFS, f2fs, or btrfs.
>
> Also note we move some functions to facilitate compilation. But there
> are no functional changes are contained within those diffs.
>
> [1] https://lkml.org/lkml/2019/11/11/572
>
> Cc: Dave Chinner <david@xxxxxxxxxxxxx>
> Cc: linux-fsdevel@xxxxxxxxxxxxxxx
> Cc: linux-kernel@xxxxxxxxxxxxxxx
> Suggested-by: Jan Kara <jack@xxxxxxx>
> Signed-off-by: Ira Weiny <ira.weiny@xxxxxxxxx>
>
> ---
> Changes from V0:
> Update cover letter.
> fix btrfs as per Andrew's comments
> change xfs_iomap_swapfile_activate() to xfs_file_swap_activate()
>
> Changes from V1:
> Update recipients list
>
>
> fs/btrfs/file.c | 341 +++++++++++++++++++++++++++++++++++++++++++++
> fs/btrfs/inode.c | 340 --------------------------------------------

For the btrfs part

Acked-by: David Sterba <dsterba@xxxxxxxx>

There's going to be a minor conflict with current 5.5 queue, the
resolution is simple rename of btrfs_block_group_cache to btrfs_block_group.