diff options
Diffstat (limited to 'include/linux/jffs2.h')
-rw-r--r-- | include/linux/jffs2.h | 41 |
1 files changed, 30 insertions, 11 deletions
diff --git a/include/linux/jffs2.h b/include/linux/jffs2.h index 419fc953ac16..cf792bb3c726 100644 --- a/include/linux/jffs2.h +++ b/include/linux/jffs2.h | |||
@@ -5,10 +5,10 @@ | |||
5 | * | 5 | * |
6 | * Created by David Woodhouse <dwmw2@infradead.org> | 6 | * Created by David Woodhouse <dwmw2@infradead.org> |
7 | * | 7 | * |
8 | * For licensing information, see the file 'LICENCE' in the | 8 | * For licensing information, see the file 'LICENCE' in the |
9 | * jffs2 directory. | 9 | * jffs2 directory. |
10 | * | 10 | * |
11 | * $Id: jffs2.h,v 1.34 2004/11/16 20:36:14 dwmw2 Exp $ | 11 | * $Id: jffs2.h,v 1.38 2005/09/26 11:37:23 havasi Exp $ |
12 | * | 12 | * |
13 | */ | 13 | */ |
14 | 14 | ||
@@ -28,6 +28,9 @@ | |||
28 | #define JFFS2_EMPTY_BITMASK 0xffff | 28 | #define JFFS2_EMPTY_BITMASK 0xffff |
29 | #define JFFS2_DIRTY_BITMASK 0x0000 | 29 | #define JFFS2_DIRTY_BITMASK 0x0000 |
30 | 30 | ||
31 | /* Summary node MAGIC marker */ | ||
32 | #define JFFS2_SUM_MAGIC 0x02851885 | ||
33 | |||
31 | /* We only allow a single char for length, and 0xFF is empty flash so | 34 | /* We only allow a single char for length, and 0xFF is empty flash so |
32 | we don't want it confused with a real length. Hence max 254. | 35 | we don't want it confused with a real length. Hence max 254. |
33 | */ | 36 | */ |
@@ -43,8 +46,6 @@ | |||
43 | #define JFFS2_COMPR_COPY 0x04 | 46 | #define JFFS2_COMPR_COPY 0x04 |
44 | #define JFFS2_COMPR_DYNRUBIN 0x05 | 47 | #define JFFS2_COMPR_DYNRUBIN 0x05 |
45 | #define JFFS2_COMPR_ZLIB 0x06 | 48 | #define JFFS2_COMPR_ZLIB 0x06 |
46 | #define JFFS2_COMPR_LZO 0x07 | ||
47 | #define JFFS2_COMPR_LZARI 0x08 | ||
48 | /* Compatibility flags. */ | 49 | /* Compatibility flags. */ |
49 | #define JFFS2_COMPAT_MASK 0xc000 /* What do to if an unknown nodetype is found */ | 50 | #define JFFS2_COMPAT_MASK 0xc000 /* What do to if an unknown nodetype is found */ |
50 | #define JFFS2_NODE_ACCURATE 0x2000 | 51 | #define JFFS2_NODE_ACCURATE 0x2000 |
@@ -62,15 +63,17 @@ | |||
62 | #define JFFS2_NODETYPE_CLEANMARKER (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3) | 63 | #define JFFS2_NODETYPE_CLEANMARKER (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3) |
63 | #define JFFS2_NODETYPE_PADDING (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 4) | 64 | #define JFFS2_NODETYPE_PADDING (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 4) |
64 | 65 | ||
66 | #define JFFS2_NODETYPE_SUMMARY (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 6) | ||
67 | |||
65 | // Maybe later... | 68 | // Maybe later... |
66 | //#define JFFS2_NODETYPE_CHECKPOINT (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3) | 69 | //#define JFFS2_NODETYPE_CHECKPOINT (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3) |
67 | //#define JFFS2_NODETYPE_OPTIONS (JFFS2_FEATURE_RWCOMPAT_COPY | JFFS2_NODE_ACCURATE | 4) | 70 | //#define JFFS2_NODETYPE_OPTIONS (JFFS2_FEATURE_RWCOMPAT_COPY | JFFS2_NODE_ACCURATE | 4) |
68 | 71 | ||
69 | 72 | ||
70 | #define JFFS2_INO_FLAG_PREREAD 1 /* Do read_inode() for this one at | 73 | #define JFFS2_INO_FLAG_PREREAD 1 /* Do read_inode() for this one at |
71 | mount time, don't wait for it to | 74 | mount time, don't wait for it to |
72 | happen later */ | 75 | happen later */ |
73 | #define JFFS2_INO_FLAG_USERCOMPR 2 /* User has requested a specific | 76 | #define JFFS2_INO_FLAG_USERCOMPR 2 /* User has requested a specific |
74 | compression type */ | 77 | compression type */ |
75 | 78 | ||
76 | 79 | ||
@@ -101,7 +104,7 @@ struct jffs2_unknown_node | |||
101 | struct jffs2_raw_dirent | 104 | struct jffs2_raw_dirent |
102 | { | 105 | { |
103 | jint16_t magic; | 106 | jint16_t magic; |
104 | jint16_t nodetype; /* == JFFS_NODETYPE_DIRENT */ | 107 | jint16_t nodetype; /* == JFFS2_NODETYPE_DIRENT */ |
105 | jint32_t totlen; | 108 | jint32_t totlen; |
106 | jint32_t hdr_crc; | 109 | jint32_t hdr_crc; |
107 | jint32_t pino; | 110 | jint32_t pino; |
@@ -117,7 +120,7 @@ struct jffs2_raw_dirent | |||
117 | } __attribute__((packed)); | 120 | } __attribute__((packed)); |
118 | 121 | ||
119 | /* The JFFS2 raw inode structure: Used for storage on physical media. */ | 122 | /* The JFFS2 raw inode structure: Used for storage on physical media. */ |
120 | /* The uid, gid, atime, mtime and ctime members could be longer, but | 123 | /* The uid, gid, atime, mtime and ctime members could be longer, but |
121 | are left like this for space efficiency. If and when people decide | 124 | are left like this for space efficiency. If and when people decide |
122 | they really need them extended, it's simple enough to add support for | 125 | they really need them extended, it's simple enough to add support for |
123 | a new type of raw node. | 126 | a new type of raw node. |
@@ -125,7 +128,7 @@ struct jffs2_raw_dirent | |||
125 | struct jffs2_raw_inode | 128 | struct jffs2_raw_inode |
126 | { | 129 | { |
127 | jint16_t magic; /* A constant magic number. */ | 130 | jint16_t magic; /* A constant magic number. */ |
128 | jint16_t nodetype; /* == JFFS_NODETYPE_INODE */ | 131 | jint16_t nodetype; /* == JFFS2_NODETYPE_INODE */ |
129 | jint32_t totlen; /* Total length of this node (inc data, etc.) */ | 132 | jint32_t totlen; /* Total length of this node (inc data, etc.) */ |
130 | jint32_t hdr_crc; | 133 | jint32_t hdr_crc; |
131 | jint32_t ino; /* Inode number. */ | 134 | jint32_t ino; /* Inode number. */ |
@@ -148,9 +151,25 @@ struct jffs2_raw_inode | |||
148 | uint8_t data[0]; | 151 | uint8_t data[0]; |
149 | } __attribute__((packed)); | 152 | } __attribute__((packed)); |
150 | 153 | ||
151 | union jffs2_node_union { | 154 | struct jffs2_raw_summary |
155 | { | ||
156 | jint16_t magic; | ||
157 | jint16_t nodetype; /* = JFFS2_NODETYPE_SUMMARY */ | ||
158 | jint32_t totlen; | ||
159 | jint32_t hdr_crc; | ||
160 | jint32_t sum_num; /* number of sum entries*/ | ||
161 | jint32_t cln_mkr; /* clean marker size, 0 = no cleanmarker */ | ||
162 | jint32_t padded; /* sum of the size of padding nodes */ | ||
163 | jint32_t sum_crc; /* summary information crc */ | ||
164 | jint32_t node_crc; /* node crc */ | ||
165 | jint32_t sum[0]; /* inode summary info */ | ||
166 | } __attribute__((packed)); | ||
167 | |||
168 | union jffs2_node_union | ||
169 | { | ||
152 | struct jffs2_raw_inode i; | 170 | struct jffs2_raw_inode i; |
153 | struct jffs2_raw_dirent d; | 171 | struct jffs2_raw_dirent d; |
172 | struct jffs2_raw_summary s; | ||
154 | struct jffs2_unknown_node u; | 173 | struct jffs2_unknown_node u; |
155 | }; | 174 | }; |
156 | 175 | ||