From patchwork Tue Aug 15 12:23:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenchao Hao X-Patchwork-Id: 135704 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:3f2:4152:657d with SMTP id x8csp777376vqo; Tue, 15 Aug 2023 17:19:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGCt5Zav65tgOUg5EUm73ViUtO+sW/jYEf8U0COmPszeEFBNmesnYLIoek88pl4ATvoX03z X-Received: by 2002:aa7:d755:0:b0:523:372c:24f2 with SMTP id a21-20020aa7d755000000b00523372c24f2mr263398eds.26.1692145194909; Tue, 15 Aug 2023 17:19:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692145194; cv=none; d=google.com; s=arc-20160816; b=SIpDJy7lZDpvK0ZmkCPVeFc4X3PoUs+28uL6lPrM6tX0peVQcLwAmplN9LF76qvoDB 5wibf+/IyZR78hr8hCg7K92CfpkFPe85/1vDeSr/DcuU3JaF3bWT9ySUS8UzNYEhSzND xIJUzJVwujBIpoFIRFWPC0SUV/kFjh9PIZMNX2tG1alxJxmr/0FiXJc318bL66g3iMt7 MQSLi8y/pxSeZhhVN7qoQdGuZxbKiQtjfi8eYXzBmBNHG0lBhQ56cv94YI4YAfrgf9El QJQEoZIJc5Sndh87s10xly6wHlwnIRJooziPgUbeur4jzhBEOmFmBAIYjZPx4omZGYFb FIHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=73Uz2teVUTsC1+TBq5KGeS+8pESZ4jIn3mt8cSex+1M=; fh=Ph6VnkDLF8u6GTEMEY9pZiFl2+IRsXBGXVaH+P3ZcSI=; b=c/9t3d/07/5wZffhuQEGNWSN6nkrJTy6EJTentrxlEW+iHMRerk8bS91Rb4bS8YcTX Qdg1C6d7LiLdcfSQG1aZjaU5AWwNwCGKV1Yg111pCQ+aHa1FkEsi9UPhcWBWpDpZkDPb HMHt7+UO0SSJteVC7P+AkHs3dwAtoNrUKSbC0dA6+Z14eOaxYStbPrmEVBbmmJawc2Mz HQkTVso+yesY/A9oxtaVhsdhOYWi+3Vt+70mvpVbTlEQY7Vg2dYDK9ePNW4UB7D29feq /ni2Vvp6fHZ3PDVbD5vu5aGTABnS4XueUwzKlHkI76cJlhzBI9xQOQhsz7SGFiPbxlFR cc6g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n27-20020a056402515b00b005222b60fc67si8369974edd.303.2023.08.15.17.19.19; Tue, 15 Aug 2023 17:19:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236400AbjHOMXU (ORCPT + 99 others); Tue, 15 Aug 2023 08:23:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235897AbjHOMXQ (ORCPT ); Tue, 15 Aug 2023 08:23:16 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1327DE52; Tue, 15 Aug 2023 05:23:14 -0700 (PDT) Received: from kwepemm600012.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4RQ9Lc263YztSDG; Tue, 15 Aug 2023 20:19:36 +0800 (CST) Received: from build.huawei.com (10.175.101.6) by kwepemm600012.china.huawei.com (7.193.23.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Tue, 15 Aug 2023 20:23:11 +0800 From: Wenchao Hao To: "James E . J . Bottomley" , "Martin K . Petersen" , Douglas Gilbert , , CC: , Wenchao Hao Subject: [PATCH v4 1/9] scsi:scsi_debug: create scsi_debug directory in the debugfs filesystem Date: Tue, 15 Aug 2023 20:23:08 +0800 Message-ID: <20230815122316.4129333-2-haowenchao2@huawei.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20230815122316.4129333-1-haowenchao2@huawei.com> References: <20230815122316.4129333-1-haowenchao2@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.101.6] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm600012.china.huawei.com (7.193.23.74) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1774342839982433022 X-GMAIL-MSGID: 1774342839982433022 Create directory scsi_debug in the root of the debugfs filesystem. Prepare to add interface for manage error injection. Signed-off-by: Wenchao Hao Acked-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 9c0af50501f9..35c336271b13 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -41,6 +41,7 @@ #include #include #include +#include #include @@ -862,6 +863,8 @@ static const int device_qfull_result = static const int condition_met_result = SAM_STAT_CONDITION_MET; +static struct dentry *sdebug_debugfs_root; + /* Only do the extra work involved in logical block provisioning if one or * more of the lbpu, lbpws or lbpws10 parameters are given and we are doing @@ -7011,6 +7014,8 @@ static int __init scsi_debug_init(void) goto driver_unreg; } + sdebug_debugfs_root = debugfs_create_dir("scsi_debug", NULL); + for (k = 0; k < hosts_to_add; k++) { if (want_store && k == 0) { ret = sdebug_add_host_helper(idx); @@ -7057,6 +7062,7 @@ static void __exit scsi_debug_exit(void) sdebug_erase_all_stores(false); xa_destroy(per_store_ap); + debugfs_remove(sdebug_debugfs_root); } device_initcall(scsi_debug_init);