/netbsd-src/usr.bin/vndcompress/ |
H A D | offtab.c | 117 offtab_read_window(struct offtab *offtab, uint32_t blkno, int read_flags) in offtab_read_window() argument 119 const uint32_t window_start = rounddown(blkno, offtab->ot_window_size); in offtab_read_window() 153 offtab_maybe_read_window(struct offtab *offtab, uint32_t blkno, int read_flags) in offtab_maybe_read_window() argument 157 if ((offtab->ot_window_start <= blkno) && in offtab_maybe_read_window() 158 (blkno < offtab_current_window_end(offtab))) in offtab_maybe_read_window() 161 if (!offtab_read_window(offtab, blkno, read_flags)) in offtab_maybe_read_window() 251 offtab_transmogrify_read_to_write(struct offtab *offtab, uint32_t blkno) in offtab_transmogrify_read_to_write() argument 255 assert(0 < blkno); in offtab_transmogrify_read_to_write() 257 if (!offtab_maybe_read_window(offtab, blkno, OFFTAB_READ_SEEK)) in offtab_transmogrify_read_to_write() 261 offtab->ot_blkno = blkno; in offtab_transmogrify_read_to_write() [all …]
|
H A D | vndcompress.c | 69 uint32_t blkno; /* input block number */ member 161 while (S->blkno < S->n_blocks) { in vndcompress() 166 if ((0 < S->end_block) && (S->end_block <= S->blkno)) in vndcompress() 171 offtab_prepare_put(&S->offtab, (S->blkno + 1)); in vndcompress() 174 const uint32_t readsize = (S->blkno == S->n_full_blocks? in vndcompress() 187 S->blkno, (uintmax_t)S->offset, in vndcompress() 192 compress_block(S->image_fd, S->cloop2_fd, S->blkno, in vndcompress() 201 assert(ADD_OK(uint32_t, S->blkno, 1)); in vndcompress() 204 assert((S->blkno + 1) < S->n_offsets); in vndcompress() 208 S->blkno += 1; /* (a) */ in vndcompress() [all …]
|
H A D | vnduncompress.c | 163 uint32_t blkno; in vnduncompress() local 166 for (blkno = 0; blkno < n_blocks; blkno++) { in vnduncompress() 167 (void)offtab_prepare_get(&offtab, (blkno + 1)); in vnduncompress() 170 const uint64_t end = offtab_get(&offtab, (blkno + 1)); in vnduncompress() 176 blkno, start); in vnduncompress() 182 blkno, (end - start), start, end); in vnduncompress() 187 blkno, offset, (end - start)); in vnduncompress() 193 err(1, "read block %"PRIu32, blkno); in vnduncompress() 197 blkno, (size_t)n_read, (size_t)(end - start)); in vnduncompress() 206 ": %s", blkno, zerror, zError(zerror)); in vnduncompress() [all …]
|
/netbsd-src/sbin/fsck_lfs/ |
H A D | fsck.h | 157 #define setbmap(blkno) setbit(blockmap, blkno) argument 158 #define testbmap(blkno) isset(blockmap, blkno) argument 159 #define clrbmap(blkno) clrbit(blockmap, blkno) argument 161 #define setbmap(blkno,ino) if(blkno > maxfsblock)raise(1); else blockmap[blkno] = ino argument 162 #define testbmap(blkno) blockmap[blkno] argument 163 #define clrbmap(blkno) blockmap[blkno] = 0 argument
|
H A D | pass1.c | 354 daddr_t blkno = idesc->id_blkno; in pass1check() local 358 if ((anyout = chkrange(blkno, idesc->id_numfrags)) != 0) { in pass1check() 359 blkerror(idesc->id_number, "BAD", blkno); in pass1check() 369 } else if (!testbmap(blkno)) { in pass1check() 370 seg_table[lfs_dtosn(fs, blkno)].su_nbytes += idesc->id_numfrags * lfs_sb_getfsize(fs); in pass1check() 372 for (ndblks = idesc->id_numfrags; ndblks > 0; blkno++, ndblks--) { in pass1check() 373 if (anyout && chkrange(blkno, 1)) { in pass1check() 375 } else if (!testbmap(blkno)) { in pass1check() 378 setbmap(blkno); in pass1check() 380 setbmap(blkno, idesc->id_number); in pass1check() [all …]
|
H A D | pass4.c | 149 daddr_t blkno = idesc->id_blkno; in pass4check() local 154 sn = lfs_dtosn(fs, blkno); in pass4check() 155 for (ndblks = idesc->id_numfrags; ndblks > 0; blkno++, ndblks--) { in pass4check() 156 if (chkrange(blkno, 1)) { in pass4check() 158 } else if (testbmap(blkno) || preen) { in pass4check() 160 if (dlp->dup != blkno) in pass4check() 169 clrbmap(blkno); in pass4check()
|
/netbsd-src/sbin/dump/ |
H A D | rcache.c | 196 rawread(daddr_t blkno, char *buf, int size) in rawread() argument 206 if (lseek(diskfd, ((off_t) blkno << dev_bshift), SEEK_SET) == -1) { in rawread() 212 if (blkno + (size >> dev_bshift) > ufsib->ufs_dsize) { in rawread() 228 disk, strerror(errno), (long long)blkno, size); in rawread() 232 disk, (long long)blkno, size, cnt); in rawread() 249 for (i = 0; i < size; i += dev_bsize, buf += dev_bsize, blkno++) { in rawread() 250 if (lseek(diskfd, ((off_t)blkno << dev_bshift), in rawread() 261 (long long)blkno, dev_bsize); in rawread() 266 disk, (long long)blkno, dev_bsize, cnt); in rawread() 271 bread(daddr_t blkno, char *buf, int size) in bread() argument [all …]
|
/netbsd-src/tests/dev/cgd/ |
H A D | t_cgd_aes.c | 57 unsigned int blkno; member 392 .blkno = 0, 397 .blkno = 1, 402 .blkno = 2, 407 .blkno = 3, 695 .blkno = 0, 700 .blkno = 1, 705 .blkno = 2, 710 .blkno = 3, 998 .blkno = 0, [all …]
|
H A D | t_cgd_blowfish.c | 56 unsigned int blkno; member 395 .blkno = 0, 400 .blkno = 1, 405 .blkno = 2, 410 .blkno = 3, 698 .blkno = 0, 703 .blkno = 1, 708 .blkno = 2, 713 .blkno = 3, 1001 .blkno = 0, [all …]
|
H A D | t_cgd_3des.c | 56 unsigned int blkno; member 371 .blkno = 0, 376 .blkno = 1, 381 .blkno = 2, 386 .blkno = 3, 674 .blkno = 0, 679 .blkno = 1, 684 .blkno = 2, 689 .blkno = 3, 759 if (rump_sys_lseek(cgdfd, tv->blkno * SECSIZE, SEEK_SET) < 0) in write_testvec() [all …]
|
/netbsd-src/sys/crypto/chacha/arch/x86/ |
H A D | chacha_sse2_impl.c | 72 chacha_stream_sse2_impl(uint8_t *restrict s, size_t nbytes, uint32_t blkno, in chacha_stream_sse2_impl() argument 79 chacha_stream_sse2(s, nbytes, blkno, nonce, key, nr); in chacha_stream_sse2_impl() 85 uint32_t blkno, in chacha_stream_xor_sse2_impl() argument 92 chacha_stream_xor_sse2(c, p, nbytes, blkno, nonce, key, nr); in chacha_stream_xor_sse2_impl() 97 xchacha_stream_sse2_impl(uint8_t *restrict s, size_t nbytes, uint32_t blkno, in xchacha_stream_sse2_impl() argument 104 xchacha_stream_sse2(s, nbytes, blkno, nonce, key, nr); in xchacha_stream_sse2_impl() 110 uint32_t blkno, in xchacha_stream_xor_sse2_impl() argument 117 xchacha_stream_xor_sse2(c, p, nbytes, blkno, nonce, key, nr); in xchacha_stream_xor_sse2_impl()
|
/netbsd-src/sys/ufs/ffs/ |
H A D | ffs_snapshot.c | 427 daddr_t blkno, numblks; 475 blkno = 1; 476 blkno = ufs_rw64(blkno, UFS_FSNEEDSWAP(fs)); 478 (void *)&blkno, sizeof(blkno), ffs_lblktosize(fs, (off_t)numblks), 496 for (blkno = UFS_NDADDR, n = 0; blkno < numblks; blkno += FFS_NINDIR(fs)) { 497 error = ffs_balloc(vp, ffs_lblktosize(fs, (off_t)blkno), 517 blkno = ffs_fragstoblks(fs, fs->fs_csaddr); 520 error = ffs_balloc(vp, ffs_lblktosize(fs, (off_t)(blkno + loc)), 661 daddr_t blkno, *blkp; 696 blkno = 0; [all …]
|
H A D | ffs_subr.c | 117 ffs_getblk(struct vnode *vp, daddr_t lblkno, daddr_t blkno, int size, in ffs_getblk() argument 122 KASSERT(blkno >= 0 || blkno == FFS_NOBLK); in ffs_getblk() 126 if (blkno != FFS_NOBLK) in ffs_getblk() 127 (*bpp)->b_blkno = blkno; in ffs_getblk() 285 ffs_clusteracct(struct fs *fs, struct cg *cgp, int32_t blkno, int cnt) in ffs_clusteracct() argument 304 setbit(freemapp, blkno); in ffs_clusteracct() 306 clrbit(freemapp, blkno); in ffs_clusteracct() 310 start = blkno + 1; in ffs_clusteracct() 331 start = blkno - 1; in ffs_clusteracct()
|
/netbsd-src/sys/arch/ia64/stand/common/ |
H A D | bcache.c | 70 static void bcache_invalidate(daddr_t blkno); 71 static void bcache_insert(void *buf, daddr_t blkno); 72 static int bcache_lookup(void *buf, daddr_t blkno); 264 bcache_insert(void *buf, daddr_t blkno) in bcache_insert() argument 276 if (bcache_ctl[i].bc_blkno == blkno) { in bcache_insert() 287 DEBUG("insert blk %d -> %d @ %d # %d", blkno, cand, now, bcache_bcount); in bcache_insert() 289 bcache_ctl[cand].bc_blkno = blkno; in bcache_insert() 300 bcache_lookup(void *buf, daddr_t blkno) in bcache_lookup() argument 309 if ((bcache_ctl[i].bc_blkno == blkno) && ((bcache_ctl[i].bc_stamp + BCACHE_TIMEOUT) >= now)) { in bcache_lookup() 311 DEBUG("hit blk %d <- %d (now %d then %d)", blkno, i, now, bcache_ctl[i].bc_stamp); in bcache_lookup() [all …]
|
/netbsd-src/sys/crypto/chacha/arch/arm/ |
H A D | chacha_neon_impl.c | 78 chacha_stream_neon_impl(uint8_t *restrict s, size_t nbytes, uint32_t blkno, in chacha_stream_neon_impl() argument 85 chacha_stream_neon(s, nbytes, blkno, nonce, key, nr); in chacha_stream_neon_impl() 91 uint32_t blkno, in chacha_stream_xor_neon_impl() argument 98 chacha_stream_xor_neon(c, p, nbytes, blkno, nonce, key, nr); in chacha_stream_xor_neon_impl() 103 xchacha_stream_neon_impl(uint8_t *restrict s, size_t nbytes, uint32_t blkno, in xchacha_stream_neon_impl() argument 110 xchacha_stream_neon(s, nbytes, blkno, nonce, key, nr); in xchacha_stream_neon_impl() 116 uint32_t blkno, in xchacha_stream_xor_neon_impl() argument 123 xchacha_stream_xor_neon(c, p, nbytes, blkno, nonce, key, nr); in xchacha_stream_xor_neon_impl()
|
/netbsd-src/sys/crypto/chacha/ |
H A D | chacha_impl.c | 142 chacha_stream(uint8_t *restrict s, size_t nbytes, uint32_t blkno, in chacha_stream() argument 148 (*chacha_impl->ci_chacha_stream)(s, nbytes, blkno, nonce, key, nr); in chacha_stream() 152 chacha_stream_xor(uint8_t *c, const uint8_t *p, size_t nbytes, uint32_t blkno, in chacha_stream_xor() argument 158 (*chacha_impl->ci_chacha_stream_xor)(c, p, nbytes, blkno, nonce, key, in chacha_stream_xor() 163 xchacha_stream(uint8_t *restrict s, size_t nbytes, uint32_t blkno, in xchacha_stream() argument 169 (*chacha_impl->ci_xchacha_stream)(s, nbytes, blkno, nonce, key, nr); in xchacha_stream() 173 xchacha_stream_xor(uint8_t *c, const uint8_t *p, size_t nbytes, uint32_t blkno, in xchacha_stream_xor() argument 179 (*chacha_impl->ci_xchacha_stream_xor)(c, p, nbytes, blkno, nonce, key, in xchacha_stream_xor()
|
/netbsd-src/sbin/fsck_ffs/ |
H A D | inode.c | 876 daddr_t blkno = ffs_lblkno(sblock, offset); in readblk() local 893 if (blkno < UFS_NDADDR) { in readblk() 894 blkno = is_ufs2 ? iswap64(dp->dp2.di_db[blkno]) : in readblk() 895 iswap32(dp->dp1.di_db[blkno]); in readblk() 896 if (blkno == 0) in readblk() 898 *bp = getdatablk(blkno, sblock->fs_bsize); in readblk() 901 blkno -= UFS_NDADDR; in readblk() 906 if (blkno < nblks) in readblk() 909 blkno -= nblks; in readblk() 924 iblkno = iswap64(ibp->b_un.b_indir2[blkno / nblks]); in readblk() [all …]
|
H A D | pass4.c | 164 daddr_t blkno = idesc->id_blkno; in pass4check() local 167 cg = dtog(sblock, blkno); in pass4check() 177 for (nfrags = idesc->id_numfrags; nfrags > 0; blkno++, nfrags--) { in pass4check() 178 if (chkrange(blkno, 1)) { in pass4check() 180 } else if (testbmap(blkno)) { in pass4check() 182 if (dlp->dup != blkno) in pass4check() 191 clrbmap(blkno); in pass4check() 194 dtogd(sblock, blkno)); in pass4check()
|
H A D | pass1b.c | 104 daddr_t blkno = idesc->id_blkno; in pass1bcheck() local 106 for (nfrags = idesc->id_numfrags; nfrags > 0; blkno++, nfrags--) { in pass1bcheck() 107 if (chkrange(blkno, 1)) in pass1bcheck() 110 if (dlp->dup == blkno) { in pass1bcheck() 111 blkerror(idesc->id_number, "DUP", blkno); in pass1bcheck() 113 duphead->dup = blkno; in pass1bcheck()
|
/netbsd-src/sys/arch/sun3/sun3/ |
H A D | machdep.c | 531 daddr_t blkno; in dumpsys() local 567 blkno = dumplo; in dumpsys() 590 error = (*dsw->d_dump)(dumpdev, blkno, vaddr, PAGE_SIZE); in dumpsys() 593 blkno += btodb(PAGE_SIZE); in dumpsys() 597 error = (*dsw->d_dump)(dumpdev, blkno, vaddr, PAGE_SIZE); in dumpsys() 600 blkno += btodb(PAGE_SIZE); in dumpsys() 604 error = (*dsw->d_dump)(dumpdev, blkno, vaddr, PAGE_SIZE); in dumpsys() 607 blkno += btodb(PAGE_SIZE); in dumpsys() 629 error = (*dsw->d_dump)(dumpdev, blkno, vaddr, PAGE_SIZE); in dumpsys() 633 blkno += btodb(PAGE_SIZE); in dumpsys() [all …]
|
/netbsd-src/sbin/fsck_ext2fs/ |
H A D | pass1b.c | 111 daddr_t blkno = idesc->id_blkno; in pass1bcheck() local 113 for (nfrags = idesc->id_numfrags; nfrags > 0; blkno++, nfrags--) { in pass1bcheck() 114 if (chkrange(blkno, 1)) in pass1bcheck() 117 if (dlp->dup == blkno) { in pass1bcheck() 118 blkerror(idesc->id_number, "DUP", blkno); in pass1bcheck() 120 duphead->dup = blkno; in pass1bcheck()
|
H A D | pass4.c | 142 daddr_t blkno = idesc->id_blkno; in pass4check() local 144 for (nfrags = idesc->id_numfrags; nfrags > 0; blkno++, nfrags--) { in pass4check() 145 if (chkrange(blkno, 1)) { in pass4check() 147 } else if (testbmap(blkno)) { in pass4check() 149 if (dlp->dup != blkno) in pass4check() 158 clrbmap(blkno); in pass4check()
|
H A D | pass1.c | 335 daddr_t blkno = idesc->id_blkno; in pass1check() local 339 if ((anyout = chkrange(blkno, idesc->id_numfrags)) != 0) { in pass1check() 340 blkerror(idesc->id_number, "BAD", blkno); in pass1check() 351 for (nfrags = idesc->id_numfrags; nfrags > 0; blkno++, nfrags--) { in pass1check() 352 if (anyout && chkrange(blkno, 1)) { in pass1check() 354 } else if (!testbmap(blkno)) { in pass1check() 356 setbmap(blkno); in pass1check() 358 blkerror(idesc->id_number, "DUP", blkno); in pass1check() 375 new->dup = blkno; in pass1check() 384 if (dlp->dup == blkno) in pass1check() [all …]
|
/netbsd-src/sys/arch/cobalt/stand/boot/ |
H A D | wdc.c | 324 wdc_exec_read(struct wd_softc *wd, uint8_t cmd, daddr_t blkno, void *data) in wdc_exec_read() argument 340 if ((wd->sc_flags & WDF_LBA48) != 0 && blkno > wd->sc_capacity28) in wdc_exec_read() 348 wd_c.r_blkno = blkno; in wdc_exec_read() 352 wd_c.r_sector = (blkno >> 0) & 0xff; in wdc_exec_read() 353 wd_c.r_cyl = (blkno >> 8) & 0xffff; in wdc_exec_read() 354 wd_c.r_head = (blkno >> 24) & 0x0f; in wdc_exec_read() 359 wd_c.r_sector = blkno % wd->sc_label.d_nsectors; in wdc_exec_read() 361 blkno /= wd->sc_label.d_nsectors; in wdc_exec_read() 362 wd_c.r_head = blkno % wd->sc_label.d_ntracks; in wdc_exec_read() 363 blkno /= wd->sc_label.d_ntracks; in wdc_exec_read() [all …]
|
/netbsd-src/sys/arch/mmeye/stand/boot/ |
H A D | wdc.c | 361 wdc_exec_read(struct wd_softc *wd, uint8_t cmd, daddr_t blkno, void *data) in wdc_exec_read() argument 377 if ((wd->sc_flags & WDF_LBA48) != 0 && blkno > wd->sc_capacity28) in wdc_exec_read() 385 wd_c.r_blkno = blkno; in wdc_exec_read() 389 wd_c.r_sector = (blkno >> 0) & 0xff; in wdc_exec_read() 390 wd_c.r_cyl = (blkno >> 8) & 0xffff; in wdc_exec_read() 391 wd_c.r_head = (blkno >> 24) & 0x0f; in wdc_exec_read() 396 wd_c.r_sector = blkno % wd->sc_label.d_nsectors; in wdc_exec_read() 398 blkno /= wd->sc_label.d_nsectors; in wdc_exec_read() 399 wd_c.r_head = blkno % wd->sc_label.d_ntracks; in wdc_exec_read() 400 blkno /= wd->sc_label.d_ntracks; in wdc_exec_read() [all …]
|