> - cmd->iocb.ki_complete = lo_rw_aio_complete; > - cmd->iocb.ki_flags = IOCB_DIRECT; > + > cmd->iocb.ki_ioprio = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_NONE, 0); > + if (!cmd->use_dio) { > + atomic_set(&cmd->ref, 1); > + cmd->iocb.ki_flags = 0; > + cmd->ret = lo_call_backing_rw_iter(file, &cmd->iocb, &iter, rw); > + lo_rw_aio_do_completion(cmd); > + return 0; > + } I don't think we even need the special casing. If you just use the AIO path here for buffered I/O it will do the same for you at the small price of an extra refcount operation. FYI, this seems to be against a kernel that still has cryptoloop/transfers.