xref: /onnv-gate/usr/src/cmd/fs.d/cachefs/common/cachefsd.x (revision 0:68f95e015346)
1*0Sstevel@tonic-gate /*
2*0Sstevel@tonic-gate  * CDDL HEADER START
3*0Sstevel@tonic-gate  *
4*0Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*0Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*0Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*0Sstevel@tonic-gate  * with the License.
8*0Sstevel@tonic-gate  *
9*0Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*0Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*0Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*0Sstevel@tonic-gate  * and limitations under the License.
13*0Sstevel@tonic-gate  *
14*0Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*0Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*0Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*0Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*0Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*0Sstevel@tonic-gate  *
20*0Sstevel@tonic-gate  * CDDL HEADER END
21*0Sstevel@tonic-gate  */
22*0Sstevel@tonic-gate /*
23*0Sstevel@tonic-gate  * Copyright 1996, 2002 Sun Microsystems, Inc.  All rights reserved.
24*0Sstevel@tonic-gate  * Use is subject to license terms.
25*0Sstevel@tonic-gate  */
26*0Sstevel@tonic-gate 
27*0Sstevel@tonic-gate /* -----------------------------------------------------------------
28*0Sstevel@tonic-gate  *
29*0Sstevel@tonic-gate  *			cachefsd.x
30*0Sstevel@tonic-gate  *
31*0Sstevel@tonic-gate  * Rpcgen file for generating cachefsd interface.
32*0Sstevel@tonic-gate  */
33*0Sstevel@tonic-gate 
34*0Sstevel@tonic-gate /* #ident	"%Z%%M%	%I%	%E% SMI" */
35*0Sstevel@tonic-gate 
36*0Sstevel@tonic-gate 
37*0Sstevel@tonic-gate /*
38*0Sstevel@tonic-gate  * List of caches.
39*0Sstevel@tonic-gate  */
40*0Sstevel@tonic-gate struct cachefsd_caches_id {
41*0Sstevel@tonic-gate 	int		cci_cacheid;		/* id of cache */
42*0Sstevel@tonic-gate 	string		cci_name<>;		/* pathname of cache */
43*0Sstevel@tonic-gate };
44*0Sstevel@tonic-gate struct cachefsd_caches_return {
45*0Sstevel@tonic-gate 	u_int			ccr_modify;	/* changes when modified */
46*0Sstevel@tonic-gate 	cachefsd_caches_id	ccr_ids<>;	/* list of caches */
47*0Sstevel@tonic-gate };
48*0Sstevel@tonic-gate 
49*0Sstevel@tonic-gate /*
50*0Sstevel@tonic-gate  * Stats about a single cache.
51*0Sstevel@tonic-gate  * All sizes are in 1K blocks.
52*0Sstevel@tonic-gate  */
53*0Sstevel@tonic-gate struct cachefsd_cache_status {
54*0Sstevel@tonic-gate 	int		ccs_id;			/* id of cache */
55*0Sstevel@tonic-gate 	string		ccs_name<>;		/* name of cache */
56*0Sstevel@tonic-gate 	longlong_t	ccs_size;		/* size of cache */
57*0Sstevel@tonic-gate 	longlong_t	ccs_lrusize;		/* size of lru files */
58*0Sstevel@tonic-gate 	longlong_t	ccs_packsize;		/* size of packed files */
59*0Sstevel@tonic-gate 	longlong_t	ccs_freesize;		/* size of free space */
60*0Sstevel@tonic-gate 	u_int		ccs_lrutime;		/* time of oldest item on lru */
61*0Sstevel@tonic-gate 	u_int		ccs_modify;		/* changes when modified */
62*0Sstevel@tonic-gate };
63*0Sstevel@tonic-gate 
64*0Sstevel@tonic-gate /*
65*0Sstevel@tonic-gate  * List of file systems in a cache.
66*0Sstevel@tonic-gate  */
67*0Sstevel@tonic-gate struct cachefsd_mount {
68*0Sstevel@tonic-gate 	int		cm_fsid;		/* id of file system */
69*0Sstevel@tonic-gate 	string		cm_name<>;		/* name of file system */
70*0Sstevel@tonic-gate };
71*0Sstevel@tonic-gate struct cachefsd_mount_returns {
72*0Sstevel@tonic-gate 	cachefsd_mount	cmr_names<>;		/* list of file systems */
73*0Sstevel@tonic-gate 	u_int		cmr_modify;		/* changes when modified */
74*0Sstevel@tonic-gate 	int		cmr_error;		/* 0 if no error */
75*0Sstevel@tonic-gate };
76*0Sstevel@tonic-gate 
77*0Sstevel@tonic-gate /*
78*0Sstevel@tonic-gate  * Stats about a single file system in a cache.
79*0Sstevel@tonic-gate  */
80*0Sstevel@tonic-gate struct cachefsd_mount_stat_args {
81*0Sstevel@tonic-gate 	int		cma_cacheid;		/* id of cache */
82*0Sstevel@tonic-gate 	int		cma_fsid;		/* id of file system */
83*0Sstevel@tonic-gate };
84*0Sstevel@tonic-gate struct cachefsd_mount_stat {
85*0Sstevel@tonic-gate 	int		cms_cacheid;		/* id of cache */
86*0Sstevel@tonic-gate 	int		cms_fsid;		/* id of file system */
87*0Sstevel@tonic-gate 	string		cms_name<>;		/* name of file system */
88*0Sstevel@tonic-gate 	string		cms_backfs<>;		/* back file system */
89*0Sstevel@tonic-gate 	string		cms_mountpt<>;		/* most recent mount point */
90*0Sstevel@tonic-gate 	string		cms_backfstype<>;	/* type of back file system */
91*0Sstevel@tonic-gate 	string		cms_writemode<>;	/* write mode */
92*0Sstevel@tonic-gate 	string		cms_options<>;		/* remaining options */
93*0Sstevel@tonic-gate 	int		cms_mounted;		/* 1 if mounted */
94*0Sstevel@tonic-gate 	int		cms_connected;		/* 1 if connected */
95*0Sstevel@tonic-gate 	int		cms_reconcile;		/* 1 if reconcile in progress */
96*0Sstevel@tonic-gate 	int		cms_changes;		/* 1 if changes to push back */
97*0Sstevel@tonic-gate 	u_int		cms_time_state;		/* time of state change */
98*0Sstevel@tonic-gate 	u_int		cms_mnttime;		/* time of last mount/umount */
99*0Sstevel@tonic-gate 	u_int		cms_modify;		/* changes when modified */
100*0Sstevel@tonic-gate };
101*0Sstevel@tonic-gate 
102*0Sstevel@tonic-gate /*
103*0Sstevel@tonic-gate  * Sent by mount command to indicate a new mounted file system.
104*0Sstevel@tonic-gate  */
105*0Sstevel@tonic-gate struct cachefsd_fs_mounted {
106*0Sstevel@tonic-gate 	string		mt_cachedir<>;		/* cache directory path */
107*0Sstevel@tonic-gate 	string		mt_cacheid<>;		/* cache id */
108*0Sstevel@tonic-gate };
109*0Sstevel@tonic-gate 
110*0Sstevel@tonic-gate /*
111*0Sstevel@tonic-gate  * Sent by umount command to unmount file system.
112*0Sstevel@tonic-gate  * cachefsd may get the request to force unmount
113*0Sstevel@tonic-gate  * the cachefs front file system, thus flag is
114*0Sstevel@tonic-gate  * necessary to indicate forced unmount.
115*0Sstevel@tonic-gate  * Hopefully, someday forced unmount is supported
116*0Sstevel@tonic-gate  * for cachefs !!
117*0Sstevel@tonic-gate  */
118*0Sstevel@tonic-gate struct cachefsd_fs_unmounted {
119*0Sstevel@tonic-gate 	string		mntpt<>;		/* Mount point */
120*0Sstevel@tonic-gate 	int		flag;			/* MS_FORCE flag */
121*0Sstevel@tonic-gate };
122*0Sstevel@tonic-gate 
123*0Sstevel@tonic-gate /*
124*0Sstevel@tonic-gate  * Sets file system to simulate disconnection.
125*0Sstevel@tonic-gate  */
126*0Sstevel@tonic-gate struct cachefsd_disconnection_args {
127*0Sstevel@tonic-gate 	string		cda_mntpt<>;		/* mntpt of file system */
128*0Sstevel@tonic-gate 	int		cda_disconnect;		/* 1 disconnect, 0 connect */
129*0Sstevel@tonic-gate };
130*0Sstevel@tonic-gate 
131*0Sstevel@tonic-gate /*
132*0Sstevel@tonic-gate  * -----------------------------------------------------------------
133*0Sstevel@tonic-gate  * This is the definition of the routines supported by the service.
134*0Sstevel@tonic-gate  */
135*0Sstevel@tonic-gate program CACHEFSDPROG {
136*0Sstevel@tonic-gate 	version CACHEFSDVERS {
137*0Sstevel@tonic-gate 		void CACHEFSD_NULL(void) = 0;
138*0Sstevel@tonic-gate 		cachefsd_caches_return CACHEFSD_CACHES(void) = 1;
139*0Sstevel@tonic-gate 		cachefsd_cache_status CACHEFSD_CACHE_STATUS(int id) = 2;
140*0Sstevel@tonic-gate 		cachefsd_mount_returns CACHEFSD_MOUNTS(int id) = 3;
141*0Sstevel@tonic-gate 		cachefsd_mount_stat CACHEFSD_MOUNT_STAT(
142*0Sstevel@tonic-gate 		    struct cachefsd_mount_stat_args) = 4;
143*0Sstevel@tonic-gate 		void CACHEFSD_FS_MOUNTED(struct cachefsd_fs_mounted) = 5;
144*0Sstevel@tonic-gate 		int CACHEFSD_FS_UNMOUNTED(struct cachefsd_fs_unmounted) = 6;
145*0Sstevel@tonic-gate 		int CACHEFSD_DISCONNECTION(struct cachefsd_disconnection_args)
146*0Sstevel@tonic-gate 		    = 7;
147*0Sstevel@tonic-gate 	} = 1;
148*0Sstevel@tonic-gate } = 100235;
149*0Sstevel@tonic-gate 
150*0Sstevel@tonic-gate #ifdef RPC_HDR
151*0Sstevel@tonic-gate %
152*0Sstevel@tonic-gate #endif /* RPC_HDR */
153