btrfs: defrag: pass file_ra_state instead of file to btrfs_defrag_file()
authorQu Wenruo <wqu@suse.com>
Fri, 6 Aug 2021 08:12:32 +0000 (16:12 +0800)
committerDavid Sterba <dsterba@suse.com>
Tue, 26 Oct 2021 17:04:39 +0000 (19:04 +0200)
commit1ccc2e8a8648b10b4f198793f78f2521e96f6d36
treeb1e9564a20b4a5224d30f8a10032ec5af2811d3f
parenta09f23c3554eec3451ce5d8891729b29b089e59f
btrfs: defrag: pass file_ra_state instead of file to btrfs_defrag_file()

Currently btrfs_defrag_file() accepts both "struct inode" and "struct
file" as parameter.  We can easily grab "struct inode" from "struct
file" using file_inode() helper.

The reason why we need "struct file" is just to re-use its f_ra.

Change this to pass "struct file_ra_state" parameter, so that it's more
clear what we really want.  Since we're here, also add some comments on
the function btrfs_defrag_file().

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/ioctl.c