Lines Matching refs:bh
32 struct buffer_head *bh; member
35 static inline void add_chain(Indirect *p, struct buffer_head *bh, __le32 *v) in add_chain() argument
38 p->bh = bh; in add_chain()
148 struct buffer_head *bh; in ext4_get_branch() local
157 bh = sb_getblk(sb, le32_to_cpu(p->key)); in ext4_get_branch()
158 if (unlikely(!bh)) { in ext4_get_branch()
163 if (!bh_uptodate_or_lock(bh)) { in ext4_get_branch()
164 if (bh_submit_read(bh) < 0) { in ext4_get_branch()
165 put_bh(bh); in ext4_get_branch()
169 if (ext4_check_indirect_blockref(inode, bh)) { in ext4_get_branch()
170 put_bh(bh); in ext4_get_branch()
175 add_chain(++p, bh, (__le32 *)bh->b_data + *++offsets); in ext4_get_branch()
211 __le32 *start = ind->bh ? (__le32 *) ind->bh->b_data : ei->i_data; in ext4_find_near()
221 if (ind->bh) in ext4_find_near()
222 return ind->bh->b_blocknr; in ext4_find_near()
326 struct buffer_head * bh; in ext4_alloc_branch() local
347 bh = branch[i].bh = sb_getblk(ar->inode->i_sb, new_blocks[i-1]); in ext4_alloc_branch()
348 if (unlikely(!bh)) { in ext4_alloc_branch()
352 lock_buffer(bh); in ext4_alloc_branch()
353 BUFFER_TRACE(bh, "call get_create_access"); in ext4_alloc_branch()
354 err = ext4_journal_get_create_access(handle, bh); in ext4_alloc_branch()
356 unlock_buffer(bh); in ext4_alloc_branch()
360 memset(bh->b_data, 0, bh->b_size); in ext4_alloc_branch()
361 p = branch[i].p = (__le32 *) bh->b_data + offsets[i]; in ext4_alloc_branch()
369 BUFFER_TRACE(bh, "marking uptodate"); in ext4_alloc_branch()
370 set_buffer_uptodate(bh); in ext4_alloc_branch()
371 unlock_buffer(bh); in ext4_alloc_branch()
373 BUFFER_TRACE(bh, "call ext4_handle_dirty_metadata"); in ext4_alloc_branch()
374 err = ext4_handle_dirty_metadata(handle, ar->inode, bh); in ext4_alloc_branch()
387 if (i > 0 && i != indirect_blks && branch[i].bh) in ext4_alloc_branch()
388 ext4_forget(handle, 1, ar->inode, branch[i].bh, in ext4_alloc_branch()
389 branch[i].bh->b_blocknr); in ext4_alloc_branch()
424 if (where->bh) { in ext4_splice_branch()
425 BUFFER_TRACE(where->bh, "get_write_access"); in ext4_splice_branch()
426 err = ext4_journal_get_write_access(handle, where->bh); in ext4_splice_branch()
446 if (where->bh) { in ext4_splice_branch()
456 BUFFER_TRACE(where->bh, "call ext4_handle_dirty_metadata"); in ext4_splice_branch()
457 err = ext4_handle_dirty_metadata(handle, ar->inode, where->bh); in ext4_splice_branch()
476 ext4_free_blocks(handle, ar->inode, where[i].bh, 0, 1, in ext4_splice_branch()
625 BUFFER_TRACE(partial->bh, "call brelse"); in ext4_ind_map_blocks()
626 brelse(partial->bh); in ext4_ind_map_blocks()
894 for (p = partial; (p > chain) && all_zeroes((__le32 *) p->bh->b_data, p->p); p--) in ext4_find_shared()
914 brelse(partial->bh); in ext4_find_shared()
933 struct buffer_head *bh, in ext4_clear_blocks() argument
956 if (bh) { in ext4_clear_blocks()
957 BUFFER_TRACE(bh, "call ext4_handle_dirty_metadata"); in ext4_clear_blocks()
958 err = ext4_handle_dirty_metadata(handle, inode, bh); in ext4_clear_blocks()
969 if (bh) { in ext4_clear_blocks()
970 BUFFER_TRACE(bh, "retaking write access"); in ext4_clear_blocks()
971 err = ext4_journal_get_write_access(handle, bh); in ext4_clear_blocks()
1102 struct buffer_head *bh; in ext4_free_branches() local
1120 bh = sb_bread(inode->i_sb, nr); in ext4_free_branches()
1126 if (!bh) { in ext4_free_branches()
1133 BUFFER_TRACE(bh, "free child branches"); in ext4_free_branches()
1134 ext4_free_branches(handle, inode, bh, in ext4_free_branches()
1135 (__le32 *) bh->b_data, in ext4_free_branches()
1136 (__le32 *) bh->b_data + addr_per_block, in ext4_free_branches()
1138 brelse(bh); in ext4_free_branches()
1264 BUFFER_TRACE(partial->bh, "get_write_access"); in ext4_ind_truncate()
1265 ext4_free_branches(handle, inode, partial->bh, in ext4_ind_truncate()
1272 ext4_free_branches(handle, inode, partial->bh, partial->p + 1, in ext4_ind_truncate()
1273 (__le32*)partial->bh->b_data+addr_per_block, in ext4_ind_truncate()
1275 BUFFER_TRACE(partial->bh, "call brelse"); in ext4_ind_truncate()
1276 brelse(partial->bh); in ext4_ind_truncate()
1374 BUFFER_TRACE(partial->bh, "get_write_access"); in ext4_ind_remove_space()
1375 ext4_free_branches(handle, inode, partial->bh, in ext4_ind_remove_space()
1386 ext4_free_branches(handle, inode, partial->bh, in ext4_ind_remove_space()
1388 (__le32 *)partial->bh->b_data+addr_per_block, in ext4_ind_remove_space()
1390 BUFFER_TRACE(partial->bh, "call brelse"); in ext4_ind_remove_space()
1391 brelse(partial->bh); in ext4_ind_remove_space()
1422 ext4_free_branches(handle, inode, partial2->bh, in ext4_ind_remove_space()
1423 (__le32 *)partial2->bh->b_data, in ext4_ind_remove_space()
1426 BUFFER_TRACE(partial2->bh, "call brelse"); in ext4_ind_remove_space()
1427 brelse(partial2->bh); in ext4_ind_remove_space()
1459 BUFFER_TRACE(partial->bh, "get_write_access"); in ext4_ind_remove_space()
1460 ext4_free_branches(handle, inode, partial->bh, in ext4_ind_remove_space()
1483 partial->bh->b_blocknr == partial2->bh->b_blocknr) { in ext4_ind_remove_space()
1488 ext4_free_branches(handle, inode, partial->bh, in ext4_ind_remove_space()
1492 BUFFER_TRACE(partial->bh, "call brelse"); in ext4_ind_remove_space()
1493 brelse(partial->bh); in ext4_ind_remove_space()
1494 BUFFER_TRACE(partial2->bh, "call brelse"); in ext4_ind_remove_space()
1495 brelse(partial2->bh); in ext4_ind_remove_space()
1507 ext4_free_branches(handle, inode, partial->bh, in ext4_ind_remove_space()
1509 (__le32 *)partial->bh->b_data+addr_per_block, in ext4_ind_remove_space()
1511 BUFFER_TRACE(partial->bh, "call brelse"); in ext4_ind_remove_space()
1512 brelse(partial->bh); in ext4_ind_remove_space()
1516 ext4_free_branches(handle, inode, partial2->bh, in ext4_ind_remove_space()
1517 (__le32 *)partial2->bh->b_data, in ext4_ind_remove_space()
1520 BUFFER_TRACE(partial2->bh, "call brelse"); in ext4_ind_remove_space()
1521 brelse(partial2->bh); in ext4_ind_remove_space()