/* This function makes sure UBIFS has enough free space to be mounted in read/write mode. UBIFS must always have some free space to allow deletions.  */
static int check_free_space(struct ubifs_info *c)
/* This function makes sure UBIFS has enough free space to be mounted in read/write mode. UBIFS must always have some free space to allow deletions.  */
static int check_free_space(struct ubifs_info *c)
{
	ubifs_assert(c->dark_wm > 0);
	if (c->lst.total_free + c->lst.total_dirty < c->dark_wm) {
		ubifs_err("insufficient free space to mount in read/write mode");
		dbg_dump_budg(c);
		dbg_dump_lprops(c);
		return -ENOSPC;
	}
	return 0;
}