fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / fs / befs / befs_fs_types.h
index 9095518..e2595c2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * include/linux/befs_fs_types.h
+ * fs/befs/befs_fs_types.h
  *
  * Copyright (C) 2001 Will Dyson (will@cs.earlham.edu)
  *
@@ -79,17 +79,27 @@ enum inode_flags {
  * On-Disk datastructures of BeFS
  */
 
+typedef u64 __bitwise fs64;
+typedef u32 __bitwise fs32;
+typedef u16 __bitwise fs16;
+
 typedef u64 befs_off_t;
-typedef u64 befs_time_t;
-typedef void befs_binode_etc;
+typedef fs64 befs_time_t;
 
 /* Block runs */
+typedef struct {
+       fs32 allocation_group;
+       fs16 start;
+       fs16 len;
+} PACKED befs_disk_block_run;
+
 typedef struct {
        u32 allocation_group;
        u16 start;
        u16 len;
 } PACKED befs_block_run;
 
+typedef befs_disk_block_run befs_disk_inode_addr;
 typedef befs_block_run befs_inode_addr;
 
 /*
@@ -97,31 +107,31 @@ typedef befs_block_run befs_inode_addr;
  */
 typedef struct {
        char name[B_OS_NAME_LENGTH];
-       u32 magic1;
-       u32 fs_byte_order;
+       fs32 magic1;
+       fs32 fs_byte_order;
 
-       u32 block_size;
-       u32 block_shift;
+       fs32 block_size;
+       fs32 block_shift;
 
-       befs_off_t num_blocks;
-       befs_off_t used_blocks;
+       fs64 num_blocks;
+       fs64 used_blocks;
 
-       u32 inode_size;
+       fs32 inode_size;
 
-       u32 magic2;
-       u32 blocks_per_ag;
-       u32 ag_shift;
-       u32 num_ags;
+       fs32 magic2;
+       fs32 blocks_per_ag;
+       fs32 ag_shift;
+       fs32 num_ags;
 
-       u32 flags;
+       fs32 flags;
 
-       befs_block_run log_blocks;
-       befs_off_t log_start;
-       befs_off_t log_end;
+       befs_disk_block_run log_blocks;
+       fs64 log_start;
+       fs64 log_end;
 
-       u32 magic3;
-       befs_inode_addr root_dir;
-       befs_inode_addr indices;
+       fs32 magic3;
+       befs_disk_inode_addr root_dir;
+       befs_disk_inode_addr indices;
 
 } PACKED befs_super_block;
 
@@ -129,6 +139,16 @@ typedef struct {
  * Note: the indirect and dbl_indir block_runs may
  * be longer than one block!
  */
+typedef struct {
+       befs_disk_block_run direct[BEFS_NUM_DIRECT_BLOCKS];
+       fs64 max_direct_range;
+       befs_disk_block_run indirect;
+       fs64 max_indirect_range;
+       befs_disk_block_run double_indirect;
+       fs64 max_double_indirect_range;
+       fs64 size;
+} PACKED befs_disk_data_stream;
+
 typedef struct {
        befs_block_run direct[BEFS_NUM_DIRECT_BLOCKS];
        befs_off_t max_direct_range;
@@ -141,35 +161,35 @@ typedef struct {
 
 /* Attribute */
 typedef struct {
-       u32 type;
-       u16 name_size;
-       u16 data_size;
+       fs32 type;
+       fs16 name_size;
+       fs16 data_size;
        char name[1];
 } PACKED befs_small_data;
 
 /* Inode structure */
 typedef struct {
-       u32 magic1;
-       befs_inode_addr inode_num;
-       u32 uid;
-       u32 gid;
-       u32 mode;
-       u32 flags;
+       fs32 magic1;
+       befs_disk_inode_addr inode_num;
+       fs32 uid;
+       fs32 gid;
+       fs32 mode;
+       fs32 flags;
        befs_time_t create_time;
        befs_time_t last_modified_time;
-       befs_inode_addr parent;
-       befs_inode_addr attributes;
-       u32 type;
+       befs_disk_inode_addr parent;
+       befs_disk_inode_addr attributes;
+       fs32 type;
 
-       u32 inode_size;
-       u32 etc;                /* not use */
+       fs32 inode_size;
+       fs32 etc;               /* not use */
 
        union {
-               befs_data_stream datastream;
+               befs_disk_data_stream datastream;
                char symlink[BEFS_SYMLINK_LEN];
        } data;
 
-       u32 pad[4];             /* not use */
+       fs32 pad[4];            /* not use */
        befs_small_data small_data[1];
 } PACKED befs_inode;
 
@@ -189,6 +209,16 @@ enum btree_types {
        BTREE_DOUBLE_TYPE = 6
 };
 
+typedef struct {
+       fs32 magic;
+       fs32 node_size;
+       fs32 max_depth;
+       fs32 data_type;
+       fs64 root_node_ptr;
+       fs64 free_node_ptr;
+       fs64 max_size;
+} PACKED befs_disk_btree_super;
+
 typedef struct {
        u32 magic;
        u32 node_size;
@@ -202,12 +232,20 @@ typedef struct {
 /*
  * Header stucture of each btree node
  */
+typedef struct {
+       fs64 left;
+       fs64 right;
+       fs64 overflow;
+       fs16 all_key_count;
+       fs16 all_key_length;
+} PACKED befs_btree_nodehead;
+
 typedef struct {
        befs_off_t left;
        befs_off_t right;
        befs_off_t overflow;
        u16 all_key_count;
        u16 all_key_length;
-} PACKED befs_btree_nodehead;
+} PACKED befs_host_btree_nodehead;
 
 #endif                         /* _LINUX_BEFS_FS_TYPES */