Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 27879
b: refs/heads/master
c: 046b8b9
h: refs/heads/master
i:
  27877: 8cdcdf3
  27875: 50fa237
  27871: fd4cedf
v: v3
  • Loading branch information
David Woodhouse committed May 25, 2006
1 parent 05d8dd8 commit cc159b1
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f61579c33736476e41e296a16c0d4ead4b953187
refs/heads/master: 046b8b9808127d63326a33bc6298c90eaee90eeb
2 changes: 1 addition & 1 deletion trunk/fs/jffs2/erase.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ static void jffs2_mark_erased_block(struct jffs2_sb_info *c, struct jffs2_eraseb
.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));

Expand Down
3 changes: 2 additions & 1 deletion trunk/fs/jffs2/malloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ void jffs2_free_tmp_dnode_info(struct jffs2_tmp_dnode_info *x)
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;

Expand Down
3 changes: 2 additions & 1 deletion trunk/fs/jffs2/nodelist.h
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,8 @@ struct jffs2_raw_inode *jffs2_alloc_raw_inode(void);
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);
Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/jffs2/nodemgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ int jffs2_reserve_space(struct jffs2_sb_info *c, uint32_t minsize,
}
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;
Expand All @@ -161,7 +161,7 @@ int jffs2_reserve_space_gc(struct jffs2_sb_info *c, uint32_t minsize,
}
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;
}
Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/jffs2/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ int jffs2_scan_medium(struct jffs2_sb_info *c)

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
Expand Down Expand Up @@ -576,7 +576,7 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo
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;

Expand Down
6 changes: 3 additions & 3 deletions trunk/fs/jffs2/summary.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ static int jffs2_sum_process_sum_data(struct jffs2_sb_info *c, struct jffs2_eras
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;

Expand Down Expand Up @@ -630,7 +630,7 @@ int jffs2_sum_scan_sumnode(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb
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;

Expand Down Expand Up @@ -815,9 +815,9 @@ int jffs2_sum_write_sumnode(struct jffs2_sb_info *c)
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");
Expand Down
8 changes: 4 additions & 4 deletions trunk/fs/jffs2/wbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,13 @@ static void jffs2_wbuf_recover(struct jffs2_sb_info *c)
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
Expand Down Expand Up @@ -417,7 +417,7 @@ static int __jffs2_flush_wbuf(struct jffs2_sb_info *c, int pad)
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
Expand Down

0 comments on commit cc159b1

Please sign in to comment.