From owner-svn-src-head@freebsd.org Fri Jul 17 22:15:03 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B72F5370560; Fri, 17 Jul 2020 22:15:03 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B7lmR2MVMz4cT4; Fri, 17 Jul 2020 22:15:03 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 24F9D202B0; Fri, 17 Jul 2020 22:15:03 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06HMF3I6032344; Fri, 17 Jul 2020 22:15:03 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06HMF2q9032341; Fri, 17 Jul 2020 22:15:02 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202007172215.06HMF2q9032341@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Fri, 17 Jul 2020 22:15:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363291 - in head: . share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: in head: . share/man/man9 X-SVN-Commit-Revision: 363291 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jul 2020 22:15:03 -0000 Author: gbe (doc committer) Date: Fri Jul 17 22:15:02 2020 New Revision: 363291 URL: https://svnweb.freebsd.org/changeset/base/363291 Log: devstat(9): Update the man page to reflect the current implementation - Rename devstat_add_entry to devstat_new_entry - Update the description of devstat_trans_flags - Add manpage aliases for devstat_start_transaction_bio and devstat_end_transaction_bio PR: 157316 Submitted by: novel Reviewed by: cem, bcr (mentor) Approved by: bcr (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25677 Modified: head/ObsoleteFiles.inc head/share/man/man9/Makefile head/share/man/man9/devstat.9 Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Jul 17 22:07:19 2020 (r363290) +++ head/ObsoleteFiles.inc Fri Jul 17 22:15:02 2020 (r363291) @@ -36,6 +36,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20200715: rework of devstat(9) man page +OLD_FILES+=usr/share/man/man9/devstat_add_entry.9.gz + # 20200714: update byacc to 20200330 OLD_FILES+=usr/tests/usr.bin/yacc/btyacc_calc1.y OLD_FILES+=usr/tests/usr.bin/yacc/btyacc_demo.y Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Fri Jul 17 22:07:19 2020 (r363290) +++ head/share/man/man9/Makefile Fri Jul 17 22:15:02 2020 (r363291) @@ -968,10 +968,12 @@ MLINKS+=device_set_desc.9 device_get_desc.9 \ device_set_desc.9 device_set_desc_copy.9 MLINKS+=device_set_flags.9 device_get_flags.9 MLINKS+=devstat.9 devicestat.9 \ - devstat.9 devstat_add_entry.9 \ + devstat.9 devstat_new_entry.9 \ devstat.9 devstat_end_transaction.9 \ + devstat.9 devstat_end_transaction_bio.9 \ devstat.9 devstat_remove_entry.9 \ - devstat.9 devstat_start_transaction.9 + devstat.9 devstat_start_transaction.9 \ + devstat.9 devstat_start_transaction_bio.9 MLINKS+=disk.9 disk_add_alias.9 \ disk.9 disk_alloc.9 \ disk.9 disk_create.9 \ Modified: head/share/man/man9/devstat.9 ============================================================================== --- head/share/man/man9/devstat.9 Fri Jul 17 22:07:19 2020 (r363290) +++ head/share/man/man9/devstat.9 Fri Jul 17 22:15:02 2020 (r363291) @@ -27,25 +27,24 @@ .\" .\" $FreeBSD$ .\" -.Dd August 22, 2018 +.Dd July 15, 2020 .Dt DEVSTAT 9 .Os .Sh NAME .Nm devstat , -.Nm devstat_add_entry , .Nm devstat_end_transaction , .Nm devstat_end_transaction_bio , .Nm devstat_end_transaction_bio_bt , +.Nm devstat_new_entry , .Nm devstat_remove_entry , .Nm devstat_start_transaction , .Nm devstat_start_transaction_bio .Nd kernel interface for keeping device statistics .Sh SYNOPSIS .In sys/devicestat.h -.Ft void -.Fo devstat_add_entry -.Fa "struct devstat *ds" -.Fa "const char *dev_name" +.Ft struct devstat * +.Fo devstat_new_entry +.Fa "const void *dev_name" .Fa "int unit_number" .Fa "uint32_t block_size" .Fa "devstat_support_flags flags" @@ -78,7 +77,6 @@ .Fa "struct devstat *ds" .Fa "const struct bio *bp" .Fc -.Fc .Ft void .Fo devstat_end_transaction_bio_bt .Fa "struct devstat *ds" @@ -103,19 +101,13 @@ for most disk-like drivers in the 2000s and beyond. New consumers of the interface should almost certainly use only the "bio" variants of the start and end transacation routines. .Pp -.Fn devstat_add_entry -registers a device with the -.Nm -subsystem. -The caller is expected to have already allocated \fBand zeroed\fR -the devstat structure before calling this function. -.Fn devstat_add_entry +.Fn devstat_new_entry +allocates and initializes +.Va devstat +structure and returns a pointer to it. +.Fn devstat_new_entry takes several arguments: .Bl -tag -width device_type -.It ds -The -.Va devstat -structure, allocated and zeroed by the client. .It dev_name The device name, e.g., da, cd, sa. .It unit_number @@ -386,6 +378,8 @@ to insert a device in the list. The second parameter is attach order. See below for a list of available priorities. +.It id +Identification for GEOM nodes. .El .Pp Each device is given a device type. @@ -478,7 +472,18 @@ typedef enum { DEVSTAT_WRITE = 0x02, DEVSTAT_FREE = 0x03 } devstat_trans_flags; +#define DEVSTAT_N_TRANS_FLAGS 4 .Ed +.Pp +DEVSTAT_NO_DATA is a type of transactions to the device which are neither +reads or writes. +For instance, +.Tn SCSI +drivers often send a test unit ready command to +.Tn SCSI +devices. +The test unit ready command does not read or write any data. +It merely causes the device to return its status. .Pp There are four possible values for the .Va tag_type