- TAILQ_ENTRY( aio_workq_entry ) aio_workq_link;
- struct proc *procp; /* user proc that queued this request */
- struct aiocb *uaiocbp; /* pointer passed in from user land */
- struct aiocb *fsyncp; /* not NULL means this request must complete */
- /* before an aio_fsync call can proceed. */
- vm_map_t aio_map; /* user land map we have a reference to */
- ssize_t returnval; /* return value from read / write request */
- int errorval; /* error value from read / write request */
- int flags;
- long group_tag; /* identifier used to group IO requests */
- struct aiocb aiocb; /* copy of aiocb from user land */
+ TAILQ_ENTRY( aio_workq_entry ) aio_workq_link; /* Protected by queue lock */
+ TAILQ_ENTRY( aio_workq_entry ) aio_proc_link; /* Proteced by proc's aio lock */
+
+ /* Proc lock */
+ void *group_tag; /* identifier used to group IO requests */
+
+ /* Initialized and never changed, safe to access */
+ struct proc *procp; /* user proc that queued this request */
+ user_addr_t uaiocbp; /* pointer passed in from user land */
+ struct user_aiocb aiocb; /* copy of aiocb from user land */
+ vm_map_t aio_map; /* user land map we have a reference to */
+
+ /* Entry lock */
+ int aio_refcount;
+ user_ssize_t returnval; /* return value from read / write request */
+ int errorval; /* error value from read / write request */
+ int flags;