xref: /titanic_41/usr/src/uts/common/sys/fs/ufs_trans.h (revision d58fda4376e4bf67072ce2e69f6f47036f9dbb68)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _SYS_FS_UFS_TRANS_H
28 #define	_SYS_FS_UFS_TRANS_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef	__cplusplus
33 extern "C" {
34 #endif
35 
36 #include	<sys/types.h>
37 #include	<sys/cred.h>
38 #include	<sys/fs/ufs_fs.h>
39 
40 /*
41  * Types of deltas
42  */
43 typedef enum delta_type {
44 	DT_NONE,	/*  0 no assigned type */
45 	DT_SB,		/*  1 superblock */
46 	DT_CG,		/*  2 cylinder group */
47 	DT_SI,		/*  3 summary info */
48 	DT_AB,		/*  4 allocation block */
49 	DT_ABZERO,	/*  5 a zero'ed allocation block */
50 	DT_DIR,		/*  6 directory */
51 	DT_INODE,	/*  7 inode */
52 	DT_FBI,		/*  8 fbiwrite */
53 	DT_QR,		/*  9 quota record */
54 	DT_COMMIT,	/* 10 commit record */
55 	DT_CANCEL,	/* 11 cancel record */
56 	DT_BOT,		/* 12 begin transaction */
57 	DT_EOT,		/* 13 end   transaction */
58 	DT_UD,		/* 14 userdata */
59 	DT_SUD,		/* 15 userdata found during log scan */
60 	DT_SHAD,	/* 16 data for a shadow inode */
61 	DT_MAX		/* 17 maximum delta type */
62 } delta_t;
63 
64 /*
65  * transaction operation types
66  */
67 typedef enum top_type {
68 	TOP_READ_SYNC,		/* 0 */
69 	TOP_WRITE,		/* 1 */
70 	TOP_WRITE_SYNC,		/* 2 */
71 	TOP_SETATTR,		/* 3 */
72 	TOP_CREATE,		/* 4 */
73 	TOP_REMOVE,		/* 5 */
74 	TOP_LINK,		/* 6 */
75 	TOP_RENAME,		/* 7 */
76 	TOP_MKDIR,		/* 8 */
77 	TOP_RMDIR,		/* 9 */
78 	TOP_SYMLINK,		/* 10 */
79 	TOP_FSYNC,		/* 11 */
80 	TOP_GETPAGE,		/* 12 */
81 	TOP_PUTPAGE,		/* 13 */
82 	TOP_SBUPDATE_FLUSH,	/* 14 */
83 	TOP_SBUPDATE_UPDATE,	/* 15 */
84 	TOP_SBUPDATE_UNMOUNT,	/* 16 */
85 	TOP_SYNCIP_CLOSEDQ,	/* 17 */
86 	TOP_SYNCIP_FLUSHI,	/* 18 */
87 	TOP_SYNCIP_HLOCK,	/* 19 */
88 	TOP_SYNCIP_SYNC,	/* 20 */
89 	TOP_SYNCIP_FREE,	/* 21 */
90 	TOP_SBWRITE_RECLAIM,	/* 22 */
91 	TOP_SBWRITE_STABLE,	/* 23 */
92 	TOP_IFREE,		/* 24 */
93 	TOP_IUPDAT,		/* 25 */
94 	TOP_MOUNT,		/* 26 */
95 	TOP_COMMIT_ASYNC,	/* 27 */
96 	TOP_COMMIT_FLUSH,	/* 28 */
97 	TOP_COMMIT_UPDATE,	/* 29 */
98 	TOP_COMMIT_UNMOUNT,	/* 30 */
99 	TOP_SETSECATTR,		/* 31 */
100 	TOP_QUOTA,		/* 32 */
101 	TOP_ITRUNC,		/* 33 */
102 	TOP_MAX			/* 34 */
103 } top_t;
104 
105 struct inode;
106 struct ufsvfs;
107 
108 /*
109  * vfs_log == NULL means not logging
110  */
111 #define	TRANS_ISTRANS(ufsvfsp)	(ufsvfsp->vfs_log)
112 
113 /*
114  * begin a synchronous transaction
115  */
116 #define	TRANS_BEGIN_SYNC(ufsvfsp, vid, vsize, error)\
117 {\
118 	if (TRANS_ISTRANS(ufsvfsp)) { \
119 		error = 0; \
120 		top_begin_sync(ufsvfsp, vid, vsize, &error); \
121 	} \
122 }
123 
124 /*
125  * begin a asynchronous transaction
126  */
127 #define	TRANS_BEGIN_ASYNC(ufsvfsp, vid, vsize)\
128 {\
129 	if (TRANS_ISTRANS(ufsvfsp))\
130 		(void) top_begin_async(ufsvfsp, vid, vsize, 0); \
131 }
132 
133 /*
134  * try to begin a asynchronous transaction
135  */
136 #define	TRANS_TRY_BEGIN_ASYNC(ufsvfsp, vid, vsize, err)\
137 {\
138 	if (TRANS_ISTRANS(ufsvfsp))\
139 		err = top_begin_async(ufsvfsp, vid, vsize, 1); \
140 	else\
141 		err = 0; \
142 }
143 
144 /*
145  * Begin a synchronous or asynchronous transaction.
146  * The lint case is needed because vsize can be a constant.
147  */
148 #ifndef __lint
149 
150 #define	TRANS_BEGIN_CSYNC(ufsvfsp, issync, vid, vsize)\
151 {\
152 	if (TRANS_ISTRANS(ufsvfsp)) {\
153 		if (ufsvfsp->vfs_syncdir) {\
154 			int error = 0; \
155 			ASSERT(vsize); \
156 			top_begin_sync(ufsvfsp, vid, vsize, &error); \
157 			ASSERT(error == 0); \
158 			issync = 1; \
159 		} else {\
160 			(void) top_begin_async(ufsvfsp, vid, vsize, 0); \
161 			issync = 0; \
162 		}\
163 	}\
164 }
165 
166 #else /* __lint */
167 
168 #define	TRANS_BEGIN_CSYNC(ufsvfsp, issync, vid, vsize)\
169 {\
170 	if (TRANS_ISTRANS(ufsvfsp)) {\
171 		if (ufsvfsp->vfs_syncdir) {\
172 			int error = 0; \
173 			top_begin_sync(ufsvfsp, vid, vsize, &error); \
174 			issync = 1; \
175 		} else {\
176 			(void) top_begin_async(ufsvfsp, vid, vsize, 0); \
177 			issync = 0; \
178 		}\
179 	}\
180 }
181 #endif /* __lint */
182 
183 /*
184  * try to begin a synchronous or asynchronous transaction
185  */
186 
187 #define	TRANS_TRY_BEGIN_CSYNC(ufsvfsp, issync, vid, vsize, error)\
188 {\
189 	if (TRANS_ISTRANS(ufsvfsp)) {\
190 		if (ufsvfsp->vfs_syncdir) {\
191 			ASSERT(vsize); \
192 			top_begin_sync(ufsvfsp, vid, vsize, &error); \
193 			ASSERT(error == 0); \
194 			issync = 1; \
195 		} else {\
196 			error = top_begin_async(ufsvfsp, vid, vsize, 1); \
197 			issync = 0; \
198 		}\
199 	}\
200 }\
201 
202 
203 /*
204  * end a asynchronous transaction
205  */
206 #define	TRANS_END_ASYNC(ufsvfsp, vid, vsize)\
207 {\
208 	if (TRANS_ISTRANS(ufsvfsp))\
209 		top_end_async(ufsvfsp, vid, vsize); \
210 }
211 
212 /*
213  * end a synchronous transaction
214  */
215 #define	TRANS_END_SYNC(ufsvfsp, error, vid, vsize)\
216 {\
217 	if (TRANS_ISTRANS(ufsvfsp))\
218 		top_end_sync(ufsvfsp, &error, vid, vsize); \
219 }
220 
221 /*
222  * end a synchronous or asynchronous transaction
223  */
224 #define	TRANS_END_CSYNC(ufsvfsp, error, issync, vid, vsize)\
225 {\
226 	if (TRANS_ISTRANS(ufsvfsp))\
227 		if (issync)\
228 			top_end_sync(ufsvfsp, &error, vid, vsize); \
229 		else\
230 			top_end_async(ufsvfsp, vid, vsize); \
231 }
232 /*
233  * record a delta
234  */
235 #define	TRANS_DELTA(ufsvfsp, mof, nb, dtyp, func, arg) \
236 	if (TRANS_ISTRANS(ufsvfsp)) \
237 		top_delta(ufsvfsp, (offset_t)(mof), nb, dtyp, func, arg)
238 
239 /*
240  * cancel a delta
241  */
242 #define	TRANS_CANCEL(ufsvfsp, mof, nb, flags) \
243 	if (TRANS_ISTRANS(ufsvfsp)) \
244 		top_cancel(ufsvfsp, (offset_t)(mof), nb, flags)
245 /*
246  * log a delta
247  */
248 #define	TRANS_LOG(ufsvfsp, va, mof, nb, buf, bufsz) \
249 	if (TRANS_ISTRANS(ufsvfsp)) \
250 		top_log(ufsvfsp, va, (offset_t)(mof), nb, buf, bufsz)
251 /*
252  * check if a range is being canceled (converting from metadata into userdata)
253  */
254 #define	TRANS_ISCANCEL(ufsvfsp, mof, nb) \
255 	((TRANS_ISTRANS(ufsvfsp)) ? \
256 		top_iscancel(ufsvfsp, (offset_t)(mof), nb) : 0)
257 /*
258  * put the log into error state
259  */
260 #define	TRANS_SETERROR(ufsvfsp) \
261 	if (TRANS_ISTRANS(ufsvfsp)) \
262 		top_seterror(ufsvfsp)
263 /*
264  * check if device has had an error
265  */
266 #define	TRANS_ISERROR(ufsvfsp) \
267 	((TRANS_ISTRANS(ufsvfsp)) ? \
268 		ufsvfsp->vfs_log->un_flags & LDL_ERROR : 0)
269 
270 /*
271  * The following macros provide a more readable interface to TRANS_DELTA
272  */
273 #define	TRANS_BUF(ufsvfsp, vof, nb, bp, type) \
274 	TRANS_DELTA(ufsvfsp, \
275 		ldbtob(bp->b_blkno) + (offset_t)(vof), nb, type, \
276 		ufs_trans_push_buf, bp->b_blkno)
277 
278 #define	TRANS_BUF_ITEM_128(ufsvfsp, item, base, bp, type) \
279 	TRANS_BUF(ufsvfsp, \
280 	(((uintptr_t)&(item)) & ~(128 - 1)) - (uintptr_t)(base), 128, bp, type)
281 
282 #define	TRANS_INODE(ufsvfsp, ip) \
283 	TRANS_DELTA(ufsvfsp, ip->i_doff, sizeof (struct dinode), \
284 			DT_INODE, ufs_trans_push_inode, ip->i_number)
285 
286 /*
287  * If ever parts of an inode except the timestamps are logged using
288  * this macro (or any other technique), bootloader logging support must
289  * be made aware of these changes.
290  */
291 #define	TRANS_INODE_DELTA(ufsvfsp, vof, nb, ip) \
292 	TRANS_DELTA(ufsvfsp, (ip->i_doff + (offset_t)(vof)), \
293 		nb, DT_INODE, ufs_trans_push_inode, ip->i_number)
294 
295 #define	TRANS_INODE_TIMES(ufsvfsp, ip) \
296 	TRANS_INODE_DELTA(ufsvfsp, (caddr_t)&ip->i_atime - (caddr_t)&ip->i_ic, \
297 		sizeof (struct timeval32) * 3, ip)
298 
299 /*
300  * Check if we need to log cylinder group summary info.
301  */
302 #define	TRANS_SI(ufsvfsp, fs, cg) \
303 	if (TRANS_ISTRANS(ufsvfsp)) \
304 		if (ufsvfsp->vfs_nolog_si) \
305 			fs->fs_si = FS_SI_BAD; \
306 		else \
307 			TRANS_DELTA(ufsvfsp, \
308 				ldbtob(fsbtodb(fs, fs->fs_csaddr)) + \
309 				((caddr_t)&fs->fs_cs(fs, cg) - \
310 				(caddr_t)fs->fs_u.fs_csp), \
311 				sizeof (struct csum), DT_SI, \
312 				ufs_trans_push_si, cg)
313 
314 #define	TRANS_DIR(ip, offset) \
315 	(TRANS_ISTRANS(ip->i_ufsvfs) ? ufs_trans_dir(ip, offset) : 0)
316 
317 #define	TRANS_QUOTA(dqp)	\
318 	if (TRANS_ISTRANS(dqp->dq_ufsvfsp))	\
319 		ufs_trans_quota(dqp);
320 
321 #define	TRANS_DQRELE(ufsvfsp, dqp) \
322 	if (TRANS_ISTRANS(ufsvfsp) && \
323 	    ((curthread->t_flag & T_DONTBLOCK) == 0)) { \
324 		ufs_trans_dqrele(dqp); \
325 	} else { \
326 		rw_enter(&ufsvfsp->vfs_dqrwlock, RW_READER); \
327 		dqrele(dqp); \
328 		rw_exit(&ufsvfsp->vfs_dqrwlock); \
329 	}
330 
331 #define	TRANS_ITRUNC(ip, length, flags, cr)	\
332 	ufs_trans_itrunc(ip, length, flags, cr);
333 
334 #define	TRANS_WRITE_RESV(ip, uiop, ulp, resvp, residp)	\
335 	if ((TRANS_ISTRANS(ip->i_ufsvfs) != NULL) && (ulp != NULL)) \
336 		ufs_trans_write_resv(ip, uiop, resvp, residp);
337 
338 #define	TRANS_WRITE(ip, uiop, ioflag, err, ulp, cr, resv, resid)	\
339 	if ((TRANS_ISTRANS(ip->i_ufsvfs) != NULL) && (ulp != NULL)) \
340 		err = ufs_trans_write(ip, uiop, ioflag, cr, resv, resid); \
341 	else \
342 		err = wrip(ip, uiop, ioflag, cr);
343 
344 /*
345  * These functions "wrap" functions that are not VOP or VFS
346  * entry points but must still use the TRANS_BEGIN/TRANS_END
347  * protocol
348  */
349 #define	TRANS_SBUPDATE(ufsvfsp, vfsp, topid) \
350 	ufs_trans_sbupdate(ufsvfsp, vfsp, topid)
351 #define	TRANS_SYNCIP(ip, bflags, iflag, topid) \
352 	ufs_syncip(ip, bflags, iflag, topid)
353 #define	TRANS_SBWRITE(ufsvfsp, topid)	ufs_trans_sbwrite(ufsvfsp, topid)
354 #define	TRANS_IUPDAT(ip, waitfor)	ufs_trans_iupdat(ip, waitfor)
355 
356 #ifdef	DEBUG
357 /*
358  * Test/Debug ops
359  *	The following ops maintain the metadata map.
360  *	The metadata map is a debug/test feature.
361  *	These ops are *not* used in the production product.
362  */
363 
364 /*
365  * Set a flag if meta data checking.
366  */
367 #define	TRANS_DOMATAMAP(ufsvfsp) \
368 	ufsvfsp->vfs_domatamap = \
369 		(TRANS_ISTRANS(ufsvfsp) && \
370 		(ufsvfsp->vfs_log->un_debug & MT_MATAMAP))
371 
372 #define	TRANS_MATA_IGET(ufsvfsp, ip) \
373 	if (ufsvfsp->vfs_domatamap) \
374 		ufs_trans_mata_iget(ip)
375 
376 #define	TRANS_MATA_FREE(ufsvfsp, mof, nb) \
377 	if (ufsvfsp->vfs_domatamap) \
378 		ufs_trans_mata_free(ufsvfsp, (offset_t)(mof), nb)
379 
380 #define	TRANS_MATA_ALLOC(ufsvfsp, ip, bno, size, zero) \
381 	if (ufsvfsp->vfs_domatamap) \
382 		ufs_trans_mata_alloc(ufsvfsp, ip, bno, size, zero)
383 
384 #define	TRANS_MATA_MOUNT(ufsvfsp) \
385 	if (ufsvfsp->vfs_domatamap) \
386 		ufs_trans_mata_mount(ufsvfsp)
387 
388 #define	TRANS_MATA_UMOUNT(ufsvfsp) \
389 	if (ufsvfsp->vfs_domatamap) \
390 		ufs_trans_mata_umount(ufsvfsp)
391 
392 #define	TRANS_MATA_SI(ufsvfsp, fs) \
393 	if (ufsvfsp->vfs_domatamap) \
394 		ufs_trans_mata_si(ufsvfsp, fs)
395 
396 #define	TRANS_MATAADD(ufsvfsp, mof, nb) \
397 	top_mataadd(ufsvfsp, (offset_t)(mof), nb)
398 
399 #else /* !DEBUG */
400 
401 #define	TRANS_DOMATAMAP(ufsvfsp)
402 #define	TRANS_MATA_IGET(ufsvfsp, ip)
403 #define	TRANS_MATA_FREE(ufsvfsp, mof, nb)
404 #define	TRANS_MATA_ALLOC(ufsvfsp, ip, bno, size, zero)
405 #define	TRANS_MATA_MOUNT(ufsvfsp)
406 #define	TRANS_MATA_UMOUNT(ufsvfsp)
407 #define	TRANS_MATA_SI(ufsvfsp, fs)
408 #define	TRANS_MATAADD(ufsvfsp, mof, nb)
409 
410 #endif  /* !DEBUG */
411 
412 #include	<sys/fs/ufs_quota.h>
413 #include	<sys/fs/ufs_lockfs.h>
414 /*
415  * identifies the type of operation passed into TRANS_BEGIN/END
416  */
417 #define	TOP_SYNC		(0x00000001)
418 #define	TOP_ASYNC		(0x00000002)
419 #define	TOP_SYNC_FORCED		(0x00000004)	/* forced sync transaction */
420 /*
421  *  estimated values
422  */
423 #define	HEADERSIZE		(128)
424 #define	ALLOCSIZE		(160)
425 #define	INODESIZE		(sizeof (struct dinode) + HEADERSIZE)
426 #define	SIZESB			((sizeof (struct fs)) + HEADERSIZE)
427 #define	SIZEDIR			(DIRBLKSIZ + HEADERSIZE)
428 /*
429  * calculated values
430  */
431 #define	SIZECG(IP)		((IP)->i_fs->fs_cgsize + HEADERSIZE)
432 #define	FRAGSIZE(IP)		((IP)->i_fs->fs_fsize + HEADERSIZE)
433 #define	ACLSIZE(IP)		(((IP)->i_ufsvfs->vfs_maxacl + HEADERSIZE) + \
434 					INODESIZE)
435 #define	MAXACLSIZE		((MAX_ACL_ENTRIES << 1) * sizeof (aclent_t))
436 #define	DIRSIZE(IP)		(INODESIZE + (4 * ALLOCSIZE) + \
437 				    (IP)->i_fs->fs_fsize + HEADERSIZE)
438 #define	QUOTASIZE		sizeof (struct dquot) + HEADERSIZE
439 /*
440  * size calculations
441  */
442 #define	TOP_CREATE_SIZE(IP)	\
443 	(ACLSIZE(IP) + SIZECG(IP) + DIRSIZE(IP) + INODESIZE)
444 #define	TOP_REMOVE_SIZE(IP)	\
445 	DIRSIZE(IP)  + SIZECG(IP) + INODESIZE + SIZESB
446 #define	TOP_LINK_SIZE(IP)	\
447 	DIRSIZE(IP) + INODESIZE
448 #define	TOP_RENAME_SIZE(IP)	\
449 	DIRSIZE(IP) + DIRSIZE(IP) + SIZECG(IP)
450 #define	TOP_MKDIR_SIZE(IP)	\
451 	DIRSIZE(IP) + INODESIZE + DIRSIZE(IP) + INODESIZE + FRAGSIZE(IP) + \
452 	    SIZECG(IP) + ACLSIZE(IP)
453 #define	TOP_SYMLINK_SIZE(IP)	\
454 	DIRSIZE((IP)) + INODESIZE + INODESIZE + SIZECG(IP)
455 #define	TOP_GETPAGE_SIZE(IP)	\
456 	ALLOCSIZE + ALLOCSIZE + ALLOCSIZE + INODESIZE + SIZECG(IP)
457 #define	TOP_SYNCIP_SIZE		INODESIZE
458 #define	TOP_READ_SIZE		INODESIZE
459 #define	TOP_RMDIR_SIZE		(SIZESB + (INODESIZE * 2) + SIZEDIR)
460 #define	TOP_SETQUOTA_SIZE(FS)	((FS)->fs_bsize << 2)
461 #define	TOP_QUOTA_SIZE		(QUOTASIZE)
462 #define	TOP_SETSECATTR_SIZE(IP)	(MAXACLSIZE)
463 #define	TOP_IUPDAT_SIZE(IP)	INODESIZE + SIZECG(IP)
464 #define	TOP_SBUPDATE_SIZE	(SIZESB)
465 #define	TOP_SBWRITE_SIZE	(SIZESB)
466 #define	TOP_PUTPAGE_SIZE(IP)	(INODESIZE + SIZECG(IP))
467 #define	TOP_SETATTR_SIZE(IP)	(SIZECG(IP) + INODESIZE + QUOTASIZE + \
468 		ACLSIZE(IP))
469 #define	TOP_IFREE_SIZE(IP)	(SIZECG(IP) + INODESIZE + QUOTASIZE)
470 #define	TOP_MOUNT_SIZE		(SIZESB)
471 #define	TOP_COMMIT_SIZE		(0)
472 
473 /*
474  * The minimum log size is 1M.  So we will allow 1 fs operation to
475  * reserve at most 512K of log space.
476  */
477 #define	TOP_MAX_RESV	(512 * 1024)
478 
479 
480 /*
481  * ufs trans function prototypes
482  */
483 #if defined(_KERNEL) && defined(__STDC__)
484 
485 extern int		ufs_trans_hlock();
486 extern void		ufs_trans_onerror();
487 extern int		ufs_trans_push_inode(struct ufsvfs *, delta_t, ino_t);
488 extern int		ufs_trans_push_buf(struct ufsvfs *, delta_t, daddr_t);
489 extern int		ufs_trans_push_si(struct ufsvfs *, delta_t, int);
490 extern void		ufs_trans_sbupdate(struct ufsvfs *, struct vfs *,
491 				top_t);
492 extern void		ufs_trans_sbwrite(struct ufsvfs *, top_t);
493 extern void		ufs_trans_iupdat(struct inode *, int);
494 extern void		ufs_trans_mata_mount(struct ufsvfs *);
495 extern void		ufs_trans_mata_umount(struct ufsvfs *);
496 extern void		ufs_trans_mata_si(struct ufsvfs *, struct fs *);
497 extern void		ufs_trans_mata_iget(struct inode *);
498 extern void		ufs_trans_mata_free(struct ufsvfs *, offset_t, off_t);
499 extern void		ufs_trans_mata_alloc(struct ufsvfs *, struct inode *,
500 				daddr_t, ulong_t, int);
501 extern int		ufs_trans_dir(struct inode *, off_t);
502 extern void		ufs_trans_quota(struct dquot *);
503 extern void		ufs_trans_dqrele(struct dquot *);
504 extern int		ufs_trans_itrunc(struct inode *, u_offset_t, int,
505 			    cred_t *);
506 extern int		ufs_trans_write(struct inode *, struct uio *, int,
507 			    cred_t *, int, long);
508 extern void		ufs_trans_write_resv(struct inode *, struct uio *,
509 				int *, int *);
510 extern int		ufs_trans_check(dev_t);
511 extern void		ufs_trans_redev(dev_t odev, dev_t ndev);
512 
513 /*
514  * transaction prototypes
515  */
516 void	lufs_unsnarf(struct ufsvfs *ufsvfsp);
517 int	lufs_snarf(struct ufsvfs *ufsvfsp, struct fs *fs, int ronly);
518 void	top_delta(struct ufsvfs *ufsvfsp, offset_t mof, off_t nb, delta_t dtyp,
519 	    int (*func)(), ulong_t arg);
520 void	top_cancel(struct ufsvfs *ufsvfsp, offset_t mof, off_t nb, int flags);
521 int	top_iscancel(struct ufsvfs *ufsvfsp, offset_t mof, off_t nb);
522 void	top_seterror(struct ufsvfs *ufsvfsp);
523 int	top_iserror(struct ufsvfs *ufsvfsp);
524 void	top_begin_sync(struct ufsvfs *ufsvfsp, top_t topid, ulong_t size,
525 	    int *error);
526 int	top_begin_async(struct ufsvfs *ufsvfsp, top_t topid, ulong_t size,
527 	    int tryasync);
528 void	top_end_sync(struct ufsvfs *ufsvfsp, int *ep, top_t topid,
529 	    ulong_t size);
530 void	top_end_async(struct ufsvfs *ufsvfsp, top_t topid, ulong_t size);
531 void	top_log(struct ufsvfs *ufsvfsp, char *va, offset_t vamof, off_t nb,
532 	    caddr_t buf, uint32_t bufsz);
533 void	top_mataadd(struct ufsvfs *ufsvfsp, offset_t mof, off_t nb);
534 void	top_matadel(struct ufsvfs *ufsvfsp, offset_t mof, off_t nb);
535 void	top_mataclr(struct ufsvfs *ufsvfsp);
536 
537 
538 #endif	/* defined(_KERNEL) && defined(__STDC__) */
539 
540 #ifdef	__cplusplus
541 }
542 #endif
543 
544 #endif	/* _SYS_FS_UFS_TRANS_H */
545