1 /* Copyright 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */
4 - definition of ondisk super block of standart disk layout for
6 - definition of layout 40 specific portion of in-core super block
7 - declarations of functions implementing methods of layout plugin
9 - declarations of functions used to get/set fields in layout 40 super block
12 #ifndef __DISK_FORMAT40_H__
13 #define __DISK_FORMAT40_H__
15 /* magic for default reiser4 layout */
16 #define FORMAT40_MAGIC "ReIsEr40FoRmAt"
17 #define FORMAT40_OFFSET (REISER4_MASTER_OFFSET + PAGE_CACHE_SIZE)
19 #include "../../dformat.h"
21 #include <linux/fs.h> /* for struct super_block */
27 /* ondisk super block for format 40. It is 512 bytes long */
28 typedef struct format40_disk_super_block
{
29 /* 0 */ d64 block_count
;
30 /* number of block in a filesystem */
31 /* 8 */ d64 free_blocks
;
32 /* number of free blocks */
33 /* 16 */ d64 root_block
;
34 /* filesystem tree root block */
36 /* smallest free objectid */
37 /* 32 */ d64 file_count
;
38 /* number of files in a filesystem */
40 /* number of times super block was
41 flushed. Needed if format 40
42 will have few super blocks */
44 /* unique identifier of fs */
45 /* 52 */ char magic
[16];
46 /* magic string ReIsEr40FoRmAt */
47 /* 68 */ d16 tree_height
;
48 /* height of filesystem tree */
49 /* 70 */ d16 formatting_policy
;
50 /* not used anymore */
53 /* on-disk format version number
54 initially assigned by mkfs as the greatest format40
55 version number supported by reiser4progs and updated
56 in mount time in accordance with the greatest format40
57 version number supported by kernel.
58 Is used by fsck to catch possible corruption and
59 for various compatibility issues */
60 /* 84 */ char not_used
[428];
61 } format40_disk_super_block
;
63 /* format 40 specific part of reiser4_super_info_data */
64 typedef struct format40_super_info
{
65 /* format40_disk_super_block actual_sb; */
68 reiser4_block_nr super
;
70 } format40_super_info
;
72 /* Defines for journal header and footer respectively. */
73 #define FORMAT40_JOURNAL_HEADER_BLOCKNR \
74 ((REISER4_MASTER_OFFSET / PAGE_CACHE_SIZE) + 3)
76 #define FORMAT40_JOURNAL_FOOTER_BLOCKNR \
77 ((REISER4_MASTER_OFFSET / PAGE_CACHE_SIZE) + 4)
79 #define FORMAT40_STATUS_BLOCKNR \
80 ((REISER4_MASTER_OFFSET / PAGE_CACHE_SIZE) + 5)
82 /* Diskmap declarations */
83 #define FORMAT40_PLUGIN_DISKMAP_ID ((REISER4_FORMAT_PLUGIN_TYPE<<16) | (FORMAT40_ID))
84 #define FORMAT40_SUPER 1
88 /* declarations of functions implementing methods of layout plugin for
89 format 40. The functions theirself are in disk_format40.c */
90 extern int init_format_format40(struct super_block
*, void *data
);
91 extern const reiser4_key
*root_dir_key_format40(const struct super_block
*);
92 extern int release_format40(struct super_block
*s
);
93 extern jnode
*log_super_format40(struct super_block
*s
);
94 extern int check_open_format40(const struct inode
*object
);
95 extern int version_update_format40(struct super_block
*super
);
97 /* __DISK_FORMAT40_H__ */
102 c-indentation-style: "K&R"