Lines Matching defs:bn

319 bmp_set(bmap_chunk_t *cp, u_quad_t bn, uint_t *vp)
326 bn -= cp->c_off;
327 if (bn < cp->c_clen) {
328 mask = 1 <<(bn & BMAP_BPW_MASK);
329 ip = &cp->c_bmp[bn >> BMAP_BPW_SHIFT];
330 v = (*vp <<(bn & BMAP_BPW_MASK)) & mask;
346 bmp_get(bmap_chunk_t *cp, u_quad_t bn)
351 bn -= cp->c_off;
352 if (bn < cp->c_clen) {
353 bit = 1 <<(bn & BMAP_BPW_MASK);
354 rv = (cp->c_bmp[bn >> BMAP_BPW_SHIFT] & bit) != 0;
368 bm_chunk_setup(bitmap_t *bmp, bmap_chunk_t *cp, u_quad_t bn)
375 off = BMAP_CHUNK_OFF(bn);
390 h = HASH(bn);
407 bm_chunk_new(bitmap_t *bmp, u_quad_t bn)
420 (void) bm_chunk_setup(bmp, cp, bn);
436 bm_chunk_alloc(bitmap_t *bmp, u_quad_t bn)
441 cp = bm_chunk_new(bmp, bn);
511 bm_chunk_find(bitmap_t *bmp, u_quad_t bn)
520 h = HASH(bn);
523 if (bn >= cp->c_off && bn < (cp->c_off + cp->c_clen)) {
533 return (bm_chunk_alloc(bmp, bn));
547 u_quad_t bn;
551 bn = vp->bmv_base;
552 max = bn + vp->bmv_len;
553 if (bn >= bmp->bm_len || max > bmp->bm_len)
565 cp = bm_chunk_find(bmp, bn);
569 for (cl = cp->c_off + cp->c_clen; bn < cl && bn < max; bn++) {
570 rv = bmp_set(cp, bn, vp->bmv_val);
574 } while (bn < max);
592 u_quad_t bn;
596 bn = vp->bmv_base;
597 max = bn + vp->bmv_len;
598 if (bn >= bmp->bm_len || max > bmp->bm_len)
608 cp = bm_chunk_find(bmp, bn);
612 for (cl = cp->c_off + cp->c_clen; bn < cl && bn < max; bn++) {
613 rv = bmp_get(cp, bn);
623 } while (bn < max);
852 dbmp_set(dbmap_chunk_t *cp, u_quad_t bn, uint_t *vp)
859 bn -= cp->c_off;
860 if (bn < cp->c_clen) {
861 mask = 1 <<(bn & BMAP_BPW_MASK);
862 ip = &cp->c_bmp[bn >> BMAP_BPW_SHIFT];
863 v = (*vp <<(bn & BMAP_BPW_MASK)) & mask;
892 dbmp_get(dbmap_chunk_t *cp, u_quad_t bn)
897 bn -= cp->c_off;
898 if (bn < cp->c_clen) {
899 bit = 1 <<(bn & BMAP_BPW_MASK);
900 rv = (cp->c_bmp[bn >> BMAP_BPW_SHIFT] & bit) != 0;
914 dbm_chunk_seek(dbitmap_t *bmp, u_quad_t bn)
922 off = BMAP_CHUNK_NO(bn) * BMAP_CHUNK_BYTES;
967 dbm_chunk_load(dbitmap_t *bmp, dbmap_chunk_t *cp, u_quad_t bn, int new)
974 off = BMAP_CHUNK_OFF(bn);
990 if (dbm_chunk_seek(bmp, bn) != 0)
998 h = HASH(bn);
1017 dbm_chunk_new(dbitmap_t *bmp, u_quad_t bn)
1028 } else if (!dbm_chunk_load(bmp, cp, bn, BMAP_NEW_CHUNK)) {
1049 dbm_chunk_alloc(dbitmap_t *bmp, u_quad_t bn)
1056 return (dbm_chunk_new(bmp, bn));
1068 return (dbm_chunk_load(bmp, cp, bn, BMAP_OLD_CHUNK));
1126 dbm_chunk_find(dbitmap_t *bmp, u_quad_t bn)
1135 h = HASH(bn);
1138 if (bn >= cp->c_off && bn < (cp->c_off + cp->c_clen)) {
1148 return (dbm_chunk_alloc(bmp, bn));
1163 u_quad_t bn;
1167 bn = vp->bmv_base;
1168 max = bn + vp->bmv_len;
1169 if (bn >= bmp->bm_len || max > bmp->bm_len)
1181 cp = dbm_chunk_find(bmp, bn);
1185 for (cl = cp->c_off + cp->c_clen; bn < cl && bn < max; bn++) {
1186 rv = dbmp_set(cp, bn, vp->bmv_val);
1190 } while (bn < max);
1209 u_quad_t bn;
1213 bn = vp->bmv_base;
1214 max = bn + vp->bmv_len;
1215 if (bn >= bmp->bm_len || max > bmp->bm_len)
1225 cp = dbm_chunk_find(bmp, bn);
1229 for (cl = cp->c_off + cp->c_clen; bn < cl && bn < max; bn++) {
1230 rv = dbmp_get(cp, bn);
1240 } while (bn < max);