svn commit: r350672 - in projects/runtime-coverage-v2: . contrib/bsnmp/lib contrib/elftoolchain/readelf contrib/netbsd-tests/lib/libpthread etc/mtree lib/libmemstat libexec/rtld-elf/amd64 libexec/r...
Enji Cooper
ngie at FreeBSD.org
Wed Aug 7 04:08:55 UTC 2019
Author: ngie
Date: Wed Aug 7 04:08:50 2019
New Revision: 350672
URL: https://svnweb.freebsd.org/changeset/base/350672
Log:
MFhead at r350671
Added:
projects/runtime-coverage-v2/sbin/nvmecontrol/resv.c
- copied unchanged from r350671, head/sbin/nvmecontrol/resv.c
projects/runtime-coverage-v2/share/man/man4/ads111x.4
- copied unchanged from r350671, head/share/man/man4/ads111x.4
projects/runtime-coverage-v2/sys/dev/iicbus/ads111x.c
- copied unchanged from r350671, head/sys/dev/iicbus/ads111x.c
projects/runtime-coverage-v2/sys/modules/i2c/ads111x/
- copied from r350671, head/sys/modules/i2c/ads111x/
projects/runtime-coverage-v2/tests/sys/fs/fusefs/
- copied from r350671, head/tests/sys/fs/fusefs/
projects/runtime-coverage-v2/tests/sys/kern/kill_zombie.c
- copied unchanged from r350671, head/tests/sys/kern/kill_zombie.c
projects/runtime-coverage-v2/tests/sys/netpfil/common/
- copied from r350671, head/tests/sys/netpfil/common/
Deleted:
projects/runtime-coverage-v2/libexec/rtld-elf/amd64/elf_rtld.x
projects/runtime-coverage-v2/libexec/rtld-elf/i386/elf_rtld.x
projects/runtime-coverage-v2/sys/fs/fuse/fuse_param.h
projects/runtime-coverage-v2/sys/sys/_kstack_cache.h
Modified:
projects/runtime-coverage-v2/MAINTAINERS (contents, props changed)
projects/runtime-coverage-v2/ObsoleteFiles.inc
projects/runtime-coverage-v2/UPDATING
projects/runtime-coverage-v2/contrib/bsnmp/lib/asn1.c
projects/runtime-coverage-v2/contrib/elftoolchain/readelf/readelf.c
projects/runtime-coverage-v2/contrib/netbsd-tests/lib/libpthread/t_condwait.c
projects/runtime-coverage-v2/etc/mtree/BSD.tests.dist
projects/runtime-coverage-v2/lib/libmemstat/memstat.c
projects/runtime-coverage-v2/lib/libmemstat/memstat.h
projects/runtime-coverage-v2/lib/libmemstat/memstat_internal.h
projects/runtime-coverage-v2/lib/libmemstat/memstat_uma.c
projects/runtime-coverage-v2/libexec/rtld-elf/amd64/Makefile.inc
projects/runtime-coverage-v2/libexec/rtld-elf/i386/Makefile.inc
projects/runtime-coverage-v2/libexec/rtld-elf/powerpc64/rtld_start.S
projects/runtime-coverage-v2/sbin/ipfw/ipfw2.c
projects/runtime-coverage-v2/sbin/mount_fusefs/mount_fusefs.8
projects/runtime-coverage-v2/sbin/mount_fusefs/mount_fusefs.c
projects/runtime-coverage-v2/sbin/nvmecontrol/Makefile
projects/runtime-coverage-v2/sbin/nvmecontrol/nvmecontrol.8
projects/runtime-coverage-v2/sbin/nvmecontrol/passthru.c
projects/runtime-coverage-v2/sbin/nvmecontrol/sanitize.c
projects/runtime-coverage-v2/share/man/man4/cc_newreno.4
projects/runtime-coverage-v2/share/man/man4/mod_cc.4
projects/runtime-coverage-v2/share/man/man4/mxge.4
projects/runtime-coverage-v2/share/man/man5/fusefs.5
projects/runtime-coverage-v2/share/man/man7/security.7
projects/runtime-coverage-v2/stand/efi/boot1/boot1.c
projects/runtime-coverage-v2/stand/efi/boot1/proto.c
projects/runtime-coverage-v2/stand/efi/gptboot/proto.c
projects/runtime-coverage-v2/stand/efi/include/efilib.h
projects/runtime-coverage-v2/stand/efi/libefi/devpath.c
projects/runtime-coverage-v2/stand/efi/libefi/efinet.c
projects/runtime-coverage-v2/stand/efi/libefi/efipart.c
projects/runtime-coverage-v2/stand/efi/libefi/libefi.c
projects/runtime-coverage-v2/stand/efi/loader/efi_main.c
projects/runtime-coverage-v2/stand/efi/loader/framebuffer.c
projects/runtime-coverage-v2/stand/efi/loader/main.c
projects/runtime-coverage-v2/sys/amd64/amd64/exception.S
projects/runtime-coverage-v2/sys/amd64/include/asmacros.h
projects/runtime-coverage-v2/sys/arm64/arm64/pmap.c
projects/runtime-coverage-v2/sys/compat/linuxkpi/common/include/linux/gfp.h
projects/runtime-coverage-v2/sys/compat/linuxkpi/common/include/linux/io.h
projects/runtime-coverage-v2/sys/compat/linuxkpi/common/include/linux/pci.h
projects/runtime-coverage-v2/sys/compat/linuxkpi/common/src/linux_pci.c
projects/runtime-coverage-v2/sys/conf/NOTES
projects/runtime-coverage-v2/sys/conf/files
projects/runtime-coverage-v2/sys/conf/kern.post.mk
projects/runtime-coverage-v2/sys/conf/kern.pre.mk
projects/runtime-coverage-v2/sys/conf/kmod.mk
projects/runtime-coverage-v2/sys/conf/options
projects/runtime-coverage-v2/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
projects/runtime-coverage-v2/sys/contrib/ipfilter/netinet/mlfk_ipl.c
projects/runtime-coverage-v2/sys/contrib/zlib/deflate.c
projects/runtime-coverage-v2/sys/contrib/zlib/infback.c
projects/runtime-coverage-v2/sys/contrib/zlib/inflate.c
projects/runtime-coverage-v2/sys/contrib/zlib/zconf.h
projects/runtime-coverage-v2/sys/contrib/zlib/zlib.h
projects/runtime-coverage-v2/sys/contrib/zlib/zutil.h
projects/runtime-coverage-v2/sys/ddb/db_ps.c
projects/runtime-coverage-v2/sys/dev/acpica/acpi_pci_link.c
projects/runtime-coverage-v2/sys/dev/amdsmn/amdsmn.c
projects/runtime-coverage-v2/sys/dev/amdtemp/amdtemp.c
projects/runtime-coverage-v2/sys/dev/nvme/nvme.h
projects/runtime-coverage-v2/sys/dev/oce/oce_if.c
projects/runtime-coverage-v2/sys/dev/ofw/ofwpci.c
projects/runtime-coverage-v2/sys/dev/pci/vga_pci.c
projects/runtime-coverage-v2/sys/dev/ral/rt2860.c
projects/runtime-coverage-v2/sys/dev/ral/rt2860var.h
projects/runtime-coverage-v2/sys/dev/zlib/zcalloc.c
projects/runtime-coverage-v2/sys/dev/zlib/zcalloc.h
projects/runtime-coverage-v2/sys/fs/fuse/fuse.h
projects/runtime-coverage-v2/sys/fs/fuse/fuse_device.c
projects/runtime-coverage-v2/sys/fs/fuse/fuse_file.c
projects/runtime-coverage-v2/sys/fs/fuse/fuse_file.h
projects/runtime-coverage-v2/sys/fs/fuse/fuse_internal.c
projects/runtime-coverage-v2/sys/fs/fuse/fuse_internal.h
projects/runtime-coverage-v2/sys/fs/fuse/fuse_io.c
projects/runtime-coverage-v2/sys/fs/fuse/fuse_io.h
projects/runtime-coverage-v2/sys/fs/fuse/fuse_ipc.c
projects/runtime-coverage-v2/sys/fs/fuse/fuse_ipc.h
projects/runtime-coverage-v2/sys/fs/fuse/fuse_kernel.h
projects/runtime-coverage-v2/sys/fs/fuse/fuse_main.c
projects/runtime-coverage-v2/sys/fs/fuse/fuse_node.c
projects/runtime-coverage-v2/sys/fs/fuse/fuse_node.h
projects/runtime-coverage-v2/sys/fs/fuse/fuse_vfsops.c
projects/runtime-coverage-v2/sys/fs/fuse/fuse_vnops.c
projects/runtime-coverage-v2/sys/geom/label/g_label_ufs.c
projects/runtime-coverage-v2/sys/i386/pci/pci_pir.c
projects/runtime-coverage-v2/sys/kern/bus_if.m
projects/runtime-coverage-v2/sys/kern/imgact_elf.c
projects/runtime-coverage-v2/sys/kern/kern_exec.c
projects/runtime-coverage-v2/sys/kern/kern_exit.c
projects/runtime-coverage-v2/sys/kern/kern_sendfile.c
projects/runtime-coverage-v2/sys/kern/subr_bus.c
projects/runtime-coverage-v2/sys/kern/sys_procdesc.c
projects/runtime-coverage-v2/sys/kern/sys_process.c
projects/runtime-coverage-v2/sys/modules/crypto/Makefile
projects/runtime-coverage-v2/sys/modules/i2c/Makefile
projects/runtime-coverage-v2/sys/modules/mxge/mxge/Makefile
projects/runtime-coverage-v2/sys/modules/zfs/Makefile
projects/runtime-coverage-v2/sys/modules/zlib/Makefile
projects/runtime-coverage-v2/sys/netinet/sctp_asconf.c
projects/runtime-coverage-v2/sys/netinet/sctp_os_bsd.h
projects/runtime-coverage-v2/sys/netinet/sctp_output.c
projects/runtime-coverage-v2/sys/netinet/sctp_pcb.c
projects/runtime-coverage-v2/sys/netinet/sctp_usrreq.c
projects/runtime-coverage-v2/sys/netinet/sctputil.c
projects/runtime-coverage-v2/sys/netinet6/frag6.c
projects/runtime-coverage-v2/sys/netinet6/mld6.c
projects/runtime-coverage-v2/sys/netinet6/sctp6_usrreq.c
projects/runtime-coverage-v2/sys/powerpc/booke/pmap.c
projects/runtime-coverage-v2/sys/powerpc/ofw/ofwcall32.S
projects/runtime-coverage-v2/sys/powerpc/powerpc/busdma_machdep.c
projects/runtime-coverage-v2/sys/powerpc/powerpc/swtch32.S
projects/runtime-coverage-v2/sys/sys/bus.h
projects/runtime-coverage-v2/sys/sys/param.h
projects/runtime-coverage-v2/sys/sys/proc.h
projects/runtime-coverage-v2/sys/ufs/ffs/ffs_vfsops.c
projects/runtime-coverage-v2/sys/vm/uma.h
projects/runtime-coverage-v2/sys/vm/uma_core.c
projects/runtime-coverage-v2/sys/vm/uma_int.h
projects/runtime-coverage-v2/sys/vm/vm_glue.c
projects/runtime-coverage-v2/sys/vm/vm_param.h
projects/runtime-coverage-v2/sys/vm/vm_phys.c
projects/runtime-coverage-v2/sys/vm/vm_phys.h
projects/runtime-coverage-v2/sys/vm/vm_swapout.c
projects/runtime-coverage-v2/tests/sys/fs/Makefile
projects/runtime-coverage-v2/tests/sys/kern/Makefile
projects/runtime-coverage-v2/tests/sys/kern/ptrace_test.c
projects/runtime-coverage-v2/tests/sys/netpfil/Makefile
projects/runtime-coverage-v2/tools/build/mk/OptionalObsoleteFiles.inc
projects/runtime-coverage-v2/usr.bin/netstat/ipsec.c
projects/runtime-coverage-v2/usr.bin/vmstat/vmstat.c
projects/runtime-coverage-v2/usr.sbin/bhyve/pci_e82545.c
Directory Properties:
projects/runtime-coverage-v2/ (props changed)
projects/runtime-coverage-v2/contrib/elftoolchain/ (props changed)
projects/runtime-coverage-v2/contrib/netbsd-tests/ (props changed)
projects/runtime-coverage-v2/sys/contrib/ipfilter/ (props changed)
projects/runtime-coverage-v2/sys/contrib/zlib/ (props changed)
Modified: projects/runtime-coverage-v2/MAINTAINERS
==============================================================================
--- projects/runtime-coverage-v2/MAINTAINERS Wed Aug 7 03:14:45 2019 (r350671)
+++ projects/runtime-coverage-v2/MAINTAINERS Wed Aug 7 04:08:50 2019 (r350672)
@@ -53,6 +53,7 @@ contrib/pjdfstest asomers,ngie,pjd,#test Pre-commit re
etc/mail gshapiro Pre-commit review requested. Keep in sync with -STABLE.
etc/sendmail gshapiro Pre-commit review requested. Keep in sync with -STABLE.
fetch des Pre-commit review requested, email only.
+fusefs(5) asomers Pre-commit review requested.
geli pjd Pre-commit review requested (both sys/geom/eli/ and sbin/geom/class/eli/).
isci(4) jimharris Pre-commit review requested.
iwm(4) adrian Pre-commit review requested, send to freebsd-wireless at freebsd.org
Modified: projects/runtime-coverage-v2/ObsoleteFiles.inc
==============================================================================
--- projects/runtime-coverage-v2/ObsoleteFiles.inc Wed Aug 7 03:14:45 2019 (r350671)
+++ projects/runtime-coverage-v2/ObsoleteFiles.inc Wed Aug 7 04:08:50 2019 (r350672)
@@ -38,6 +38,8 @@
# xargs -n1 | sort | uniq -d;
# done
+# 20190729: gzip'ed a.out support removed
+OLD_FILES+=usr/include/sys/inflate.h
# 20190722: cap_random(3) removed
OLD_FILES+=lib/casper/libcap_random.so.1
OLD_FILES+=usr/include/casper/cap_random.h
Modified: projects/runtime-coverage-v2/UPDATING
==============================================================================
--- projects/runtime-coverage-v2/UPDATING Wed Aug 7 03:14:45 2019 (r350671)
+++ projects/runtime-coverage-v2/UPDATING Wed Aug 7 04:08:50 2019 (r350672)
@@ -26,6 +26,18 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW:
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
+20190727:
+ The vfs.fusefs.sync_unmount and vfs.fusefs.init_backgrounded sysctls
+ and the "-o sync_unmount" and "-o init_backgrounded" mount options have
+ been removed from mount_fusefs(8). You can safely remove them from
+ your scripts, because they had no effect.
+
+ The vfs.fusefs.fix_broken_io, vfs.fusefs.sync_resize,
+ vfs.fusefs.refresh_size, vfs.fusefs.mmap_enable,
+ vfs.fusefs.reclaim_revoked, and vfs.fusefs.data_cache_invalidate
+ sysctls have been removed. If you felt the need to set any of them to
+ a non-default value, please tell asomers at FreeBSD.org why.
+
20190713:
Default permissions on the /var/account/acct file (and copies of it
rotated by periodic daily scripts) are changed from 0644 to 0640
Modified: projects/runtime-coverage-v2/contrib/bsnmp/lib/asn1.c
==============================================================================
--- projects/runtime-coverage-v2/contrib/bsnmp/lib/asn1.c Wed Aug 7 03:14:45 2019 (r350671)
+++ projects/runtime-coverage-v2/contrib/bsnmp/lib/asn1.c Wed Aug 7 04:08:50 2019 (r350672)
@@ -100,6 +100,11 @@ asn_get_header(struct asn_buf *b, u_char *type, asn_le
*len = *b->asn_cptr++;
b->asn_len--;
}
+ if (*len > b->asn_len) {
+ asn_error(b, "len %u exceeding asn_len %u", *len, b->asn_len);
+ return (ASN_ERR_EOBUF);
+ }
+
return (ASN_ERR_OK);
}
Modified: projects/runtime-coverage-v2/contrib/elftoolchain/readelf/readelf.c
==============================================================================
--- projects/runtime-coverage-v2/contrib/elftoolchain/readelf/readelf.c Wed Aug 7 03:14:45 2019 (r350671)
+++ projects/runtime-coverage-v2/contrib/elftoolchain/readelf/readelf.c Wed Aug 7 04:08:50 2019 (r350672)
@@ -7732,10 +7732,12 @@ main(int argc, char **argv)
for (i = 0; i < argc; i++) {
re->filename = argv[i];
fd = fileargs_open(fa, re->filename);
- if (fd < 0)
+ if (fd < 0) {
warn("open %s failed", re->filename);
- else
+ } else {
dump_object(re, fd);
+ close(fd);
+ }
}
exit(EXIT_SUCCESS);
Modified: projects/runtime-coverage-v2/contrib/netbsd-tests/lib/libpthread/t_condwait.c
==============================================================================
--- projects/runtime-coverage-v2/contrib/netbsd-tests/lib/libpthread/t_condwait.c Wed Aug 7 03:14:45 2019 (r350671)
+++ projects/runtime-coverage-v2/contrib/netbsd-tests/lib/libpthread/t_condwait.c Wed Aug 7 04:08:50 2019 (r350672)
@@ -51,6 +51,9 @@ static void *
run(void *param)
{
struct timespec ts, to, te;
+#ifdef __FreeBSD__
+ struct timespec tw;
+#endif
clockid_t clck;
pthread_condattr_t attr;
pthread_cond_t cond;
@@ -91,7 +94,15 @@ run(void *param)
/* Loose upper limit because of qemu timing bugs */
ATF_REQUIRE(to_seconds < WAITTIME * 2.5);
} else {
+#ifdef __FreeBSD__
+ tw.tv_sec = WAITTIME;
+ tw.tv_nsec = 0;
+ ATF_REQUIRE(timespeccmp(&to, &tw, >=));
+ tw.tv_sec++;
+ ATF_REQUIRE(timespeccmp(&to, &tw, <=));
+#else
ATF_REQUIRE_EQ(to.tv_sec, WAITTIME);
+#endif
}
break;
default:
Modified: projects/runtime-coverage-v2/etc/mtree/BSD.tests.dist
==============================================================================
--- projects/runtime-coverage-v2/etc/mtree/BSD.tests.dist Wed Aug 7 03:14:45 2019 (r350671)
+++ projects/runtime-coverage-v2/etc/mtree/BSD.tests.dist Wed Aug 7 04:08:50 2019 (r350672)
@@ -731,6 +731,8 @@
file
..
fs
+ fusefs
+ ..
tmpfs
..
..
@@ -793,6 +795,8 @@
netmap
..
netpfil
+ common
+ ..
pf
ioctl
..
Modified: projects/runtime-coverage-v2/lib/libmemstat/memstat.c
==============================================================================
--- projects/runtime-coverage-v2/lib/libmemstat/memstat.c Wed Aug 7 03:14:45 2019 (r350671)
+++ projects/runtime-coverage-v2/lib/libmemstat/memstat.c Wed Aug 7 04:08:50 2019 (r350672)
@@ -326,6 +326,13 @@ memstat_get_sleeps(const struct memory_type *mtp)
return (mtp->mt_sleeps);
}
+uint64_t
+memstat_get_xdomain(const struct memory_type *mtp)
+{
+
+ return (mtp->mt_xdomain);
+}
+
void *
memstat_get_caller_pointer(const struct memory_type *mtp, int index)
{
Modified: projects/runtime-coverage-v2/lib/libmemstat/memstat.h
==============================================================================
--- projects/runtime-coverage-v2/lib/libmemstat/memstat.h Wed Aug 7 03:14:45 2019 (r350671)
+++ projects/runtime-coverage-v2/lib/libmemstat/memstat.h Wed Aug 7 04:08:50 2019 (r350672)
@@ -136,6 +136,7 @@ uint64_t memstat_get_count(const struct memory_type *
uint64_t memstat_get_free(const struct memory_type *mtp);
uint64_t memstat_get_failures(const struct memory_type *mtp);
uint64_t memstat_get_sleeps(const struct memory_type *mtp);
+uint64_t memstat_get_xdomain(const struct memory_type *mtp);
void *memstat_get_caller_pointer(const struct memory_type *mtp,
int index);
void memstat_set_caller_pointer(struct memory_type *mtp,
Modified: projects/runtime-coverage-v2/lib/libmemstat/memstat_internal.h
==============================================================================
--- projects/runtime-coverage-v2/lib/libmemstat/memstat_internal.h Wed Aug 7 03:14:45 2019 (r350671)
+++ projects/runtime-coverage-v2/lib/libmemstat/memstat_internal.h Wed Aug 7 04:08:50 2019 (r350672)
@@ -69,6 +69,7 @@ struct memory_type {
uint64_t mt_free; /* Number of cached free items. */
uint64_t mt_failures; /* Number of allocation failures. */
uint64_t mt_sleeps; /* Number of allocation sleeps. */
+ uint64_t mt_xdomain; /* Number of cross domain sleeps. */
/*
* Caller-owned memory.
Modified: projects/runtime-coverage-v2/lib/libmemstat/memstat_uma.c
==============================================================================
--- projects/runtime-coverage-v2/lib/libmemstat/memstat_uma.c Wed Aug 7 03:14:45 2019 (r350671)
+++ projects/runtime-coverage-v2/lib/libmemstat/memstat_uma.c Wed Aug 7 04:08:50 2019 (r350672)
@@ -201,6 +201,7 @@ retry:
mtp->mt_numfrees = uthp->uth_frees;
mtp->mt_failures = uthp->uth_fails;
mtp->mt_sleeps = uthp->uth_sleeps;
+ mtp->mt_xdomain = uthp->uth_xdomain;
for (j = 0; j < maxcpus; j++) {
upsp = (struct uma_percpu_stat *)p;
@@ -423,11 +424,11 @@ memstat_kvm_uma(struct memory_type_list *list, void *k
mtp->mt_failures = kvm_counter_u64_fetch(kvm,
(unsigned long )uz.uz_fails);
mtp->mt_sleeps = uz.uz_sleeps;
-
/* See comment above in memstat_sysctl_uma(). */
if (mtp->mt_numallocs < mtp->mt_numfrees)
mtp->mt_numallocs = mtp->mt_numfrees;
+ mtp->mt_xdomain = uz.uz_xdomain;
if (kz.uk_flags & UMA_ZFLAG_INTERNAL)
goto skip_percpu;
for (i = 0; i < mp_maxid + 1; i++) {
Modified: projects/runtime-coverage-v2/libexec/rtld-elf/amd64/Makefile.inc
==============================================================================
--- projects/runtime-coverage-v2/libexec/rtld-elf/amd64/Makefile.inc Wed Aug 7 03:14:45 2019 (r350671)
+++ projects/runtime-coverage-v2/libexec/rtld-elf/amd64/Makefile.inc Wed Aug 7 04:08:50 2019 (r350672)
@@ -1,6 +1,3 @@
# $FreeBSD$
CFLAGS+= ${CFLAGS_NO_SIMD} -msoft-float
-# Uncomment this to build the dynamic linker as an executable instead
-# of a shared library:
-#LDSCRIPT= ${.CURDIR}/${MACHINE_CPUARCH}/elf_rtld.x
Modified: projects/runtime-coverage-v2/libexec/rtld-elf/i386/Makefile.inc
==============================================================================
--- projects/runtime-coverage-v2/libexec/rtld-elf/i386/Makefile.inc Wed Aug 7 03:14:45 2019 (r350671)
+++ projects/runtime-coverage-v2/libexec/rtld-elf/i386/Makefile.inc Wed Aug 7 04:08:50 2019 (r350672)
@@ -1,6 +1,3 @@
# $FreeBSD$
CFLAGS+= ${CFLAGS_NO_SIMD} -msoft-float
-# Uncomment this to build the dynamic linker as an executable instead
-# of a shared library:
-#LDSCRIPT= ${.CURDIR}/${MACHINE_CPUARCH}/elf_rtld.x
Modified: projects/runtime-coverage-v2/libexec/rtld-elf/powerpc64/rtld_start.S
==============================================================================
--- projects/runtime-coverage-v2/libexec/rtld-elf/powerpc64/rtld_start.S Wed Aug 7 03:14:45 2019 (r350671)
+++ projects/runtime-coverage-v2/libexec/rtld-elf/powerpc64/rtld_start.S Wed Aug 7 04:08:50 2019 (r350672)
@@ -38,9 +38,12 @@ _ENTRY(_rtld_start)
stdu %r1,-144(%r1) /* 16-byte aligned stack for reg saves +
exit_proc & obj _rtld args +
backchain & lrsave stack frame */
- std %r3,96(%r1) /* argc */
+
+ /* Save and restore only initial argv, because _rtld will modify
+ * argv and envp if invoked explicitly, making it necessary to
+ * load the (possibly) adjusted values from the stack.
+ */
std %r4,104(%r1) /* argv */
- std %r5,112(%r1) /* envp */
/* std %r6,120(%r1) *//* obj (always 0) */
/* std %r7,128(%r1) *//* cleanup (always 0) */
std %r8,136(%r1) /* ps_strings */
@@ -94,9 +97,14 @@ _ENTRY(_rtld_start)
/*
* Restore args, with new obj/exit proc
*/
- ld %r3,96(%r1) /* argc */
- ld %r4,104(%r1) /* argv */
- ld %r5,112(%r1) /* envp */
+ ld %r4,104(%r1) /* argv */
+ ld %r3,-8(%r4) /* argc */
+
+ /* envp = argv + argc + 1 */
+ addi %r5,%r3,1
+ sldi %r5,%r5,3 /* x8 */
+ add %r5,%r4,%r5
+
ld %r6,120(%r1) /* obj */
ld %r7,128(%r1) /* exit proc */
ld %r8,136(%r1) /* ps_strings */
Modified: projects/runtime-coverage-v2/sbin/ipfw/ipfw2.c
==============================================================================
--- projects/runtime-coverage-v2/sbin/ipfw/ipfw2.c Wed Aug 7 03:14:45 2019 (r350671)
+++ projects/runtime-coverage-v2/sbin/ipfw/ipfw2.c Wed Aug 7 04:08:50 2019 (r350672)
@@ -4674,12 +4674,27 @@ read_options:
case TOK_JAIL:
NEED1("jail requires argument");
{
+ char *end;
int jid;
cmd->opcode = O_JAIL;
- jid = jail_getid(*av);
- if (jid < 0)
- errx(EX_DATAERR, "%s", jail_errmsg);
+ /*
+ * If av is a number, then we'll just pass it as-is. If
+ * it's a name, try to resolve that to a jid.
+ *
+ * We save the jail_getid(3) call for a fallback because
+ * it entails an unconditional trip to the kernel to
+ * either validate a jid or resolve a name to a jid.
+ * This specific token doesn't currently require a
+ * jid to be an active jail, so we save a transition
+ * by simply using a number that we're given.
+ */
+ jid = strtoul(*av, &end, 10);
+ if (*end != '\0') {
+ jid = jail_getid(*av);
+ if (jid < 0)
+ errx(EX_DATAERR, "%s", jail_errmsg);
+ }
cmd32->d[0] = (uint32_t)jid;
cmd->len |= F_INSN_SIZE(ipfw_insn_u32);
av++;
Modified: projects/runtime-coverage-v2/sbin/mount_fusefs/mount_fusefs.8
==============================================================================
--- projects/runtime-coverage-v2/sbin/mount_fusefs/mount_fusefs.8 Wed Aug 7 03:14:45 2019 (r350671)
+++ projects/runtime-coverage-v2/sbin/mount_fusefs/mount_fusefs.8 Wed Aug 7 04:08:50 2019 (r350672)
@@ -3,6 +3,11 @@
.\" Copyright (c) 2005, 2006 Csaba Henk
.\" All rights reserved.
.\"
+.\" Copyright (c) 2019 The FreeBSD Foundation
+.\"
+.\" Portions of this documentation were written by BFF Storage Systems under
+.\" sponsorship from the FreeBSD Foundation.
+.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
@@ -29,7 +34,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd November 17, 2018
+.Dd July 31, 2019
.Dt MOUNT_FUSEFS 8
.Os
.Sh NAME
@@ -108,27 +113,27 @@ Intended for use in scripts and the
.Xr sudoers 5
file.
.It Fl S , Ic --safe
-Run in safe mode (i.e. reject invoking a filesystem daemon)
+Run in safe mode (i.e., reject invoking a filesystem daemon).
.It Fl v
-Be verbose
-.It Fl D, Ic --daemon Ar daemon
+Be verbose.
+.It Fl D , Ic --daemon Ar daemon
Call the specified
-.Ar daemon
-.It Fl O, Ic --daemon_opts Ar opts
+.Ar daemon .
+.It Fl O , Ic --daemon_opts Ar opts
Add
.Ar opts
-to the daemon's command line
-.It Fl s, Ic --special Ar special
+to the daemon's command line.
+.It Fl s , Ic --special Ar special
Use
.Ar special
-as special
-.It Fl m, Ic --mountpath Ar node
+as special.
+.It Fl m , Ic --mountpath Ar node
Mount on
-.Ar node
-.It Fl h, Ic --help
-Show help
-.It Fl V, Ic --version
-Show version information
+.Ar node .
+.It Fl h , Ic --help
+Show help.
+.It Fl V , Ic --version
+Show version information.
.It Fl o
Mount options are specified via
.Fl o .
@@ -136,23 +141,38 @@ The following options are available (and also their ne
by prefixing them with
.Dq no ) :
.Bl -tag -width indent
-.It Cm default_permissions
-Enable traditional (file mode based) permission checking in kernel
.It Cm allow_other
Do not apply
.Sx STRICT ACCESS POLICY .
-Only root can use this option
+Only root can use this option.
+.It Cm async
+I/O to the file system may be done asynchronously.
+Writes may be delayed and/or reordered.
+.It Cm default_permissions
+Enable traditional (file mode based) permission checking in kernel.
+.It Cm intr
+Allow signals to interrupt operations that are blocked waiting for a reply from the server.
+When this option is in use, system calls may fail with
+.Er EINTR
+whenever a signal is received.
.It Cm max_read Ns = Ns Ar n
Limit size of read requests to
-.Ar n
+.Ar n .
+.It Cm neglect_shares
+Do not refuse unmounting if there are secondary mounts.
.It Cm private
Refuse shared mounting of the daemon.
This is the default behaviour, to allow sharing, expicitly use
-.Fl o Cm noprivate
-.It Cm neglect_shares
-Do not refuse unmounting if there are secondary mounts
+.Fl o Cm noprivate .
.It Cm push_symlinks_in
-Prefix absolute symlinks with the mountpoint
+Prefix absolute symlinks with the mountpoint.
+.It Cm subtype Ns = Ns Ar fsname
+Suffix
+.Ar fsname
+to the file system name as reported by
+.Xr statfs 2 .
+This option can be used to identify the file system implemented by
+.Ar fuse_daemon .
.El
.El
.Pp
@@ -167,11 +187,11 @@ However, there are some which do require in-kernel sup
Currently the options supported by the kernel are:
.Bl -tag -width indent
.It Cm direct_io
-Bypass the buffer cache system
+Bypass the buffer cache system.
.It Cm kernel_cache
By default cached buffers of a given file are flushed at each
.Xr open 2 .
-This option disables this behaviour
+This option disables this behaviour.
.El
.Sh DAEMON MOUNTS
Usually users do not need to use
@@ -194,7 +214,7 @@ only if the filesystem daemon has the same credentials
real gid) as the user.
.Pp
This is applied for Fuse mounts by default and only root can mount without
-the strict access policy (i.e. the
+the strict access policy (i.e., the
.Cm allow_other
mount option).
.Pp
@@ -206,7 +226,7 @@ Users might opt to willingly relax strict access polic
are concerned) by doing their own secondary mount (See
.Sx SHARED MOUNTS ) .
.Sh SHARED MOUNTS
-A Fuse daemon can be shared (i.e. mounted multiple times).
+A Fuse daemon can be shared (i.e., mounted multiple times).
When doing the first (primary) mount, the spawner and the mounter of the daemon
must have the same uid, or the mounter should be the superuser.
.Pp
@@ -225,7 +245,7 @@ is used or not.
.Pp
The device name of a secondary mount is the device name of the corresponding
primary mount, followed by a '#' character and the index of the secondary
-mount; e.g.
+mount; e.g.,
.Pa /dev/fuse0#3 .
.Sh SECURITY
System administrators might want to use a custom mount policy (ie., one going
@@ -239,7 +259,7 @@ However, given that
is capable of invoking an arbitrary program, one must be careful when doing this.
.Nm
is designed in a way such that it makes that easy.
-For this purpose, there are options which disable certain risky features (i.e.
+For this purpose, there are options which disable certain risky features (
.Fl S
and
.Fl A ) ,
@@ -342,7 +362,7 @@ does not call any external utility and also provides a
was written as the part of the
.Fx
implementation of the Fuse userspace filesystem framework (see
-.Xr https://github.com/libfuse/libfuse )
+.Lk https://github.com/libfuse/libfuse )
and first appeared in the
.Pa sysutils/fusefs-kmod
port, supporting
Modified: projects/runtime-coverage-v2/sbin/mount_fusefs/mount_fusefs.c
==============================================================================
--- projects/runtime-coverage-v2/sbin/mount_fusefs/mount_fusefs.c Wed Aug 7 03:14:45 2019 (r350671)
+++ projects/runtime-coverage-v2/sbin/mount_fusefs/mount_fusefs.c Wed Aug 7 04:08:50 2019 (r350672)
@@ -5,6 +5,11 @@
* Copyright (c) 2005 Csaba Henk
* All rights reserved.
*
+ * Copyright (c) 2019 The FreeBSD Foundation
+ *
+ * Portions of this software were developed by BFF Storage Systems under
+ * sponsorship from the FreeBSD Foundation.
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -60,7 +65,6 @@ void __usage_short(void);
void usage(void);
void helpmsg(void);
void showversion(void);
-int init_backgrounded(void);
static struct mntopt mopts[] = {
#define ALTF_PRIVATE 0x01
@@ -73,8 +77,6 @@ static struct mntopt mopts[] = {
{ "max_read=", 0, ALTF_MAXREAD, 1 },
#define ALTF_SUBTYPE 0x40
{ "subtype=", 0, ALTF_SUBTYPE, 1 },
- #define ALTF_SYNC_UNMOUNT 0x80
- { "sync_unmount", 0, ALTF_SYNC_UNMOUNT, 1 },
/*
* MOPT_AUTOMOUNTED, included by MOPT_STDOPTS, does not fit into
* the 'flags' argument to nmount(2). We have to abuse altflags
@@ -82,6 +84,8 @@ static struct mntopt mopts[] = {
*/
#define ALTF_AUTOMOUNTED 0x100
{ "automounted", 0, ALTF_AUTOMOUNTED, 1 },
+ #define ALTF_INTR 0x200
+ { "intr", 0, ALTF_INTR, 1 },
/* Linux specific options, we silently ignore them */
{ "fsname=", 0, 0x00, 1 },
{ "fd=", 0, 0x00, 1 },
@@ -91,6 +95,8 @@ static struct mntopt mopts[] = {
{ "large_read", 0, 0x00, 1 },
/* "nonempty", just the first two chars are stripped off during parsing */
{ "nempty", 0, 0x00, 1 },
+ { "async", 0, MNT_ASYNC, 0},
+ { "noasync", 1, MNT_ASYNC, 0},
MOPT_STDOPTS,
MOPT_END
};
@@ -107,7 +113,7 @@ static struct mntval mvals[] = {
{ 0, NULL, 0 }
};
-#define DEFAULT_MOUNT_FLAGS ALTF_PRIVATE | ALTF_SYNC_UNMOUNT
+#define DEFAULT_MOUNT_FLAGS ALTF_PRIVATE
int
main(int argc, char *argv[])
@@ -409,12 +415,6 @@ main(int argc, char *argv[])
}
}
- if (fd >= 0 && ! init_backgrounded() && close(fd) < 0) {
- if (pid)
- kill(pid, SIGKILL);
- err(1, "failed to close fuse device");
- }
-
/* Prepare the options vector for nmount(). build_iovec() is declared
* in mntopts.h. */
sprintf(fdstr, "%d", fd);
@@ -471,6 +471,7 @@ helpmsg(void)
" -o allow_other allow access to other users\n"
/* " -o nonempty allow mounts over non-empty file/dir\n" */
" -o default_permissions enable permission checking by kernel\n"
+ " -o intr interruptible mount\n"
/*
" -o fsname=NAME set filesystem name\n"
" -o large_read issue large read requests (2.4 only)\n"
@@ -481,7 +482,6 @@ helpmsg(void)
" -o neglect_shares don't report EBUSY when unmount attempted\n"
" in presence of secondary mounts\n"
" -o push_symlinks_in prefix absolute symlinks with mountpoint\n"
- " -o sync_unmount do unmount synchronously\n"
);
exit(EX_USAGE);
}
@@ -491,18 +491,4 @@ showversion(void)
{
puts("mount_fusefs [fuse4bsd] version: " FUSE4BSD_VERSION);
exit(EX_USAGE);
-}
-
-int
-init_backgrounded(void)
-{
- int ibg;
- size_t len;
-
- len = sizeof(ibg);
-
- if (sysctlbyname("vfs.fusefs.init_backgrounded", &ibg, &len, NULL, 0))
- return (0);
-
- return (ibg);
}
Modified: projects/runtime-coverage-v2/sbin/nvmecontrol/Makefile
==============================================================================
--- projects/runtime-coverage-v2/sbin/nvmecontrol/Makefile Wed Aug 7 03:14:45 2019 (r350671)
+++ projects/runtime-coverage-v2/sbin/nvmecontrol/Makefile Wed Aug 7 04:08:50 2019 (r350672)
@@ -4,8 +4,8 @@ PACKAGE=runtime
PROG= nvmecontrol
SRCS= comnd.c nvmecontrol.c
SRCS+= devlist.c firmware.c format.c identify.c logpage.c ns.c nsid.c
-SRCS+= perftest.c power.c reset.c sanitize.c
-#SRCS+= passthru.c
+SRCS+= perftest.c power.c reset.c resv.c sanitize.c
+SRCS+= passthru.c
SRCS+= identify_ext.c nvme_util.c nc_util.c
MAN= nvmecontrol.8
LDFLAGS+= -rdynamic
Modified: projects/runtime-coverage-v2/sbin/nvmecontrol/nvmecontrol.8
==============================================================================
--- projects/runtime-coverage-v2/sbin/nvmecontrol/nvmecontrol.8 Wed Aug 7 03:14:45 2019 (r350671)
+++ projects/runtime-coverage-v2/sbin/nvmecontrol/nvmecontrol.8 Wed Aug 7 04:08:50 2019 (r350672)
@@ -34,7 +34,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd August 3, 2019
+.Dd August 5, 2019
.Dt NVMECONTROL 8
.Os
.Sh NAME
@@ -121,6 +121,33 @@
.Aq device id
.Aq namespace id
.Nm
+.Ic resv acquire
+.Aq Fl c Ar crkey
+.Op Fl p Ar prkey
+.Aq Fl t Ar rtype
+.Aq Fl a Ar racqa
+.Aq namespace id
+.Nm
+.Ic resv register
+.Op Fl c Ar crkey
+.Aq Fl k Ar nrkey
+.Aq Fl r Ar rrega
+.Op Fl i Ar iekey
+.Op Fl p Ar cptpl
+.Aq namespace id
+.Nm
+.Ic resv release
+.Aq Fl c Ar crkey
+.Aq Fl t Ar rtype
+.Aq Fl a Ar rrela
+.Aq namespace id
+.Nm
+.Ic resv report
+.Op Fl e
+.Op Fl v
+.Op Fl x
+.Aq namespace id
+.Nm
.Ic firmware
.Op Fl s Ar slot
.Op Fl f Ar path_to_firmware
@@ -140,9 +167,9 @@
.Ic sanitize
.Aq Fl a Ar sanact
.Op Fl c Ar owpass
+.Op Fl d
.Op Fl p Ar ovrpat
.Op Fl r
-.Op Fl D
.Op Fl I
.Op Fl U
.Aq device id
@@ -223,6 +250,96 @@ will set Retain Asynchronous Event.
Various namespace management commands.
If namespace management is supported by device, allow list, create and delete
namespaces, list, attach and detach controllers to namespaces.
+.Ss resv acquire
+Acquire or preempt namespace reservation, using specified parameters:
+.Bl -tag -width 6n
+.It Fl a
+Acquire action:
+.Bl -tag -compact -width 6n
+.It Dv 0
+Acquire
+.It Dv 1
+Preempt
+.It Dv 2
+Preempt and abort
+.El
+.It Fl c
+Current reservation key.
+.It Fl p
+Preempt reservation key.
+.It Fl t
+Reservation type:
+.Bl -tag -compact -width 6n
+.It Dv 1
+Write Exclusive
+.It Dv 2
+Exclusive Access
+.It Dv 3
+Write Exclusive - Registrants Only
+.It Dv 4
+Exclusive Access - Registrants Only
+.It Dv 5
+Write Exclusive - All Registrants
+.It Dv 6
+Exclusive Access - All Registrants
+.El
+.El
+.Ss resv register
+Register, unregister or replace reservation key, using specified parameters:
+.Bl -tag -width 6n
+.It Fl c
+Current reservation key.
+.It Fl k
+New reservation key.
+.It Fl r
+Register action:
+.Bl -tag -compact -width 6n
+.It Dv 0
+Register
+.It Dv 1
+Unregister
+.It Dv 2
+Replace
+.El
+.It Fl i
+Ignore Existing Key
+.It Fl p
+Change Persist Through Power Loss State:
+.Bl -tag -compact -width 6n
+.It Dv 0
+No change to PTPL state
+.It Dv 2
+Set PTPL state to ‘0’.
+Reservations are released and registrants are cleared on a power on.
+.It Dv 3
+Set PTPL state to ‘1’.
+Reservations and registrants persist across a power loss.
+.El
+.El
+.Ss resv release
+Release or clear reservation, using specified parameters:
+.Bl -tag -width 6n
+.It Fl c
+Current reservation key.
+.It Fl t
+Reservation type.
+.It Fl a
+Release action:
+.Bl -tag -compact -width 6n
+.It Dv 0
+Release
+.It Dv 1
+Clean
+.El
+.El
+.Ss resv report
+Print reservation status, using specified parameters:
+.Bl -tag -width 6n
+.It Fl x
+Print reservation status in hex.
+.It Fl e
+Use Extended Data Structure.
+.El
.Ss format
Format either specified namespace, or all namespaces of specified controller,
using specified parameters:
@@ -281,7 +398,7 @@ The number of passes when performing an
operation.
Valid values are between 1 and 16.
The default is 1.
-.It Fl D
+.It Fl d
No Deallocate After Sanitize.
.It Fl I
When performing an
Modified: projects/runtime-coverage-v2/sbin/nvmecontrol/passthru.c
==============================================================================
--- projects/runtime-coverage-v2/sbin/nvmecontrol/passthru.c Wed Aug 7 03:14:45 2019 (r350671)
+++ projects/runtime-coverage-v2/sbin/nvmecontrol/passthru.c Wed Aug 7 04:08:50 2019 (r350672)
@@ -101,7 +101,7 @@ static struct options {
*/
#define ARG(l, s, t, opt, addr, desc) { l, s, t, &opt.addr, desc }
-static const struct opts opts[] = {
+static struct opts opts[] = {
ARG("opcode", 'o', arg_uint8, opt, opcode,
"NVMe command opcode (required)"),
ARG("cdw2", '2', arg_uint32, opt, cdw2,
@@ -267,7 +267,23 @@ io_passthru(const struct cmd *nf, int argc, char *argv
passthru(nf, argc, argv);
}
-CMD_COMMAND(top, admin-passthru, admin_passthru, sizeof(struct options), opts, args,
- "Send a pass through Admin command to the specified device");
-CMD_COMMAND(top, io-passthru, io_passthru, sizeof(struct options), opts, args,
- "Send a pass through I/O command to the specified device");
+static struct cmd admin_pass_cmd = {
+ .name = "admin-passthru",
+ .fn = admin_passthru,
+ .ctx_size = sizeof(struct options),
+ .opts = opts,
+ .args = args,
+ .descr = "Send a pass through Admin command to the specified device",
+};
+
+static struct cmd io_pass_cmd = {
+ .name = "io-passthru",
+ .fn = io_passthru,
+ .ctx_size = sizeof(struct options),
+ .opts = opts,
+ .args = args,
+ .descr = "Send a pass through Admin command to the specified device",
+};
+
+CMD_COMMAND(admin_pass_cmd);
+CMD_COMMAND(io_pass_cmd);
Copied: projects/runtime-coverage-v2/sbin/nvmecontrol/resv.c (from r350671, head/sbin/nvmecontrol/resv.c)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ projects/runtime-coverage-v2/sbin/nvmecontrol/resv.c Wed Aug 7 04:08:50 2019 (r350672, copy of r350671, head/sbin/nvmecontrol/resv.c)
@@ -0,0 +1,442 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (C) 2019 Alexander Motin <mav at FreeBSD.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer,
+ * without modification, immediately at the beginning of the file.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+#include <sys/ioccom.h>
+
+#include <err.h>
+#include <fcntl.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "nvmecontrol.h"
+
+/* Tables for command line parsing */
+
+static cmd_fn_t resv;
+static cmd_fn_t resvacquire;
+static cmd_fn_t resvregister;
+static cmd_fn_t resvrelease;
+static cmd_fn_t resvreport;
+
+#define NONE 0xffffffffu
+#define NONE64 0xffffffffffffffffull
+#define OPT(l, s, t, opt, addr, desc) { l, s, t, &opt.addr, desc }
+#define OPT_END { NULL, 0, arg_none, NULL, NULL }
+
+static struct cmd resv_cmd = {
+ .name = "resv",
+ .fn = resv,
+ .descr = "Reservation commands",
+ .ctx_size = 0,
+ .opts = NULL,
+ .args = NULL,
+};
+
+CMD_COMMAND(resv_cmd);
+
+static struct acquire_options {
+ uint64_t crkey;
+ uint64_t prkey;
+ uint8_t rtype;
+ uint8_t racqa;
+ const char *dev;
+} acquire_opt = {
+ .crkey = 0,
+ .prkey = 0,
+ .rtype = 0,
+ .racqa = 0,
+ .dev = NULL,
+};
+
+static const struct opts acquire_opts[] = {
+ OPT("crkey", 'c', arg_uint64, acquire_opt, crkey,
+ "Current Reservation Key"),
+ OPT("prkey", 'p', arg_uint64, acquire_opt, prkey,
+ "Preempt Reservation Key"),
+ OPT("rtype", 't', arg_uint8, acquire_opt, rtype,
+ "Reservation Type"),
+ OPT("racqa", 'a', arg_uint8, acquire_opt, racqa,
+ "Acquire Action (0=acq, 1=pre, 2=pre+ab)"),
+ { NULL, 0, arg_none, NULL, NULL }
+};
+
+static const struct args acquire_args[] = {
+ { arg_string, &acquire_opt.dev, "namespace-id" },
+ { arg_none, NULL, NULL },
+};
+
+static struct cmd acquire_cmd = {
+ .name = "acquire",
+ .fn = resvacquire,
+ .descr = "Acquire/preempt reservation",
+ .ctx_size = sizeof(acquire_opt),
+ .opts = acquire_opts,
+ .args = acquire_args,
+};
+
+CMD_SUBCOMMAND(resv_cmd, acquire_cmd);
+
+static struct register_options {
+ uint64_t crkey;
+ uint64_t nrkey;
+ uint8_t rrega;
+ bool iekey;
+ uint8_t cptpl;
+ const char *dev;
+} register_opt = {
+ .crkey = 0,
+ .nrkey = 0,
+ .rrega = 0,
+ .iekey = false,
+ .cptpl = 0,
+ .dev = NULL,
+};
+
+static const struct opts register_opts[] = {
+ OPT("crkey", 'c', arg_uint64, register_opt, crkey,
+ "Current Reservation Key"),
+ OPT("nrkey", 'k', arg_uint64, register_opt, nrkey,
+ "New Reservation Key"),
+ OPT("rrega", 'r', arg_uint8, register_opt, rrega,
+ "Register Action (0=reg, 1=unreg, 2=replace)"),
+ OPT("iekey", 'i', arg_none, register_opt, iekey,
+ "Ignore Existing Key"),
+ OPT("cptpl", 'p', arg_uint8, register_opt, cptpl,
+ "Change Persist Through Power Loss State"),
+ { NULL, 0, arg_none, NULL, NULL }
+};
+
+static const struct args register_args[] = {
+ { arg_string, ®ister_opt.dev, "namespace-id" },
+ { arg_none, NULL, NULL },
+};
+
+static struct cmd register_cmd = {
+ .name = "register",
+ .fn = resvregister,
+ .descr = "Register/unregister reservation",
+ .ctx_size = sizeof(register_opt),
+ .opts = register_opts,
+ .args = register_args,
+};
+
+CMD_SUBCOMMAND(resv_cmd, register_cmd);
+
+static struct release_options {
+ uint64_t crkey;
+ uint8_t rtype;
+ uint8_t rrela;
+ const char *dev;
+} release_opt = {
+ .crkey = 0,
+ .rtype = 0,
+ .rrela = 0,
+ .dev = NULL,
+};
+
+static const struct opts release_opts[] = {
+ OPT("crkey", 'c', arg_uint64, release_opt, crkey,
+ "Current Reservation Key"),
+ OPT("rtype", 't', arg_uint8, release_opt, rtype,
+ "Reservation Type"),
+ OPT("rrela", 'a', arg_uint8, release_opt, rrela,
+ "Release Action (0=release, 1=clear)"),
+ { NULL, 0, arg_none, NULL, NULL }
+};
+
+static const struct args release_args[] = {
+ { arg_string, &release_opt.dev, "namespace-id" },
+ { arg_none, NULL, NULL },
+};
+
+static struct cmd release_cmd = {
+ .name = "release",
+ .fn = resvrelease,
+ .descr = "Release/clear reservation",
+ .ctx_size = sizeof(release_opt),
+ .opts = release_opts,
+ .args = release_args,
+};
+
+CMD_SUBCOMMAND(resv_cmd, release_cmd);
+
+static struct report_options {
+ bool hex;
+ bool verbose;
+ bool eds;
+ const char *dev;
+} report_opt = {
+ .hex = false,
+ .verbose = false,
+ .eds = false,
+ .dev = NULL,
+};
+
+static const struct opts report_opts[] = {
+ OPT("hex", 'x', arg_none, report_opt, hex,
+ "Print reservation status in hex"),
+ OPT("verbose", 'v', arg_none, report_opt, verbose,
+ "More verbosity"),
+ OPT("eds", 'e', arg_none, report_opt, eds,
+ "Extended Data Structure"),
+ { NULL, 0, arg_none, NULL, NULL }
+};
+
+static const struct args report_args[] = {
+ { arg_string, &report_opt.dev, "namespace-id" },
+ { arg_none, NULL, NULL },
+};
+
+static struct cmd report_cmd = {
+ .name = "report",
+ .fn = resvreport,
+ .descr = "Print reservation status",
+ .ctx_size = sizeof(report_opt),
+ .opts = report_opts,
+ .args = report_args,
+};
+
+CMD_SUBCOMMAND(resv_cmd, report_cmd);
+
+/* handles NVME_OPC_RESERVATION_* NVM commands */
+
+static void
+resvacquire(const struct cmd *f, int argc, char *argv[])
+{
+ struct nvme_pt_command pt;
+ uint64_t data[2];
+ int fd;
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-src-projects
mailing list