/* yaffs_bg_gc() Garbage collects. Intended to be called from a background thread. Returns non-zero if at least half the free chunks are erased.  */
int yaffs_bg_gc(struct yaffs_dev *dev, unsigned urgency)
/* yaffs_bg_gc() Garbage collects. Intended to be called from a background thread. Returns non-zero if at least half the free chunks are erased.  */
int yaffs_bg_gc(struct yaffs_dev *dev, unsigned urgency)
{
	int erased_chunks = dev->n_erased_blocks * dev->param.chunks_per_block;
	yaffs_trace(YAFFS_TRACE_BACKGROUND, "Background gc %u", urgency);
	yaffs_check_gc(dev, 1);
	return erased_chunks > dev->n_free_chunks / 2;
}