On Tue, Dec 13, 2022 at 07:21:14PM +0100, Paolo Abeni wrote: > Hi, > > On Mon, 2022-12-12 at 22:01 -0800, Eric Biggers wrote: > > I am trying to understand whether this patch is correct. > > > > One thing that would help would be to use more standard naming: > > > > ep_put => ep_refcount_dec_and_test (or ep_put_and_test) > > ep_dispose => ep_free > > ep_free => ep_clear_and_put > > Thank you for the feedback. > > I must admit I'm not good at all at selecting good names, so I > definitelly will apply the above. I additionally still have to cover > the feedback from Jacob - switching the reference count to a kref - as > I've been diverted to other tasks. > > I hope to be able to share a new revision of this patch next week. Using 'refcount_t' directly is another option. I think a plain 'unsigned int' would be fine here, if all reads and writes of the refcount really happen under a mutex. Using refcount_t (or kref) would add some extra sanity checks, though. - Eric