/* This function returns a pointer to the nnode on success or a negative error code on failure.  */
struct ubifs_nnode* ubifs_get_nnode(struct ubifs_info *c, struct ubifs_nnode *parent, int iip)
/* This function returns a pointer to the nnode on success or a negative error code on failure.  */
struct ubifs_nnode* ubifs_get_nnode(struct ubifs_info *c, struct ubifs_nnode *parent, int iip)
{
	struct ubifs_nbranch *branch;
	struct ubifs_nnode *nnode;
	int err;
	branch = &parent->nbranch[iip];
	nnode = branch->nnode;
	if (nnode)
		return nnode;
	err = ubifs_read_nnode(c, parent, iip);
	if (err)
		return ERR_PTR(err);
	return branch->nnode;
}