File super_block.h

super_block.h ------------- $Id: super_block.h,v 1.13 2003/10/20 07:18:11 stewart Exp $
Part of the FCFS object store.
This file describes the super block and related data structures.
(C)2003 Stewart Smith Distributed under the GNU Public License

Included in: fcfs_newobj.c
  fcfs_readobj.c
  fcfs_updateobj.c
  fcfs_vfs.h
  mkfs.c
  mount_testkit.c
  onode.c
  onode_index.c
  space_bitmap.c
  super_block.c
  volinfo.c


Included Files


Preprocessor definitions

#define __GXX_ABI_VERSION 102

#define __SIZE_TYPE__

#define __PTRDIFF_TYPE__ int

#define __WCHAR_TYPE__

#define __WINT_TYPE__

#define __SCHAR_MAX__ 127

#define __SHRT_MAX__ 32767

#define __INT_MAX__ 2147483647

#define __LONG_MAX__ 2147483647L

#define __LONG_LONG_MAX__ 9223372036854775807LL

#define __WCHAR_MAX__ 2147483647

#define __CHAR_BIT__ 8

#define __FLT_EVAL_METHOD__ 0

#define __FLT_RADIX__ 2

#define __FLT_MANT_DIG__ 24

#define __FLT_DIG__ 6

#define __FLT_MIN_EXP__ -125

#define __FLT_MIN_10_EXP__ -37

#define __FLT_MAX_EXP__ 128

#define __FLT_MAX_10_EXP__ 38

#define __FLT_MAX__ 3.40282347e+38F

#define __FLT_MIN__ 1.17549435e-38F

#define __FLT_EPSILON__ 1.19209290e-7F

#define __FLT_DENORM_MIN__ 1.40129846e-45F

#define __DBL_MANT_DIG__ 53

#define __DBL_DIG__ 15

#define __DBL_MIN_EXP__ -1021

#define __DBL_MIN_10_EXP__ -307

#define __DBL_MAX_EXP__ 1024

#define __DBL_MAX_10_EXP__ 308

#define __DBL_MAX__ 1.7976931348623157e+308

#define __DBL_MIN__ 2.2250738585072014e-308

#define __DBL_EPSILON__ 2.2204460492503131e-16

#define __DBL_DENORM_MIN__ 4.9406564584124654e-324

#define __LDBL_MANT_DIG__ 53

#define __LDBL_DIG__ 15

#define __LDBL_MIN_EXP__ -1021

#define __LDBL_MIN_10_EXP__ -307

#define __LDBL_MAX_EXP__ 1024

#define __LDBL_MAX_10_EXP__ 308

#define __DECIMAL_DIG__ 17

#define __LDBL_MAX__ 1.7976931348623157e+308L

#define __LDBL_MIN__ 2.2250738585072014e-308L

#define __LDBL_EPSILON__ 2.2204460492503131e-16L

#define __LDBL_DENORM_MIN__ 4.9406564584124654e-324L

#define __REGISTER_PREFIX__

#define __USER_LABEL_PREFIX__

#define __VERSION__ "3.3.2 (Debian)"

#define __STDC_HOSTED__ 1

#define __NO_INLINE__ 1

#define __FINITE_MATH_ONLY__ 0

#define __CHAR_UNSIGNED__ 1

#define _ARCH_PPC 1

#define __BIG_ENDIAN__ 1

#define _BIG_ENDIAN 1

#define _CALL_SYSV 1

#define __PPC 1

#define __PPC__ 1

#define PPC 1

#define __ELF__ 1

#define __powerpc 1

#define __powerpc__ 1

#define powerpc 1

#define __GNUC__ 3

#define __GNUC_MINOR__ 3

#define __GNUC_PATCHLEVEL__ 2

#define __unix__ 1

#define __gnu_linux__ 1

#define __linux__ 1

#define unix 1

#define __unix 1

#define linux 1

#define __linux 1

#define __FCFS_SUPER_BLOCK_H__

#define FCFS_SB_MAGIC1 0x46436673

#define FCFS_SB_VERSION1 0x00010001

#define FCFS_SB_BITS 0x00000040

#define FCFS_NAME_LENGTH 128

#define FCFS_SB_MAGIC2 0x3f8ec2a1

#define FCFS_ONODE_MAGIC1 0x4f4e6f4465563101ULL

#define FSFS_ONODE1_SPACE_LEAF_MAXNR 10

#define FCFS_FORK_SMALL_DATA_SIZE 112


Type struct fcfs_block_run

fcfs_block_run -------------- We have a max of ~4billion alloction groups, within these, we can have up to 4billion blocks. and we can address these with *one* block_run structure. This means we don't have a lot of block address lookup on large files or contiguous files. Should lead to fast IO...

struct fcfs_block_run
struct fcfs_block_run 
   { 
     u32 allocation_group;Allocation group
     u32 start;Start Block
     u32 len;Length (blocks)
   } 


Type enum fcfs_sb_flags

