revert-mm-fix-blkdev-size-calculation-in-generic_write_checks
[linux-2.6/linux-trees-mm.git] / fs / reiser4 / plugin / disk_format / disk_format40.h
blob7fc1772d4e1ca6655ecdae32a1ef8cd9b32d30c9
1 /* Copyright 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */
3 /* this file contains:
4 - definition of ondisk super block of standart disk layout for
5 reiser 4.0 (layout 40)
6 - definition of layout 40 specific portion of in-core super block
7 - declarations of functions implementing methods of layout plugin
8 for layout 40
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 */
23 typedef enum {
24 FORMAT40_LARGE_KEYS
25 } format40_flags;
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 */
35 /* 24 */ d64 oid;
36 /* smallest free objectid */
37 /* 32 */ d64 file_count;
38 /* number of files in a filesystem */
39 /* 40 */ d64 flushes;
40 /* number of times super block was
41 flushed. Needed if format 40
42 will have few super blocks */
43 /* 48 */ d32 mkfs_id;
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 */
51 /* 72 */ d64 flags;
52 /* 80 */ d32 version;
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; */
66 jnode *sb_jnode;
67 struct {
68 reiser4_block_nr super;
69 } loc;
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
85 #define FORMAT40_JH 2
86 #define FORMAT40_JF 3
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__ */
98 #endif
100 /* Make Linus happy.
101 Local variables:
102 c-indentation-style: "K&R"
103 mode-name: "LC"
104 c-basic-offset: 8
105 tab-width: 8
106 fill-column: 120
107 scroll-step: 1
108 End: