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