aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dax.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-02-03 16:49:22 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2018-02-03 16:49:22 -0500
commit23aedc4b9b39428c92b380b386bc97edecb3d4e7 (patch)
tree66c858fc497c84363292e8ce6fd637f07fff0e8d /fs/dax.c
parent85b8bac957599ba99d76b239af73d43e9ac60c4c (diff)
parent5dc397113d195a004899ee672c5a8a19809495ba (diff)
Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
Pull ext4 updates from Ted Ts'o: "Only miscellaneous cleanups and bug fixes for ext4 this cycle" * tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: ext4: create ext4_kset dynamically ext4: create ext4_feat kobject dynamically ext4: release kobject/kset even when init/register fail ext4: fix incorrect indentation of if statement ext4: correct documentation for grpid mount option ext4: use 'sbi' instead of 'EXT4_SB(sb)' ext4: save error to disk in __ext4_grp_locked_error() jbd2: fix sphinx kernel-doc build warnings ext4: fix a race in the ext4 shutdown path mbcache: make sure c_entry_count is not decremented past zero ext4: no need flush workqueue before destroying it ext4: fixed alignment and minor code cleanup in ext4.h ext4: fix ENOSPC handling in DAX page fault handler dax: pass detailed error code from dax_iomap_fault() mbcache: revert "fs/mbcache.c: make count_objects() more robust" mbcache: initialize entry->e_referenced in mb_cache_entry_create() ext4: fix up remaining files with SPDX cleanups
Diffstat (limited to 'fs/dax.c')
-rw-r--r--fs/dax.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/dax.c b/fs/dax.c
index 6ee6f7e24f5a..0276df90e86c 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -1095,7 +1095,7 @@ static bool dax_fault_is_synchronous(unsigned long flags,
1095} 1095}
1096 1096
1097static int dax_iomap_pte_fault(struct vm_fault *vmf, pfn_t *pfnp, 1097static int dax_iomap_pte_fault(struct vm_fault *vmf, pfn_t *pfnp,
1098 const struct iomap_ops *ops) 1098 int *iomap_errp, const struct iomap_ops *ops)
1099{ 1099{
1100 struct vm_area_struct *vma = vmf->vma; 1100 struct vm_area_struct *vma = vmf->vma;
1101 struct address_space *mapping = vma->vm_file->f_mapping; 1101 struct address_space *mapping = vma->vm_file->f_mapping;
@@ -1148,6 +1148,8 @@ static int dax_iomap_pte_fault(struct vm_fault *vmf, pfn_t *pfnp,
1148 * that we never have to deal with more than a single extent here. 1148 * that we never have to deal with more than a single extent here.
1149 */ 1149 */
1150 error = ops->iomap_begin(inode, pos, PAGE_SIZE, flags, &iomap); 1150 error = ops->iomap_begin(inode, pos, PAGE_SIZE, flags, &iomap);
1151 if (iomap_errp)
1152 *iomap_errp = error;
1151 if (error) { 1153 if (error) {
1152 vmf_ret = dax_fault_return(error); 1154 vmf_ret = dax_fault_return(error);
1153 goto unlock_entry; 1155 goto unlock_entry;
@@ -1481,6 +1483,7 @@ static int dax_iomap_pmd_fault(struct vm_fault *vmf, pfn_t *pfnp,
1481 * @vmf: The description of the fault 1483 * @vmf: The description of the fault
1482 * @pe_size: Size of the page to fault in 1484 * @pe_size: Size of the page to fault in
1483 * @pfnp: PFN to insert for synchronous faults if fsync is required 1485 * @pfnp: PFN to insert for synchronous faults if fsync is required
1486 * @iomap_errp: Storage for detailed error code in case of error
1484 * @ops: Iomap ops passed from the file system 1487 * @ops: Iomap ops passed from the file system
1485 * 1488 *
1486 * When a page fault occurs, filesystems may call this helper in 1489 * When a page fault occurs, filesystems may call this helper in
@@ -1489,11 +1492,11 @@ static int dax_iomap_pmd_fault(struct vm_fault *vmf, pfn_t *pfnp,
1489 * successfully. 1492 * successfully.
1490 */ 1493 */
1491int dax_iomap_fault(struct vm_fault *vmf, enum page_entry_size pe_size, 1494int dax_iomap_fault(struct vm_fault *vmf, enum page_entry_size pe_size,
1492 pfn_t *pfnp, const struct iomap_ops *ops) 1495 pfn_t *pfnp, int *iomap_errp, const struct iomap_ops *ops)
1493{ 1496{
1494 switch (pe_size) { 1497 switch (pe_size) {
1495 case PE_SIZE_PTE: 1498 case PE_SIZE_PTE:
1496 return dax_iomap_pte_fault(vmf, pfnp, ops); 1499 return dax_iomap_pte_fault(vmf, pfnp, iomap_errp, ops);
1497 case PE_SIZE_PMD: 1500 case PE_SIZE_PMD:
1498 return dax_iomap_pmd_fault(vmf, pfnp, ops); 1501 return dax_iomap_pmd_fault(vmf, pfnp, ops);
1499 default: 1502 default: