Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp865490ybh; Tue, 10 Mar 2020 09:41:14 -0700 (PDT) X-Google-Smtp-Source: ADFU+vv3SeU7q5rhJdllkiadYwR3/tiuFCszCCsUj3nZSygMoixBwvxH4sDWw1jqdrtVIhpf9Yc+ X-Received: by 2002:aca:1a17:: with SMTP id a23mr1763550oia.84.1583858474793; Tue, 10 Mar 2020 09:41:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583858474; cv=none; d=google.com; s=arc-20160816; b=u7Ynd2xq2OxXDbtvmnbAPtqsI4Afoxbol5pLdlZj9cFzZZ+BA6S4ltWW4O5LukYilU PLjBNkG9F6bUYDI88E+GTf4POnadun4Nj8dKAKm0y1EnFMlZgN9QjPteN5MBr35PgQDi sQaG1F4qVuyMh2muy1ZDBdQppbTc2bl+MgsO57CGfNZxa3OIMgHcyMsTz0l++8zSIsBy KyvOILCHcEAJqBT1ThIAa3vnUhG1vWNxwQUhBUsqUX1li0JdLLGxwYPWbHwSGeFW9NnB d0IDHHohz3UIKAK/3Od+aCzUCT9RRjssQRbzcZzWtzvwlpCMz1yxp/SsPN+vq+9ygcTw 6JIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=AAoZNxzGtp9LPCNckS6CYlW3EFTrOxAiN8C2TpyEYsU=; b=cOa040QpaV+L82syOc1dBe+kpUWFCmVbR5DWKhbrUyStXlzWe8kxZopOzqnaEkV6Ik NHbqj37njJkKwtIXwqJsUJjbfBQhsq+3p9MjLWJPjhkn8D8Lwy5qi4vaysTq2temh9dO 2luYsRoeO3meXkaDZlRIGXu3MpfMKsLxsPWeDeG7XNusXzYN4xBY51YFSlhQmEYzsyD/ 8n5ZZdoPapM9igK7BmQ1ALkRgmuVeCyCkxNMCzYgKkFODygzmFPJA/y7lnx3j4ahHbLi pvhHnfMap1WFbb+3eiz7envKTnk21tBbe7OytsDSInfx0VRr6OPC24uqmX4G3euOI8Ov 0YaA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c23si7588227oto.22.2020.03.10.09.41.02; Tue, 10 Mar 2020 09:41:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726451AbgCJQjk (ORCPT + 99 others); Tue, 10 Mar 2020 12:39:40 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:11218 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727181AbgCJQjk (ORCPT ); Tue, 10 Mar 2020 12:39:40 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id C2C462B96F6C27146853; Wed, 11 Mar 2020 00:30:38 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.487.0; Wed, 11 Mar 2020 00:30:31 +0800 From: John Garry To: , , , , , , CC: , , , , , , Hannes Reinecke Subject: [PATCH RFC v2 22/24] scsi: drop scsi command list Date: Wed, 11 Mar 2020 00:25:48 +0800 Message-ID: <1583857550-12049-23-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1583857550-12049-1-git-send-email-john.garry@huawei.com> References: <1583857550-12049-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hannes Reinecke No users left, kill it. Signed-off-by: Hannes Reinecke --- drivers/scsi/scsi.c | 1 - drivers/scsi/scsi_lib.c | 32 -------------------------------- drivers/scsi/scsi_scan.c | 1 - include/scsi/scsi_cmnd.h | 1 - include/scsi/scsi_device.h | 1 - include/scsi/scsi_host.h | 2 -- 6 files changed, 38 deletions(-) diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index 930e4803d888..8ca36d778bcf 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c @@ -104,7 +104,6 @@ EXPORT_SYMBOL(scsi_sd_pm_domain); */ void scsi_put_command(struct scsi_cmnd *cmd) { - scsi_del_cmd_from_list(cmd); BUG_ON(delayed_work_pending(&cmd->abort_work)); } diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index af4f56cd0093..1253893007d3 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -562,7 +562,6 @@ static void scsi_mq_uninit_cmd(struct scsi_cmnd *cmd) { scsi_mq_free_sgtables(cmd); scsi_uninit_cmd(cmd); - scsi_del_cmd_from_list(cmd); } /* Returns false when no more bytes to process, true if there are more */ @@ -1098,35 +1097,6 @@ static void scsi_cleanup_rq(struct request *rq) } } -/* Add a command to the list used by the aacraid and dpt_i2o drivers */ -void scsi_add_cmd_to_list(struct scsi_cmnd *cmd) -{ - struct scsi_device *sdev = cmd->device; - struct Scsi_Host *shost = sdev->host; - unsigned long flags; - - if (shost->use_cmd_list) { - spin_lock_irqsave(&sdev->list_lock, flags); - list_add_tail(&cmd->list, &sdev->cmd_list); - spin_unlock_irqrestore(&sdev->list_lock, flags); - } -} - -/* Remove a command from the list used by the aacraid and dpt_i2o drivers */ -void scsi_del_cmd_from_list(struct scsi_cmnd *cmd) -{ - struct scsi_device *sdev = cmd->device; - struct Scsi_Host *shost = sdev->host; - unsigned long flags; - - if (shost->use_cmd_list) { - spin_lock_irqsave(&sdev->list_lock, flags); - BUG_ON(list_empty(&cmd->list)); - list_del_init(&cmd->list); - spin_unlock_irqrestore(&sdev->list_lock, flags); - } -} - /* Called after a request has been started. */ void scsi_init_command(struct scsi_device *dev, struct scsi_cmnd *cmd) { @@ -1159,8 +1129,6 @@ void scsi_init_command(struct scsi_device *dev, struct scsi_cmnd *cmd) cmd->retries = retries; if (in_flight) __set_bit(SCMD_STATE_INFLIGHT, &cmd->state); - - scsi_add_cmd_to_list(cmd); } static blk_status_t scsi_setup_scsi_cmnd(struct scsi_device *sdev, diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 058079f915f1..f2437a7570ce 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c @@ -236,7 +236,6 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget, sdev->sdev_state = SDEV_CREATED; INIT_LIST_HEAD(&sdev->siblings); INIT_LIST_HEAD(&sdev->same_target_siblings); - INIT_LIST_HEAD(&sdev->cmd_list); INIT_LIST_HEAD(&sdev->starved_entry); INIT_LIST_HEAD(&sdev->event_list); spin_lock_init(&sdev->list_lock); diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index c73280b3706d..50addc112212 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h @@ -68,7 +68,6 @@ struct scsi_pointer { struct scsi_cmnd { struct scsi_request req; struct scsi_device *device; - struct list_head list; /* scsi_cmnd participates in queue lists */ struct list_head eh_entry; /* entry for the host eh_cmd_q */ struct delayed_work abort_work; diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index f8312a3e5b42..f146a4557787 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -110,7 +110,6 @@ struct scsi_device { atomic_t device_blocked; /* Device returned QUEUE_FULL. */ spinlock_t list_lock; - struct list_head cmd_list; /* queue of in use SCSI Command structures */ struct list_head starved_entry; unsigned short queue_depth; /* How deep of a queue we want */ unsigned short max_queue_depth; /* max queue depth */ diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 663aef22437a..dc62794f4cb5 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -634,8 +634,6 @@ struct Scsi_Host { /* The controller does not support WRITE SAME */ unsigned no_write_same:1; - unsigned use_cmd_list:1; - /* Host responded with short (<36 bytes) INQUIRY result */ unsigned short_inquiry:1; -- 2.17.1