Lines Matching refs:bud

33 	struct ubifs_bud *bud;  in ubifs_search_bud()  local
38 bud = rb_entry(p, struct ubifs_bud, rb); in ubifs_search_bud()
39 if (lnum < bud->lnum) in ubifs_search_bud()
41 else if (lnum > bud->lnum) in ubifs_search_bud()
45 return bud; in ubifs_search_bud()
62 struct ubifs_bud *bud; in ubifs_get_wbuf() local
71 bud = rb_entry(p, struct ubifs_bud, rb); in ubifs_get_wbuf()
72 if (lnum < bud->lnum) in ubifs_get_wbuf()
74 else if (lnum > bud->lnum) in ubifs_get_wbuf()
77 jhead = bud->jhead; in ubifs_get_wbuf()
112 void ubifs_add_bud(struct ubifs_info *c, struct ubifs_bud *bud) in ubifs_add_bud() argument
123 ubifs_assert(c, bud->lnum != b->lnum); in ubifs_add_bud()
124 if (bud->lnum < b->lnum) in ubifs_add_bud()
130 rb_link_node(&bud->rb, parent, p); in ubifs_add_bud()
131 rb_insert_color(&bud->rb, &c->buds); in ubifs_add_bud()
133 jhead = &c->jheads[bud->jhead]; in ubifs_add_bud()
134 list_add_tail(&bud->list, &jhead->buds_list); in ubifs_add_bud()
144 c->bud_bytes += c->leb_size - bud->start; in ubifs_add_bud()
146 dbg_log("LEB %d:%d, jhead %s, bud_bytes %lld", bud->lnum, in ubifs_add_bud()
147 bud->start, dbg_jhead(bud->jhead), c->bud_bytes); in ubifs_add_bud()
167 struct ubifs_bud *bud; in ubifs_add_bud_to_log() local
170 bud = kmalloc(sizeof(struct ubifs_bud), GFP_NOFS); in ubifs_add_bud_to_log()
171 if (!bud) in ubifs_add_bud_to_log()
175 kfree(bud); in ubifs_add_bud_to_log()
224 bud->lnum = lnum; in ubifs_add_bud_to_log()
225 bud->start = offs; in ubifs_add_bud_to_log()
226 bud->jhead = jhead; in ubifs_add_bud_to_log()
227 bud->log_hash = NULL; in ubifs_add_bud_to_log()
230 ref->lnum = cpu_to_le32(bud->lnum); in ubifs_add_bud_to_log()
231 ref->offs = cpu_to_le32(bud->start); in ubifs_add_bud_to_log()
247 if (bud->start == 0) { in ubifs_add_bud_to_log()
255 err = ubifs_leb_map(c, bud->lnum); in ubifs_add_bud_to_log()
277 ubifs_add_bud(c, bud); in ubifs_add_bud_to_log()
286 kfree(bud); in ubifs_add_bud_to_log()
307 struct ubifs_bud *bud; in remove_buds() local
311 bud = rb_entry(p1, struct ubifs_bud, rb); in remove_buds()
312 wbuf = &c->jheads[bud->jhead].wbuf; in remove_buds()
314 if (wbuf->lnum == bud->lnum) { in remove_buds()
319 c->cmt_bud_bytes += wbuf->offs - bud->start; in remove_buds()
321 bud->lnum, bud->start, dbg_jhead(bud->jhead), in remove_buds()
322 wbuf->offs - bud->start, c->cmt_bud_bytes); in remove_buds()
323 bud->start = wbuf->offs; in remove_buds()
325 c->cmt_bud_bytes += c->leb_size - bud->start; in remove_buds()
327 bud->lnum, bud->start, dbg_jhead(bud->jhead), in remove_buds()
328 c->leb_size - bud->start, c->cmt_bud_bytes); in remove_buds()
337 list_move(&bud->list, &c->old_buds); in remove_buds()
520 struct ubifs_bud *bud; in ubifs_log_post_commit() local
522 bud = list_entry(c->old_buds.next, struct ubifs_bud, list); in ubifs_log_post_commit()
523 err = ubifs_return_leb(c, bud->lnum); in ubifs_log_post_commit()
526 list_del(&bud->list); in ubifs_log_post_commit()
527 kfree(bud->log_hash); in ubifs_log_post_commit()
528 kfree(bud); in ubifs_log_post_commit()
743 struct ubifs_bud *bud; in dbg_check_bud_bytes() local
751 list_for_each_entry(bud, &c->jheads[i].buds_list, list) in dbg_check_bud_bytes()
752 bud_bytes += c->leb_size - bud->start; in dbg_check_bud_bytes()