Lines Matching defs:chain
115 * ext4_get_branch - read the chain of indirect blocks leading to data
117 * @depth: depth of the chain (1 - direct pointer, etc.)
119 * @chain: place to store the result
124 * (incomplete one) otherwise. Upon the return chain[i].key contains
125 * the number of (i+1)-th block in the chain (as it is stored in memory,
126 * i.e. little-endian 32-bit), chain[i].p contains the address of that
128 * for i>0) and chain[i].bh points to the buffer_head of i-th indirect
130 * numbers of the chain, addresses they were taken from (and where we can
131 * verify that chain did not change) and buffer_heads hosting these
139 * the whole chain, all way to the data (returns %NULL, *err == 0).
146 Indirect chain[4], int *err)
149 Indirect *p = chain;
156 add_chain(chain, NULL, EXT4_I(inode)->i_data + *offsets);
244 * @partial: pointer to the last triple within a chain
269 * @branch: chain of indirect blocks
304 * ext4_alloc_branch() - allocate and set up a chain of blocks
309 * @branch: place to store the chain in.
312 * links them into chain and (if we are synchronous) writes them to disk.
314 * inode. It stores the information about that chain in the branch[], in
316 * we had read the existing part of chain and partial points to the last
319 * place chain is disconnected - *branch->p is still zero (we did not
325 * ext4_alloc_block() (normally -ENOSPC). Otherwise we set the chain
422 * chain to new block and return 0.
535 Indirect chain[4];
552 partial = ext4_get_branch(inode, depth, offsets, chain, &err);
556 first_block = le32_to_cpu(chain[depth - 1].key);
562 blk = le32_to_cpu(*(chain[depth-1].p + count));
584 for (i = partial - chain + 1; i < depth; i++)
621 indirect_blks = (chain + depth) - partial - 1;
634 offsets + (partial - chain), partial);
638 * on the new chain if there is a failure, but that risks using
662 map->m_pblk = le32_to_cpu(chain[depth-1].key);
668 partial = chain + depth - 1; /* the whole chain */
670 while (partial > chain) {
771 * @chain: place to store the pointers to partial indirect blocks
789 * partially truncated blocks - in @chain[].bh and pointers to
791 * @chain[].p. Return value is the pointer to last filled element
792 * of @chain.
797 * (@chain[i].p+1 .. end of @chain[i].bh->b_data)
798 * c) free the subtrees growing from the inode past the @chain[0].
802 ext4_lblk_t offsets[4], Indirect chain[4],
812 partial = ext4_get_branch(inode, k, offsets, chain, &err);
815 partial = chain + k-1;
823 for (p = partial; (p > chain) && all_zeroes((__le32 *) p->bh->b_data, p->p); p--)
831 if (p == chain + k - 1 && p > chain) {
1120 Indirect chain[4];
1161 partial = ext4_find_shared(inode, n, offsets, chain, &nr);
1164 if (partial == chain) {
1167 &nr, &nr+1, (chain+n-1) - partial);
1178 partial->p+1, (chain+n-1) - partial);
1182 while (partial > chain) {
1185 (chain+n-1) - partial);
1236 Indirect chain[4], chain2[4];
1280 partial = p = ext4_find_shared(inode, n, offsets, chain, &nr);
1282 if (partial == chain) {
1285 &nr, &nr+1, (chain+n-1) - partial);
1292 partial->p+1, (chain+n-1) - partial);
1300 while (partial > chain) {
1304 (chain+n-1) - partial);
1345 partial = p = ext4_find_shared(inode, n, offsets, chain, &nr);
1350 int level = min(partial - chain, partial2 - chain2);
1362 if (partial == chain) {
1366 (chain+n-1) - partial);
1374 (chain+n-1) - partial);
1389 while (partial > chain || partial2 > chain2) {
1390 int depth = (chain+n-1) - partial;
1393 if (partial > chain && partial2 > chain2 &&
1402 (chain+n-1) - partial);
1413 if (partial > chain && depth <= depth2) {
1417 (chain+n-1) - partial);
1430 while (p && p > chain) {