Changeset b56d88f in mainline
- Timestamp:
- 2024-11-22T21:10:35Z (7 months ago)
- Children:
- f81960c5
- Parents:
- b8409b9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdwrite/bdwrite.c
rb8409b9 rb56d88f 108 108 109 109 uint64_t to_alloc = min(DATA_XFER_LIMIT, bsize * blkcnt); 110 uint8_t *buf = calloc(to_alloc / bsize, bsize);110 uint8_t *buf = malloc(to_alloc); 111 111 if (buf == NULL) { 112 112 rc = ENOMEM; … … 114 114 } 115 115 uint64_t left = blkcnt; 116 while (left >0) {116 while (left != 0) { 117 117 uint64_t blks_to_write = min(to_alloc / bsize, left); 118 118 uint8_t *ptr = buf; … … 120 120 /* memset(ptr, (i + 1) % 0x100, bsize); */ 121 121 memset(ptr, 'A' + (i % 26), bsize); 122 ptr = (uint8_t *)((uintptr_t) ptr + bsize);122 ptr += bsize; 123 123 } 124 124 rc = block_write_direct(dev, off, blks_to_write, buf); … … 128 128 } 129 129 left -= blks_to_write; 130 off += blks_to_write; 130 131 } 131 132 end:
Note:
See TracChangeset
for help on using the changeset viewer.