Lines Matching refs:bh
34 struct buffer_head *bh; member
37 static inline void add_chain(Indirect *p, struct buffer_head *bh, __le32 *v) in add_chain() argument
40 p->bh = bh; in add_chain()
150 struct buffer_head *bh; in ext4_get_branch() local
159 bh = sb_getblk(sb, le32_to_cpu(p->key)); in ext4_get_branch()
160 if (unlikely(!bh)) { in ext4_get_branch()
165 if (!bh_uptodate_or_lock(bh)) { in ext4_get_branch()
166 if (ext4_read_bh(bh, 0, NULL) < 0) { in ext4_get_branch()
167 put_bh(bh); in ext4_get_branch()
171 if (ext4_check_indirect_blockref(inode, bh)) { in ext4_get_branch()
172 put_bh(bh); in ext4_get_branch()
177 add_chain(++p, bh, (__le32 *)bh->b_data + *++offsets); in ext4_get_branch()
213 __le32 *start = ind->bh ? (__le32 *) ind->bh->b_data : ei->i_data; in ext4_find_near()
223 if (ind->bh) in ext4_find_near()
224 return ind->bh->b_blocknr; in ext4_find_near()
326 struct buffer_head * bh; in ext4_alloc_branch() local
340 branch[i+1].bh = NULL; in ext4_alloc_branch()
350 bh = branch[i].bh = sb_getblk(ar->inode->i_sb, new_blocks[i-1]); in ext4_alloc_branch()
351 if (unlikely(!bh)) { in ext4_alloc_branch()
355 lock_buffer(bh); in ext4_alloc_branch()
356 BUFFER_TRACE(bh, "call get_create_access"); in ext4_alloc_branch()
357 err = ext4_journal_get_create_access(handle, bh); in ext4_alloc_branch()
359 unlock_buffer(bh); in ext4_alloc_branch()
363 memset(bh->b_data, 0, bh->b_size); in ext4_alloc_branch()
364 p = branch[i].p = (__le32 *) bh->b_data + offsets[i]; in ext4_alloc_branch()
372 BUFFER_TRACE(bh, "marking uptodate"); in ext4_alloc_branch()
373 set_buffer_uptodate(bh); in ext4_alloc_branch()
374 unlock_buffer(bh); in ext4_alloc_branch()
376 BUFFER_TRACE(bh, "call ext4_handle_dirty_metadata"); in ext4_alloc_branch()
377 err = ext4_handle_dirty_metadata(handle, ar->inode, bh); in ext4_alloc_branch()
399 ext4_free_blocks(handle, ar->inode, branch[i+1].bh, in ext4_alloc_branch()
401 branch[i+1].bh ? EXT4_FREE_BLOCKS_FORGET : 0); in ext4_alloc_branch()
430 if (where->bh) { in ext4_splice_branch()
431 BUFFER_TRACE(where->bh, "get_write_access"); in ext4_splice_branch()
432 err = ext4_journal_get_write_access(handle, where->bh); in ext4_splice_branch()
452 if (where->bh) { in ext4_splice_branch()
462 BUFFER_TRACE(where->bh, "call ext4_handle_dirty_metadata"); in ext4_splice_branch()
463 err = ext4_handle_dirty_metadata(handle, ar->inode, where->bh); in ext4_splice_branch()
484 ext4_free_blocks(handle, ar->inode, where[i].bh, 0, 1, in ext4_splice_branch()
656 BUFFER_TRACE(partial->bh, "call brelse"); in ext4_ind_map_blocks()
657 brelse(partial->bh); in ext4_ind_map_blocks()
680 struct buffer_head *bh, int *dropped) in ext4_ind_trunc_restart_fn() argument
684 if (bh) { in ext4_ind_trunc_restart_fn()
685 BUFFER_TRACE(bh, "call ext4_handle_dirty_metadata"); in ext4_ind_trunc_restart_fn()
686 err = ext4_handle_dirty_metadata(handle, inode, bh); in ext4_ind_trunc_restart_fn()
716 struct buffer_head *bh, in ext4_ind_truncate_ensure_credits() argument
724 ext4_ind_trunc_restart_fn(handle, inode, bh, &dropped)); in ext4_ind_truncate_ensure_credits()
729 if (bh) { in ext4_ind_truncate_ensure_credits()
730 BUFFER_TRACE(bh, "retaking write access"); in ext4_ind_truncate_ensure_credits()
731 ret = ext4_journal_get_write_access(handle, bh); in ext4_ind_truncate_ensure_credits()
808 for (p = partial; (p > chain) && all_zeroes((__le32 *) p->bh->b_data, p->p); p--) in ext4_find_shared()
828 brelse(partial->bh); in ext4_find_shared()
847 struct buffer_head *bh, in ext4_clear_blocks() argument
869 err = ext4_ind_truncate_ensure_credits(handle, inode, bh, in ext4_clear_blocks()
999 struct buffer_head *bh; in ext4_free_branches() local
1016 bh = ext4_sb_bread(inode->i_sb, nr, 0); in ext4_free_branches()
1022 if (IS_ERR(bh)) { in ext4_free_branches()
1023 ext4_error_inode_block(inode, nr, -PTR_ERR(bh), in ext4_free_branches()
1029 BUFFER_TRACE(bh, "free child branches"); in ext4_free_branches()
1030 ext4_free_branches(handle, inode, bh, in ext4_free_branches()
1031 (__le32 *) bh->b_data, in ext4_free_branches()
1032 (__le32 *) bh->b_data + addr_per_block, in ext4_free_branches()
1034 brelse(bh); in ext4_free_branches()
1160 BUFFER_TRACE(partial->bh, "get_write_access"); in ext4_ind_truncate()
1161 ext4_free_branches(handle, inode, partial->bh, in ext4_ind_truncate()
1168 ext4_free_branches(handle, inode, partial->bh, partial->p + 1, in ext4_ind_truncate()
1169 (__le32*)partial->bh->b_data+addr_per_block, in ext4_ind_truncate()
1171 BUFFER_TRACE(partial->bh, "call brelse"); in ext4_ind_truncate()
1172 brelse(partial->bh); in ext4_ind_truncate()
1274 BUFFER_TRACE(partial->bh, "get_write_access"); in ext4_ind_remove_space()
1275 ext4_free_branches(handle, inode, partial->bh, in ext4_ind_remove_space()
1286 ext4_free_branches(handle, inode, partial->bh, in ext4_ind_remove_space()
1288 (__le32 *)partial->bh->b_data+addr_per_block, in ext4_ind_remove_space()
1320 ext4_free_branches(handle, inode, partial2->bh, in ext4_ind_remove_space()
1321 (__le32 *)partial2->bh->b_data, in ext4_ind_remove_space()
1355 BUFFER_TRACE(partial->bh, "get_write_access"); in ext4_ind_remove_space()
1356 ext4_free_branches(handle, inode, partial->bh, in ext4_ind_remove_space()
1379 partial->bh->b_blocknr == partial2->bh->b_blocknr) { in ext4_ind_remove_space()
1384 ext4_free_branches(handle, inode, partial->bh, in ext4_ind_remove_space()
1399 ext4_free_branches(handle, inode, partial->bh, in ext4_ind_remove_space()
1401 (__le32 *)partial->bh->b_data+addr_per_block, in ext4_ind_remove_space()
1406 ext4_free_branches(handle, inode, partial2->bh, in ext4_ind_remove_space()
1407 (__le32 *)partial2->bh->b_data, in ext4_ind_remove_space()
1416 BUFFER_TRACE(p->bh, "call brelse"); in ext4_ind_remove_space()
1417 brelse(p->bh); in ext4_ind_remove_space()
1421 BUFFER_TRACE(p2->bh, "call brelse"); in ext4_ind_remove_space()
1422 brelse(p2->bh); in ext4_ind_remove_space()