fed up with those stupid warnings
[mmotm.git] / fs / reiser4 / dformat.h
blob7943762069a4296a617ea7bc15398ded16e81faa
1 /* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by
2 reiser4/README */
4 /* Formats of on-disk data and conversion functions. */
6 /* put all item formats in the files describing the particular items,
7 our model is, everything you need to do to add an item to reiser4,
8 (excepting the changes to the plugin that uses the item which go
9 into the file defining that plugin), you put into one file. */
10 /* Data on disk are stored in little-endian format.
11 To declare fields of on-disk structures, use d8, d16, d32 and d64.
12 d??tocpu() and cputod??() to convert. */
14 #if !defined(__FS_REISER4_DFORMAT_H__)
15 #define __FS_REISER4_DFORMAT_H__
17 #include <asm/byteorder.h>
18 #include <asm/unaligned.h>
19 #include <linux/types.h>
21 typedef __u8 d8;
22 typedef __le16 d16;
23 typedef __le32 d32;
24 typedef __le64 d64;
26 #define PACKED __attribute__((packed))
28 /* data-type for block number */
29 typedef __u64 reiser4_block_nr;
31 /* data-type for block number on disk, disk format */
32 typedef __le64 reiser4_dblock_nr;
34 /**
35 * disk_addr_eq - compare disk addresses
36 * @b1: pointer to block number ot compare
37 * @b2: pointer to block number ot compare
39 * Returns true if if disk addresses are the same
41 static inline int disk_addr_eq(const reiser4_block_nr * b1,
42 const reiser4_block_nr * b2)
44 assert("nikita-1033", b1 != NULL);
45 assert("nikita-1266", b2 != NULL);
47 return !memcmp(b1, b2, sizeof *b1);
50 /* structure of master reiser4 super block */
51 typedef struct reiser4_master_sb {
52 char magic[16]; /* "ReIsEr4" */
53 __le16 disk_plugin_id; /* id of disk layout plugin */
54 __le16 blocksize;
55 char uuid[16]; /* unique id */
56 char label[16]; /* filesystem label */
57 __le64 diskmap; /* location of the diskmap. 0 if not present */
58 } reiser4_master_sb;
60 /* __FS_REISER4_DFORMAT_H__ */
61 #endif
64 * Local variables:
65 * c-indentation-style: "K&R"
66 * mode-name: "LC"
67 * c-basic-offset: 8
68 * tab-width: 8
69 * fill-column: 79
70 * End: