b                  39 kernel/bio.c     struct buf *b;
b                  46 kernel/bio.c     for(b = bcache.buf; b < bcache.buf+NBUF; b++){
b                  47 kernel/bio.c       b->next = bcache.head.next;
b                  48 kernel/bio.c       b->prev = &bcache.head;
b                  49 kernel/bio.c       initsleeplock(&b->lock, "buffer");
b                  50 kernel/bio.c       bcache.head.next->prev = b;
b                  51 kernel/bio.c       bcache.head.next = b;
b                  61 kernel/bio.c     struct buf *b;
b                  66 kernel/bio.c     for(b = bcache.head.next; b != &bcache.head; b = b->next){
b                  67 kernel/bio.c       if(b->dev == dev && b->blockno == blockno){
b                  68 kernel/bio.c         b->refcnt++;
b                  70 kernel/bio.c         acquiresleep(&b->lock);
b                  71 kernel/bio.c         return b;
b                  77 kernel/bio.c     for(b = bcache.head.prev; b != &bcache.head; b = b->prev){
b                  78 kernel/bio.c       if(b->refcnt == 0) {
b                  79 kernel/bio.c         b->dev = dev;
b                  80 kernel/bio.c         b->blockno = blockno;
b                  81 kernel/bio.c         b->valid = 0;
b                  82 kernel/bio.c         b->refcnt = 1;
b                  84 kernel/bio.c         acquiresleep(&b->lock);
b                  85 kernel/bio.c         return b;
b                  95 kernel/bio.c     struct buf *b;
b                  97 kernel/bio.c     b = bget(dev, blockno);
b                  98 kernel/bio.c     if(!b->valid) {
b                  99 kernel/bio.c       virtio_disk_rw(b, 0);
b                 100 kernel/bio.c       b->valid = 1;
b                 102 kernel/bio.c     return b;
b                 107 kernel/bio.c   bwrite(struct buf *b)
b                 109 kernel/bio.c     if(!holdingsleep(&b->lock))
b                 111 kernel/bio.c     virtio_disk_rw(b, 1);
b                 117 kernel/bio.c   brelse(struct buf *b)
b                 119 kernel/bio.c     if(!holdingsleep(&b->lock))
b                 122 kernel/bio.c     releasesleep(&b->lock);
b                 125 kernel/bio.c     b->refcnt--;
b                 126 kernel/bio.c     if (b->refcnt == 0) {
b                 128 kernel/bio.c       b->next->prev = b->prev;
b                 129 kernel/bio.c       b->prev->next = b->next;
b                 130 kernel/bio.c       b->next = bcache.head.next;
b                 131 kernel/bio.c       b->prev = &bcache.head;
b                 132 kernel/bio.c       bcache.head.next->prev = b;
b                 133 kernel/bio.c       bcache.head.next = b;
b                 140 kernel/bio.c   bpin(struct buf *b) {
b                 142 kernel/bio.c     b->refcnt++;
b                 147 kernel/bio.c   bunpin(struct buf *b) {
b                 149 kernel/bio.c     b->refcnt--;
b                  24 kernel/fs.c    #define min(a, b) ((a) < (b) ? (a) : (b))
b                  68 kernel/fs.c      int b, bi, m;
b                  72 kernel/fs.c      for(b = 0; b < sb.size; b += BPB){
b                  73 kernel/fs.c        bp = bread(dev, BBLOCK(b, sb));
b                  74 kernel/fs.c        for(bi = 0; bi < BPB && b + bi < sb.size; bi++){
b                  80 kernel/fs.c            bzero(dev, b + bi);
b                  81 kernel/fs.c            return b + bi;
b                  92 kernel/fs.c    bfree(int dev, uint b)
b                  97 kernel/fs.c      bp = bread(dev, BBLOCK(b, sb));
b                  98 kernel/fs.c      bi = b % BPB;
b                  51 kernel/fs.h    #define BBLOCK(b, sb) ((b)/BPB + sb.bmapstart)
b                 215 kernel/log.c   log_write(struct buf *b)
b                 226 kernel/log.c       if (log.lh.block[i] == b->blockno)   // log absorption
b                 229 kernel/log.c     log.lh.block[i] = b->blockno;
b                 231 kernel/log.c       bpin(b);
b                  23 kernel/ramdisk.c ramdiskrw(struct buf *b)
b                  25 kernel/ramdisk.c   if(!holdingsleep(&b->lock))
b                  27 kernel/ramdisk.c   if((b->flags & (B_VALID|B_DIRTY)) == B_VALID)
b                  30 kernel/ramdisk.c   if(b->blockno >= FSSIZE)
b                  33 kernel/ramdisk.c   uint64 diskaddr = b->blockno * BSIZE;
b                  36 kernel/ramdisk.c   if(b->flags & B_DIRTY){
b                  38 kernel/ramdisk.c     memmove(addr, b->data, BSIZE);
b                  39 kernel/ramdisk.c     b->flags &= ~B_DIRTY;
b                  42 kernel/ramdisk.c     memmove(b->data, addr, BSIZE);
b                  43 kernel/ramdisk.c     b->flags |= B_VALID;
b                  49 kernel/virtio_disk.c     struct buf *b;
b                 216 kernel/virtio_disk.c virtio_disk_rw(struct buf *b, int write)
b                 218 kernel/virtio_disk.c   uint64 sector = b->blockno * (BSIZE / 512);
b                 252 kernel/virtio_disk.c   disk.desc[idx[1]].addr = (uint64) b->data;
b                 268 kernel/virtio_disk.c   b->disk = 1;
b                 269 kernel/virtio_disk.c   disk.info[idx[0]].b = b;
b                 284 kernel/virtio_disk.c   while(b->disk == 1) {
b                 285 kernel/virtio_disk.c     sleep(b, &disk.vdisk_lock);
b                 288 kernel/virtio_disk.c   disk.info[idx[0]].b = 0;
b                 319 kernel/virtio_disk.c     struct buf *b = disk.info[id].b;
b                 320 kernel/virtio_disk.c     b->disk = 0;   // disk is done with buf
b                 321 kernel/virtio_disk.c     wakeup(b);
b                  15 mkfs/mkfs.c    #define static_assert(a, b) do { switch (0) case 0: case (a): ; } while (0)
b                 250 mkfs/mkfs.c    #define min(a, b) ((a) < (b) ? (a) : (b))
b                 139 user/usertests.c   char b[MAXPATH+1];
b                 142 user/usertests.c     b[i] = 'x';
b                 143 user/usertests.c   b[MAXPATH] = '\0';
b                 145 user/usertests.c   int ret = unlink(b);
b                 147 user/usertests.c     printf("unlink(%s) returned %d, not -1\n", b, ret);
b                 151 user/usertests.c   int fd = open(b, O_CREATE | O_WRONLY);
b                 153 user/usertests.c     printf("open(%s) returned %d, not -1\n", b, fd);
b                 157 user/usertests.c   ret = link(b, b);
b                 159 user/usertests.c     printf("link(%s, %s) returned %d, not -1\n", b, b, ret);
b                 164 user/usertests.c   ret = exec(b, args);
b                 166 user/usertests.c     printf("exec(%s) returned %d, not -1\n", b, fd);
b                 212 user/usertests.c   char *b = (char *) (top - 1);
b                 213 user/usertests.c   *b = 'x';
b                 215 user/usertests.c   int ret = unlink(b);
b                 217 user/usertests.c     printf("unlink(%s) returned %d, not -1\n", b, ret);
b                 221 user/usertests.c   int fd = open(b, O_CREATE | O_WRONLY);
b                 223 user/usertests.c     printf("open(%s) returned %d, not -1\n", b, fd);
b                 227 user/usertests.c   ret = link(b, b);
b                 229 user/usertests.c     printf("link(%s, %s) returned %d, not -1\n", b, b, ret);
b                 234 user/usertests.c   ret = exec(b, args);
b                 236 user/usertests.c     printf("exec(%s) returned %d, not -1\n", b, fd);
b                2001 user/usertests.c   char *c, *a, *b;
b                2016 user/usertests.c     for(b = a; b < a+TOOMUCH; b += 4096){
b                2017 user/usertests.c       *b = 99;
b                2035 user/usertests.c     b = sbrk(1);
b                2036 user/usertests.c     if(b != a){
b                2037 user/usertests.c       printf("%s: sbrk test failed %d %x %x\n", s, i, a, b);
b                2040 user/usertests.c     *b = 1;
b                2041 user/usertests.c     a = b + 1;