splice: simplify a conditional in copy_splice_read
[linux-2.6-block.git] / fs / splice.c
index 87c69fdb333dab893fc02310b07c61ec6ab7b815..7a9565d8ec4f9d363718ff616503367ec2462108 100644 (file)
@@ -368,15 +368,15 @@ ssize_t copy_splice_read(struct file *in, loff_t *ppos,
        if (ret > 0) {
                keep = DIV_ROUND_UP(ret, PAGE_SIZE);
                *ppos = kiocb.ki_pos;
-       } else if (ret < 0) {
-               /*
-                * callers of ->splice_read() expect -EAGAIN on
-                * "can't put anything in there", rather than -EFAULT.
-                */
-               if (ret == -EFAULT)
-                       ret = -EAGAIN;
        }
 
+       /*
+        * Callers of ->splice_read() expect -EAGAIN on "can't put anything in
+        * there", rather than -EFAULT.
+        */
+       if (ret == -EFAULT)
+               ret = -EAGAIN;
+
        /* Free any pages that didn't get touched at all. */
        if (keep < npages)
                release_pages(pages + keep, npages - keep);