case IO_NORMAL:
result = lustre_generic_file_read(file, cio, &pos);
break;
-#ifdef HAVE_KERNEL_SENDFILE
- case IO_SENDFILE:
- result = generic_file_sendfile(file, &pos, cnt,
- vio->u.sendfile.cui_actor,
- vio->u.sendfile.cui_target);
- break;
-#endif
-#ifdef HAVE_KERNEL_SPLICE_READ
case IO_SPLICE:
result = generic_file_splice_read(file, &pos,
vio->u.splice.cui_pipe, cnt,
* buffers. */
io->ci_continue = 0;
break;
-#endif
default:
CERROR("Wrong IO type %u\n", vio->cui_io_subtype);
LBUG();
RETURN(result);
}
-#ifndef HAVE_VM_OP_FAULT
-static int vvp_io_kernel_fault(struct vvp_fault_io *cfio)
-{
- struct page *vmpage;
-
- vmpage = filemap_nopage(cfio->ft_vma, cfio->nopage.ft_address,
- cfio->nopage.ft_type);
-
- if (vmpage == NOPAGE_SIGBUS) {
- CDEBUG(D_PAGE, "got addr %lu type %lx - SIGBUS\n",
- cfio->nopage.ft_address,(long)cfio->nopage.ft_type);
- return -EFAULT;
- } else if (vmpage == NOPAGE_OOM) {
- CDEBUG(D_PAGE, "got addr %lu type %lx - OOM\n",
- cfio->nopage.ft_address, (long)cfio->nopage.ft_type);
- return -ENOMEM;
- }
-
- LL_CDEBUG_PAGE(D_PAGE, vmpage, "got addr %lu type %lx\n",
- cfio->nopage.ft_address, (long)cfio->nopage.ft_type);
-
- cfio->ft_vmpage = vmpage;
- lock_page(vmpage);
-
- return 0;
-}
-#else
static int vvp_io_kernel_fault(struct vvp_fault_io *cfio)
{
struct vm_fault *vmf = cfio->fault.ft_vmf;
return -EINVAL;
}
-#endif
-
static int vvp_io_fault_start(const struct lu_env *env,
const struct cl_io_slice *ios)
{
/* return unlocked vmpage to avoid deadlocking */
if (vmpage != NULL)
unlock_page(vmpage);
-#ifdef HAVE_VM_OP_FAULT
cfio->fault.ft_flags &= ~VM_FAULT_LOCKED;
-#endif
return result;
}