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