Lines Matching refs:bud
37 struct ubifs_bud *bud; in ubifs_search_bud() local
42 bud = rb_entry(p, struct ubifs_bud, rb); in ubifs_search_bud()
43 if (lnum < bud->lnum) in ubifs_search_bud()
45 else if (lnum > bud->lnum) in ubifs_search_bud()
49 return bud; in ubifs_search_bud()
66 struct ubifs_bud *bud; in ubifs_get_wbuf() local
75 bud = rb_entry(p, struct ubifs_bud, rb); in ubifs_get_wbuf()
76 if (lnum < bud->lnum) in ubifs_get_wbuf()
78 else if (lnum > bud->lnum) in ubifs_get_wbuf()
81 jhead = bud->jhead; in ubifs_get_wbuf()
116 void ubifs_add_bud(struct ubifs_info *c, struct ubifs_bud *bud) in ubifs_add_bud() argument
127 ubifs_assert(bud->lnum != b->lnum); in ubifs_add_bud()
128 if (bud->lnum < b->lnum) in ubifs_add_bud()
134 rb_link_node(&bud->rb, parent, p); in ubifs_add_bud()
135 rb_insert_color(&bud->rb, &c->buds); in ubifs_add_bud()
137 jhead = &c->jheads[bud->jhead]; in ubifs_add_bud()
138 list_add_tail(&bud->list, &jhead->buds_list); in ubifs_add_bud()
148 c->bud_bytes += c->leb_size - bud->start; in ubifs_add_bud()
150 dbg_log("LEB %d:%d, jhead %s, bud_bytes %lld", bud->lnum, in ubifs_add_bud()
151 bud->start, dbg_jhead(bud->jhead), c->bud_bytes); in ubifs_add_bud()
171 struct ubifs_bud *bud; in ubifs_add_bud_to_log() local
174 bud = kmalloc(sizeof(struct ubifs_bud), GFP_NOFS); in ubifs_add_bud_to_log()
175 if (!bud) in ubifs_add_bud_to_log()
179 kfree(bud); in ubifs_add_bud_to_log()
228 bud->lnum = lnum; in ubifs_add_bud_to_log()
229 bud->start = offs; in ubifs_add_bud_to_log()
230 bud->jhead = jhead; in ubifs_add_bud_to_log()
233 ref->lnum = cpu_to_le32(bud->lnum); in ubifs_add_bud_to_log()
234 ref->offs = cpu_to_le32(bud->start); in ubifs_add_bud_to_log()
250 if (bud->start == 0) { in ubifs_add_bud_to_log()
258 err = ubifs_leb_map(c, bud->lnum); in ubifs_add_bud_to_log()
272 ubifs_add_bud(c, bud); in ubifs_add_bud_to_log()
281 kfree(bud); in ubifs_add_bud_to_log()
302 struct ubifs_bud *bud; in remove_buds() local
306 bud = rb_entry(p1, struct ubifs_bud, rb); in remove_buds()
307 wbuf = &c->jheads[bud->jhead].wbuf; in remove_buds()
309 if (wbuf->lnum == bud->lnum) { in remove_buds()
314 c->cmt_bud_bytes += wbuf->offs - bud->start; in remove_buds()
316 bud->lnum, bud->start, dbg_jhead(bud->jhead), in remove_buds()
317 wbuf->offs - bud->start, c->cmt_bud_bytes); in remove_buds()
318 bud->start = wbuf->offs; in remove_buds()
320 c->cmt_bud_bytes += c->leb_size - bud->start; in remove_buds()
322 bud->lnum, bud->start, dbg_jhead(bud->jhead), in remove_buds()
323 c->leb_size - bud->start, c->cmt_bud_bytes); in remove_buds()
332 list_move(&bud->list, &c->old_buds); in remove_buds()
504 struct ubifs_bud *bud; in ubifs_log_post_commit() local
506 bud = list_entry(c->old_buds.next, struct ubifs_bud, list); in ubifs_log_post_commit()
507 err = ubifs_return_leb(c, bud->lnum); in ubifs_log_post_commit()
510 list_del(&bud->list); in ubifs_log_post_commit()
511 kfree(bud); in ubifs_log_post_commit()
726 struct ubifs_bud *bud; in dbg_check_bud_bytes() local
734 list_for_each_entry(bud, &c->jheads[i].buds_list, list) in dbg_check_bud_bytes()
735 bud_bytes += c->leb_size - bud->start; in dbg_check_bud_bytes()