2021-10-22から1日間の記事一覧

bio.c void brelse(struct buf *b)

トップページ jupiteroak.hatenablog.com bio.c https://github.com/mit-pdos/xv6-public/blob/master/bio.c#L120 void brelse(struct buf *b) { if(!holdingsleep(&b->lock)) panic("brelse"); releasesleep(&b->lock); acquire(&bcache.lock); b->refcnt--…

bio.c void bwrite(struct buf *b)

トップページ jupiteroak.hatenablog.com bio.c https://github.com/mit-pdos/xv6-public/blob/master/bio.c#L109 void bwrite(struct buf *b) { if(!holdingsleep(&b->lock)) panic("bwrite"); b->flags |= B_DIRTY; iderw(b); }bwrite関数は、バッファbに…

bio.c static struct buf* bget(uint dev, uint blockno)

トップページ jupiteroak.hatenablog.com bio.c https://github.com/mit-pdos/xv6-public/blob/master/bio.c#L61 static struct buf* bget(uint dev, uint blockno) { struct buf *b; acquire(&bcache.lock); // Is the block already cached? for(b = bcach…

bio.c struct buf* bread(uint dev, uint blockno)

トップページ jupiteroak.hatenablog.com bio.c https://github.com/mit-pdos/xv6-public/blob/master/bio.c#L96 struct buf* bread(uint dev, uint blockno) { struct buf *b; b = bget(dev, blockno); if((b->flags & B_VALID) == 0) { iderw(b); } return…