Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/share/man/man9 document missing disk_set_info function that ...



details:   https://anonhg.NetBSD.org/src/rev/a63a6f4d3284
branches:  trunk
changeset: 805338:a63a6f4d3284
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Mon Dec 29 19:07:03 2014 +0000

description:
document missing disk_set_info function that maintains the device's
"disk-info" dictionary.

diffstat:

 share/man/man9/disk.9 |  18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diffs (53 lines):

diff -r dec8caec214f -r a63a6f4d3284 share/man/man9/disk.9
--- a/share/man/man9/disk.9     Mon Dec 29 18:54:19 2014 +0000
+++ b/share/man/man9/disk.9     Mon Dec 29 19:07:03 2014 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: disk.9,v 1.37 2014/12/29 18:41:20 mlelstv Exp $
+.\"    $NetBSD: disk.9,v 1.38 2014/12/29 19:07:03 mlelstv Exp $
 .\"
 .\" Copyright (c) 1995, 1996 Jason R. Thorpe.
 .\" All rights reserved.
@@ -44,7 +44,8 @@
 .Nm disk_unbusy ,
 .Nm disk_isbusy ,
 .Nm disk_find ,
-.Nm disk_blocksize
+.Nm disk_blocksize ,
+.Nm disk_set_info
 .Nd generic disk framework
 .Sh SYNOPSIS
 .In sys/types.h
@@ -70,6 +71,8 @@
 .Fn disk_find "const char *"
 .Ft void
 .Fn disk_blocksize "struct disk *" "int blocksize"
+.Ft void
+.Fn disk_set_info "device_t" "struct disk *" "const char *type"
 .Sh DESCRIPTION
 The
 .Nx
@@ -203,6 +206,13 @@
 It is only necessary to call this function if the device's physical blocksize
 is not
 .Dv DEV_BSIZE .
+.It Fn disk_set_info
+Setup disk-info dictionary, the driver must have initialized the
+dk_geom member of
+.Fa struct disk
+with suitable values. If
+.Fa type
+is not NULL, it will be added to the dictionary.
 .El
 .Pp
 The functions typically called by device drivers are
@@ -358,6 +368,10 @@
        /* Read geometry and fill in pertinent parts of disklabel. */
        [ . . . ]
        disk_blocksize(\*[Am]sc-\*[Gt]sc_dk, bytes_per_sector);
+
+       /* Initialize geometry values of the disk structure */
+       [ . . . ]
+       disk_set_info(\*[Am]self\*[Gt], \*[Am]sc-\*[Gt]sc_dk, type);
 }
 .Ed
 .Pp



Home | Main Index | Thread Index | Old Index