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 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 252 mkfs/mkfs.c #define min(a, b) ((a) < (b) ? (a) : (b)) b 142 user/usertests.c char b[MAXPATH+1]; b 145 user/usertests.c b[i] = 'x'; b 146 user/usertests.c b[MAXPATH] = '\0'; b 148 user/usertests.c int ret = unlink(b); b 150 user/usertests.c printf("unlink(%s) returned %d, not -1\n", b, ret); b 154 user/usertests.c int fd = open(b, O_CREATE | O_WRONLY); b 156 user/usertests.c printf("open(%s) returned %d, not -1\n", b, fd); b 160 user/usertests.c ret = link(b, b); b 162 user/usertests.c printf("link(%s, %s) returned %d, not -1\n", b, b, ret); b 167 user/usertests.c ret = exec(b, args); b 169 user/usertests.c printf("exec(%s) returned %d, not -1\n", b, fd); b 215 user/usertests.c char *b = (char *) (top - 1); b 216 user/usertests.c *b = 'x'; b 218 user/usertests.c int ret = unlink(b); b 220 user/usertests.c printf("unlink(%s) returned %d, not -1\n", b, ret); b 224 user/usertests.c int fd = open(b, O_CREATE | O_WRONLY); b 226 user/usertests.c printf("open(%s) returned %d, not -1\n", b, fd); b 230 user/usertests.c ret = link(b, b); b 232 user/usertests.c printf("link(%s, %s) returned %d, not -1\n", b, b, ret); b 237 user/usertests.c ret = exec(b, args); b 239 user/usertests.c printf("exec(%s) returned %d, not -1\n", b, fd); b 2004 user/usertests.c char *c, *a, *b; b 2019 user/usertests.c for(b = a; b < a+TOOMUCH; b += 4096){ b 2020 user/usertests.c *b = 99; b 2038 user/usertests.c b = sbrk(1); b 2039 user/usertests.c if(b != a){ b 2040 user/usertests.c printf("%s: sbrk test failed %d %p %p\n", s, i, a, b); b 2043 user/usertests.c *b = 1; b 2044 user/usertests.c a = b + 1;