fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER START
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The contents of this file are subject to the terms of the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Common Development and Distribution License (the "License").
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You may not use this file except in compliance with the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * See the License for the specific language governing permissions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and limitations under the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * When distributing Covered Code, include this CDDL HEADER in each
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * If applicable, add the following below this CDDL HEADER, with the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fields enclosed by brackets "[]" replaced with your own identifying
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * information: Portions Copyright [yyyy] [name of copyright owner]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER END
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Use is subject to license terms.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Storage Volume Character and Block Driver (SV)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Private header file.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Define SV_SLEEP_LOCK to get full sleep lock semantics (ie. mutex not
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * held across calls to sdctl functions.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * #define SV_SLEEP_LOCK
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Misc defines, enums.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Guard device clients
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * SV_MAJOR_HASH_CNT & SV_MINOR_HASH_CNT should be prime.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * In a given system, there is likely to be one or two major devices in use.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Examples are:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * SD - Direct Attached Storage (SCSI-2/3)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * SSD - SAN Direct Attached Storage FC SCSI-2/3
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * SVM - Solaris Volume Manager
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * VxVM - Veritas Volume Manager
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Global - Sun Cluster Global Devices
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * For a typical system, there may be a 10s to 100s of minor devices configured
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * per major device, but most are likely to be configured under a single major
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * number. SV_MINOR_HASH_CNT has been chosen to ensure that the hash chains are
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * not too long (one or two devices), for the worst case.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SV_MAJOR_HASH_CNT 3 /* # hash buckets per system */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SV_MAJOR_HASH(min) ((min) % SV_MAJOR_HASH_CNT)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SV_MINOR_HASH_CNT 37 /* # hash buckets per major */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SV_MINOR_HASH(min) ((min) % SV_MINOR_HASH_CNT)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Per major device structure.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct sv_dev_s *sm_hash[SV_MINOR_HASH_CNT]; /* Minor Hash Table */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Per configured sv structure.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte kmutex_t sv_olock; /* mutual exclusion for otyp flags */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte nsc_size_t sv_maxfbas; /* maxfbas accepted by I/O module */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sv_gid_t sv_gclients; /* bitmask of all guard clients */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sv_gid_t sv_gkernel; /* bitmask of kernel guard clients */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int sv_openlcnt; /* # of OTYP_LYR opens whilst failed */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte clock_t sv_timestamp; /* time of successful {en,dis}able */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte void *sv_pending; /* the thread setting SV_PENDING */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * private functions exported from nskern to sv.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern int nskernd_isdaemon(void);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _KERNEL */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _SV_IMPL_H */