From patchwork Wed Aug 10 18:27:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 596614 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB560C00140 for ; Wed, 10 Aug 2022 18:28:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231674AbiHJS2N (ORCPT ); Wed, 10 Aug 2022 14:28:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229487AbiHJS2I (ORCPT ); Wed, 10 Aug 2022 14:28:08 -0400 Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 917EC85FB8 for ; Wed, 10 Aug 2022 11:28:06 -0700 (PDT) Received: by mail-pg1-f177.google.com with SMTP id f11so15051663pgj.7 for ; Wed, 10 Aug 2022 11:28:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=h7JRgUiDRzNhsiyctx72rJg8reBaCRNEJwqXY48CE90=; b=hiPd1dDS1a9QOTSE/2ZXChKyOFxAn4O19Vapj1v0kxfut0xhPufOAx/Pigk+oEzUwc JWTXcsqcwbSkfleEKAa9il/tg14H1/q1yFQ1R2JzbKX3miSqVNGv2zbsmU1Se+RI1ZH+ AOFZ1owwljm2W3iK3V5EJoZhp9U7PnaVzz9r+7zVxEyN0Ukrou+grkmNpt4N+M1+ZUH+ jAzru5dZ0YNM5HO/t+xE8nUut6ie7+6OuuRAIvv3Ee60MNC13TwB/0QU9JrMB+itdfdF EWI7WOEps/kJ9fnbGy/4IltacTAr5YF+fG04pLxS0g/SsO9Zjx//o9+j6/VIQfrVLPrl 37mg== X-Gm-Message-State: ACgBeo2MyoqU9s9HFbRqbEn3r8nQ6Ieg52jBT1wG/OjbmlryEKntVDjL IA1ewP2/YgRg0jON6lQEhJp3Gi/V6A8= X-Google-Smtp-Source: AA6agR7+x1slN5ulCYFdd42BiRtm05Yh5dH45Ic3vnrvfLMydLOy9fo+2oSIF+m6Qm/3qHP5UvHyeg== X-Received: by 2002:a65:6a46:0:b0:41b:65fa:b09e with SMTP id o6-20020a656a46000000b0041b65fab09emr24384127pgu.292.1660156085753; Wed, 10 Aug 2022 11:28:05 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:85c9:163f:8564:e41f]) by smtp.gmail.com with ESMTPSA id p3-20020a170902780300b0016d10267927sm13080315pll.203.2022.08.10.11.28.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Aug 2022 11:28:04 -0700 (PDT) From: Bart Van Assche To: Doug Gilbert Cc: Hannes Reinecke , linux-scsi@vger.kernel.org, Bart Van Assche Subject: [sg3_utils 1/3] Change /proc/scsi/sg/allow_dio into /sys/module/sg/parameters/allow_dio Date: Wed, 10 Aug 2022 11:27:37 -0700 Message-Id: <20220810182739.756352-2-bvanassche@acm.org> X-Mailer: git-send-email 2.37.1.559.g78731f0fdb-goog In-Reply-To: <20220810182739.756352-1-bvanassche@acm.org> References: <20220810182739.756352-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Prepare for the removal of /proc/scsi from the Linux kernel by removing the references to /proc/scsi. Signed-off-by: Bart Van Assche --- ChangeLog | 2 +- doc/sg_dd.8 | 6 +++--- doc/sg_read.8 | 4 ++-- doc/sgp_dd.8 | 4 ++-- examples/sgq_dd.c | 6 +++--- src/sg_dd.c | 6 +++--- src/sg_read.c | 6 +++--- src/sgm_dd.c | 6 +++--- src/sgp_dd.c | 6 +++--- testing/sg_mrq_dd.cpp | 6 +++--- testing/sg_tst_bidi.c | 2 +- testing/sgh_dd.cpp | 6 +++--- 12 files changed, 30 insertions(+), 30 deletions(-) diff --git a/ChangeLog b/ChangeLog index 587a7844f631..54a778a653e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1811,7 +1811,7 @@ Changelog for sg3_utils-0.96 [20011221] Changelog for sg3_utils-0.95 [20010915] ---------------------------- - make sg_dd, sgp_dd and archive/sgq_dd warn if dio selected but - /proc/scsi/sg/allow_dio is '0' + /sys/module/sg/parameters/allow_dio is '0' - sg_map can now do any INQUIRY (when '-i' argument given) - expand example in scsi_inquiry diff --git a/doc/sg_dd.8 b/doc/sg_dd.8 index 14290e0740e8..3268de32e738 100644 --- a/doc/sg_dd.8 +++ b/doc/sg_dd.8 @@ -139,7 +139,7 @@ issued and no copy takes place. \fBdio\fR={0|1} default is 0 which selects indirect (buffered) IO on sg devices. Value of 1 attempts direct IO which, if not available, falls back to indirect IO and -notes this at completion. If direct IO is selected and /proc/scsi/sg/allow_dio +notes this at completion. If direct IO is selected and /sys/module/sg/parameters/allow_dio has the value of 0 then a warning is issued (and indirect IO is performed). For finer grain control use 'iflag=dio' or 'oflag=dio'. .TP @@ -333,7 +333,7 @@ utility. See note about READ LONG below. dio request the sg device node associated with this flag does direct IO. If direct IO is not available, falls back to indirect IO and notes this at completion. -If direct IO is selected and /proc/scsi/sg/allow_dio has the value of 0 then a +If direct IO is selected and /sys/module/sg/parameters/allow_dio has the value of 0 then a warning is issued (and indirect IO is performed). .TP direct @@ -470,7 +470,7 @@ This is called "indirect IO" and there is a 'dio' option to select "direct IO" which will DMA directly into user memory. Due to some issues "direct IO" is disabled in the sg driver and needs a configuration change to activate it. This is typically done -with 'echo 1 > /proc/scsi/sg/allow_dio'. +with 'echo 1 > /sys/module/sg/parameters/allow_dio'. .PP All informative, warning and error output is sent to stderr so that dd's output file can be stdout and remain unpolluted. If no options diff --git a/doc/sg_read.8 b/doc/sg_read.8 index c12dd57f087f..3f370a62f42d 100644 --- a/doc/sg_read.8 +++ b/doc/sg_read.8 @@ -71,7 +71,7 @@ to be transferred. This option is mandatory. default is 0 which selects indirect IO. Value of 1 attempts direct IO which, if not available, falls back to indirect IO and notes this at completion. This option is only active if \fIIFILE\fR is an sg device. -If direct IO is selected and /proc/scsi/sg/allow_dio +If direct IO is selected and /sys/module/sg/parameters/allow_dio has the value of 0 then a warning is issued (and indirect IO is performed) .TP \fBdpo\fR=0 | 1 @@ -140,7 +140,7 @@ This is called "indirect IO" and there is a "dio" option to select "direct IO" which will DMA directly into user memory. Due to some issues "direct IO" is disabled in the sg driver and needs a configuration change to activate it. This is typically done with -"echo 1 > /proc/scsi/sg/allow_dio". An alternate way to avoid the +"echo 1 > /sys/module/sg/parameters/allow_dio". An alternate way to avoid the 2 stage copy is to select memory mapped IO with 'mmap=1'. .SH SIGNALS The signal handling has been borrowed from dd: SIGINT, SIGQUIT and diff --git a/doc/sgp_dd.8 b/doc/sgp_dd.8 index 7f6115da5bb4..99afcf30f085 100644 --- a/doc/sgp_dd.8 +++ b/doc/sgp_dd.8 @@ -77,7 +77,7 @@ of debug (max debug output when \fIVERB\fR is 9). \fBdio\fR=0 | 1 default is 0 which selects indirect IO. Value of 1 attempts direct IO which, if not available, falls back to indirect IO and notes this -at completion. If direct IO is selected and /proc/scsi/sg/allow_dio +at completion. If direct IO is selected and /sys/module/sg/parameters/allow_dio has the value of 0 then a warning is issued (and indirect IO is performed) For finer grain control use 'iflag=dio' or 'oflag=dio'. .TP @@ -184,7 +184,7 @@ reported to stderr and the copy continues (as if nothing went wrong). dio request the sg device node associated with this flag does direct IO. If direct IO is not available, falls back to indirect IO and notes -this at completion. If direct IO is selected and /proc/scsi/sg/allow_dio +this at completion. If direct IO is selected and /sys/module/sg/parameters/allow_dio has the value of 0 then a warning is issued (and indirect IO is performed). .TP direct diff --git a/examples/sgq_dd.c b/examples/sgq_dd.c index 2f163ef16ee9..66c52efe25d9 100644 --- a/examples/sgq_dd.c +++ b/examples/sgq_dd.c @@ -148,7 +148,7 @@ static struct pollfd in_pollfd_arr[MAX_NUM_THREADS]; static struct pollfd out_pollfd_arr[MAX_NUM_THREADS]; static int dd_count = -1; -static const char * proc_allow_dio = "/proc/scsi/sg/allow_dio"; +static const char * sg_allow_dio = "/sys/module/sg/parameters/allow_dio"; static int sg_finish_io(int wr, Rq_elem * rep); @@ -1214,11 +1214,11 @@ main(int argc, char * argv[]) fprintf(stderr, ">> Direct IO requested but incomplete %d times\n", rcoll.dio_incomplete); - if ((fd = open(proc_allow_dio, O_RDONLY)) >= 0) { + if ((fd = open(sg_allow_dio, O_RDONLY)) >= 0) { if (1 == read(fd, &c, 1)) { if ('0' == c) fprintf(stderr, ">>> %s set to '0' but should be set " - "to '1' for direct IO\n", proc_allow_dio); + "to '1' for direct IO\n", sg_allow_dio); } close(fd); } diff --git a/src/sg_dd.c b/src/sg_dd.c index 10ede6fd01da..cba519dc39d4 100644 --- a/src/sg_dd.c +++ b/src/sg_dd.c @@ -182,7 +182,7 @@ static long seed; static struct drand48_data drand;/* opaque, used by srand48_r and mrand48_r */ #endif -static const char * proc_allow_dio = "/proc/scsi/sg/allow_dio"; +static const char * sg_allow_dio = "/sys/module/sg/parameters/allow_dio"; struct flags_t { bool append; @@ -2733,11 +2733,11 @@ bypass_copy: pr2serr(">> Direct IO requested but incomplete %d times\n", dio_incomplete_count); - if ((fd = open(proc_allow_dio, O_RDONLY)) >= 0) { + if ((fd = open(sg_allow_dio, O_RDONLY)) >= 0) { if (1 == read(fd, &c, 1)) { if ('0' == c) pr2serr(">>> %s set to '0' but should be set to '1' for " - "direct IO\n", proc_allow_dio); + "direct IO\n", sg_allow_dio); } close(fd); } diff --git a/src/sg_read.c b/src/sg_read.c index a4f7ceec7a11..0538472f9023 100644 --- a/src/sg_read.c +++ b/src/sg_read.c @@ -98,7 +98,7 @@ static int in_partial = 0; static int pack_id_count = 0; static int verbose = 0; -static const char * proc_allow_dio = "/proc/scsi/sg/allow_dio"; +static const char * sg_allow_dio = "/sys/module/sg/parameters/allow_dio"; static void @@ -916,11 +916,11 @@ main(int argc, char * argv[]) pr2serr(">> Direct IO requested but incomplete %d times\n", dio_incomplete); - if ((fd = open(proc_allow_dio, O_RDONLY)) >= 0) { + if ((fd = open(sg_allow_dio, O_RDONLY)) >= 0) { if (1 == read(fd, &c, 1)) { if ('0' == c) pr2serr(">>> %s set to '0' but should be set to '1' for " - "direct IO\n", proc_allow_dio); + "direct IO\n", sg_allow_dio); } close(fd); } diff --git a/src/sgm_dd.c b/src/sgm_dd.c index aa656b390f6a..57ca1e17cae8 100644 --- a/src/sgm_dd.c +++ b/src/sgm_dd.c @@ -126,7 +126,7 @@ static struct timeval start_tm; static int blk_sz = 0; static uint32_t glob_pack_id = 0; /* pre-increment */ -static const char * proc_allow_dio = "/proc/scsi/sg/allow_dio"; +static const char * sg_allow_dio = "/sys/module/sg/parameters/allow_dio"; struct flags_t { bool append; @@ -1286,11 +1286,11 @@ main(int argc, char * argv[]) int fd; char c; - if ((fd = open(proc_allow_dio, O_RDONLY)) >= 0) { + if ((fd = open(sg_allow_dio, O_RDONLY)) >= 0) { if (1 == read(fd, &c, 1)) { if ('0' == c) pr2serr(">>> %s set to '0' but should be set to '1' for " - "direct IO\n", proc_allow_dio); + "direct IO\n", sg_allow_dio); } close(fd); } diff --git a/src/sgp_dd.c b/src/sgp_dd.c index a36d9d03a96d..7f69406beec4 100644 --- a/src/sgp_dd.c +++ b/src/sgp_dd.c @@ -214,7 +214,7 @@ typedef struct request_element static sigset_t signal_set; static pthread_t sig_listen_thread_id; -static const char * proc_allow_dio = "/proc/scsi/sg/allow_dio"; +static const char * sg_allow_dio = "/sys/module/sg/parameters/allow_dio"; static void sg_in_operation(struct opts_t * clp, Rq_elem * rep); static void sg_out_operation(struct opts_t * clp, Rq_elem * rep, @@ -1991,11 +1991,11 @@ fini: pr2serr(">> Direct IO requested but incomplete %d times\n", clp->dio_incomplete_count); - if ((fd = open(proc_allow_dio, O_RDONLY)) >= 0) { + if ((fd = open(sg_allow_dio, O_RDONLY)) >= 0) { if (1 == read(fd, &c, 1)) { if ('0' == c) pr2serr(">>> %s set to '0' but should be set to '1' for " - "direct IO\n", proc_allow_dio); + "direct IO\n", sg_allow_dio); } close(fd); } diff --git a/testing/sg_mrq_dd.cpp b/testing/sg_mrq_dd.cpp index 9f17146c31c6..dc50ad21b8cf 100644 --- a/testing/sg_mrq_dd.cpp +++ b/testing/sg_mrq_dd.cpp @@ -396,7 +396,7 @@ static atomic vb_first_time(true); static sigset_t signal_set; static sigset_t orig_signal_set; -static const char * proc_allow_dio = "/proc/scsi/sg/allow_dio"; +static const char * sg_allow_dio = "/sys/module/sg/parameters/allow_dio"; static int do_both_sg_segment(Rq_elem * rep, scat_gath_iter & i_sg_it, scat_gath_iter & o_sg_it, int seg_blks, @@ -4614,11 +4614,11 @@ fini: pr2serr(">> Direct IO requested but incomplete %d times\n", clp->dio_incomplete_count.load()); - if ((fd = open(proc_allow_dio, O_RDONLY)) >= 0) { + if ((fd = open(sg_allow_dio, O_RDONLY)) >= 0) { if (1 == read(fd, &c, 1)) { if ('0' == c) pr2serr(">>> %s set to '0' but should be set to '1' for " - "direct IO\n", proc_allow_dio); + "direct IO\n", sg_allow_dio); } close(fd); } diff --git a/testing/sg_tst_bidi.c b/testing/sg_tst_bidi.c index 6865e9a9245f..981a64fb9303 100644 --- a/testing/sg_tst_bidi.c +++ b/testing/sg_tst_bidi.c @@ -585,7 +585,7 @@ rep_async: } if (direct_io && (dirio_count < q_len)) { pr2serr("Direct IO requested %d times, done %d times\nMaybe need " - "'echo 1 > /proc/scsi/sg/allow_dio'\n", q_len, dirio_count); + "'echo 1 > /sys/module/sg/parameters/allow_dio'\n", q_len, dirio_count); } if (rep_count-- > 0) goto rep_async; diff --git a/testing/sgh_dd.cpp b/testing/sgh_dd.cpp index 2c1f24336595..e329f6bc52f7 100644 --- a/testing/sgh_dd.cpp +++ b/testing/sgh_dd.cpp @@ -387,7 +387,7 @@ static sigset_t signal_set; static sigset_t orig_signal_set; static pthread_t sig_listen_thread_id; -static const char * proc_allow_dio = "/proc/scsi/sg/allow_dio"; +static const char * sg_allow_dio = "/sys/module/sg/parameters/allow_dio"; static void sg_in_rd_cmd(struct global_collection * clp, Rq_elem * rep, mrq_arr_t & def_arr); @@ -5040,11 +5040,11 @@ fini: pr2serr(">> Direct IO requested but incomplete %d times\n", clp->dio_incomplete_count.load()); - if ((fd = open(proc_allow_dio, O_RDONLY)) >= 0) { + if ((fd = open(sg_allow_dio, O_RDONLY)) >= 0) { if (1 == read(fd, &c, 1)) { if ('0' == c) pr2serr(">>> %s set to '0' but should be set to '1' for " - "direct IO\n", proc_allow_dio); + "direct IO\n", sg_allow_dio); } close(fd); } From patchwork Wed Aug 10 18:27:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 596613 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DBEE9C00140 for ; Wed, 10 Aug 2022 18:28:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232315AbiHJS2U (ORCPT ); Wed, 10 Aug 2022 14:28:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230359AbiHJS2J (ORCPT ); Wed, 10 Aug 2022 14:28:09 -0400 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B442D86C0D for ; Wed, 10 Aug 2022 11:28:08 -0700 (PDT) Received: by mail-pl1-f180.google.com with SMTP id 13so13528853plo.12 for ; Wed, 10 Aug 2022 11:28:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=kmheWdpd3i4Ml/tZ1AljZtyFoUeRDJWabI9ibZwfLNE=; b=lHJ/Pf0rcM+Mr4yRC9WwFtcjqMMBG3Il6eAtY9SdpHCUgicrlXP93guIpnZKg1QUOk 25L+gK9uDpauzz+2LkjeEx+v+3VZ61skva61aEWbNb5ayZEH7oH2HTbvR5iHEyK+rGLL 7DBPlLPajZBRKERp/zUIKlXx/KiCGcXO9a11+LieS4NBrX1AKikKbxnCEJQ/qAAnRWL1 NlpLzorZckg4kwPJ67iF7NVGanR1WwArGsi02mCJyqzS9y2Nu1tfohsmD+aTfnBaMgAu cV2mP2vM4u3iAzDZWtfBZv7JuDYbySRdUra/3aIXYUautVS/BD9LCjFldP5EoNoa1Aen C8pg== X-Gm-Message-State: ACgBeo0bgyY2Y86eI0ceCXydT1uNoaJpDZFKknqrg/BUbOj8mEIIxIJv ZmBnxlm/QYMm1gNSKFMMc50= X-Google-Smtp-Source: AA6agR4J+AmjsV0UyN07n8XbG0Sa9aWe/pLUNvUKcRetuZ0ykRYkm8ktTmdC+QAQZT3JAQ/LDBaj1g== X-Received: by 2002:a17:902:f649:b0:16d:22fd:5c14 with SMTP id m9-20020a170902f64900b0016d22fd5c14mr29542793plg.98.1660156087356; Wed, 10 Aug 2022 11:28:07 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:85c9:163f:8564:e41f]) by smtp.gmail.com with ESMTPSA id p3-20020a170902780300b0016d10267927sm13080315pll.203.2022.08.10.11.28.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Aug 2022 11:28:06 -0700 (PDT) From: Bart Van Assche To: Doug Gilbert Cc: Hannes Reinecke , linux-scsi@vger.kernel.org, Bart Van Assche Subject: [sg3_utils 2/3] Replace the references to /proc/scsi/sg/debug Date: Wed, 10 Aug 2022 11:27:38 -0700 Message-Id: <20220810182739.756352-3-bvanassche@acm.org> X-Mailer: git-send-email 2.37.1.559.g78731f0fdb-goog In-Reply-To: <20220810182739.756352-1-bvanassche@acm.org> References: <20220810182739.756352-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Prepare for the removal of /proc/scsi from the Linux kernel by removing the references to /proc/scsi. Signed-off-by: Bart Van Assche --- testing/sg_mrq_dd.cpp | 12 ++++++------ testing/sgh_dd.cpp | 12 ++++++------ testing/uapi_sg.h | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/testing/sg_mrq_dd.cpp b/testing/sg_mrq_dd.cpp index dc50ad21b8cf..40de12316b6d 100644 --- a/testing/sg_mrq_dd.cpp +++ b/testing/sg_mrq_dd.cpp @@ -632,12 +632,12 @@ page4: "each issued\nSCSI command. When both IFILE and OFILE are sg " "devices, then the READ in\neach read-write pair is issued an " "even pack_id and its WRITE pair is\ngiven the pack_id one " - "higher (i.e. an odd number). This enables a\n'cat '" - "/proc/scsi/sg/debug' user to see that progress is being " + "higher (i.e. an odd number). This enables a\n'dmesg -w' " + "user to see that progress is being " "made.\n\n"); pr2serr("Debugging:\n" "Apart from using one or more '--verbose' options which gets a " - "bit noisy\n'cat /proc/scsi/sg/debug' can give a good overview " + "bit noisy\n'dmesg -w' can give a good overview " "of what is happening.\nThat does a sg driver object tree " "traversal that does minimal locking\nto make sure that each " "traversal is 'safe'. So it is important to note\nthe whole " @@ -650,7 +650,7 @@ page4: "request entered it while some other nodes were being " "printed.\n\n"); pr2serr("Busy state:\n" - "Busy state (abbreviated to 'bsy' in the /proc/scsi/sg/debug " + "Busy state (abbreviated to 'bsy' in the dmesg " "output)\nis entered during request setup and completion. It " "is intended to be\na temporary state. It should not block " "but does sometimes (e.g. in\nblock_get_request()). Even so " @@ -1255,7 +1255,7 @@ bypass: } if (clp->verbose) { t = 1; - /* more info in /proc/scsi/sg/debug */ + /* more info in the kernel log */ res = ioctl(fd, SG_SET_DEBUG, &t); if (res < 0) perror("sg_mrq_dd: SG_SET_DEBUG error"); @@ -1507,7 +1507,7 @@ sig_listen_thread(struct global_collection * clp) } else pr2serr_lk("%s: subsequent stall at pack_id=%d\n", __func__, pack_id); - system_wrapper("/usr/bin/cat /proc/scsi/sg/debug\n"); + system_wrapper("/usr/bin/dmesg\n"); } else prev_pack_id = pack_id; } else if (EAGAIN != err) diff --git a/testing/sgh_dd.cpp b/testing/sgh_dd.cpp index e329f6bc52f7..5482b0c39dc8 100644 --- a/testing/sgh_dd.cpp +++ b/testing/sgh_dd.cpp @@ -660,12 +660,12 @@ page4: "each issued\nSCSI command. When both IFILE and OFILE are sg " "devices, then the READ in\neach read-write pair is issued an " "even pack_id and its WRITE pair is\ngiven the pack_id one " - "higher (i.e. an odd number). This enables a\n'cat '" - "/proc/scsi/sg/debug' user to see that progress is being " + "higher (i.e. an odd number). This enables a\n'dmesg -w' " + "user to see that progress is being " "made.\n\n"); pr2serr("Debugging:\n" "Apart from using one or more '--verbose' options which gets a " - "bit noisy\n'cat /proc/scsi/sg/debug' can give a good overview " + "bit noisy\n'dmesg -w' can give a good overview " "of what is happening.\nThat does a sg driver object tree " "traversal that does minimal locking\nto make sure that each " "traversal is 'safe'. So it is important to note\nthe whole " @@ -678,7 +678,7 @@ page4: "request entered it while some other nodes were being " "printed.\n\n"); pr2serr("Busy state:\n" - "Busy state (abbreviated to 'bsy' in the /proc/scsi/sg/debug " + "Busy state (abbreviated to 'bsy' in the dmesg " "output)\nis entered during request setup and completion. It " "is intended to be\na temporary state. It should not block " "but does sometimes (e.g. in\nblock_get_request()). Even so " @@ -1258,7 +1258,7 @@ sig_listen_thread(void * v_clp) } else pr2serr_lk("%s: subsequent stall at pack_id=%d\n", __func__, pack_id); - system_wrapper("/usr/bin/cat /proc/scsi/sg/debug\n"); + system_wrapper("/usr/bin/dmesg\n"); } else prev_pack_id = pack_id; } else if (EAGAIN != err) @@ -3752,7 +3752,7 @@ bypass: } } t = 1; - res = ioctl(fd, SG_SET_DEBUG, &t); /* more info in /proc/scsi/sg/debug */ + res = ioctl(fd, SG_SET_DEBUG, &t); /* more info in the kernel log */ if (res < 0) perror("sgs_dd: SG_SET_DEBUG error"); return (res < 0) ? 0 : num; diff --git a/testing/uapi_sg.h b/testing/uapi_sg.h index 270ad4689ea7..9cc51dc00654 100644 --- a/testing/uapi_sg.h +++ b/testing/uapi_sg.h @@ -442,8 +442,8 @@ struct sg_header { #define SG_SET_COMMAND_Q 0x2271 /* Change queuing state with 0 or 1 */ /* - * Turn on/off error sense trace (1 and 0 respectively, default is off). - * Try using: "# cat /proc/scsi/sg/debug" instead in the v3 driver + * Turn on/off error sense trace in the kernel log (1 and 0 respectively, default is + * off). */ #define SG_SET_DEBUG 0x227e /* 0 -> turn off debug */ From patchwork Wed Aug 10 18:27:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 596776 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD9F3C00140 for ; Wed, 10 Aug 2022 18:28:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231584AbiHJS2R (ORCPT ); Wed, 10 Aug 2022 14:28:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230430AbiHJS2L (ORCPT ); Wed, 10 Aug 2022 14:28:11 -0400 Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9264086C16 for ; Wed, 10 Aug 2022 11:28:09 -0700 (PDT) Received: by mail-pg1-f173.google.com with SMTP id 12so15074281pga.1 for ; Wed, 10 Aug 2022 11:28:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=l//4b3stp0WdmU9qPa2Gbkr8thaoo+qqRe/qNuhI6ZI=; b=qPlick+veY2ucNJDoJRBtNVC69Q5itpVmKz9OARO86vyF6wRbT+WAzOXhqEghX0IAZ WESacZ6Pg/w2WTeKW/cPZt9P3tz2bbcU2KzaJxdKWD57wjjaraJIH/tLGQMtJPZ7XcRq b2WXToiHkiiXWKi47AM0VNms4j6frPo3oCtF4vtJ15miWu3TtbMR2aO7ApkKBR8/gZ2c 7cEG3704nEOcXuB5ucxyhRPvkc8Zrva88Jo0SIO4bKpREwpipXU02LFWAzvyCgcBmw5R Y7hYqPjInl1xZvG+svrALcJQnikhYq01CJ87dXi23CArCxac72/Snj/GEG8yAcA7ZuT3 M3eg== X-Gm-Message-State: ACgBeo2tSbY99GmmVPhOQ4d6jzPK4/FpvwNlSctWlovg3DlF1v+XPMo9 gPFEoRZMPrdSMTC3OWh4Jow= X-Google-Smtp-Source: AA6agR5XU+QydzhvIZYaISxNTrGOclLL/BWLNnwi6U6BnpeU411gVEAcQBRI5s88TURtbQRT2v9B0g== X-Received: by 2002:a05:6a00:2403:b0:52b:cd68:27f0 with SMTP id z3-20020a056a00240300b0052bcd6827f0mr28775019pfh.11.1660156088960; Wed, 10 Aug 2022 11:28:08 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:85c9:163f:8564:e41f]) by smtp.gmail.com with ESMTPSA id p3-20020a170902780300b0016d10267927sm13080315pll.203.2022.08.10.11.28.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Aug 2022 11:28:08 -0700 (PDT) From: Bart Van Assche To: Doug Gilbert Cc: Hannes Reinecke , linux-scsi@vger.kernel.org, Bart Van Assche Subject: [sg3_utils 3/3] Refer to sg_map instead of /proc/scsi/scsi Date: Wed, 10 Aug 2022 11:27:39 -0700 Message-Id: <20220810182739.756352-4-bvanassche@acm.org> X-Mailer: git-send-email 2.37.1.559.g78731f0fdb-goog In-Reply-To: <20220810182739.756352-1-bvanassche@acm.org> References: <20220810182739.756352-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Prepare for the removal of /proc/scsi from the Linux kernel by removing the references to /proc/scsi. Signed-off-by: Bart Van Assche --- doc/sg_dd.8 | 3 +-- doc/sg_map.8 | 2 +- doc/sgp_dd.8 | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/doc/sg_dd.8 b/doc/sg_dd.8 index 3268de32e738..fa182022fd49 100644 --- a/doc/sg_dd.8 +++ b/doc/sg_dd.8 @@ -484,8 +484,7 @@ A raw device must be bound to a block device prior to using sg_dd. See .B raw(8) for more information about binding raw devices. To be safe, the sg device -mapping to SCSI block devices should be checked with 'cat /proc/scsi/scsi', -or sg_map before use. +mapping to SCSI block devices should be checked with sg_map before use. .PP Disk partition information can often be found with .B fdisk(8) diff --git a/doc/sg_map.8 b/doc/sg_map.8 index 5cbb4c2a82f0..abe0935d3ae4 100644 --- a/doc/sg_map.8 +++ b/doc/sg_map.8 @@ -73,7 +73,7 @@ called devfsd whose default configuration adds back the Linux device names in their traditional positions. .PP Quite often the mapping information can be derived by -observing the output of the command: "cat /proc/scsi/scsi". +observing the output of the command: "sg_map". However if devices have been added since boot this can be deceptive. .PP diff --git a/doc/sgp_dd.8 b/doc/sgp_dd.8 index 99afcf30f085..6e40295e4443 100644 --- a/doc/sgp_dd.8 +++ b/doc/sgp_dd.8 @@ -246,7 +246,7 @@ A raw device must be bound to a block device prior to using sgp_dd. See .B raw(8) for more information about binding raw devices. To be safe, the sg device -mapping to SCSI block devices should be checked with 'cat /proc/scsi/scsi' +mapping to SCSI block devices should be checked with 'sg_map' before use. .PP Raw device partition information can often be found with