xref: /onnv-gate/usr/src/uts/common/sys/fs/cachefs_log.h (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 2004 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 #ifndef _SYS_FS_CACHEFS_LOG_H
28*0Sstevel@tonic-gate #define	_SYS_FS_CACHEFS_LOG_H
29*0Sstevel@tonic-gate 
30*0Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*0Sstevel@tonic-gate 
32*0Sstevel@tonic-gate #include <sys/types.h>
33*0Sstevel@tonic-gate #include <sys/types32.h>
34*0Sstevel@tonic-gate #include <sys/vfs.h>
35*0Sstevel@tonic-gate #include <sys/fs/cachefs_fs.h>
36*0Sstevel@tonic-gate 
37*0Sstevel@tonic-gate #ifdef __cplusplus
38*0Sstevel@tonic-gate extern "C" {
39*0Sstevel@tonic-gate #endif
40*0Sstevel@tonic-gate 
41*0Sstevel@tonic-gate /* constants, etc. */
42*0Sstevel@tonic-gate 
43*0Sstevel@tonic-gate #define	CACHEFS_LOG_MAGIC	32321
44*0Sstevel@tonic-gate #define	CACHEFS_LOG_FILE_REV	    2
45*0Sstevel@tonic-gate 
46*0Sstevel@tonic-gate #define	CACHEFS_LOG_MOUNT		 1
47*0Sstevel@tonic-gate #define	CACHEFS_LOG_UMOUNT		 2
48*0Sstevel@tonic-gate #define	CACHEFS_LOG_GETPAGE		 3
49*0Sstevel@tonic-gate #define	CACHEFS_LOG_READDIR		 4
50*0Sstevel@tonic-gate #define	CACHEFS_LOG_READLINK		 5
51*0Sstevel@tonic-gate #define	CACHEFS_LOG_REMOVE		 6
52*0Sstevel@tonic-gate #define	CACHEFS_LOG_RMDIR		 7
53*0Sstevel@tonic-gate #define	CACHEFS_LOG_TRUNCATE		 8
54*0Sstevel@tonic-gate #define	CACHEFS_LOG_PUTPAGE		 9
55*0Sstevel@tonic-gate #define	CACHEFS_LOG_CREATE		10
56*0Sstevel@tonic-gate #define	CACHEFS_LOG_MKDIR		11
57*0Sstevel@tonic-gate #define	CACHEFS_LOG_RENAME		12
58*0Sstevel@tonic-gate #define	CACHEFS_LOG_SYMLINK		13
59*0Sstevel@tonic-gate #define	CACHEFS_LOG_POPULATE		14
60*0Sstevel@tonic-gate #define	CACHEFS_LOG_CSYMLINK		15
61*0Sstevel@tonic-gate #define	CACHEFS_LOG_FILLDIR		16
62*0Sstevel@tonic-gate #define	CACHEFS_LOG_MDCREATE		17
63*0Sstevel@tonic-gate #define	CACHEFS_LOG_GPFRONT		18
64*0Sstevel@tonic-gate #define	CACHEFS_LOG_RFDIR		19
65*0Sstevel@tonic-gate #define	CACHEFS_LOG_UALLOC		20
66*0Sstevel@tonic-gate #define	CACHEFS_LOG_CALLOC		21
67*0Sstevel@tonic-gate #define	CACHEFS_LOG_NOCACHE		22
68*0Sstevel@tonic-gate #define	CACHEFS_LOG_NUMRECS		22
69*0Sstevel@tonic-gate 
70*0Sstevel@tonic-gate /*
71*0Sstevel@tonic-gate  * cachefs_log_* are stored on disk, so they need to be the same
72*0Sstevel@tonic-gate  * 32-bit vs. 64-bit.
73*0Sstevel@tonic-gate  */
74*0Sstevel@tonic-gate 
75*0Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
76*0Sstevel@tonic-gate #pragma pack(4)
77*0Sstevel@tonic-gate #endif
78*0Sstevel@tonic-gate 
79*0Sstevel@tonic-gate /*
80*0Sstevel@tonic-gate  * for communicating from user to kernel, or for storing state.
81*0Sstevel@tonic-gate  */
82*0Sstevel@tonic-gate 
83*0Sstevel@tonic-gate typedef struct cachefs_log_control {
84*0Sstevel@tonic-gate 	int	lc_magic;
85*0Sstevel@tonic-gate 	char	lc_path[MAXPATHLEN];
86*0Sstevel@tonic-gate 	uchar_t	lc_which[(CACHEFS_LOG_NUMRECS / NBBY) + 1];
87*0Sstevel@tonic-gate 	uint64_t lc_cachep; /* really cachefscache_t * */
88*0Sstevel@tonic-gate } cachefs_log_control_t;
89*0Sstevel@tonic-gate 
90*0Sstevel@tonic-gate /*
91*0Sstevel@tonic-gate  * per-cachefscache information
92*0Sstevel@tonic-gate  */
93*0Sstevel@tonic-gate 
94*0Sstevel@tonic-gate typedef struct cachefs_log_cookie {
95*0Sstevel@tonic-gate 	void		*cl_head;	/* head of records to be written */
96*0Sstevel@tonic-gate 	void		*cl_tail;	/* tail of records to be written */
97*0Sstevel@tonic-gate 	uint_t		cl_size;	/* # of bytes to be written */
98*0Sstevel@tonic-gate 
99*0Sstevel@tonic-gate 	struct vnode	*cl_logvp;	/* vnode for logfile */
100*0Sstevel@tonic-gate 
101*0Sstevel@tonic-gate 	cachefs_log_control_t *cl_logctl; /* points at ksp->ks_data */
102*0Sstevel@tonic-gate 
103*0Sstevel@tonic-gate 	int		cl_magic;	/* cheap sanity check */
104*0Sstevel@tonic-gate } cachefs_log_cookie_t;
105*0Sstevel@tonic-gate 
106*0Sstevel@tonic-gate /* macros for determining which things we're logging + misc stuff */
107*0Sstevel@tonic-gate #define	CACHEFS_LOG_LOGGING(cp, which)				\
108*0Sstevel@tonic-gate 	((cp != NULL) &&					\
109*0Sstevel@tonic-gate 	(cp->c_log != NULL) &&				\
110*0Sstevel@tonic-gate 	(cp->c_log_ctl->lc_which[which / NBBY] &	\
111*0Sstevel@tonic-gate 	(1 << (which % NBBY))))
112*0Sstevel@tonic-gate #define	CACHEFS_LOG_SET(lc, which)	\
113*0Sstevel@tonic-gate 	(lc->lc_which[which / NBBY] |= (1 << (which % NBBY)))
114*0Sstevel@tonic-gate #define	CACHEFS_LOG_CLEAR(lc, which)	\
115*0Sstevel@tonic-gate 	(lc->lc_which[which / NBBY] &= ~(1 << (which % NBBY)))
116*0Sstevel@tonic-gate #define	CLPAD(sname, field)			\
117*0Sstevel@tonic-gate 	(sizeof (struct sname) -		\
118*0Sstevel@tonic-gate 	offsetof(struct sname, field) -	\
119*0Sstevel@tonic-gate 	sizeof (((struct sname *)0)->field))
120*0Sstevel@tonic-gate 
121*0Sstevel@tonic-gate struct cachefs_log_logfile_header {
122*0Sstevel@tonic-gate 	uint_t lh_magic;
123*0Sstevel@tonic-gate 	uint_t lh_revision;
124*0Sstevel@tonic-gate 	int lh_errno;
125*0Sstevel@tonic-gate 	uint_t lh_blocks;
126*0Sstevel@tonic-gate 	uint_t lh_files;
127*0Sstevel@tonic-gate 	uint_t lh_maxbsize;
128*0Sstevel@tonic-gate 	uint_t lh_pagesize;
129*0Sstevel@tonic-gate };
130*0Sstevel@tonic-gate 
131*0Sstevel@tonic-gate /*
132*0Sstevel@tonic-gate  * declarations of the logging records.
133*0Sstevel@tonic-gate  *
134*0Sstevel@tonic-gate  * note -- the first three fields must be int, int, and time_t (time32_t),
135*0Sstevel@tonic-gate  * corresponding to record type, error status, and timestamp.
136*0Sstevel@tonic-gate  *
137*0Sstevel@tonic-gate  * note -- the size of a trailing string should be large enough to
138*0Sstevel@tonic-gate  * hold any necessary null-terminating bytes.  i.e. for one string,
139*0Sstevel@tonic-gate  * say `char foo[1]'.  for two strings, null-separated, say `char
140*0Sstevel@tonic-gate  * foo[2]'.
141*0Sstevel@tonic-gate  *
142*0Sstevel@tonic-gate  * XX64	time32_t (above) is going to be a problem when the underlying
143*0Sstevel@tonic-gate  *	filesystems support 64-bit time.
144*0Sstevel@tonic-gate  */
145*0Sstevel@tonic-gate 
146*0Sstevel@tonic-gate /*
147*0Sstevel@tonic-gate  * XX64 - for now define all time types as 32-bits.
148*0Sstevel@tonic-gate  */
149*0Sstevel@tonic-gate 
150*0Sstevel@tonic-gate #if (defined(_SYSCALL32) && defined(_LP64))
151*0Sstevel@tonic-gate typedef uid32_t		cfs_uid_t;
152*0Sstevel@tonic-gate #else /* not _SYSCALL32 && _LP64 */
153*0Sstevel@tonic-gate typedef uid_t		cfs_uid_t;
154*0Sstevel@tonic-gate #endif /* _SYSCALL32 && _LP64 */
155*0Sstevel@tonic-gate 
156*0Sstevel@tonic-gate struct cachefs_log_mount_record {
157*0Sstevel@tonic-gate 	int type;		/* == CACHEFS_LOG_MOUNT */
158*0Sstevel@tonic-gate 	int error;		/* errno */
159*0Sstevel@tonic-gate 	cfs_time_t time;	/* timestamp */
160*0Sstevel@tonic-gate 	uint64_t vfsp;		/* vfs pointer -- unique while mounted */
161*0Sstevel@tonic-gate 	uint_t flags;		/* opt_flags from cachefsoptions */
162*0Sstevel@tonic-gate 	uint_t popsize;		/* opt_popsize from cachefsoptions */
163*0Sstevel@tonic-gate 	uint_t fgsize;		/* opt_fgsize from cachefsoptions */
164*0Sstevel@tonic-gate 	ushort_t pathlen;	/* length of path */
165*0Sstevel@tonic-gate 	ushort_t cacheidlen;	/* length of cacheid */
166*0Sstevel@tonic-gate 	char path[2];		/* the path of the mountpoint, and cacheid */
167*0Sstevel@tonic-gate };
168*0Sstevel@tonic-gate 
169*0Sstevel@tonic-gate struct cachefs_log_umount_record {
170*0Sstevel@tonic-gate 	int type;		/* == CACHEFS_LOG_UMOUNT */
171*0Sstevel@tonic-gate 	int error;		/* errno */
172*0Sstevel@tonic-gate 	cfs_time_t time;	/* timestamp */
173*0Sstevel@tonic-gate 	uint64_t vfsp;		/* vfs pointer we're unmounting */
174*0Sstevel@tonic-gate };
175*0Sstevel@tonic-gate 
176*0Sstevel@tonic-gate struct cachefs_log_getpage_record {
177*0Sstevel@tonic-gate 	int type;		/* == CACHEFS_LOG_GETPAGE */
178*0Sstevel@tonic-gate 	int error;		/* errno */
179*0Sstevel@tonic-gate 	cfs_time_t time;	/* timestamp */
180*0Sstevel@tonic-gate 	uint64_t vfsp;		/* which filesystem */
181*0Sstevel@tonic-gate 	cfs_fid_t fid;		/* file identifier */
182*0Sstevel@tonic-gate 	ino64_t fileno;		/* fileno */
183*0Sstevel@tonic-gate 	cfs_uid_t uid;		/* uid of credential */
184*0Sstevel@tonic-gate 	u_offset_t offset;	/* offset we're getting */
185*0Sstevel@tonic-gate 	uint_t len;		/* how many bytes we're getting */
186*0Sstevel@tonic-gate };
187*0Sstevel@tonic-gate 
188*0Sstevel@tonic-gate struct cachefs_log_readdir_record {
189*0Sstevel@tonic-gate 	int type;		/* == CACHEFS_LOG_READDIR */
190*0Sstevel@tonic-gate 	int error;		/* errno */
191*0Sstevel@tonic-gate 	cfs_time_t time;	/* timestamp */
192*0Sstevel@tonic-gate 	uint64_t vfsp;		/* which filesystem */
193*0Sstevel@tonic-gate 	cfs_fid_t fid;		/* file identifier */
194*0Sstevel@tonic-gate 	ino64_t fileno;		/* fileno */
195*0Sstevel@tonic-gate 	cfs_uid_t uid;		/* uid of credential */
196*0Sstevel@tonic-gate 	u_offset_t offset;	/* offset into directory */
197*0Sstevel@tonic-gate 	int eof;		/* like `*eofp' in VOP_READDIR */
198*0Sstevel@tonic-gate };
199*0Sstevel@tonic-gate 
200*0Sstevel@tonic-gate struct cachefs_log_readlink_record {
201*0Sstevel@tonic-gate 	int type;		/* == CACHEFS_LOG_READLINK */
202*0Sstevel@tonic-gate 	int error;		/* errno */
203*0Sstevel@tonic-gate 	cfs_time_t time;	/* timestamp */
204*0Sstevel@tonic-gate 	uint64_t vfsp;		/* which filesystem */
205*0Sstevel@tonic-gate 	cfs_fid_t fid;		/* file identifier */
206*0Sstevel@tonic-gate 	ino64_t fileno;		/* fileno */
207*0Sstevel@tonic-gate 	cfs_uid_t uid;		/* uid of credential */
208*0Sstevel@tonic-gate 	uint_t length;		/* length of symlink */
209*0Sstevel@tonic-gate };
210*0Sstevel@tonic-gate 
211*0Sstevel@tonic-gate struct cachefs_log_remove_record {
212*0Sstevel@tonic-gate 	int type;		/* == CACHEFS_LOG_REMOVE */
213*0Sstevel@tonic-gate 	int error;		/* errno */
214*0Sstevel@tonic-gate 	cfs_time_t time;	/* timestamp */
215*0Sstevel@tonic-gate 	uint64_t vfsp;		/* which filesystem */
216*0Sstevel@tonic-gate 	cfs_fid_t fid;		/* fid of file being removed */
217*0Sstevel@tonic-gate 				/* (not the directory holding the file) */
218*0Sstevel@tonic-gate 	ino64_t fileno;		/* fileno */
219*0Sstevel@tonic-gate 	cfs_uid_t uid;		/* uid of credential */
220*0Sstevel@tonic-gate };
221*0Sstevel@tonic-gate 
222*0Sstevel@tonic-gate struct cachefs_log_rmdir_record {
223*0Sstevel@tonic-gate 	int type;		/* == CACHEFS_LOG_RMDIR */
224*0Sstevel@tonic-gate 	int error;		/* errno */
225*0Sstevel@tonic-gate 	cfs_time_t time;	/* timestamp */
226*0Sstevel@tonic-gate 	uint64_t vfsp;		/* which filesystem */
227*0Sstevel@tonic-gate 	cfs_fid_t fid;		/* fid of directory being removed */
228*0Sstevel@tonic-gate 	ino64_t fileno;		/* fileno */
229*0Sstevel@tonic-gate 	cfs_uid_t uid;		/* uid of credential */
230*0Sstevel@tonic-gate };
231*0Sstevel@tonic-gate 
232*0Sstevel@tonic-gate struct cachefs_log_truncate_record {
233*0Sstevel@tonic-gate 	int type;		/* == CACHEFS_LOG_TRUNCATE */
234*0Sstevel@tonic-gate 	int error;		/* errno */
235*0Sstevel@tonic-gate 	cfs_time_t time;	/* timestamp */
236*0Sstevel@tonic-gate 	uint64_t vfsp;		/* which filesystem */
237*0Sstevel@tonic-gate 	cfs_fid_t fid;		/* file being truncated */
238*0Sstevel@tonic-gate 	ino64_t fileno;		/* fileno */
239*0Sstevel@tonic-gate 	cfs_uid_t uid;		/* uid of credential */
240*0Sstevel@tonic-gate 	u_offset_t size;	/* new size */
241*0Sstevel@tonic-gate };
242*0Sstevel@tonic-gate 
243*0Sstevel@tonic-gate struct cachefs_log_putpage_record {
244*0Sstevel@tonic-gate 	int type;		/* == CACHEFS_LOG_PUTPAGE */
245*0Sstevel@tonic-gate 	int error;		/* errno */
246*0Sstevel@tonic-gate 	cfs_time_t time;	/* timestamp */
247*0Sstevel@tonic-gate 	uint64_t vfsp;		/* which filesystem */
248*0Sstevel@tonic-gate 	cfs_fid_t fid;		/* file being written */
249*0Sstevel@tonic-gate 	ino64_t fileno;		/* fileno */
250*0Sstevel@tonic-gate 	cfs_uid_t uid;		/* uid of credential */
251*0Sstevel@tonic-gate 	u_offset_t offset;	/* offset */
252*0Sstevel@tonic-gate 	uint_t len;		/* length */
253*0Sstevel@tonic-gate };
254*0Sstevel@tonic-gate 
255*0Sstevel@tonic-gate struct cachefs_log_create_record {
256*0Sstevel@tonic-gate 	int type;		/* == CACHEFS_LOG_CREATE */
257*0Sstevel@tonic-gate 	int error;		/* errno */
258*0Sstevel@tonic-gate 	cfs_time_t time;	/* timestamp */
259*0Sstevel@tonic-gate 	uint64_t vfsp;		/* which filesystem */
260*0Sstevel@tonic-gate 	cfs_fid_t fid;		/* fid of newly created file */
261*0Sstevel@tonic-gate 	ino64_t fileno;		/* fileno */
262*0Sstevel@tonic-gate 	cfs_uid_t uid;		/* uid of credential */
263*0Sstevel@tonic-gate };
264*0Sstevel@tonic-gate 
265*0Sstevel@tonic-gate struct cachefs_log_mkdir_record {
266*0Sstevel@tonic-gate 	int type;		/* == CACHEFS_LOG_MKDIR */
267*0Sstevel@tonic-gate 	int error;		/* errno */
268*0Sstevel@tonic-gate 	cfs_time_t time;	/* timestamp */
269*0Sstevel@tonic-gate 	uint64_t vfsp;		/* which filesystem */
270*0Sstevel@tonic-gate 	cfs_fid_t fid;		/* fid of newly created directory */
271*0Sstevel@tonic-gate 	ino64_t fileno;		/* fileno */
272*0Sstevel@tonic-gate 	cfs_uid_t uid;		/* uid of credential */
273*0Sstevel@tonic-gate };
274*0Sstevel@tonic-gate 
275*0Sstevel@tonic-gate struct cachefs_log_rename_record {
276*0Sstevel@tonic-gate 	int type;		/* == CACHEFS_LOG_RENAME */
277*0Sstevel@tonic-gate 	int error;		/* errno */
278*0Sstevel@tonic-gate 	cfs_time_t time;	/* timestamp */
279*0Sstevel@tonic-gate 	uint64_t vfsp;		/* which filesystem */
280*0Sstevel@tonic-gate 	cfs_fid_t gone;		/* fid of file removed (may be undefined) */
281*0Sstevel@tonic-gate 	ino64_t fileno;		/* fileno */
282*0Sstevel@tonic-gate 	int removed;		/* nonzero if file was removed */
283*0Sstevel@tonic-gate 	cfs_uid_t uid;		/* uid of credential */
284*0Sstevel@tonic-gate };
285*0Sstevel@tonic-gate 
286*0Sstevel@tonic-gate struct cachefs_log_symlink_record {
287*0Sstevel@tonic-gate 	int type;		/* == CACHEFS_LOG_SYMLINK */
288*0Sstevel@tonic-gate 	int error;		/* errno */
289*0Sstevel@tonic-gate 	cfs_time_t time;	/* timestamp */
290*0Sstevel@tonic-gate 	uint64_t vfsp;		/* which filesystem */
291*0Sstevel@tonic-gate 	cfs_fid_t fid;		/* fid of newly created symlink */
292*0Sstevel@tonic-gate 	ino64_t fileno;		/* fileno */
293*0Sstevel@tonic-gate 	uint_t size;		/* size of newly created symlink */
294*0Sstevel@tonic-gate 	cfs_uid_t uid;		/* uid of credential */
295*0Sstevel@tonic-gate };
296*0Sstevel@tonic-gate 
297*0Sstevel@tonic-gate struct cachefs_log_populate_record {
298*0Sstevel@tonic-gate 	int type;		/* == CACHEFS_LOG_POPULATE */
299*0Sstevel@tonic-gate 	int error;		/* errno */
300*0Sstevel@tonic-gate 	cfs_time_t time;	/* timestamp */
301*0Sstevel@tonic-gate 	uint64_t vfsp;		/* which filesystem */
302*0Sstevel@tonic-gate 	cfs_fid_t fid;		/* fid of file being populated */
303*0Sstevel@tonic-gate 	ino64_t fileno;		/* fileno */
304*0Sstevel@tonic-gate 	u_offset_t off;		/* offset */
305*0Sstevel@tonic-gate 	uint_t size;		/* popsize */
306*0Sstevel@tonic-gate };
307*0Sstevel@tonic-gate 
308*0Sstevel@tonic-gate struct cachefs_log_csymlink_record {
309*0Sstevel@tonic-gate 	int type;		/* == CACHEFS_LOG_CSYMLINK */
310*0Sstevel@tonic-gate 	int error;		/* errno */
311*0Sstevel@tonic-gate 	cfs_time_t time;	/* timestamp */
312*0Sstevel@tonic-gate 	uint64_t vfsp;		/* which filesystem */
313*0Sstevel@tonic-gate 	cfs_fid_t fid;		/* fid of symlink being cached */
314*0Sstevel@tonic-gate 	ino64_t fileno;		/* fileno */
315*0Sstevel@tonic-gate 	int size;		/* size of symlink being cached */
316*0Sstevel@tonic-gate };
317*0Sstevel@tonic-gate 
318*0Sstevel@tonic-gate struct cachefs_log_filldir_record {
319*0Sstevel@tonic-gate 	int type;		/* == CACHEFS_LOG_FILLDIR */
320*0Sstevel@tonic-gate 	int error;		/* errno */
321*0Sstevel@tonic-gate 	cfs_time_t time;	/* timestamp */
322*0Sstevel@tonic-gate 	uint64_t vfsp;		/* which filesystem */
323*0Sstevel@tonic-gate 	cfs_fid_t fid;		/* fid of directory being filled */
324*0Sstevel@tonic-gate 	ino64_t fileno;		/* fileno */
325*0Sstevel@tonic-gate 	int size;		/* size of frontfile after filling */
326*0Sstevel@tonic-gate };
327*0Sstevel@tonic-gate 
328*0Sstevel@tonic-gate struct cachefs_log_mdcreate_record {
329*0Sstevel@tonic-gate 	int type;		/* == CACHEFS_LOG_MDCREATE */
330*0Sstevel@tonic-gate 	int error;		/* errno */
331*0Sstevel@tonic-gate 	cfs_time_t time;	/* timestamp */
332*0Sstevel@tonic-gate 	uint64_t vfsp;		/* which filesystem */
333*0Sstevel@tonic-gate 	cfs_fid_t fid;		/* fid of file for whom md slot is created */
334*0Sstevel@tonic-gate 	ino64_t fileno;		/* fileno */
335*0Sstevel@tonic-gate 	uint_t count;		/* new number of entries in attrcache */
336*0Sstevel@tonic-gate };
337*0Sstevel@tonic-gate 
338*0Sstevel@tonic-gate struct cachefs_log_gpfront_record {
339*0Sstevel@tonic-gate 	int type;		/* == CACHEFS_LOG_GPFRONT */
340*0Sstevel@tonic-gate 	int error;		/* errno */
341*0Sstevel@tonic-gate 	cfs_time_t time;	/* timestamp */
342*0Sstevel@tonic-gate 	uint64_t vfsp;		/* which filesystem */
343*0Sstevel@tonic-gate 	cfs_fid_t fid;		/* fid of file for whom md slot is created */
344*0Sstevel@tonic-gate 	ino64_t fileno;		/* fileno */
345*0Sstevel@tonic-gate 	cfs_uid_t uid;		/* uid of credential */
346*0Sstevel@tonic-gate 	u_offset_t off;		/* offset */
347*0Sstevel@tonic-gate 	uint_t len;		/* length */
348*0Sstevel@tonic-gate };
349*0Sstevel@tonic-gate 
350*0Sstevel@tonic-gate struct cachefs_log_rfdir_record {
351*0Sstevel@tonic-gate 	int type;		/* == CACHEFS_LOG_GPFRONT */
352*0Sstevel@tonic-gate 	int error;		/* errno */
353*0Sstevel@tonic-gate 	cfs_time_t time;	/* timestamp */
354*0Sstevel@tonic-gate 	uint64_t vfsp;		/* which filesystem */
355*0Sstevel@tonic-gate 	cfs_fid_t fid;		/* fid of directory */
356*0Sstevel@tonic-gate 	ino64_t fileno;		/* fileno */
357*0Sstevel@tonic-gate 	cfs_uid_t uid;		/* uid of credential */
358*0Sstevel@tonic-gate };
359*0Sstevel@tonic-gate 
360*0Sstevel@tonic-gate struct cachefs_log_ualloc_record {
361*0Sstevel@tonic-gate 	int type;		/* == CACHEFS_LOG_UALLOC */
362*0Sstevel@tonic-gate 	int error;		/* errno */
363*0Sstevel@tonic-gate 	cfs_time_t time;	/* timestamp */
364*0Sstevel@tonic-gate 	uint64_t vfsp;		/* which filesystem */
365*0Sstevel@tonic-gate 	cfs_fid_t fid;		/* fid of allocmap-updated file */
366*0Sstevel@tonic-gate 	ino64_t fileno;		/* fileno of allocmap-updated file */
367*0Sstevel@tonic-gate 	u_offset_t off;		/* offset of new area */
368*0Sstevel@tonic-gate 	uint_t len;		/* length of new area */
369*0Sstevel@tonic-gate };
370*0Sstevel@tonic-gate 
371*0Sstevel@tonic-gate struct cachefs_log_calloc_record {
372*0Sstevel@tonic-gate 	int type;		/* == CACHEFS_LOG_CALLOC */
373*0Sstevel@tonic-gate 	int error;		/* errno */
374*0Sstevel@tonic-gate 	cfs_time_t time;	/* timestamp */
375*0Sstevel@tonic-gate 	uint64_t vfsp;		/* which filesystem */
376*0Sstevel@tonic-gate 	cfs_fid_t fid;		/* fid of allocmap-checked file */
377*0Sstevel@tonic-gate 	ino64_t fileno;		/* fileno of allocmap-checked file */
378*0Sstevel@tonic-gate 	u_offset_t off;		/* offset of successful check_allocmap */
379*0Sstevel@tonic-gate 	uint_t len;		/* length of successful check_allocmap */
380*0Sstevel@tonic-gate };
381*0Sstevel@tonic-gate 
382*0Sstevel@tonic-gate struct cachefs_log_nocache_record {
383*0Sstevel@tonic-gate 	int type;		/* == CACHEFS_LOG_NOCACHE */
384*0Sstevel@tonic-gate 	int error;		/* errno */
385*0Sstevel@tonic-gate 	cfs_time_t time;	/* timestamp */
386*0Sstevel@tonic-gate 	uint64_t vfsp;		/* which filesystem */
387*0Sstevel@tonic-gate 	cfs_fid_t fid;		/* fid of file being nocached */
388*0Sstevel@tonic-gate 	ino64_t fileno;		/* fileno of file being nocached */
389*0Sstevel@tonic-gate };
390*0Sstevel@tonic-gate 
391*0Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
392*0Sstevel@tonic-gate #pragma pack()
393*0Sstevel@tonic-gate #endif
394*0Sstevel@tonic-gate 
395*0Sstevel@tonic-gate #ifdef __cplusplus
396*0Sstevel@tonic-gate }
397*0Sstevel@tonic-gate #endif
398*0Sstevel@tonic-gate 
399*0Sstevel@tonic-gate 
400*0Sstevel@tonic-gate #endif /* _SYS_FS_CACHEFS_LOG_H */
401