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
166 bh = sb_getblk(sb, key); in ext4_get_branch()
167 if (unlikely(!bh)) { in ext4_get_branch()
172 if (!bh_uptodate_or_lock(bh)) { in ext4_get_branch()
173 if (ext4_read_bh(bh, 0, NULL) < 0) { in ext4_get_branch()
174 put_bh(bh); in ext4_get_branch()
178 if (ext4_check_indirect_blockref(inode, bh)) { in ext4_get_branch()
179 put_bh(bh); in ext4_get_branch()
184 add_chain(++p, bh, (__le32 *)bh->b_data + *++offsets); in ext4_get_branch()
220 __le32 *start = ind->bh ? (__le32 *) ind->bh->b_data : ei->i_data; in ext4_find_near()
230 if (ind->bh) in ext4_find_near()
231 return ind->bh->b_blocknr; in ext4_find_near()
333 struct buffer_head * bh; in ext4_alloc_branch() local
347 branch[i+1].bh = NULL; in ext4_alloc_branch()
357 bh = branch[i].bh = sb_getblk(ar->inode->i_sb, new_blocks[i-1]); in ext4_alloc_branch()
358 if (unlikely(!bh)) { in ext4_alloc_branch()
362 lock_buffer(bh); in ext4_alloc_branch()
363 BUFFER_TRACE(bh, "call get_create_access"); in ext4_alloc_branch()
365 bh, EXT4_JTR_NONE); in ext4_alloc_branch()
367 unlock_buffer(bh); in ext4_alloc_branch()
371 memset(bh->b_data, 0, bh->b_size); in ext4_alloc_branch()
372 p = branch[i].p = (__le32 *) bh->b_data + offsets[i]; in ext4_alloc_branch()
380 BUFFER_TRACE(bh, "marking uptodate"); in ext4_alloc_branch()
381 set_buffer_uptodate(bh); in ext4_alloc_branch()
382 unlock_buffer(bh); in ext4_alloc_branch()
384 BUFFER_TRACE(bh, "call ext4_handle_dirty_metadata"); in ext4_alloc_branch()
385 err = ext4_handle_dirty_metadata(handle, ar->inode, bh); in ext4_alloc_branch()
407 ext4_free_blocks(handle, ar->inode, branch[i+1].bh, in ext4_alloc_branch()
409 branch[i+1].bh ? EXT4_FREE_BLOCKS_FORGET : 0); in ext4_alloc_branch()
438 if (where->bh) { in ext4_splice_branch()
439 BUFFER_TRACE(where->bh, "get_write_access"); in ext4_splice_branch()
441 where->bh, EXT4_JTR_NONE); in ext4_splice_branch()
461 if (where->bh) { in ext4_splice_branch()
471 BUFFER_TRACE(where->bh, "call ext4_handle_dirty_metadata"); in ext4_splice_branch()
472 err = ext4_handle_dirty_metadata(handle, ar->inode, where->bh); in ext4_splice_branch()
493 ext4_free_blocks(handle, ar->inode, where[i].bh, 0, 1, in ext4_splice_branch()
673 BUFFER_TRACE(partial->bh, "call brelse"); in ext4_ind_map_blocks()
674 brelse(partial->bh); in ext4_ind_map_blocks()
697 struct buffer_head *bh, int *dropped) in ext4_ind_trunc_restart_fn() argument
701 if (bh) { in ext4_ind_trunc_restart_fn()
702 BUFFER_TRACE(bh, "call ext4_handle_dirty_metadata"); in ext4_ind_trunc_restart_fn()
703 err = ext4_handle_dirty_metadata(handle, inode, bh); in ext4_ind_trunc_restart_fn()
733 struct buffer_head *bh, in ext4_ind_truncate_ensure_credits() argument
741 ext4_ind_trunc_restart_fn(handle, inode, bh, &dropped)); in ext4_ind_truncate_ensure_credits()
746 if (bh) { in ext4_ind_truncate_ensure_credits()
747 BUFFER_TRACE(bh, "retaking write access"); in ext4_ind_truncate_ensure_credits()
748 ret = ext4_journal_get_write_access(handle, inode->i_sb, bh, in ext4_ind_truncate_ensure_credits()
826 for (p = partial; (p > chain) && all_zeroes((__le32 *) p->bh->b_data, p->p); p--) in ext4_find_shared()
846 brelse(partial->bh); in ext4_find_shared()
865 struct buffer_head *bh, in ext4_clear_blocks() argument
887 err = ext4_ind_truncate_ensure_credits(handle, inode, bh, in ext4_clear_blocks()
1018 struct buffer_head *bh; in ext4_free_branches() local
1035 bh = ext4_sb_bread(inode->i_sb, nr, 0); in ext4_free_branches()
1041 if (IS_ERR(bh)) { in ext4_free_branches()
1042 ext4_error_inode_block(inode, nr, -PTR_ERR(bh), in ext4_free_branches()
1048 BUFFER_TRACE(bh, "free child branches"); in ext4_free_branches()
1049 ext4_free_branches(handle, inode, bh, in ext4_free_branches()
1050 (__le32 *) bh->b_data, in ext4_free_branches()
1051 (__le32 *) bh->b_data + addr_per_block, in ext4_free_branches()
1053 brelse(bh); in ext4_free_branches()
1180 BUFFER_TRACE(partial->bh, "get_write_access"); in ext4_ind_truncate()
1181 ext4_free_branches(handle, inode, partial->bh, in ext4_ind_truncate()
1188 ext4_free_branches(handle, inode, partial->bh, partial->p + 1, in ext4_ind_truncate()
1189 (__le32*)partial->bh->b_data+addr_per_block, in ext4_ind_truncate()
1191 BUFFER_TRACE(partial->bh, "call brelse"); in ext4_ind_truncate()
1192 brelse(partial->bh); in ext4_ind_truncate()
1294 BUFFER_TRACE(partial->bh, "get_write_access"); in ext4_ind_remove_space()
1295 ext4_free_branches(handle, inode, partial->bh, in ext4_ind_remove_space()
1306 ext4_free_branches(handle, inode, partial->bh, in ext4_ind_remove_space()
1308 (__le32 *)partial->bh->b_data+addr_per_block, in ext4_ind_remove_space()
1340 ext4_free_branches(handle, inode, partial2->bh, in ext4_ind_remove_space()
1341 (__le32 *)partial2->bh->b_data, in ext4_ind_remove_space()
1375 BUFFER_TRACE(partial->bh, "get_write_access"); in ext4_ind_remove_space()
1376 ext4_free_branches(handle, inode, partial->bh, in ext4_ind_remove_space()
1399 partial->bh->b_blocknr == partial2->bh->b_blocknr) { in ext4_ind_remove_space()
1404 ext4_free_branches(handle, inode, partial->bh, in ext4_ind_remove_space()
1419 ext4_free_branches(handle, inode, partial->bh, in ext4_ind_remove_space()
1421 (__le32 *)partial->bh->b_data+addr_per_block, in ext4_ind_remove_space()
1426 ext4_free_branches(handle, inode, partial2->bh, in ext4_ind_remove_space()
1427 (__le32 *)partial2->bh->b_data, in ext4_ind_remove_space()
1436 BUFFER_TRACE(p->bh, "call brelse"); in ext4_ind_remove_space()
1437 brelse(p->bh); in ext4_ind_remove_space()
1441 BUFFER_TRACE(p2->bh, "call brelse"); in ext4_ind_remove_space()
1442 brelse(p2->bh); in ext4_ind_remove_space()