diff options
Diffstat (limited to 'drivers/dax/device.c')
-rw-r--r-- | drivers/dax/device.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/dax/device.c b/drivers/dax/device.c index 6833ada237ab..7b0bf825c4e7 100644 --- a/drivers/dax/device.c +++ b/drivers/dax/device.c | |||
@@ -428,9 +428,21 @@ static int dev_dax_fault(struct vm_fault *vmf) | |||
428 | return dev_dax_huge_fault(vmf, PE_SIZE_PTE); | 428 | return dev_dax_huge_fault(vmf, PE_SIZE_PTE); |
429 | } | 429 | } |
430 | 430 | ||
431 | static int dev_dax_split(struct vm_area_struct *vma, unsigned long addr) | ||
432 | { | ||
433 | struct file *filp = vma->vm_file; | ||
434 | struct dev_dax *dev_dax = filp->private_data; | ||
435 | struct dax_region *dax_region = dev_dax->region; | ||
436 | |||
437 | if (!IS_ALIGNED(addr, dax_region->align)) | ||
438 | return -EINVAL; | ||
439 | return 0; | ||
440 | } | ||
441 | |||
431 | static const struct vm_operations_struct dax_vm_ops = { | 442 | static const struct vm_operations_struct dax_vm_ops = { |
432 | .fault = dev_dax_fault, | 443 | .fault = dev_dax_fault, |
433 | .huge_fault = dev_dax_huge_fault, | 444 | .huge_fault = dev_dax_huge_fault, |
445 | .split = dev_dax_split, | ||
434 | }; | 446 | }; |
435 | 447 | ||
436 | static int dax_mmap(struct file *filp, struct vm_area_struct *vma) | 448 | static int dax_mmap(struct file *filp, struct vm_area_struct *vma) |