# 2.11BSD#431 - /usr/src/sys/h/disk.h

##### Macros

    DKF_ALIVE         X
    DKF_CLOSING       X
    DKF_ONLINE        X
    DKF_OPENING       X
    DKF_SEEK          X
    DKF_SWAIT         X
    DKF_WANTED        X
    DKF_WLABEL        X
    _SYS_DISK_H_      X
    dkminor           X
    dkpart            X
    dkunit            X

##### struct's

    dkdevice          X

       1: /*
       2:  * Copyright (c) 1992, 1993
       3:  *	The Regents of the University of California.  All rights reserved.
       4:  *
       5:  * This software was developed by the Computer Systems Engineering group
       6:  * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
       7:  * contributed to Berkeley.
       8:  *
       9:  * All advertising materials mentioning features or use of this software
      10:  * must display the following acknowledgement:
      11:  *	This product includes software developed by the University of
      12:  *	California, Lawrence Berkeley Laboratory.
      13:  *
      14:  * Redistribution and use in source and binary forms, with or without
      15:  * modification, are permitted provided that the following conditions
      16:  * are met:
      17:  * 1. Redistributions of source code must retain the above copyright
      18:  *    notice, this list of conditions and the following disclaimer.
      19:  * 2. Redistributions in binary form must reproduce the above copyright
      20:  *    notice, this list of conditions and the following disclaimer in the
      21:  *    documentation and/or other materials provided with the distribution.
      22:  * 3. All advertising materials mentioning features or use of this software
      23:  *    must display the following acknowledgement:
      24:  *	This product includes software developed by the University of
      25:  *	California, Berkeley and its contributors.
      26:  * 4. Neither the name of the University nor the names of its contributors
      27:  *    may be used to endorse or promote products derived from this software
      28:  *    without specific prior written permission.
      29:  *
      30:  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
      31:  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
      32:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
      33:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
      34:  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
      35:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
      36:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
      37:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
      38:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
      39:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
      40:  * SUCH DAMAGE.
      41:  *
      42:  *	@(#)disk.h	8.1.2 (2.11BSD GTE) 1995/05/21
      43:  *
      44:  * from: $Header: disk.h,v 1.5 92/11/19 04:33:03 torek Exp $ (LBL)
      45:  */
      46:
      47: #ifndef _SYS_DISK_H_
      48: #define _SYS_DISK_H_
      49: #include <sys/disklabel.h>
      50:
      51: /*
      52:  * Disk device structures.
      53:  *
      54:  * Note that this is only a preliminary outline.  The final disk structures
      55:  * may be somewhat different.
      56:  *
      57:  * Note:  the 2.11BSD version is very different.  The 4.4 version served
      58:  *        as the inspiration. I needed something similar but for slightly
      59:  *	  different purposes.
      60:  */
      61:
      62: /*
      63:  * Disk device structures.  Rather than replicate driver specific variations
      64:  * of the following in each driver it was made common here.
      65:  *
      66:  * Some of the flags are specific to various drivers. For example ALIVE and
      67:  * ONLINE apply to MSCP devices more than to SMD devices while the SEEK flag
      68:  * applies to the SMD (xp) driver but not to the MSCP driver.  The rest
      69:  * of the flags as well as the open partition bitmaps are usable by any disk
      70:  * driver.  One 'dkdevice' structure is needed for each disk drive supported
      71:  * by a driver.
      72:  *
      73:  * The entire disklabel is not resident in the kernel address space.  Only
      74:  * the partition table is directly accessible by the kernel.  The MSCP driver
      75:  * does not care (or know) about the geometry of the disk.  Not holding
      76:  * the entire label in the kernel saved quite a bit of D space.  Other drivers
      77:  * which need geometry information from the label will have to map in the
      78:  * label and copy out the geometry data they require.  This is unlikely to
      79:  * cause much overhead since labels are read and written infrequently - when
      80:  * mounting a drive, assigning a label, running newfs, etc.
      81:  */
      82:
      83: struct dkdevice {
      84:     int dk_bopenmask;       /* block devices open */
      85:     int dk_copenmask;       /* character devices open */
      86:     int dk_openmask;        /* composite (bopen|copen) */
      87:     int dk_flags;       /* label state   see below */
      88:     memaddr dk_label;       /* sector containing label */
      89:     struct  partition dk_parts[MAXPARTITIONS];  /* inkernel portion */
      90: };
      91:
      92: #define DKF_OPENING 0x0001      /* drive is being opened */
      93: #define DKF_CLOSING 0x0002      /* drive is being closed */
      94: #define DKF_WANTED  0x0004      /* drive is being waited for */
      95: #define DKF_ALIVE   0x0008      /* drive is alive */
      96: #define DKF_ONLINE  0x0010      /* drive is online */
      97: #define DKF_WLABEL  0x0020      /* label area is being written */
      98: #define DKF_SEEK    0x0040      /* drive is seeking */
      99: #define DKF_SWAIT   0x0080      /* waiting for seek to complete */
     100:
     101: /* encoding of disk minor numbers, should be elsewhere... but better
     102:  * here than in ufs_disksubr.c
     103:  *
     104:  * Note: the controller number in bits 6 and 7 of the minor device are NOT
     105:  *	 removed.  It is the responsibility of the driver to extract or mask
     106:  *	 these bits.
     107: */
     108:
     109: #define dkunit(dev)     (minor(dev) >> 3)
     110: #define dkpart(dev)     (minor(dev) & 07)
     111: #define dkminor(unit, part) (((unit) << 3) | (part))
     112:
     113: #ifdef KERNEL
     114: char    *readdisklabel();
     115: int setdisklabel();
     116: int writedisklabel();
     117: #endif
     118: #endif /* _SYS_DISK_H_ */

