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