From 98b99ad2ab348bbba1676b95a8895f12ee48fd31 Mon Sep 17 00:00:00 2001 From: Douglas Gilbert Date: Fri, 12 Aug 2022 17:26:14 +0000 Subject: Prepare for removing /proc/scsi from the Linux kernel From: Bart Van Assche The sg3_utils package is the only /proc/scsi user I know of. Although support for systems without /proc/scsi was added to rescan_scsi_bus.sh more than ten years ago, a few references to /proc/scsi remain. Convert these references into the recommended interfaces. Posted to linux-scsi@vger.kernel.org on 20220810 git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@968 6180dd3e-e324-4e3e-922d-17de1ae2f315 --- src/sgp_dd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/sgp_dd.c') diff --git a/src/sgp_dd.c b/src/sgp_dd.c index e88f3330..6a039f43 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); } -- cgit v1.2.3