Re: [PATCH] ipc 1/3: Add refcount to ipc_rcu_alloc

From: Andrew Morton
Date: Sat Jul 03 2004 - 17:47:40 EST


Manfred Spraul <manfred@xxxxxxxxxxxxxxxx> wrote:
>
> +struct ipc_rcu_hdr
> +{
> + int refcount;
> + int is_vmalloc;
> + void *data[0];
> +};

That's not what I meant ;)

struct ipc_rcu_hdr
{
int refcount;
int is_vmalloc;
};

Then place one of these inside struct msg_queue, one inside struct
sem_array, etc.

#define ipc_rcu_putref(p)
if (--p->rcu_hdr.refcount == 0)
ipc_rcu_putref_final(p, &p->rcu_hdr)

or whatever.

That's assuming struct kref isn't suitable. I guess you don't want the
atomic_t.
-
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/