#### Defined struct's

dkdevice defined in line 83; used 50 times

- in /usr/src/sys/pdpuba/hk.c line 84(2), 128(2), 219(2), 260(2), 301(2), 331(2), 371(2), 465(2), 701(2), 916(2)
- in /usr/src/sys/pdpuba/ra.c line 189(2)
- in /usr/src/sys/pdpuba/rl.c line 101(2), 144(2), 218(2), 254(2), 294(2), 325(2), 369(2), 591(2), 612(2), 706(2)
- in /usr/src/sys/pdpuba/xp.c line 73(2), 940(2)
- in /usr/src/sys/sys/ufs_disksubr.c line 271(2), 373(2)

#### Defined macros

DKF_ALIVE defined in line 95; used 20 times

- in /usr/src/sys/pdpuba/hk.c line 135, 148, 245, 336, 666, 709
- in /usr/src/sys/pdpuba/ra.c line 336-338(2), 650, 1270
- in /usr/src/sys/pdpuba/rl.c line 149, 330, 628, 759, 766
- in /usr/src/sys/pdpuba/xp.c line 203, 220, 397, 969
- in /usr/src/sys/sys/ufs_disksubr.c line 357

DKF_CLOSING defined in line 93; used 12 times

- in /usr/src/sys/pdpuba/hk.c line 162, 232, 245
- in /usr/src/sys/pdpuba/ra.c line 438, 509-514(2)
- in /usr/src/sys/pdpuba/rl.c line 160, 231, 239
- in /usr/src/sys/pdpuba/xp.c line 226, 289-293(2)

DKF_ONLINE defined in line 96; used 17 times

- in /usr/src/sys/pdpuba/hk.c line 245, 395, 403, 427, 508, 524
- in /usr/src/sys/pdpuba/ra.c line 405, 425, 650, 1100, 1129, 1184
- in /usr/src/sys/pdpuba/xp.c line 469-472(2), 505, 615, 623

DKF_OPENING defined in line 92; used 12 times

- in /usr/src/sys/pdpuba/hk.c line 162, 181-183(2)
- in /usr/src/sys/pdpuba/ra.c line 438, 457-459(2)
- in /usr/src/sys/pdpuba/rl.c line 160, 180-182(2)
- in /usr/src/sys/pdpuba/xp.c line 226, 235-237(2)

DKF_SEEK defined in line 98; never used
DKF_SWAIT defined in line 99; never used
DKF_WANTED defined in line 94; used 8 times

- in /usr/src/sys/pdpuba/hk.c line 236, 245, 482-484(2)
- in /usr/src/sys/pdpuba/rl.c line 235-239(2), 383-385(2)

DKF_WLABEL defined in line 97; used 6 times

- in /usr/src/sys/sys/ufs_disksubr.c line 308-310(2), 316, 336, 357, 405

_SYS_DISK_H_ defined in line 48; used 1 times

- in line 47

dkminor defined in line 111; used 1 times

- in /usr/src/sys/sys/ufs_disksubr.c line 171

dkpart defined in line 110; used 28 times

- in /usr/src/sys/pdpuba/br.c line 338
- in /usr/src/sys/pdpuba/hk.c line 195-197(2), 222, 711, 933
- in /usr/src/sys/pdpuba/ra.c line 470-473(2), 499, 765, 1263, 1421
- in /usr/src/sys/pdpuba/rl.c line 193-196(2), 221, 624, 722
- in /usr/src/sys/pdpuba/xp.c line 214, 279, 409, 599, 851, 972, 1062
- in /usr/src/sys/sys/ufs_disksubr.c line 164, 231, 302, 378

dkunit defined in line 109; used 22 times

- in /usr/src/sys/pdpuba/br.c line 338
- in /usr/src/sys/pdpuba/hk.c line 126, 217, 273, 316, 333, 490, 564, 704, 805, 920
- in /usr/src/sys/pdpuba/ra.c line 152, 586
- in /usr/src/sys/pdpuba/rl.c line 67, 267, 310
- in /usr/src/sys/pdpuba/si.c line 141, 273, 345
- in /usr/src/sys/pdpuba/xp.c line 48
- in /usr/src/sys/sys/ufs_disksubr.c line 171, 230

#### Usage of this include

disk.h used 8 times

- in /usr/src/sbin/newfs/newfs.c line 32
- in /usr/src/sys/pdpuba/br.c line 49
- in /usr/src/sys/pdpuba/hk.c line 49
- in /usr/src/sys/pdpuba/ra.c line 145
- in /usr/src/sys/pdpuba/rl.c line 57
- in /usr/src/sys/pdpuba/si.c line 26
- in /usr/src/sys/pdpuba/xp.c line 28
- in /usr/src/sys/sys/ufs_disksubr.c line 51

Last modified: 1995-06-16 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 591 |