/* This function returns a pointer to the znode to the left of @znode or NULL if there is not one. A negative error code is returned on failure.  */
static struct ubifs_znode* left_znode(struct ubifs_info *c, struct ubifs_znode *znode)
/* This function returns a pointer to the znode to the left of @znode or NULL if there is not one. A negative error code is returned on failure.  */
static struct ubifs_znode* left_znode(struct ubifs_info *c, struct ubifs_znode *znode)
{
	int level = znode->level;
	while (1) {
		int n = znode->iip - 1;
		znode = znode->parent;
		if (!znode)
			return NULL;
		if (n >= 0) {
			znode = get_znode(c, znode, n);
			if (IS_ERR(znode))
				return znode;
			while (znode->level != level) {
				n = znode->child_cnt - 1;
				znode = get_znode(c, znode, n);
				if (IS_ERR(znode))
					return znode;
			}
			break;
		}
	}
	return znode;
}