Lines Matching refs:chain

204  *	ext2_get_branch - read the chain of indirect blocks leading to data
206 * @depth: depth of the chain (1 - direct pointer, etc.)
208 * @chain: place to store the result
213 * (incomplete one) otherwise. Upon the return chain[i].key contains
214 * the number of (i+1)-th block in the chain (as it is stored in memory,
215 * i.e. little-endian 32-bit), chain[i].p contains the address of that
217 * for i>0) and chain[i].bh points to the buffer_head of i-th indirect
219 * numbers of the chain, addresses they were taken from (and where we can
220 * verify that chain did not change) and buffer_heads hosting these
227 * or when it notices that chain had been changed while it was reading
230 * the whole chain, all way to the data (returns %NULL, *err == 0).
235 Indirect chain[4],
239 Indirect *p = chain;
244 add_chain (chain, NULL, EXT2_I(inode)->i_data + *offsets);
252 if (!verify_chain(chain, p))
323 * @partial: pointer to the last triple within a chain
352 * @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
521 * End of chain, update the last new metablock of
522 * the chain to point to the new allocated
560 * chain to new block and return 0.
633 Indirect chain[4];
651 partial = ext2_get_branch(inode, depth, offsets, chain, &err);
654 first_block = le32_to_cpu(chain[depth - 1].key);
660 if (!verify_chain(chain, chain + depth - 1)) {
669 partial = chain + depth - 1;
672 blk = le32_to_cpu(*(chain[depth-1].p + count));
689 * the chain(ext2_get_branch() returns -EAGAIN err), or
690 * if the chain has been changed after we grab the semaphore,
692 * another get_block allocated this branch) re-grab the chain to see if
696 * at this point, we will have the current copy of the chain when we
699 if (err == -EAGAIN || !verify_chain(chain, partial)) {
700 while (partial > chain) {
704 partial = ext2_get_branch(inode, depth, offsets, chain, &err);
727 indirect_blks = (chain + depth) - partial - 1;
738 offsets + (partial - chain), partial);
754 partial = chain + depth - 1; /* the whole chain */
756 while (partial > chain) {
761 *bno = le32_to_cpu(chain[depth-1].key);
975 * @chain: place to store the pointers to partial indirect blocks
992 * truncated blocks - in @chain[].bh and pointers to their last elements
993 * that should not be removed - in @chain[].p. Return value is the pointer
994 * to last filled element of @chain.
999 * (@chain[i].p+1 .. end of @chain[i].bh->b_data)
1000 * c) free the subtrees growing from the inode past the @chain[0].p
1007 Indirect chain[4],
1017 partial = ext2_get_branch(inode, k, offsets, chain, &err);
1019 partial = chain + k-1;
1029 for (p=partial; p>chain && all_zeroes((__le32*)p->bh->b_data,p->p); p--)
1037 if (p == chain + k - 1 && p > chain) {
1148 Indirect chain[4];
1174 partial = ext2_find_shared(inode, n, offsets, chain, &nr);
1177 if (partial == chain)
1182 ext2_free_branches(inode, &nr, &nr+1, (chain+n-1) - partial);
1185 while (partial > chain) {
1189 (chain+n-1) - partial);