Lines Matching defs:bcache_ctl
60 static struct bcachectl *bcache_ctl;
83 free(bcache_ctl);
90 bcache_ctl = (struct bcachectl *)malloc(bcache_nblks * sizeof(struct bcachectl));
92 if ((bcache_data == NULL) || (bcache_ctl == NULL) || (bcache_miss == NULL)) {
95 if (bcache_ctl)
96 free(bcache_ctl);
118 bcache_ctl[i].bc_count = -1;
119 bcache_ctl[i].bc_blkno = -1;
271 ocount = bcache_ctl[0].bc_count;
275 if (bcache_ctl[i].bc_blkno == blkno) {
280 if (bcache_ctl[i].bc_count < ocount) {
281 ocount = bcache_ctl[i].bc_count;
288 bcache_ctl[cand].bc_blkno = blkno;
289 bcache_ctl[cand].bc_stamp = now;
290 bcache_ctl[cand].bc_count = bcache_bcount++;
308 if ((bcache_ctl[i].bc_blkno == blkno) && ((bcache_ctl[i].bc_stamp + BCACHE_TIMEOUT) >= now)) {
310 DEBUG("hit blk %d <- %d (now %d then %d)", blkno, i, now, bcache_ctl[i].bc_stamp);
325 if (bcache_ctl[i].bc_blkno == blkno) {
326 bcache_ctl[i].bc_count = -1;
327 bcache_ctl[i].bc_blkno = -1;
342 printf("%08jx %04x %04x|", (uintmax_t)bcache_ctl[i].bc_blkno, (unsigned int)bcache_ctl[i].bc_stamp & 0xffff, bcache_ctl[i].bc_count & 0xffff);