[OpenAFS-devel] porting openafs to another linux - problems w ith vRefcount type..
Nickolai Zeldovich
kolya@MIT.EDU
Fri, 05 Oct 2001 15:33:12 -0400
> Although it would be better to use the atomic_* interfaces I'd say. But that
> would require cleaning up stray references to it throughout the code.
> (Probably a good thing to do anyway.)
It looks like all we'd need to do is convert the refcount increments
and decrements into VN_HOLD/VN_RELE calls (and of course make VN_HOLD
an atomic_inc), and convert the rest to use something like these:
#ifndef AFS_LINUX24_ENV
#define VREFCOUNT(v) (v).vrefCount
#define VREFCOUNT_SET(v, c) (v).vrefCount=c
#else
#define VREFCOUNT(v) atomic_read(&(v).v_count)
#define VREFCOUNT_SET(v, c) atomic_set(&(v).v_count, c)
#endif
grep suggests there's only 20-30 places that would have to be changed,
so shouldn't be very hard. I'll try to go through and do this sometime
later tonight, unless someone beats me to it. (Am I missing anything?)
-- kolya