diff options
author | David Woodhouse <dwmw2@infradead.org> | 2006-05-23 21:04:45 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2006-05-23 21:04:45 -0400 |
commit | 2f785402f39b96a077b6e62bf26164bfb8e0c980 (patch) | |
tree | 3f3a38b484ef2dabda1599d4d8f08b121bd03a76 /fs/jffs2/nodelist.h | |
parent | 4cbb9b80e171107c6c34116283fe38e5a396c68b (diff) |
[JFFS2] Reduce visibility of raw_node_ref to upper layers of JFFS2 code.
As the first step towards eliminating the ref->next_phys member and saving
memory by using an _array_ of struct jffs2_raw_node_ref per eraseblock,
stop the write functions from allocating their own refs; have them just
_reserve_ the appropriate number instead. Then jffs2_link_node_ref() can
just fill them in.
Use a linked list of pre-allocated refs in the superblock, for now. Once
we switch to an array, it'll just be a case of extending that array.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'fs/jffs2/nodelist.h')
-rw-r--r-- | fs/jffs2/nodelist.h | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/fs/jffs2/nodelist.h b/fs/jffs2/nodelist.h index 76f1b9419eea..7cc74d2ab4dc 100644 --- a/fs/jffs2/nodelist.h +++ b/fs/jffs2/nodelist.h | |||
@@ -318,9 +318,10 @@ void jffs2_obsolete_node_frag(struct jffs2_sb_info *c, struct jffs2_node_frag *t | |||
318 | int jffs2_add_full_dnode_to_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, struct jffs2_full_dnode *fn); | 318 | int jffs2_add_full_dnode_to_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, struct jffs2_full_dnode *fn); |
319 | void jffs2_truncate_fragtree (struct jffs2_sb_info *c, struct rb_root *list, uint32_t size); | 319 | void jffs2_truncate_fragtree (struct jffs2_sb_info *c, struct rb_root *list, uint32_t size); |
320 | int jffs2_add_older_frag_to_fragtree(struct jffs2_sb_info *c, struct jffs2_inode_info *f, struct jffs2_tmp_dnode_info *tn); | 320 | int jffs2_add_older_frag_to_fragtree(struct jffs2_sb_info *c, struct jffs2_inode_info *f, struct jffs2_tmp_dnode_info *tn); |
321 | void jffs2_link_node_ref(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, | 321 | struct jffs2_raw_node_ref *jffs2_link_node_ref(struct jffs2_sb_info *c, |
322 | struct jffs2_raw_node_ref *ref, uint32_t len, | 322 | struct jffs2_eraseblock *jeb, |
323 | struct jffs2_inode_cache *ic); | 323 | uint32_t ofs, uint32_t len, |
324 | struct jffs2_inode_cache *ic); | ||
324 | extern uint32_t __jffs2_ref_totlen(struct jffs2_sb_info *c, | 325 | extern uint32_t __jffs2_ref_totlen(struct jffs2_sb_info *c, |
325 | struct jffs2_eraseblock *jeb, | 326 | struct jffs2_eraseblock *jeb, |
326 | struct jffs2_raw_node_ref *ref); | 327 | struct jffs2_raw_node_ref *ref); |
@@ -331,10 +332,9 @@ int jffs2_reserve_space(struct jffs2_sb_info *c, uint32_t minsize, | |||
331 | uint32_t *len, int prio, uint32_t sumsize); | 332 | uint32_t *len, int prio, uint32_t sumsize); |
332 | int jffs2_reserve_space_gc(struct jffs2_sb_info *c, uint32_t minsize, | 333 | int jffs2_reserve_space_gc(struct jffs2_sb_info *c, uint32_t minsize, |
333 | uint32_t *len, uint32_t sumsize); | 334 | uint32_t *len, uint32_t sumsize); |
334 | int jffs2_add_physical_node_ref(struct jffs2_sb_info *c, | 335 | struct jffs2_raw_node_ref *jffs2_add_physical_node_ref(struct jffs2_sb_info *c, |
335 | struct jffs2_raw_node_ref *new, | 336 | uint32_t ofs, uint32_t len, |
336 | uint32_t len, | 337 | struct jffs2_inode_cache *ic); |
337 | struct jffs2_inode_cache *ic); | ||
338 | void jffs2_complete_reservation(struct jffs2_sb_info *c); | 338 | void jffs2_complete_reservation(struct jffs2_sb_info *c); |
339 | void jffs2_mark_node_obsolete(struct jffs2_sb_info *c, struct jffs2_raw_node_ref *raw); | 339 | void jffs2_mark_node_obsolete(struct jffs2_sb_info *c, struct jffs2_raw_node_ref *raw); |
340 | 340 | ||
@@ -378,8 +378,9 @@ struct jffs2_raw_inode *jffs2_alloc_raw_inode(void); | |||
378 | void jffs2_free_raw_inode(struct jffs2_raw_inode *); | 378 | void jffs2_free_raw_inode(struct jffs2_raw_inode *); |
379 | struct jffs2_tmp_dnode_info *jffs2_alloc_tmp_dnode_info(void); | 379 | struct jffs2_tmp_dnode_info *jffs2_alloc_tmp_dnode_info(void); |
380 | void jffs2_free_tmp_dnode_info(struct jffs2_tmp_dnode_info *); | 380 | void jffs2_free_tmp_dnode_info(struct jffs2_tmp_dnode_info *); |
381 | struct jffs2_raw_node_ref *jffs2_alloc_raw_node_ref(void); | 381 | int jffs2_prealloc_raw_node_refs(struct jffs2_sb_info *c, int nr); |
382 | void jffs2_free_raw_node_ref(struct jffs2_raw_node_ref *); | 382 | struct jffs2_raw_node_ref *__jffs2_alloc_raw_node_ref(void); |
383 | void __jffs2_free_raw_node_ref(struct jffs2_raw_node_ref *); | ||
383 | struct jffs2_node_frag *jffs2_alloc_node_frag(void); | 384 | struct jffs2_node_frag *jffs2_alloc_node_frag(void); |
384 | void jffs2_free_node_frag(struct jffs2_node_frag *); | 385 | void jffs2_free_node_frag(struct jffs2_node_frag *); |
385 | struct jffs2_inode_cache *jffs2_alloc_inode_cache(void); | 386 | struct jffs2_inode_cache *jffs2_alloc_inode_cache(void); |