xref: /titanic_44/usr/src/cmd/fs.d/cachefs/common/cachefsd.x (revision 6bbe05905a1c10a2703f95fb4912eb14b87f6670)
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  * Copyright 1996, 2002 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /* -----------------------------------------------------------------
28  *
29  *			cachefsd.x
30  *
31  * Rpcgen file for generating cachefsd interface.
32  */
33 
34 /* #ident	"%Z%%M%	%I%	%E% SMI" */
35 
36 
37 /*
38  * List of caches.
39  */
40 struct cachefsd_caches_id {
41 	int		cci_cacheid;		/* id of cache */
42 	string		cci_name<>;		/* pathname of cache */
43 };
44 struct cachefsd_caches_return {
45 	u_int			ccr_modify;	/* changes when modified */
46 	cachefsd_caches_id	ccr_ids<>;	/* list of caches */
47 };
48 
49 /*
50  * Stats about a single cache.
51  * All sizes are in 1K blocks.
52  */
53 struct cachefsd_cache_status {
54 	int		ccs_id;			/* id of cache */
55 	string		ccs_name<>;		/* name of cache */
56 	longlong_t	ccs_size;		/* size of cache */
57 	longlong_t	ccs_lrusize;		/* size of lru files */
58 	longlong_t	ccs_packsize;		/* size of packed files */
59 	longlong_t	ccs_freesize;		/* size of free space */
60 	u_int		ccs_lrutime;		/* time of oldest item on lru */
61 	u_int		ccs_modify;		/* changes when modified */
62 };
63 
64 /*
65  * List of file systems in a cache.
66  */
67 struct cachefsd_mount {
68 	int		cm_fsid;		/* id of file system */
69 	string		cm_name<>;		/* name of file system */
70 };
71 struct cachefsd_mount_returns {
72 	cachefsd_mount	cmr_names<>;		/* list of file systems */
73 	u_int		cmr_modify;		/* changes when modified */
74 	int		cmr_error;		/* 0 if no error */
75 };
76 
77 /*
78  * Stats about a single file system in a cache.
79  */
80 struct cachefsd_mount_stat_args {
81 	int		cma_cacheid;		/* id of cache */
82 	int		cma_fsid;		/* id of file system */
83 };
84 struct cachefsd_mount_stat {
85 	int		cms_cacheid;		/* id of cache */
86 	int		cms_fsid;		/* id of file system */
87 	string		cms_name<>;		/* name of file system */
88 	string		cms_backfs<>;		/* back file system */
89 	string		cms_mountpt<>;		/* most recent mount point */
90 	string		cms_backfstype<>;	/* type of back file system */
91 	string		cms_writemode<>;	/* write mode */
92 	string		cms_options<>;		/* remaining options */
93 	int		cms_mounted;		/* 1 if mounted */
94 	int		cms_connected;		/* 1 if connected */
95 	int		cms_reconcile;		/* 1 if reconcile in progress */
96 	int		cms_changes;		/* 1 if changes to push back */
97 	u_int		cms_time_state;		/* time of state change */
98 	u_int		cms_mnttime;		/* time of last mount/umount */
99 	u_int		cms_modify;		/* changes when modified */
100 };
101 
102 /*
103  * Sent by mount command to indicate a new mounted file system.
104  */
105 struct cachefsd_fs_mounted {
106 	string		mt_cachedir<>;		/* cache directory path */
107 	string		mt_cacheid<>;		/* cache id */
108 };
109 
110 /*
111  * Sent by umount command to unmount file system.
112  * cachefsd may get the request to force unmount
113  * the cachefs front file system, thus flag is
114  * necessary to indicate forced unmount.
115  * Hopefully, someday forced unmount is supported
116  * for cachefs !!
117  */
118 struct cachefsd_fs_unmounted {
119 	string		mntpt<>;		/* Mount point */
120 	int		flag;			/* MS_FORCE flag */
121 };
122 
123 /*
124  * Sets file system to simulate disconnection.
125  */
126 struct cachefsd_disconnection_args {
127 	string		cda_mntpt<>;		/* mntpt of file system */
128 	int		cda_disconnect;		/* 1 disconnect, 0 connect */
129 };
130 
131 /*
132  * -----------------------------------------------------------------
133  * This is the definition of the routines supported by the service.
134  */
135 program CACHEFSDPROG {
136 	version CACHEFSDVERS {
137 		void CACHEFSD_NULL(void) = 0;
138 		cachefsd_caches_return CACHEFSD_CACHES(void) = 1;
139 		cachefsd_cache_status CACHEFSD_CACHE_STATUS(int id) = 2;
140 		cachefsd_mount_returns CACHEFSD_MOUNTS(int id) = 3;
141 		cachefsd_mount_stat CACHEFSD_MOUNT_STAT(
142 		    struct cachefsd_mount_stat_args) = 4;
143 		void CACHEFSD_FS_MOUNTED(struct cachefsd_fs_mounted) = 5;
144 		int CACHEFSD_FS_UNMOUNTED(struct cachefsd_fs_unmounted) = 6;
145 		int CACHEFSD_DISCONNECTION(struct cachefsd_disconnection_args)
146 		    = 7;
147 	} = 1;
148 } = 100235;
149 
150 #ifdef RPC_HDR
151 %
152 #endif /* RPC_HDR */
153