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;
918 while ((nbytes = read(infd, (char *)&ioreq, sizeof(ioreq)))) {
935 if (nbytes == -1) {
943 if (nbytes != sizeof(ioreq)) {
946 sizeof(ioreq), nbytes);
1406 int fd, offset, nbytes, oflags, rval;
1425 nbytes = req->r_data.read.r_nbytes;
1427 /*printf("read: %s, %#o, %d %d\n", file, oflags, offset, nbytes); */
1448 if (alloc_sds(nbytes) == -1)
1454 alloc_mem(nbytes + wtob(1) * 2 +
1474 if ((rval = alloc_mem(nbytes + wtob(1) * 2 + fdc->c_memalign)) < 0) {
1493 if ((rval = alloc_mem(nbytes + wtob(1) * 2)) < 0) {
1511 if ((rval = read(fd, addr, nbytes)) == -1) {
1518 } else if (rval != nbytes) {
1521 nbytes, rval,
1548 if (reada(fd, addr, nbytes, &aiop->iosw, signo) == -1) {
1567 if (aiop->iosw.sw_count != nbytes) {
1570 1, 0, nbytes,
1601 int fd, nbytes, oflags, signo;
1621 nbytes = req->r_data.write.r_nbytes;
1627 /*printf("pwrite: %s, %#o, %d %d\n", file, oflags, offset, nbytes); */
1644 fd, file, oflags, offset, nbytes); */
1653 if ((rval = alloc_mem(nbytes + wtob(1))) < 0) {
1657 (*Data_Fill) (Memptr, nbytes, Pattern, Pattern_Length, 0);
1658 /*pattern_fill(Memptr, nbytes, Pattern, Pattern_Length, 0); */
1660 if (alloc_sds(nbytes) == -1)
1663 if (sswrite((long)Memptr, Sdsptr, btoc(nbytes)) == -1) {
1666 (long)Memptr, Sdsptr, btoc(nbytes), SYSERR,
1680 if ((rval = alloc_mem(nbytes + wtob(1)) < 0)) {
1695 (*Data_Fill) (Memptr, nbytes, Pattern, Pattern_Length, 0);
1697 memmove(addr, Memptr, nbytes);
1704 if ((rval = alloc_mem(nbytes + wtob(1) * 2 + fdc->c_memalign)) < 0) {
1722 (*Data_Fill) (Memptr, nbytes, Pattern, Pattern_Length, 0);
1724 memmove(addr, Memptr, nbytes);
1727 if ((rval = alloc_mem(nbytes + wtob(1) * 2)) < 0) {
1733 (*Data_Fill) (Memptr, nbytes, Pattern, Pattern_Length, 0);
1735 memmove(addr, Memptr, nbytes);
1744 if (lock_file_region(file, fd, F_WRLCK, offset, nbytes) < 0) {
1768 wrec.w_nbytes = nbytes;
1801 rval = write(fd, addr, nbytes);
1811 "write() failed: %s\n\twrite(%d, %#o, %d)\n\toffset %d, nbytes%%miniou(%d)=%d, oflags=%#o memalign=%d, addr%%memalign=%d\n",
1813 fd, addr, nbytes,
1815 fdc->c_miniosz, nbytes % fdc->c_miniosz,
1820 "write() failed: %s\n\twrite(%d, %#o, %d)\n\toffset %d, nbytes%%1B=%d, oflags=%#o\n",
1822 fd, addr, nbytes,
1823 offset, nbytes % 4096, oflags);
1826 } else if (rval != nbytes) {
1829 nbytes, rval,
1860 if (writea(fd, addr, nbytes, &aiop->iosw, signo) == -1) {
1881 if (aiop->iosw.sw_count != nbytes) {
1884 1, 0, nbytes,
1910 msg = check_file(file, offset, nbytes, Pattern, Pattern_Length,
1946 if (lock_file_region(file, fd, F_UNLCK, offset, nbytes) < 0) {
1959 int lock_file_region(char *fname, int fd, int type, int start, int nbytes)
1966 flk.l_len = nbytes;
1972 start, nbytes, SYSERR, errno,
2106 "do_listio(): Bogus listio request - abs(filestride) [%d] < nbytes [%d]\n",
2339 int nbytes, nb;
2342 nbytes = req->r_data.ssread.r_nbytes;
2348 if ((nb = alloc_mem(nbytes)) < 0)
2351 if (alloc_sds(nbytes) == -1)
2361 /*pattern_fill(Memptr, nbytes, Pattern, Pattern_Length, 0); */
2362 (*Data_Fill) (Memptr, nbytes, Pattern, Pattern_Length, 0);
2364 if (sswrite((long)Memptr, (long)Sdsptr, btoc(nbytes)) == -1) {
2376 if (ssread((long)Memptr, (long)Sdsptr, btoc(nbytes)) == -1) {
2391 ssread((long)Memptr, (long)Sdsptr, btoc(nbytes));
2393 if (pattern_check(Memptr, nbytes, Pattern, Pattern_Length, 0) ==
2533 int offset, nbytes, nstrides, nents, aio_strat;
2546 nbytes = req->r_data.io.r_nbytes;
2575 i < nents; l++, a += nbytes, o += nbytes, i++) {
2585 l->li_nbyte = nbytes;
3058 int fd, offset, nbytes, nstrides, nents, oflags;
3085 nbytes = req->r_data.io.r_nbytes;
3132 mem_needed = nbytes;
3166 if (alloc_sds(nbytes) == -1)
3171 (*Data_Fill) (Memptr, nbytes, Pattern, Pattern_Length,
3251 max_byte = offset + (nbytes * nstrides * nents);
3286 wrec.w_nbytes = nbytes; /* mem_needed -- total length */
3359 } else if (iosw->sw_count != nbytes * nstrides) {
3363 1, 0, nbytes * nstrides,
3402 } else if (aiop->aio_ret != nbytes) {
3406 0, nbytes,
3427 sy->sy_name, nbytes, s->rval,
3444 msg = check_file(file, offset, nbytes * nstrides * nents,
3498 int fd, oflags, offset, nbytes;
3513 nbytes = req->r_data.io.r_nbytes;
3518 flk.l_len = nbytes;
3535 max_byte = offset + nbytes;
3538 min_byte, (nbytes + 1)) < 0) {
3863 int alloc_mem(int nbytes)
3879 /* nbytes = -1 means "free all allocated memory" */
3880 if (nbytes == -1) {
3946 if (nbytes > M->size) {
3959 if ((cp = malloc(nbytes)) == NULL) {
3962 nbytes, SYSERR, errno);
3967 if (mpin(cp, nbytes) == -1) {
3970 cp, nbytes, SYSERR, errno);
3975 M->size = nbytes;
3980 if (nbytes > M->size) {
4011 M->size = nbytes * 4;
4059 if (nbytes > M->size) {
4083 M->size = M->nblks ? M->nblks * 512 : nbytes;
4085 if (nbytes > M->size) {
4088 "MEM_SHMEM: nblks(%d) too small: nbytes=%d Msize=%d, skipping this req.\n",
4089 M->nblks, nbytes, M->size);
4136 int alloc_mem(int nbytes)
4148 if (nbytes > Memsize) {
4149 if ((cp = (char *)sbrk(nbytes - Memsize)) == (char *)-1) {
4151 nbytes - Memsize, SYSERR, errno);
4157 Memsize += nbytes - Memsize;
4161 /* nbytes = -1 means "free all allocated memory" */
4162 if (nbytes == -1) {
4169 if (nbytes > Memsize) {
4173 if ((cp = malloc_space = malloc(nbytes)) == NULL) {
4175 nbytes, SYSERR, errno);
4184 nbytes, cp, ip, ip & 0x3f);
4187 if ((cp = malloc_space = malloc(nbytes + 0x40)) == NULL) {
4190 nbytes, SYSERR, errno);
4198 Memsize = nbytes;
4212 int alloc_sds(int nbytes)
4216 if (nbytes > Sdssize) {
4217 if ((nblks = ssbreak(btoc(nbytes - Sdssize))) == -1) {
4219 btoc(nbytes - Sdssize), SYSERR, errno);
4234 int alloc_sds(int nbytes)