Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
[sfrench/cifs-2.6.git] / drivers / scsi / sd.c
index a38c71511bc94b7a8637eb4a2d81471edc3b2ce3..4f28dd617ecadaa5636adde4b892834df7cfb1a1 100644 (file)
@@ -121,7 +121,6 @@ static void scsi_disk_release(struct device *cdev);
 
 static DEFINE_IDA(sd_index_ida);
 
-static struct kmem_cache *sd_cdb_cache;
 static mempool_t *sd_page_pool;
 static struct lock_class_key sd_bio_compl_lkclass;
 
@@ -2252,23 +2251,20 @@ static void sd_config_protection(struct scsi_disk *sdkp)
 {
        struct scsi_device *sdp = sdkp->device;
 
-       if (!sdkp->first_scan)
-               return;
-
        sd_dif_config_host(sdkp);
 
        if (!sdkp->protection_type)
                return;
 
        if (!scsi_host_dif_capable(sdp->host, sdkp->protection_type)) {
-               sd_printk(KERN_NOTICE, sdkp,
-                         "Disabling DIF Type %u protection\n",
-                         sdkp->protection_type);
+               sd_first_printk(KERN_NOTICE, sdkp,
+                               "Disabling DIF Type %u protection\n",
+                               sdkp->protection_type);
                sdkp->protection_type = 0;
        }
 
-       sd_printk(KERN_NOTICE, sdkp, "Enabling DIF Type %u protection\n",
-                 sdkp->protection_type);
+       sd_first_printk(KERN_NOTICE, sdkp, "Enabling DIF Type %u protection\n",
+                       sdkp->protection_type);
 }
 
 static void read_capacity_error(struct scsi_disk *sdkp, struct scsi_device *sdp,
@@ -3851,19 +3847,11 @@ static int __init init_sd(void)
        if (err)
                goto err_out;
 
-       sd_cdb_cache = kmem_cache_create("sd_ext_cdb", SD_EXT_CDB_SIZE,
-                                        0, 0, NULL);
-       if (!sd_cdb_cache) {
-               printk(KERN_ERR "sd: can't init extended cdb cache\n");
-               err = -ENOMEM;
-               goto err_out_class;
-       }
-
        sd_page_pool = mempool_create_page_pool(SD_MEMPOOL_SIZE, 0);
        if (!sd_page_pool) {
                printk(KERN_ERR "sd: can't init discard page pool\n");
                err = -ENOMEM;
-               goto err_out_cache;
+               goto err_out_class;
        }
 
        err = scsi_register_driver(&sd_template.gendrv);
@@ -3874,10 +3862,6 @@ static int __init init_sd(void)
 
 err_out_driver:
        mempool_destroy(sd_page_pool);
-
-err_out_cache:
-       kmem_cache_destroy(sd_cdb_cache);
-
 err_out_class:
        class_unregister(&sd_disk_class);
 err_out:
@@ -3899,7 +3883,6 @@ static void __exit exit_sd(void)
 
        scsi_unregister_driver(&sd_template.gendrv);
        mempool_destroy(sd_page_pool);
-       kmem_cache_destroy(sd_cdb_cache);
 
        class_unregister(&sd_disk_class);