/* UBIFS is trying to account the space which might not be usable, and this space is called "dark space". For example, if an LEB has only %512 free bytes, it is dark space, because it cannot fit a large data node.  */
int ubifs_calc_dark(const struct ubifs_info *c, int spc)
/* UBIFS is trying to account the space which might not be usable, and this space is called "dark space". For example, if an LEB has only %512 free bytes, it is dark space, because it cannot fit a large data node.  */
int ubifs_calc_dark(const struct ubifs_info *c, int spc)
{
	ubifs_assert(!(spc & 7));
	if (spc < c->dark_wm)
		return spc;
	if (spc - c->dark_wm < MIN_WRITE_SZ)
		return spc - MIN_WRITE_SZ;
	return c->dark_wm;
}