aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ufs_fs.h
diff options
context:
space:
mode:
authorMark Fortescue <mark@mtfhpc.demon.co.uk>2007-10-17 02:26:31 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-17 11:42:49 -0400
commit252e211e90ce56bf005cb533ad5a297c18c19407 (patch)
tree9b37f80e1f4c1ec74e150edb3ea7b8d70faea79a /include/linux/ufs_fs.h
parentef2fb67989d30fea475bb01c5b7ca44adbce5dea (diff)
Add in SunOS 4.1.x compatible mode for UFS
Add in support for SunOS 4.1.x flavor of BSD 4.2 UFS filing system Macros have been put in to alow suport for the old static table Cylinder Groups but this implementation does not use them yet. This also fixes Solaris UFS filing system access by disabling fast symbolic links as Sun's version of UFS does not support on-disk fast symbolic links. Tested by: Ppartitioning a new disk using SunOS 4.1.1, creating a UFS filing system on one of the partitions and writing some files to the filing system. Using Linux-2.6.22 (patched) to read the files and then write a shed load of files to the UFS partition. Using SunOS 4.1.1 to verify the filing system is OK and to check the files. The test host is a sun4c SS1 Clone. [akpm@linux-foundation.org: coding style fixes] [adobriyan@gmail.com: fix oops] Signed-off-by: Mark Fortescue <mark@mtfhpc.demon.co.uk> Cc: Evgeniy Dushistov <dushistov@mail.ru> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/ufs_fs.h')
-rw-r--r--include/linux/ufs_fs.h55
1 files changed, 51 insertions, 4 deletions
diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h
index daeba22b7656..52730d2c9ad9 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 */
376struct ufs_super_block { 378struct 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 */
612struct 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 */
798struct ufs_super_block_first { 838struct 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;