Lines Matching refs:bud

45 	struct ubifs_bud *bud;  in ubifs_search_bud()  local
50 bud = rb_entry(p, struct ubifs_bud, rb); in ubifs_search_bud()
51 if (lnum < bud->lnum) in ubifs_search_bud()
53 else if (lnum > bud->lnum) in ubifs_search_bud()
57 return bud; in ubifs_search_bud()
74 struct ubifs_bud *bud; in ubifs_get_wbuf() local
83 bud = rb_entry(p, struct ubifs_bud, rb); in ubifs_get_wbuf()
84 if (lnum < bud->lnum) in ubifs_get_wbuf()
86 else if (lnum > bud->lnum) in ubifs_get_wbuf()
89 jhead = bud->jhead; in ubifs_get_wbuf()
124 void ubifs_add_bud(struct ubifs_info *c, struct ubifs_bud *bud) in ubifs_add_bud() argument
135 ubifs_assert(c, bud->lnum != b->lnum); in ubifs_add_bud()
136 if (bud->lnum < b->lnum) in ubifs_add_bud()
142 rb_link_node(&bud->rb, parent, p); in ubifs_add_bud()
143 rb_insert_color(&bud->rb, &c->buds); in ubifs_add_bud()
145 jhead = &c->jheads[bud->jhead]; in ubifs_add_bud()
146 list_add_tail(&bud->list, &jhead->buds_list); in ubifs_add_bud()
156 c->bud_bytes += c->leb_size - bud->start; in ubifs_add_bud()
158 dbg_log("LEB %d:%d, jhead %s, bud_bytes %lld", bud->lnum, in ubifs_add_bud()
159 bud->start, dbg_jhead(bud->jhead), c->bud_bytes); in ubifs_add_bud()
179 struct ubifs_bud *bud; in ubifs_add_bud_to_log() local
182 bud = kmalloc(sizeof(struct ubifs_bud), GFP_NOFS); in ubifs_add_bud_to_log()
183 if (!bud) in ubifs_add_bud_to_log()
187 kfree(bud); in ubifs_add_bud_to_log()
236 bud->lnum = lnum; in ubifs_add_bud_to_log()
237 bud->start = offs; in ubifs_add_bud_to_log()
238 bud->jhead = jhead; in ubifs_add_bud_to_log()
241 ref->lnum = cpu_to_le32(bud->lnum); in ubifs_add_bud_to_log()
242 ref->offs = cpu_to_le32(bud->start); in ubifs_add_bud_to_log()
258 if (bud->start == 0) { in ubifs_add_bud_to_log()
266 err = ubifs_leb_map(c, bud->lnum); in ubifs_add_bud_to_log()
280 ubifs_add_bud(c, bud); in ubifs_add_bud_to_log()
289 kfree(bud); in ubifs_add_bud_to_log()
310 struct ubifs_bud *bud; in remove_buds() local
314 bud = rb_entry(p1, struct ubifs_bud, rb); in remove_buds()
315 wbuf = &c->jheads[bud->jhead].wbuf; in remove_buds()
317 if (wbuf->lnum == bud->lnum) { in remove_buds()
322 c->cmt_bud_bytes += wbuf->offs - bud->start; in remove_buds()
324 bud->lnum, bud->start, dbg_jhead(bud->jhead), in remove_buds()
325 wbuf->offs - bud->start, c->cmt_bud_bytes); in remove_buds()
326 bud->start = wbuf->offs; in remove_buds()
328 c->cmt_bud_bytes += c->leb_size - bud->start; in remove_buds()
330 bud->lnum, bud->start, dbg_jhead(bud->jhead), in remove_buds()
331 c->leb_size - bud->start, c->cmt_bud_bytes); in remove_buds()
340 list_move(&bud->list, &c->old_buds); in remove_buds()
512 struct ubifs_bud *bud; in ubifs_log_post_commit() local
514 bud = list_entry(c->old_buds.next, struct ubifs_bud, list); in ubifs_log_post_commit()
515 err = ubifs_return_leb(c, bud->lnum); in ubifs_log_post_commit()
518 list_del(&bud->list); in ubifs_log_post_commit()
519 kfree(bud); in ubifs_log_post_commit()
734 struct ubifs_bud *bud; in dbg_check_bud_bytes() local
742 list_for_each_entry(bud, &c->jheads[i].buds_list, list) in dbg_check_bud_bytes()
743 bud_bytes += c->leb_size - bud->start; in dbg_check_bud_bytes()