drm/radeon: fixup RV550 chip family
[sfrench/cifs-2.6.git] / block / blk-barrier.c
index 5f74fec327d53e35651d4616098a99e6e146630b..55c5f1fc4f1fcd90c1f119a9bc0f58b46f446e83 100644 (file)
@@ -26,7 +26,8 @@ int blk_queue_ordered(struct request_queue *q, unsigned ordered,
 {
        if (ordered & (QUEUE_ORDERED_PREFLUSH | QUEUE_ORDERED_POSTFLUSH) &&
            prepare_flush_fn == NULL) {
-               printk(KERN_ERR "blk_queue_ordered: prepare_flush_fn required\n");
+               printk(KERN_ERR "%s: prepare_flush_fn required\n",
+                                                               __FUNCTION__);
                return -EINVAL;
        }
 
@@ -47,7 +48,6 @@ int blk_queue_ordered(struct request_queue *q, unsigned ordered,
 
        return 0;
 }
-
 EXPORT_SYMBOL(blk_queue_ordered);
 
 /*
@@ -259,8 +259,11 @@ int blk_do_ordered(struct request_queue *q, struct request **rqp)
 
 static void bio_end_empty_barrier(struct bio *bio, int err)
 {
-       if (err)
+       if (err) {
+               if (err == -EOPNOTSUPP)
+                       set_bit(BIO_EOPNOTSUPP, &bio->bi_flags);
                clear_bit(BIO_UPTODATE, &bio->bi_flags);
+       }
 
        complete(bio->bi_private);
 }
@@ -309,11 +312,12 @@ int blkdev_issue_flush(struct block_device *bdev, sector_t *error_sector)
                *error_sector = bio->bi_sector;
 
        ret = 0;
-       if (!bio_flagged(bio, BIO_UPTODATE))
+       if (bio_flagged(bio, BIO_EOPNOTSUPP))
+               ret = -EOPNOTSUPP;
+       else if (!bio_flagged(bio, BIO_UPTODATE))
                ret = -EIO;
 
        bio_put(bio);
        return ret;
 }
-
 EXPORT_SYMBOL(blkdev_issue_flush);