Lines Matching refs:bu
1521 int ubifs_tnc_get_bu_keys(struct ubifs_info *c, struct bu_info *bu) in ubifs_tnc_get_bu_keys() argument
1525 unsigned int block = key_block(c, &bu->key); in ubifs_tnc_get_bu_keys()
1528 bu->cnt = 0; in ubifs_tnc_get_bu_keys()
1529 bu->blk_cnt = 0; in ubifs_tnc_get_bu_keys()
1530 bu->eof = 0; in ubifs_tnc_get_bu_keys()
1534 err = ubifs_lookup_level0(c, &bu->key, &znode, &n); in ubifs_tnc_get_bu_keys()
1541 if (len > bu->buf_len) { in ubifs_tnc_get_bu_keys()
1546 bu->zbranch[bu->cnt++] = znode->zbranch[n]; in ubifs_tnc_get_bu_keys()
1547 bu->blk_cnt += 1; in ubifs_tnc_get_bu_keys()
1563 if (key_inum(c, key) != key_inum(c, &bu->key) || in ubifs_tnc_get_bu_keys()
1573 if (len > bu->buf_len) { in ubifs_tnc_get_bu_keys()
1587 if (len > bu->buf_len) in ubifs_tnc_get_bu_keys()
1592 bu->blk_cnt += (next_block - block - 1); in ubifs_tnc_get_bu_keys()
1593 if (bu->blk_cnt >= UBIFS_MAX_BULK_READ) in ubifs_tnc_get_bu_keys()
1597 bu->zbranch[bu->cnt++] = *zbr; in ubifs_tnc_get_bu_keys()
1598 bu->blk_cnt += 1; in ubifs_tnc_get_bu_keys()
1600 if (bu->cnt >= UBIFS_MAX_BULK_READ) in ubifs_tnc_get_bu_keys()
1602 if (bu->blk_cnt >= UBIFS_MAX_BULK_READ) in ubifs_tnc_get_bu_keys()
1607 bu->eof = 1; in ubifs_tnc_get_bu_keys()
1610 bu->gc_seq = c->gc_seq; in ubifs_tnc_get_bu_keys()
1618 if (bu->blk_cnt > UBIFS_MAX_BULK_READ) in ubifs_tnc_get_bu_keys()
1619 bu->blk_cnt = UBIFS_MAX_BULK_READ; in ubifs_tnc_get_bu_keys()
1625 !(bu->blk_cnt & (UBIFS_BLOCKS_PER_PAGE - 1))) in ubifs_tnc_get_bu_keys()
1627 if (bu->eof) { in ubifs_tnc_get_bu_keys()
1629 bu->blk_cnt += UBIFS_BLOCKS_PER_PAGE - 1; in ubifs_tnc_get_bu_keys()
1633 block = key_block(c, &bu->key) + bu->blk_cnt; in ubifs_tnc_get_bu_keys()
1635 while (bu->cnt) { in ubifs_tnc_get_bu_keys()
1636 if (key_block(c, &bu->zbranch[bu->cnt - 1].key) < block) in ubifs_tnc_get_bu_keys()
1638 bu->cnt -= 1; in ubifs_tnc_get_bu_keys()
1758 int ubifs_tnc_bulk_read(struct ubifs_info *c, struct bu_info *bu) in ubifs_tnc_bulk_read() argument
1760 int lnum = bu->zbranch[0].lnum, offs = bu->zbranch[0].offs, len, err, i; in ubifs_tnc_bulk_read()
1764 len = bu->zbranch[bu->cnt - 1].offs; in ubifs_tnc_bulk_read()
1765 len += bu->zbranch[bu->cnt - 1].len - offs; in ubifs_tnc_bulk_read()
1766 if (len > bu->buf_len) { in ubifs_tnc_bulk_read()
1767 ubifs_err(c, "buffer too small %d vs %d", bu->buf_len, len); in ubifs_tnc_bulk_read()
1774 err = read_wbuf(wbuf, bu->buf, len, lnum, offs); in ubifs_tnc_bulk_read()
1776 err = ubifs_leb_read(c, lnum, bu->buf, offs, len, 0); in ubifs_tnc_bulk_read()
1779 if (maybe_leb_gced(c, lnum, bu->gc_seq)) in ubifs_tnc_bulk_read()
1786 dbg_tnck(&bu->key, "key "); in ubifs_tnc_bulk_read()
1791 buf = bu->buf; in ubifs_tnc_bulk_read()
1792 for (i = 0; i < bu->cnt; i++) { in ubifs_tnc_bulk_read()
1793 err = validate_data_node(c, buf, &bu->zbranch[i]); in ubifs_tnc_bulk_read()
1796 buf = buf + ALIGN(bu->zbranch[i].len, 8); in ubifs_tnc_bulk_read()