summaryrefslogtreecommitdiff
path: root/fs/xfs
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2017-05-05 09:38:43 +0300
committerDan Williams <dan.j.williams@intel.com>2017-05-05 09:38:43 +0300
commit736163671bcb163fc82600b46c83dfa89d532d95 (patch)
tree0639dc9d9fa180450b4e8fbda706eaae5f1876da /fs/xfs
parentd5483feda85a8f39ee2e940e279547c686aac30c (diff)
parent1ef97fe4f8abd3317d5c3c860f990e02c2633959 (diff)
downloadlinux-736163671bcb163fc82600b46c83dfa89d532d95.tar.xz
Merge branch 'for-4.12/dax' into libnvdimm-for-next
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/xfs_iomap.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
index 288ee5b840d7..4b47403f8089 100644
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -976,6 +976,7 @@ xfs_file_iomap_begin(
int nimaps = 1, error = 0;
bool shared = false, trimmed = false;
unsigned lockmode;
+ struct block_device *bdev;
if (XFS_FORCED_SHUTDOWN(mp))
return -EIO;
@@ -1063,6 +1064,14 @@ xfs_file_iomap_begin(
}
xfs_bmbt_to_iomap(ip, iomap, &imap);
+
+ /* optionally associate a dax device with the iomap bdev */
+ bdev = iomap->bdev;
+ if (blk_queue_dax(bdev->bd_queue))
+ iomap->dax_dev = dax_get_by_host(bdev->bd_disk->disk_name);
+ else
+ iomap->dax_dev = NULL;
+
if (shared)
iomap->flags |= IOMAP_F_SHARED;
return 0;
@@ -1140,6 +1149,7 @@ xfs_file_iomap_end(
unsigned flags,
struct iomap *iomap)
{
+ put_dax(iomap->dax_dev);
if ((flags & IOMAP_WRITE) && iomap->type == IOMAP_DELALLOC)
return xfs_file_iomap_end_delalloc(XFS_I(inode), offset,
length, written, iomap);