#include <9pm/u.h>
#include <9pm/libc.h>

void
incref(Ref *r)
{
	lock(&r->lk);
	++r->ref;
	unlock(&r->lk);
}

int
decref(Ref *r)
{
	int ret;

	lock(&r->lk);
	ret = --r->ref;
	unlock(&r->lk);
	return ret;
}

