Lines Matching defs:rap
306 struct cl_readahead *rap;
310 if ((rap = ubc->cl_rahead) == NULL) {
311 MALLOC_ZONE(rap, struct cl_readahead *, sizeof *rap, M_CLRDAHEAD, M_WAITOK);
313 bzero(rap, sizeof *rap);
314 rap->cl_lastr = -1;
315 lck_mtx_init(&rap->cl_lockr, cl_mtx_grp, cl_mtx_attr);
320 ubc->cl_rahead = rap;
322 lck_mtx_destroy(&rap->cl_lockr, cl_mtx_grp);
323 FREE_ZONE((void *)rap, sizeof *rap, M_CLRDAHEAD);
324 rap = ubc->cl_rahead;
328 if (lck_mtx_try_lock(&rap->cl_lockr) == TRUE)
329 return(rap);
1507 cluster_read_ahead(vnode_t vp, struct cl_extent *extent, off_t filesize, struct cl_readahead *rap, int (*callback)(buf_t, void *), void *callback_arg,
1517 (int)extent->b_addr, (int)extent->e_addr, (int)rap->cl_lastr, 0, 0);
1519 if (extent->b_addr == rap->cl_lastr && extent->b_addr == extent->e_addr) {
1521 rap->cl_ralen, (int)rap->cl_maxra, (int)rap->cl_lastr, 0, 0);
1524 if (rap->cl_lastr == -1 || (extent->b_addr != rap->cl_lastr && extent->b_addr != (rap->cl_lastr + 1))) {
1525 rap->cl_ralen = 0;
1526 rap->cl_maxra = 0;
1529 rap->cl_ralen, (int)rap->cl_maxra, (int)rap->cl_lastr, 1, 0);
1535 if (extent->e_addr < rap->cl_maxra) {
1536 if ((rap->cl_maxra - extent->e_addr) > ((max_prefetch / PAGE_SIZE) / 4)) {
1539 rap->cl_ralen, (int)rap->cl_maxra, (int)rap->cl_lastr, 2, 0);
1543 r_addr = max(extent->e_addr, rap->cl_maxra) + 1;
1552 rap->cl_ralen, (int)rap->cl_maxra, (int)rap->cl_lastr, 3, 0);
1558 rap->cl_ralen = rap->cl_ralen ? min(max_prefetch / PAGE_SIZE, rap->cl_ralen << 1) : 1;
1562 if (read_size > rap->cl_ralen) {
1564 rap->cl_ralen = max_prefetch / PAGE_SIZE;
1566 rap->cl_ralen = read_size;
1568 size_of_prefetch = cluster_read_prefetch(vp, f_offset, rap->cl_ralen * PAGE_SIZE, filesize, callback, callback_arg, bflag);
1571 rap->cl_maxra = (r_addr + size_of_prefetch) - 1;
1574 rap->cl_ralen, (int)rap->cl_maxra, (int)rap->cl_lastr, 4, 0);
3150 struct cl_readahead * rap;
3184 rap = NULL;
3192 if ((rap = cluster_get_rap(vp)) == NULL)
3200 if (rap != NULL && rap->cl_ralen && (rap->cl_lastr == extent.b_addr || (rap->cl_lastr + 1) == extent.b_addr)) {
3208 last_ioread_offset = (rap->cl_maxra * PAGE_SIZE_64) + PAGE_SIZE_64;
3300 cluster_read_ahead(vp, &extent, filesize, rap, callback, callback_arg, bflag);
3306 if (rap != NULL) {
3307 if (extent.e_addr < rap->cl_lastr)
3308 rap->cl_maxra = 0;
3309 rap->cl_lastr = extent.e_addr;
3461 cluster_read_ahead(vp, &extent, filesize, rap, callback, callback_arg, bflag);
3463 if (rap != NULL) {
3464 if (extent.e_addr < rap->cl_lastr)
3465 rap->cl_maxra = 0;
3466 rap->cl_lastr = extent.e_addr;
3557 if (rap != NULL)
3567 if (rap != NULL) {
3569 (int)uio->uio_offset, io_req_size, rap->cl_lastr, retval, 0);
3571 lck_mtx_unlock(&rap->cl_lockr);
4497 struct cl_readahead *rap;
4509 rap = ubc->cl_rahead;
4515 if ((rap = ubc->cl_rahead)) {
4516 lck_mtx_destroy(&rap->cl_lockr, cl_mtx_grp);
4517 FREE_ZONE((void *)rap, sizeof *rap, M_CLRDAHEAD);
4522 KERNEL_DEBUG((FSDBG_CODE(DBG_FSRW, 81)) | DBG_FUNC_END, (int)ubc, (int)rap, (int)wbp, 0, 0);