Quoting r. Roland Dreier <[EMAIL PROTECTED]>:
> Subject: Re: [PATCH] cm refcount race fix
>
> Good idea. I think with
>
> static inline int get_obj_refcount(struct foo *obj)
> {
> int c;
>
> spin_lock_irq(&obj->lock);
> c = obj->refcount;
> spin_unlock_irq(&obj->lock);
>
> return c;
> }
>
> then
>
> wait_event(&obj->wait, !get_obj_refcount(&obj));
>
> looks like a pretty clean solution.
Right, fine, but if we change refcount from atomic to int,
we still need to edit all code and replace
atomic_inc/atomic_dec with lock/modify/unlock.
Would
static inline int get_obj_refcount(struct foo *obj)
{
int c;
spin_lock_irq(&obj->lock);
c = atomic_read(&obj->refcount);
spin_unlock_irq(&obj->lock);
return c;
}
be acceptable?
--
MST
_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general
To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general