diff options
author | Dan Williams <dan.j.williams@intel.com> | 2017-08-24 15:12:50 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2017-08-31 09:31:47 -0700 |
commit | 486aff5e04823bb1e60c4045226eb244024b8420 (patch) | |
tree | c0cc960b998086e92873d918f203a5e737e97db6 /fs/xfs/xfs_aops.c | |
parent | 78f35473508118df5ea04b9515ac3f1aaec0a980 (diff) | |
download | linux-stable-486aff5e04823bb1e60c4045226eb244024b8420.tar.gz linux-stable-486aff5e04823bb1e60c4045226eb244024b8420.tar.bz2 linux-stable-486aff5e04823bb1e60c4045226eb244024b8420.zip |
xfs: perform dax_device lookup at mount
The ->iomap_begin() operation is a hot path, so cache the
fs_dax_get_by_host() result at mount time to avoid the incurring the
hash lookup overhead on a per-i/o basis.
Reported-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'fs/xfs/xfs_aops.c')
-rw-r--r-- | fs/xfs/xfs_aops.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c index 6bf120bb1a17..78185f3b10b2 100644 --- a/fs/xfs/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -80,6 +80,19 @@ xfs_find_bdev_for_inode( return mp->m_ddev_targp->bt_bdev; } +struct dax_device * +xfs_find_daxdev_for_inode( + struct inode *inode) +{ + struct xfs_inode *ip = XFS_I(inode); + struct xfs_mount *mp = ip->i_mount; + + if (XFS_IS_REALTIME_INODE(ip)) + return mp->m_rtdev_targp->bt_daxdev; + else + return mp->m_ddev_targp->bt_daxdev; +} + /* * We're now finished for good with this page. Update the page state via the * associated buffer_heads, paying attention to the start and end offsets that |