Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 046b8b98 authored by David Woodhouse's avatar David Woodhouse
Browse files

[JFFS2] Add 'jeb' argument to jffs2_prealloc_raw_node_refs()



Preallocation of refs is shortly going to be a per-eraseblock thing,
rather than per-filesystem. Add the required argument to the function.

Signed-off-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
parent f61579c3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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));

+2 −1
Original line number Diff line number Diff line
@@ -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;

+2 −1
Original line number Diff line number Diff line
@@ -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);
+2 −2
Original line number Diff line number Diff line
@@ -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;
@@ -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;
}
+2 −2
Original line number Diff line number Diff line
@@ -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
@@ -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;

Loading