Lines Matching refs:bu

1507 int ubifs_tnc_get_bu_keys(struct ubifs_info *c, struct bu_info *bu)  in ubifs_tnc_get_bu_keys()  argument
1511 unsigned int block = key_block(c, &bu->key); in ubifs_tnc_get_bu_keys()
1514 bu->cnt = 0; in ubifs_tnc_get_bu_keys()
1515 bu->blk_cnt = 0; in ubifs_tnc_get_bu_keys()
1516 bu->eof = 0; in ubifs_tnc_get_bu_keys()
1520 err = ubifs_lookup_level0(c, &bu->key, &znode, &n); in ubifs_tnc_get_bu_keys()
1527 if (len > bu->buf_len) { in ubifs_tnc_get_bu_keys()
1532 bu->zbranch[bu->cnt++] = znode->zbranch[n]; in ubifs_tnc_get_bu_keys()
1533 bu->blk_cnt += 1; in ubifs_tnc_get_bu_keys()
1549 if (key_inum(c, key) != key_inum(c, &bu->key) || in ubifs_tnc_get_bu_keys()
1559 if (len > bu->buf_len) { in ubifs_tnc_get_bu_keys()
1573 if (len > bu->buf_len) in ubifs_tnc_get_bu_keys()
1578 bu->blk_cnt += (next_block - block - 1); in ubifs_tnc_get_bu_keys()
1579 if (bu->blk_cnt >= UBIFS_MAX_BULK_READ) in ubifs_tnc_get_bu_keys()
1583 bu->zbranch[bu->cnt++] = *zbr; in ubifs_tnc_get_bu_keys()
1584 bu->blk_cnt += 1; in ubifs_tnc_get_bu_keys()
1586 if (bu->cnt >= UBIFS_MAX_BULK_READ) in ubifs_tnc_get_bu_keys()
1588 if (bu->blk_cnt >= UBIFS_MAX_BULK_READ) in ubifs_tnc_get_bu_keys()
1593 bu->eof = 1; in ubifs_tnc_get_bu_keys()
1596 bu->gc_seq = c->gc_seq; in ubifs_tnc_get_bu_keys()
1604 if (bu->blk_cnt > UBIFS_MAX_BULK_READ) in ubifs_tnc_get_bu_keys()
1605 bu->blk_cnt = UBIFS_MAX_BULK_READ; in ubifs_tnc_get_bu_keys()
1611 !(bu->blk_cnt & (UBIFS_BLOCKS_PER_PAGE - 1))) in ubifs_tnc_get_bu_keys()
1613 if (bu->eof) { in ubifs_tnc_get_bu_keys()
1615 bu->blk_cnt += UBIFS_BLOCKS_PER_PAGE - 1; in ubifs_tnc_get_bu_keys()
1619 block = key_block(c, &bu->key) + bu->blk_cnt; in ubifs_tnc_get_bu_keys()
1621 while (bu->cnt) { in ubifs_tnc_get_bu_keys()
1622 if (key_block(c, &bu->zbranch[bu->cnt - 1].key) < block) in ubifs_tnc_get_bu_keys()
1624 bu->cnt -= 1; in ubifs_tnc_get_bu_keys()
1738 int ubifs_tnc_bulk_read(struct ubifs_info *c, struct bu_info *bu) in ubifs_tnc_bulk_read() argument
1740 int lnum = bu->zbranch[0].lnum, offs = bu->zbranch[0].offs, len, err, i; in ubifs_tnc_bulk_read()
1744 len = bu->zbranch[bu->cnt - 1].offs; in ubifs_tnc_bulk_read()
1745 len += bu->zbranch[bu->cnt - 1].len - offs; in ubifs_tnc_bulk_read()
1746 if (len > bu->buf_len) { in ubifs_tnc_bulk_read()
1747 ubifs_err(c, "buffer too small %d vs %d", bu->buf_len, len); in ubifs_tnc_bulk_read()
1754 err = read_wbuf(wbuf, bu->buf, len, lnum, offs); in ubifs_tnc_bulk_read()
1756 err = ubifs_leb_read(c, lnum, bu->buf, offs, len, 0); in ubifs_tnc_bulk_read()
1759 if (maybe_leb_gced(c, lnum, bu->gc_seq)) in ubifs_tnc_bulk_read()
1766 dbg_tnck(&bu->key, "key "); in ubifs_tnc_bulk_read()
1771 buf = bu->buf; in ubifs_tnc_bulk_read()
1772 for (i = 0; i < bu->cnt; i++) { in ubifs_tnc_bulk_read()
1773 err = validate_data_node(c, buf, &bu->zbranch[i]); in ubifs_tnc_bulk_read()
1776 buf = buf + ALIGN(bu->zbranch[i].len, 8); in ubifs_tnc_bulk_read()