+
+ /* Check for short read case */
+ transferred = dio->result;
+ offset = dio->iocb->ki_pos;
+
+ if ((dio->rw == READ) &&
+ ((offset + transferred) > dio->i_size))
+ transferred = dio->i_size - offset;
+
+ /* check for error in completion path */
+ if (dio->io_error)
+ transferred = dio->io_error;
+
+ dio_complete(dio, offset, transferred);
+