Lines Matching refs:nbytes

328 int lock_file_region(char *fname, int fd, int type, int start, int nbytes);
410 int alloc_mem(int nbytes);
413 int alloc_sds(int nbytes);
756 int rval, i, infd, nbytes; in doio() local
918 while ((nbytes = read(infd, (char *)&ioreq, sizeof(ioreq)))) { in doio()
935 if (nbytes == -1) { in doio()
943 if (nbytes != sizeof(ioreq)) { in doio()
946 sizeof(ioreq), nbytes); in doio()
1406 int fd, offset, nbytes, oflags, rval; in do_read() local
1425 nbytes = req->r_data.read.r_nbytes; in do_read()
1448 if (alloc_sds(nbytes) == -1) in do_read()
1454 alloc_mem(nbytes + wtob(1) * 2 + in do_read()
1474 if ((rval = alloc_mem(nbytes + wtob(1) * 2 + fdc->c_memalign)) < 0) { in do_read()
1493 if ((rval = alloc_mem(nbytes + wtob(1) * 2)) < 0) { in do_read()
1511 if ((rval = read(fd, addr, nbytes)) == -1) { in do_read()
1518 } else if (rval != nbytes) { in do_read()
1521 nbytes, rval, in do_read()
1548 if (reada(fd, addr, nbytes, &aiop->iosw, signo) == -1) { in do_read()
1567 if (aiop->iosw.sw_count != nbytes) { in do_read()
1570 1, 0, nbytes, in do_read()
1601 int fd, nbytes, oflags, signo; in do_write() local
1621 nbytes = req->r_data.write.r_nbytes; in do_write()
1653 if ((rval = alloc_mem(nbytes + wtob(1))) < 0) { in do_write()
1657 (*Data_Fill) (Memptr, nbytes, Pattern, Pattern_Length, 0); in do_write()
1660 if (alloc_sds(nbytes) == -1) in do_write()
1663 if (sswrite((long)Memptr, Sdsptr, btoc(nbytes)) == -1) { in do_write()
1666 (long)Memptr, Sdsptr, btoc(nbytes), SYSERR, in do_write()
1680 if ((rval = alloc_mem(nbytes + wtob(1)) < 0)) { in do_write()
1695 (*Data_Fill) (Memptr, nbytes, Pattern, Pattern_Length, 0); in do_write()
1697 memmove(addr, Memptr, nbytes); in do_write()
1704 if ((rval = alloc_mem(nbytes + wtob(1) * 2 + fdc->c_memalign)) < 0) { in do_write()
1722 (*Data_Fill) (Memptr, nbytes, Pattern, Pattern_Length, 0); in do_write()
1724 memmove(addr, Memptr, nbytes); in do_write()
1727 if ((rval = alloc_mem(nbytes + wtob(1) * 2)) < 0) { in do_write()
1733 (*Data_Fill) (Memptr, nbytes, Pattern, Pattern_Length, 0); in do_write()
1735 memmove(addr, Memptr, nbytes); in do_write()
1744 if (lock_file_region(file, fd, F_WRLCK, offset, nbytes) < 0) { in do_write()
1768 wrec.w_nbytes = nbytes; in do_write()
1801 rval = write(fd, addr, nbytes); in do_write()
1813 fd, addr, nbytes, in do_write()
1815 fdc->c_miniosz, nbytes % fdc->c_miniosz, in do_write()
1822 fd, addr, nbytes, in do_write()
1823 offset, nbytes % 4096, oflags); in do_write()
1826 } else if (rval != nbytes) { in do_write()
1829 nbytes, rval, in do_write()
1860 if (writea(fd, addr, nbytes, &aiop->iosw, signo) == -1) { in do_write()
1881 if (aiop->iosw.sw_count != nbytes) { in do_write()
1884 1, 0, nbytes, in do_write()
1910 msg = check_file(file, offset, nbytes, Pattern, Pattern_Length, in do_write()
1946 if (lock_file_region(file, fd, F_UNLCK, offset, nbytes) < 0) { in do_write()
1959 int lock_file_region(char *fname, int fd, int type, int start, int nbytes) in lock_file_region() argument
1966 flk.l_len = nbytes; in lock_file_region()
1972 start, nbytes, SYSERR, errno, in lock_file_region()
2339 int nbytes, nb; in do_ssdio() local
2342 nbytes = req->r_data.ssread.r_nbytes; in do_ssdio()
2348 if ((nb = alloc_mem(nbytes)) < 0) in do_ssdio()
2351 if (alloc_sds(nbytes) == -1) in do_ssdio()
2362 (*Data_Fill) (Memptr, nbytes, Pattern, Pattern_Length, 0); in do_ssdio()
2364 if (sswrite((long)Memptr, (long)Sdsptr, btoc(nbytes)) == -1) { in do_ssdio()
2376 if (ssread((long)Memptr, (long)Sdsptr, btoc(nbytes)) == -1) { in do_ssdio()
2391 ssread((long)Memptr, (long)Sdsptr, btoc(nbytes)); in do_ssdio()
2393 if (pattern_check(Memptr, nbytes, Pattern, Pattern_Length, 0) == in do_ssdio()
2533 int offset, nbytes, nstrides, nents, aio_strat; in sy_listio() local
2546 nbytes = req->r_data.io.r_nbytes; in sy_listio()
2575 i < nents; l++, a += nbytes, o += nbytes, i++) { in sy_listio()
2585 l->li_nbyte = nbytes; in sy_listio()
3058 int fd, offset, nbytes, nstrides, nents, oflags; in do_rw() local
3085 nbytes = req->r_data.io.r_nbytes; in do_rw()
3132 mem_needed = nbytes; in do_rw()
3166 if (alloc_sds(nbytes) == -1) in do_rw()
3171 (*Data_Fill) (Memptr, nbytes, Pattern, Pattern_Length, in do_rw()
3251 max_byte = offset + (nbytes * nstrides * nents); in do_rw()
3286 wrec.w_nbytes = nbytes; /* mem_needed -- total length */ in do_rw()
3359 } else if (iosw->sw_count != nbytes * nstrides) { in do_rw()
3363 1, 0, nbytes * nstrides, in do_rw()
3402 } else if (aiop->aio_ret != nbytes) { in do_rw()
3406 0, nbytes, in do_rw()
3427 sy->sy_name, nbytes, s->rval, in do_rw()
3444 msg = check_file(file, offset, nbytes * nstrides * nents, in do_rw()
3498 int fd, oflags, offset, nbytes; in do_fcntl() local
3513 nbytes = req->r_data.io.r_nbytes; in do_fcntl()
3518 flk.l_len = nbytes; in do_fcntl()
3535 max_byte = offset + nbytes; in do_fcntl()
3538 min_byte, (nbytes + 1)) < 0) { in do_fcntl()
3863 int alloc_mem(int nbytes) in alloc_mem() argument
3880 if (nbytes == -1) { in alloc_mem()
3946 if (nbytes > M->size) { in alloc_mem()
3959 if ((cp = malloc(nbytes)) == NULL) { in alloc_mem()
3962 nbytes, SYSERR, errno); in alloc_mem()
3967 if (mpin(cp, nbytes) == -1) { in alloc_mem()
3970 cp, nbytes, SYSERR, errno); in alloc_mem()
3975 M->size = nbytes; in alloc_mem()
3980 if (nbytes > M->size) { in alloc_mem()
4011 M->size = nbytes * 4; in alloc_mem()
4059 if (nbytes > M->size) { in alloc_mem()
4083 M->size = M->nblks ? M->nblks * 512 : nbytes; in alloc_mem()
4085 if (nbytes > M->size) { in alloc_mem()
4089 M->nblks, nbytes, M->size); in alloc_mem()
4136 int alloc_mem(int nbytes) in alloc_mem() argument
4148 if (nbytes > Memsize) { in alloc_mem()
4149 if ((cp = (char *)sbrk(nbytes - Memsize)) == (char *)-1) { in alloc_mem()
4151 nbytes - Memsize, SYSERR, errno); in alloc_mem()
4157 Memsize += nbytes - Memsize; in alloc_mem()
4162 if (nbytes == -1) { in alloc_mem()
4169 if (nbytes > Memsize) { in alloc_mem()
4173 if ((cp = malloc_space = malloc(nbytes)) == NULL) { in alloc_mem()
4175 nbytes, SYSERR, errno); in alloc_mem()
4184 nbytes, cp, ip, ip & 0x3f); in alloc_mem()
4187 if ((cp = malloc_space = malloc(nbytes + 0x40)) == NULL) { in alloc_mem()
4190 nbytes, SYSERR, errno); in alloc_mem()
4198 Memsize = nbytes; in alloc_mem()
4212 int alloc_sds(int nbytes) in alloc_sds() argument
4216 if (nbytes > Sdssize) { in alloc_sds()
4217 if ((nblks = ssbreak(btoc(nbytes - Sdssize))) == -1) { in alloc_sds()
4219 btoc(nbytes - Sdssize), SYSERR, errno); in alloc_sds()
4234 int alloc_sds(int nbytes) in alloc_sds() argument