Lines Matching full:chain

206  *	ext2_get_branch - read the chain of indirect blocks leading to data
208 * @depth: depth of the chain (1 - direct pointer, etc.)
210 * @chain: place to store the result
215 * (incomplete one) otherwise. Upon the return chain[i].key contains
216 * the number of (i+1)-th block in the chain (as it is stored in memory,
217 * i.e. little-endian 32-bit), chain[i].p contains the address of that
219 * for i>0) and chain[i].bh points to the buffer_head of i-th indirect
221 * numbers of the chain, addresses they were taken from (and where we can
222 * verify that chain did not change) and buffer_heads hosting these
229 * or when it notices that chain had been changed while it was reading
232 * the whole chain, all way to the data (returns %NULL, *err == 0).
237 Indirect chain[4], in ext2_get_branch()
241 Indirect *p = chain; in ext2_get_branch()
246 add_chain (chain, NULL, EXT2_I(inode)->i_data + *offsets); in ext2_get_branch()
254 if (!verify_chain(chain, p)) in ext2_get_branch()
325 * @partial: pointer to the last triple within a chain
353 * @branch: chain of indirect blocks
453 * ext2_alloc_branch - allocate and set up a chain of blocks.
455 * @indirect_blks: depth of the chain (number of blocks to allocate)
459 * @branch: place to store the chain in.
462 * links them into chain and (if we are synchronous) writes them to disk.
464 * inode. It stores the information about that chain in the branch[], in
466 * we had read the existing part of chain and partial points to the last
469 * place chain is disconnected - *branch->p is still zero (we did not
475 * ext2_alloc_block() (normally -ENOSPC). Otherwise we set the chain
520 * End of chain, update the last new metablock of in ext2_alloc_branch()
521 * the chain to point to the new allocated in ext2_alloc_branch()
559 * chain to new block and return 0.
631 Indirect chain[4]; in ext2_get_blocks() local
648 partial = ext2_get_branch(inode, depth, offsets, chain, &err); in ext2_get_blocks()
651 first_block = le32_to_cpu(chain[depth - 1].key); in ext2_get_blocks()
657 if (!verify_chain(chain, chain + depth - 1)) { in ext2_get_blocks()
666 partial = chain + depth - 1; in ext2_get_blocks()
669 blk = le32_to_cpu(*(chain[depth-1].p + count)); in ext2_get_blocks()
686 * the chain(ext2_get_branch() returns -EAGAIN err), or in ext2_get_blocks()
687 * if the chain has been changed after we grab the semaphore, in ext2_get_blocks()
689 * another get_block allocated this branch) re-grab the chain to see if in ext2_get_blocks()
693 * at this point, we will have the current copy of the chain when we in ext2_get_blocks()
696 if (err == -EAGAIN || !verify_chain(chain, partial)) { in ext2_get_blocks()
697 while (partial > chain) { in ext2_get_blocks()
701 partial = ext2_get_branch(inode, depth, offsets, chain, &err); in ext2_get_blocks()
724 indirect_blks = (chain + depth) - partial - 1; in ext2_get_blocks()
735 offsets + (partial - chain), partial); in ext2_get_blocks()
748 le32_to_cpu(chain[depth-1].key), in ext2_get_blocks()
756 le32_to_cpu(chain[depth-1].key), count, in ext2_get_blocks()
772 partial = chain + depth - 1; /* the whole chain */ in ext2_get_blocks()
774 while (partial > chain) { in ext2_get_blocks()
779 *bno = le32_to_cpu(chain[depth-1].key); in ext2_get_blocks()
1008 * @chain: place to store the pointers to partial indirect blocks
1025 * truncated blocks - in @chain[].bh and pointers to their last elements
1026 * that should not be removed - in @chain[].p. Return value is the pointer
1027 * to last filled element of @chain.
1032 * (@chain[i].p+1 .. end of @chain[i].bh->b_data)
1033 * c) free the subtrees growing from the inode past the @chain[0].p
1040 Indirect chain[4], in ext2_find_shared()
1049 partial = ext2_get_branch(inode, k, offsets, chain, &err); in ext2_find_shared()
1051 partial = chain + k-1; in ext2_find_shared()
1061 for (p=partial; p>chain && all_zeroes((__le32*)p->bh->b_data,p->p); p--) in ext2_find_shared()
1069 if (p == chain + k - 1 && p > chain) { in ext2_find_shared()
1178 Indirect chain[4]; in __ext2_truncate_blocks() local
1207 partial = ext2_find_shared(inode, n, offsets, chain, &nr); in __ext2_truncate_blocks()
1210 if (partial == chain) in __ext2_truncate_blocks()
1214 ext2_free_branches(inode, &nr, &nr+1, (chain+n-1) - partial); in __ext2_truncate_blocks()
1217 while (partial > chain) { in __ext2_truncate_blocks()
1221 (chain+n-1) - partial); in __ext2_truncate_blocks()