block: kill GENHD_FL_FAIL and use part0->make_it_fail
[linux-3.10.git] / block / blk-core.c
index a4a7c08..505ec61 100644 (file)
@@ -1273,8 +1273,9 @@ __setup("fail_make_request=", setup_fail_make_request);
 
 static int should_fail_request(struct bio *bio)
 {
-       if ((bio->bi_bdev->bd_disk->flags & GENHD_FL_FAIL) ||
-           bio->bi_bdev->bd_part->make_it_fail)
+       struct hd_struct *part = bio->bi_bdev->bd_part;
+
+       if (part_to_disk(part)->part0.make_it_fail || part->make_it_fail)
                return should_fail(&fail_make_request, bio->bi_size);
 
        return 0;