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