Lines Matching defs:procp

161 	if ((aiop)->procp != (theproc)) { 	\
168 static void aio_proc_lock(proc_t procp);
169 static void aio_proc_lock_spin(proc_t procp);
170 static void aio_proc_unlock(proc_t procp);
171 static lck_mtx_t* aio_proc_mutex(proc_t procp);
172 static void aio_proc_move_done_locked(proc_t procp, aio_workq_entry *entryp);
173 static void aio_proc_remove_done_locked(proc_t procp, aio_workq_entry *entryp);
174 static int aio_get_process_count(proc_t procp );
175 static int aio_active_requests_for_process(proc_t procp );
176 static int aio_proc_active_requests_for_file(proc_t procp, int fd);
177 static boolean_t is_already_queued(proc_t procp, user_addr_t aiocbp );
205 static int aio_queue_async_request(proc_t procp, user_addr_t aiocbp, int kindOfIO );
217 static int lio_create_entry(proc_t procp,
221 static aio_workq_entry *aio_create_queue_entry(proc_t procp,
225 static user_addr_t *aio_copy_in_list(proc_t procp, user_addr_t aiocblist, int nent);
227 static void aio_enqueue_work( proc_t procp, aio_workq_entry *entryp, int proc_locked);
344 aio_proc_lock(proc_t procp)
346 lck_mtx_lock(aio_proc_mutex(procp));
350 aio_proc_lock_spin(proc_t procp)
352 lck_mtx_lock_spin(aio_proc_mutex(procp));
356 aio_proc_move_done_locked(proc_t procp, aio_workq_entry *entryp)
358 ASSERT_AIO_PROC_LOCK_OWNED(procp);
360 TAILQ_REMOVE(&procp->p_aio_activeq, entryp, aio_proc_link );
361 TAILQ_INSERT_TAIL( &procp->p_aio_doneq, entryp, aio_proc_link);
362 procp->p_aio_active_count--;
367 aio_proc_remove_done_locked(proc_t procp, aio_workq_entry *entryp)
369 TAILQ_REMOVE(&procp->p_aio_doneq, entryp, aio_proc_link);
372 procp->p_aio_total_count--;
376 aio_proc_unlock(proc_t procp)
378 lck_mtx_unlock(aio_proc_mutex(procp));
382 aio_proc_mutex(proc_t procp)
384 return &procp->p_mlock;
1015 (int)entryp->procp, (int)entryp->uaiocbp, fd, 0, 0 );
1046 (int)entryp->procp, (int)entryp->uaiocbp, fd, 0, 0 );
1071 (int)entryp->procp, (int)entryp->uaiocbp, fd, 0, 0 );
1263 aio_copy_in_list(proc_t procp, user_addr_t aiocblist, int nent)
1275 proc_is64bit(procp) ? (nent * sizeof(user64_addr_t))
1288 if ( !proc_is64bit(procp) ) {
1304 aio_copy_in_sigev(proc_t procp, user_addr_t sigp, struct user_sigevent *sigev)
1321 if ( proc_is64bit(procp) ) {
1361 * Parameters: procp Process queueing the I/O
1376 aio_enqueue_work( proc_t procp, aio_workq_entry *entryp, int proc_locked)
1384 aio_proc_lock(procp);
1387 ASSERT_AIO_PROC_LOCK_OWNED(procp);
1390 TAILQ_INSERT_TAIL(&procp->p_aio_activeq, entryp, aio_proc_link);
1391 procp->p_aio_active_count++;
1392 procp->p_aio_total_count++;
1401 aio_proc_unlock(procp);
1422 entryp->priority = (((2 * NZERO) - 1) - procp->p_nice);
1579 aio_get_process_count( entryp->procp ) >= aio_max_requests_per_process ||
1580 is_already_queued( entryp->procp, entryp->uaiocbp ) == TRUE ) {
1674 (int)entryp->procp, (int)entryp->uaiocbp, entryp->flags, 0, 0 );
1685 uthreadp->uu_aio_task = entryp->procp->task;
1711 (int)entryp->procp, (int)entryp->uaiocbp, entryp->errorval,
1722 aio_proc_lock(entryp->procp);
1723 aio_proc_move_done_locked(entryp->procp, entryp);
1724 aio_proc_unlock(entryp->procp);
1803 aio_proc_lock_spin(entryp->procp);
1807 (int)entryp->procp, (int)entryp->uaiocbp, 0, 0, 0 );
1809 aio_proc_unlock(entryp->procp);
1815 aio_proc_unlock(entryp->procp);
1844 if (entryp == TAILQ_FIRST(&entryp->procp->p_aio_activeq)) {
1852 aio_create_queue_entry(proc_t procp, user_addr_t aiocbp, void *group_tag, int kindOfIO)
1866 entryp->procp = procp;
1873 if ( proc_is64bit(procp) ) {
1894 entryp->aio_map = get_task_map( procp->task );
1917 aio_queue_async_request(proc_t procp, user_addr_t aiocbp, int kindOfIO )
1929 entryp = aio_create_queue_entry( procp, aiocbp, 0, kindOfIO);
1936 aio_proc_lock_spin(procp);
1938 if ( is_already_queued( entryp->procp, entryp->uaiocbp ) == TRUE ) {
1944 if (aio_get_process_count( procp ) >= aio_max_requests_per_process) {
1945 printf("aio_queue_async_request(): too many in flight for proc: %d.\n", procp->p_aio_total_count);
1951 lck_mtx_convert_spin(aio_proc_mutex(procp));
1952 aio_enqueue_work(procp, entryp, 1);
1954 aio_proc_unlock(procp);
1957 (int)procp, (int)aiocbp, 0, 0, 0 );
1966 aio_proc_unlock(procp);
1983 * Parameters: procp The process makign the request
2006 lio_create_entry(proc_t procp, user_addr_t aiocbp, void *group_tag,
2012 entryp = aio_create_queue_entry( procp, aiocbp, group_tag, AIO_LIO);
2138 proc_fdlock(entryp->procp);
2140 result = fp_lookup( entryp->procp, entryp->aiocb.aio_fildes, &fp , 1);
2152 fp_drop(entryp->procp, entryp->aiocb.aio_fildes, fp , 1);
2158 proc_fdunlock(entryp->procp);
2182 aio_get_process_count(proc_t procp )
2184 return procp->p_aio_total_count;
2211 aio_proc_lock_spin(entryp->procp);
2229 aio_proc_unlock(entryp->procp);
2250 (int)entryp->procp, (int)entryp->uaiocbp,
2253 psignal( entryp->procp, entryp->aiocb.aio_sigevent.sigev_signo );
2278 (int)entryp->procp, (int)entryp->uaiocbp, 0, 0, 0 );
2280 aio_proc_lock_spin(entryp->procp);
2281 active_requests = aio_active_requests_for_process( entryp->procp );
2287 wakeup_one((caddr_t)&entryp->procp->AIO_CLEANUP_SLEEP_CHAN);
2288 aio_proc_unlock(entryp->procp);
2291 (int)entryp->procp, (int)entryp->uaiocbp, 0, 0, 0 );
2293 aio_proc_unlock(entryp->procp);
2301 (int)entryp->procp, (int)entryp->uaiocbp, 0, 0, 0 );
2303 aio_proc_lock_spin(entryp->procp);
2304 active_requests = aio_proc_active_requests_for_file( entryp->procp, entryp->aiocb.aio_fildes);
2307 wakeup(&entryp->procp->AIO_CLEANUP_SLEEP_CHAN);
2308 aio_proc_unlock(entryp->procp);
2311 (int)entryp->procp, (int)entryp->uaiocbp, 0, 0, 0 );
2313 aio_proc_unlock(entryp->procp);
2323 wakeup( (caddr_t) &entryp->procp->AIO_SUSPEND_SLEEP_CHAN );
2325 (int)entryp->procp, (int)entryp->uaiocbp, 0, 0, 0 );
2348 if ( (error = fp_lookup(entryp->procp, entryp->aiocb.aio_fildes, &fp , 0)) )
2351 fp_drop(entryp->procp, entryp->aiocb.aio_fildes, fp, 0);
2359 context.vc_thread = proc_thread(entryp->procp); /* XXX */
2367 fp_drop(entryp->procp, entryp->aiocb.aio_fildes, fp, 0);
2384 if ( (error = fp_lookup(entryp->procp, entryp->aiocb.aio_fildes, &fp , 0)) )
2387 fp_drop(entryp->procp, entryp->aiocb.aio_fildes, fp, 0);
2400 context.vc_thread = proc_thread(entryp->procp); /* XXX */
2412 fp_drop(entryp->procp, entryp->aiocb.aio_fildes, fp, 0);
2424 aio_active_requests_for_process(proc_t procp )
2426 return( procp->p_aio_active_count );
2434 aio_proc_active_requests_for_file(proc_t procp, int fd)
2438 TAILQ_FOREACH(entryp, &procp->p_aio_activeq, aio_proc_link) {
2480 error = fp_getfvp( entryp->procp, entryp->aiocb.aio_fildes, &fp, &vp);
2483 fp_drop(entryp->procp, entryp->aiocb.aio_fildes, fp, 0);
2494 fp_drop(entryp->procp, entryp->aiocb.aio_fildes, fp, 0);
2512 is_already_queued(proc_t procp,
2521 TAILQ_FOREACH( entryp, &procp->p_aio_doneq, aio_proc_link ) {
2529 TAILQ_FOREACH( entryp, &procp->p_aio_activeq, aio_proc_link ) {