Re: [PATCH 2/3] sysfs: make s_count a kref

From: Eric W. Biederman
Date: Fri Mar 26 2010 - 00:29:34 EST


NeilBrown <neilb@xxxxxxx> writes:

> s_count in sysfs behaves exactly like a kref, so change it to
> be one.
> This requires adding a KREF_INIT macro to kref.h

Except where it doesn't. The whole no_recurse thing is definitely
not idiomatic kref usage. I could find only 3 instances of someone even
looking at the return value. I would argue based on that the return
value of kref_put should be removed.

KREF_INIT if we want it should be added in a separate patch.

kref should be kept for the stupid simple cases where so we don't have
to think about refcounting, and just know it works. kref should not
be where we are getting clever, and it this feels like getting clever
to me.

It isn't like the atomic primitives are any worse than kref.

Eric
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/