code:notavil - ikarishinjieva/unixV6-code-analyze-chs GitHub Wiki
- 将给定的struct buf缓存管理结构 从自由队列取下,置状态为B_BUSY
- 共传入一个参数 bp
- bp : 给定的struct buf缓存管理结构
4995
4996 /* Unlink a buffer from the available list and mark it busy.
4997 * (internal interface)
4998 */
4999 notavil(bp)
5000 struct buf *bp;
5001 {
5002 register struct buf *rbp;
5003 register int sps;
5004
5005 rbp = bp;
5006 sps = PS->integ;
5007 spl6();
- 将PS备份到sps
5008 rbp->av_back->av_forw = rbp->av_forw;
- 处理机优级设为6
5009 rbp->av_forw->av_back = rbp->av_back;
5010 rbp->b_flags =| B_BUSY;
5011 PS->integ = sps;
- 将给定的 缓存管理结构 从自由队列取下
- 置该块状态为B_BUSY
5012 }
5013 /* ------------------------- */