/* This function checks if the UBIFS volume is empty by looking if its LEBs are mapped or not. The result of checking is stored in the  */
static int check_volume_empty(struct ubifs_info *c)
/* This function checks if the UBIFS volume is empty by looking if its LEBs are mapped or not. The result of checking is stored in the  */
static int check_volume_empty(struct ubifs_info *c)
{
	int lnum, err;
	c->empty = 1;
	for (lnum = 0; lnum < c->leb_cnt; lnum++) {
		err = ubifs_is_mapped(c, lnum);
		if (unlikely(err < 0))
			return err;
		if (err == 1) {
			c->empty = 0;
			break;
		}
		cond_resched();
	}
	return 0;
}