]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - drivers/block/aoe/aoecmd.c
block: switch bios to blk_status_t
[mirror_ubuntu-artful-kernel.git] / drivers / block / aoe / aoecmd.c
index ab19adb07a126ae0cae4f0d37170a2929367b115..dc43254e05a4bd4030e5a7a0cbb34d749b3f8365 100644 (file)
@@ -853,45 +853,6 @@ rqbiocnt(struct request *r)
        return n;
 }
 
-/* This can be removed if we are certain that no users of the block
- * layer will ever use zero-count pages in bios.  Otherwise we have to
- * protect against the put_page sometimes done by the network layer.
- *
- * See http://oss.sgi.com/archives/xfs/2007-01/msg00594.html for
- * discussion.
- *
- * We cannot use get_page in the workaround, because it insists on a
- * positive page count as a precondition.  So we use _refcount directly.
- */
-static void
-bio_pageinc(struct bio *bio)
-{
-       struct bio_vec bv;
-       struct page *page;
-       struct bvec_iter iter;
-
-       bio_for_each_segment(bv, bio, iter) {
-               /* Non-zero page count for non-head members of
-                * compound pages is no longer allowed by the kernel.
-                */
-               page = compound_head(bv.bv_page);
-               page_ref_inc(page);
-       }
-}
-
-static void
-bio_pagedec(struct bio *bio)
-{
-       struct page *page;
-       struct bio_vec bv;
-       struct bvec_iter iter;
-
-       bio_for_each_segment(bv, bio, iter) {
-               page = compound_head(bv.bv_page);
-               page_ref_dec(page);
-       }
-}
-
 static void
 bufinit(struct buf *buf, struct request *rq, struct bio *bio)
 {
@@ -899,7 +860,6 @@ bufinit(struct buf *buf, struct request *rq, struct bio *bio)
        buf->rq = rq;
        buf->bio = bio;
        buf->iter = bio->bi_iter;
-       bio_pageinc(bio);
 }
 
 static struct buf *
@@ -1110,8 +1070,8 @@ aoe_end_request(struct aoedev *d, struct request *rq, int fastfail)
                d->ip.rq = NULL;
        do {
                bio = rq->bio;
-               bok = !fastfail && !bio->bi_error;
-       } while (__blk_end_request(rq, bok ? 0 : -EIO, bio->bi_iter.bi_size));
+               bok = !fastfail && !bio->bi_status;
+       } while (__blk_end_request(rq, bok ? BLK_STS_OK : BLK_STS_IOERR, bio->bi_iter.bi_size));
 
        /* cf. http://lkml.org/lkml/2006/10/31/28 */
        if (!fastfail)
@@ -1127,7 +1087,6 @@ aoe_end_buf(struct aoedev *d, struct buf *buf)
        if (buf == d->ip.buf)
                d->ip.buf = NULL;
        rq = buf->rq;
-       bio_pagedec(buf->bio);
        mempool_free(buf, d->bufpool);
        n = (unsigned long) rq->special;
        rq->special = (void *) --n;
@@ -1172,7 +1131,7 @@ ktiocomplete(struct frame *f)
                        ahout->cmdstat, ahin->cmdstat,
                        d->aoemajor, d->aoeminor);
 noskb:         if (buf)
-                       buf->bio->bi_error = -EIO;
+                       buf->bio->bi_status = BLK_STS_IOERR;
                goto out;
        }
 
@@ -1185,7 +1144,7 @@ noskb:            if (buf)
                                "aoe: runt data size in read from",
                                (long) d->aoemajor, d->aoeminor,
                               skb->len, n);
-                       buf->bio->bi_error = -EIO;
+                       buf->bio->bi_status = BLK_STS_IOERR;
                        break;
                }
                if (n > f->iter.bi_size) {
@@ -1193,7 +1152,7 @@ noskb:            if (buf)
                                "aoe: too-large data size in read from",
                                (long) d->aoemajor, d->aoeminor,
                                n, f->iter.bi_size);
-                       buf->bio->bi_error = -EIO;
+                       buf->bio->bi_status = BLK_STS_IOERR;
                        break;
                }
                bvcpy(skb, f->buf->bio, f->iter, n);
@@ -1695,7 +1654,7 @@ aoe_failbuf(struct aoedev *d, struct buf *buf)
        if (buf == NULL)
                return;
        buf->iter.bi_size = 0;
-       buf->bio->bi_error = -EIO;
+       buf->bio->bi_status = BLK_STS_IOERR;
        if (buf->nframesout == 0)
                aoe_end_buf(d, buf);
 }