Lines Matching refs:bh

153 				   struct buffer_head *bh, u16 rec_len)  in ocfs2_init_dir_trailer()  argument
157 trailer = ocfs2_trailer_from_bh(bh, inode->i_sb); in ocfs2_init_dir_trailer()
162 trailer->db_blkno = cpu_to_le64(bh->b_blocknr); in ocfs2_init_dir_trailer()
318 struct buffer_head * bh, in ocfs2_check_dir_entry() argument
331 ((char *) de - bh->b_data) + rlen > dir->i_sb->s_blocksize)) in ocfs2_check_dir_entry()
358 static inline int ocfs2_search_dirblock(struct buffer_head *bh, in ocfs2_search_dirblock() argument
383 if (!ocfs2_check_dir_entry(dir, de, bh, offset)) { in ocfs2_search_dirblock()
438 struct buffer_head *bh) in ocfs2_validate_dir_block() argument
442 ocfs2_trailer_from_bh(bh, sb); in ocfs2_validate_dir_block()
449 trace_ocfs2_validate_dir_block((unsigned long long)bh->b_blocknr); in ocfs2_validate_dir_block()
451 BUG_ON(!buffer_uptodate(bh)); in ocfs2_validate_dir_block()
462 rc = ocfs2_validate_meta_ecc(sb, bh->b_data, &trailer->db_check); in ocfs2_validate_dir_block()
465 (unsigned long long)bh->b_blocknr); in ocfs2_validate_dir_block()
476 static int ocfs2_check_dir_trailer(struct inode *dir, struct buffer_head *bh) in ocfs2_check_dir_trailer() argument
481 trailer = ocfs2_trailer_from_bh(bh, dir->i_sb); in ocfs2_check_dir_trailer()
485 (unsigned long long)bh->b_blocknr, 7, in ocfs2_check_dir_trailer()
489 if (le64_to_cpu(trailer->db_blkno) != bh->b_blocknr) { in ocfs2_check_dir_trailer()
492 (unsigned long long)bh->b_blocknr, in ocfs2_check_dir_trailer()
500 (unsigned long long)bh->b_blocknr, in ocfs2_check_dir_trailer()
516 struct buffer_head **bh, int flags) in ocfs2_read_dir_block() argument
519 struct buffer_head *tmp = *bh; in ocfs2_read_dir_block()
532 if (!*bh) in ocfs2_read_dir_block()
540 if (!*bh) in ocfs2_read_dir_block()
541 *bh = tmp; in ocfs2_read_dir_block()
553 struct buffer_head **bh) in ocfs2_read_dir_block_direct() argument
556 struct buffer_head *tmp = *bh; in ocfs2_read_dir_block_direct()
568 if (!*bh) in ocfs2_read_dir_block_direct()
575 if (!ret && !*bh) in ocfs2_read_dir_block_direct()
576 *bh = tmp; in ocfs2_read_dir_block_direct()
582 struct buffer_head *bh) in ocfs2_validate_dx_root() argument
587 BUG_ON(!buffer_uptodate(bh)); in ocfs2_validate_dx_root()
589 dx_root = (struct ocfs2_dx_root_block *) bh->b_data; in ocfs2_validate_dx_root()
591 ret = ocfs2_validate_meta_ecc(sb, bh->b_data, &dx_root->dr_check); in ocfs2_validate_dx_root()
595 (unsigned long long)bh->b_blocknr); in ocfs2_validate_dx_root()
627 struct buffer_head *bh) in ocfs2_validate_dx_leaf() argument
630 struct ocfs2_dx_leaf *dx_leaf = (struct ocfs2_dx_leaf *)bh->b_data; in ocfs2_validate_dx_leaf()
632 BUG_ON(!buffer_uptodate(bh)); in ocfs2_validate_dx_leaf()
634 ret = ocfs2_validate_meta_ecc(sb, bh->b_data, &dx_leaf->dl_check); in ocfs2_validate_dx_leaf()
638 (unsigned long long)bh->b_blocknr); in ocfs2_validate_dx_leaf()
689 struct buffer_head *bh, *ret = NULL; in ocfs2_find_entry_el() local
727 bh = NULL; in ocfs2_find_entry_el()
728 err = ocfs2_read_dir_block(dir, b++, &bh, in ocfs2_find_entry_el()
730 bh_use[ra_max] = bh; in ocfs2_find_entry_el()
733 if ((bh = bh_use[ra_ptr++]) == NULL) in ocfs2_find_entry_el()
735 if (ocfs2_read_dir_block(dir, block, &bh, 0)) { in ocfs2_find_entry_el()
744 i = ocfs2_search_dirblock(bh, dir, name, namelen, in ocfs2_find_entry_el()
746 bh->b_data, sb->s_blocksize, in ocfs2_find_entry_el()
750 ret = bh; in ocfs2_find_entry_el()
753 brelse(bh); in ocfs2_find_entry_el()
1079 struct buffer_head *bh; in ocfs2_find_entry() local
1091 bh = ocfs2_find_entry_id(name, namelen, dir, &res_dir); in ocfs2_find_entry()
1093 bh = ocfs2_find_entry_el(name, namelen, dir, &res_dir); in ocfs2_find_entry()
1095 if (bh == NULL) in ocfs2_find_entry()
1098 lookup->dl_leaf_bh = bh; in ocfs2_find_entry()
1146 struct buffer_head *bh, char *first_de, in __ocfs2_delete_entry() argument
1160 if (!ocfs2_check_dir_entry(dir, de, bh, i)) { in __ocfs2_delete_entry()
1166 status = access(handle, INODE_CACHE(dir), bh, in __ocfs2_delete_entry()
1178 ocfs2_journal_dirty(handle, bh); in __ocfs2_delete_entry()
1367 struct buffer_head *bh) in ocfs2_delete_entry_id() argument
1383 ret = __ocfs2_delete_entry(handle, dir, de_del, bh, data->id_data, in ocfs2_delete_entry_id()
1394 struct buffer_head *bh) in ocfs2_delete_entry_el() argument
1396 return __ocfs2_delete_entry(handle, dir, de_del, bh, bh->b_data, in ocfs2_delete_entry_el()
1397 bh->b_size); in ocfs2_delete_entry_el()
1545 struct buffer_head *bh; in ocfs2_remove_block_from_free_list() local
1550 bh = lookup->dl_dx_root_bh; in ocfs2_remove_block_from_free_list()
1551 dx_root = (struct ocfs2_dx_root_block *)bh->b_data; in ocfs2_remove_block_from_free_list()
1554 bh = lookup->dl_prev_leaf_bh; in ocfs2_remove_block_from_free_list()
1555 prev = ocfs2_trailer_from_bh(bh, dir->i_sb); in ocfs2_remove_block_from_free_list()
1562 ocfs2_journal_dirty(handle, bh); in ocfs2_remove_block_from_free_list()
1619 struct buffer_head *bh; in __ocfs2_add_entry() local
1630 bh = lookup->dl_dx_root_bh; in __ocfs2_add_entry()
1632 INODE_CACHE(dir), bh, in __ocfs2_add_entry()
1635 bh = lookup->dl_prev_leaf_bh; in __ocfs2_add_entry()
1637 INODE_CACHE(dir), bh, in __ocfs2_add_entry()
1832 struct buffer_head * bh, * tmp; in ocfs2_dir_foreach_blk_el() local
1838 bh = NULL; in ocfs2_dir_foreach_blk_el()
1844 if (ocfs2_read_dir_block(inode, blk, &bh, 0)) { in ocfs2_dir_foreach_blk_el()
1874 de = (struct ocfs2_dir_entry *) (bh->b_data + i); in ocfs2_dir_foreach_blk_el()
1894 de = (struct ocfs2_dir_entry *) (bh->b_data + offset); in ocfs2_dir_foreach_blk_el()
1895 if (!ocfs2_check_dir_entry(inode, de, bh, offset)) { in ocfs2_dir_foreach_blk_el()
1899 brelse(bh); in ocfs2_dir_foreach_blk_el()
1911 brelse(bh); in ocfs2_dir_foreach_blk_el()
1920 brelse(bh); in ocfs2_dir_foreach_blk_el()
1921 bh = NULL; in ocfs2_dir_foreach_blk_el()
2409 struct buffer_head *bh; in ocfs2_dx_dir_format_cluster() local
2412 bh = sb_getblk(osb->sb, start_blk + i); in ocfs2_dx_dir_format_cluster()
2413 if (bh == NULL) { in ocfs2_dx_dir_format_cluster()
2417 dx_leaves[i] = bh; in ocfs2_dx_dir_format_cluster()
2419 ocfs2_set_new_buffer_uptodate(INODE_CACHE(dir), bh); in ocfs2_dx_dir_format_cluster()
2421 ret = ocfs2_journal_access_dl(handle, INODE_CACHE(dir), bh, in ocfs2_dx_dir_format_cluster()
2428 dx_leaf = (struct ocfs2_dx_leaf *) bh->b_data; in ocfs2_dx_dir_format_cluster()
2433 dx_leaf->dl_blkno = cpu_to_le64(bh->b_blocknr); in ocfs2_dx_dir_format_cluster()
2439 (unsigned long long)bh->b_blocknr, in ocfs2_dx_dir_format_cluster()
2442 ocfs2_journal_dirty(handle, bh); in ocfs2_dx_dir_format_cluster()
3438 struct buffer_head *bh = NULL; in ocfs2_find_dir_space_el() local
3445 status = ocfs2_read_dir_block(dir, 0, &bh, 0); in ocfs2_find_dir_space_el()
3451 de = (struct ocfs2_dir_entry *) bh->b_data; in ocfs2_find_dir_space_el()
3453 if ((char *)de >= sb->s_blocksize + bh->b_data) { in ocfs2_find_dir_space_el()
3454 brelse(bh); in ocfs2_find_dir_space_el()
3455 bh = NULL; in ocfs2_find_dir_space_el()
3467 &bh, 0); in ocfs2_find_dir_space_el()
3472 de = (struct ocfs2_dir_entry *) bh->b_data; in ocfs2_find_dir_space_el()
3474 if (!ocfs2_check_dir_entry(dir, de, bh, offset)) { in ocfs2_find_dir_space_el()
3490 *ret_de_bh = bh; in ocfs2_find_dir_space_el()
3501 brelse(bh); in ocfs2_find_dir_space_el()
4271 struct buffer_head *bh = NULL; in ocfs2_prepare_dir_for_insert() local
4306 namelen, &bh, &blocks_wanted); in ocfs2_prepare_dir_for_insert()
4308 ret = ocfs2_find_dir_space_el(dir, name, namelen, &bh); in ocfs2_prepare_dir_for_insert()
4319 BUG_ON(bh); in ocfs2_prepare_dir_for_insert()
4322 lookup, &bh); in ocfs2_prepare_dir_for_insert()
4329 BUG_ON(!bh); in ocfs2_prepare_dir_for_insert()
4332 lookup->dl_leaf_bh = bh; in ocfs2_prepare_dir_for_insert()
4333 bh = NULL; in ocfs2_prepare_dir_for_insert()
4335 brelse(bh); in ocfs2_prepare_dir_for_insert()