buf                31 bio.c            struct buf buf[NBUF];
buf                35 bio.c            struct buf head;
buf                41 bio.c            struct buf *b;
buf                49 bio.c            for(b = bcache.buf; b < bcache.buf+NBUF; b++){
buf                61 bio.c          static struct buf*
buf                64 bio.c            struct buf *b;
buf                96 bio.c          struct buf*
buf                99 bio.c            struct buf *b;
buf               110 bio.c          bwrite(struct buf *b)
buf               121 bio.c          brelse(struct buf *b)
buf                 7 buf.h            struct buf *prev; // LRU cache list
buf                 8 buf.h            struct buf *next;
buf                 9 buf.h            struct buf *qnext; // disk queue
buf                 5 cat.c          char buf[512];
buf                12 cat.c            while((n = read(fd, buf, sizeof(buf))) > 0) {
buf                13 cat.c              if (write(1, buf, n) != n) {
buf                31 console.c        char buf[16];
buf                42 console.c          buf[i++] = digits[x % base];
buf                46 console.c          buf[i++] = '-';
buf                49 console.c          consputc(buf[i]);
buf               183 console.c        char buf[INPUT_BUF];
buf               205 console.c                  input.buf[(input.e-1) % INPUT_BUF] != '\n'){
buf               219 console.c              input.buf[input.e++ % INPUT_BUF] = c;
buf               253 console.c          c = input.buf[input.r++ % INPUT_BUF];
buf               274 console.c      consolewrite(struct inode *ip, char *buf, int n)
buf               281 console.c          consputc(buf[i] & 0xff);
buf                 1 defs.h         struct buf;
buf                15 defs.h         struct buf*     bread(uint, uint);
buf                16 defs.h         void            brelse(struct buf*);
buf                17 defs.h         void            bwrite(struct buf*);
buf                59 defs.h         void            iderw(struct buf*);
buf                86 defs.h         void            log_write(struct buf*);
buf                34 fs.c             struct buf *bp;
buf                45 fs.c             struct buf *bp;
buf                60 fs.c             struct buf *bp;
buf                84 fs.c             struct buf *bp;
buf               198 fs.c             struct buf *bp;
buf               223 fs.c             struct buf *bp;
buf               290 fs.c             struct buf *bp;
buf               376 fs.c             struct buf *bp;
buf               411 fs.c             struct buf *bp;
buf               456 fs.c             struct buf *bp;
buf               485 fs.c             struct buf *bp;
buf                 7 grep.c         char buf[1024];
buf                17 grep.c           while((n = read(fd, buf+m, sizeof(buf)-m-1)) > 0){
buf                19 grep.c             buf[m] = '\0';
buf                20 grep.c             p = buf;
buf                29 grep.c             if(p == buf)
buf                32 grep.c               m -= p - buf;
buf                33 grep.c               memmove(buf, p, m);
buf                32 ide.c          static struct buf *idequeue;
buf                35 ide.c          static void idestart(struct buf*);
buf                74 ide.c          idestart(struct buf *b)
buf               106 ide.c            struct buf *b;
buf               138 ide.c          iderw(struct buf *b)
buf               140 ide.c            struct buf **pp;
buf                75 log.c              struct buf *lbuf = bread(log.dev, log.start+tail+1); // read log block
buf                76 log.c              struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst
buf                88 log.c            struct buf *buf = bread(log.dev, log.start);
buf                89 log.c            struct logheader *lh = (struct logheader *) (buf->data);
buf                95 log.c            brelse(buf);
buf               104 log.c            struct buf *buf = bread(log.dev, log.start);
buf               105 log.c            struct logheader *hb = (struct logheader *) (buf->data);
buf               111 log.c            bwrite(buf);
buf               112 log.c            brelse(buf);
buf               183 log.c              struct buf *to = bread(log.dev, log.start+tail+1); // log block
buf               184 log.c              struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block
buf               214 log.c          log_write(struct buf *b)
buf                 9 ls.c             static char buf[DIRSIZ+1];
buf                20 ls.c             memmove(buf, p, strlen(p));
buf                21 ls.c             memset(buf+strlen(p), ' ', DIRSIZ-strlen(p));
buf                22 ls.c             return buf;
buf                28 ls.c             char buf[512], *p;
buf                50 ls.c               if(strlen(path) + 1 + DIRSIZ + 1 > sizeof buf){
buf                54 ls.c               strcpy(buf, path);
buf                55 ls.c               p = buf+strlen(buf);
buf                62 ls.c                 if(stat(buf, &st) < 0){
buf                63 ls.c                   printf(1, "ls: cannot stat %s\n", buf);
buf                66 ls.c                 printf(1, "%s %d %d %d\n", fmtname(buf), st.type, st.ino, st.size);
buf                39 memide.c       iderw(struct buf *b)
buf                40 mkfs.c         void rsect(uint sec, void *buf);
buf                73 mkfs.c           char buf[BSIZE];
buf               113 mkfs.c           memset(buf, 0, sizeof(buf));
buf               114 mkfs.c           memmove(buf, &sb, sizeof(sb));
buf               115 mkfs.c           wsect(1, buf);
buf               152 mkfs.c             while((cc = read(fd, buf, sizeof(buf))) > 0)
buf               153 mkfs.c               iappend(inum, buf, cc);
buf               171 mkfs.c         wsect(uint sec, void *buf)
buf               177 mkfs.c           if(write(fsfd, buf, BSIZE) != BSIZE){
buf               186 mkfs.c           char buf[BSIZE];
buf               191 mkfs.c           rsect(bn, buf);
buf               192 mkfs.c           dip = ((struct dinode*)buf) + (inum % IPB);
buf               194 mkfs.c           wsect(bn, buf);
buf               200 mkfs.c           char buf[BSIZE];
buf               205 mkfs.c           rsect(bn, buf);
buf               206 mkfs.c           dip = ((struct dinode*)buf) + (inum % IPB);
buf               211 mkfs.c         rsect(uint sec, void *buf)
buf               217 mkfs.c           if(read(fsfd, buf, BSIZE) != BSIZE){
buf               240 mkfs.c           uchar buf[BSIZE];
buf               245 mkfs.c           bzero(buf, BSIZE);
buf               247 mkfs.c             buf[i/8] = buf[i/8] | (0x1 << (i%8));
buf               250 mkfs.c           wsect(sb.bmapstart, buf);
buf               261 mkfs.c           char buf[BSIZE];
buf               288 mkfs.c             rsect(x, buf);
buf               289 mkfs.c             bcopy(p, buf + off - (fbn * BSIZE), n1);
buf               290 mkfs.c             wsect(x, buf);
buf                15 printf.c         char buf[16];
buf                29 printf.c           buf[i++] = digits[x % base];
buf                32 printf.c           buf[i++] = '-';
buf                35 printf.c           putc(fd, buf[i]);
buf               134 sh.c           getcmd(char *buf, int nbuf)
buf               137 sh.c             memset(buf, 0, nbuf);
buf               138 sh.c             gets(buf, nbuf);
buf               139 sh.c             if(buf[0] == 0) // EOF
buf               147 sh.c             static char buf[100];
buf               159 sh.c             while(getcmd(buf, sizeof(buf)) >= 0){
buf               160 sh.c               if(buf[0] == 'c' && buf[1] == 'd' && buf[2] == ' '){
buf               162 sh.c                 buf[strlen(buf)-1] = 0;  // chop \n
buf               163 sh.c                 if(chdir(buf+3) < 0)
buf               164 sh.c                   printf(2, "cannot cd %s\n", buf+3);
buf               168 sh.c                 runcmd(parsecmd(buf));
buf                53 ulib.c         gets(char *buf, int max)
buf                62 ulib.c             buf[i++] = c;
buf                66 ulib.c           buf[i] = '\0';
buf                67 ulib.c           return buf;
buf                11 usertests.c    char buf[8192];
buf               171 usertests.c      i = read(fd, buf, 2000);
buf               201 usertests.c        ((int*)buf)[0] = i;
buf               202 usertests.c        if(write(fd, buf, 512) != 512){
buf               218 usertests.c        i = read(fd, buf, 512);
buf               229 usertests.c        if(((int*)buf)[0] != n){
buf               231 usertests.c                 n, ((int*)buf)[0]);
buf               321 usertests.c            buf[i] = seq++;
buf               322 usertests.c          if(write(fds[1], buf, 1033) != 1033){
buf               332 usertests.c        while((n = read(fds[0], buf, cc)) > 0){
buf               334 usertests.c            if((buf[i] & 0xff) != (seq++ & 0xff)){
buf               341 usertests.c          if(cc > sizeof(buf))
buf               342 usertests.c            cc = sizeof(buf);
buf               387 usertests.c      if(read(pfds[0], buf, sizeof(buf)) != 1){
buf               468 usertests.c      char buf[10];
buf               479 usertests.c      memset(buf, pid==0?'c':'p', sizeof(buf));
buf               481 usertests.c        if(write(fd, buf, sizeof(buf)) != sizeof(buf)){
buf               497 usertests.c      while((n = read(fd, buf, sizeof(buf))) > 0){
buf               498 usertests.c        for(i = 0; i < sizeof(buf); i++){
buf               499 usertests.c          if(buf[i] == 'c')
buf               501 usertests.c          if(buf[i] == 'p')
buf               543 usertests.c          memset(buf, '0'+pi, 512);
buf               545 usertests.c            if((n = write(fd, buf, 500)) != 500){
buf               562 usertests.c        while((n = read(fd, buf, sizeof(buf))) > 0){
buf               564 usertests.c            if(buf[j] != '0'+i){
buf               684 usertests.c      if(read(fd, buf, sizeof(buf)) != 5){
buf               688 usertests.c      if(buf[0] != 'h'){
buf               692 usertests.c      if(write(fd, buf, 10) != 10){
buf               738 usertests.c      if(read(fd, buf, sizeof(buf)) != 5){
buf               978 usertests.c      cc = read(fd, buf, sizeof(buf));
buf               979 usertests.c      if(cc != 2 || buf[0] != 'f'){
buf              1021 usertests.c      if(read(fd, buf, sizeof(buf)) != 2){
buf              1134 usertests.c          int cc = write(fd, buf, sz);
buf              1161 usertests.c        memset(buf, i, 600);
buf              1162 usertests.c        if(write(fd, buf, 600) != 600){
buf              1176 usertests.c        cc = read(fd, buf, 300);
buf              1187 usertests.c        if(buf[0] != i/2 || buf[299] != i/2){
buf              1671 usertests.c          int cc = write(fd, buf, 512);
buf               368 vm.c             char *buf, *pa0;
buf               371 vm.c             buf = (char*)p;
buf               380 vm.c               memmove(pa0 + (va - va0), buf, n);
buf               382 vm.c               buf += n;
buf                 5 wc.c           char buf[512];
buf                15 wc.c             while((n = read(fd, buf, sizeof(buf))) > 0){
buf                18 wc.c                 if(buf[i] == '\n')
buf                20 wc.c                 if(strchr(" \r\t\n\v", buf[i]))