aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2022-08-12 17:26:14 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2022-08-12 17:26:14 +0000
commit98b99ad2ab348bbba1676b95a8895f12ee48fd31 (patch)
tree8c250f6c63a9ada16b4c223056b5d27bf123fc57 /examples
parent5a1cdabc085bc9ccaedc5aff7c49a2d0ea5d6e12 (diff)
downloadsg3_utils-98b99ad2ab348bbba1676b95a8895f12ee48fd31.tar.gz
Prepare for removing /proc/scsi from the Linux kernel
From: Bart Van Assche <bvanassche@acm.org> 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
Diffstat (limited to 'examples')
-rw-r--r--examples/sgq_dd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/sgq_dd.c b/examples/sgq_dd.c
index 3f8ffa27..80e8817a 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);
}