xref: /titanic_44/usr/src/cmd/fs.d/cachefs/cfsd/cfsd_all.h (revision 598f4ceed9327d2d6c2325dd67cae3aa06f7fea6)
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, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  *
24  *			all.h
25  *
26  * Include file for the cfsd_all class.
27  */
28 
29 #pragma ident	"%Z%%M%	%I%	%E% SMI"
30 /* Copyright (c) 1994 by Sun Microsystems, Inc. */
31 
32 #ifndef CFSD_ALL
33 #define	CFSD_ALL
34 
35 /* get define for _SYS_NMLN */
36 #include <sys/utsname.h>
37 
38 typedef struct cfsd_all_object {
39 	char			 i_machname[SYS_NMLN]; /* machine name */
40 	cfsd_cache_object_t	*i_cachelist;		 /* list of caches */
41 	int			 i_cachecount;		 /* # of objs on list */
42 	mutex_t			 i_lock;		 /* synchro lock */
43 	int			 i_nextcacheid;		 /* for cache ids */
44 	int			 i_modify;		 /* changed when mod */
45 #ifdef HOARD_CLASS
46 	cfsd_hoard		*i_hoardp;		 /* hoarding class */
47 #endif
48 
49 } cfsd_all_object_t;
50 
51 cfsd_all_object_t *cfsd_all_create(void);
52 void cfsd_all_destroy(cfsd_all_object_t *cfsd_all_object_p);
53 
54 void all_lock(cfsd_all_object_t *all_object_p);
55 void all_unlock(cfsd_all_object_t *all_object_p);
56 
57 cfsd_cache_object_t *all_cachelist_at(cfsd_all_object_t *all_object_p,
58     size_t index);
59 void all_cachelist_add(cfsd_all_object_t *all_object_p,
60     cfsd_cache_object_t *cache_object_p);
61 cfsd_cache_object_t *all_cachelist_find(cfsd_all_object_t *all_object_p,
62     const char *namep);
63 
64 void all_cachefstab_update(cfsd_all_object_t *all_object_p);
65 
66 #endif /* CFSD_ALL */
67