diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/ufs_fs.h | 55 |
1 files changed, 51 insertions, 4 deletions
diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h index daeba22b76..52730d2c9a 100644 --- a/include/linux/ufs_fs.h +++ b/include/linux/ufs_fs.h | |||
| @@ -170,8 +170,9 @@ typedef __u16 __bitwise __fs16; | |||
| 170 | #define UFS_ST_MASK 0x00000700 /* mask for the following */ | 170 | #define UFS_ST_MASK 0x00000700 /* mask for the following */ |
| 171 | #define UFS_ST_OLD 0x00000000 | 171 | #define UFS_ST_OLD 0x00000000 |
| 172 | #define UFS_ST_44BSD 0x00000100 | 172 | #define UFS_ST_44BSD 0x00000100 |
| 173 | #define UFS_ST_SUN 0x00000200 | 173 | #define UFS_ST_SUN 0x00000200 /* Solaris */ |
| 174 | #define UFS_ST_SUNx86 0x00000400 | 174 | #define UFS_ST_SUNOS 0x00000300 |
| 175 | #define UFS_ST_SUNx86 0x00000400 /* Solaris x86 */ | ||
| 175 | /*cylinder group encoding */ | 176 | /*cylinder group encoding */ |
| 176 | #define UFS_CG_MASK 0x00003000 /* mask for the following */ | 177 | #define UFS_CG_MASK 0x00003000 /* mask for the following */ |
| 177 | #define UFS_CG_OLD 0x00000000 | 178 | #define UFS_CG_OLD 0x00000000 |
| @@ -204,6 +205,7 @@ typedef __u16 __bitwise __fs16; | |||
| 204 | #define UFS_MOUNT_UFSTYPE_SUNx86 0x00000400 | 205 | #define UFS_MOUNT_UFSTYPE_SUNx86 0x00000400 |
| 205 | #define UFS_MOUNT_UFSTYPE_HP 0x00000800 | 206 | #define UFS_MOUNT_UFSTYPE_HP 0x00000800 |
| 206 | #define UFS_MOUNT_UFSTYPE_UFS2 0x00001000 | 207 | #define UFS_MOUNT_UFSTYPE_UFS2 0x00001000 |
| 208 | #define UFS_MOUNT_UFSTYPE_SUNOS 0x00002000 | ||
| 207 | 209 | ||
| 208 | #define ufs_clear_opt(o,opt) o &= ~UFS_MOUNT_##opt | 210 | #define ufs_clear_opt(o,opt) o &= ~UFS_MOUNT_##opt |
| 209 | #define ufs_set_opt(o,opt) o |= UFS_MOUNT_##opt | 211 | #define ufs_set_opt(o,opt) o |= UFS_MOUNT_##opt |
| @@ -374,7 +376,14 @@ struct ufs_csum_core { | |||
| 374 | * struct ufs_super_block_(first,second,third) instead. | 376 | * struct ufs_super_block_(first,second,third) instead. |
| 375 | */ | 377 | */ |
| 376 | struct ufs_super_block { | 378 | struct ufs_super_block { |
| 377 | __fs32 fs_link; /* UNUSED */ | 379 | union { |
| 380 | struct { | ||
| 381 | __fs32 fs_link; /* UNUSED */ | ||
| 382 | } fs_42; | ||
| 383 | struct { | ||
| 384 | __fs32 fs_state; /* file system state flag */ | ||
| 385 | } fs_sun; | ||
| 386 | } fs_u0; | ||
| 378 | __fs32 fs_rlink; /* UNUSED */ | 387 | __fs32 fs_rlink; /* UNUSED */ |
| 379 | __fs32 fs_sblkno; /* addr of super-block in filesys */ | 388 | __fs32 fs_sblkno; /* addr of super-block in filesys */ |
| 380 | __fs32 fs_cblkno; /* offset of cyl-block in filesys */ | 389 | __fs32 fs_cblkno; /* offset of cyl-block in filesys */ |
| @@ -545,6 +554,15 @@ struct ufs_super_block { | |||
| 545 | #define CG_MAGIC 0x090255 | 554 | #define CG_MAGIC 0x090255 |
| 546 | #define ufs_cg_chkmagic(sb, ucg) \ | 555 | #define ufs_cg_chkmagic(sb, ucg) \ |
| 547 | (fs32_to_cpu((sb), (ucg)->cg_magic) == CG_MAGIC) | 556 | (fs32_to_cpu((sb), (ucg)->cg_magic) == CG_MAGIC) |
| 557 | /* | ||
| 558 | * Macros for access to old cylinder group array structures | ||
| 559 | */ | ||
| 560 | #define ufs_ocg_blktot(sb, ucg) fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_btot) | ||
| 561 | #define ufs_ocg_blks(sb, ucg, cylno) fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_b[cylno]) | ||
| 562 | #define ufs_ocg_inosused(sb, ucg) fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_iused) | ||
| 563 | #define ufs_ocg_blksfree(sb, ucg) fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_free) | ||
| 564 | #define ufs_ocg_chkmagic(sb, ucg) \ | ||
| 565 | (fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_magic) == CG_MAGIC) | ||
| 548 | 566 | ||
| 549 | /* | 567 | /* |
| 550 | * size of this structure is 172 B | 568 | * size of this structure is 172 B |
| @@ -590,6 +608,28 @@ struct ufs_cylinder_group { | |||
| 590 | /* actually longer */ | 608 | /* actually longer */ |
| 591 | }; | 609 | }; |
| 592 | 610 | ||
| 611 | /* Historic Cylinder group info */ | ||
| 612 | struct ufs_old_cylinder_group { | ||
| 613 | __fs32 cg_link; /* linked list of cyl groups */ | ||
| 614 | __fs32 cg_rlink; /* for incore cyl groups */ | ||
| 615 | __fs32 cg_time; /* time last written */ | ||
| 616 | __fs32 cg_cgx; /* we are the cgx'th cylinder group */ | ||
| 617 | __fs16 cg_ncyl; /* number of cyl's this cg */ | ||
| 618 | __fs16 cg_niblk; /* number of inode blocks this cg */ | ||
| 619 | __fs32 cg_ndblk; /* number of data blocks this cg */ | ||
| 620 | struct ufs_csum cg_cs; /* cylinder summary information */ | ||
| 621 | __fs32 cg_rotor; /* position of last used block */ | ||
| 622 | __fs32 cg_frotor; /* position of last used frag */ | ||
| 623 | __fs32 cg_irotor; /* position of last used inode */ | ||
| 624 | __fs32 cg_frsum[8]; /* counts of available frags */ | ||
| 625 | __fs32 cg_btot[32]; /* block totals per cylinder */ | ||
| 626 | __fs16 cg_b[32][8]; /* positions of free blocks */ | ||
| 627 | __u8 cg_iused[256]; /* used inode map */ | ||
| 628 | __fs32 cg_magic; /* magic number */ | ||
| 629 | __u8 cg_free[1]; /* free block map */ | ||
| 630 | /* actually longer */ | ||
| 631 | }; | ||
| 632 | |||
| 593 | /* | 633 | /* |
| 594 | * structure of an on-disk inode | 634 | * structure of an on-disk inode |
| 595 | */ | 635 | */ |
| @@ -796,7 +836,14 @@ struct ufs_sb_private_info { | |||
| 796 | * ufs_super_block_third 356 | 836 | * ufs_super_block_third 356 |
| 797 | */ | 837 | */ |
| 798 | struct ufs_super_block_first { | 838 | struct ufs_super_block_first { |
| 799 | __fs32 fs_link; | 839 | union { |
| 840 | struct { | ||
| 841 | __fs32 fs_link; /* UNUSED */ | ||
| 842 | } fs_42; | ||
| 843 | struct { | ||
| 844 | __fs32 fs_state; /* file system state flag */ | ||
| 845 | } fs_sun; | ||
| 846 | } fs_u0; | ||
| 800 | __fs32 fs_rlink; | 847 | __fs32 fs_rlink; |
| 801 | __fs32 fs_sblkno; | 848 | __fs32 fs_sblkno; |
| 802 | __fs32 fs_cblkno; | 849 | __fs32 fs_cblkno; |
