Lines Matching refs:osb

71 	struct ocfs2_super *osb = OCFS2_SB(dir->i_sb);  in ocfs2_supports_dir_trailer()  local
76 return ocfs2_meta_ecc(osb) || ocfs2_dir_indexed(dir); in ocfs2_supports_dir_trailer()
89 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); in ocfs2_new_dir_wants_trailer() local
91 return ocfs2_meta_ecc(osb) || in ocfs2_new_dir_wants_trailer()
92 ocfs2_supports_indexed_dirs(osb); in ocfs2_new_dir_wants_trailer()
254 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); in ocfs2_dx_dir_name_hash() local
278 memcpy(buf, osb->osb_dx_seed, sizeof(buf)); in ocfs2_dx_dir_name_hash()
836 static inline unsigned int __ocfs2_dx_dir_hash_idx(struct ocfs2_super *osb, in __ocfs2_dx_dir_hash_idx() argument
839 return minor_hash & osb->osb_dx_mask; in __ocfs2_dx_dir_hash_idx()
842 static inline unsigned int ocfs2_dx_dir_hash_idx(struct ocfs2_super *osb, in ocfs2_dx_dir_hash_idx() argument
845 return __ocfs2_dx_dir_hash_idx(osb, hinfo->minor_hash); in ocfs2_dx_dir_hash_idx()
2187 static int ocfs2_fill_new_dir_id(struct ocfs2_super *osb, in ocfs2_fill_new_dir_id() argument
2220 static int ocfs2_fill_new_dir_el(struct ocfs2_super *osb, in ocfs2_fill_new_dir_el() argument
2229 unsigned int size = osb->sb->s_blocksize; in ocfs2_fill_new_dir_el()
2236 status = ocfs2_do_extend_dir(osb->sb, handle, inode, fe_bh, in ocfs2_fill_new_dir_el()
2251 memset(new_bh->b_data, 0, osb->sb->s_blocksize); in ocfs2_fill_new_dir_el()
2290 static int ocfs2_dx_dir_attach_index(struct ocfs2_super *osb, in ocfs2_dx_dir_attach_index() argument
2319 dx_root_bh = sb_getblk(osb->sb, dr_blkno); in ocfs2_dx_dir_attach_index()
2334 memset(dx_root, 0, osb->sb->s_blocksize); in ocfs2_dx_dir_attach_index()
2339 dx_root->dr_fs_generation = cpu_to_le32(osb->fs_generation); in ocfs2_dx_dir_attach_index()
2351 cpu_to_le16(ocfs2_dx_entries_per_root(osb->sb)); in ocfs2_dx_dir_attach_index()
2354 cpu_to_le16(ocfs2_extent_recs_per_dx_root(osb->sb)); in ocfs2_dx_dir_attach_index()
2382 static int ocfs2_dx_dir_format_cluster(struct ocfs2_super *osb, in ocfs2_dx_dir_format_cluster() argument
2392 bh = sb_getblk(osb->sb, start_blk + i); in ocfs2_dx_dir_format_cluster()
2410 memset(dx_leaf, 0, osb->sb->s_blocksize); in ocfs2_dx_dir_format_cluster()
2412 dx_leaf->dl_fs_generation = cpu_to_le32(osb->fs_generation); in ocfs2_dx_dir_format_cluster()
2415 cpu_to_le16(ocfs2_dx_entries_per_leaf(osb->sb)); in ocfs2_dx_dir_format_cluster()
2444 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); in __ocfs2_dx_dir_new_cluster() local
2462 phys_blkno = ocfs2_clusters_to_blocks(osb->sb, phys); in __ocfs2_dx_dir_new_cluster()
2463 ret = ocfs2_dx_dir_format_cluster(osb, handle, dir, dx_leaves, in __ocfs2_dx_dir_new_cluster()
2515 static int ocfs2_fill_new_dir_dx(struct ocfs2_super *osb, in ocfs2_fill_new_dir_dx() argument
2541 ret = ocfs2_fill_new_dir_el(osb, handle, parent, inode, di_bh, in ocfs2_fill_new_dir_dx()
2548 ret = ocfs2_dx_dir_attach_index(osb, handle, inode, di_bh, leaf_bh, in ocfs2_fill_new_dir_dx()
2570 int ocfs2_fill_new_dir(struct ocfs2_super *osb, in ocfs2_fill_new_dir() argument
2579 BUG_ON(!ocfs2_supports_inline_data(osb) && data_ac == NULL); in ocfs2_fill_new_dir()
2582 return ocfs2_fill_new_dir_id(osb, handle, parent, inode, fe_bh); in ocfs2_fill_new_dir()
2584 if (ocfs2_supports_indexed_dirs(osb)) in ocfs2_fill_new_dir()
2585 return ocfs2_fill_new_dir_dx(osb, handle, parent, inode, fe_bh, in ocfs2_fill_new_dir()
2588 return ocfs2_fill_new_dir_el(osb, handle, parent, inode, fe_bh, in ocfs2_fill_new_dir()
2783 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); in ocfs2_expand_inline_dir() local
2803 if (ocfs2_supports_indexed_dirs(osb)) { in ocfs2_expand_inline_dir()
2820 ret = ocfs2_reserve_new_metadata_blocks(osb, 1, &meta_ac); in ocfs2_expand_inline_dir()
2837 ret = ocfs2_reserve_clusters(osb, alloc + dx_alloc, &data_ac); in ocfs2_expand_inline_dir()
2850 handle = ocfs2_start_trans(osb, credits); in ocfs2_expand_inline_dir()
2858 ocfs2_clusters_to_bytes(osb->sb, alloc + dx_alloc)); in ocfs2_expand_inline_dir()
2863 if (ocfs2_supports_indexed_dirs(osb) && !dx_inline) { in ocfs2_expand_inline_dir()
2884 if (ocfs2_dir_resv_allowed(osb)) in ocfs2_expand_inline_dir()
2932 if (ocfs2_supports_indexed_dirs(osb) && !dx_inline) { in ocfs2_expand_inline_dir()
2999 if (ocfs2_supports_indexed_dirs(osb)) { in ocfs2_expand_inline_dir()
3000 ret = ocfs2_dx_dir_attach_index(osb, handle, dir, di_bh, in ocfs2_expand_inline_dir()
3046 if (ocfs2_supports_indexed_dirs(osb)) { in ocfs2_expand_inline_dir()
3054 off = ocfs2_dx_dir_hash_idx(osb, in ocfs2_expand_inline_dir()
3067 ocfs2_commit_trans(osb, handle); in ocfs2_expand_inline_dir()
3154 static int ocfs2_extend_dir(struct ocfs2_super *osb, in ocfs2_extend_dir() argument
3171 struct super_block *sb = osb->sb; in ocfs2_extend_dir()
3240 status = ocfs2_reserve_new_metadata(osb, el, &meta_ac); in ocfs2_extend_dir()
3248 status = ocfs2_reserve_clusters(osb, 1, &data_ac); in ocfs2_extend_dir()
3255 if (ocfs2_dir_resv_allowed(osb)) in ocfs2_extend_dir()
3269 handle = ocfs2_start_trans(osb, credits); in ocfs2_extend_dir()
3277 status = ocfs2_do_extend_dir(osb->sb, handle, dir, parent_fe_bh, in ocfs2_extend_dir()
3329 ocfs2_commit_trans(osb, handle); in ocfs2_extend_dir()
3671 static int ocfs2_dx_dir_rebalance_credits(struct ocfs2_super *osb, in ocfs2_dx_dir_rebalance_credits() argument
3674 int credits = ocfs2_clusters_to_blocks(osb->sb, 3); in ocfs2_dx_dir_rebalance_credits()
3676 credits += ocfs2_calc_extend_credits(osb->sb, &dx_root->dr_list); in ocfs2_dx_dir_rebalance_credits()
3677 credits += ocfs2_quota_trans_credits(osb->sb); in ocfs2_dx_dir_rebalance_credits()
3685 static int ocfs2_dx_dir_rebalance(struct ocfs2_super *osb, struct inode *dir, in ocfs2_dx_dir_rebalance() argument
3727 orig_dx_leaves = ocfs2_dx_dir_kmalloc_leaves(osb->sb, &num_dx_leaves); in ocfs2_dx_dir_rebalance()
3734 new_dx_leaves = ocfs2_dx_dir_kmalloc_leaves(osb->sb, NULL); in ocfs2_dx_dir_rebalance()
3748 credits = ocfs2_dx_dir_rebalance_credits(osb, dx_root); in ocfs2_dx_dir_rebalance()
3749 handle = ocfs2_start_trans(osb, credits); in ocfs2_dx_dir_rebalance()
3806 tmp_dx_leaf = kmalloc(osb->sb->s_blocksize, GFP_NOFS); in ocfs2_dx_dir_rebalance()
3857 ocfs2_commit_trans(osb, handle); in ocfs2_dx_dir_rebalance()
3880 static int ocfs2_find_dir_space_dx(struct ocfs2_super *osb, struct inode *dir, in ocfs2_find_dir_space_dx() argument
3925 ret = ocfs2_dx_dir_rebalance(osb, dir, dx_root_bh, dx_leaf_bh, in ocfs2_find_dir_space_dx()
4009 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); in ocfs2_expand_inline_dx_root() local
4016 ret = ocfs2_reserve_clusters(osb, 1, &data_ac); in ocfs2_expand_inline_dx_root()
4022 dx_leaves = ocfs2_dx_dir_kmalloc_leaves(osb->sb, &num_dx_leaves); in ocfs2_expand_inline_dx_root()
4029 handle = ocfs2_start_trans(osb, ocfs2_calc_dxi_expand_credits(osb->sb)); in ocfs2_expand_inline_dx_root()
4037 ocfs2_clusters_to_bytes(osb->sb, 1)); in ocfs2_expand_inline_dx_root()
4071 j = __ocfs2_dx_dir_hash_idx(osb, in ocfs2_expand_inline_dx_root()
4082 memset(&dx_root->dr_list, 0, osb->sb->s_blocksize - in ocfs2_expand_inline_dx_root()
4085 cpu_to_le16(ocfs2_extent_recs_per_dx_root(osb->sb)); in ocfs2_expand_inline_dx_root()
4103 ocfs2_commit_trans(osb, handle); in ocfs2_expand_inline_dx_root()
4139 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); in ocfs2_prepare_dx_dir_for_insert() local
4182 ret = ocfs2_find_dir_space_dx(osb, dir, di_bh, dx_root_bh, name, in ocfs2_prepare_dx_dir_for_insert()
4207 ret = ocfs2_extend_dir(osb, dir, di_bh, 1, lookup, &leaf_bh); in ocfs2_prepare_dx_dir_for_insert()
4234 int ocfs2_prepare_dir_for_insert(struct ocfs2_super *osb, in ocfs2_prepare_dir_for_insert() argument
4259 if (ocfs2_supports_indexed_dirs(osb)) in ocfs2_prepare_dir_for_insert()
4287 ret = ocfs2_extend_dir(osb, dir, parent_fe_bh, blocks_wanted, in ocfs2_prepare_dir_for_insert()
4310 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); in ocfs2_dx_dir_remove_index() local
4322 dx_alloc_inode = ocfs2_get_system_file_inode(osb, in ocfs2_dx_dir_remove_index()
4338 handle = ocfs2_start_trans(osb, OCFS2_DX_ROOT_REMOVE_CREDITS); in ocfs2_dx_dir_remove_index()
4373 ocfs2_commit_trans(osb, handle); in ocfs2_dx_dir_remove_index()
4392 struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); in ocfs2_dx_dir_truncate() local
4449 ocfs2_schedule_truncate_log_flush(osb, 1); in ocfs2_dx_dir_truncate()
4450 ocfs2_run_deallocs(osb, &dealloc); in ocfs2_dx_dir_truncate()