iommu: Drop unnecessary of_iommu.h includes
[linux-2.6-microblaze.git] / fs / block_dev.c
index 580bae9..6cc4d4c 100644 (file)
@@ -79,7 +79,7 @@ static void kill_bdev(struct block_device *bdev)
 {
        struct address_space *mapping = bdev->bd_inode->i_mapping;
 
-       if (mapping->nrpages == 0 && mapping->nrexceptional == 0)
+       if (mapping_empty(mapping))
                return;
 
        invalidate_bh_lrus();
@@ -1244,6 +1244,9 @@ int bdev_disk_changed(struct block_device *bdev, bool invalidate)
 
        lockdep_assert_held(&bdev->bd_mutex);
 
+       if (!(disk->flags & GENHD_FL_UP))
+               return -ENXIO;
+
 rescan:
        if (bdev->bd_part_count)
                return -EBUSY;