xref: /freebsd-src/sys/contrib/openzfs/include/sys/zfs_znode.h (revision 7a7741af18d6c8a804cc643cb7ecda9d730c6aa6)
1eda14cbcSMatt Macy /*
2eda14cbcSMatt Macy  * CDDL HEADER START
3eda14cbcSMatt Macy  *
4eda14cbcSMatt Macy  * The contents of this file are subject to the terms of the
5eda14cbcSMatt Macy  * Common Development and Distribution License (the "License").
6eda14cbcSMatt Macy  * You may not use this file except in compliance with the License.
7eda14cbcSMatt Macy  *
8eda14cbcSMatt Macy  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9271171e0SMartin Matuska  * or https://opensource.org/licenses/CDDL-1.0.
10eda14cbcSMatt Macy  * See the License for the specific language governing permissions
11eda14cbcSMatt Macy  * and limitations under the License.
12eda14cbcSMatt Macy  *
13eda14cbcSMatt Macy  * When distributing Covered Code, include this CDDL HEADER in each
14eda14cbcSMatt Macy  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15eda14cbcSMatt Macy  * If applicable, add the following below this CDDL HEADER, with the
16eda14cbcSMatt Macy  * fields enclosed by brackets "[]" replaced with your own identifying
17eda14cbcSMatt Macy  * information: Portions Copyright [yyyy] [name of copyright owner]
18eda14cbcSMatt Macy  *
19eda14cbcSMatt Macy  * CDDL HEADER END
20eda14cbcSMatt Macy  */
21eda14cbcSMatt Macy /*
22eda14cbcSMatt Macy  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23eda14cbcSMatt Macy  * Copyright (c) 2012, 2018 by Delphix. All rights reserved.
24eda14cbcSMatt Macy  * Copyright 2016 Nexenta Systems, Inc. All rights reserved.
25eda14cbcSMatt Macy  */
26eda14cbcSMatt Macy 
27eda14cbcSMatt Macy #ifndef	_SYS_FS_ZFS_ZNODE_H
28eda14cbcSMatt Macy #define	_SYS_FS_ZFS_ZNODE_H
29eda14cbcSMatt Macy 
30eda14cbcSMatt Macy #include <sys/zfs_acl.h>
31eda14cbcSMatt Macy #include <sys/zil.h>
32eda14cbcSMatt Macy #include <sys/zfs_project.h>
33eda14cbcSMatt Macy 
34eda14cbcSMatt Macy #ifdef	__cplusplus
35eda14cbcSMatt Macy extern "C" {
36eda14cbcSMatt Macy #endif
37eda14cbcSMatt Macy 
38eda14cbcSMatt Macy /*
39eda14cbcSMatt Macy  * Additional file level attributes, that are stored
40c03c5b1cSMartin Matuska  * in the upper half of z_pflags
41eda14cbcSMatt Macy  */
42eda14cbcSMatt Macy #define	ZFS_READONLY		0x0000000100000000ull
43eda14cbcSMatt Macy #define	ZFS_HIDDEN		0x0000000200000000ull
44eda14cbcSMatt Macy #define	ZFS_SYSTEM		0x0000000400000000ull
45eda14cbcSMatt Macy #define	ZFS_ARCHIVE		0x0000000800000000ull
46eda14cbcSMatt Macy #define	ZFS_IMMUTABLE		0x0000001000000000ull
47eda14cbcSMatt Macy #define	ZFS_NOUNLINK		0x0000002000000000ull
48eda14cbcSMatt Macy #define	ZFS_APPENDONLY		0x0000004000000000ull
49eda14cbcSMatt Macy #define	ZFS_NODUMP		0x0000008000000000ull
50eda14cbcSMatt Macy #define	ZFS_OPAQUE		0x0000010000000000ull
51eda14cbcSMatt Macy #define	ZFS_AV_QUARANTINED	0x0000020000000000ull
52eda14cbcSMatt Macy #define	ZFS_AV_MODIFIED		0x0000040000000000ull
53eda14cbcSMatt Macy #define	ZFS_REPARSE		0x0000080000000000ull
54eda14cbcSMatt Macy #define	ZFS_OFFLINE		0x0000100000000000ull
55eda14cbcSMatt Macy #define	ZFS_SPARSE		0x0000200000000000ull
56eda14cbcSMatt Macy 
57eda14cbcSMatt Macy /*
58eda14cbcSMatt Macy  * PROJINHERIT attribute is used to indicate that the child object under the
59eda14cbcSMatt Macy  * directory which has the PROJINHERIT attribute needs to inherit its parent
60eda14cbcSMatt Macy  * project ID that is used by project quota.
61eda14cbcSMatt Macy  */
62eda14cbcSMatt Macy #define	ZFS_PROJINHERIT		0x0000400000000000ull
63eda14cbcSMatt Macy 
64eda14cbcSMatt Macy /*
65eda14cbcSMatt Macy  * PROJID attr is used internally to indicate that the object has project ID.
66eda14cbcSMatt Macy  */
67eda14cbcSMatt Macy #define	ZFS_PROJID		0x0000800000000000ull
68eda14cbcSMatt Macy 
69eda14cbcSMatt Macy #define	ZFS_ATTR_SET(zp, attr, value, pflags, tx) \
70eda14cbcSMatt Macy { \
71eda14cbcSMatt Macy 	if (value) \
72eda14cbcSMatt Macy 		pflags |= attr; \
73eda14cbcSMatt Macy 	else \
74eda14cbcSMatt Macy 		pflags &= ~attr; \
75eda14cbcSMatt Macy 	VERIFY(0 == sa_update(zp->z_sa_hdl, SA_ZPL_FLAGS(ZTOZSB(zp)), \
76eda14cbcSMatt Macy 	    &pflags, sizeof (pflags), tx)); \
77eda14cbcSMatt Macy }
78eda14cbcSMatt Macy 
79eda14cbcSMatt Macy /*
80eda14cbcSMatt Macy  * Define special zfs pflags
81eda14cbcSMatt Macy  */
82eda14cbcSMatt Macy #define	ZFS_XATTR		0x1		/* is an extended attribute */
83eda14cbcSMatt Macy #define	ZFS_INHERIT_ACE		0x2		/* ace has inheritable ACEs */
84eda14cbcSMatt Macy #define	ZFS_ACL_TRIVIAL		0x4		/* files ACL is trivial */
85eda14cbcSMatt Macy #define	ZFS_ACL_OBJ_ACE		0x8		/* ACL has CMPLX Object ACE */
86eda14cbcSMatt Macy #define	ZFS_ACL_PROTECTED	0x10		/* ACL protected */
87eda14cbcSMatt Macy #define	ZFS_ACL_DEFAULTED	0x20		/* ACL should be defaulted */
88eda14cbcSMatt Macy #define	ZFS_ACL_AUTO_INHERIT	0x40		/* ACL should be inherited */
89eda14cbcSMatt Macy #define	ZFS_BONUS_SCANSTAMP	0x80		/* Scanstamp in bonus area */
90eda14cbcSMatt Macy #define	ZFS_NO_EXECS_DENIED	0x100		/* exec was given to everyone */
91eda14cbcSMatt Macy 
92eda14cbcSMatt Macy #define	SA_ZPL_ATIME(z)		z->z_attr_table[ZPL_ATIME]
93eda14cbcSMatt Macy #define	SA_ZPL_MTIME(z)		z->z_attr_table[ZPL_MTIME]
94eda14cbcSMatt Macy #define	SA_ZPL_CTIME(z)		z->z_attr_table[ZPL_CTIME]
95eda14cbcSMatt Macy #define	SA_ZPL_CRTIME(z)	z->z_attr_table[ZPL_CRTIME]
96eda14cbcSMatt Macy #define	SA_ZPL_GEN(z)		z->z_attr_table[ZPL_GEN]
97eda14cbcSMatt Macy #define	SA_ZPL_DACL_ACES(z)	z->z_attr_table[ZPL_DACL_ACES]
98eda14cbcSMatt Macy #define	SA_ZPL_XATTR(z)		z->z_attr_table[ZPL_XATTR]
99eda14cbcSMatt Macy #define	SA_ZPL_SYMLINK(z)	z->z_attr_table[ZPL_SYMLINK]
100eda14cbcSMatt Macy #define	SA_ZPL_RDEV(z)		z->z_attr_table[ZPL_RDEV]
101eda14cbcSMatt Macy #define	SA_ZPL_SCANSTAMP(z)	z->z_attr_table[ZPL_SCANSTAMP]
102eda14cbcSMatt Macy #define	SA_ZPL_UID(z)		z->z_attr_table[ZPL_UID]
103eda14cbcSMatt Macy #define	SA_ZPL_GID(z)		z->z_attr_table[ZPL_GID]
104eda14cbcSMatt Macy #define	SA_ZPL_PARENT(z)	z->z_attr_table[ZPL_PARENT]
105eda14cbcSMatt Macy #define	SA_ZPL_LINKS(z)		z->z_attr_table[ZPL_LINKS]
106eda14cbcSMatt Macy #define	SA_ZPL_MODE(z)		z->z_attr_table[ZPL_MODE]
107eda14cbcSMatt Macy #define	SA_ZPL_DACL_COUNT(z)	z->z_attr_table[ZPL_DACL_COUNT]
108eda14cbcSMatt Macy #define	SA_ZPL_FLAGS(z)		z->z_attr_table[ZPL_FLAGS]
109eda14cbcSMatt Macy #define	SA_ZPL_SIZE(z)		z->z_attr_table[ZPL_SIZE]
110eda14cbcSMatt Macy #define	SA_ZPL_ZNODE_ACL(z)	z->z_attr_table[ZPL_ZNODE_ACL]
111eda14cbcSMatt Macy #define	SA_ZPL_DXATTR(z)	z->z_attr_table[ZPL_DXATTR]
112eda14cbcSMatt Macy #define	SA_ZPL_PAD(z)		z->z_attr_table[ZPL_PAD]
113eda14cbcSMatt Macy #define	SA_ZPL_PROJID(z)	z->z_attr_table[ZPL_PROJID]
114eda14cbcSMatt Macy 
115eda14cbcSMatt Macy /*
116eda14cbcSMatt Macy  * Is ID ephemeral?
117eda14cbcSMatt Macy  */
118eda14cbcSMatt Macy #define	IS_EPHEMERAL(x)		(x > MAXUID)
119eda14cbcSMatt Macy 
120eda14cbcSMatt Macy /*
121eda14cbcSMatt Macy  * Should we use FUIDs?
122eda14cbcSMatt Macy  */
123eda14cbcSMatt Macy #define	USE_FUIDS(version, os)	(version >= ZPL_VERSION_FUID && \
124eda14cbcSMatt Macy     spa_version(dmu_objset_spa(os)) >= SPA_VERSION_FUID)
125eda14cbcSMatt Macy #define	USE_SA(version, os) (version >= ZPL_VERSION_SA && \
126eda14cbcSMatt Macy     spa_version(dmu_objset_spa(os)) >= SPA_VERSION_SA)
127eda14cbcSMatt Macy 
128eda14cbcSMatt Macy #define	MASTER_NODE_OBJ	1
129eda14cbcSMatt Macy 
130eda14cbcSMatt Macy /*
131eda14cbcSMatt Macy  * Special attributes for master node.
132eda14cbcSMatt Macy  * "userquota@", "groupquota@" and "projectquota@" are also valid (from
133eda14cbcSMatt Macy  * zfs_userquota_prop_prefixes[]).
134eda14cbcSMatt Macy  */
135eda14cbcSMatt Macy #define	ZFS_FSID		"FSID"
136eda14cbcSMatt Macy #define	ZFS_UNLINKED_SET	"DELETE_QUEUE"
137eda14cbcSMatt Macy #define	ZFS_ROOT_OBJ		"ROOT"
138eda14cbcSMatt Macy #define	ZPL_VERSION_STR		"VERSION"
139eda14cbcSMatt Macy #define	ZFS_FUID_TABLES		"FUID"
140eda14cbcSMatt Macy #define	ZFS_SHARES_DIR		"SHARES"
141eda14cbcSMatt Macy #define	ZFS_SA_ATTRS		"SA_ATTRS"
142eda14cbcSMatt Macy 
143eda14cbcSMatt Macy /*
144eda14cbcSMatt Macy  * Convert mode bits (zp_mode) to BSD-style DT_* values for storing in
145eda14cbcSMatt Macy  * the directory entries.  On Linux systems this value is already
146eda14cbcSMatt Macy  * defined correctly as part of the /usr/include/dirent.h header file.
147eda14cbcSMatt Macy  */
148eda14cbcSMatt Macy #ifndef IFTODT
149eda14cbcSMatt Macy #define	IFTODT(mode) (((mode) & S_IFMT) >> 12)
150eda14cbcSMatt Macy #endif
151eda14cbcSMatt Macy 
152eda14cbcSMatt Macy /*
153eda14cbcSMatt Macy  * The directory entry has the type (currently unused on Solaris) in the
154eda14cbcSMatt Macy  * top 4 bits, and the object number in the low 48 bits.  The "middle"
155eda14cbcSMatt Macy  * 12 bits are unused.
156eda14cbcSMatt Macy  */
157eda14cbcSMatt Macy #define	ZFS_DIRENT_TYPE(de) BF64_GET(de, 60, 4)
158eda14cbcSMatt Macy #define	ZFS_DIRENT_OBJ(de) BF64_GET(de, 0, 48)
159eda14cbcSMatt Macy 
160eda14cbcSMatt Macy extern int zfs_obj_to_path(objset_t *osp, uint64_t obj, char *buf, int len);
161*7a7741afSMartin Matuska extern int zfs_obj_to_pobj(objset_t *osp, sa_handle_t *hdl,
162*7a7741afSMartin Matuska     sa_attr_type_t *sa_table, uint64_t *pobjp, int *is_xattrdir);
1634e8d558cSMartin Matuska extern int zfs_get_zplprop(objset_t *os, zfs_prop_t prop, uint64_t *value);
164eda14cbcSMatt Macy 
165eda14cbcSMatt Macy #ifdef _KERNEL
166eda14cbcSMatt Macy #include <sys/zfs_znode_impl.h>
167eda14cbcSMatt Macy 
168eda14cbcSMatt Macy /*
169eda14cbcSMatt Macy  * Directory entry locks control access to directory entries.
170eda14cbcSMatt Macy  * They are used to protect creates, deletes, and renames.
171eda14cbcSMatt Macy  * Each directory znode has a mutex and a list of locked names.
172eda14cbcSMatt Macy  */
173eda14cbcSMatt Macy typedef struct zfs_dirlock {
174eda14cbcSMatt Macy 	char		*dl_name;	/* directory entry being locked */
175eda14cbcSMatt Macy 	uint32_t	dl_sharecnt;	/* 0 if exclusive, > 0 if shared */
176eda14cbcSMatt Macy 	uint8_t		dl_namelock;	/* 1 if z_name_lock is NOT held */
177eda14cbcSMatt Macy 	uint16_t	dl_namesize;	/* set if dl_name was allocated */
178eda14cbcSMatt Macy 	kcondvar_t	dl_cv;		/* wait for entry to be unlocked */
179eda14cbcSMatt Macy 	struct znode	*dl_dzp;	/* directory znode */
180eda14cbcSMatt Macy 	struct zfs_dirlock *dl_next;	/* next in z_dirlocks list */
181eda14cbcSMatt Macy } zfs_dirlock_t;
182eda14cbcSMatt Macy 
183eda14cbcSMatt Macy typedef struct znode {
184eda14cbcSMatt Macy 	uint64_t	z_id;		/* object ID for this znode */
185eda14cbcSMatt Macy 	kmutex_t	z_lock;		/* znode modification lock */
186eda14cbcSMatt Macy 	krwlock_t	z_parent_lock;	/* parent lock for directories */
187eda14cbcSMatt Macy 	krwlock_t	z_name_lock;	/* "master" lock for dirent locks */
188eda14cbcSMatt Macy 	zfs_dirlock_t	*z_dirlocks;	/* directory entry lock list */
189eda14cbcSMatt Macy 	zfs_rangelock_t	z_rangelock;	/* file range locks */
190eda14cbcSMatt Macy 	boolean_t	z_unlinked;	/* file has been unlinked */
191eda14cbcSMatt Macy 	boolean_t	z_atime_dirty;	/* atime needs to be synced */
192eda14cbcSMatt Macy 	boolean_t	z_zn_prefetch;	/* Prefetch znodes? */
193eda14cbcSMatt Macy 	boolean_t	z_is_sa;	/* are we native sa? */
194eda14cbcSMatt Macy 	boolean_t	z_is_ctldir;	/* are we .zfs entry */
195eda14cbcSMatt Macy 	boolean_t	z_suspended;	/* extra ref from a suspend? */
196eda14cbcSMatt Macy 	uint_t		z_blksz;	/* block size in bytes */
197eda14cbcSMatt Macy 	uint_t		z_seq;		/* modification sequence number */
198eda14cbcSMatt Macy 	uint64_t	z_mapcnt;	/* number of pages mapped to file */
199eda14cbcSMatt Macy 	uint64_t	z_dnodesize;	/* dnode size */
200eda14cbcSMatt Macy 	uint64_t	z_size;		/* file size (cached) */
201eda14cbcSMatt Macy 	uint64_t	z_pflags;	/* pflags (cached) */
202eda14cbcSMatt Macy 	uint32_t	z_sync_cnt;	/* synchronous open count */
203716fd348SMartin Matuska 	uint32_t	z_sync_writes_cnt; /* synchronous write count */
204716fd348SMartin Matuska 	uint32_t	z_async_writes_cnt; /* asynchronous write count */
205eda14cbcSMatt Macy 	mode_t		z_mode;		/* mode (cached) */
206eda14cbcSMatt Macy 	kmutex_t	z_acl_lock;	/* acl data lock */
207eda14cbcSMatt Macy 	zfs_acl_t	*z_acl_cached;	/* cached acl */
208eda14cbcSMatt Macy 	krwlock_t	z_xattr_lock;	/* xattr data lock */
209eda14cbcSMatt Macy 	nvlist_t	*z_xattr_cached; /* cached xattrs */
210eda14cbcSMatt Macy 	uint64_t	z_xattr_parent;	/* parent obj for this xattr */
211eda14cbcSMatt Macy 	uint64_t	z_projid;	/* project ID */
212eda14cbcSMatt Macy 	list_node_t	z_link_node;	/* all znodes in fs link */
213eda14cbcSMatt Macy 	sa_handle_t	*z_sa_hdl;	/* handle to sa data */
214eda14cbcSMatt Macy 
215eda14cbcSMatt Macy 	/*
216eda14cbcSMatt Macy 	 * Platform specific field, defined by each platform and only
217eda14cbcSMatt Macy 	 * accessible from platform specific code.
218eda14cbcSMatt Macy 	 */
219eda14cbcSMatt Macy 	ZNODE_OS_FIELDS;
220eda14cbcSMatt Macy } znode_t;
221eda14cbcSMatt Macy 
222c7046f76SMartin Matuska /* Verifies the znode is valid. */
223c7046f76SMartin Matuska static inline int
224c7046f76SMartin Matuska zfs_verify_zp(znode_t *zp)
225c7046f76SMartin Matuska {
226c7046f76SMartin Matuska 	if (unlikely(zp->z_sa_hdl == NULL))
227c7046f76SMartin Matuska 		return (SET_ERROR(EIO));
228c7046f76SMartin Matuska 	return (0);
229c7046f76SMartin Matuska }
230c7046f76SMartin Matuska 
231c7046f76SMartin Matuska /* zfs_enter and zfs_verify_zp together */
232c7046f76SMartin Matuska static inline int
233c7046f76SMartin Matuska zfs_enter_verify_zp(zfsvfs_t *zfsvfs, znode_t *zp, const char *tag)
234c7046f76SMartin Matuska {
235c7046f76SMartin Matuska 	int error;
236c7046f76SMartin Matuska 	if ((error = zfs_enter(zfsvfs, tag)) != 0)
237c7046f76SMartin Matuska 		return (error);
238c7046f76SMartin Matuska 	if ((error = zfs_verify_zp(zp)) != 0) {
239c7046f76SMartin Matuska 		zfs_exit(zfsvfs, tag);
240c7046f76SMartin Matuska 		return (error);
241c7046f76SMartin Matuska 	}
242c7046f76SMartin Matuska 	return (0);
243c7046f76SMartin Matuska }
244c7046f76SMartin Matuska 
245eda14cbcSMatt Macy typedef struct znode_hold {
246eda14cbcSMatt Macy 	uint64_t	zh_obj;		/* object id */
247eda14cbcSMatt Macy 	avl_node_t	zh_node;	/* avl tree linkage */
248bb2d13b6SMartin Matuska 	kmutex_t	zh_lock;	/* lock serializing object access */
249bb2d13b6SMartin Matuska 	int		zh_refcount;	/* active consumer reference count */
250eda14cbcSMatt Macy } znode_hold_t;
251eda14cbcSMatt Macy 
252eda14cbcSMatt Macy static inline uint64_t
253eda14cbcSMatt Macy zfs_inherit_projid(znode_t *dzp)
254eda14cbcSMatt Macy {
255eda14cbcSMatt Macy 	return ((dzp->z_pflags & ZFS_PROJINHERIT) ? dzp->z_projid :
256eda14cbcSMatt Macy 	    ZFS_DEFAULT_PROJID);
257eda14cbcSMatt Macy }
258eda14cbcSMatt Macy 
259eda14cbcSMatt Macy /*
260eda14cbcSMatt Macy  * Timestamp defines
261eda14cbcSMatt Macy  */
262eda14cbcSMatt Macy #define	ACCESSED		(ATTR_ATIME)
263eda14cbcSMatt Macy #define	STATE_CHANGED		(ATTR_CTIME)
264eda14cbcSMatt Macy #define	CONTENT_MODIFIED	(ATTR_MTIME | ATTR_CTIME)
265eda14cbcSMatt Macy 
266eda14cbcSMatt Macy extern int	zfs_init_fs(zfsvfs_t *, znode_t **);
267eda14cbcSMatt Macy extern void	zfs_set_dataprop(objset_t *);
268eda14cbcSMatt Macy extern void	zfs_create_fs(objset_t *os, cred_t *cr, nvlist_t *,
269eda14cbcSMatt Macy     dmu_tx_t *tx);
270eda14cbcSMatt Macy extern void	zfs_tstamp_update_setup(znode_t *, uint_t, uint64_t [2],
271eda14cbcSMatt Macy     uint64_t [2]);
272eda14cbcSMatt Macy extern void	zfs_grow_blocksize(znode_t *, uint64_t, dmu_tx_t *);
273eda14cbcSMatt Macy extern int	zfs_freesp(znode_t *, uint64_t, uint64_t, int, boolean_t);
274eda14cbcSMatt Macy extern void	zfs_znode_init(void);
275eda14cbcSMatt Macy extern void	zfs_znode_fini(void);
276eda14cbcSMatt Macy extern int	zfs_znode_hold_compare(const void *, const void *);
27715f0b8c3SMartin Matuska extern znode_hold_t *zfs_znode_hold_enter(zfsvfs_t *, uint64_t);
27815f0b8c3SMartin Matuska extern void	zfs_znode_hold_exit(zfsvfs_t *, znode_hold_t *);
279eda14cbcSMatt Macy extern int	zfs_zget(zfsvfs_t *, uint64_t, znode_t **);
280eda14cbcSMatt Macy extern int	zfs_rezget(znode_t *);
281eda14cbcSMatt Macy extern void	zfs_zinactive(znode_t *);
282eda14cbcSMatt Macy extern void	zfs_znode_delete(znode_t *, dmu_tx_t *);
283eda14cbcSMatt Macy extern void	zfs_remove_op_tables(void);
284eda14cbcSMatt Macy extern int	zfs_create_op_tables(void);
285eda14cbcSMatt Macy extern dev_t	zfs_cmpldev(uint64_t);
286eda14cbcSMatt Macy extern int	zfs_get_stats(objset_t *os, nvlist_t *nv);
287eda14cbcSMatt Macy extern boolean_t zfs_get_vfs_flag_unmounted(objset_t *os);
288eda14cbcSMatt Macy extern void	zfs_znode_dmu_fini(znode_t *);
289eda14cbcSMatt Macy 
290eda14cbcSMatt Macy extern void zfs_log_create(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype,
291180f8225SMatt Macy     znode_t *dzp, znode_t *zp, const char *name, vsecattr_t *,
292180f8225SMatt Macy     zfs_fuid_info_t *, vattr_t *vap);
293eda14cbcSMatt Macy extern int zfs_log_create_txtype(zil_create_t, vsecattr_t *vsecp,
294eda14cbcSMatt Macy     vattr_t *vap);
295eda14cbcSMatt Macy extern void zfs_log_remove(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype,
296180f8225SMatt Macy     znode_t *dzp, const char *name, uint64_t foid, boolean_t unlinked);
297eda14cbcSMatt Macy #define	ZFS_NO_OBJECT	0	/* no object id */
298eda14cbcSMatt Macy extern void zfs_log_link(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype,
299180f8225SMatt Macy     znode_t *dzp, znode_t *zp, const char *name);
300eda14cbcSMatt Macy extern void zfs_log_symlink(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype,
301180f8225SMatt Macy     znode_t *dzp, znode_t *zp, const char *name, const char *link);
302eda14cbcSMatt Macy extern void zfs_log_rename(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype,
303180f8225SMatt Macy     znode_t *sdzp, const char *sname, znode_t *tdzp, const char *dname,
304180f8225SMatt Macy     znode_t *szp);
305dbd5678dSMartin Matuska extern void zfs_log_rename_exchange(zilog_t *zilog, dmu_tx_t *tx,
306dbd5678dSMartin Matuska     uint64_t txtype, znode_t *sdzp, const char *sname, znode_t *tdzp,
307dbd5678dSMartin Matuska     const char *dname, znode_t *szp);
308dbd5678dSMartin Matuska extern void zfs_log_rename_whiteout(zilog_t *zilog, dmu_tx_t *tx,
309dbd5678dSMartin Matuska     uint64_t txtype, znode_t *sdzp, const char *sname, znode_t *tdzp,
310dbd5678dSMartin Matuska     const char *dname, znode_t *szp, znode_t *wzp);
311eda14cbcSMatt Macy extern void zfs_log_write(zilog_t *zilog, dmu_tx_t *tx, int txtype,
312f8b1db88SMartin Matuska     znode_t *zp, offset_t off, ssize_t len, boolean_t commit,
313*7a7741afSMartin Matuska     boolean_t o_direct, zil_callback_t callback, void *callback_data);
314eda14cbcSMatt Macy extern void zfs_log_truncate(zilog_t *zilog, dmu_tx_t *tx, int txtype,
315eda14cbcSMatt Macy     znode_t *zp, uint64_t off, uint64_t len);
316eda14cbcSMatt Macy extern void zfs_log_setattr(zilog_t *zilog, dmu_tx_t *tx, int txtype,
317eda14cbcSMatt Macy     znode_t *zp, vattr_t *vap, uint_t mask_applied, zfs_fuid_info_t *fuidp);
318eda14cbcSMatt Macy extern void zfs_log_acl(zilog_t *zilog, dmu_tx_t *tx, znode_t *zp,
319eda14cbcSMatt Macy     vsecattr_t *vsecp, zfs_fuid_info_t *fuidp);
3202a58b312SMartin Matuska extern void zfs_log_clone_range(zilog_t *zilog, dmu_tx_t *tx, int txtype,
3212a58b312SMartin Matuska     znode_t *zp, uint64_t offset, uint64_t length, uint64_t blksz,
3222a58b312SMartin Matuska     const blkptr_t *bps, size_t nbps);
323eda14cbcSMatt Macy extern void zfs_xvattr_set(znode_t *zp, xvattr_t *xvap, dmu_tx_t *tx);
324eda14cbcSMatt Macy extern void zfs_upgrade(zfsvfs_t *zfsvfs, dmu_tx_t *tx);
325c03c5b1cSMartin Matuska extern void zfs_log_setsaxattr(zilog_t *zilog, dmu_tx_t *tx, int txtype,
326c03c5b1cSMartin Matuska     znode_t *zp, const char *name, const void *value, size_t size);
327eda14cbcSMatt Macy 
328184c1b94SMartin Matuska extern void zfs_znode_update_vfs(struct znode *);
329184c1b94SMartin Matuska 
330eda14cbcSMatt Macy #endif
331eda14cbcSMatt Macy #ifdef	__cplusplus
332eda14cbcSMatt Macy }
333eda14cbcSMatt Macy #endif
334eda14cbcSMatt Macy 
335eda14cbcSMatt Macy #endif	/* _SYS_FS_ZFS_ZNODE_H */
336