enum fcfs_sb_flags
enum fcfs_sb_flags 
   { 
     FCFS_FLAG_SBLocation1;Three flags make number
     FCFS_FLAG_SBLocation2;see: enum fcfs_sb_location
     FCFS_FLAG_SBLocation3; 
     FCFS_FLAG_Dirty;Was uncleanly unmounted
     FCFS_FLAG_Experimental;Has been written by experimental code
     FCFS_FLAG_JournalMeta;Journal meta-data
     FCFS_FLAG_JournalData;Journal all data writes
     FCFS_FLAG_Versioned;Is versioned system
   } 

Type enum fcfs_sb_location

enum fcfs_sb_location
enum fcfs_sb_location 
   { 
     FCFS_SBloc_start_volume;Start of volume
     FCFS_SBloc_start_ag;Start of allocation group
     FCFS_SBloc_end_volume;Final block of volume
   } 

Type union space_tracking

union space_tracking
union space_tracking 
   { 
     char padding[50]; 
   } 

Type struct fcfs_sb

struct fcfs_sb
struct fcfs_sb 
   { 
     u32 magic1;first magic number.
     u32 version;version of FS
     u32 bits;number of bits to use as a 'base' bits. (64 default)
     u32 sblength;length of sb (bytes)
     u64 flags; 
     u32 bsize;block size (bytes)
     u64 blocksnr;number of blocks
     char name[128];human readable name of volume
     u32 magic2;magic2
     u32 allocation_groupsnr;Number of alloction groups on volume
     u32 ag_blocksnr;Blocks per allocation group
     u64 num_mounts;Number of successful read/write mounts
     u64 num_dirtymounts;Num dirty mounts
     u64 time_created;Time volume created
     u64 time_clean;Time volume last unmounted cleanly
     u64 time_dirtymount;Time volume last mounted dirty
     u64 onode_index_blocknr;Where we find our primary index
     u64 onindex_num_onodes;Num onodes in index
     u64 onindex_used;Num of used inodes in index
     u64 onindex_free;Num of free onodes in index
     u64 onindex_next_id;Next ID to use
     u32 onindex_node_size;In number of keys
     union space_tracking 
        { 
          char padding[50]; 
        } 
     space; 
   } 

Type enum fcfs_onode_flags

enum fcfs_onode_flags
enum fcfs_onode_flags 
   { 
     FCFS_OFLAG_NoVersion;Don't version track this onode
     FCFS_OFLAG_ForkLeaf;We have a fork leaf, not a node
   } 

Type struct fcfs_onode1_space_leaf

struct fcfs_onode1_space_leaf
struct fcfs_onode1_space_leaf 
   { 
     char nr; 
     struct fcfs_block_run br[10]; 
   } 

Type struct fcfs_onode1_space_node

struct fcfs_onode1_space_node
struct fcfs_onode1_space_node 
   { 
     u64 offset[7]; 
     u64 block[7]; 
   } 

Type enum fcfs_fork_flags

enum fcfs_fork_flags
enum fcfs_fork_flags 
   { 
     FCFS_FORK_InForkData;We have data, not space nodes
     FCFS_FORK_SpaceNode;Space is node, not leaf
   } 

Type union space

union space
union space 
   { 
     struct fcfs_onode1_space_leaf leaf; 
     struct fcfs_onode1_space_node node; 
   } 

Type union data

union data
union data 
   { 
     union space 
        { 
          struct fcfs_onode1_space_leaf leaf; 
          struct fcfs_onode1_space_node node; 
        } 
     space; 
     char small_data[112];I wish this was neater, as part of the leaf
   } 

Type struct fcfs_fork

struct fcfs_fork
struct fcfs_fork 
   { 
     u64 fork_type; 
     u64 fork_flags; 
     u64 content_length; 
     union data 
        { 
          union space 
             { 
               struct fcfs_onode1_space_leaf leaf; 
               struct fcfs_onode1_space_node node; 
             } 
          space; 
          char small_data[112];I wish this was neater, as part of the leaf
        } 
     data; 
   } 

Type struct fcfs_fork_leaf

struct fcfs_fork_leaf
struct fcfs_fork_leaf 
   { 
     char nr; 
     struct fcfs_fork fork[10]; 
   } 

Type struct fcfs_fork_node

struct fcfs_fork_node
struct fcfs_fork_node 
   { 
     u64 offset[7]; 
     u64 block[7]; 
   } 

Type union forks

union forks
union forks 
   { 
     struct fcfs_fork_leaf leaf; 
     struct fcfs_fork_node node; 
   } 

Type struct fcfs_onode1

struct fcfs_onode1
struct fcfs_onode1 
   { 
     u64 magic1;Identify as O-Node
     u64 onode_num;FS Specific Unique ID
     u64 onode_revision;Revision of onode
     u64 flags;fcfs_onode_flags
     u64 use_count;Reference Counter (for indicies)
     u32 onode_size;Length of o-node structure.
     union forks 
        { 
          struct fcfs_fork_leaf leaf; 
          struct fcfs_fork_node node; 
        } 
     forks; 
     char small_space[1];used for in-onode data (or metadata)
   }