diff options
author | Douglas Gilbert <dgilbert@interlog.com> | 2020-07-17 03:50:13 +0000 |
---|---|---|
committer | Douglas Gilbert <dgilbert@interlog.com> | 2020-07-17 03:50:13 +0000 |
commit | 5d21382d1a81a0aa3da2c27235171a8b88357c00 (patch) | |
tree | a322cc5b5e82618b7358ec89113e5f3c72ede8d8 /testing | |
parent | ec46929f407fa5cc5fd1b276d407c17d1d70c2e5 (diff) | |
download | sg3_utils-5d21382d1a81a0aa3da2c27235171a8b88357c00.tar.gz |
testing: remove master-slave terminology for sgv4; remove space from end of source lines for git-svn
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@856 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'testing')
-rw-r--r-- | testing/Makefile | 18 | ||||
-rw-r--r-- | testing/Makefile.cyg | 12 | ||||
-rw-r--r-- | testing/Makefile.freebsd | 2 | ||||
-rw-r--r-- | testing/sg_mrq_dd.cpp | 42 | ||||
-rw-r--r-- | testing/sg_tst_ioctl.c | 30 | ||||
-rw-r--r-- | testing/sgh_dd.cpp | 58 | ||||
-rw-r--r-- | testing/uapi_sg.h | 18 |
7 files changed, 92 insertions, 88 deletions
diff --git a/testing/Makefile b/testing/Makefile index 63176f56..dedf23a6 100644 --- a/testing/Makefile +++ b/testing/Makefile @@ -14,7 +14,7 @@ EXTRAS = BSG_EXTRAS = -MAN_PGS = +MAN_PGS = MAN_PREF = man8 LARGE_FILE_FLAGS = -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 @@ -31,10 +31,10 @@ CXXLD = $(CXX) CPPFLAGS = -iquote ../include -iquote .. -D_REENTRANT $(LARGE_FILE_FLAGS) -DHAVE_CONFIG_H -DHAVE_NVME CXXFLAGS = -std=c++17 -pthread -ggdb -O2 -W -Wall -iquote ../include -D_REENTRANT $(LARGE_FILE_FLAGS) # CPPFLAGS = -iquote ../include -iquote .. -D_REENTRANT $(LARGE_FILE_FLAGS) -DHAVE_CONFIG_H -DHAVE_NVME -DDEBUG -# CFLAGS = -g -O2 -W -Wall +# CFLAGS = -g -O2 -W -Wall CFLAGS = -ggdb -O2 -W -Wall -DDEBUG # CFLAGS = -g -O2 -Wall -DSG_KERNEL_INCLUDES -# CFLAGS = -g -O2 -Wall -pedantic +# CFLAGS = -g -O2 -Wall -pedantic # CFLAGS = -Wall -W -pedantic -std=c11 --analyze # CFLAGS = -Wall -W -pedantic -std=c++14 -fPIC @@ -67,29 +67,29 @@ sg_sense_test: sg_sense_test.o $(LIBFILESOLD) $(LD) -o $@ $(LDFLAGS) $^ sg_queue_tst: sg_queue_tst.o $(LIBFILESOLD) - $(LD) -o $@ $(LDFLAGS) $^ + $(LD) -o $@ $(LDFLAGS) $^ bsg_queue_tst: bsg_queue_tst.o $(LIBFILESOLD) - $(LD) -o $@ $(LDFLAGS) $^ + $(LD) -o $@ $(LDFLAGS) $^ sg_tst_ioctl: sg_tst_ioctl.o $(LIBFILESOLD) - $(LD) -o $@ $(LDFLAGS) $^ + $(LD) -o $@ $(LDFLAGS) $^ # building sg_chk_asc depends on a prior successful make in ../lib sg_chk_asc: sg_chk_asc.o ../lib/sg_lib.o ../lib/sg_lib_data.o $(LD) -o $@ $(LDFLAGS) $^ sg_tst_nvme: sg_tst_nvme.o $(LIBFILESNEW) - $(LD) -o $@ $(LDFLAGS) $^ + $(LD) -o $@ $(LDFLAGS) $^ tst_sg_lib: tst_sg_lib.o ../lib/sg_lib.o ../lib/sg_lib_data.o $(LD) -o $@ $(LDFLAGS) $^ sgs_dd: sgs_dd.o $(LIBFILESOLD) - $(LD) -o $@ $(LDFLAGS) $^ + $(LD) -o $@ $(LDFLAGS) $^ sg_tst_bidi: sg_tst_bidi.o $(LIBFILESNEW) - $(LD) -o $@ $(LDFLAGS) $^ + $(LD) -o $@ $(LDFLAGS) $^ sg_tst_excl: sg_tst_excl.o $(LIBFILESNEW) $(CXXLD) -o $@ $(LDFLAGS) -pthread $^ diff --git a/testing/Makefile.cyg b/testing/Makefile.cyg index 058f837d..0dfbb07d 100644 --- a/testing/Makefile.cyg +++ b/testing/Makefile.cyg @@ -20,7 +20,7 @@ EXTRAS = BSG_EXTRAS = -MAN_PGS = +MAN_PGS = MAN_PREF = man8 LARGE_FILE_FLAGS = -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 @@ -32,9 +32,9 @@ LARGE_FILE_FLAGS = -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 ## CC = clang++ CPPFLAGS = -iquote ../include -iquote .. -D_REENTRANT $(LARGE_FILE_FLAGS) -DHAVE_CONFIG_H -DHAVE_NVME -CFLAGS = -g -O2 -W -Wall +CFLAGS = -g -O2 -W -Wall # CFLAGS = -g -O2 -Wall -DSG_KERNEL_INCLUDES -# CFLAGS = -g -O2 -Wall -pedantic +# CFLAGS = -g -O2 -Wall -pedantic # CFLAGS = -Wall -W -pedantic -std=c11 --analyze # CFLAGS = -Wall -W -pedantic -std=c++14 -fPIC @@ -65,17 +65,17 @@ sg_sense_test: sg_sense_test.o $(LIBFILESOLD) $(LD) -o $@ $(LDFLAGS) $^ sg_queue_tst: sg_queue_tst.o $(LIBFILESOLD) - $(LD) -o $@ $(LDFLAGS) $^ + $(LD) -o $@ $(LDFLAGS) $^ bsg_queue_tst: bsg_queue_tst.o $(LIBFILESOLD) - $(LD) -o $@ $(LDFLAGS) $^ + $(LD) -o $@ $(LDFLAGS) $^ # building sg_chk_asc depends on a prior successful make in ../lib sg_chk_asc: sg_chk_asc.o ../lib/sg_lib.o ../lib/sg_lib_data.o $(LD) -o $@ $(LDFLAGS) $^ sg_tst_nvme: sg_tst_nvme.o $(LIBFILESNEW) - $(LD) -o $@ $(LDFLAGS) $^ + $(LD) -o $@ $(LDFLAGS) $^ tst_sg_lib: tst_sg_lib.o ../lib/sg_lib.o ../lib/sg_lib_data.o $(LD) -o $@ $(LDFLAGS) $^ diff --git a/testing/Makefile.freebsd b/testing/Makefile.freebsd index bba9f572..5b11cd09 100644 --- a/testing/Makefile.freebsd +++ b/testing/Makefile.freebsd @@ -17,7 +17,7 @@ EXECS = sg_sense_test sg_chk_asc sg_tst_nvme tst_sg_lib EXTRAS = -MAN_PGS = +MAN_PGS = MAN_PREF = man8 OS_FLAGS = -DSG_LIB_FREEBSD -DHAVE_NVME diff --git a/testing/sg_mrq_dd.cpp b/testing/sg_mrq_dd.cpp index 846d381a..900f45dc 100644 --- a/testing/sg_mrq_dd.cpp +++ b/testing/sg_mrq_dd.cpp @@ -36,7 +36,7 @@ * renamed [20181221] */ -static const char * version_str = "1.02 20200709"; +static const char * version_str = "1.03 20200716"; #define _XOPEN_SOURCE 600 #ifndef _GNU_SOURCE @@ -683,8 +683,8 @@ sg_flags_str(int flags, int b_len, char * b) if (n >= b_len) goto fini; } - if (SGV4_FLAG_ORDERED_SLV & flags) { /* 0x80000 */ - n += sg_scnpr(b + n, b_len - n, "OSLV|"); + if (SGV4_FLAG_ORDERED_WR & flags) { /* 0x80000 */ + n += sg_scnpr(b + n, b_len - n, "OWR|"); if (n >= b_len) goto fini; } @@ -802,8 +802,8 @@ fetch_sg_version(void) have_sg_version = !!sg_version; } } - if (NULL == fp) - pr2serr("The sg driver may not be loaded\n"); + if (NULL == fp) + pr2serr("The sg driver may not be loaded\n"); } if (fp) fclose(fp); @@ -1107,11 +1107,12 @@ page4: "traversal is 'safe'. So it is important to note\nthe whole " "tree is not locked. This means for fast devices the overall\n" "tree state may change while the traversal is occurring. For " - "example,\nit has been observed that both the master and slave " + "example,\nit has been observed that both the read- and write- " "sides of a request\nshare show they are in 'active' state " - "which should not be possible.\nIt occurs because the master " - "probably jumped out of active state and\nthe slave request " - "entered it while some other nodes were being printed.\n\n"); + "which should not be possible.\nIt occurs because the read-side " + "probably jumped out of active state and\nthe write-side " + "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 " "output)\nis entered during request setup and completion. It " @@ -2244,7 +2245,7 @@ sig_listen_thread(struct global_collection * clp) } static bool -sg_share_prepare(int slave_wr_fd, int master_rd_fd, int id, bool vb_b) +sg_share_prepare(int write_side_fd, int read_side_fd, int id, bool vb_b) { struct sg_extended_info sei; struct sg_extended_info * seip; @@ -2253,16 +2254,17 @@ sg_share_prepare(int slave_wr_fd, int master_rd_fd, int id, bool vb_b) memset(seip, 0, sizeof(*seip)); seip->sei_wr_mask |= SG_SEIM_SHARE_FD; seip->sei_rd_mask |= SG_SEIM_SHARE_FD; - seip->share_fd = master_rd_fd; - if (ioctl(slave_wr_fd, SG_SET_GET_EXTENDED, seip) < 0) { + seip->share_fd = read_side_fd; + if (ioctl(write_side_fd, SG_SET_GET_EXTENDED, seip) < 0) { pr2serr_lk("tid=%d: ioctl(EXTENDED(shared_fd=%d), failed " - "errno=%d %s\n", id, master_rd_fd, errno, + "errno=%d %s\n", id, read_side_fd, errno, strerror(errno)); return false; } if (vb_b) - pr2serr_lk("%s: tid=%d: ioctl(EXTENDED(shared_fd)) ok, master_fd=%d, " - "slave_fd=%d\n", __func__, id, master_rd_fd, slave_wr_fd); + pr2serr_lk("%s: tid=%d: ioctl(EXTENDED(shared_fd)) ok, " + "read_side_fd=%d, write_side_fd=%d\n", __func__, id, + read_side_fd, write_side_fd); return true; } @@ -2537,7 +2539,7 @@ fini: } close(rep->outfd); } - /* pass stats back to master */ + /* pass stats back to read-side */ clp->in_rem_count -= rep->in_local_count; clp->out_rem_count -= rep->out_local_count; clp->in_partial += rep->in_local_partial; @@ -2983,7 +2985,7 @@ sg_half_segment(Rq_elem * rep, scat_gath_iter & sg_it, bool is_wr, break; } - /* First build the command/request for the master (READ) side */ + /* First build the command/request for the read-side */ cdbsz = is_wr ? clp->cdbsz_out : clp->cdbsz_in; res = sg_build_scsi_cdb(t_cdb.data(), cdbsz, num, sg_it.current_lba(), false, is_wr, flagsp->fua, flagsp->dpo); @@ -3384,7 +3386,7 @@ do_both_sg_segment(Rq_elem * rep, scat_gath_iter & i_sg_it, break; } - /* First build the command/request for the master (READ) side */ + /* First build the command/request for the read-side*/ cdbsz = clp->cdbsz_in; res = sg_build_scsi_cdb(t_cdb.data(), cdbsz, num, i_sg_it.current_lba(), false, false, @@ -3408,7 +3410,7 @@ do_both_sg_segment(Rq_elem * rep, scat_gath_iter & i_sg_it, t_v4p->request_extra = mrq_pack_id_base + ++rep->mrq_pack_id_off; a_v4.push_back(t_v4); - /* Now build the command/request for slave (WRITE or VERIFY) side */ + /* Now build the command/request for write-side (WRITE or VERIFY) */ cdbsz = clp->cdbsz_out; res = sg_build_scsi_cdb(t_cdb.data(), cdbsz, num, o_sg_it.current_lba(), clp->verify, true, @@ -3464,7 +3466,7 @@ do_both_sg_segment(Rq_elem * rep, scat_gath_iter & i_sg_it, if (! (iflagsp->coe || oflagsp->coe)) ctl_v4.flags |= SGV4_FLAG_STOP_IF; if ((! clp->verify) && clp->out_flags.order) - ctl_v4.flags |= SGV4_FLAG_ORDERED_SLV; + ctl_v4.flags |= SGV4_FLAG_ORDERED_WR; ctl_v4.dout_xferp = (uint64_t)a_v4.data(); /* request array */ ctl_v4.dout_xfer_len = a_v4.size() * sizeof(struct sg_io_v4); ctl_v4.din_xferp = (uint64_t)a_v4.data(); /* response array */ diff --git a/testing/sg_tst_ioctl.c b/testing/sg_tst_ioctl.c index 160fcd83..54e0d23a 100644 --- a/testing/sg_tst_ioctl.c +++ b/testing/sg_tst_ioctl.c @@ -60,7 +60,7 @@ * later of the Linux sg driver. */ -static const char * version_str = "Version: 1.17 20200602"; +static const char * version_str = "Version: 1.18 20200716"; #define INQ_REPLY_LEN 128 #define INQ_CMD_LEN 6 @@ -410,10 +410,10 @@ tst_extended_ioctl(const char * fnp, int sg_fd, const char * fn2p, int sg_fd2, seip->ctl_flags_rd_mask |= SG_CTL_FLAGM_ORPHANS; seip->ctl_flags_rd_mask |= SG_CTL_FLAGM_Q_TAIL; seip->ctl_flags_rd_mask |= SG_CTL_FLAGM_IS_SHARE; - seip->ctl_flags_rd_mask |= SG_CTL_FLAGM_IS_MASTER; + seip->ctl_flags_rd_mask |= SG_CTL_FLAGM_IS_READ_SIDE; seip->ctl_flags_rd_mask |= SG_CTL_FLAGM_UNSHARE; - seip->ctl_flags_rd_mask |= SG_CTL_FLAGM_MASTER_FINI; - seip->ctl_flags_rd_mask |= SG_CTL_FLAGM_MASTER_ERR; + seip->ctl_flags_rd_mask |= SG_CTL_FLAGM_READ_SIDE_FINI; + seip->ctl_flags_rd_mask |= SG_CTL_FLAGM_READ_SIDE_ERR; seip->ctl_flags_wr_mask |= SG_CTL_FLAGM_NO_DURATION; seip->ctl_flags_rd_mask |= SG_CTL_FLAGM_NO_DURATION; seip->ctl_flags |= SG_CTL_FLAGM_TIME_IN_NS; @@ -450,18 +450,18 @@ tst_extended_ioctl(const char * fnp, int sg_fd, const char * fn2p, int sg_fd2, if (SG_CTL_FLAGM_IS_SHARE & seip->ctl_flags_rd_mask) printf(" %sIS_SHARE: %s\n", cp, (SG_CTL_FLAGM_IS_SHARE & cflags) ? "true" : "false"); - if (SG_CTL_FLAGM_IS_MASTER & seip->ctl_flags_rd_mask) - printf(" %sIS_MASTER: %s\n", cp, - (SG_CTL_FLAGM_IS_MASTER & cflags) ? "true" : "false"); + if (SG_CTL_FLAGM_IS_READ_SIDE & seip->ctl_flags_rd_mask) + printf(" %sIS_READ_SIDE: %s\n", cp, + (SG_CTL_FLAGM_IS_READ_SIDE & cflags) ? "true" : "false"); if (SG_CTL_FLAGM_UNSHARE & seip->ctl_flags_rd_mask) printf(" %sUNSHARE: %s\n", cp, (SG_CTL_FLAGM_UNSHARE & cflags) ? "true" : "false"); - if (SG_CTL_FLAGM_MASTER_FINI & seip->ctl_flags_rd_mask) - printf(" %sMASTER_FINI: %s\n", cp, - (SG_CTL_FLAGM_MASTER_FINI & cflags) ? "true" : "false"); - if (SG_CTL_FLAGM_MASTER_ERR & seip->ctl_flags_rd_mask) - printf(" %sMASTER_ERR: %s\n", cp, - (SG_CTL_FLAGM_MASTER_ERR & cflags) ? "true" : "false"); + if (SG_CTL_FLAGM_READ_SIDE_FINI & seip->ctl_flags_rd_mask) + printf(" %sREAD_SIDE_FINI: %s\n", cp, + (SG_CTL_FLAGM_READ_SIDE_FINI & cflags) ? "true" : "false"); + if (SG_CTL_FLAGM_READ_SIDE_ERR & seip->ctl_flags_rd_mask) + printf(" %sREAD_SIDE_ERR: %s\n", cp, + (SG_CTL_FLAGM_READ_SIDE_ERR & cflags) ? "true" : "false"); if (SG_CTL_FLAGM_NO_DURATION & seip->ctl_flags_rd_mask) printf(" %sNO_DURATION: %s\n", cp, (SG_CTL_FLAGM_NO_DURATION & cflags) ? "true" : "false"); @@ -1020,8 +1020,8 @@ main(int argc, char * argv[]) k = -k; if (second_fname) { if ((sg_fd2 = open(second_fname, O_RDWR)) < 0) { - snprintf(ebuff, EBUFF_SZ, - "%s: error opening file: %s", __func__, second_fname); + snprintf(ebuff, EBUFF_SZ, "%s: error opening file: %s", + __func__, second_fname); perror(ebuff); return 1; } diff --git a/testing/sgh_dd.cpp b/testing/sgh_dd.cpp index a9cc85d3..75fc5364 100644 --- a/testing/sgh_dd.cpp +++ b/testing/sgh_dd.cpp @@ -36,7 +36,7 @@ * renamed [20181221] */ -static const char * version_str = "1.83 20200709"; +static const char * version_str = "1.84 20200716"; #define _XOPEN_SOURCE 600 #ifndef _GNU_SOURCE @@ -602,8 +602,8 @@ sg_flags_str(int flags, int b_len, char * b) if (n >= b_len) goto fini; } - if (SGV4_FLAG_ORDERED_SLV & flags) { /* 0x80000 */ - n += sg_scnpr(b + n, b_len - n, "OSLV|"); + if (SGV4_FLAG_ORDERED_WR & flags) { /* 0x80000 */ + n += sg_scnpr(b + n, b_len - n, "OWR|"); if (n >= b_len) goto fini; } @@ -900,9 +900,9 @@ usage(int pg_num) pr2serr(" [ae=AEN[,MAEN]] [bpt=BPT] [cdbsz=6|10|12|16] " "[coe=0|1]\n" " [dio=0|1] [elemsz_kb=ESK] [fail_mask=FM] " - "[fua=0|1|2|3]\n" + "[fua=0|1|2|3]\n" " [mrq=[I|O,]NRQS[,C]] [noshare=0|1] " - "[of2=OFILE2]\n" + "[of2=OFILE2]\n" " [ofreg=OFREG] [ofsplit=OSP] [sync=0|1] [thr=THR] " "[time=0|1]\n" " [unshare=1|0] [verbose=VERB] [--dry-run] " @@ -1041,8 +1041,8 @@ page3: "file\n" " descriptors (def: each threads has own file " "descriptors)\n" - " swait slave wait: issue WRITE on OFILE before READ " - "is finished;\n" + " swait slave wait: action under review, treat as " + "dummy;\n" " [oflag only] and IFILE and OFILE must be sg " "devices\n" " v3 use v3 sg interface (def: v3 unless sg driver " @@ -1077,11 +1077,12 @@ page4: "traversal is 'safe'. So it is important to note\nthe whole " "tree is not locked. This means for fast devices the overall\n" "tree state may change while the traversal is occurring. For " - "example,\nit has been observed that both the master and slave " + "example,\nit has been observed that both the read- and write- " "sides of a request\nshare show they are in 'active' state " - "which should not be possible.\nIt occurs because the master " - "probably jumped out of active state and\nthe slave request " - "entered it while some other nodes were being printed.\n\n"); + "which should not be possible.\nIt occurs because the read-" + "sie probably jumped out of active state and\nthe write-side " + "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 " "output)\nis entered during request setup and completion. It " @@ -1259,7 +1260,7 @@ mrq_abort_thread(void * v_maip) } static bool -sg_share_prepare(int slave_wr_fd, int master_rd_fd, int id, bool vb_b) +sg_share_prepare(int write_side_fd, int read_side_fd, int id, bool vb_b) { struct sg_extended_info sei; struct sg_extended_info * seip; @@ -1268,16 +1269,17 @@ sg_share_prepare(int slave_wr_fd, int master_rd_fd, int id, bool vb_b) memset(seip, 0, sizeof(*seip)); seip->sei_wr_mask |= SG_SEIM_SHARE_FD; seip->sei_rd_mask |= SG_SEIM_SHARE_FD; - seip->share_fd = master_rd_fd; - if (ioctl(slave_wr_fd, SG_SET_GET_EXTENDED, seip) < 0) { + seip->share_fd = read_side_fd; + if (ioctl(write_side_fd, SG_SET_GET_EXTENDED, seip) < 0) { pr2serr_lk("tid=%d: ioctl(EXTENDED(shared_fd=%d), failed " - "errno=%d %s\n", id, master_rd_fd, errno, + "errno=%d %s\n", id, read_side_fd, errno, strerror(errno)); return false; } if (vb_b) - pr2serr_lk("%s: tid=%d: ioctl(EXTENDED(shared_fd)) ok, master_fd=%d, " - "slave_fd=%d\n", __func__, id, master_rd_fd, slave_wr_fd); + pr2serr_lk("%s: tid=%d: ioctl(EXTENDED(shared_fd)) ok, " + "read_side_fd=%d, write_side_fd=%d\n", __func__, + id, read_side_fd, write_side_fd); return true; } @@ -2051,7 +2053,7 @@ sg_wr_swap_share(Rq_elem * rep, int to_fd, bool before) bool not_first = false; int err = 0; int k; - int master_fd = rep->infd; /* in (READ) side is master */ + int read_side_fd = rep->infd; struct global_collection * clp = rep->clp; struct sg_extended_info sei; struct sg_extended_info * seip = &sei; @@ -2064,13 +2066,13 @@ sg_wr_swap_share(Rq_elem * rep, int to_fd, bool before) seip->sei_rd_mask |= SG_SEIM_CHG_SHARE_FD; seip->share_fd = to_fd; if (before) { - /* clear MASTER_FINI bit to put master in SG_RQ_SHR_SWAP state */ + /* clear READ_SIDE_FINI bit: puts read-side in SG_RQ_SHR_SWAP state */ seip->sei_wr_mask |= SG_SEIM_CTL_FLAGS; seip->sei_rd_mask |= SG_SEIM_CTL_FLAGS; - seip->ctl_flags_wr_mask |= SG_CTL_FLAGM_MASTER_FINI; - seip->ctl_flags &= SG_CTL_FLAGM_MASTER_FINI;/* would be 0 anyway */ + seip->ctl_flags_wr_mask |= SG_CTL_FLAGM_READ_SIDE_FINI; + seip->ctl_flags &= SG_CTL_FLAGM_READ_SIDE_FINI;/* would be 0 anyway */ } - for (k = 0; (ioctl(master_fd, SG_SET_GET_EXTENDED, seip) < 0) && + for (k = 0; (ioctl(read_side_fd, SG_SET_GET_EXTENDED, seip) < 0) && (EBUSY == errno); ++k) { err = errno; if (k > 10000) @@ -2078,7 +2080,7 @@ sg_wr_swap_share(Rq_elem * rep, int to_fd, bool before) if (! not_first) { if (clp->verbose > 3) pr2serr_lk("tid=%d: ioctl(EXTENDED(change_shared_fd=%d), " - "failed errno=%d %s\n", rep->id, master_fd, err, + "failed errno=%d %s\n", rep->id, read_side_fd, err, strerror(err)); not_first = true; } @@ -2087,13 +2089,13 @@ sg_wr_swap_share(Rq_elem * rep, int to_fd, bool before) } if (err) { pr2serr_lk("tid=%d: ioctl(EXTENDED(change_shared_fd=%d), failed " - "errno=%d %s\n", rep->id, master_fd, err, strerror(err)); + "errno=%d %s\n", rep->id, read_side_fd, err, strerror(err)); return false; } if (clp->verbose > 15) pr2serr_lk("%s: tid=%d: ioctl(EXTENDED(change_shared_fd)) ok, " - "master_fd=%d, to_slave_fd=%d\n", __func__, rep->id, - master_fd, to_fd); + "read_side_fd=%d, to_write_side_fd=%d\n", __func__, rep->id, + read_side_fd, to_fd); return true; } @@ -3089,9 +3091,9 @@ sg_start_io(Rq_elem * rep, mrq_arr_t & def_arr, int & pack_id, else if (rep->outregfd < 0) flags |= SGV4_FLAG_NO_DXFER; - cp = (wr ? " slave active" : " master active"); + cp = (wr ? " write_side active" : " read_side active"); } else - cp = (wr ? " slave not sharing" : " master not sharing"); + cp = (wr ? " write-side not sharing" : " read_side not sharing"); if (rep->both_sg) { if (wr) pack_id = rep->rd_p_id + 1; diff --git a/testing/uapi_sg.h b/testing/uapi_sg.h index d9401af9..2f40f7e8 100644 --- a/testing/uapi_sg.h +++ b/testing/uapi_sg.h @@ -14,7 +14,7 @@ * Later extensions (versions 2, 3 and 4) to driver: * Copyright (C) 1998 - 2020 Douglas Gilbert * - * Version 4.0.13 (20200328) + * Version 4.0.44 (20200618) * This version is for Linux 4 and 5 series kernels. * * Documentation @@ -127,7 +127,7 @@ typedef struct sg_io_hdr { #define SGV4_FLAG_NO_DXFER SG_FLAG_NO_DXFER /* needed for sharing */ #define SGV4_FLAG_MULTIPLE_REQS 0x20000 /* n sg_io_v4s in data-in */ #define SGV4_FLAG_EVENTFD 0x40000 /* signal completion on ... */ -#define SGV4_FLAG_ORDERED_SLV 0x80000 /* svb: issue in-order writes */ +#define SGV4_FLAG_ORDERED_WR 0x80000 /* svb: issue in-order writes */ /* Output (potentially OR-ed together) in v3::info or v4::info field */ #define SG_INFO_OK_MASK 0x1 @@ -194,8 +194,8 @@ typedef struct sg_req_info { /* used by SG_GET_REQUEST_TABLE ioctl() */ #define SG_SEIM_RESERVED_SIZE 0x4 /* reserved_sz of reserve request */ #define SG_SEIM_TOT_FD_THRESH 0x8 /* tot_fd_thresh of data buffers */ #define SG_SEIM_MINOR_INDEX 0x10 /* sg device minor index number */ -#define SG_SEIM_SHARE_FD 0x20 /* slave gives fd of master: sharing */ -#define SG_SEIM_CHG_SHARE_FD 0x40 /* master gives fd of new slave */ +#define SG_SEIM_SHARE_FD 0x20 /* write-side gives fd of read-side */ +#define SG_SEIM_CHG_SHARE_FD 0x40 /* read-side given new write-side fd */ #define SG_SEIM_SGAT_ELEM_SZ 0x80 /* sgat element size (>= PAGE_SIZE) */ #define SG_SEIM_EVENTFD 0x100 /* pass eventfd to driver */ #define SG_SEIM_ALL_BITS 0x1ff /* should be OR of previous items */ @@ -206,12 +206,12 @@ typedef struct sg_req_info { /* used by SG_GET_REQUEST_TABLE ioctl() */ #define SG_CTL_FLAGM_OTHER_OPENS 0x4 /* rd: other sg fd_s on this dev */ #define SG_CTL_FLAGM_ORPHANS 0x8 /* rd: orphaned requests on this fd */ #define SG_CTL_FLAGM_Q_TAIL 0x10 /* used for future cmds on this fd */ -#define SG_CTL_FLAGM_IS_SHARE 0x20 /* rd: fd is master or slave share */ -#define SG_CTL_FLAGM_IS_MASTER 0x40 /* rd: this fd is share master */ +#define SG_CTL_FLAGM_IS_SHARE 0x20 /* rd: fd is read-side or write-side share */ +#define SG_CTL_FLAGM_IS_READ_SIDE 0x40 /* rd: this fd is read-side share */ #define SG_CTL_FLAGM_UNSHARE 0x80 /* undo share after inflight cmd */ -/* rd> 1: master finished 0: not; wr> 1: finish share post master */ -#define SG_CTL_FLAGM_MASTER_FINI 0x100 /* wr> 0: setup for repeat slave req */ -#define SG_CTL_FLAGM_MASTER_ERR 0x200 /* rd: sharing, master got error */ +/* rd> 1: read-side finished, 0: not; wr> 1: finish share post read-side */ +#define SG_CTL_FLAGM_READ_SIDE_FINI 0x100 /* wr> 0: setup for repeat write-side req */ +#define SG_CTL_FLAGM_READ_SIDE_ERR 0x200 /* rd: sharing, read-side got error */ #define SG_CTL_FLAGM_NO_DURATION 0x400 /* don't calc command duration */ #define SG_CTL_FLAGM_MORE_ASYNC 0x800 /* yield EAGAIN in more cases */ #define SG_CTL_FLAGM_EXCL_WAITQ 0x1000 /* only 1 wake up per response */ |