summaryrefslogtreecommitdiffstats
path: root/fs/dax.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2021-11-29 11:21:58 +0100
committerDan Williams <dan.j.williams@intel.com>2021-12-04 08:58:53 -0800
commit952da06375c8f3aa58474fff718d9ae8442531b9 (patch)
tree8fce857c95365fd0340d4975d7bf83bc071e6761 /fs/dax.c
parent740fd671e04f8a977018eb9cfe440b4817850f0d (diff)
downloadlinux-stable-952da06375c8f3aa58474fff718d9ae8442531b9.tar.gz
linux-stable-952da06375c8f3aa58474fff718d9ae8442531b9.tar.bz2
linux-stable-952da06375c8f3aa58474fff718d9ae8442531b9.zip
iomap: add a IOMAP_DAX flag
Add a flag so that the file system can easily detect DAX operations based just on the iomap operation requested instead of looking at inode state using IS_DAX. This will be needed to apply the to be added partition offset only for operations that actually use DAX, but not things like fiemap that are based on the block device. In the long run it should also allow turning the bdev, dax_dev and inline_data into a union. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dan Williams <dan.j.williams@intel.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Link: https://lore.kernel.org/r/20211129102203.2243509-25-hch@lst.de Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'fs/dax.c')
-rw-r--r--fs/dax.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/dax.c b/fs/dax.c
index 43d58b4219fd..148e8b0967f3 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -1180,7 +1180,7 @@ int dax_zero_range(struct inode *inode, loff_t pos, loff_t len, bool *did_zero,
.inode = inode,
.pos = pos,
.len = len,
- .flags = IOMAP_ZERO,
+ .flags = IOMAP_DAX | IOMAP_ZERO,
};
int ret;
@@ -1308,6 +1308,7 @@ dax_iomap_rw(struct kiocb *iocb, struct iov_iter *iter,
.inode = iocb->ki_filp->f_mapping->host,
.pos = iocb->ki_pos,
.len = iov_iter_count(iter),
+ .flags = IOMAP_DAX,
};
loff_t done = 0;
int ret;
@@ -1461,7 +1462,7 @@ static vm_fault_t dax_iomap_pte_fault(struct vm_fault *vmf, pfn_t *pfnp,
.inode = mapping->host,
.pos = (loff_t)vmf->pgoff << PAGE_SHIFT,
.len = PAGE_SIZE,
- .flags = IOMAP_FAULT,
+ .flags = IOMAP_DAX | IOMAP_FAULT,
};
vm_fault_t ret = 0;
void *entry;
@@ -1570,7 +1571,7 @@ static vm_fault_t dax_iomap_pmd_fault(struct vm_fault *vmf, pfn_t *pfnp,
struct iomap_iter iter = {
.inode = mapping->host,
.len = PMD_SIZE,
- .flags = IOMAP_FAULT,
+ .flags = IOMAP_DAX | IOMAP_FAULT,
};
vm_fault_t ret = VM_FAULT_FALLBACK;
pgoff_t max_pgoff;