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