/* Dark space is the space which is not always usable - it depends on which nodes are written in which order. E.g., if an LEB has only 512 free bytes, it is dark space, because it cannot fit a large data node. So UBIFS cannot count on this LEB and treat these 512 bytes as usable because it is not true if, for example, only big chunks of uncompressible data will be written to the FS.  */
static int calc_dark(struct ubifs_info *c, int spc)
/* Dark space is the space which is not always usable - it depends on which nodes are written in which order. E.g., if an LEB has only 512 free bytes, it is dark space, because it cannot fit a large data node. So UBIFS cannot count on this LEB and treat these 512 bytes as usable because it is not true if, for example, only big chunks of uncompressible data will be written to the FS.  */
static int calc_dark(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;
}