Lines Matching refs:bu

1503 int ubifs_tnc_get_bu_keys(struct ubifs_info *c, struct bu_info *bu)  in ubifs_tnc_get_bu_keys()  argument
1507 unsigned int block = key_block(c, &bu->key); in ubifs_tnc_get_bu_keys()
1510 bu->cnt = 0; in ubifs_tnc_get_bu_keys()
1511 bu->blk_cnt = 0; in ubifs_tnc_get_bu_keys()
1512 bu->eof = 0; in ubifs_tnc_get_bu_keys()
1516 err = ubifs_lookup_level0(c, &bu->key, &znode, &n); in ubifs_tnc_get_bu_keys()
1523 if (len > bu->buf_len) { in ubifs_tnc_get_bu_keys()
1528 bu->zbranch[bu->cnt++] = znode->zbranch[n]; in ubifs_tnc_get_bu_keys()
1529 bu->blk_cnt += 1; in ubifs_tnc_get_bu_keys()
1545 if (key_inum(c, key) != key_inum(c, &bu->key) || in ubifs_tnc_get_bu_keys()
1555 if (len > bu->buf_len) { in ubifs_tnc_get_bu_keys()
1569 if (len > bu->buf_len) in ubifs_tnc_get_bu_keys()
1574 bu->blk_cnt += (next_block - block - 1); in ubifs_tnc_get_bu_keys()
1575 if (bu->blk_cnt >= UBIFS_MAX_BULK_READ) in ubifs_tnc_get_bu_keys()
1579 bu->zbranch[bu->cnt++] = *zbr; in ubifs_tnc_get_bu_keys()
1580 bu->blk_cnt += 1; in ubifs_tnc_get_bu_keys()
1582 if (bu->cnt >= UBIFS_MAX_BULK_READ) in ubifs_tnc_get_bu_keys()
1584 if (bu->blk_cnt >= UBIFS_MAX_BULK_READ) in ubifs_tnc_get_bu_keys()
1589 bu->eof = 1; in ubifs_tnc_get_bu_keys()
1592 bu->gc_seq = c->gc_seq; in ubifs_tnc_get_bu_keys()
1600 if (bu->blk_cnt > UBIFS_MAX_BULK_READ) in ubifs_tnc_get_bu_keys()
1601 bu->blk_cnt = UBIFS_MAX_BULK_READ; in ubifs_tnc_get_bu_keys()
1607 !(bu->blk_cnt & (UBIFS_BLOCKS_PER_PAGE - 1))) in ubifs_tnc_get_bu_keys()
1609 if (bu->eof) { in ubifs_tnc_get_bu_keys()
1611 bu->blk_cnt += UBIFS_BLOCKS_PER_PAGE - 1; in ubifs_tnc_get_bu_keys()
1615 block = key_block(c, &bu->key) + bu->blk_cnt; in ubifs_tnc_get_bu_keys()
1617 while (bu->cnt) { in ubifs_tnc_get_bu_keys()
1618 if (key_block(c, &bu->zbranch[bu->cnt - 1].key) < block) in ubifs_tnc_get_bu_keys()
1620 bu->cnt -= 1; in ubifs_tnc_get_bu_keys()
1734 int ubifs_tnc_bulk_read(struct ubifs_info *c, struct bu_info *bu) in ubifs_tnc_bulk_read() argument
1736 int lnum = bu->zbranch[0].lnum, offs = bu->zbranch[0].offs, len, err, i; in ubifs_tnc_bulk_read()
1740 len = bu->zbranch[bu->cnt - 1].offs; in ubifs_tnc_bulk_read()
1741 len += bu->zbranch[bu->cnt - 1].len - offs; in ubifs_tnc_bulk_read()
1742 if (len > bu->buf_len) { in ubifs_tnc_bulk_read()
1743 ubifs_err(c, "buffer too small %d vs %d", bu->buf_len, len); in ubifs_tnc_bulk_read()
1750 err = read_wbuf(wbuf, bu->buf, len, lnum, offs); in ubifs_tnc_bulk_read()
1752 err = ubifs_leb_read(c, lnum, bu->buf, offs, len, 0); in ubifs_tnc_bulk_read()
1755 if (maybe_leb_gced(c, lnum, bu->gc_seq)) in ubifs_tnc_bulk_read()
1762 dbg_tnck(&bu->key, "key "); in ubifs_tnc_bulk_read()
1767 buf = bu->buf; in ubifs_tnc_bulk_read()
1768 for (i = 0; i < bu->cnt; i++) { in ubifs_tnc_bulk_read()
1769 err = validate_data_node(c, buf, &bu->zbranch[i]); in ubifs_tnc_bulk_read()
1772 buf = buf + ALIGN(bu->zbranch[i].len, 8); in ubifs_tnc_bulk_read()