]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - drivers/md/linear.c
block: Add bio_end_sector()
[mirror_ubuntu-artful-kernel.git] / drivers / md / linear.c
index 21014836bdbf2286eba4fd02effbc4efcd9db625..f03fabd2b37bacf34a231a0bb034a6d8f2826e68 100644 (file)
@@ -317,8 +317,7 @@ static void linear_make_request(struct mddev *mddev, struct bio *bio)
                bio_io_error(bio);
                return;
        }
-       if (unlikely(bio->bi_sector + (bio->bi_size >> 9) >
-                    tmp_dev->end_sector)) {
+       if (unlikely(bio_end_sector(bio) > tmp_dev->end_sector)) {
                /* This bio crosses a device boundary, so we have to
                 * split it.
                 */