Lines Matching refs:bu

1504 int ubifs_tnc_get_bu_keys(struct ubifs_info *c, struct bu_info *bu)  in ubifs_tnc_get_bu_keys()  argument
1508 unsigned int block = key_block(c, &bu->key); in ubifs_tnc_get_bu_keys()
1511 bu->cnt = 0; in ubifs_tnc_get_bu_keys()
1512 bu->blk_cnt = 0; in ubifs_tnc_get_bu_keys()
1513 bu->eof = 0; in ubifs_tnc_get_bu_keys()
1517 err = ubifs_lookup_level0(c, &bu->key, &znode, &n); in ubifs_tnc_get_bu_keys()
1524 if (len > bu->buf_len) { in ubifs_tnc_get_bu_keys()
1529 bu->zbranch[bu->cnt++] = znode->zbranch[n]; in ubifs_tnc_get_bu_keys()
1530 bu->blk_cnt += 1; in ubifs_tnc_get_bu_keys()
1546 if (key_inum(c, key) != key_inum(c, &bu->key) || in ubifs_tnc_get_bu_keys()
1556 if (len > bu->buf_len) { in ubifs_tnc_get_bu_keys()
1570 if (len > bu->buf_len) in ubifs_tnc_get_bu_keys()
1575 bu->blk_cnt += (next_block - block - 1); in ubifs_tnc_get_bu_keys()
1576 if (bu->blk_cnt >= UBIFS_MAX_BULK_READ) in ubifs_tnc_get_bu_keys()
1580 bu->zbranch[bu->cnt++] = *zbr; in ubifs_tnc_get_bu_keys()
1581 bu->blk_cnt += 1; in ubifs_tnc_get_bu_keys()
1583 if (bu->cnt >= UBIFS_MAX_BULK_READ) in ubifs_tnc_get_bu_keys()
1585 if (bu->blk_cnt >= UBIFS_MAX_BULK_READ) in ubifs_tnc_get_bu_keys()
1590 bu->eof = 1; in ubifs_tnc_get_bu_keys()
1593 bu->gc_seq = c->gc_seq; in ubifs_tnc_get_bu_keys()
1601 if (bu->blk_cnt > UBIFS_MAX_BULK_READ) in ubifs_tnc_get_bu_keys()
1602 bu->blk_cnt = UBIFS_MAX_BULK_READ; in ubifs_tnc_get_bu_keys()
1608 !(bu->blk_cnt & (UBIFS_BLOCKS_PER_PAGE - 1))) in ubifs_tnc_get_bu_keys()
1610 if (bu->eof) { in ubifs_tnc_get_bu_keys()
1612 bu->blk_cnt += UBIFS_BLOCKS_PER_PAGE - 1; in ubifs_tnc_get_bu_keys()
1616 block = key_block(c, &bu->key) + bu->blk_cnt; in ubifs_tnc_get_bu_keys()
1618 while (bu->cnt) { in ubifs_tnc_get_bu_keys()
1619 if (key_block(c, &bu->zbranch[bu->cnt - 1].key) < block) in ubifs_tnc_get_bu_keys()
1621 bu->cnt -= 1; in ubifs_tnc_get_bu_keys()
1735 int ubifs_tnc_bulk_read(struct ubifs_info *c, struct bu_info *bu) in ubifs_tnc_bulk_read() argument
1737 int lnum = bu->zbranch[0].lnum, offs = bu->zbranch[0].offs, len, err, i; in ubifs_tnc_bulk_read()
1741 len = bu->zbranch[bu->cnt - 1].offs; in ubifs_tnc_bulk_read()
1742 len += bu->zbranch[bu->cnt - 1].len - offs; in ubifs_tnc_bulk_read()
1743 if (len > bu->buf_len) { in ubifs_tnc_bulk_read()
1744 ubifs_err(c, "buffer too small %d vs %d", bu->buf_len, len); in ubifs_tnc_bulk_read()
1751 err = read_wbuf(wbuf, bu->buf, len, lnum, offs); in ubifs_tnc_bulk_read()
1753 err = ubifs_leb_read(c, lnum, bu->buf, offs, len, 0); in ubifs_tnc_bulk_read()
1756 if (maybe_leb_gced(c, lnum, bu->gc_seq)) in ubifs_tnc_bulk_read()
1763 dbg_tnck(&bu->key, "key "); in ubifs_tnc_bulk_read()
1768 buf = bu->buf; in ubifs_tnc_bulk_read()
1769 for (i = 0; i < bu->cnt; i++) { in ubifs_tnc_bulk_read()
1770 err = validate_data_node(c, buf, &bu->zbranch[i]); in ubifs_tnc_bulk_read()
1773 buf = buf + ALIGN(bu->zbranch[i].len, 8); in ubifs_tnc_bulk_read()