Skip to content

Commit 8bf782f

Browse files
Souptick Joarderhubcapsc
authored andcommitted
orangefs: Adding new return type vm_fault_t
Use new return type vm_fault_t for fault handler. For now, this is just documenting that the function returns a VM_FAULT value rather than an errno. Once all instances are converted, vm_fault_t will become a distinct type. See the following commit 1c8f422 ("mm: change return type to vm_fault_t") Fixed checkpatch.pl warning. Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
1 parent 94710ca commit 8bf782f

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

fs/orangefs/file.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -528,18 +528,19 @@ static long orangefs_ioctl(struct file *file, unsigned int cmd, unsigned long ar
528528
return ret;
529529
}
530530

531-
static int orangefs_fault(struct vm_fault *vmf)
531+
static vm_fault_t orangefs_fault(struct vm_fault *vmf)
532532
{
533533
struct file *file = vmf->vma->vm_file;
534-
int rc;
535-
rc = orangefs_inode_getattr(file->f_mapping->host, 0, 1,
534+
int ret;
535+
536+
ret = orangefs_inode_getattr(file->f_mapping->host, 0, 1,
536537
STATX_SIZE);
537-
if (rc == -ESTALE)
538-
rc = -EIO;
539-
if (rc) {
540-
gossip_err("%s: orangefs_inode_getattr failed, "
541-
"rc:%d:.\n", __func__, rc);
542-
return rc;
538+
if (ret == -ESTALE)
539+
ret = -EIO;
540+
if (ret) {
541+
gossip_err("%s: orangefs_inode_getattr failed, ret:%d:.\n",
542+
__func__, ret);
543+
return VM_FAULT_SIGBUS;
543544
}
544545
return filemap_fault(vmf);
545546
}

0 commit comments

Comments
 (0)