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
423 * chain to new block and return 0.
537 Indirect chain[4];
554 partial = ext4_get_branch(inode, depth, offsets, chain, &err);
558 first_block = le32_to_cpu(chain[depth - 1].key);
564 blk = le32_to_cpu(*(chain[depth-1].p + count));
586 for (i = partial - chain + 1; i < depth; i++)
623 indirect_blks = (chain + depth) - partial - 1;
636 offsets + (partial - chain), partial);
640 * on the new chain if there is a failure, but that risks using
664 map->m_pblk = le32_to_cpu(chain[depth-1].key);
670 partial = chain + depth - 1; /* the whole chain */
672 while (partial > chain) {
774 * @chain: place to store the pointers to partial indirect blocks
792 * partially truncated blocks - in @chain[].bh and pointers to
794 * @chain[].p. Return value is the pointer to last filled element
795 * of @chain.
800 * (@chain[i].p+1 .. end of @chain[i].bh->b_data)
801 * c) free the subtrees growing from the inode past the @chain[0].
805 ext4_lblk_t offsets[4], Indirect chain[4],
815 partial = ext4_get_branch(inode, k, offsets, chain, &err);
818 partial = chain + k-1;
826 for (p = partial; (p > chain) && all_zeroes((__le32 *) p->bh->b_data, p->p); p--)
834 if (p == chain + k - 1 && p > chain) {
1125 Indirect chain[4];
1166 partial = ext4_find_shared(inode, n, offsets, chain, &nr);
1169 if (partial == chain) {
1172 &nr, &nr+1, (chain+n-1) - partial);
1183 partial->p+1, (chain+n-1) - partial);
1187 while (partial > chain) {
1190 (chain+n-1) - partial);
1241 Indirect chain[4], chain2[4];
1285 partial = p = ext4_find_shared(inode, n, offsets, chain, &nr);
1287 if (partial == chain) {
1290 &nr, &nr+1, (chain+n-1) - partial);
1297 partial->p+1, (chain+n-1) - partial);
1305 while (partial > chain) {
1309 (chain+n-1) - partial);
1350 partial = p = ext4_find_shared(inode, n, offsets, chain, &nr);
1355 int level = min(partial - chain, partial2 - chain2);
1367 if (partial == chain) {
1371 (chain+n-1) - partial);
1379 (chain+n-1) - partial);
1394 while (partial > chain || partial2 > chain2) {
1395 int depth = (chain+n-1) - partial;
1398 if (partial > chain && partial2 > chain2 &&
1407 (chain+n-1) - partial);
1418 if (partial > chain && depth <= depth2) {
1422 (chain+n-1) - partial);
1435 while (p && p > chain) {