Lines Matching refs:bh
33 struct buffer_head *bh; member
36 static inline void add_chain(Indirect *p, struct buffer_head *bh, __le32 *v) in add_chain() argument
39 p->bh = bh; in add_chain()
149 struct buffer_head *bh; in ext4_get_branch() local
158 bh = sb_getblk(sb, le32_to_cpu(p->key)); in ext4_get_branch()
159 if (unlikely(!bh)) { in ext4_get_branch()
164 if (!bh_uptodate_or_lock(bh)) { in ext4_get_branch()
165 if (bh_submit_read(bh) < 0) { in ext4_get_branch()
166 put_bh(bh); in ext4_get_branch()
170 if (ext4_check_indirect_blockref(inode, bh)) { in ext4_get_branch()
171 put_bh(bh); in ext4_get_branch()
176 add_chain(++p, bh, (__le32 *)bh->b_data + *++offsets); in ext4_get_branch()
212 __le32 *start = ind->bh ? (__le32 *) ind->bh->b_data : ei->i_data; in ext4_find_near()
222 if (ind->bh) in ext4_find_near()
223 return ind->bh->b_blocknr; in ext4_find_near()
327 struct buffer_head * bh; in ext4_alloc_branch() local
348 bh = branch[i].bh = sb_getblk(ar->inode->i_sb, new_blocks[i-1]); in ext4_alloc_branch()
349 if (unlikely(!bh)) { in ext4_alloc_branch()
353 lock_buffer(bh); in ext4_alloc_branch()
354 BUFFER_TRACE(bh, "call get_create_access"); in ext4_alloc_branch()
355 err = ext4_journal_get_create_access(handle, bh); in ext4_alloc_branch()
357 unlock_buffer(bh); in ext4_alloc_branch()
361 memset(bh->b_data, 0, bh->b_size); in ext4_alloc_branch()
362 p = branch[i].p = (__le32 *) bh->b_data + offsets[i]; in ext4_alloc_branch()
370 BUFFER_TRACE(bh, "marking uptodate"); in ext4_alloc_branch()
371 set_buffer_uptodate(bh); in ext4_alloc_branch()
372 unlock_buffer(bh); in ext4_alloc_branch()
374 BUFFER_TRACE(bh, "call ext4_handle_dirty_metadata"); in ext4_alloc_branch()
375 err = ext4_handle_dirty_metadata(handle, ar->inode, bh); in ext4_alloc_branch()
388 if (i > 0 && i != indirect_blks && branch[i].bh) in ext4_alloc_branch()
389 ext4_forget(handle, 1, ar->inode, branch[i].bh, in ext4_alloc_branch()
390 branch[i].bh->b_blocknr); in ext4_alloc_branch()
425 if (where->bh) { in ext4_splice_branch()
426 BUFFER_TRACE(where->bh, "get_write_access"); in ext4_splice_branch()
427 err = ext4_journal_get_write_access(handle, where->bh); in ext4_splice_branch()
447 if (where->bh) { in ext4_splice_branch()
457 BUFFER_TRACE(where->bh, "call ext4_handle_dirty_metadata"); in ext4_splice_branch()
458 err = ext4_handle_dirty_metadata(handle, ar->inode, where->bh); in ext4_splice_branch()
477 ext4_free_blocks(handle, ar->inode, where[i].bh, 0, 1, in ext4_splice_branch()
627 BUFFER_TRACE(partial->bh, "call brelse"); in ext4_ind_map_blocks()
628 brelse(partial->bh); in ext4_ind_map_blocks()
896 for (p = partial; (p > chain) && all_zeroes((__le32 *) p->bh->b_data, p->p); p--) in ext4_find_shared()
916 brelse(partial->bh); in ext4_find_shared()
935 struct buffer_head *bh, in ext4_clear_blocks() argument
958 if (bh) { in ext4_clear_blocks()
959 BUFFER_TRACE(bh, "call ext4_handle_dirty_metadata"); in ext4_clear_blocks()
960 err = ext4_handle_dirty_metadata(handle, inode, bh); in ext4_clear_blocks()
971 if (bh) { in ext4_clear_blocks()
972 BUFFER_TRACE(bh, "retaking write access"); in ext4_clear_blocks()
973 err = ext4_journal_get_write_access(handle, bh); in ext4_clear_blocks()
1104 struct buffer_head *bh; in ext4_free_branches() local
1122 bh = sb_bread(inode->i_sb, nr); in ext4_free_branches()
1128 if (!bh) { in ext4_free_branches()
1135 BUFFER_TRACE(bh, "free child branches"); in ext4_free_branches()
1136 ext4_free_branches(handle, inode, bh, in ext4_free_branches()
1137 (__le32 *) bh->b_data, in ext4_free_branches()
1138 (__le32 *) bh->b_data + addr_per_block, in ext4_free_branches()
1140 brelse(bh); in ext4_free_branches()
1266 BUFFER_TRACE(partial->bh, "get_write_access"); in ext4_ind_truncate()
1267 ext4_free_branches(handle, inode, partial->bh, in ext4_ind_truncate()
1274 ext4_free_branches(handle, inode, partial->bh, partial->p + 1, in ext4_ind_truncate()
1275 (__le32*)partial->bh->b_data+addr_per_block, in ext4_ind_truncate()
1277 BUFFER_TRACE(partial->bh, "call brelse"); in ext4_ind_truncate()
1278 brelse(partial->bh); in ext4_ind_truncate()
1376 BUFFER_TRACE(partial->bh, "get_write_access"); in ext4_ind_remove_space()
1377 ext4_free_branches(handle, inode, partial->bh, in ext4_ind_remove_space()
1388 ext4_free_branches(handle, inode, partial->bh, in ext4_ind_remove_space()
1390 (__le32 *)partial->bh->b_data+addr_per_block, in ext4_ind_remove_space()
1392 BUFFER_TRACE(partial->bh, "call brelse"); in ext4_ind_remove_space()
1393 brelse(partial->bh); in ext4_ind_remove_space()
1424 ext4_free_branches(handle, inode, partial2->bh, in ext4_ind_remove_space()
1425 (__le32 *)partial2->bh->b_data, in ext4_ind_remove_space()
1428 BUFFER_TRACE(partial2->bh, "call brelse"); in ext4_ind_remove_space()
1429 brelse(partial2->bh); in ext4_ind_remove_space()
1461 BUFFER_TRACE(partial->bh, "get_write_access"); in ext4_ind_remove_space()
1462 ext4_free_branches(handle, inode, partial->bh, in ext4_ind_remove_space()
1485 partial->bh->b_blocknr == partial2->bh->b_blocknr) { in ext4_ind_remove_space()
1490 ext4_free_branches(handle, inode, partial->bh, in ext4_ind_remove_space()
1494 BUFFER_TRACE(partial->bh, "call brelse"); in ext4_ind_remove_space()
1495 brelse(partial->bh); in ext4_ind_remove_space()
1496 BUFFER_TRACE(partial2->bh, "call brelse"); in ext4_ind_remove_space()
1497 brelse(partial2->bh); in ext4_ind_remove_space()
1509 ext4_free_branches(handle, inode, partial->bh, in ext4_ind_remove_space()
1511 (__le32 *)partial->bh->b_data+addr_per_block, in ext4_ind_remove_space()
1513 BUFFER_TRACE(partial->bh, "call brelse"); in ext4_ind_remove_space()
1514 brelse(partial->bh); in ext4_ind_remove_space()
1518 ext4_free_branches(handle, inode, partial2->bh, in ext4_ind_remove_space()
1519 (__le32 *)partial2->bh->b_data, in ext4_ind_remove_space()
1522 BUFFER_TRACE(partial2->bh, "call brelse"); in ext4_ind_remove_space()
1523 brelse(partial2->bh); in ext4_ind_remove_space()