aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ufs_fs.h
diff options
context:
space:
mode:
authorEvgeniy Dushistov <dushistov@mail.ru>2006-06-25 08:47:29 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-25 13:01:04 -0400
commit647b7e87b56f594daf648f44abfbeeb5eb6a9457 (patch)
tree2a81679a2a9f7ee0a0ad984fbae4d43be050fd51 /include/linux/ufs_fs.h
parentf391475812ba39afa322c835217ffe936f5e754a (diff)
[PATCH] ufs: one way to access super block
Super block of UFS usually has size >512, because of fragment size may be 512, this cause some problems. Currently, there are two methods to work with ufs super block: 1) split structure which describes ufs super blocks into structures with size <=512 2) use one structure which describes ufs super block, and hope that array of "buffer_head" which holds "super block", has such construction: bh[n]->b_data + bh[n]->b_size == bh[n + 1]->b_data The second variant may cause some problems in the future, and usage of two variants cause unnecessary code duplication. This patch remove the second variant. Also patch contains some CodingStyle fixes. Signed-off-by: Evgeniy Dushistov <dushistov@mail.ru> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/ufs_fs.h')
-rw-r--r--include/linux/ufs_fs.h61
1 files changed, 52 insertions, 9 deletions
diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h
index 28b31591f68..87b0a658bec 100644
--- a/include/linux/ufs_fs.h
+++ b/include/linux/ufs_fs.h
@@ -351,8 +351,12 @@ struct ufs2_csum_total {
351 __fs64 cs_spare[3]; /* future expansion */ 351 __fs64 cs_spare[3]; /* future expansion */
352}; 352};
353 353
354#if 0
354/* 355/*
355 * This is the actual superblock, as it is laid out on the disk. 356 * This is the actual superblock, as it is laid out on the disk.
357 * Do NOT use this structure, because of sizeof(ufs_super_block) > 512 and
358 * it may occupy several blocks, use
359 * struct ufs_super_block_(first,second,third) instead.
356 */ 360 */
357struct ufs_super_block { 361struct ufs_super_block {
358 __fs32 fs_link; /* UNUSED */ 362 __fs32 fs_link; /* UNUSED */
@@ -498,6 +502,7 @@ struct ufs_super_block {
498 __fs32 fs_magic; /* magic number */ 502 __fs32 fs_magic; /* magic number */
499 __u8 fs_space[1]; /* list of blocks for each rotation */ 503 __u8 fs_space[1]; /* list of blocks for each rotation */
500}; 504};
505#endif/*struct ufs_super_block*/
501 506
502/* 507/*
503 * Preference for optimization. 508 * Preference for optimization.
@@ -837,16 +842,54 @@ struct ufs_super_block_first {
837}; 842};
838 843
839struct ufs_super_block_second { 844struct ufs_super_block_second {
840 __s8 fs_fsmnt[212]; 845 union {
841 __fs32 fs_cgrotor; 846 struct {
842 __fs32 fs_csp[UFS_MAXCSBUFS]; 847 __s8 fs_fsmnt[212];
843 __fs32 fs_maxcluster; 848 __fs32 fs_cgrotor;
844 __fs32 fs_cpc; 849 __fs32 fs_csp[UFS_MAXCSBUFS];
845 __fs16 fs_opostbl[82]; 850 __fs32 fs_maxcluster;
846}; 851 __fs32 fs_cpc;
852 __fs16 fs_opostbl[82];
853 } fs_u1;
854 struct {
855 __s8 fs_fsmnt[UFS2_MAXMNTLEN - UFS_MAXMNTLEN + 212];
856 __u8 fs_volname[UFS2_MAXVOLLEN];
857 __fs64 fs_swuid;
858 __fs32 fs_pad;
859 __fs32 fs_cgrotor;
860 __fs32 fs_ocsp[UFS2_NOCSPTRS];
861 __fs32 fs_contigdirs;
862 __fs32 fs_csp;
863 __fs32 fs_maxcluster;
864 __fs32 fs_active;
865 __fs32 fs_old_cpc;
866 __fs32 fs_maxbsize;
867 __fs64 fs_sparecon64[17];
868 __fs64 fs_sblockloc;
869 __fs64 cs_ndir;
870 __fs64 cs_nbfree;
871 } fs_u2;
872 } fs_un;
873};
847 874
848struct ufs_super_block_third { 875struct ufs_super_block_third {
849 __fs16 fs_opostbl[46]; 876 union {
877 struct {
878 __fs16 fs_opostbl[46];
879 } fs_u1;
880 struct {
881 __fs64 cs_nifree; /* number of free inodes */
882 __fs64 cs_nffree; /* number of free frags */
883 __fs64 cs_numclusters; /* number of free clusters */
884 __fs64 cs_spare[3]; /* future expansion */
885 struct ufs_timeval fs_time; /* last time written */
886 __fs64 fs_size; /* number of blocks in fs */
887 __fs64 fs_dsize; /* number of data blocks in fs */
888 __fs64 fs_csaddr; /* blk addr of cyl grp summary area */
889 __fs64 fs_pendingblocks;/* blocks in process of being freed */
890 __fs32 fs_pendinginodes;/*inodes in process of being freed */
891 } fs_u2;
892 } fs_un1;
850 union { 893 union {
851 struct { 894 struct {
852 __fs32 fs_sparecon[53];/* reserved for future constants */ 895 __fs32 fs_sparecon[53];/* reserved for future constants */
@@ -874,7 +917,7 @@ struct ufs_super_block_third {
874 __fs32 fs_qfmask[2]; /* ~usb_fmask */ 917 __fs32 fs_qfmask[2]; /* ~usb_fmask */
875 __fs32 fs_state; /* file system state time stamp */ 918 __fs32 fs_state; /* file system state time stamp */
876 } fs_44; 919 } fs_44;
877 } fs_u2; 920 } fs_un2;
878 __fs32 fs_postblformat; 921 __fs32 fs_postblformat;
879 __fs32 fs_nrpos; 922 __fs32 fs_nrpos;
880 __fs32 fs_postbloff; 923 __fs32 fs_postbloff;