Lines Matching refs:bu
1552 int ubifs_tnc_get_bu_keys(struct ubifs_info *c, struct bu_info *bu) in ubifs_tnc_get_bu_keys() argument
1556 unsigned int block = key_block(c, &bu->key); in ubifs_tnc_get_bu_keys()
1559 bu->cnt = 0; in ubifs_tnc_get_bu_keys()
1560 bu->blk_cnt = 0; in ubifs_tnc_get_bu_keys()
1561 bu->eof = 0; in ubifs_tnc_get_bu_keys()
1565 err = ubifs_lookup_level0(c, &bu->key, &znode, &n); in ubifs_tnc_get_bu_keys()
1572 if (len > bu->buf_len) { in ubifs_tnc_get_bu_keys()
1577 bu->zbranch[bu->cnt++] = znode->zbranch[n]; in ubifs_tnc_get_bu_keys()
1578 bu->blk_cnt += 1; in ubifs_tnc_get_bu_keys()
1594 if (key_inum(c, key) != key_inum(c, &bu->key) || in ubifs_tnc_get_bu_keys()
1604 if (len > bu->buf_len) { in ubifs_tnc_get_bu_keys()
1618 if (len > bu->buf_len) in ubifs_tnc_get_bu_keys()
1623 bu->blk_cnt += (next_block - block - 1); in ubifs_tnc_get_bu_keys()
1624 if (bu->blk_cnt >= UBIFS_MAX_BULK_READ) in ubifs_tnc_get_bu_keys()
1628 bu->zbranch[bu->cnt++] = *zbr; in ubifs_tnc_get_bu_keys()
1629 bu->blk_cnt += 1; in ubifs_tnc_get_bu_keys()
1631 if (bu->cnt >= UBIFS_MAX_BULK_READ) in ubifs_tnc_get_bu_keys()
1633 if (bu->blk_cnt >= UBIFS_MAX_BULK_READ) in ubifs_tnc_get_bu_keys()
1638 bu->eof = 1; in ubifs_tnc_get_bu_keys()
1641 bu->gc_seq = c->gc_seq; in ubifs_tnc_get_bu_keys()
1649 if (bu->blk_cnt > UBIFS_MAX_BULK_READ) in ubifs_tnc_get_bu_keys()
1650 bu->blk_cnt = UBIFS_MAX_BULK_READ; in ubifs_tnc_get_bu_keys()
1656 !(bu->blk_cnt & (UBIFS_BLOCKS_PER_PAGE - 1))) in ubifs_tnc_get_bu_keys()
1658 if (bu->eof) { in ubifs_tnc_get_bu_keys()
1660 bu->blk_cnt += UBIFS_BLOCKS_PER_PAGE - 1; in ubifs_tnc_get_bu_keys()
1664 block = key_block(c, &bu->key) + bu->blk_cnt; in ubifs_tnc_get_bu_keys()
1666 while (bu->cnt) { in ubifs_tnc_get_bu_keys()
1667 if (key_block(c, &bu->zbranch[bu->cnt - 1].key) < block) in ubifs_tnc_get_bu_keys()
1669 bu->cnt -= 1; in ubifs_tnc_get_bu_keys()
1789 int ubifs_tnc_bulk_read(struct ubifs_info *c, struct bu_info *bu) in ubifs_tnc_bulk_read() argument
1791 int lnum = bu->zbranch[0].lnum, offs = bu->zbranch[0].offs, len, err, i; in ubifs_tnc_bulk_read()
1795 len = bu->zbranch[bu->cnt - 1].offs; in ubifs_tnc_bulk_read()
1796 len += bu->zbranch[bu->cnt - 1].len - offs; in ubifs_tnc_bulk_read()
1797 if (len > bu->buf_len) { in ubifs_tnc_bulk_read()
1798 ubifs_err(c, "buffer too small %d vs %d", bu->buf_len, len); in ubifs_tnc_bulk_read()
1805 err = read_wbuf(wbuf, bu->buf, len, lnum, offs); in ubifs_tnc_bulk_read()
1807 err = ubifs_leb_read(c, lnum, bu->buf, offs, len, 0); in ubifs_tnc_bulk_read()
1810 if (maybe_leb_gced(c, lnum, bu->gc_seq)) in ubifs_tnc_bulk_read()
1817 dbg_tnck(&bu->key, "key "); in ubifs_tnc_bulk_read()
1822 buf = bu->buf; in ubifs_tnc_bulk_read()
1823 for (i = 0; i < bu->cnt; i++) { in ubifs_tnc_bulk_read()
1824 err = validate_data_node(c, buf, &bu->zbranch[i]); in ubifs_tnc_bulk_read()
1827 buf = buf + ALIGN(bu->zbranch[i].len, 8); in ubifs_tnc_bulk_read()