* [PATCH v2 0/2] scsi: remove scsi_sdb_cache
@ 2020-06-19 15:41 Bean Huo
2020-06-19 15:41 ` [PATCH v2 1/2] " Bean Huo
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Bean Huo @ 2020-06-19 15:41 UTC (permalink / raw)
To: jejb, martin.petersen, linux-scsi, linux-kernel, bvanassche; +Cc: beanhuo
From: Bean Huo <beanhuo@micron.com>
Changelog:
v1 -- v2:
1. split patch
2. fix more coding errors in the scsi_lib.c
Bean Huo (2):
scsi: remove scsi_sdb_cache
scsi: fix coding style errors in scsi_lib.c
drivers/scsi/scsi.c | 3 ---
drivers/scsi/scsi_lib.c | 58 +++++++++++++++-------------------------
drivers/scsi/scsi_priv.h | 1 -
3 files changed, 21 insertions(+), 41 deletions(-)
--
2.17.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2 1/2] scsi: remove scsi_sdb_cache
2020-06-19 15:41 [PATCH v2 0/2] scsi: remove scsi_sdb_cache Bean Huo
@ 2020-06-19 15:41 ` Bean Huo
2020-06-19 15:41 ` [PATCH v2 2/2] scsi: fix coding style errors in scsi_lib.c Bean Huo
2020-06-20 3:26 ` [PATCH v2 0/2] scsi: remove scsi_sdb_cache Martin K. Petersen
2 siblings, 0 replies; 4+ messages in thread
From: Bean Huo @ 2020-06-19 15:41 UTC (permalink / raw)
To: jejb, martin.petersen, linux-scsi, linux-kernel, bvanassche; +Cc: beanhuo
From: Bean Huo <beanhuo@micron.com>
After 'commit f664a3cc17b7 ("scsi: kill off the legacy IO path")',
scsi_sdb_cache not be used any more, remove it.
Signed-off-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
---
drivers/scsi/scsi.c | 3 ---
drivers/scsi/scsi_lib.c | 15 ---------------
drivers/scsi/scsi_priv.h | 1 -
3 files changed, 19 deletions(-)
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index 56c24a73e0c7..24619c3bebd5 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -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;
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 0ba7a65e7c8d..c47650f7f0d3 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -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);
}
/**
diff --git a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h
index 22b6585e28b4..d12ada035961 100644
--- a/drivers/scsi/scsi_priv.h
+++ b/drivers/scsi/scsi_priv.h
@@ -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;
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v2 2/2] scsi: fix coding style errors in scsi_lib.c
2020-06-19 15:41 [PATCH v2 0/2] scsi: remove scsi_sdb_cache Bean Huo
2020-06-19 15:41 ` [PATCH v2 1/2] " Bean Huo
@ 2020-06-19 15:41 ` Bean Huo
2020-06-20 3:26 ` [PATCH v2 0/2] scsi: remove scsi_sdb_cache Martin K. Petersen
2 siblings, 0 replies; 4+ messages in thread
From: Bean Huo @ 2020-06-19 15:41 UTC (permalink / raw)
To: jejb, martin.petersen, linux-scsi, linux-kernel, bvanassche; +Cc: beanhuo
From: Bean Huo <beanhuo@micron.com>
Delete trailing whitespace, multiple blank lines, and make
switch/case be at the same indent.
Signed-off-by: Bean Huo <beanhuo@micron.com>
---
drivers/scsi/scsi_lib.c | 43 ++++++++++++++++++++---------------------
1 file changed, 21 insertions(+), 22 deletions(-)
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index c47650f7f0d3..be8f5050f837 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -389,7 +389,7 @@ static void scsi_single_lun_run(struct scsi_device *current_sdev)
spin_unlock_irqrestore(shost->host_lock, flags);
scsi_kick_queue(sdev->request_queue);
spin_lock_irqsave(shost->host_lock, flags);
-
+
scsi_device_put(sdev);
}
out:
@@ -1455,18 +1455,18 @@ static void scsi_softirq_done(struct request *rq)
scsi_log_completion(cmd, disposition);
switch (disposition) {
- case SUCCESS:
- scsi_finish_command(cmd);
- break;
- case NEEDS_RETRY:
- scsi_queue_insert(cmd, SCSI_MLQUEUE_EH_RETRY);
- break;
- case ADD_TO_MLQUEUE:
- scsi_queue_insert(cmd, SCSI_MLQUEUE_DEVICE_BUSY);
- break;
- default:
- scsi_eh_scmd_add(cmd);
- break;
+ case SUCCESS:
+ scsi_finish_command(cmd);
+ break;
+ case NEEDS_RETRY:
+ scsi_queue_insert(cmd, SCSI_MLQUEUE_EH_RETRY);
+ break;
+ case ADD_TO_MLQUEUE:
+ scsi_queue_insert(cmd, SCSI_MLQUEUE_DEVICE_BUSY);
+ break;
+ default:
+ scsi_eh_scmd_add(cmd);
+ break;
}
}
@@ -2024,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;
@@ -2110,7 +2109,7 @@ scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage,
if (scsi_sense_valid(sshdr)) {
if ((sshdr->sense_key == ILLEGAL_REQUEST) &&
(sshdr->asc == 0x20) && (sshdr->ascq == 0)) {
- /*
+ /*
* Invalid command operation code
*/
sdev->use_10_for_ms = 0;
@@ -2119,7 +2118,7 @@ scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage,
}
}
- if(scsi_status_is_good(result)) {
+ if (scsi_status_is_good(result)) {
if (unlikely(buffer[0] == 0x86 && buffer[1] == 0x0b &&
(modepage == 6 || modepage == 8))) {
/* Initio breakage? */
@@ -2129,7 +2128,7 @@ scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage,
data->device_specific = 0;
data->longlba = 0;
data->block_descriptor_length = 0;
- } else if(use_10_for_ms) {
+ } else if (use_10_for_ms) {
data->length = buffer[0]*256 + buffer[1] + 2;
data->medium_type = buffer[2];
data->device_specific = buffer[3];
@@ -2212,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:
@@ -2497,7 +2496,7 @@ EXPORT_SYMBOL_GPL(sdev_evt_send_simple);
* (which must be a legal transition). When the device is in this
* state, only special requests will be accepted, all others will
* be deferred. Since special requests may also be requeued requests,
- * a successful return doesn't guarantee the device will be
+ * a successful return doesn't guarantee the device will be
* totally quiescent.
*
* Must be called with user context, may sleep.
@@ -2623,10 +2622,10 @@ int scsi_internal_device_block_nowait(struct scsi_device *sdev)
return err;
}
- /*
+ /*
* The device has transitioned to SDEV_BLOCK. Stop the
* block layer from calling the midlayer with this device's
- * request queue.
+ * request queue.
*/
blk_mq_quiesce_queue_nowait(q);
return 0;
@@ -2661,7 +2660,7 @@ static int scsi_internal_device_block(struct scsi_device *sdev)
return err;
}
-
+
void scsi_start_queue(struct scsi_device *sdev)
{
struct request_queue *q = sdev->request_queue;
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2 0/2] scsi: remove scsi_sdb_cache
2020-06-19 15:41 [PATCH v2 0/2] scsi: remove scsi_sdb_cache Bean Huo
2020-06-19 15:41 ` [PATCH v2 1/2] " Bean Huo
2020-06-19 15:41 ` [PATCH v2 2/2] scsi: fix coding style errors in scsi_lib.c Bean Huo
@ 2020-06-20 3:26 ` Martin K. Petersen
2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2020-06-20 3:26 UTC (permalink / raw)
To: bvanassche, jejb, linux-scsi, linux-kernel, Bean Huo
Cc: Martin K . Petersen, beanhuo
On Fri, 19 Jun 2020 17:41:15 +0200, Bean Huo wrote:
> Changelog:
> v1 -- v2:
> 1. split patch
> 2. fix more coding errors in the scsi_lib.c
>
> Bean Huo (2):
> scsi: remove scsi_sdb_cache
> scsi: fix coding style errors in scsi_lib.c
>
> [...]
Applied to 5.9/scsi-queue, thanks!
[1/2] scsi: core: Remove scsi_sdb_cache
https://git.kernel.org/mkp/scsi/c/71df6fb976c3
[2/2] scsi: core: Fix formatting errors in scsi_lib.c
https://git.kernel.org/mkp/scsi/c/4c7b4d63273d
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-06-20 3:28 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-19 15:41 [PATCH v2 0/2] scsi: remove scsi_sdb_cache Bean Huo
2020-06-19 15:41 ` [PATCH v2 1/2] " Bean Huo
2020-06-19 15:41 ` [PATCH v2 2/2] scsi: fix coding style errors in scsi_lib.c Bean Huo
2020-06-20 3:26 ` [PATCH v2 0/2] scsi: remove scsi_sdb_cache Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).