Lines Matching full: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) in ext4_get_branch()
149 Indirect *p = chain; in ext4_get_branch()
155 add_chain(chain, NULL, EXT4_I(inode)->i_data + *offsets); in ext4_get_branch()
237 * @partial: pointer to the last triple within a chain
262 * @branch: chain of indirect blocks
297 * ext4_alloc_branch() - allocate and set up a chain of blocks
302 * @branch: place to store the chain in.
305 * links them into chain and (if we are synchronous) writes them to disk.
307 * inode. It stores the information about that chain in the branch[], in
309 * we had read the existing part of chain and partial points to the last
312 * place chain is disconnected - *branch->p is still zero (we did not
318 * ext4_alloc_block() (normally -ENOSPC). Otherwise we set the chain
415 * chain to new block and return 0.
528 Indirect chain[4]; in ext4_ind_map_blocks() local
545 partial = ext4_get_branch(inode, depth, offsets, chain, &err); in ext4_ind_map_blocks()
549 first_block = le32_to_cpu(chain[depth - 1].key); in ext4_ind_map_blocks()
555 blk = le32_to_cpu(*(chain[depth-1].p + count)); in ext4_ind_map_blocks()
577 for (i = partial - chain + 1; i < depth; i++) in ext4_ind_map_blocks()
614 indirect_blks = (chain + depth) - partial - 1; in ext4_ind_map_blocks()
627 offsets + (partial - chain), partial); in ext4_ind_map_blocks()
631 * on the new chain if there is a failure, but that risks using in ext4_ind_map_blocks()
647 map->m_pblk = le32_to_cpu(chain[depth-1].key); in ext4_ind_map_blocks()
653 partial = chain + depth - 1; /* the whole chain */ in ext4_ind_map_blocks()
655 while (partial > chain) { in ext4_ind_map_blocks()
756 * @chain: place to store the pointers to partial indirect blocks
774 * partially truncated blocks - in @chain[].bh and pointers to
776 * @chain[].p. Return value is the pointer to last filled element
777 * of @chain.
782 * (@chain[i].p+1 .. end of @chain[i].bh->b_data)
783 * c) free the subtrees growing from the inode past the @chain[0].
787 ext4_lblk_t offsets[4], Indirect chain[4], in ext4_find_shared()
797 partial = ext4_get_branch(inode, k, offsets, chain, &err); in ext4_find_shared()
800 partial = chain + k-1; in ext4_find_shared()
808 for (p = partial; (p > chain) && all_zeroes((__le32 *) p->bh->b_data, p->p); p--) in ext4_find_shared()
816 if (p == chain + k - 1 && p > chain) { in ext4_find_shared()
1105 Indirect chain[4]; in ext4_ind_truncate() local
1146 partial = ext4_find_shared(inode, n, offsets, chain, &nr); in ext4_ind_truncate()
1149 if (partial == chain) { in ext4_ind_truncate()
1152 &nr, &nr+1, (chain+n-1) - partial); in ext4_ind_truncate()
1163 partial->p+1, (chain+n-1) - partial); in ext4_ind_truncate()
1167 while (partial > chain) { in ext4_ind_truncate()
1170 (chain+n-1) - partial); in ext4_ind_truncate()
1221 Indirect chain[4], chain2[4]; in ext4_ind_remove_space() local
1265 partial = p = ext4_find_shared(inode, n, offsets, chain, &nr); in ext4_ind_remove_space()
1267 if (partial == chain) { in ext4_ind_remove_space()
1270 &nr, &nr+1, (chain+n-1) - partial); in ext4_ind_remove_space()
1277 partial->p+1, (chain+n-1) - partial); in ext4_ind_remove_space()
1285 while (partial > chain) { in ext4_ind_remove_space()
1289 (chain+n-1) - partial); in ext4_ind_remove_space()
1330 partial = p = ext4_find_shared(inode, n, offsets, chain, &nr); in ext4_ind_remove_space()
1335 int level = min(partial - chain, partial2 - chain2); in ext4_ind_remove_space()
1347 if (partial == chain) { in ext4_ind_remove_space()
1351 (chain+n-1) - partial); in ext4_ind_remove_space()
1359 (chain+n-1) - partial); in ext4_ind_remove_space()
1374 while (partial > chain || partial2 > chain2) { in ext4_ind_remove_space()
1375 int depth = (chain+n-1) - partial; in ext4_ind_remove_space()
1378 if (partial > chain && partial2 > chain2 && in ext4_ind_remove_space()
1387 (chain+n-1) - partial); in ext4_ind_remove_space()
1398 if (partial > chain && depth <= depth2) { in ext4_ind_remove_space()
1402 (chain+n-1) - partial); in ext4_ind_remove_space()
1415 while (p && p > chain) { in ext4_ind_remove_space()