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