xref: /titanic_52/usr/src/uts/common/sharefs/sharetab.h (revision a0900badd8eb6bcca99411c8906b483e84f2da91)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
23  */
24 
25 #ifndef _SHAREFS_SHARETAB_H
26 #define	_SHAREFS_SHARETAB_H
27 
28 #include <sys/pkp_hash.h>
29 
30 /*
31  * This header defines the glue to keeping a sharetab in memory.
32  * It is broken out from sharefs.h in the case that it will be
33  * reused in userland.
34  */
35 
36 /*
37  * Note:
38  * Must include share/share.h before this header.
39  */
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
45 typedef struct sh_list {		/* cached share list */
46 	struct sh_list	*shl_next;
47 	share_t		*shl_sh;
48 } sh_list_t;
49 
50 typedef struct sharefs_hash_head {
51 	share_t		*ssh_sh;
52 	uint_t		ssh_count;
53 } sharefs_hash_head_t;
54 
55 #define	SHARETAB_HASHES		PKP_HASH_SIZE
56 
57 typedef struct sharetab {
58 	sharefs_hash_head_t	s_buckets[SHARETAB_HASHES];
59 	char			*s_fstype;
60 	struct sharetab		*s_next;
61 	uint_t			s_count;
62 } sharetab_t;
63 
64 #ifdef __cplusplus
65 }
66 #endif
67 
68 #endif /* !_SHAREFS_SHARETAB_H */
69