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()
487 (unsigned long long)bh->b_blocknr, 7, in ocfs2_check_dir_trailer()
491 if (le64_to_cpu(trailer->db_blkno) != bh->b_blocknr) { in ocfs2_check_dir_trailer()
496 (unsigned long long)bh->b_blocknr, in ocfs2_check_dir_trailer()
507 (unsigned long long)bh->b_blocknr, in ocfs2_check_dir_trailer()
523 struct buffer_head **bh, int flags) in ocfs2_read_dir_block() argument
526 struct buffer_head *tmp = *bh; in ocfs2_read_dir_block()
539 if (!*bh) in ocfs2_read_dir_block()
547 if (!*bh) in ocfs2_read_dir_block()
548 *bh = tmp; in ocfs2_read_dir_block()
560 struct buffer_head **bh) in ocfs2_read_dir_block_direct() argument
563 struct buffer_head *tmp = *bh; in ocfs2_read_dir_block_direct()
575 if (!*bh) in ocfs2_read_dir_block_direct()
582 if (!ret && !*bh) in ocfs2_read_dir_block_direct()
583 *bh = tmp; in ocfs2_read_dir_block_direct()
589 struct buffer_head *bh) in ocfs2_validate_dx_root() argument
594 BUG_ON(!buffer_uptodate(bh)); in ocfs2_validate_dx_root()
596 dx_root = (struct ocfs2_dx_root_block *) bh->b_data; in ocfs2_validate_dx_root()
598 ret = ocfs2_validate_meta_ecc(sb, bh->b_data, &dx_root->dr_check); in ocfs2_validate_dx_root()
602 (unsigned long long)bh->b_blocknr); in ocfs2_validate_dx_root()
635 struct buffer_head *bh) in ocfs2_validate_dx_leaf() argument
638 struct ocfs2_dx_leaf *dx_leaf = (struct ocfs2_dx_leaf *)bh->b_data; in ocfs2_validate_dx_leaf()
640 BUG_ON(!buffer_uptodate(bh)); in ocfs2_validate_dx_leaf()
642 ret = ocfs2_validate_meta_ecc(sb, bh->b_data, &dx_leaf->dl_check); in ocfs2_validate_dx_leaf()
646 (unsigned long long)bh->b_blocknr); in ocfs2_validate_dx_leaf()
698 struct buffer_head *bh, *ret = NULL; in ocfs2_find_entry_el() local
736 bh = NULL; in ocfs2_find_entry_el()
737 err = ocfs2_read_dir_block(dir, b++, &bh, in ocfs2_find_entry_el()
739 bh_use[ra_max] = bh; in ocfs2_find_entry_el()
742 if ((bh = bh_use[ra_ptr++]) == NULL) in ocfs2_find_entry_el()
744 if (ocfs2_read_dir_block(dir, block, &bh, 0)) { in ocfs2_find_entry_el()
753 i = ocfs2_search_dirblock(bh, dir, name, namelen, in ocfs2_find_entry_el()
755 bh->b_data, sb->s_blocksize, in ocfs2_find_entry_el()
759 ret = bh; in ocfs2_find_entry_el()
762 brelse(bh); in ocfs2_find_entry_el()
1089 struct buffer_head *bh; in ocfs2_find_entry() local
1101 bh = ocfs2_find_entry_id(name, namelen, dir, &res_dir); in ocfs2_find_entry()
1103 bh = ocfs2_find_entry_el(name, namelen, dir, &res_dir); in ocfs2_find_entry()
1105 if (bh == NULL) in ocfs2_find_entry()
1108 lookup->dl_leaf_bh = bh; in ocfs2_find_entry()
1156 struct buffer_head *bh, char *first_de, in __ocfs2_delete_entry() argument
1170 if (!ocfs2_check_dir_entry(dir, de, bh, i)) { in __ocfs2_delete_entry()
1176 status = access(handle, INODE_CACHE(dir), bh, in __ocfs2_delete_entry()
1188 ocfs2_journal_dirty(handle, bh); in __ocfs2_delete_entry()
1377 struct buffer_head *bh) in ocfs2_delete_entry_id() argument
1393 ret = __ocfs2_delete_entry(handle, dir, de_del, bh, data->id_data, in ocfs2_delete_entry_id()
1404 struct buffer_head *bh) in ocfs2_delete_entry_el() argument
1406 return __ocfs2_delete_entry(handle, dir, de_del, bh, bh->b_data, in ocfs2_delete_entry_el()
1407 bh->b_size); in ocfs2_delete_entry_el()
1555 struct buffer_head *bh; in ocfs2_remove_block_from_free_list() local
1560 bh = lookup->dl_dx_root_bh; in ocfs2_remove_block_from_free_list()
1561 dx_root = (struct ocfs2_dx_root_block *)bh->b_data; in ocfs2_remove_block_from_free_list()
1564 bh = lookup->dl_prev_leaf_bh; in ocfs2_remove_block_from_free_list()
1565 prev = ocfs2_trailer_from_bh(bh, dir->i_sb); in ocfs2_remove_block_from_free_list()
1572 ocfs2_journal_dirty(handle, bh); in ocfs2_remove_block_from_free_list()
1629 struct buffer_head *bh; in __ocfs2_add_entry() local
1640 bh = lookup->dl_dx_root_bh; in __ocfs2_add_entry()
1642 INODE_CACHE(dir), bh, in __ocfs2_add_entry()
1645 bh = lookup->dl_prev_leaf_bh; in __ocfs2_add_entry()
1647 INODE_CACHE(dir), bh, in __ocfs2_add_entry()
1842 struct buffer_head * bh, * tmp; in ocfs2_dir_foreach_blk_el() local
1848 bh = NULL; in ocfs2_dir_foreach_blk_el()
1854 if (ocfs2_read_dir_block(inode, blk, &bh, 0)) { in ocfs2_dir_foreach_blk_el()
1884 de = (struct ocfs2_dir_entry *) (bh->b_data + i); in ocfs2_dir_foreach_blk_el()
1904 de = (struct ocfs2_dir_entry *) (bh->b_data + offset); in ocfs2_dir_foreach_blk_el()
1905 if (!ocfs2_check_dir_entry(inode, de, bh, offset)) { in ocfs2_dir_foreach_blk_el()
1909 brelse(bh); in ocfs2_dir_foreach_blk_el()
1921 brelse(bh); in ocfs2_dir_foreach_blk_el()
1930 brelse(bh); in ocfs2_dir_foreach_blk_el()
1931 bh = NULL; in ocfs2_dir_foreach_blk_el()
2419 struct buffer_head *bh; in ocfs2_dx_dir_format_cluster() local
2422 bh = sb_getblk(osb->sb, start_blk + i); in ocfs2_dx_dir_format_cluster()
2423 if (bh == NULL) { in ocfs2_dx_dir_format_cluster()
2427 dx_leaves[i] = bh; in ocfs2_dx_dir_format_cluster()
2429 ocfs2_set_new_buffer_uptodate(INODE_CACHE(dir), bh); in ocfs2_dx_dir_format_cluster()
2431 ret = ocfs2_journal_access_dl(handle, INODE_CACHE(dir), bh, in ocfs2_dx_dir_format_cluster()
2438 dx_leaf = (struct ocfs2_dx_leaf *) bh->b_data; in ocfs2_dx_dir_format_cluster()
2443 dx_leaf->dl_blkno = cpu_to_le64(bh->b_blocknr); in ocfs2_dx_dir_format_cluster()
2449 (unsigned long long)bh->b_blocknr, in ocfs2_dx_dir_format_cluster()
2452 ocfs2_journal_dirty(handle, bh); in ocfs2_dx_dir_format_cluster()
3448 struct buffer_head *bh = NULL; in ocfs2_find_dir_space_el() local
3455 status = ocfs2_read_dir_block(dir, 0, &bh, 0); in ocfs2_find_dir_space_el()
3461 de = (struct ocfs2_dir_entry *) bh->b_data; in ocfs2_find_dir_space_el()
3463 if ((char *)de >= sb->s_blocksize + bh->b_data) { in ocfs2_find_dir_space_el()
3464 brelse(bh); in ocfs2_find_dir_space_el()
3465 bh = NULL; in ocfs2_find_dir_space_el()
3477 &bh, 0); in ocfs2_find_dir_space_el()
3482 de = (struct ocfs2_dir_entry *) bh->b_data; in ocfs2_find_dir_space_el()
3484 if (!ocfs2_check_dir_entry(dir, de, bh, offset)) { in ocfs2_find_dir_space_el()
3500 *ret_de_bh = bh; in ocfs2_find_dir_space_el()
3511 brelse(bh); in ocfs2_find_dir_space_el()
4284 struct buffer_head *bh = NULL; in ocfs2_prepare_dir_for_insert() local
4319 namelen, &bh, &blocks_wanted); in ocfs2_prepare_dir_for_insert()
4321 ret = ocfs2_find_dir_space_el(dir, name, namelen, &bh); in ocfs2_prepare_dir_for_insert()
4332 BUG_ON(bh); in ocfs2_prepare_dir_for_insert()
4335 lookup, &bh); in ocfs2_prepare_dir_for_insert()
4342 BUG_ON(!bh); in ocfs2_prepare_dir_for_insert()
4345 lookup->dl_leaf_bh = bh; in ocfs2_prepare_dir_for_insert()
4346 bh = NULL; in ocfs2_prepare_dir_for_insert()
4348 brelse(bh); in ocfs2_prepare_dir_for_insert()