aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2022-10-21 04:13:46 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2022-10-21 04:13:46 +0000
commitdf021e02a8ebe19d0537bb836b988bc7d424f79e (patch)
treef803e2f82447fa4d7bd9917fb7734e49100e7f42
parent571a84881ebb07e5c307a748b705724ec2d8d3e4 (diff)
downloadsg3_utils-df021e02a8ebe19d0537bb836b988bc7d424f79e.tar.gz
build cleanups for 'make distcheck'
See https://github.com/doug-gilbert/sg3_utils/pull/26, 27 and 28; still need svn:ignore property or maybe global-ignores. More testing/*_dd.c* cleanups for retiring HIPRI and relacing with POLLED (for calling bio_poll() in kernel). git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@975 6180dd3e-e324-4e3e-922d-17de1ae2f315
-rw-r--r--.gitignore193
-rw-r--r--ChangeLog5
-rw-r--r--Makefile.am183
-rw-r--r--Makefile.in81
-rw-r--r--configure.ac9
-rw-r--r--doc/Makefile.am12
-rw-r--r--doc/Makefile.in16
-rw-r--r--lib/Makefile.am3
-rw-r--r--lib/Makefile.in4
-rw-r--r--scripts/Makefile.am2
-rw-r--r--scripts/Makefile.in33
-rw-r--r--src/Makefile.am4
-rw-r--r--src/Makefile.in4
-rw-r--r--testing/sg_mrq_dd.cpp71
-rw-r--r--testing/sgh_dd.cpp39
-rw-r--r--testing/sgs_dd.c51
-rw-r--r--testing/uapi_sg.h3
17 files changed, 501 insertions, 212 deletions
diff --git a/.gitignore b/.gitignore
index d194ced1..8ed670de 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,97 +6,104 @@
*.lo
*.o
*~
-.deps
-.libs
-aclocal.m4
-ar-lib
-autom4te.cache/
-compile
-config.guess
-config.h
-config.log
-config.status
-config.sub
-configure
-depcomp
-doc/Makefile
-doc/sg_scan.8
-include/Makefile
-INSTALL
-install-sh
-lib/Makefile
-libtool
-ltmain.sh
-Makefile
+.deps/
+.libs/
+/aclocal.m4
+/ar-lib
+/autom4te.cache/
+/compile
+/config.guess
+/config.h
+/config.h.in
+/config.log
+/config.status
+/config.sub
+/configure
+/depcomp
+/doc/Makefile
+/doc/sg_scan.8
+/include/Makefile
+/install-sh
+/lib/Makefile
+/libtool
+/ltmain.sh
+/Makefile
+/missing
+/scripts/Makefile
+/sg3_utils-*.tar.gz
+/src/Makefile
+/src/sginfo
+/src/sgm_dd
+/src/sgp_dd
+/src/sg_bg_ctl
+/src/sg_compare_and_write
+/src/sg_copy_results
+/src/sg_dd
+/src/sg_decode_sense
+/src/sg_emc_trespass
+/src/sg_format
+/src/sg_get_config
+/src/sg_get_elem_status
+/src/sg_get_lba_status
+/src/sg_ident
+/src/sg_inq
+/src/sg_logs
+/src/sg_luns
+/src/sg_map
+/src/sg_map26
+/src/sg_modes
+/src/sg_opcodes
+/src/sg_persist
+/src/sg_prevent
+/src/sg_raw
+/src/sg_rbuf
+/src/sg_rdac
+/src/sg_read
+/src/sg_readcap
+/src/sg_read_attr
+/src/sg_read_block_limits
+/src/sg_read_buffer
+/src/sg_read_long
+/src/sg_reassign
+/src/sg_referrals
+/src/sg_rem_rest_elem
+/src/sg_rep_density
+/src/sg_rep_pip
+/src/sg_rep_zones
+/src/sg_requests
+/src/sg_reset
+/src/sg_reset_wp
+/src/sg_rmsn
+/src/sg_rtpg
+/src/sg_safte
+/src/sg_sanitize
+/src/sg_sat_identify
+/src/sg_sat_phy_event
+/src/sg_sat_read_gplog
+/src/sg_sat_set_features
+/src/sg_scan
+/src/sg_seek
+/src/sg_senddiag
+/src/sg_ses
+/src/sg_ses_microcode
+/src/sg_start
+/src/sg_stpg
+/src/sg_stream_ctl
+/src/sg_sync
+/src/sg_test_rwbuf
+/src/sg_timestamp
+/src/sg_turs
+/src/sg_unmap
+/src/sg_verify
+/src/sg_vpd
+/src/sg_write_buffer
+/src/sg_write_long
+/src/sg_write_same
+/src/sg_write_verify
+/src/sg_write_x
+/src/sg_wr_mode
+/src/sg_xcopy
+/src/sg_zone
+/src/sg_z_act_query
+/stamp-h1
Makefile.in
-missing
-src/Makefile
-src/sginfo
-src/sgm_dd
-src/sgp_dd
-src/sg_bg_ctl
-src/sg_compare_and_write
-src/sg_copy_results
-src/sg_dd
-src/sg_decode_sense
-src/sg_emc_trespass
-src/sg_format
-src/sg_get_config
-src/sg_get_lba_status
-src/sg_ident
-src/sg_inq
-src/sg_logs
-src/sg_luns
-src/sg_map
-src/sg_map26
-src/sg_modes
-src/sg_opcodes
-src/sg_persist
-src/sg_prevent
-src/sg_raw
-src/sg_rbuf
-src/sg_rdac
-src/sg_read
-src/sg_readcap
-src/sg_read_attr
-src/sg_read_block_limits
-src/sg_read_buffer
-src/sg_read_long
-src/sg_reassign
-src/sg_referrals
-src/sg_rep_zones
-src/sg_requests
-src/sg_reset
-src/sg_reset_wp
-src/sg_rmsn
-src/sg_rtpg
-src/sg_safte
-src/sg_sanitize
-src/sg_sat_identify
-src/sg_sat_phy_event
-src/sg_sat_read_gplog
-src/sg_sat_set_features
-src/sg_scan
-src/sg_scan.c
-src/sg_senddiag
-src/sg_ses
-src/sg_ses_microcode
-src/sg_start
-src/sg_stpg
-src/sg_sync
-src/sg_test_rwbuf
-src/sg_timestamp
-src/sg_turs
-src/sg_unmap
-src/sg_verify
-src/sg_vpd
-src/sg_write_atomic
-src/sg_write_buffer
-src/sg_write_long
-src/sg_write_same
-src/sg_write_verify
-src/sg_write_x
-src/sg_wr_mode
-src/sg_xcopy
-src/sg_zone
-stamp-h1
diff --git a/ChangeLog b/ChangeLog
index ad91c94e..d50470de 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,7 +2,7 @@ Each utility has its own version number, date of last change and
some description at the top of its ".c" file. All utilities in the main
directory have their own "man" pages. There is also a sg3_utils man page.
-Changelog for pre-release sg3_utils-1.48 [20221007] [svn: r974]
+Changelog for pre-release sg3_utils-1.48 [20221020] [svn: r975]
- some utilities: add experimental --json[=JO] option
- sg_z_act_query: new utility for sending either a
Zone activate or Zone query command
@@ -94,6 +94,9 @@ Changelog for pre-release sg3_utils-1.48 [20221007] [svn: r974]
- sg_pt_dummy.c: remove problematic include
- sg3_utils.spec: change tarball extension from .tgz to
.tar.gz ; fix build issue with Fedora 36
+ - build cleanups for 'make distcheck', see
+ https://github.com/doug-gilbert/sg3_utils/pull/26, 27 and
+ 28; need svn:ignore property or maybe global-ignores
- round of coverity identified issue fixes (and non-issues)
- autoconf: upgrade version 2.70 to 2.71; automake upgrade
to version 1.16.5 (from Fedora 36)
diff --git a/Makefile.am b/Makefile.am
index 77b0716f..240acbe2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,15 +1,184 @@
-SUBDIRS = include \
- lib \
- src \
- doc \
- scripts
+SUBDIRS = \
+ include \
+ lib \
+ src \
+ doc \
+ scripts
-EXTRA_DIST=autogen.sh COVERAGE CREDITS
+EXTRA_DIST = \
+ autogen.sh \
+ COVERAGE \
+ CREDITS \
+ BSD_LICENSE \
+ build_debian.sh \
+ README.details \
+ README.freebsd \
+ README.iscsi \
+ README.sg_start \
+ README.solaris \
+ README.tru64 \
+ README.win32 \
+ sg3_utils.man8.html \
+ sg3_utils.spec
+
+EXTRA_DIST += \
+ archive/align_b4_memalign.c \
+ archive/llseek.c \
+ archive/llseek.h \
+ archive/o_scsi_logging_level \
+ archive/README \
+ archive/sg_json_writer.c \
+ archive/sg_json_writer.h
+
+EXTRA_DIST += \
+ debian/changelog \
+ debian/compat \
+ debian/control \
+ debian/copyright \
+ debian/docs \
+ debian/libsgutils2-2.install \
+ debian/libsgutils2-dev.install \
+ debian/README.debian4 \
+ debian/rules \
+ debian/sg3-utils.examples \
+ debian/sg3-utils.install
+
+EXTRA_DIST += \
+ examples/Makefile.freebsd \
+ examples/README \
+ examples/reassign_addr.txt \
+ examples/scsi_inquiry.c \
+ examples/sdiag_sas_p0_cjtpat.txt \
+ examples/sdiag_sas_p0_prbs9.txt \
+ examples/sdiag_sas_p1_cjtpat.txt \
+ examples/sdiag_sas_p1_idle.txt \
+ examples/sdiag_sas_p1_prbs15.txt \
+ examples/sdiag_sas_p1_stop.txt \
+ examples/sg_compare_and_write.txt \
+ examples/sg_excl.c \
+ examples/sg_persist_tst.sh \
+ examples/sgq_dd.c \
+ examples/sg_sat_chk_power.c \
+ examples/sg__sat_identify.c \
+ examples/sg__sat_phy_event.c \
+ examples/sg__sat_set_features.c \
+ examples/sg_sat_smart_rd_data.c \
+ examples/sg_simple16.c \
+ examples/sg_simple1.c \
+ examples/sg_simple2.c \
+ examples/sg_simple3.c \
+ examples/sg_simple4.c \
+ examples/sg_simple5.c \
+ examples/sg_unmap_example.txt \
+ examples/transport_ids.txt \
+ examples/Makefile
+
+EXTRA_DIST += \
+ getopt_long/getopt.h \
+ getopt_long/getopt_long.c
+
+EXTRA_DIST += \
+ include/freebsd_nvme_ioctl.h
+
+EXTRA_DIST += \
+ inhex/descriptor_sense.hex \
+ inhex/fixed_sense.hex \
+ inhex/forwarded_sense.hex \
+ inhex/get_elem_status.hex \
+ inhex/get_lba_status.hex \
+ inhex/inq_standard.hex \
+ inhex/logs_last_n.hex \
+ inhex/nvme_dev_self_test.hex \
+ inhex/nvme_identify_ctl.hex \
+ inhex/nvme_read_ctl.hex \
+ inhex/nvme_read_oob_ctl.hex \
+ inhex/nvme_write_ctl.hex \
+ inhex/opcodes.hex \
+ inhex/README \
+ inhex/ref_sense.hex \
+ inhex/rep_density.hex \
+ inhex/rep_density_media.hex \
+ inhex/rep_density_media_typem.hex \
+ inhex/rep_density_typem.hex \
+ inhex/rep_realms.hex \
+ inhex/rep_zdomains.hex \
+ inhex/rep_zones.hex \
+ inhex/ses_areca_all.hex \
+ inhex/vpd_bdce.hex \
+ inhex/vpd_consistuents.hex \
+ inhex/vpd_cpr.hex \
+ inhex/vpd_dev_id.hex \
+ inhex/vpd_di_all.hex \
+ inhex/vpd_fp.hex \
+ inhex/vpd_lbpro.hex \
+ inhex/vpd_lbpv.hex \
+ inhex/vpd_ref.hex \
+ inhex/vpd_sbl.hex \
+ inhex/vpd_sdeb.hex \
+ inhex/vpd_sfs.hex \
+ inhex/vpd_tpc.hex \
+ inhex/vpd_zbdc.hex \
+ inhex/vpd_zbdc.raw \
+ inhex/z_act_query.hex
+
+EXTRA_DIST += \
+ scripts/40-usb-blacklist.rules \
+ scripts/54-before-scsi-sg3_id.rules \
+ scripts/55-scsi-sg3_id.rules \
+ scripts/58-scsi-sg3_symlink.rules \
+ scripts/59-fc-wwpn-id.rules \
+ scripts/59-scsi-cciss_id.rules \
+ scripts/cciss_id \
+ scripts/fc_wwpn_id \
+ scripts/lunmask.service \
+ scripts/scsi-enable-target-scan.sh
+
+EXTRA_DIST += \
+ suse/sg3_utils.changes \
+ suse/sg3_utils.spec
+
+EXTRA_DIST += \
+ testing/bsg_queue_tst.c \
+ testing/Makefile \
+ testing/Makefile.cyg \
+ testing/Makefile.freebsd \
+ testing/README \
+ testing/sg_chk_asc.c \
+ testing/sgh_dd.cpp \
+ testing/sg_iovec_tst.cpp \
+ testing/sg_json_builder_test.c \
+ testing/sg_mrq_dd.cpp \
+ testing/sg_queue_tst.c \
+ testing/sg_scat_gath.cpp \
+ testing/sg_scat_gath.h \
+ testing/sgs_dd.c \
+ testing/sg_sense_test.c \
+ testing/sg_take_snap.c \
+ testing/sg_tst_async.cpp \
+ testing/sg_tst_bidi.c \
+ testing/sg_tst_context.cpp \
+ testing/sg_tst_excl2.cpp \
+ testing/sg_tst_excl3.cpp \
+ testing/sg_tst_excl.cpp \
+ testing/sg_tst_ioctl.c \
+ testing/sg_tst_json_builder.c \
+ testing/sg_tst_nvme.c \
+ testing/tst_sg_lib.c \
+ testing/uapi_sg.h
+
+EXTRA_DIST += \
+ utils/hxascdmp.1 \
+ utils/hxascdmp.c \
+ utils/Makefile \
+ utils/Makefile.cygwin \
+ utils/Makefile.freebsd \
+ utils/Makefile.mingw \
+ utils/Makefile.solaris \
+ utils/README
distclean-local:
rm -rf autom4te.cache
rm -f build-stamp configure-stamp
rm -rf lib/.deps
rm -rf src/.deps
-
diff --git a/Makefile.in b/Makefile.in
index 73aba952..b3722f3b 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -327,13 +327,80 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-SUBDIRS = include \
- lib \
- src \
- doc \
- scripts
-
-EXTRA_DIST = autogen.sh COVERAGE CREDITS
+SUBDIRS = \
+ include \
+ lib \
+ src \
+ doc \
+ scripts
+
+EXTRA_DIST = autogen.sh COVERAGE CREDITS BSD_LICENSE build_debian.sh \
+ README.details README.freebsd README.iscsi README.sg_start \
+ README.solaris README.tru64 README.win32 sg3_utils.man8.html \
+ sg3_utils.spec archive/align_b4_memalign.c archive/llseek.c \
+ archive/llseek.h archive/o_scsi_logging_level archive/README \
+ archive/sg_json_writer.c archive/sg_json_writer.h \
+ debian/changelog debian/compat debian/control debian/copyright \
+ debian/docs debian/libsgutils2-2.install \
+ debian/libsgutils2-dev.install debian/README.debian4 \
+ debian/rules debian/sg3-utils.examples \
+ debian/sg3-utils.install examples/Makefile.freebsd \
+ examples/README examples/reassign_addr.txt \
+ examples/scsi_inquiry.c examples/sdiag_sas_p0_cjtpat.txt \
+ examples/sdiag_sas_p0_prbs9.txt \
+ examples/sdiag_sas_p1_cjtpat.txt \
+ examples/sdiag_sas_p1_idle.txt \
+ examples/sdiag_sas_p1_prbs15.txt \
+ examples/sdiag_sas_p1_stop.txt \
+ examples/sg_compare_and_write.txt examples/sg_excl.c \
+ examples/sg_persist_tst.sh examples/sgq_dd.c \
+ examples/sg_sat_chk_power.c examples/sg__sat_identify.c \
+ examples/sg__sat_phy_event.c examples/sg__sat_set_features.c \
+ examples/sg_sat_smart_rd_data.c examples/sg_simple16.c \
+ examples/sg_simple1.c examples/sg_simple2.c \
+ examples/sg_simple3.c examples/sg_simple4.c \
+ examples/sg_simple5.c examples/sg_unmap_example.txt \
+ examples/transport_ids.txt examples/Makefile \
+ getopt_long/getopt.h getopt_long/getopt_long.c \
+ include/freebsd_nvme_ioctl.h inhex/descriptor_sense.hex \
+ inhex/fixed_sense.hex inhex/forwarded_sense.hex \
+ inhex/get_elem_status.hex inhex/get_lba_status.hex \
+ inhex/inq_standard.hex inhex/logs_last_n.hex \
+ inhex/nvme_dev_self_test.hex inhex/nvme_identify_ctl.hex \
+ inhex/nvme_read_ctl.hex inhex/nvme_read_oob_ctl.hex \
+ inhex/nvme_write_ctl.hex inhex/opcodes.hex inhex/README \
+ inhex/ref_sense.hex inhex/rep_density.hex \
+ inhex/rep_density_media.hex inhex/rep_density_media_typem.hex \
+ inhex/rep_density_typem.hex inhex/rep_realms.hex \
+ inhex/rep_zdomains.hex inhex/rep_zones.hex \
+ inhex/ses_areca_all.hex inhex/vpd_bdce.hex \
+ inhex/vpd_consistuents.hex inhex/vpd_cpr.hex \
+ inhex/vpd_dev_id.hex inhex/vpd_di_all.hex inhex/vpd_fp.hex \
+ inhex/vpd_lbpro.hex inhex/vpd_lbpv.hex inhex/vpd_ref.hex \
+ inhex/vpd_sbl.hex inhex/vpd_sdeb.hex inhex/vpd_sfs.hex \
+ inhex/vpd_tpc.hex inhex/vpd_zbdc.hex inhex/vpd_zbdc.raw \
+ inhex/z_act_query.hex scripts/40-usb-blacklist.rules \
+ scripts/54-before-scsi-sg3_id.rules \
+ scripts/55-scsi-sg3_id.rules scripts/58-scsi-sg3_symlink.rules \
+ scripts/59-fc-wwpn-id.rules scripts/59-scsi-cciss_id.rules \
+ scripts/cciss_id scripts/fc_wwpn_id scripts/lunmask.service \
+ scripts/scsi-enable-target-scan.sh suse/sg3_utils.changes \
+ suse/sg3_utils.spec testing/bsg_queue_tst.c testing/Makefile \
+ testing/Makefile.cyg testing/Makefile.freebsd testing/README \
+ testing/sg_chk_asc.c testing/sgh_dd.cpp \
+ testing/sg_iovec_tst.cpp testing/sg_json_builder_test.c \
+ testing/sg_mrq_dd.cpp testing/sg_queue_tst.c \
+ testing/sg_scat_gath.cpp testing/sg_scat_gath.h \
+ testing/sgs_dd.c testing/sg_sense_test.c \
+ testing/sg_take_snap.c testing/sg_tst_async.cpp \
+ testing/sg_tst_bidi.c testing/sg_tst_context.cpp \
+ testing/sg_tst_excl2.cpp testing/sg_tst_excl3.cpp \
+ testing/sg_tst_excl.cpp testing/sg_tst_ioctl.c \
+ testing/sg_tst_json_builder.c testing/sg_tst_nvme.c \
+ testing/tst_sg_lib.c testing/uapi_sg.h utils/hxascdmp.1 \
+ utils/hxascdmp.c utils/Makefile utils/Makefile.cygwin \
+ utils/Makefile.freebsd utils/Makefile.mingw \
+ utils/Makefile.solaris utils/README
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
diff --git a/configure.ac b/configure.ac
index 23378ad6..c6deea8c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -179,7 +179,14 @@ AC_ARG_ENABLE([linux-sgv4],
[AC_DEFINE_UNQUOTED(IGNORE_LINUX_SGV4, 1, [even if Linux sg v4 available, use v3 instead], )], [])
-AC_OUTPUT(Makefile include/Makefile lib/Makefile src/Makefile doc/Makefile scripts/Makefile)
+AC_OUTPUT(
+ Makefile
+ include/Makefile
+ lib/Makefile
+ src/Makefile
+ doc/Makefile
+ scripts/Makefile
+)
# Borrowed from smartmontools configure.ac
diff --git a/doc/Makefile.am b/doc/Makefile.am
index f816bb87..2d5c52ea 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -1,5 +1,5 @@
-man_MANS = \
+dist_man_MANS = \
scsi_mandat.8 scsi_readcap.8 scsi_ready.8 scsi_satl.8 scsi_start.8 \
scsi_stop.8 scsi_temperature.8 sg3_utils.8 sg3_utils_json.8 \
sg_bg_ctl.8 sg_compare_and_write.8 sg_decode_sense.8 sg_format.8 \
@@ -19,7 +19,7 @@ man_MANS = \
CLEANFILES =
if OS_LINUX
-man_MANS += \
+dist_man_MANS += \
rescan-scsi-bus.sh.8 scsi_logging_level.8 sg_copy_results.8 sg_dd.8 \
sg_emc_trespass.8 sg_map.8 sg_map26.8 sg_rbuf.8 sg_read.8 sg_reset.8 \
sg_scan.8 sg_test_rwbuf.8 sg_xcopy.8 sginfo.8 sgm_dd.8 sgp_dd.8
@@ -29,15 +29,19 @@ sg_scan.8: sg_scan.8.linux
endif
if OS_WIN32_MINGW
-man_MANS += sg_scan.8
+dist_man_MANS += sg_scan.8
CLEANFILES += sg_scan.8
sg_scan.8: sg_scan.8.win32
cp -p $< $@
endif
if OS_WIN32_CYGWIN
-man_MANS += sg_scan.8
+dist_man_MANS += sg_scan.8
CLEANFILES += sg_scan.8
sg_scan.8: sg_scan.8.win32
cp -p $< $@
endif
+
+EXTRA_DIST = \
+ sg_scan.8.linux \
+ sg_scan.8.win32
diff --git a/doc/Makefile.in b/doc/Makefile.in
index 63171443..a75d0fdc 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -156,9 +156,9 @@ am__uninstall_files_from_dir = { \
man8dir = $(mandir)/man8
am__installdirs = "$(DESTDIR)$(man8dir)"
NROFF = nroff
-MANS = $(man_MANS)
+MANS = $(dist_man_MANS)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
-am__DIST_COMMON = $(srcdir)/Makefile.in README
+am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in README
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@@ -286,7 +286,7 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-man_MANS = scsi_mandat.8 scsi_readcap.8 scsi_ready.8 scsi_satl.8 \
+dist_man_MANS = scsi_mandat.8 scsi_readcap.8 scsi_ready.8 scsi_satl.8 \
scsi_start.8 scsi_stop.8 scsi_temperature.8 sg3_utils.8 \
sg3_utils_json.8 sg_bg_ctl.8 sg_compare_and_write.8 \
sg_decode_sense.8 sg_format.8 sg_get_config.8 \
@@ -306,6 +306,10 @@ man_MANS = scsi_mandat.8 scsi_readcap.8 scsi_ready.8 scsi_satl.8 \
sg_z_act_query.8 $(am__append_1) $(am__append_3) \
$(am__append_5)
CLEANFILES = $(am__append_2) $(am__append_4) $(am__append_6)
+EXTRA_DIST = \
+ sg_scan.8.linux \
+ sg_scan.8.win32
+
all: all-am
.SUFFIXES:
@@ -344,10 +348,10 @@ mostlyclean-libtool:
clean-libtool:
-rm -rf .libs _libs
-install-man8: $(man_MANS)
+install-man8: $(dist_man_MANS)
@$(NORMAL_INSTALL)
@list1=''; \
- list2='$(man_MANS)'; \
+ list2='$(dist_man_MANS)'; \
test -n "$(man8dir)" \
&& test -n "`echo $$list1$$list2`" \
|| exit 0; \
@@ -382,7 +386,7 @@ uninstall-man8:
@$(NORMAL_UNINSTALL)
@list=''; test -n "$(man8dir)" || exit 0; \
files=`{ for i in $$list; do echo "$$i"; done; \
- l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
sed -n '/\.8[a-z]*$$/p'; \
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 69c64aff..2c19b1bd 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -104,3 +104,6 @@ libsgutils2_la_LDFLAGS = -version-info 2:0:0 -no-undefined -release ${PACKAGE_VE
libsgutils2_la_LIBADD = @GETOPT_O_FILES@
libsgutils2_la_DEPENDENCIES = @GETOPT_O_FILES@
+EXTRA_DIST = \
+ sg_json_builder.h \
+ BSD_LICENSE
diff --git a/lib/Makefile.in b/lib/Makefile.in
index 88ba65b9..529c7d12 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -413,6 +413,10 @@ lib_LTLIBRARIES = libsgutils2.la
libsgutils2_la_LDFLAGS = -version-info 2:0:0 -no-undefined -release ${PACKAGE_VERSION}
libsgutils2_la_LIBADD = @GETOPT_O_FILES@
libsgutils2_la_DEPENDENCIES = @GETOPT_O_FILES@
+EXTRA_DIST = \
+ sg_json_builder.h \
+ BSD_LICENSE
+
all: all-am
.SUFFIXES:
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 4fe4d145..01d44362 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -1,3 +1,3 @@
-bin_SCRIPTS = scsi_logging_level scsi_mandat scsi_readcap scsi_ready \
+dist_bin_SCRIPTS = scsi_logging_level scsi_mandat scsi_readcap scsi_ready \
scsi_satl scsi_start scsi_stop scsi_temperature \
rescan-scsi-bus.sh
diff --git a/scripts/Makefile.in b/scripts/Makefile.in
index 8d2a418d..21673ab2 100644
--- a/scripts/Makefile.in
+++ b/scripts/Makefile.in
@@ -93,7 +93,8 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
-DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+DIST_COMMON = $(srcdir)/Makefile.am $(dist_bin_SCRIPTS) \
+ $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
@@ -126,7 +127,7 @@ am__uninstall_files_from_dir = { \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__installdirs = "$(DESTDIR)$(bindir)"
-SCRIPTS = $(bin_SCRIPTS)
+SCRIPTS = $(dist_bin_SCRIPTS)
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
@@ -275,7 +276,7 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-bin_SCRIPTS = scsi_logging_level scsi_mandat scsi_readcap scsi_ready \
+dist_bin_SCRIPTS = scsi_logging_level scsi_mandat scsi_readcap scsi_ready \
scsi_satl scsi_start scsi_stop scsi_temperature \
rescan-scsi-bus.sh
@@ -311,9 +312,9 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
-install-binSCRIPTS: $(bin_SCRIPTS)
+install-dist_binSCRIPTS: $(dist_bin_SCRIPTS)
@$(NORMAL_INSTALL)
- @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \
+ @list='$(dist_bin_SCRIPTS)'; test -n "$(bindir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
$(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
@@ -340,9 +341,9 @@ install-binSCRIPTS: $(bin_SCRIPTS)
} \
; done
-uninstall-binSCRIPTS:
+uninstall-dist_binSCRIPTS:
@$(NORMAL_UNINSTALL)
- @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \
+ @list='$(dist_bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 's,.*/,,;$(transform)'`; \
dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir)
@@ -454,7 +455,7 @@ install-dvi: install-dvi-am
install-dvi-am:
-install-exec-am: install-binSCRIPTS
+install-exec-am: install-dist_binSCRIPTS
install-html: install-html-am
@@ -492,22 +493,22 @@ ps: ps-am
ps-am:
-uninstall-am: uninstall-binSCRIPTS
+uninstall-am: uninstall-dist_binSCRIPTS
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
cscopelist-am ctags-am distclean distclean-generic \
distclean-libtool distdir dvi dvi-am html html-am info info-am \
- install install-am install-binSCRIPTS install-data \
- install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-pdf install-pdf-am \
- install-ps install-ps-am install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
+ install install-am install-data install-data-am \
+ install-dist_binSCRIPTS install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
- uninstall-am uninstall-binSCRIPTS
+ uninstall-am uninstall-dist_binSCRIPTS
.PRECIOUS: Makefile
diff --git a/src/Makefile.am b/src/Makefile.am
index 95144625..c852833e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -213,3 +213,7 @@ sg_xcopy_LDADD = ../lib/libsgutils2.la
sg_zone_LDADD = ../lib/libsgutils2.la
sg_z_act_query_LDADD = ../lib/libsgutils2.la
+
+EXTRA_DIST = \
+ sg_vpd_common.h \
+ BSD_LICENSE
diff --git a/src/Makefile.in b/src/Makefile.in
index 96880766..4dde3e60 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -745,6 +745,10 @@ sg_write_x_LDADD = ../lib/libsgutils2.la
sg_xcopy_LDADD = ../lib/libsgutils2.la
sg_zone_LDADD = ../lib/libsgutils2.la
sg_z_act_query_LDADD = ../lib/libsgutils2.la
+EXTRA_DIST = \
+ sg_vpd_common.h \
+ BSD_LICENSE
+
all: all-am
.SUFFIXES:
diff --git a/testing/sg_mrq_dd.cpp b/testing/sg_mrq_dd.cpp
index 821f2555..01b38e79 100644
--- a/testing/sg_mrq_dd.cpp
+++ b/testing/sg_mrq_dd.cpp
@@ -30,7 +30,7 @@
*
*/
-static const char * version_str = "1.43 20220910";
+static const char * version_str = "1.44 20221020";
#define _XOPEN_SOURCE 600
#ifndef _GNU_SOURCE
@@ -122,8 +122,8 @@ using namespace std;
// #endif
-#ifndef SGV4_FLAG_HIPRI
-#define SGV4_FLAG_HIPRI 0x800
+#ifndef SGV4_FLAG_POLLED
+#define SGV4_FLAG_POLLED 0x800
#endif
#define MAX_SGL_NUM_VAL (INT32_MAX - 1) /* should reduce for testing */
@@ -190,7 +190,6 @@ struct flags_t {
bool excl;
bool ff;
bool fua;
- bool hipri;
bool masync; /* more async sg v4 driver fd flag */
bool mout_if; /* META_OUT_IF flag at mrq level */
bool nocreat;
@@ -198,6 +197,7 @@ struct flags_t {
bool no_thresh;
bool no_waitq; /* dummy, no longer supported, just warn */
bool order_wr;
+ bool polled; /* was previously 'hipri' */
bool qhead;
bool qtail;
bool random;
@@ -299,7 +299,7 @@ struct global_collection /* one instance visible to all threads */
bool count_given;
bool ese;
bool flexible;
- bool mrq_hipri;
+ bool mrq_polled;
bool ofile_given;
bool unit_nanosec; /* default duration unit is millisecond */
bool verify; /* don't copy, verify like Unix: cmp */
@@ -477,7 +477,7 @@ usage(int pg_num)
pr2serr(" [bpt=BPT] [cdbsz=6|10|12|16] [cdl=CDL] "
"[dio=0|1]\n"
" [elemsz_kb=EKB] [ese=0|1] [fua=0|1|2|3] "
- "[hipri=NRQS]\n"
+ "[polled=NRQS]\n"
" [mrq=NRQS] [ofreg=OFREG] [sdt=SDT] "
"[sync=0|1]\n"
" [thr=THR] [time=0|1|2[,TO]] [verbose=VERB] "
@@ -544,8 +544,7 @@ page2:
" 3->OFILE+IFILE\n"
" ibs IFILE logical block size, cannot differ from "
"obs or bs\n"
- " hipri similar to mrq=NRQS operand but also sets "
- "hipri flag\n"
+ " hipri same as polled=NRQS; name 'hipri' is deprecated\n"
" mrq NRQS is number of cmds placed in each sg "
"ioctl\n"
" (def: 16). Does not set mrq hipri flag.\n"
@@ -555,6 +554,8 @@ page2:
"ibs or bs\n"
" ofreg OFREG is regular file or pipe to send what is "
"read from\n"
+ " polled similar to mrq=NRQS operand but also sets "
+ "polled flag\n"
" IFILE in the first half of each shared element\n"
" sdt stall detection times: CRT[,ICT]. CRT: check "
"repetition\n"
@@ -598,8 +599,7 @@ page3:
"iflag)\n"
" fua sets the FUA (force unit access) in SCSI READs "
"and WRITEs\n"
- " hipri set HIPRI flag and use blk_poll() for "
- "completions\n"
+ " hipri same as 'polled'; name 'hipri' is deprecated\n"
" masync set 'more async' flag on this sg device\n"
" mmap setup mmap IO on IFILE or OFILE\n"
" mmap,mmap when used twice, doesn't call munmap()\n"
@@ -609,6 +609,8 @@ page3:
" no_thresh skip checking per fd max data xfer size\n"
" order require write ordering on sg->sg copy; only "
"for oflag\n"
+ " polled set POLLED flag and use blk_poll() for "
+ "completions\n"
" qhead queue new request at head of block queue\n"
" qtail queue new request at tail of block queue (def: "
"q at head)\n"
@@ -800,8 +802,8 @@ sg_flags_str(int flags, int b_len, char * b)
if (n >= b_len)
goto fini;
}
- if (SGV4_FLAG_HIPRI & flags) { /* 0x800 */
- n += sg_scnpr(b + n, b_len - n, "HIPRI|");
+ if (SGV4_FLAG_POLLED & flags) { /* 0x800 */
+ n += sg_scnpr(b + n, b_len - n, "POLLED|");
if (n >= b_len)
goto fini;
}
@@ -2327,8 +2329,8 @@ sg_half_segment_mrq0(Rq_elem * rep, scat_gath_iter & sg_it, bool is_wr,
rflags |= SGV4_FLAG_Q_AT_HEAD;
if (flagsp->qtail)
rflags |= SGV4_FLAG_Q_AT_TAIL;
- if (flagsp->hipri)
- rflags |= SGV4_FLAG_HIPRI;
+ if (flagsp->polled)
+ rflags |= SGV4_FLAG_POLLED;
for (k = 0, num = 0; seg_blks > 0; ++k, seg_blks -= num) {
kk = min<int>(seg_blks, clp->bpt);
@@ -2449,8 +2451,8 @@ sg_half_segment(Rq_elem * rep, scat_gath_iter & sg_it, bool is_wr,
rflags |= SGV4_FLAG_Q_AT_HEAD;
if (flagsp->qtail)
rflags |= SGV4_FLAG_Q_AT_TAIL;
- if (flagsp->hipri)
- rflags |= SGV4_FLAG_HIPRI;
+ if (flagsp->polled)
+ rflags |= SGV4_FLAG_POLLED;
for (k = 0, num = 0; seg_blks > 0; ++k, seg_blks -= num) {
kk = min<int>(seg_blks, clp->bpt);
@@ -2520,8 +2522,8 @@ sg_half_segment(Rq_elem * rep, scat_gath_iter & sg_it, bool is_wr,
ctl_v4.flags = SGV4_FLAG_MULTIPLE_REQS;
if (! flagsp->coe)
ctl_v4.flags |= SGV4_FLAG_STOP_IF;
- if (clp->mrq_hipri)
- ctl_v4.flags |= SGV4_FLAG_HIPRI;
+ if (clp->mrq_polled)
+ ctl_v4.flags |= SGV4_FLAG_POLLED;
if (clp->in_flags.mout_if || clp->out_flags.mout_if) {
ctl_v4.flags |= SGV4_FLAG_META_OUT_IF;
if (num_mrq > 0)
@@ -2870,8 +2872,8 @@ do_both_sg_segment_mrq0(Rq_elem * rep, scat_gath_iter & i_sg_it,
iflags |= SGV4_FLAG_Q_AT_HEAD;
if (iflagsp->qtail)
iflags |= SGV4_FLAG_Q_AT_TAIL;
- if (iflagsp->hipri)
- iflags |= SGV4_FLAG_HIPRI;
+ if (iflagsp->polled)
+ iflags |= SGV4_FLAG_POLLED;
oflags = SGV4_FLAG_SHARE | SGV4_FLAG_NO_DXFER;
if (oflagsp->dio)
@@ -2880,8 +2882,8 @@ do_both_sg_segment_mrq0(Rq_elem * rep, scat_gath_iter & i_sg_it,
oflags |= SGV4_FLAG_Q_AT_HEAD;
if (oflagsp->qtail)
oflags |= SGV4_FLAG_Q_AT_TAIL;
- if (oflagsp->hipri)
- oflags |= SGV4_FLAG_HIPRI;
+ if (oflagsp->polled)
+ oflags |= SGV4_FLAG_POLLED;
for (k = 0; seg_blks > 0; ++k, seg_blks -= num) {
kk = min<int>(seg_blks, clp->bpt);
@@ -3053,8 +3055,8 @@ do_both_sg_segment(Rq_elem * rep, scat_gath_iter & i_sg_it,
iflags |= SGV4_FLAG_Q_AT_HEAD;
if (iflagsp->qtail)
iflags |= SGV4_FLAG_Q_AT_TAIL;
- if (iflagsp->hipri)
- iflags |= SGV4_FLAG_HIPRI;
+ if (iflagsp->polled)
+ iflags |= SGV4_FLAG_POLLED;
oflags = SGV4_FLAG_SHARE | SGV4_FLAG_NO_DXFER;
if (oflagsp->dio)
@@ -3063,8 +3065,8 @@ do_both_sg_segment(Rq_elem * rep, scat_gath_iter & i_sg_it,
oflags |= SGV4_FLAG_Q_AT_HEAD;
if (oflagsp->qtail)
oflags |= SGV4_FLAG_Q_AT_TAIL;
- if (oflagsp->hipri)
- oflags |= SGV4_FLAG_HIPRI;
+ if (oflagsp->polled)
+ oflags |= SGV4_FLAG_POLLED;
oflags |= SGV4_FLAG_DO_ON_OTHER;
for (k = 0; seg_blks > 0; ++k, seg_blks -= num) {
@@ -3164,8 +3166,8 @@ do_both_sg_segment(Rq_elem * rep, scat_gath_iter & i_sg_it,
ctl_v4.flags |= SGV4_FLAG_STOP_IF;
if ((! clp->verify) && clp->out_flags.order_wr)
ctl_v4.flags |= SGV4_FLAG_ORDERED_WR;
- if (clp->mrq_hipri)
- ctl_v4.flags |= SGV4_FLAG_HIPRI;
+ if (clp->mrq_polled)
+ ctl_v4.flags |= SGV4_FLAG_POLLED;
if (clp->in_flags.mout_if || clp->out_flags.mout_if) {
ctl_v4.flags |= SGV4_FLAG_META_OUT_IF;
if (num_mrq > 0)
@@ -3417,7 +3419,7 @@ process_flags(const char * arg, struct flags_t * fp)
else if (0 == strcmp(cp, "fua"))
fp->fua = true;
else if (0 == strcmp(cp, "hipri"))
- fp->hipri = true;
+ fp->polled = true;
else if (0 == strcmp(cp, "masync"))
fp->masync = true;
else if (0 == strcmp(cp, "mmap"))
@@ -3444,6 +3446,8 @@ process_flags(const char * arg, struct flags_t * fp)
fp->order_wr = true;
else if (0 == strcmp(cp, "order"))
fp->order_wr = true;
+ else if (0 == strcmp(cp, "polled"))
+ fp->polled = true;
else if (0 == strcmp(cp, "qhead"))
fp->qhead = true;
else if (0 == strcmp(cp, "qtail"))
@@ -3673,11 +3677,12 @@ parse_cmdline_sanity(int argc, char * argv[], struct global_collection * clp,
goto syn_err;
}
} else if ((0 == strcmp(key, "hipri")) ||
- (0 == strcmp(key, "mrq"))) {
+ (0 == strcmp(key, "mrq")) ||
+ (0 == strcmp(key, "polled"))) {
if (isdigit(buf[0]))
cp = buf;
else {
- pr2serr("%sonly mrq=NRQS or hipri=NRQS which is a number "
+ pr2serr("%sonly mrq=NRQS or polled=NRQS which is a number "
"allowed here\n", my_name);
goto syn_err;
}
@@ -3691,8 +3696,8 @@ parse_cmdline_sanity(int argc, char * argv[], struct global_collection * clp,
clp->mrq_num = 1;
pr2serr("note: send single, non-mrq commands\n");
}
- if ('h' == key[0])
- clp->mrq_hipri = true;
+ if ('m' != key[0])
+ clp->mrq_polled = true;
} else if ((0 == strcmp(key, "no_waitq")) ||
(0 == strcmp(key, "no-waitq"))) {
n = sg_get_num(buf);
diff --git a/testing/sgh_dd.cpp b/testing/sgh_dd.cpp
index dd72ffa9..b0704ffa 100644
--- a/testing/sgh_dd.cpp
+++ b/testing/sgh_dd.cpp
@@ -36,7 +36,7 @@
* renamed [20181221]
*/
-static const char * version_str = "2.21 20220911";
+static const char * version_str = "2.22 20221020";
#define _XOPEN_SOURCE 600
#ifndef _GNU_SOURCE
@@ -124,8 +124,8 @@ using namespace std;
/* comment out following line to stop ioctl(SG_CTL_FLAGM_SNAP_DEV) */
#define SGH_DD_SNAP_DEV 1
-#ifndef SGV4_FLAG_HIPRI
-#define SGV4_FLAG_HIPRI 0x800
+#ifndef SGV4_FLAG_POLLED
+#define SGV4_FLAG_POLLED 0x800
#endif
#define DEF_BLOCK_SIZE 512
@@ -183,7 +183,7 @@ struct flags_t {
bool excl;
bool ff;
bool fua;
- bool hipri;
+ bool polled; /* formerly called 'hipri' */
bool masync; /* more async sg v4 driver flag */
bool mrq_immed; /* mrq submit non-blocking */
bool mrq_svb; /* mrq shared_variable_block, for sg->sg copy */
@@ -498,9 +498,9 @@ usage(int pg_num)
" if file or device to read from (def: stdin)\n"
" iflag comma separated list from: [00,coe,defres,dio,"
"direct,dpo,\n"
- " dsync,excl,ff,fua,hipri,masync,mmap,mout_if,"
- "mrq_immed,\n"
- " mrq_svb,nocreat,nodur,noxfer,null,qhead,"
+ " dsync,excl,ff,fua,masync,mmap,mout_if,"
+ "mrq_immed,mrq_svb,\n"
+ " nocreat,nodur,noxfer,null,polled,qhead,"
"qtail,\n"
" random,same_fds,v3,v4,wq_excl]\n"
" of file or device to write to (def: /dev/null "
@@ -613,8 +613,7 @@ page3:
"iflags)\n"
" fua sets the FUA (force unit access) in SCSI READs "
"and WRITEs\n"
- " hipri set HIPRI flag on command, uses blk_poll() to "
- "complete\n"
+ " hipri same as 'polled'; 'hipri' name is deprecated\n"
" masync set 'more async' flag on this sg device\n"
" mmap setup mmap IO on IFILE or OFILE; OFILE only "
"with noshare\n"
@@ -630,6 +629,8 @@ page3:
" noxfer no transfer to/from the user space\n"
" no_thresh skip checking per fd max data xfer\n"
" null does nothing, placeholder\n"
+ " polled set POLLED flag on command, uses blk_poll() to "
+ "complete\n"
" qhead queue new request at head of block queue\n"
" qtail queue new request at tail of block queue (def: "
"q at head)\n"
@@ -797,8 +798,8 @@ sg_flags_str(int flags, int b_len, char * b)
if (n >= b_len)
goto fini;
}
- if (SGV4_FLAG_HIPRI & flags) { /* 0x800 */
- n += sg_scnpr(b + n, b_len - n, "HIPRI|");
+ if (SGV4_FLAG_POLLED & flags) { /* 0x800 */
+ n += sg_scnpr(b + n, b_len - n, "POLLED|");
if (n >= b_len)
goto fini;
}
@@ -2633,9 +2634,9 @@ sgh_do_async_mrq(Rq_elem * rep, mrq_arr_t & def_arr, int fd,
b_len = sizeof(b);
a_v4p = def_arr.first.data();
ctlop->flags = SGV4_FLAG_MULTIPLE_REQS;
- if (clp->in_flags.hipri || clp->out_flags.hipri) {
- /* submit of full non-blocking with HIPRI */
- ctlop->flags |= (SGV4_FLAG_IMMED | SGV4_FLAG_HIPRI);
+ if (clp->in_flags.polled || clp->out_flags.polled) {
+ /* submit of full non-blocking with POLLED */
+ ctlop->flags |= (SGV4_FLAG_IMMED | SGV4_FLAG_POLLED);
if (!after1 && (clp->verbose > 1)) {
after1 = true;
pr2serr_lk("%s: %s\n", __func__, mrq_s_nb_s);
@@ -3143,7 +3144,7 @@ sg_start_io(Rq_elem * rep, mrq_arr_t & def_arr, int & pack_id,
bool v4 = wr ? clp->out_flags.v4 : clp->in_flags.v4;
bool qhead = wr ? clp->out_flags.qhead : clp->in_flags.qhead;
bool qtail = wr ? clp->out_flags.qtail : clp->in_flags.qtail;
- bool hipri = wr ? clp->out_flags.hipri : clp->in_flags.hipri;
+ bool polled = wr ? clp->out_flags.polled : clp->in_flags.polled;
bool mout_if = wr ? clp->out_flags.mout_if : clp->in_flags.mout_if;
bool prefetch = xtrp ? xtrp->prefetch : false;
bool is_wr2 = xtrp ? xtrp->is_wr2 : false;
@@ -3203,8 +3204,8 @@ sg_start_io(Rq_elem * rep, mrq_arr_t & def_arr, int & pack_id,
flags |= SG_FLAG_NO_DXFER;
if (dio)
flags |= SG_FLAG_DIRECT_IO;
- if (hipri)
- flags |= SGV4_FLAG_HIPRI;
+ if (polled)
+ flags |= SGV4_FLAG_POLLED;
if (qhead)
flags |= SG_FLAG_Q_AT_HEAD;
if (qtail)
@@ -3802,7 +3803,7 @@ process_flags(const char * arg, struct flags_t * fp)
else if (0 == strcmp(cp, "fua"))
fp->fua = true;
else if (0 == strcmp(cp, "hipri"))
- fp->hipri = true;
+ fp->polled = true;
else if (0 == strcmp(cp, "masync"))
fp->masync = true;
else if (0 == strcmp(cp, "mmap"))
@@ -3845,6 +3846,8 @@ process_flags(const char * arg, struct flags_t * fp)
fp->noxfer = true;
else if (0 == strcmp(cp, "null"))
;
+ else if (0 == strcmp(cp, "polled"))
+ fp->polled = true;
else if (0 == strcmp(cp, "qhead"))
fp->qhead = true;
else if (0 == strcmp(cp, "qtail"))
diff --git a/testing/sgs_dd.c b/testing/sgs_dd.c
index 0d7d2e1b..c139a178 100644
--- a/testing/sgs_dd.c
+++ b/testing/sgs_dd.c
@@ -84,11 +84,11 @@
#include "sg_unaligned.h"
-static const char * version_str = "4.23 20220815";
+static const char * version_str = "4.24 20221020";
static const char * my_name = "sgs_dd";
-#ifndef SGV4_FLAG_HIPRI
-#define SGV4_FLAG_HIPRI 0x800
+#ifndef SGV4_FLAG_POLLED
+#define SGV4_FLAG_POLLED 0x800
#endif
#define DEF_BLOCK_SIZE 512
@@ -125,11 +125,11 @@ struct flags_t {
bool dio;
bool evfd;
bool excl;
- bool hipri;
bool immed;
bool mmap;
bool noxfer;
bool pack;
+ bool polled;
bool tag;
bool v3;
bool v4;
@@ -223,12 +223,12 @@ usage(int pg_num)
" bs must be the logical block size of device (def: 512)\n"
" deb debug: 0->no debug (def); > 0 -> more debug\n"
" -v (up to -vvvvv) sets deb value to number of 'v's\n"
- " iflag comma separated list from: dio,evfd,excl,hipri,immed,"
- "mmap\n"
- " noxfer,null,pack,tag,v3,v4 bound to IFILE\n"
+ " iflag comma separated list from: dio,evfd,excl,immed,mmap,"
+ "noxfer,\n"
+ " null,pack,polled,tag,v3,v4 bound to IFILE\n"
" no_sig 0-> use signals; 1-> no signals, hard polling "
"instead;\n"
- " default 0, unless hipri flag(s) given then it's 1\n"
+ " default 0, unless polled flag(s) given then it's 1\n"
" oflag same flags as iflag but bound to OFILE\n"
" poll_ms number of milliseconds to wait on poll (def: 0)\n"
" rt_sig 0->use SIGIO (def); 1->use RT sig (SIGRTMIN + 1)\n"
@@ -244,7 +244,7 @@ second_page:
" evfd when poll() gives POLLIN, use eventfd to find "
"out how many\n"
" excl open IFILE or OFILE with O_EXCL\n"
- " hipri set HIPRI flag and use blk_poll() for completion\n"
+ " hipri same as 'polled'; name 'hipri' is deprecated\n"
" immed use SGV4_FLAG_IMMED flag on each request\n"
" mmap use mmap()-ed IO on IFILE or OFILE\n"
" noxfer no transfer between user space and kernel IO "
@@ -252,6 +252,7 @@ second_page:
" null does nothing, placeholder\n"
" pack submit with rising pack_id, complete matching "
"each pack_id\n"
+ " polled set POLLED flag and use blk_poll() for completion\n"
" tag use tag (from block layer) rather than "
"pack_id\n"
" v3 use sg v3 interface (default)\n"
@@ -350,12 +351,12 @@ sg_start_io(Rq_coll * clp, Rq_elem * rep)
hp->pack_id = rep->blk;
if (flagp->dio)
hp->flags |= SG_FLAG_DIRECT_IO;
- if (flagp->hipri)
- hp->flags |= SGV4_FLAG_HIPRI;
if (flagp->noxfer)
hp->flags |= SG_FLAG_NO_DXFER;
if (flagp->immed)
hp->flags |= SGV4_FLAG_IMMED;
+ if (flagp->polled)
+ hp->flags |= SGV4_FLAG_POLLED;
if (flagp->mmap) {
hp->flags |= SG_FLAG_MMAP_IO;
hp->dxferp = is_wr ? clp->out_mmapp : clp->in_mmapp;
@@ -407,10 +408,10 @@ do_v4:
h4p->flags |= SG_FLAG_DIRECT_IO;
if (flagp->noxfer)
h4p->flags |= SG_FLAG_NO_DXFER;
- if (flagp->hipri)
- h4p->flags |= SGV4_FLAG_HIPRI;
if (flagp->immed)
h4p->flags |= SGV4_FLAG_IMMED;
+ if (flagp->polled)
+ h4p->flags |= SGV4_FLAG_POLLED;
if (flagp->mmap) {
h4p->flags |= SG_FLAG_MMAP_IO;
hp->dxferp = is_wr ? clp->out_mmapp : clp->in_mmapp;
@@ -500,7 +501,7 @@ sg_finish_io(Rq_coll * clp, bool wr, Rq_elem ** repp)
rep = (Rq_elem *)io_hdr.usr_ptr;
if (rep) {
dio = flagsp->dio;
- if (rep->io_hdr.flags & SGV4_FLAG_HIPRI)
+ if (rep->io_hdr.flags & SGV4_FLAG_POLLED)
++clp->blk_poll_count;
}
if (res < 0) {
@@ -588,7 +589,7 @@ do_v4:
return res;
}
if (rep) {
- if (rep->io_v4.flags & SGV4_FLAG_HIPRI)
+ if (rep->io_v4.flags & SGV4_FLAG_POLLED)
++clp->blk_poll_count;
}
if (! (rep && (SGQ_IO_STARTED == rep->state))) {
@@ -1188,7 +1189,7 @@ process_flags(const char * arg, struct flags_t * fp)
else if (0 == strcmp(cp, "excl"))
fp->excl = true;
else if (0 == strcmp(cp, "hipri"))
- fp->hipri = true;
+ fp->polled = true;
else if (0 == strcmp(cp, "immed"))
fp->immed = true;
else if (0 == strcmp(cp, "mmap"))
@@ -1199,6 +1200,8 @@ process_flags(const char * arg, struct flags_t * fp)
;
else if (0 == strcmp(cp, "pack"))
fp->pack = true;
+ else if (0 == strcmp(cp, "polled"))
+ fp->polled = true;
else if (0 == strcmp(cp, "tag"))
fp->tag = true;
else if (0 == strcmp(cp, "v3")) {
@@ -1232,7 +1235,7 @@ main(int argc, char * argv[])
{
bool bs_given = false;
bool no_sig_given = false;
- bool hipri_present;
+ bool polled_present;
int skip = 0;
int seek = 0;
int ibs = 0;
@@ -1388,12 +1391,12 @@ main(int argc, char * argv[])
return 0;
}
- hipri_present = (clp->iflag.hipri || clp->oflag.hipri);
+ polled_present = (clp->iflag.polled || clp->oflag.polled);
if (no_sig_given) {
- if ((0 == clp->no_sig) && hipri_present)
- pr2serr("Warning: signalling doesn't work with hipri\n");
- } else /* no_sig default varies: 0 normally and 1 if hipri present */
- clp->no_sig = hipri_present ? 1 : 0;
+ if ((0 == clp->no_sig) && polled_present)
+ pr2serr("Warning: signalling doesn't work with polled flag\n");
+ } else /* no_sig default varies: 0 normally and 1 if polled present */
+ clp->no_sig = polled_present ? 1 : 0;
if ((ibs && (ibs != clp->bs)) || (obs && (obs != clp->bs))) {
pr2serr("If 'ibs' or 'obs' given must be same as 'bs'\n");
@@ -1652,8 +1655,8 @@ main(int argc, char * argv[])
if (! clp->no_sig)
pr2serr("SIGIO/SIGPOLL signals received: %d, RT sigs: %d\n",
clp->sigs_io_received, clp->sigs_rt_received);
- if (hipri_present)
- pr2serr("HIPRI (blk_poll) used to complete %d commands\n",
+ if (polled_present)
+ pr2serr("POLLED (blk_poll) used to complete %d commands\n",
clp->blk_poll_count);
}
if (clp->pollerr_count > 0)
diff --git a/testing/uapi_sg.h b/testing/uapi_sg.h
index 9cc51dc0..41377c6a 100644
--- a/testing/uapi_sg.h
+++ b/testing/uapi_sg.h
@@ -119,7 +119,8 @@ typedef struct sg_io_hdr {
#define SGV4_FLAG_COMPLETE_B4 0x100 /* mrq: complete this rq before next */
#define SGV4_FLAG_SIGNAL 0x200 /* v3: ignored; v4 signal on completion */
#define SGV4_FLAG_IMMED 0x400 /* issue request and return immediately ... */
-#define SGV4_FLAG_HIPRI 0x800 /* request will use blk_poll to complete */
+#define SGV4_FLAG_HIPRI 0x800 /* use blk_poll (deprecated name, use POLLED) */
+#define SGV4_FLAG_POLLED 0x800 /* request will use blk_poll to complete */
#define SGV4_FLAG_STOP_IF 0x1000 /* Stops sync mrq if error or warning */
#define SGV4_FLAG_DEV_SCOPE 0x2000 /* permit SG_IOABORT to have wider scope */
#define SGV4_FLAG_SHARE 0x4000 /* share IO buffer; needs SG_SEIM_SHARE_FD */