- TAILQ_ENTRY( aio_workq_entry ) aio_workq_link;
- struct proc *procp; /* user proc that queued this request */
- user_addr_t uaiocbp; /* pointer passed in from user land */
- user_addr_t 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 */
- user_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 user_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 */
+ thread_t thread; /* thread that queued this request */
+
+ /* 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;