1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30#ifndef __LINUX_UFS_FS_H
31#define __LINUX_UFS_FS_H
32
33#include <linux/types.h>
34#include <linux/kernel.h>
35#include <linux/stat.h>
36#include <linux/fs.h>
37
38#include <asm/div64.h>
39typedef __u64 __bitwise __fs64;
40typedef __u32 __bitwise __fs32;
41typedef __u16 __bitwise __fs16;
42
43#define UFS_BBLOCK 0
44#define UFS_BBSIZE 8192
45#define UFS_SBLOCK 8192
46#define UFS_SBSIZE 8192
47
48#define UFS_SECTOR_SIZE 512
49#define UFS_SECTOR_BITS 9
50#define UFS_MAGIC 0x00011954
51#define UFS2_MAGIC 0x19540119
52#define UFS_CIGAM 0x54190100
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87#define SBLOCK_FLOPPY 0
88#define SBLOCK_UFS1 8192
89#define SBLOCK_UFS2 65536
90#define SBLOCK_PIGGY 262144
91#define SBLOCKSIZE 8192
92#define SBLOCKSEARCH \
93 { SBLOCK_UFS2, SBLOCK_UFS1, SBLOCK_FLOPPY, SBLOCK_PIGGY, -1 }
94
95
96
97
98#define UFS_MAGIC_LFN 0x00095014
99#define UFS_CIGAM_LFN 0x14500900
100
101#define UFS_MAGIC_SEC 0x00612195
102#define UFS_CIGAM_SEC 0x95216100
103
104#define UFS_MAGIC_FEA 0x00195612
105#define UFS_CIGAM_FEA 0x12561900
106
107#define UFS_MAGIC_4GB 0x05231994
108#define UFS_CIGAM_4GB 0x94192305
109
110
111#define UFS_FSF_LFN 0x00000001
112#define UFS_FSF_B1 0x00000002
113#define UFS_FSF_LFS 0x00000002
114#define UFS_FSF_LUID 0x00000004
115
116
117
118
119#define UFS_BSIZE 8192
120#define UFS_MINBSIZE 4096
121#define UFS_FSIZE 1024
122#define UFS_MAXFRAG (UFS_BSIZE / UFS_FSIZE)
123
124#define UFS_NDADDR 12
125#define UFS_NINDIR 3
126
127#define UFS_IND_BLOCK (UFS_NDADDR + 0)
128#define UFS_DIND_BLOCK (UFS_NDADDR + 1)
129#define UFS_TIND_BLOCK (UFS_NDADDR + 2)
130
131#define UFS_NDIR_FRAGMENT (UFS_NDADDR << uspi->s_fpbshift)
132#define UFS_IND_FRAGMENT (UFS_IND_BLOCK << uspi->s_fpbshift)
133#define UFS_DIND_FRAGMENT (UFS_DIND_BLOCK << uspi->s_fpbshift)
134#define UFS_TIND_FRAGMENT (UFS_TIND_BLOCK << uspi->s_fpbshift)
135
136#define UFS_ROOTINO 2
137#define UFS_FIRST_INO (UFS_ROOTINO + 1)
138
139#define UFS_USEEFT ((__u16)65535)
140
141#define UFS_FSOK 0x7c269d38
142#define UFS_FSACTIVE ((__s8)0x00)
143#define UFS_FSCLEAN ((__s8)0x01)
144#define UFS_FSSTABLE ((__s8)0x02)
145#define UFS_FSOSF1 ((__s8)0x03)
146#define UFS_FSBAD ((__s8)0xff)
147
148
149
150#define UFS_DE_MASK 0x00000010
151#define UFS_DE_OLD 0x00000000
152#define UFS_DE_44BSD 0x00000010
153
154#define UFS_UID_MASK 0x00000060
155#define UFS_UID_OLD 0x00000000
156#define UFS_UID_44BSD 0x00000020
157#define UFS_UID_EFT 0x00000040
158
159#define UFS_ST_MASK 0x00000700
160#define UFS_ST_OLD 0x00000000
161#define UFS_ST_44BSD 0x00000100
162#define UFS_ST_SUN 0x00000200
163#define UFS_ST_SUNOS 0x00000300
164#define UFS_ST_SUNx86 0x00000400
165
166#define UFS_CG_MASK 0x00003000
167#define UFS_CG_OLD 0x00000000
168#define UFS_CG_44BSD 0x00002000
169#define UFS_CG_SUN 0x00001000
170
171#define UFS_TYPE_MASK 0x00010000
172#define UFS_TYPE_UFS1 0x00000000
173#define UFS_TYPE_UFS2 0x00010000
174
175
176
177#define UFS_42INODEFMT -1
178#define UFS_44INODEFMT 2
179
180
181
182
183
184
185
186
187
188
189
190
191
192#define UFS_MINFREE 5
193#define UFS_DEFAULTOPT UFS_OPTTIME
194
195
196
197
198
199#define ufs_fsbtodb(uspi, b) ((b) << (uspi)->s_fsbtodb)
200#define ufs_dbtofsb(uspi, b) ((b) >> (uspi)->s_fsbtodb)
201
202
203
204
205
206#define ufs_cgbase(c) (uspi->s_fpg * (c))
207#define ufs_cgstart(c) ((uspi)->fs_magic == UFS2_MAGIC ? ufs_cgbase(c) : \
208 (ufs_cgbase(c) + uspi->s_cgoffset * ((c) & ~uspi->s_cgmask)))
209#define ufs_cgsblock(c) (ufs_cgstart(c) + uspi->s_sblkno)
210#define ufs_cgcmin(c) (ufs_cgstart(c) + uspi->s_cblkno)
211#define ufs_cgimin(c) (ufs_cgstart(c) + uspi->s_iblkno)
212#define ufs_cgdmin(c) (ufs_cgstart(c) + uspi->s_dblkno)
213
214
215
216
217
218
219
220#define ufs_inotocg(x) ((x) / uspi->s_ipg)
221#define ufs_inotocgoff(x) ((x) % uspi->s_ipg)
222#define ufs_inotofsba(x) (((u64)ufs_cgimin(ufs_inotocg(x))) + ufs_inotocgoff(x) / uspi->s_inopf)
223#define ufs_inotofsbo(x) ((x) % uspi->s_inopf)
224
225
226
227
228#define ufs_cbtocylno(bno) \
229 ((bno) * uspi->s_nspf / uspi->s_spc)
230#define ufs_cbtorpos(bno) \
231 ((((bno) * uspi->s_nspf % uspi->s_spc / uspi->s_nsect \
232 * uspi->s_trackskew + (bno) * uspi->s_nspf % uspi->s_spc \
233 % uspi->s_nsect * uspi->s_interleave) % uspi->s_nsect \
234 * uspi->s_nrpos) / uspi->s_npsect)
235
236
237
238
239
240
241#define ufs_blkoff(loc) ((loc) & uspi->s_qbmask)
242#define ufs_fragoff(loc) ((loc) & uspi->s_qfmask)
243#define ufs_lblktosize(blk) ((blk) << uspi->s_bshift)
244#define ufs_lblkno(loc) ((loc) >> uspi->s_bshift)
245#define ufs_numfrags(loc) ((loc) >> uspi->s_fshift)
246#define ufs_blkroundup(size) (((size) + uspi->s_qbmask) & uspi->s_bmask)
247#define ufs_fragroundup(size) (((size) + uspi->s_qfmask) & uspi->s_fmask)
248#define ufs_fragstoblks(frags) ((frags) >> uspi->s_fpbshift)
249#define ufs_blkstofrags(blks) ((blks) << uspi->s_fpbshift)
250#define ufs_fragnum(fsb) ((fsb) & uspi->s_fpbmask)
251#define ufs_blknum(fsb) ((fsb) & ~uspi->s_fpbmask)
252
253#define UFS_MAXNAMLEN 255
254#define UFS_MAXMNTLEN 512
255#define UFS2_MAXMNTLEN 468
256#define UFS2_MAXVOLLEN 32
257#define UFS_MAXCSBUFS 31
258#define UFS_LINK_MAX 32000
259
260
261
262#define UFS2_NOCSPTRS 28
263
264
265
266
267
268#define UFS_DIR_PAD 4
269#define UFS_DIR_ROUND (UFS_DIR_PAD - 1)
270#define UFS_DIR_REC_LEN(name_len) (((name_len) + 1 + 8 + UFS_DIR_ROUND) & ~UFS_DIR_ROUND)
271
272struct ufs_timeval {
273 __fs32 tv_sec;
274 __fs32 tv_usec;
275};
276
277struct ufs_dir_entry {
278 __fs32 d_ino;
279 __fs16 d_reclen;
280 union {
281 __fs16 d_namlen;
282 struct {
283 __u8 d_type;
284 __u8 d_namlen;
285 } d_44;
286 } d_u;
287 __u8 d_name[UFS_MAXNAMLEN + 1];
288};
289
290struct ufs_csum {
291 __fs32 cs_ndir;
292 __fs32 cs_nbfree;
293 __fs32 cs_nifree;
294 __fs32 cs_nffree;
295};
296struct ufs2_csum_total {
297 __fs64 cs_ndir;
298 __fs64 cs_nbfree;
299 __fs64 cs_nifree;
300 __fs64 cs_nffree;
301 __fs64 cs_numclusters;
302 __fs64 cs_spare[3];
303};
304
305struct ufs_csum_core {
306 __u64 cs_ndir;
307 __u64 cs_nbfree;
308 __u64 cs_nifree;
309 __u64 cs_nffree;
310 __u64 cs_numclusters;
311};
312
313
314
315
316#define UFS_UNCLEAN 0x01
317#define UFS_DOSOFTDEP 0x02
318#define UFS_NEEDSFSCK 0x04
319#define UFS_INDEXDIRS 0x08
320#define UFS_ACLS 0x10
321#define UFS_MULTILABEL 0x20
322#define UFS_FLAGS_UPDATED 0x80
323
324#if 0
325
326
327
328
329
330
331struct ufs_super_block {
332 union {
333 struct {
334 __fs32 fs_link;
335 } fs_42;
336 struct {
337 __fs32 fs_state;
338 } fs_sun;
339 } fs_u0;
340 __fs32 fs_rlink;
341 __fs32 fs_sblkno;
342 __fs32 fs_cblkno;
343 __fs32 fs_iblkno;
344 __fs32 fs_dblkno;
345 __fs32 fs_cgoffset;
346 __fs32 fs_cgmask;
347 __fs32 fs_time;
348 __fs32 fs_size;
349 __fs32 fs_dsize;
350 __fs32 fs_ncg;
351 __fs32 fs_bsize;
352 __fs32 fs_fsize;
353 __fs32 fs_frag;
354
355 __fs32 fs_minfree;
356 __fs32 fs_rotdelay;
357 __fs32 fs_rps;
358
359 __fs32 fs_bmask;
360 __fs32 fs_fmask;
361 __fs32 fs_bshift;
362 __fs32 fs_fshift;
363
364 __fs32 fs_maxcontig;
365 __fs32 fs_maxbpg;
366
367 __fs32 fs_fragshift;
368 __fs32 fs_fsbtodb;
369 __fs32 fs_sbsize;
370 __fs32 fs_csmask;
371 __fs32 fs_csshift;
372 __fs32 fs_nindir;
373 __fs32 fs_inopb;
374 __fs32 fs_nspf;
375
376 __fs32 fs_optim;
377
378 union {
379 struct {
380 __fs32 fs_npsect;
381 } fs_sun;
382 struct {
383 __fs32 fs_state;
384 } fs_sunx86;
385 } fs_u1;
386 __fs32 fs_interleave;
387 __fs32 fs_trackskew;
388
389
390
391
392 __fs32 fs_id[2];
393
394 __fs32 fs_csaddr;
395 __fs32 fs_cssize;
396 __fs32 fs_cgsize;
397
398 __fs32 fs_ntrak;
399 __fs32 fs_nsect;
400 __fs32 fs_spc;
401
402 __fs32 fs_ncyl;
403
404 __fs32 fs_cpg;
405 __fs32 fs_ipg;
406 __fs32 fs_fpg;
407
408 struct ufs_csum fs_cstotal;
409
410 __s8 fs_fmod;
411 __s8 fs_clean;
412 __s8 fs_ronly;
413 __s8 fs_flags;
414 union {
415 struct {
416 __s8 fs_fsmnt[UFS_MAXMNTLEN];
417 __fs32 fs_cgrotor;
418 __fs32 fs_csp[UFS_MAXCSBUFS];
419 __fs32 fs_maxcluster;
420 __fs32 fs_cpc;
421 __fs16 fs_opostbl[16][8];
422 } fs_u1;
423 struct {
424 __s8 fs_fsmnt[UFS2_MAXMNTLEN];
425 __u8 fs_volname[UFS2_MAXVOLLEN];
426 __fs64 fs_swuid;
427 __fs32 fs_pad;
428 __fs32 fs_cgrotor;
429 __fs32 fs_ocsp[UFS2_NOCSPTRS];
430 __fs32 fs_contigdirs;
431 __fs32 fs_csp;
432 __fs32 fs_maxcluster;
433 __fs32 fs_active;
434 __fs32 fs_old_cpc;
435 __fs32 fs_maxbsize;
436 __fs64 fs_sparecon64[17];
437 __fs64 fs_sblockloc;
438 struct ufs2_csum_total fs_cstotal;
439 struct ufs_timeval fs_time;
440 __fs64 fs_size;
441 __fs64 fs_dsize;
442 __fs64 fs_csaddr;
443 __fs64 fs_pendingblocks;
444 __fs32 fs_pendinginodes;
445 } fs_u2;
446 } fs_u11;
447 union {
448 struct {
449 __fs32 fs_sparecon[53];
450 __fs32 fs_reclaim;
451 __fs32 fs_sparecon2[1];
452 __fs32 fs_state;
453 __fs32 fs_qbmask[2];
454 __fs32 fs_qfmask[2];
455 } fs_sun;
456 struct {
457 __fs32 fs_sparecon[53];
458 __fs32 fs_reclaim;
459 __fs32 fs_sparecon2[1];
460 __fs32 fs_npsect;
461 __fs32 fs_qbmask[2];
462 __fs32 fs_qfmask[2];
463 } fs_sunx86;
464 struct {
465 __fs32 fs_sparecon[50];
466 __fs32 fs_contigsumsize;
467 __fs32 fs_maxsymlinklen;
468 __fs32 fs_inodefmt;
469 __fs32 fs_maxfilesize[2];
470 __fs32 fs_qbmask[2];
471 __fs32 fs_qfmask[2];
472 __fs32 fs_state;
473 } fs_44;
474 } fs_u2;
475 __fs32 fs_postblformat;
476 __fs32 fs_nrpos;
477 __fs32 fs_postbloff;
478 __fs32 fs_rotbloff;
479 __fs32 fs_magic;
480 __u8 fs_space[1];
481};
482#endif
483
484
485
486
487#define UFS_OPTTIME 0
488#define UFS_OPTSPACE 1
489
490
491
492
493#define UFS_42POSTBLFMT -1
494#define UFS_DYNAMICPOSTBLFMT 1
495
496
497
498
499#define fs_cs(indx) s_csp[(indx)]
500
501
502
503
504
505
506
507#define CG_MAGIC 0x090255
508#define ufs_cg_chkmagic(sb, ucg) \
509 (fs32_to_cpu((sb), (ucg)->cg_magic) == CG_MAGIC)
510
511
512
513#define ufs_ocg_blktot(sb, ucg) fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_btot)
514#define ufs_ocg_blks(sb, ucg, cylno) fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_b[cylno])
515#define ufs_ocg_inosused(sb, ucg) fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_iused)
516#define ufs_ocg_blksfree(sb, ucg) fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_free)
517#define ufs_ocg_chkmagic(sb, ucg) \
518 (fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_magic) == CG_MAGIC)
519
520
521
522
523struct ufs_cylinder_group {
524 __fs32 cg_link;
525 __fs32 cg_magic;
526 __fs32 cg_time;
527 __fs32 cg_cgx;
528 __fs16 cg_ncyl;
529 __fs16 cg_niblk;
530 __fs32 cg_ndblk;
531 struct ufs_csum cg_cs;
532 __fs32 cg_rotor;
533 __fs32 cg_frotor;
534 __fs32 cg_irotor;
535 __fs32 cg_frsum[UFS_MAXFRAG];
536 __fs32 cg_btotoff;
537 __fs32 cg_boff;
538 __fs32 cg_iusedoff;
539 __fs32 cg_freeoff;
540 __fs32 cg_nextfreeoff;
541 union {
542 struct {
543 __fs32 cg_clustersumoff;
544 __fs32 cg_clusteroff;
545 __fs32 cg_nclusterblks;
546 __fs32 cg_sparecon[13];
547 } cg_44;
548 struct {
549 __fs32 cg_clustersumoff;
550 __fs32 cg_clusteroff;
551 __fs32 cg_nclusterblks;
552 __fs32 cg_niblk;
553 __fs32 cg_initediblk;
554 __fs32 cg_sparecon32[3];
555 __fs64 cg_time;
556 __fs64 cg_sparecon[3];
557 } cg_u2;
558 __fs32 cg_sparecon[16];
559 } cg_u;
560 __u8 cg_space[1];
561
562};
563
564
565struct ufs_old_cylinder_group {
566 __fs32 cg_link;
567 __fs32 cg_rlink;
568 __fs32 cg_time;
569 __fs32 cg_cgx;
570 __fs16 cg_ncyl;
571 __fs16 cg_niblk;
572 __fs32 cg_ndblk;
573 struct ufs_csum cg_cs;
574 __fs32 cg_rotor;
575 __fs32 cg_frotor;
576 __fs32 cg_irotor;
577 __fs32 cg_frsum[8];
578 __fs32 cg_btot[32];
579 __fs16 cg_b[32][8];
580 __u8 cg_iused[256];
581 __fs32 cg_magic;
582 __u8 cg_free[1];
583
584};
585
586
587
588
589struct ufs_inode {
590 __fs16 ui_mode;
591 __fs16 ui_nlink;
592 union {
593 struct {
594 __fs16 ui_suid;
595 __fs16 ui_sgid;
596 } oldids;
597 __fs32 ui_inumber;
598 __fs32 ui_author;
599 } ui_u1;
600 __fs64 ui_size;
601 struct ufs_timeval ui_atime;
602 struct ufs_timeval ui_mtime;
603 struct ufs_timeval ui_ctime;
604 union {
605 struct {
606 __fs32 ui_db[UFS_NDADDR];
607 __fs32 ui_ib[UFS_NINDIR];
608 } ui_addr;
609 __u8 ui_symlink[4*(UFS_NDADDR+UFS_NINDIR)];
610 } ui_u2;
611 __fs32 ui_flags;
612 __fs32 ui_blocks;
613 __fs32 ui_gen;
614 union {
615 struct {
616 __fs32 ui_shadow;
617 __fs32 ui_uid;
618 __fs32 ui_gid;
619 __fs32 ui_oeftflag;
620 } ui_sun;
621 struct {
622 __fs32 ui_uid;
623 __fs32 ui_gid;
624 __fs32 ui_spare[2];
625 } ui_44;
626 struct {
627 __fs32 ui_uid;
628 __fs32 ui_gid;
629 __fs16 ui_modeh;
630 __fs16 ui_spare;
631 __fs32 ui_trans;
632 } ui_hurd;
633 } ui_u3;
634};
635
636#define UFS_NXADDR 2
637struct ufs2_inode {
638 __fs16 ui_mode;
639 __fs16 ui_nlink;
640 __fs32 ui_uid;
641 __fs32 ui_gid;
642 __fs32 ui_blksize;
643 __fs64 ui_size;
644 __fs64 ui_blocks;
645 __fs64 ui_atime;
646 __fs64 ui_mtime;
647 __fs64 ui_ctime;
648 __fs64 ui_birthtime;
649 __fs32 ui_mtimensec;
650 __fs32 ui_atimensec;
651 __fs32 ui_ctimensec;
652 __fs32 ui_birthnsec;
653 __fs32 ui_gen;
654 __fs32 ui_kernflags;
655 __fs32 ui_flags;
656 __fs32 ui_extsize;
657 __fs64 ui_extb[UFS_NXADDR];
658 union {
659 struct {
660 __fs64 ui_db[UFS_NDADDR];
661 __fs64 ui_ib[UFS_NINDIR];
662 } ui_addr;
663 __u8 ui_symlink[2*4*(UFS_NDADDR+UFS_NINDIR)];
664 } ui_u2;
665 __fs64 ui_spare[3];
666};
667
668
669
670
671#define UFS_UF_SETTABLE 0x0000ffff
672#define UFS_UF_NODUMP 0x00000001
673#define UFS_UF_IMMUTABLE 0x00000002
674#define UFS_UF_APPEND 0x00000004
675#define UFS_UF_OPAQUE 0x00000008
676#define UFS_UF_NOUNLINK 0x00000010
677
678#define UFS_SF_SETTABLE 0xffff0000
679#define UFS_SF_ARCHIVED 0x00010000
680#define UFS_SF_IMMUTABLE 0x00020000
681#define UFS_SF_APPEND 0x00040000
682#define UFS_SF_NOUNLINK 0x00100000
683
684
685
686
687
688struct ufs_buffer_head {
689 __u64 fragment;
690 __u64 count;
691 struct buffer_head * bh[UFS_MAXFRAG];
692};
693
694struct ufs_cg_private_info {
695 struct ufs_buffer_head c_ubh;
696 __u32 c_cgx;
697 __u16 c_ncyl;
698 __u16 c_niblk;
699 __u32 c_ndblk;
700 __u32 c_rotor;
701 __u32 c_frotor;
702 __u32 c_irotor;
703 __u32 c_btotoff;
704 __u32 c_boff;
705 __u32 c_iusedoff;
706 __u32 c_freeoff;
707 __u32 c_nextfreeoff;
708 __u32 c_clustersumoff;
709 __u32 c_clusteroff;
710 __u32 c_nclusterblks;
711};
712
713
714struct ufs_sb_private_info {
715 struct ufs_buffer_head s_ubh;
716 struct ufs_csum_core cs_total;
717 __u32 s_sblkno;
718 __u32 s_cblkno;
719 __u32 s_iblkno;
720 __u32 s_dblkno;
721 __u32 s_cgoffset;
722 __u32 s_cgmask;
723 __u32 s_size;
724 __u32 s_dsize;
725 __u64 s_u2_size;
726 __u64 s_u2_dsize;
727 __u32 s_ncg;
728 __u32 s_bsize;
729 __u32 s_fsize;
730 __u32 s_fpb;
731 __u32 s_minfree;
732 __u32 s_bmask;
733 __u32 s_fmask;
734 __u32 s_bshift;
735 __u32 s_fshift;
736 __u32 s_fpbshift;
737 __u32 s_fsbtodb;
738 __u32 s_sbsize;
739 __u32 s_csmask;
740 __u32 s_csshift;
741 __u32 s_nindir;
742 __u32 s_inopb;
743 __u32 s_nspf;
744 __u32 s_npsect;
745 __u32 s_interleave;
746 __u32 s_trackskew;
747 __u64 s_csaddr;
748 __u32 s_cssize;
749 __u32 s_cgsize;
750 __u32 s_ntrak;
751 __u32 s_nsect;
752 __u32 s_spc;
753 __u32 s_ipg;
754 __u32 s_fpg;
755 __u32 s_cpc;
756 __s32 s_contigsumsize;
757 __s64 s_qbmask;
758 __s64 s_qfmask;
759 __s32 s_postblformat;
760 __s32 s_nrpos;
761 __s32 s_postbloff;
762 __s32 s_rotbloff;
763
764 __u32 s_fpbmask;
765 __u32 s_apb;
766 __u32 s_2apb;
767 __u32 s_3apb;
768 __u32 s_apbmask;
769 __u32 s_apbshift;
770 __u32 s_2apbshift;
771 __u32 s_3apbshift;
772 __u32 s_nspfshift;
773 __u32 s_nspb;
774 __u32 s_inopf;
775 __u32 s_sbbase;
776 __u32 s_bpf;
777 __u32 s_bpfshift;
778 __u32 s_bpfmask;
779
780 __u32 s_maxsymlinklen;
781 __s32 fs_magic;
782 unsigned int s_dirblksize;
783};
784
785
786
787
788
789
790
791struct ufs_super_block_first {
792 union {
793 struct {
794 __fs32 fs_link;
795 } fs_42;
796 struct {
797 __fs32 fs_state;
798 } fs_sun;
799 } fs_u0;
800 __fs32 fs_rlink;
801 __fs32 fs_sblkno;
802 __fs32 fs_cblkno;
803 __fs32 fs_iblkno;
804 __fs32 fs_dblkno;
805 __fs32 fs_cgoffset;
806 __fs32 fs_cgmask;
807 __fs32 fs_time;
808 __fs32 fs_size;
809 __fs32 fs_dsize;
810 __fs32 fs_ncg;
811 __fs32 fs_bsize;
812 __fs32 fs_fsize;
813 __fs32 fs_frag;
814 __fs32 fs_minfree;
815 __fs32 fs_rotdelay;
816 __fs32 fs_rps;
817 __fs32 fs_bmask;
818 __fs32 fs_fmask;
819 __fs32 fs_bshift;
820 __fs32 fs_fshift;
821 __fs32 fs_maxcontig;
822 __fs32 fs_maxbpg;
823 __fs32 fs_fragshift;
824 __fs32 fs_fsbtodb;
825 __fs32 fs_sbsize;
826 __fs32 fs_csmask;
827 __fs32 fs_csshift;
828 __fs32 fs_nindir;
829 __fs32 fs_inopb;
830 __fs32 fs_nspf;
831 __fs32 fs_optim;
832 union {
833 struct {
834 __fs32 fs_npsect;
835 } fs_sun;
836 struct {
837 __fs32 fs_state;
838 } fs_sunx86;
839 } fs_u1;
840 __fs32 fs_interleave;
841 __fs32 fs_trackskew;
842 __fs32 fs_id[2];
843 __fs32 fs_csaddr;
844 __fs32 fs_cssize;
845 __fs32 fs_cgsize;
846 __fs32 fs_ntrak;
847 __fs32 fs_nsect;
848 __fs32 fs_spc;
849 __fs32 fs_ncyl;
850 __fs32 fs_cpg;
851 __fs32 fs_ipg;
852 __fs32 fs_fpg;
853 struct ufs_csum fs_cstotal;
854 __s8 fs_fmod;
855 __s8 fs_clean;
856 __s8 fs_ronly;
857 __s8 fs_flags;
858 __s8 fs_fsmnt[UFS_MAXMNTLEN - 212];
859
860};
861
862struct ufs_super_block_second {
863 union {
864 struct {
865 __s8 fs_fsmnt[212];
866 __fs32 fs_cgrotor;
867 __fs32 fs_csp[UFS_MAXCSBUFS];
868 __fs32 fs_maxcluster;
869 __fs32 fs_cpc;
870 __fs16 fs_opostbl[82];
871 } fs_u1;
872 struct {
873 __s8 fs_fsmnt[UFS2_MAXMNTLEN - UFS_MAXMNTLEN + 212];
874 __u8 fs_volname[UFS2_MAXVOLLEN];
875 __fs64 fs_swuid;
876 __fs32 fs_pad;
877 __fs32 fs_cgrotor;
878 __fs32 fs_ocsp[UFS2_NOCSPTRS];
879 __fs32 fs_contigdirs;
880 __fs32 fs_csp;
881 __fs32 fs_maxcluster;
882 __fs32 fs_active;
883 __fs32 fs_old_cpc;
884 __fs32 fs_maxbsize;
885 __fs64 fs_sparecon64[17];
886 __fs64 fs_sblockloc;
887 __fs64 cs_ndir;
888 __fs64 cs_nbfree;
889 } fs_u2;
890 } fs_un;
891};
892
893struct ufs_super_block_third {
894 union {
895 struct {
896 __fs16 fs_opostbl[46];
897 } fs_u1;
898 struct {
899 __fs64 cs_nifree;
900 __fs64 cs_nffree;
901 __fs64 cs_numclusters;
902 __fs64 cs_spare[3];
903 struct ufs_timeval fs_time;
904 __fs64 fs_size;
905 __fs64 fs_dsize;
906 __fs64 fs_csaddr;
907 __fs64 fs_pendingblocks;
908 __fs32 fs_pendinginodes;
909 } __attribute__ ((packed)) fs_u2;
910 } fs_un1;
911 union {
912 struct {
913 __fs32 fs_sparecon[53];
914 __fs32 fs_reclaim;
915 __fs32 fs_sparecon2[1];
916 __fs32 fs_state;
917 __fs32 fs_qbmask[2];
918 __fs32 fs_qfmask[2];
919 } fs_sun;
920 struct {
921 __fs32 fs_sparecon[53];
922 __fs32 fs_reclaim;
923 __fs32 fs_sparecon2[1];
924 __fs32 fs_npsect;
925 __fs32 fs_qbmask[2];
926 __fs32 fs_qfmask[2];
927 } fs_sunx86;
928 struct {
929 __fs32 fs_sparecon[50];
930 __fs32 fs_contigsumsize;
931 __fs32 fs_maxsymlinklen;
932 __fs32 fs_inodefmt;
933 __fs32 fs_maxfilesize[2];
934 __fs32 fs_qbmask[2];
935 __fs32 fs_qfmask[2];
936 __fs32 fs_state;
937 } fs_44;
938 } fs_un2;
939 __fs32 fs_postblformat;
940 __fs32 fs_nrpos;
941 __fs32 fs_postbloff;
942 __fs32 fs_rotbloff;
943 __fs32 fs_magic;
944 __u8 fs_space[1];
945};
946
947#endif
948