• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/linux/linux-2.6.36/fs/ubifs/

Lines Matching defs:bud

39  * ubifs_search_bud - search bud LEB.
43 * This function searches bud LEB @lnum. Returns bud description object in case
44 * of success and %NULL if there is no bud with this LEB number.
49 struct ubifs_bud *bud;
54 bud = rb_entry(p, struct ubifs_bud, rb);
55 if (lnum < bud->lnum)
57 else if (lnum > bud->lnum)
61 return bud;
78 struct ubifs_bud *bud;
87 bud = rb_entry(p, struct ubifs_bud, rb);
88 if (lnum < bud->lnum)
90 else if (lnum > bud->lnum)
93 jhead = bud->jhead;
134 * ubifs_add_bud - add bud LEB to the tree of buds and its journal head list.
136 * @bud: the bud to add
138 void ubifs_add_bud(struct ubifs_info *c, struct ubifs_bud *bud)
149 ubifs_assert(bud->lnum != b->lnum);
150 if (bud->lnum < b->lnum)
156 rb_link_node(&bud->rb, parent, p);
157 rb_insert_color(&bud->rb, &c->buds);
159 jhead = &c->jheads[bud->jhead];
160 list_add_tail(&bud->list, &jhead->buds_list);
165 * Note, although this is a new bud, we anyway account this space now,
167 * guarantee fixed mount time, and this bud will anyway be read and
170 c->bud_bytes += c->leb_size - bud->start;
172 dbg_log("LEB %d:%d, jhead %s, bud_bytes %lld", bud->lnum,
173 bud->start, dbg_jhead(bud->jhead), c->bud_bytes);
188 struct ubifs_bud *bud = rb_entry(p, struct ubifs_bud, rb);
189 struct ubifs_jhead *jhead = &c->jheads[bud->jhead];
191 list_add_tail(&bud->list, &jhead->buds_list);
198 * ubifs_add_bud_to_log - add a new bud to the log.
200 * @jhead: journal head the bud belongs to
201 * @lnum: LEB number of the bud
202 * @offs: starting offset of the bud
204 * This function writes reference node for the new bud LEB @lnum it to the log,
213 struct ubifs_bud *bud;
216 bud = kmalloc(sizeof(struct ubifs_bud), GFP_NOFS);
217 if (!bud)
221 kfree(bud);
251 dbg_log("bud bytes %lld (%lld max), require commit",
265 dbg_log("bud bytes %lld (%lld max), initiate BG commit",
270 bud->lnum = lnum;
271 bud->start = offs;
272 bud->jhead = jhead;
275 ref->lnum = cpu_to_le32(bud->lnum);
276 ref->offs = cpu_to_le32(bud->start);
291 if (bud->start == 0) {
299 err = ubi_leb_map(c->ubi, bud->lnum, UBI_SHORTTERM);
313 ubifs_add_bud(c, bud);
324 kfree(bud);
345 struct ubifs_bud *bud;
349 bud = rb_entry(p1, struct ubifs_bud, rb);
350 wbuf = &c->jheads[bud->jhead].wbuf;
352 if (wbuf->lnum == bud->lnum) {
357 c->cmt_bud_bytes += wbuf->offs - bud->start;
358 dbg_log("preserve %d:%d, jhead %s, bud bytes %d, "
359 "cmt_bud_bytes %lld", bud->lnum, bud->start,
360 dbg_jhead(bud->jhead), wbuf->offs - bud->start,
362 bud->start = wbuf->offs;
364 c->cmt_bud_bytes += c->leb_size - bud->start;
365 dbg_log("remove %d:%d, jhead %s, bud bytes %d, "
366 "cmt_bud_bytes %lld", bud->lnum, bud->start,
367 dbg_jhead(bud->jhead), c->leb_size - bud->start,
377 list_move(&bud->list, &c->old_buds);
545 struct ubifs_bud *bud;
547 bud = list_entry(c->old_buds.next, struct ubifs_bud, list);
548 err = ubifs_return_leb(c, bud->lnum);
551 list_del(&bud->list);
552 kfree(bud);
776 * dbg_check_bud_bytes - make sure bud bytes calculation are all right.
786 struct ubifs_bud *bud;
794 list_for_each_entry(bud, &c->jheads[i].buds_list, list)
795 bud_bytes += c->leb_size - bud->start;