Lines Matching refs:bp

37 	fmd_buf_t *bp = fmd_alloc(sizeof (fmd_buf_t), FMD_SLEEP);  in fmd_buf_alloc()  local
39 bp->buf_name = fmd_strdup(name, FMD_SLEEP); in fmd_buf_alloc()
40 bp->buf_next = NULL; in fmd_buf_alloc()
41 bp->buf_data = fmd_zalloc(size, FMD_SLEEP); in fmd_buf_alloc()
42 bp->buf_size = size; in fmd_buf_alloc()
43 bp->buf_flags = FMD_BUF_DIRTY; in fmd_buf_alloc()
45 return (bp); in fmd_buf_alloc()
49 fmd_buf_free(fmd_buf_t *bp) in fmd_buf_free() argument
51 fmd_strfree(bp->buf_name); in fmd_buf_free()
52 fmd_free(bp->buf_data, bp->buf_size); in fmd_buf_free()
53 fmd_free(bp, sizeof (fmd_buf_t)); in fmd_buf_free()
68 fmd_buf_t *bp, *np; in fmd_buf_hash_destroy() local
72 for (bp = bhp->bh_hash[i]; bp != NULL; bp = np) { in fmd_buf_hash_destroy()
73 np = bp->buf_next; in fmd_buf_hash_destroy()
74 total += bp->buf_size; in fmd_buf_hash_destroy()
75 fmd_buf_free(bp); in fmd_buf_hash_destroy()
87 fmd_buf_t *bp; in fmd_buf_hash_apply() local
91 for (bp = bhp->bh_hash[i]; bp != NULL; bp = bp->buf_next) in fmd_buf_hash_apply()
92 func(bp, arg); in fmd_buf_hash_apply()
99 fmd_buf_t *bp; in fmd_buf_hash_commit() local
103 for (bp = bhp->bh_hash[i]; bp != NULL; bp = bp->buf_next) in fmd_buf_hash_commit()
104 bp->buf_flags &= ~FMD_BUF_DIRTY; in fmd_buf_hash_commit()
118 fmd_buf_t *bp = fmd_buf_alloc(name, size); in fmd_buf_insert() local
120 bp->buf_next = bhp->bh_hash[h]; in fmd_buf_insert()
121 bhp->bh_hash[h] = bp; in fmd_buf_insert()
124 return (bp); in fmd_buf_insert()
131 fmd_buf_t *bp; in fmd_buf_lookup() local
133 for (bp = bhp->bh_hash[h]; bp != NULL; bp = bp->buf_next) { in fmd_buf_lookup()
134 if (strcmp(name, bp->buf_name) == 0) in fmd_buf_lookup()
135 return (bp); in fmd_buf_lookup()
145 fmd_buf_t *bp, **pp = &bhp->bh_hash[h]; in fmd_buf_delete() local
147 for (bp = *pp; bp != NULL; bp = bp->buf_next) { in fmd_buf_delete()
148 if (strcmp(bp->buf_name, name) != 0) in fmd_buf_delete()
149 pp = &bp->buf_next; in fmd_buf_delete()
154 if (bp != NULL) { in fmd_buf_delete()
155 *pp = bp->buf_next; in fmd_buf_delete()
156 fmd_buf_free(bp); in fmd_buf_delete()