Lines Matching defs:bcache_ctl
61 static struct bcachectl *bcache_ctl;
84 free(bcache_ctl);
91 bcache_ctl = (struct bcachectl *)alloc(bcache_nblks * sizeof(struct bcachectl));
93 if ((bcache_data == NULL) || (bcache_ctl == NULL) || (bcache_miss == NULL)) {
96 if (bcache_ctl)
97 free(bcache_ctl);
119 bcache_ctl[i].bc_count = -1;
120 bcache_ctl[i].bc_blkno = -1;
272 ocount = bcache_ctl[0].bc_count;
276 if (bcache_ctl[i].bc_blkno == blkno) {
281 if (bcache_ctl[i].bc_count < ocount) {
282 ocount = bcache_ctl[i].bc_count;
289 bcache_ctl[cand].bc_blkno = blkno;
290 bcache_ctl[cand].bc_stamp = now;
291 bcache_ctl[cand].bc_count = bcache_bcount++;
309 if ((bcache_ctl[i].bc_blkno == blkno) && ((bcache_ctl[i].bc_stamp + BCACHE_TIMEOUT) >= now)) {
311 DEBUG("hit blk %d <- %d (now %d then %d)", blkno, i, now, bcache_ctl[i].bc_stamp);
326 if (bcache_ctl[i].bc_blkno == blkno) {
327 bcache_ctl[i].bc_count = -1;
328 bcache_ctl[i].bc_blkno = -1;
341 printf("%lx %x %x|", (uintmax_t)bcache_ctl[i].bc_blkno, (unsigned int)bcache_ctl[i].bc_stamp & 0xffff, bcache_ctl[i].bc_count & 0xffff);