.totlen = cpu_to_je32(c->cleanmarker_size)
};
- jffs2_prealloc_raw_node_refs(c, 1);
+ jffs2_prealloc_raw_node_refs(c, jeb, 1);
marker.hdr_crc = cpu_to_je32(crc32(0, &marker, sizeof(struct jffs2_unknown_node)-4));
kmem_cache_free(tmp_dnode_info_slab, x);
}
-int jffs2_prealloc_raw_node_refs(struct jffs2_sb_info *c, int nr)
+int jffs2_prealloc_raw_node_refs(struct jffs2_sb_info *c,
+ struct jffs2_eraseblock *jeb, int nr)
{
struct jffs2_raw_node_ref *p = c->refs;
void jffs2_free_raw_inode(struct jffs2_raw_inode *);
struct jffs2_tmp_dnode_info *jffs2_alloc_tmp_dnode_info(void);
void jffs2_free_tmp_dnode_info(struct jffs2_tmp_dnode_info *);
-int jffs2_prealloc_raw_node_refs(struct jffs2_sb_info *c, int nr);
+int jffs2_prealloc_raw_node_refs(struct jffs2_sb_info *c,
+ struct jffs2_eraseblock *jeb, int nr);
struct jffs2_raw_node_ref *__jffs2_alloc_raw_node_ref(void);
void __jffs2_free_raw_node_ref(struct jffs2_raw_node_ref *);
struct jffs2_node_frag *jffs2_alloc_node_frag(void);
}
spin_unlock(&c->erase_completion_lock);
if (!ret)
- ret = jffs2_prealloc_raw_node_refs(c, 1);
+ ret = jffs2_prealloc_raw_node_refs(c, c->nextblock, 1);
if (ret)
up(&c->alloc_sem);
return ret;
}
spin_unlock(&c->erase_completion_lock);
if (!ret)
- ret = jffs2_prealloc_raw_node_refs(c, 1);
+ ret = jffs2_prealloc_raw_node_refs(c, c->nextblock, 1);
return ret;
}
D1(printk(KERN_DEBUG "jffs2_scan_medium(): Skipping %d bytes in nextblock to ensure page alignment\n",
skip));
- jffs2_prealloc_raw_node_refs(c, 1);
+ jffs2_prealloc_raw_node_refs(c, c->nextblock, 1);
jffs2_scan_dirty_space(c, c->nextblock, skip);
}
#endif
jffs2_dbg_acct_paranoia_check_nolock(c, jeb);
/* Make sure there are node refs available for use */
- err = jffs2_prealloc_raw_node_refs(c, 2);
+ err = jffs2_prealloc_raw_node_refs(c, jeb, 2);
if (err)
return err;
dbg_summary("processing summary index %d\n", i);
/* Make sure there's a spare ref for dirty space */
- err = jffs2_prealloc_raw_node_refs(c, 2);
+ err = jffs2_prealloc_raw_node_refs(c, jeb, 2);
if (err)
return err;
return ret; /* real error */
/* for PARANOIA_CHECK */
- ret = jffs2_prealloc_raw_node_refs(c, 2);
+ ret = jffs2_prealloc_raw_node_refs(c, jeb, 2);
if (ret)
return ret;
dbg_summary("called\n");
spin_unlock(&c->erase_completion_lock);
- jffs2_prealloc_raw_node_refs(c, 1);
jeb = c->nextblock;
+ jffs2_prealloc_raw_node_refs(c, jeb, 1);
if (!c->summary->sum_num || !c->summary->sum_list_head) {
JFFS2_WARNING("Empty summary info!!!\n");
unsigned char *buf;
uint32_t start, end, ofs, len;
- if (jffs2_prealloc_raw_node_refs(c, c->reserved_refs + 1))
+ jeb = &c->blocks[c->wbuf_ofs / c->sector_size];
+
+ if (jffs2_prealloc_raw_node_refs(c, jeb, c->reserved_refs + 1))
return;
spin_lock(&c->erase_completion_lock);
- jeb = &c->blocks[c->wbuf_ofs / c->sector_size];
-
jffs2_block_refile(c, jeb, REFILE_NOTEMPTY);
/* Find the first node to be recovered, by skipping over every
if (!c->wbuf_len) /* already checked c->wbuf above */
return 0;
- if (jffs2_prealloc_raw_node_refs(c, c->reserved_refs + 1))
+ if (jffs2_prealloc_raw_node_refs(c, c->nextblock, c->reserved_refs + 1))
return -ENOMEM;
/* claim remaining space on the page