summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_aops.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2022-07-14 11:06:30 -0700
committerDarrick J. Wong <djwong@kernel.org>2022-11-09 19:07:34 -0800
commit78f0652474e3e0cad8ce37a205978a804246ec1d (patch)
treeea54e496b7ad25714495c6a4d2fbd0680355f776 /fs/xfs/xfs_aops.c
parent43f6ef45082f625560bd722fdda85b0972cae858 (diff)
xfs: support in-memory buffer cache targets
Allow the buffer cache to target in-memory files by connecting it to xfiles. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/xfs/xfs_aops.c')
-rw-r--r--fs/xfs/xfs_aops.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
index 5d1a995b15f8..17451c6094e0 100644
--- a/fs/xfs/xfs_aops.c
+++ b/fs/xfs/xfs_aops.c
@@ -556,7 +556,10 @@ xfs_iomap_swapfile_activate(
struct file *swap_file,
sector_t *span)
{
- sis->bdev = xfs_inode_buftarg(XFS_I(file_inode(swap_file)))->bt_bdev;
+ struct xfs_inode *ip = XFS_I(file_inode(swap_file));
+ struct xfs_buftarg *btp = xfs_inode_buftarg(ip);
+
+ sis->bdev = xfs_buftarg_bdev(btp);
return iomap_swapfile_activate(sis, swap_file, span,
&xfs_read_iomap_ops);
}