Skip to contentSkip to conversation

scsi: remove scsi_sdb_cache

RFC PATCH Superseded Bean Huo 2 participants 3 messages Jun 19, 2020 SCSI

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Bean Huo

author
#0 lore raw

RFC PATCH 1/1 scsi: remove scsi_sdb_cache

From: Bean Huo <[email protected]>

After 'commit f664a3cc17b7 ("scsi: kill off the legacy IO path")', scsi_sdb_cache not be used any more, remove it.

---
 drivers/scsi/scsi.c      |  3 ---
 drivers/scsi/scsi_lib.c  | 18 +-----------------
 drivers/scsi/scsi_priv.h |  1 -
 3 files changed, 1 insertion(+), 21 deletions(-)
drivers/scsi/scsi.c +0 -3
index 56c24a73e0c7..24619c3bebd5 100644
@@ -754,9 +754,6 @@ static int __init init_scsi(void)
 {
 	int error;
 
-	error = scsi_init_queue();
-	if (error)
-		return error;
 	error = scsi_init_procfs();
 	if (error)
 		goto cleanup_queue;
drivers/scsi/scsi_lib.c +1 -17
index 0ba7a65e7c8d..3fadfe9447e8 100644
@@ -52,7 +52,6 @@
 #define  SCSI_INLINE_SG_CNT  2
 #endif
 
-static struct kmem_cache *scsi_sdb_cache;
 static struct kmem_cache *scsi_sense_cache;
 static struct kmem_cache *scsi_sense_isadma_cache;
 static DEFINE_MUTEX(scsi_sense_cache_mutex);
@@ -1955,24 +1954,10 @@ void scsi_unblock_requests(struct Scsi_Host *shost)
 }
 EXPORT_SYMBOL(scsi_unblock_requests);
 
-int __init scsi_init_queue(void)
-{
-	scsi_sdb_cache = kmem_cache_create("scsi_data_buffer",
-					   sizeof(struct scsi_data_buffer),
-					   0, 0, NULL);
-	if (!scsi_sdb_cache) {
-		printk(KERN_ERR "SCSI: can't init scsi sdb cache\n");
-		return -ENOMEM;
-	}
-
-	return 0;
-}
-
 void scsi_exit_queue(void)
 {
 	kmem_cache_destroy(scsi_sense_cache);
 	kmem_cache_destroy(scsi_sense_isadma_cache);
-	kmem_cache_destroy(scsi_sdb_cache);
 }
 
 /**
@@ -2039,7 +2024,6 @@ scsi_mode_select(struct scsi_device *sdev, int pf, int sp, int modepage,
 		real_buffer[1] = data->medium_type;
 		real_buffer[2] = data->device_specific;
 		real_buffer[3] = data->block_descriptor_length;
-		
 
 		cmd[0] = MODE_SELECT;
 		cmd[4] = len;
@@ -2227,7 +2211,7 @@ scsi_device_set_state(struct scsi_device *sdev, enum scsi_device_state state)
 			goto illegal;
 		}
 		break;
-			
+
 	case SDEV_RUNNING:
 		switch (oldstate) {
 		case SDEV_CREATED:
drivers/scsi/scsi_priv.h +0 -1
index 22b6585e28b4..d12ada035961 100644
@@ -93,7 +93,6 @@ extern struct request_queue *scsi_mq_alloc_queue(struct scsi_device *sdev);
 extern void scsi_start_queue(struct scsi_device *sdev);
 extern int scsi_mq_setup_tags(struct Scsi_Host *shost);
 extern void scsi_mq_destroy_tags(struct Scsi_Host *shost);
-extern int scsi_init_queue(void);
 extern void scsi_exit_queue(void);
 extern void scsi_evt_thread(struct work_struct *work);
 struct request_queue;
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Bean Huo
drivers/scsi/scsi_lib.c +0 -1
@@ -2039,7 +2024,6 @@ scsi_mode_select(struct scsi_device *sdev, int pf, int sp, int modepage,
 		real_buffer[1] = data->medium_type;
 		real_buffer[2] = data->device_specific;
 		real_buffer[3] = data->block_descriptor_length;
-		
 
 		cmd[0] = MODE_SELECT;
 		cmd[4] = len;

drivers/scsi/scsi_lib.c scsi_device_set_state(struct scsi_device *sdev, enum scsi_device_state state) · line 2217

Quoted 8 lines
drivers/scsi/scsi_lib.c +1 -1
@@ -2227,7 +2211,7 @@ scsi_device_set_state(struct scsi_device *sdev, enum scsi_device_state state)
 			goto illegal;
 		}
 		break;
-			
+
 	case SDEV_RUNNING:
 		switch (oldstate) {
 		case SDEV_CREATED:

If these whitespace changes are left out, feel free to add:

author
#2 lore raw

Hi Bart

Thanks.

Quoted 7 lines · Bart Van Assche

drivers/scsi/scsi_lib.c scsi_mode_select(struct scsi_device *sdev, · line 2043

Quoted 6 lines · Bean Huo
drivers/scsi/scsi_lib.c +0 -1
@@ -2039,7 +2024,6 @@ scsi_mode_select(struct scsi_device *sdev,
 int pf, int sp, int modepage,
 		real_buffer[1] = data->medium_type;
 		real_buffer[2] = data->device_specific;
 		real_buffer[3] = data->block_descriptor_length;
-	

Here delete a blank line since there are multiple blank lines.

Quoted 11 lines

drivers/scsi/scsi_lib.c scsi_device_set_state(struct scsi_device · line 2215

Quoted 11 lines
drivers/scsi/scsi_lib.c +1 -1
 		cmd[0] = MODE_SELECT;
 		cmd[4] = len;
@@ -2227,7 +2211,7 @@ scsi_device_set_state(struct scsi_device
 *sdev, enum scsi_device_state state)
 			goto illegal;
 		}
 		break;
-			
+

Here has trailing whitespace, delete it.

Quoted 7 lines
Quoted 3 lines
drivers/scsi/scsi_lib.c +0 -0
 	case SDEV_RUNNING:
 		switch (oldstate) {

case SDEV_CREATED:

If these whitespace changes are left out, feel free to add:

Bean