> Sorry I wasn't thorough enough. And partially because I was worried
> about changing structure type for user space facing struct aio_ring.
> Now that I looked through all arches, it looks safe as all arch's
> atomic_t has the same size as int.
> Here is the updated patch.
> @@ -144,7 +144,7 @@ struct kiocb {
> struct aio_ring {
> unsigned id; /* kernel internal index number */
> unsigned nr; /* number of io_events */
> - unsigned head;
> + atomic_t head;
> unsigned tail;
Embedding an atomic_t in an ABI struct? That makes everyone else
nervous too, right?
It may look safe on i386/x86-64 today, but this doesn't seem like wise
practice. Is there any reason to believe that atomic_t will never
change size? Does anything else do this already?
If nothing else, the "unsigned" (should be __u32, sigh) could be cast to
an atomic_t.