/* Returns 0 for success, negative error code on error.  */
int request_resource(struct resource *root, struct resource *new)
/* Returns 0 for success, negative error code on error.  */
int request_resource(struct resource *root, struct resource *new)
{
	struct resource *conflict;
	write_lock(&resource_lock);
	conflict = __request_resource(root, new);
	write_unlock(&resource_lock);
	return conflict ? -EBUSY : 0;
}