xref: /titanic_44/usr/src/uts/common/sys/fs/cachefs_dlog.h (revision ba3594ba9b5dd4c846c472a8d657edcb7c8109ac)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
57c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
67c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
77c478bd9Sstevel@tonic-gate  * with the License.
87c478bd9Sstevel@tonic-gate  *
97c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
117c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
127c478bd9Sstevel@tonic-gate  * and limitations under the License.
137c478bd9Sstevel@tonic-gate  *
147c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
157c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
177c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
187c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
197c478bd9Sstevel@tonic-gate  *
207c478bd9Sstevel@tonic-gate  * CDDL HEADER END
217c478bd9Sstevel@tonic-gate  */
227c478bd9Sstevel@tonic-gate /*
23*ba3594baSGarrett D'Amore  * Copyright 2014 Garrett D'Amore <garrett@damore.org>
24*ba3594baSGarrett D'Amore  *
257c478bd9Sstevel@tonic-gate  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
267c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
277c478bd9Sstevel@tonic-gate  */
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate #ifndef	_SYS_FS_CACHEFS_DLOG_H
307c478bd9Sstevel@tonic-gate #define	_SYS_FS_CACHEFS_DLOG_H
317c478bd9Sstevel@tonic-gate 
327c478bd9Sstevel@tonic-gate #include <sys/vfs.h>
337c478bd9Sstevel@tonic-gate #include <sys/acl.h>
347c478bd9Sstevel@tonic-gate 
357c478bd9Sstevel@tonic-gate #ifdef __cplusplus
367c478bd9Sstevel@tonic-gate extern "C" {
377c478bd9Sstevel@tonic-gate #endif
387c478bd9Sstevel@tonic-gate 
397c478bd9Sstevel@tonic-gate /*
407c478bd9Sstevel@tonic-gate  * Version number of log file format.
417c478bd9Sstevel@tonic-gate  * Put in an int at the start of the file.
427c478bd9Sstevel@tonic-gate  * Large Files: Increment VER by 1.
437c478bd9Sstevel@tonic-gate  */
447c478bd9Sstevel@tonic-gate #define	CFS_DLOG_VERSION 1001
457c478bd9Sstevel@tonic-gate 
467c478bd9Sstevel@tonic-gate /* valid types of dlog records */
477c478bd9Sstevel@tonic-gate enum cfs_dlog_op {
487c478bd9Sstevel@tonic-gate 	CFS_DLOG_CREATE = 0x100,
497c478bd9Sstevel@tonic-gate 	CFS_DLOG_REMOVE,
507c478bd9Sstevel@tonic-gate 	CFS_DLOG_LINK,
517c478bd9Sstevel@tonic-gate 	CFS_DLOG_RENAME,
527c478bd9Sstevel@tonic-gate 	CFS_DLOG_MKDIR,
537c478bd9Sstevel@tonic-gate 	CFS_DLOG_RMDIR,
547c478bd9Sstevel@tonic-gate 	CFS_DLOG_SYMLINK,
557c478bd9Sstevel@tonic-gate 	CFS_DLOG_SETATTR,
567c478bd9Sstevel@tonic-gate 	CFS_DLOG_SETSECATTR,
577c478bd9Sstevel@tonic-gate 	CFS_DLOG_MODIFIED,
587c478bd9Sstevel@tonic-gate 	CFS_DLOG_MAPFID,
597c478bd9Sstevel@tonic-gate 	CFS_DLOG_TRAILER
607c478bd9Sstevel@tonic-gate };
617c478bd9Sstevel@tonic-gate typedef enum cfs_dlog_op cfs_dlog_op_t;
627c478bd9Sstevel@tonic-gate 
637c478bd9Sstevel@tonic-gate /* validity of records */
647c478bd9Sstevel@tonic-gate enum cfs_dlog_val {
657c478bd9Sstevel@tonic-gate 	CFS_DLOG_VAL_CRASH = 0x200,	/* crash during record creation */
667c478bd9Sstevel@tonic-gate 	CFS_DLOG_VAL_COMMITTED,		/* valid record */
677c478bd9Sstevel@tonic-gate 	CFS_DLOG_VAL_ERROR,		/* error, operation not performed */
687c478bd9Sstevel@tonic-gate 	CFS_DLOG_VAL_PROCESSED		/* record processed */
697c478bd9Sstevel@tonic-gate };
707c478bd9Sstevel@tonic-gate typedef enum cfs_dlog_val cfs_dlog_val_t;
717c478bd9Sstevel@tonic-gate 
727c478bd9Sstevel@tonic-gate /* number of bytes for groups appended to a cred structure */
737c478bd9Sstevel@tonic-gate #define	CFS_DLOG_BUFSIZE (sizeof (gid_t) * (NGROUPS_MAX_DEFAULT - 1))
747c478bd9Sstevel@tonic-gate 
757c478bd9Sstevel@tonic-gate /* the old kernel credential; ossified on disk so we're stuck with this. */
767c478bd9Sstevel@tonic-gate typedef struct dl_cred {
777c478bd9Sstevel@tonic-gate 	uint_t	__ign1;			/* ignore (was ref count) */
787c478bd9Sstevel@tonic-gate 	uid_t	cr_uid;			/* effective user id */
797c478bd9Sstevel@tonic-gate 	gid_t	cr_gid;			/* effective group id */
807c478bd9Sstevel@tonic-gate 	uid_t	cr_ruid;		/* real user id */
817c478bd9Sstevel@tonic-gate 	gid_t	cr_rgid;		/* real group id */
827c478bd9Sstevel@tonic-gate 	uid_t	cr_suid;		/* "saved" user id (from exec) */
837c478bd9Sstevel@tonic-gate 	gid_t	cr_sgid;		/* "saved" group id (from exec) */
847c478bd9Sstevel@tonic-gate 	uint_t	cr_ngroups;		/* number of groups in cr_groups */
857c478bd9Sstevel@tonic-gate 	gid_t	cr_groups[1];		/* supplementary group list */
867c478bd9Sstevel@tonic-gate } dl_cred_t;
877c478bd9Sstevel@tonic-gate 
887c478bd9Sstevel@tonic-gate /*
897c478bd9Sstevel@tonic-gate  * cfs_dlog_mapping_space is stored on disk, so it needs to be the same
907c478bd9Sstevel@tonic-gate  * 32-bit vs. 64-bit. The other structures below are also stored on disk,
917c478bd9Sstevel@tonic-gate  * but they do not contain any 64-bit elements.
927c478bd9Sstevel@tonic-gate  */
937c478bd9Sstevel@tonic-gate 
947c478bd9Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
957c478bd9Sstevel@tonic-gate #pragma pack(4)
967c478bd9Sstevel@tonic-gate #endif
977c478bd9Sstevel@tonic-gate 
987c478bd9Sstevel@tonic-gate /* the basic elements in the mapping file */
997c478bd9Sstevel@tonic-gate struct cfs_dlog_mapping_space {
1007c478bd9Sstevel@tonic-gate 	cfs_cid_t	ms_cid;		/* mapping key */
1017c478bd9Sstevel@tonic-gate 	off_t		ms_fid;		/* offset to fid */
1027c478bd9Sstevel@tonic-gate 	off_t		ms_times;	/* offset to timestamps */
1037c478bd9Sstevel@tonic-gate };
1047c478bd9Sstevel@tonic-gate 
1057c478bd9Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1067c478bd9Sstevel@tonic-gate #pragma pack()
1077c478bd9Sstevel@tonic-gate #endif
1087c478bd9Sstevel@tonic-gate 
1097c478bd9Sstevel@tonic-gate /*
1107c478bd9Sstevel@tonic-gate  * XX64: For now we use the old time_t defs. In the next version the logs
1117c478bd9Sstevel@tonic-gate  * and on-disk structs may change to 64-bit. The structs here are used
1127c478bd9Sstevel@tonic-gate  * for the data log.
1137c478bd9Sstevel@tonic-gate  */
1147c478bd9Sstevel@tonic-gate /* mtime and ctime stamps */
1157c478bd9Sstevel@tonic-gate struct cfs_dlog_tm {
1167c478bd9Sstevel@tonic-gate 	cfs_timestruc_t	tm_mtime;	/* cached mtime on file */
1177c478bd9Sstevel@tonic-gate 	cfs_timestruc_t	tm_ctime;	/* cached ctime on file */
1187c478bd9Sstevel@tonic-gate };
1197c478bd9Sstevel@tonic-gate typedef struct cfs_dlog_tm cfs_dlog_tm_t;
1207c478bd9Sstevel@tonic-gate 
1217c478bd9Sstevel@tonic-gate /* structure populated for setattr */
1227c478bd9Sstevel@tonic-gate struct cfs_dlog_setattr {
1237c478bd9Sstevel@tonic-gate 	cfs_vattr_t	dl_attrs;	/* attrs to set file to */
1247c478bd9Sstevel@tonic-gate 	int		dl_flags;	/* flags used with setattr */
1257c478bd9Sstevel@tonic-gate 	cfs_cid_t	dl_cid;		/* cid of the file to setattr */
1267c478bd9Sstevel@tonic-gate 	cfs_dlog_tm_t	dl_times;	/* ctime and mtime on file */
1277c478bd9Sstevel@tonic-gate 	dl_cred_t	dl_cred;	/* creds used */
1287c478bd9Sstevel@tonic-gate 	char		dl_buffer[CFS_DLOG_BUFSIZE];	/* groups */
1297c478bd9Sstevel@tonic-gate };
1307c478bd9Sstevel@tonic-gate 
1317c478bd9Sstevel@tonic-gate /* structure for setsecattr (aka setting an ACL) */
1327c478bd9Sstevel@tonic-gate /* n.b. data for this can exceed sizeof this struct, due to 24k ACLs! */
1337c478bd9Sstevel@tonic-gate struct cfs_dlog_setsecattr {
1347c478bd9Sstevel@tonic-gate 	cfs_cid_t	dl_cid;		/* cid of file to setsecattr */
1357c478bd9Sstevel@tonic-gate 	cfs_dlog_tm_t	dl_times;	/* ctime and mtime on file */
1367c478bd9Sstevel@tonic-gate 	uint_t		dl_mask;	/* mask field in vsecattr_t */
1377c478bd9Sstevel@tonic-gate 	int		dl_aclcnt;	/* count of ACLs */
1387c478bd9Sstevel@tonic-gate 	int		dl_dfaclcnt;	/* count of default ACLs */
1397c478bd9Sstevel@tonic-gate 	dl_cred_t	dl_cred;	/* creds used */
1407c478bd9Sstevel@tonic-gate 	char		dl_buffer[CFS_DLOG_BUFSIZE]; /* groups + ACLs */
1417c478bd9Sstevel@tonic-gate };
1427c478bd9Sstevel@tonic-gate 
1437c478bd9Sstevel@tonic-gate /* structure populated for creates */
1447c478bd9Sstevel@tonic-gate struct cfs_dlog_create {
1457c478bd9Sstevel@tonic-gate 	cfs_cid_t	dl_parent_cid;	/* parent directory cid */
1467c478bd9Sstevel@tonic-gate 	cfs_cid_t	dl_new_cid;	/* cid of the created file */
1477c478bd9Sstevel@tonic-gate 	cfs_vattr_t	dl_attrs;	/* attrs to create with */
1487c478bd9Sstevel@tonic-gate 	int		dl_excl;	/* exclusive mode flag */
1497c478bd9Sstevel@tonic-gate 	int		dl_mode;	/* mode bits for created file */
1507c478bd9Sstevel@tonic-gate 	int		dl_exists;	/* does file already exist? */
1517c478bd9Sstevel@tonic-gate 	cfs_dlog_tm_t	dl_times;	/* ctime and mtime on file */
1527c478bd9Sstevel@tonic-gate 	cfs_fid_t	dl_fid;		/* blank fid */
1537c478bd9Sstevel@tonic-gate 	dl_cred_t	dl_cred;	/* user credentials */
1547c478bd9Sstevel@tonic-gate 	char		dl_buffer[CFS_DLOG_BUFSIZE + MAXNAMELEN];
1557c478bd9Sstevel@tonic-gate };
1567c478bd9Sstevel@tonic-gate 
1577c478bd9Sstevel@tonic-gate /* struct used for remove */
1587c478bd9Sstevel@tonic-gate struct cfs_dlog_remove {
1597c478bd9Sstevel@tonic-gate 	cfs_cid_t	dl_parent_cid;	/* parent directory cid */
1607c478bd9Sstevel@tonic-gate 	cfs_cid_t	dl_child_cid;	/* cid of entry that was removed */
1617c478bd9Sstevel@tonic-gate 	cfs_dlog_tm_t	dl_times;	/* ctime and mtime on file */
1627c478bd9Sstevel@tonic-gate 	dl_cred_t	dl_cred;	/* credentials to use */
1637c478bd9Sstevel@tonic-gate 	char		dl_buffer[CFS_DLOG_BUFSIZE + MAXNAMELEN];
1647c478bd9Sstevel@tonic-gate };
1657c478bd9Sstevel@tonic-gate 
1667c478bd9Sstevel@tonic-gate /* struct used for rmdir */
1677c478bd9Sstevel@tonic-gate struct cfs_dlog_rmdir {
1687c478bd9Sstevel@tonic-gate 	cfs_cid_t	dl_parent_cid;	/* parent directory cid */
1697c478bd9Sstevel@tonic-gate 	dl_cred_t	dl_cred;	/* credentials to use */
1707c478bd9Sstevel@tonic-gate 	char		dl_buffer[CFS_DLOG_BUFSIZE + MAXNAMELEN];
1717c478bd9Sstevel@tonic-gate };
1727c478bd9Sstevel@tonic-gate 
1737c478bd9Sstevel@tonic-gate /* struct used for mkdir */
1747c478bd9Sstevel@tonic-gate struct cfs_dlog_mkdir {
1757c478bd9Sstevel@tonic-gate 	cfs_cid_t	dl_parent_cid;	/* parent directory cid */
1767c478bd9Sstevel@tonic-gate 	cfs_cid_t	dl_child_cid;	/* cid of created entry */
1777c478bd9Sstevel@tonic-gate 	cfs_vattr_t	dl_attrs;	/* attrs to insert with */
1787c478bd9Sstevel@tonic-gate 	cfs_fid_t	dl_fid;		/* blank fid */
1797c478bd9Sstevel@tonic-gate 	dl_cred_t	dl_cred;	/* credentials to use */
1807c478bd9Sstevel@tonic-gate 	char		dl_buffer[CFS_DLOG_BUFSIZE + MAXNAMELEN];
1817c478bd9Sstevel@tonic-gate };
1827c478bd9Sstevel@tonic-gate 
1837c478bd9Sstevel@tonic-gate /* struct used for link */
1847c478bd9Sstevel@tonic-gate struct cfs_dlog_link {
1857c478bd9Sstevel@tonic-gate 	cfs_cid_t	dl_parent_cid;	/* parent directory cid */
1867c478bd9Sstevel@tonic-gate 	cfs_cid_t	dl_child_cid;	/* cid of created entry */
1877c478bd9Sstevel@tonic-gate 	cfs_dlog_tm_t	dl_times;	/* ctime and mtime on file */
1887c478bd9Sstevel@tonic-gate 	dl_cred_t	dl_cred;	/* credentials to use */
1897c478bd9Sstevel@tonic-gate 	char		dl_buffer[CFS_DLOG_BUFSIZE + MAXNAMELEN];
1907c478bd9Sstevel@tonic-gate };
1917c478bd9Sstevel@tonic-gate 
1927c478bd9Sstevel@tonic-gate /* struct used for symlink */
1937c478bd9Sstevel@tonic-gate struct cfs_dlog_symlink {
1947c478bd9Sstevel@tonic-gate 	cfs_cid_t	dl_parent_cid;	/* parent directory cid */
1957c478bd9Sstevel@tonic-gate 	cfs_cid_t	dl_child_cid;	/* cid of created entry */
1967c478bd9Sstevel@tonic-gate 	cfs_vattr_t	dl_attrs;	/* attrs to insert with */
1977c478bd9Sstevel@tonic-gate 	cfs_dlog_tm_t	dl_times;	/* ctime and mtime on file */
1987c478bd9Sstevel@tonic-gate 	cfs_fid_t	dl_fid;		/* blank fid */
1997c478bd9Sstevel@tonic-gate 	dl_cred_t	dl_cred;	/* credentials to use */
2007c478bd9Sstevel@tonic-gate 	char		dl_buffer[CFS_DLOG_BUFSIZE + MAXNAMELEN + MAXPATHLEN];
2017c478bd9Sstevel@tonic-gate };
2027c478bd9Sstevel@tonic-gate 
2037c478bd9Sstevel@tonic-gate struct cfs_dlog_rename {
2047c478bd9Sstevel@tonic-gate 	cfs_cid_t	dl_oparent_cid; /* cid of the original parent dir */
2057c478bd9Sstevel@tonic-gate 	cfs_cid_t	dl_nparent_cid;	/* cid of the new parent dir */
2067c478bd9Sstevel@tonic-gate 	cfs_cid_t	dl_child_cid;	/* cid of renamed file */
2077c478bd9Sstevel@tonic-gate 	cfs_dlog_tm_t	dl_times;	/* ctime and mtime on file */
2087c478bd9Sstevel@tonic-gate 	cfs_cid_t	dl_del_cid;	/* cid of deleted file */
2097c478bd9Sstevel@tonic-gate 	cfs_dlog_tm_t	dl_del_times;	/* ctime and mtime on deleted file */
2107c478bd9Sstevel@tonic-gate 	dl_cred_t	dl_cred;	/* credentials to use */
2117c478bd9Sstevel@tonic-gate 	char		dl_buffer[CFS_DLOG_BUFSIZE + (2 * MAXNAMELEN)];
2127c478bd9Sstevel@tonic-gate };
2137c478bd9Sstevel@tonic-gate 
2147c478bd9Sstevel@tonic-gate struct cfs_dlog_modify {
2157c478bd9Sstevel@tonic-gate 	cfs_cid_t	dl_cid;		/* cid of modified file */
2167c478bd9Sstevel@tonic-gate 	cfs_dlog_tm_t	dl_times;	/* ctime and mtime on file */
2177c478bd9Sstevel@tonic-gate 	off32_t		dl_next;	/* daemon links modifies together */
2187c478bd9Sstevel@tonic-gate 	dl_cred_t	dl_cred;	/* credentials to use */
2197c478bd9Sstevel@tonic-gate 	char		dl_buffer[CFS_DLOG_BUFSIZE];	/* groups */
2207c478bd9Sstevel@tonic-gate };
2217c478bd9Sstevel@tonic-gate 
2227c478bd9Sstevel@tonic-gate struct cfs_dlog_mapfid {
2237c478bd9Sstevel@tonic-gate 	cfs_cid_t	dl_cid;		/* cid of file */
2247c478bd9Sstevel@tonic-gate 	cfs_fid_t	dl_fid;		/* fid of file */
2257c478bd9Sstevel@tonic-gate };
2267c478bd9Sstevel@tonic-gate 
2277c478bd9Sstevel@tonic-gate #define	COMMON_RECORD_HDR()  						\
2287c478bd9Sstevel@tonic-gate 	int		dl_len;		/* length of this record */	\
2297c478bd9Sstevel@tonic-gate 	cfs_dlog_op_t 	dl_op;		/* operation */			\
2307c478bd9Sstevel@tonic-gate 	cfs_dlog_val_t 	dl_valid;	/* validity of operation */	\
2317c478bd9Sstevel@tonic-gate 	uint_t		dl_seq;		/* sequence number */
2327c478bd9Sstevel@tonic-gate 
2337c478bd9Sstevel@tonic-gate /*
2347c478bd9Sstevel@tonic-gate  * The trailer record must look just like the beginning of a record.
2357c478bd9Sstevel@tonic-gate  * This allows the cachefs daemon to throw it away(not process the record)
2367c478bd9Sstevel@tonic-gate  * with very little additional code.
2377c478bd9Sstevel@tonic-gate  */
2387c478bd9Sstevel@tonic-gate struct cfs_dlog_trailer {
2397c478bd9Sstevel@tonic-gate 	COMMON_RECORD_HDR()
2407c478bd9Sstevel@tonic-gate };
2417c478bd9Sstevel@tonic-gate 
2427c478bd9Sstevel@tonic-gate struct cfs_dlog_entry {
2437c478bd9Sstevel@tonic-gate 	COMMON_RECORD_HDR()
2447c478bd9Sstevel@tonic-gate 
2457c478bd9Sstevel@tonic-gate 	union cfs_dlog_entry_items {
2467c478bd9Sstevel@tonic-gate 		struct cfs_dlog_setattr		dl_setattr;
2477c478bd9Sstevel@tonic-gate 		struct cfs_dlog_setsecattr	dl_setsecattr;
2487c478bd9Sstevel@tonic-gate 		struct cfs_dlog_create		dl_create;
2497c478bd9Sstevel@tonic-gate 		struct cfs_dlog_remove		dl_remove;
2507c478bd9Sstevel@tonic-gate 		struct cfs_dlog_rmdir		dl_rmdir;
2517c478bd9Sstevel@tonic-gate 		struct cfs_dlog_mkdir		dl_mkdir;
2527c478bd9Sstevel@tonic-gate 		struct cfs_dlog_link		dl_link;
2537c478bd9Sstevel@tonic-gate 		struct cfs_dlog_symlink		dl_symlink;
2547c478bd9Sstevel@tonic-gate 		struct cfs_dlog_rename		dl_rename;
2557c478bd9Sstevel@tonic-gate 		struct cfs_dlog_modify		dl_modify;
2567c478bd9Sstevel@tonic-gate 		struct cfs_dlog_mapfid		dl_mapfid;
2577c478bd9Sstevel@tonic-gate 	} dl_u;
2587c478bd9Sstevel@tonic-gate 
2597c478bd9Sstevel@tonic-gate 	struct cfs_dlog_trailer dl_trailer;
2607c478bd9Sstevel@tonic-gate };
2617c478bd9Sstevel@tonic-gate typedef struct cfs_dlog_entry cfs_dlog_entry_t;
2627c478bd9Sstevel@tonic-gate 
2637c478bd9Sstevel@tonic-gate /*
2647c478bd9Sstevel@tonic-gate  * XXXX the maxsize calculation below will give wrong answer if
2657c478bd9Sstevel@tonic-gate  * the total size of struct cfs_dlog_setsecattr + max aclsize is less than
2667c478bd9Sstevel@tonic-gate  * the size of the union above. This is currently true, but to be on the safe
2677c478bd9Sstevel@tonic-gate  * side, use struct size plus acl size (minus trailer because it's not
2687c478bd9Sstevel@tonic-gate  * not counted in the length field).
2697c478bd9Sstevel@tonic-gate  */
2707c478bd9Sstevel@tonic-gate #define	CFS_DLOG_SECATTR_MAXSIZE (sizeof (struct cfs_dlog_setsecattr) + \
2717c478bd9Sstevel@tonic-gate 	(sizeof (aclent_t) * MAX_ACL_ENTRIES))
2727c478bd9Sstevel@tonic-gate 
2737c478bd9Sstevel@tonic-gate #ifndef MAX
2747c478bd9Sstevel@tonic-gate #define	MAX(a, b)	(((a) > (b)) ? (a) : (b))
2757c478bd9Sstevel@tonic-gate #endif /* MAX */
2767c478bd9Sstevel@tonic-gate 
2777c478bd9Sstevel@tonic-gate #define	CFS_DLOG_ENTRY_MAXSIZE	\
2787c478bd9Sstevel@tonic-gate 	MAX(offsetof(struct cfs_dlog_entry, dl_trailer),		\
2797c478bd9Sstevel@tonic-gate 	    offsetof(struct cfs_dlog_entry, dl_u.dl_setsecattr) +	\
2807c478bd9Sstevel@tonic-gate 	    CFS_DLOG_SECATTR_MAXSIZE)
2817c478bd9Sstevel@tonic-gate 
282*ba3594baSGarrett D'Amore #if defined(_KERNEL)
2837c478bd9Sstevel@tonic-gate int cachefs_dlog_setup(fscache_t *fscp, int createfile);
2847c478bd9Sstevel@tonic-gate void cachefs_dlog_teardown(fscache_t *fscp);
2857c478bd9Sstevel@tonic-gate int cachefs_dlog_commit(fscache_t *fscp, off_t offset, int error);
2867c478bd9Sstevel@tonic-gate int cachefs_dlog_cidmap(fscache_t *fscp);
2877c478bd9Sstevel@tonic-gate off_t cachefs_dlog_setattr(fscache_t *fscp, struct vattr *vap, int flags,
2887c478bd9Sstevel@tonic-gate     cnode_t *cp, cred_t *cr);
2897c478bd9Sstevel@tonic-gate off_t
2907c478bd9Sstevel@tonic-gate cachefs_dlog_setsecattr(fscache_t *fscp, vsecattr_t *vsec, int flags,
2917c478bd9Sstevel@tonic-gate     cnode_t *cp, cred_t *cr);
2927c478bd9Sstevel@tonic-gate off_t cachefs_dlog_create(fscache_t *fscp, cnode_t *pcp, char *nm,
2937c478bd9Sstevel@tonic-gate     vattr_t *vap, int excl, int mode, cnode_t *cp, int exists, cred_t *cr);
2947c478bd9Sstevel@tonic-gate off_t cachefs_dlog_remove(fscache_t *fscp, cnode_t *pcp, char *nm, cnode_t *cp,
2957c478bd9Sstevel@tonic-gate     cred_t *cr);
2967c478bd9Sstevel@tonic-gate off_t cachefs_dlog_link(fscache_t *fscp, cnode_t *pcp, char *nm, cnode_t *cp,
2977c478bd9Sstevel@tonic-gate     cred_t *cr);
2987c478bd9Sstevel@tonic-gate off_t cachefs_dlog_rename(fscache_t *fscp, cnode_t *odcp, char *onm,
2997c478bd9Sstevel@tonic-gate     cnode_t *ndcp, char *nnm, cred_t *cr, cnode_t *cp, cnode_t *delcp);
3007c478bd9Sstevel@tonic-gate off_t cachefs_dlog_mkdir(fscache_t *fscp, cnode_t *pcp, cnode_t *cp, char *nm,
3017c478bd9Sstevel@tonic-gate     vattr_t *vap, cred_t *cr);
3027c478bd9Sstevel@tonic-gate off_t cachefs_dlog_rmdir(fscache_t *fscp, cnode_t *pcp, char *nm, cnode_t *cp,
3037c478bd9Sstevel@tonic-gate     cred_t *cr);
3047c478bd9Sstevel@tonic-gate off_t cachefs_dlog_symlink(fscache_t *fscp, cnode_t *pcp, cnode_t *cp,
3057c478bd9Sstevel@tonic-gate     char *lnm, vattr_t *vap, char *tnm, cred_t *cr);
3067c478bd9Sstevel@tonic-gate off_t cachefs_dlog_modify(fscache_t *fscp, cnode_t *cp, cred_t *cr,
3077c478bd9Sstevel@tonic-gate     uint_t *seqp);
3087c478bd9Sstevel@tonic-gate int cachefs_dlog_mapfid(fscache_t *fscp, cnode_t *cp);
3097c478bd9Sstevel@tonic-gate uint_t cachefs_dlog_seqnext(fscache_t *fscp);
3107c478bd9Sstevel@tonic-gate #endif
3117c478bd9Sstevel@tonic-gate 
3127c478bd9Sstevel@tonic-gate #ifdef __cplusplus
3137c478bd9Sstevel@tonic-gate }
3147c478bd9Sstevel@tonic-gate #endif
3157c478bd9Sstevel@tonic-gate 
3167c478bd9Sstevel@tonic-gate #endif	/* _SYS_FS_CACHEFS_DLOG_H */
317