aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2/nodelist.h
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2005-11-09 17:33:22 -0500
committerSteve French <sfrench@us.ibm.com>2005-11-09 17:33:22 -0500
commite82b3aec8d508d2a925a4c766e97f16b7c4dfb1b (patch)
tree69d5685ef0c194f651a03e30bff14628b4d45400 /fs/jffs2/nodelist.h
parentec58ef03284f0bfa50a04982b74c8c2325a0758e (diff)
parentad8f76be48d817b48222411ae16a7dfe257bdb24 (diff)
Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Diffstat (limited to 'fs/jffs2/nodelist.h')
-rw-r--r--fs/jffs2/nodelist.h163
1 files changed, 45 insertions, 118 deletions
diff --git a/fs/jffs2/nodelist.h b/fs/jffs2/nodelist.h
index b34c397909ef..23a67bb3052f 100644
--- a/fs/jffs2/nodelist.h
+++ b/fs/jffs2/nodelist.h
@@ -7,7 +7,7 @@
7 * 7 *
8 * For licensing information, see the file 'LICENCE' in this directory. 8 * For licensing information, see the file 'LICENCE' in this directory.
9 * 9 *
10 * $Id: nodelist.h,v 1.131 2005/07/05 21:03:07 dwmw2 Exp $ 10 * $Id: nodelist.h,v 1.140 2005/09/07 08:34:54 havasi Exp $
11 * 11 *
12 */ 12 */
13 13
@@ -20,30 +20,15 @@
20#include <linux/jffs2.h> 20#include <linux/jffs2.h>
21#include <linux/jffs2_fs_sb.h> 21#include <linux/jffs2_fs_sb.h>
22#include <linux/jffs2_fs_i.h> 22#include <linux/jffs2_fs_i.h>
23#include "summary.h"
23 24
24#ifdef __ECOS 25#ifdef __ECOS
25#include "os-ecos.h" 26#include "os-ecos.h"
26#else 27#else
27#include <linux/mtd/compatmac.h> /* For min/max in older kernels */ 28#include <linux/mtd/compatmac.h> /* For compatibility with older kernels */
28#include "os-linux.h" 29#include "os-linux.h"
29#endif 30#endif
30 31
31#ifndef CONFIG_JFFS2_FS_DEBUG
32#define CONFIG_JFFS2_FS_DEBUG 1
33#endif
34
35#if CONFIG_JFFS2_FS_DEBUG > 0
36#define D1(x) x
37#else
38#define D1(x)
39#endif
40
41#if CONFIG_JFFS2_FS_DEBUG > 1
42#define D2(x) x
43#else
44#define D2(x)
45#endif
46
47#define JFFS2_NATIVE_ENDIAN 32#define JFFS2_NATIVE_ENDIAN
48 33
49/* Note we handle mode bits conversion from JFFS2 (i.e. Linux) to/from 34/* Note we handle mode bits conversion from JFFS2 (i.e. Linux) to/from
@@ -73,14 +58,17 @@
73#define je16_to_cpu(x) (le16_to_cpu(x.v16)) 58#define je16_to_cpu(x) (le16_to_cpu(x.v16))
74#define je32_to_cpu(x) (le32_to_cpu(x.v32)) 59#define je32_to_cpu(x) (le32_to_cpu(x.v32))
75#define jemode_to_cpu(x) (le32_to_cpu(jffs2_to_os_mode((x).m))) 60#define jemode_to_cpu(x) (le32_to_cpu(jffs2_to_os_mode((x).m)))
76#else 61#else
77#error wibble 62#error wibble
78#endif 63#endif
79 64
65/* The minimal node header size */
66#define JFFS2_MIN_NODE_HEADER sizeof(struct jffs2_raw_dirent)
67
80/* 68/*
81 This is all we need to keep in-core for each raw node during normal 69 This is all we need to keep in-core for each raw node during normal
82 operation. As and when we do read_inode on a particular inode, we can 70 operation. As and when we do read_inode on a particular inode, we can
83 scan the nodes which are listed for it and build up a proper map of 71 scan the nodes which are listed for it and build up a proper map of
84 which nodes are currently valid. JFFSv1 always used to keep that whole 72 which nodes are currently valid. JFFSv1 always used to keep that whole
85 map in core for each inode. 73 map in core for each inode.
86*/ 74*/
@@ -97,7 +85,7 @@ struct jffs2_raw_node_ref
97 85
98 /* flash_offset & 3 always has to be zero, because nodes are 86 /* flash_offset & 3 always has to be zero, because nodes are
99 always aligned at 4 bytes. So we have a couple of extra bits 87 always aligned at 4 bytes. So we have a couple of extra bits
100 to play with, which indicate the node's status; see below: */ 88 to play with, which indicate the node's status; see below: */
101#define REF_UNCHECKED 0 /* We haven't yet checked the CRC or built its inode */ 89#define REF_UNCHECKED 0 /* We haven't yet checked the CRC or built its inode */
102#define REF_OBSOLETE 1 /* Obsolete, can be completely ignored */ 90#define REF_OBSOLETE 1 /* Obsolete, can be completely ignored */
103#define REF_PRISTINE 2 /* Completely clean. GC without looking */ 91#define REF_PRISTINE 2 /* Completely clean. GC without looking */
@@ -110,7 +98,7 @@ struct jffs2_raw_node_ref
110/* For each inode in the filesystem, we need to keep a record of 98/* For each inode in the filesystem, we need to keep a record of
111 nlink, because it would be a PITA to scan the whole directory tree 99 nlink, because it would be a PITA to scan the whole directory tree
112 at read_inode() time to calculate it, and to keep sufficient information 100 at read_inode() time to calculate it, and to keep sufficient information
113 in the raw_node_ref (basically both parent and child inode number for 101 in the raw_node_ref (basically both parent and child inode number for
114 dirent nodes) would take more space than this does. We also keep 102 dirent nodes) would take more space than this does. We also keep
115 a pointer to the first physical node which is part of this inode, too. 103 a pointer to the first physical node which is part of this inode, too.
116*/ 104*/
@@ -140,7 +128,7 @@ struct jffs2_inode_cache {
140#define INOCACHE_HASHSIZE 128 128#define INOCACHE_HASHSIZE 128
141 129
142/* 130/*
143 Larger representation of a raw node, kept in-core only when the 131 Larger representation of a raw node, kept in-core only when the
144 struct inode for this particular ino is instantiated. 132 struct inode for this particular ino is instantiated.
145*/ 133*/
146 134
@@ -150,11 +138,11 @@ struct jffs2_full_dnode
150 uint32_t ofs; /* The offset to which the data of this node belongs */ 138 uint32_t ofs; /* The offset to which the data of this node belongs */
151 uint32_t size; 139 uint32_t size;
152 uint32_t frags; /* Number of fragments which currently refer 140 uint32_t frags; /* Number of fragments which currently refer
153 to this node. When this reaches zero, 141 to this node. When this reaches zero,
154 the node is obsolete. */ 142 the node is obsolete. */
155}; 143};
156 144
157/* 145/*
158 Even larger representation of a raw node, kept in-core only while 146 Even larger representation of a raw node, kept in-core only while
159 we're actually building up the original map of which nodes go where, 147 we're actually building up the original map of which nodes go where,
160 in read_inode() 148 in read_inode()
@@ -164,7 +152,10 @@ struct jffs2_tmp_dnode_info
164 struct rb_node rb; 152 struct rb_node rb;
165 struct jffs2_full_dnode *fn; 153 struct jffs2_full_dnode *fn;
166 uint32_t version; 154 uint32_t version;
167}; 155 uint32_t data_crc;
156 uint32_t partial_crc;
157 uint32_t csize;
158};
168 159
169struct jffs2_full_dirent 160struct jffs2_full_dirent
170{ 161{
@@ -178,7 +169,7 @@ struct jffs2_full_dirent
178}; 169};
179 170
180/* 171/*
181 Fragments - used to build a map of which raw node to obtain 172 Fragments - used to build a map of which raw node to obtain
182 data from for each part of the ino 173 data from for each part of the ino
183*/ 174*/
184struct jffs2_node_frag 175struct jffs2_node_frag
@@ -207,86 +198,18 @@ struct jffs2_eraseblock
207 struct jffs2_raw_node_ref *gc_node; /* Next node to be garbage collected */ 198 struct jffs2_raw_node_ref *gc_node; /* Next node to be garbage collected */
208}; 199};
209 200
210#define ACCT_SANITY_CHECK(c, jeb) do { \ 201static inline int jffs2_blocks_use_vmalloc(struct jffs2_sb_info *c)
211 struct jffs2_eraseblock *___j = jeb; \
212 if ((___j) && ___j->used_size + ___j->dirty_size + ___j->free_size + ___j->wasted_size + ___j->unchecked_size != c->sector_size) { \
213 printk(KERN_NOTICE "Eeep. Space accounting for block at 0x%08x is screwed\n", ___j->offset); \
214 printk(KERN_NOTICE "free 0x%08x + dirty 0x%08x + used %08x + wasted %08x + unchecked %08x != total %08x\n", \
215 ___j->free_size, ___j->dirty_size, ___j->used_size, ___j->wasted_size, ___j->unchecked_size, c->sector_size); \
216 BUG(); \
217 } \
218 if (c->used_size + c->dirty_size + c->free_size + c->erasing_size + c->bad_size + c->wasted_size + c->unchecked_size != c->flash_size) { \
219 printk(KERN_NOTICE "Eeep. Space accounting superblock info is screwed\n"); \
220 printk(KERN_NOTICE "free 0x%08x + dirty 0x%08x + used %08x + erasing %08x + bad %08x + wasted %08x + unchecked %08x != total %08x\n", \
221 c->free_size, c->dirty_size, c->used_size, c->erasing_size, c->bad_size, c->wasted_size, c->unchecked_size, c->flash_size); \
222 BUG(); \
223 } \
224} while(0)
225
226static inline void paranoia_failed_dump(struct jffs2_eraseblock *jeb)
227{ 202{
228 struct jffs2_raw_node_ref *ref; 203 return ((c->flash_size / c->sector_size) * sizeof (struct jffs2_eraseblock)) > (128 * 1024);
229 int i=0;
230
231 printk(KERN_NOTICE);
232 for (ref = jeb->first_node; ref; ref = ref->next_phys) {
233 printk("%08x->", ref_offset(ref));
234 if (++i == 8) {
235 i = 0;
236 printk("\n" KERN_NOTICE);
237 }
238 }
239 printk("\n");
240} 204}
241 205
242
243#define ACCT_PARANOIA_CHECK(jeb) do { \
244 uint32_t my_used_size = 0; \
245 uint32_t my_unchecked_size = 0; \
246 struct jffs2_raw_node_ref *ref2 = jeb->first_node; \
247 while (ref2) { \
248 if (unlikely(ref2->flash_offset < jeb->offset || \
249 ref2->flash_offset > jeb->offset + c->sector_size)) { \
250 printk(KERN_NOTICE "Node %08x shouldn't be in block at %08x!\n", \
251 ref_offset(ref2), jeb->offset); \
252 paranoia_failed_dump(jeb); \
253 BUG(); \
254 } \
255 if (ref_flags(ref2) == REF_UNCHECKED) \
256 my_unchecked_size += ref_totlen(c, jeb, ref2); \
257 else if (!ref_obsolete(ref2)) \
258 my_used_size += ref_totlen(c, jeb, ref2); \
259 if (unlikely((!ref2->next_phys) != (ref2 == jeb->last_node))) { \
260 if (!ref2->next_phys) \
261 printk("ref for node at %p (phys %08x) has next_phys->%p (----), last_node->%p (phys %08x)\n", \
262 ref2, ref_offset(ref2), ref2->next_phys, \
263 jeb->last_node, ref_offset(jeb->last_node)); \
264 else \
265 printk("ref for node at %p (phys %08x) has next_phys->%p (%08x), last_node->%p (phys %08x)\n", \
266 ref2, ref_offset(ref2), ref2->next_phys, ref_offset(ref2->next_phys), \
267 jeb->last_node, ref_offset(jeb->last_node)); \
268 paranoia_failed_dump(jeb); \
269 BUG(); \
270 } \
271 ref2 = ref2->next_phys; \
272 } \
273 if (my_used_size != jeb->used_size) { \
274 printk(KERN_NOTICE "Calculated used size %08x != stored used size %08x\n", my_used_size, jeb->used_size); \
275 BUG(); \
276 } \
277 if (my_unchecked_size != jeb->unchecked_size) { \
278 printk(KERN_NOTICE "Calculated unchecked size %08x != stored unchecked size %08x\n", my_unchecked_size, jeb->unchecked_size); \
279 BUG(); \
280 } \
281 } while(0)
282
283/* Calculate totlen from surrounding nodes or eraseblock */ 206/* Calculate totlen from surrounding nodes or eraseblock */
284static inline uint32_t __ref_totlen(struct jffs2_sb_info *c, 207static inline uint32_t __ref_totlen(struct jffs2_sb_info *c,
285 struct jffs2_eraseblock *jeb, 208 struct jffs2_eraseblock *jeb,
286 struct jffs2_raw_node_ref *ref) 209 struct jffs2_raw_node_ref *ref)
287{ 210{
288 uint32_t ref_end; 211 uint32_t ref_end;
289 212
290 if (ref->next_phys) 213 if (ref->next_phys)
291 ref_end = ref_offset(ref->next_phys); 214 ref_end = ref_offset(ref->next_phys);
292 else { 215 else {
@@ -306,11 +229,13 @@ static inline uint32_t ref_totlen(struct jffs2_sb_info *c,
306{ 229{
307 uint32_t ret; 230 uint32_t ret;
308 231
309 D1(if (jeb && jeb != &c->blocks[ref->flash_offset / c->sector_size]) { 232#if CONFIG_JFFS2_FS_DEBUG > 0
233 if (jeb && jeb != &c->blocks[ref->flash_offset / c->sector_size]) {
310 printk(KERN_CRIT "ref_totlen called with wrong block -- at 0x%08x instead of 0x%08x; ref 0x%08x\n", 234 printk(KERN_CRIT "ref_totlen called with wrong block -- at 0x%08x instead of 0x%08x; ref 0x%08x\n",
311 jeb->offset, c->blocks[ref->flash_offset / c->sector_size].offset, ref_offset(ref)); 235 jeb->offset, c->blocks[ref->flash_offset / c->sector_size].offset, ref_offset(ref));
312 BUG(); 236 BUG();
313 }) 237 }
238#endif
314 239
315#if 1 240#if 1
316 ret = ref->__totlen; 241 ret = ref->__totlen;
@@ -323,14 +248,13 @@ static inline uint32_t ref_totlen(struct jffs2_sb_info *c,
323 ret, ref->__totlen); 248 ret, ref->__totlen);
324 if (!jeb) 249 if (!jeb)
325 jeb = &c->blocks[ref->flash_offset / c->sector_size]; 250 jeb = &c->blocks[ref->flash_offset / c->sector_size];
326 paranoia_failed_dump(jeb); 251 jffs2_dbg_dump_node_refs_nolock(c, jeb);
327 BUG(); 252 BUG();
328 } 253 }
329#endif 254#endif
330 return ret; 255 return ret;
331} 256}
332 257
333
334#define ALLOC_NORMAL 0 /* Normal allocation */ 258#define ALLOC_NORMAL 0 /* Normal allocation */
335#define ALLOC_DELETION 1 /* Deletion node. Best to allow it */ 259#define ALLOC_DELETION 1 /* Deletion node. Best to allow it */
336#define ALLOC_GC 2 /* Space requested for GC. Give it or die */ 260#define ALLOC_GC 2 /* Space requested for GC. Give it or die */
@@ -340,7 +264,7 @@ static inline uint32_t ref_totlen(struct jffs2_sb_info *c,
340#define VERYDIRTY(c, size) ((size) >= ((c)->sector_size / 2)) 264#define VERYDIRTY(c, size) ((size) >= ((c)->sector_size / 2))
341 265
342/* check if dirty space is more than 255 Byte */ 266/* check if dirty space is more than 255 Byte */
343#define ISDIRTY(size) ((size) > sizeof (struct jffs2_raw_inode) + JFFS2_MIN_DATA_LEN) 267#define ISDIRTY(size) ((size) > sizeof (struct jffs2_raw_inode) + JFFS2_MIN_DATA_LEN)
344 268
345#define PAD(x) (((x)+3)&~3) 269#define PAD(x) (((x)+3)&~3)
346 270
@@ -384,12 +308,7 @@ static inline struct jffs2_node_frag *frag_last(struct rb_root *root)
384#define frag_erase(frag, list) rb_erase(&frag->rb, list); 308#define frag_erase(frag, list) rb_erase(&frag->rb, list);
385 309
386/* nodelist.c */ 310/* nodelist.c */
387D2(void jffs2_print_frag_list(struct jffs2_inode_info *f));
388void jffs2_add_fd_to_list(struct jffs2_sb_info *c, struct jffs2_full_dirent *new, struct jffs2_full_dirent **list); 311void jffs2_add_fd_to_list(struct jffs2_sb_info *c, struct jffs2_full_dirent *new, struct jffs2_full_dirent **list);
389int jffs2_get_inode_nodes(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
390 struct rb_root *tnp, struct jffs2_full_dirent **fdp,
391 uint32_t *highest_version, uint32_t *latest_mctime,
392 uint32_t *mctime_ver);
393void jffs2_set_inocache_state(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic, int state); 312void jffs2_set_inocache_state(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic, int state);
394struct jffs2_inode_cache *jffs2_get_ino_cache(struct jffs2_sb_info *c, uint32_t ino); 313struct jffs2_inode_cache *jffs2_get_ino_cache(struct jffs2_sb_info *c, uint32_t ino);
395void jffs2_add_ino_cache (struct jffs2_sb_info *c, struct jffs2_inode_cache *new); 314void jffs2_add_ino_cache (struct jffs2_sb_info *c, struct jffs2_inode_cache *new);
@@ -398,19 +317,23 @@ void jffs2_free_ino_caches(struct jffs2_sb_info *c);
398void jffs2_free_raw_node_refs(struct jffs2_sb_info *c); 317void jffs2_free_raw_node_refs(struct jffs2_sb_info *c);
399struct jffs2_node_frag *jffs2_lookup_node_frag(struct rb_root *fragtree, uint32_t offset); 318struct jffs2_node_frag *jffs2_lookup_node_frag(struct rb_root *fragtree, uint32_t offset);
400void jffs2_kill_fragtree(struct rb_root *root, struct jffs2_sb_info *c_delete); 319void jffs2_kill_fragtree(struct rb_root *root, struct jffs2_sb_info *c_delete);
401void jffs2_fragtree_insert(struct jffs2_node_frag *newfrag, struct jffs2_node_frag *base);
402struct rb_node *rb_next(struct rb_node *); 320struct rb_node *rb_next(struct rb_node *);
403struct rb_node *rb_prev(struct rb_node *); 321struct rb_node *rb_prev(struct rb_node *);
404void rb_replace_node(struct rb_node *victim, struct rb_node *new, struct rb_root *root); 322void rb_replace_node(struct rb_node *victim, struct rb_node *new, struct rb_root *root);
323void jffs2_obsolete_node_frag(struct jffs2_sb_info *c, struct jffs2_node_frag *this);
324int jffs2_add_full_dnode_to_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, struct jffs2_full_dnode *fn);
325void jffs2_truncate_fragtree (struct jffs2_sb_info *c, struct rb_root *list, uint32_t size);
326int jffs2_add_older_frag_to_fragtree(struct jffs2_sb_info *c, struct jffs2_inode_info *f, struct jffs2_tmp_dnode_info *tn);
405 327
406/* nodemgmt.c */ 328/* nodemgmt.c */
407int jffs2_thread_should_wake(struct jffs2_sb_info *c); 329int jffs2_thread_should_wake(struct jffs2_sb_info *c);
408int jffs2_reserve_space(struct jffs2_sb_info *c, uint32_t minsize, uint32_t *ofs, uint32_t *len, int prio); 330int jffs2_reserve_space(struct jffs2_sb_info *c, uint32_t minsize, uint32_t *ofs,
409int jffs2_reserve_space_gc(struct jffs2_sb_info *c, uint32_t minsize, uint32_t *ofs, uint32_t *len); 331 uint32_t *len, int prio, uint32_t sumsize);
332int jffs2_reserve_space_gc(struct jffs2_sb_info *c, uint32_t minsize, uint32_t *ofs,
333 uint32_t *len, uint32_t sumsize);
410int jffs2_add_physical_node_ref(struct jffs2_sb_info *c, struct jffs2_raw_node_ref *new); 334int jffs2_add_physical_node_ref(struct jffs2_sb_info *c, struct jffs2_raw_node_ref *new);
411void jffs2_complete_reservation(struct jffs2_sb_info *c); 335void jffs2_complete_reservation(struct jffs2_sb_info *c);
412void jffs2_mark_node_obsolete(struct jffs2_sb_info *c, struct jffs2_raw_node_ref *raw); 336void jffs2_mark_node_obsolete(struct jffs2_sb_info *c, struct jffs2_raw_node_ref *raw);
413void jffs2_dump_block_lists(struct jffs2_sb_info *c);
414 337
415/* write.c */ 338/* write.c */
416int jffs2_do_new_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, uint32_t mode, struct jffs2_raw_inode *ri); 339int jffs2_do_new_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, uint32_t mode, struct jffs2_raw_inode *ri);
@@ -418,17 +341,15 @@ int jffs2_do_new_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, uint
418struct jffs2_full_dnode *jffs2_write_dnode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, struct jffs2_raw_inode *ri, const unsigned char *data, uint32_t datalen, uint32_t flash_ofs, int alloc_mode); 341struct jffs2_full_dnode *jffs2_write_dnode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, struct jffs2_raw_inode *ri, const unsigned char *data, uint32_t datalen, uint32_t flash_ofs, int alloc_mode);
419struct jffs2_full_dirent *jffs2_write_dirent(struct jffs2_sb_info *c, struct jffs2_inode_info *f, struct jffs2_raw_dirent *rd, const unsigned char *name, uint32_t namelen, uint32_t flash_ofs, int alloc_mode); 342struct jffs2_full_dirent *jffs2_write_dirent(struct jffs2_sb_info *c, struct jffs2_inode_info *f, struct jffs2_raw_dirent *rd, const unsigned char *name, uint32_t namelen, uint32_t flash_ofs, int alloc_mode);
420int jffs2_write_inode_range(struct jffs2_sb_info *c, struct jffs2_inode_info *f, 343int jffs2_write_inode_range(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
421 struct jffs2_raw_inode *ri, unsigned char *buf, 344 struct jffs2_raw_inode *ri, unsigned char *buf,
422 uint32_t offset, uint32_t writelen, uint32_t *retlen); 345 uint32_t offset, uint32_t writelen, uint32_t *retlen);
423int jffs2_do_create(struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f, struct jffs2_inode_info *f, struct jffs2_raw_inode *ri, const char *name, int namelen); 346int jffs2_do_create(struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f, struct jffs2_inode_info *f, struct jffs2_raw_inode *ri, const char *name, int namelen);
424int jffs2_do_unlink(struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f, const char *name, int namelen, struct jffs2_inode_info *dead_f); 347int jffs2_do_unlink(struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f, const char *name, int namelen, struct jffs2_inode_info *dead_f, uint32_t time);
425int jffs2_do_link (struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f, uint32_t ino, uint8_t type, const char *name, int namelen); 348int jffs2_do_link (struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f, uint32_t ino, uint8_t type, const char *name, int namelen, uint32_t time);
426 349
427 350
428/* readinode.c */ 351/* readinode.c */
429void jffs2_truncate_fraglist (struct jffs2_sb_info *c, struct rb_root *list, uint32_t size); 352int jffs2_do_read_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
430int jffs2_add_full_dnode_to_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, struct jffs2_full_dnode *fn);
431int jffs2_do_read_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
432 uint32_t ino, struct jffs2_raw_inode *latest_node); 353 uint32_t ino, struct jffs2_raw_inode *latest_node);
433int jffs2_do_crccheck_inode(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic); 354int jffs2_do_crccheck_inode(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic);
434void jffs2_do_clear_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f); 355void jffs2_do_clear_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f);
@@ -468,6 +389,10 @@ char *jffs2_getlink(struct jffs2_sb_info *c, struct jffs2_inode_info *f);
468/* scan.c */ 389/* scan.c */
469int jffs2_scan_medium(struct jffs2_sb_info *c); 390int jffs2_scan_medium(struct jffs2_sb_info *c);
470void jffs2_rotate_lists(struct jffs2_sb_info *c); 391void jffs2_rotate_lists(struct jffs2_sb_info *c);
392int jffs2_fill_scan_buf(struct jffs2_sb_info *c, void *buf,
393 uint32_t ofs, uint32_t len);
394struct jffs2_inode_cache *jffs2_scan_make_ino_cache(struct jffs2_sb_info *c, uint32_t ino);
395int jffs2_scan_classify_jeb(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb);
471 396
472/* build.c */ 397/* build.c */
473int jffs2_do_mount_fs(struct jffs2_sb_info *c); 398int jffs2_do_mount_fs(struct jffs2_sb_info *c);
@@ -483,4 +408,6 @@ int jffs2_check_nand_cleanmarker(struct jffs2_sb_info *c, struct jffs2_erasebloc
483int jffs2_write_nand_cleanmarker(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb); 408int jffs2_write_nand_cleanmarker(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb);
484#endif 409#endif
485 410
411#include "debug.h"
412
486#endif /* __JFFS2_NODELIST_H__ */ 413#endif /* __JFFS2_NODELIST_H__ */