/* Note, this function does not add the @node object to LNC directly, but allocates a copy of the object and adds the copy to LNC. The reason for this is that @node has been allocated outside of the TNC subsystem and will be used with  */
static int lnc_add(struct ubifs_info *c, struct ubifs_zbranch *zbr, const void *node)
/* Note, this function does not add the @node object to LNC directly, but allocates a copy of the object and adds the copy to LNC. The reason for this is that @node has been allocated outside of the TNC subsystem and will be used with  */
static int lnc_add(struct ubifs_info *c, struct ubifs_zbranch *zbr, const void *node)
{
	int err;
	void *lnc_node;
	const struct ubifs_dent_node *dent = node;
	ubifs_assert(!zbr->leaf);
	ubifs_assert(zbr->len != 0);
	ubifs_assert(is_hash_key(c, &zbr->key));
	err = ubifs_validate_entry(c, dent);
	if (err) {
		dump_stack();
		ubifs_dump_node(c, dent);
		return err;
	}
	lnc_node = kmemdup(node, zbr->len, GFP_NOFS);
	if (!lnc_node)
		return 0;
	zbr->leaf = lnc_node;
	return 0;
}