/* This function ensures that the corrupted node at @offs is the last thing written to a LEB. This function returns %1 if more data is not found and %0 if more data is found.  */
static int no_more_nodes(const struct ubifs_info *c, void *buf, int len, int lnum, int offs)
/* This function ensures that the corrupted node at @offs is the last thing written to a LEB. This function returns %1 if more data is not found and %0 if more data is found.  */
static int no_more_nodes(const struct ubifs_info *c, void *buf, int len, int lnum, int offs)
{
	struct ubifs_ch *ch = buf;
	int skip, dlen = le32_to_cpu(ch->len);
	skip = ALIGN(offs + UBIFS_CH_SZ, c->min_io_size) - offs;
	if (is_empty(buf + skip, len - skip))
		return 1;
	if (ubifs_check_node(c, buf, lnum, offs, 1, 0) != -EUCLEAN) {
		dbg_rcvry("unexpected bad common header at %d:%d", lnum, offs);
		return 0;
	}
	skip = ALIGN(offs + dlen, c->min_io_size) - offs;
	if (is_empty(buf + skip, len - skip))
		return 1;
	dbg_rcvry("unexpected data at %d:%d", lnum, offs + skip);
	return 0;
}