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