alloc.c (ca12b7c48942d21b2e7890b820db9d578bc291cd) alloc.c (35dc0aa3c5e7391319754e0c19cdfc0a28eb5b25)
1/* -*- mode: c; c-basic-offset: 8; -*-
2 * vim: noexpandtab sw=8 ts=8 sts=0:
3 *
4 * alloc.c
5 *
6 * Extent allocs and frees
7 *
8 * Copyright (C) 2002, 2004 Oracle. All rights reserved.

--- 51 unchanged lines hidden (view full) ---

60 * root ocfs2_extent_list and a root_bh so that they can be used in the b-tree
61 * functions.
62 * ocfs2_extent_tree_operations abstract the normal operations we do for
63 * the root of extent b-tree.
64 */
65struct ocfs2_extent_tree;
66
67struct ocfs2_extent_tree_operations {
1/* -*- mode: c; c-basic-offset: 8; -*-
2 * vim: noexpandtab sw=8 ts=8 sts=0:
3 *
4 * alloc.c
5 *
6 * Extent allocs and frees
7 *
8 * Copyright (C) 2002, 2004 Oracle. All rights reserved.

--- 51 unchanged lines hidden (view full) ---

60 * root ocfs2_extent_list and a root_bh so that they can be used in the b-tree
61 * functions.
62 * ocfs2_extent_tree_operations abstract the normal operations we do for
63 * the root of extent b-tree.
64 */
65struct ocfs2_extent_tree;
66
67struct ocfs2_extent_tree_operations {
68 void (*set_last_eb_blk) (struct ocfs2_extent_tree *et, u64 blkno);
69 u64 (*get_last_eb_blk) (struct ocfs2_extent_tree *et);
70 void (*update_clusters) (struct inode *inode,
71 struct ocfs2_extent_tree *et,
72 u32 new_clusters);
73 int (*sanity_check) (struct inode *inode, struct ocfs2_extent_tree *et);
68 void (*eo_set_last_eb_blk)(struct ocfs2_extent_tree *et,
69 u64 blkno);
70 u64 (*eo_get_last_eb_blk)(struct ocfs2_extent_tree *et);
71 void (*eo_update_clusters)(struct inode *inode,
72 struct ocfs2_extent_tree *et,
73 u32 new_clusters);
74 int (*eo_sanity_check)(struct inode *inode, struct ocfs2_extent_tree *et);
74};
75
76struct ocfs2_extent_tree {
77 enum ocfs2_extent_tree_type type;
78 struct ocfs2_extent_tree_operations *eops;
79 struct buffer_head *root_bh;
80 struct ocfs2_extent_list *root_el;
81 void *private;

--- 45 unchanged lines hidden (view full) ---

127 "Inode %llu has invalid path root",
128 (unsigned long long)OCFS2_I(inode)->ip_blkno);
129 }
130
131 return ret;
132}
133
134static struct ocfs2_extent_tree_operations ocfs2_dinode_et_ops = {
75};
76
77struct ocfs2_extent_tree {
78 enum ocfs2_extent_tree_type type;
79 struct ocfs2_extent_tree_operations *eops;
80 struct buffer_head *root_bh;
81 struct ocfs2_extent_list *root_el;
82 void *private;

--- 45 unchanged lines hidden (view full) ---

128 "Inode %llu has invalid path root",
129 (unsigned long long)OCFS2_I(inode)->ip_blkno);
130 }
131
132 return ret;
133}
134
135static struct ocfs2_extent_tree_operations ocfs2_dinode_et_ops = {
135 .set_last_eb_blk = ocfs2_dinode_set_last_eb_blk,
136 .get_last_eb_blk = ocfs2_dinode_get_last_eb_blk,
137 .update_clusters = ocfs2_dinode_update_clusters,
138 .sanity_check = ocfs2_dinode_sanity_check,
136 .eo_set_last_eb_blk = ocfs2_dinode_set_last_eb_blk,
137 .eo_get_last_eb_blk = ocfs2_dinode_get_last_eb_blk,
138 .eo_update_clusters = ocfs2_dinode_update_clusters,
139 .eo_sanity_check = ocfs2_dinode_sanity_check,
139};
140
141static void ocfs2_xattr_value_set_last_eb_blk(struct ocfs2_extent_tree *et,
142 u64 blkno)
143{
144 struct ocfs2_xattr_value_root *xv =
145 (struct ocfs2_xattr_value_root *)et->private;
146

--- 20 unchanged lines hidden (view full) ---

167
168static int ocfs2_xattr_value_sanity_check(struct inode *inode,
169 struct ocfs2_extent_tree *et)
170{
171 return 0;
172}
173
174static struct ocfs2_extent_tree_operations ocfs2_xattr_et_ops = {
140};
141
142static void ocfs2_xattr_value_set_last_eb_blk(struct ocfs2_extent_tree *et,
143 u64 blkno)
144{
145 struct ocfs2_xattr_value_root *xv =
146 (struct ocfs2_xattr_value_root *)et->private;
147

--- 20 unchanged lines hidden (view full) ---

168
169static int ocfs2_xattr_value_sanity_check(struct inode *inode,
170 struct ocfs2_extent_tree *et)
171{
172 return 0;
173}
174
175static struct ocfs2_extent_tree_operations ocfs2_xattr_et_ops = {
175 .set_last_eb_blk = ocfs2_xattr_value_set_last_eb_blk,
176 .get_last_eb_blk = ocfs2_xattr_value_get_last_eb_blk,
177 .update_clusters = ocfs2_xattr_value_update_clusters,
178 .sanity_check = ocfs2_xattr_value_sanity_check,
176 .eo_set_last_eb_blk = ocfs2_xattr_value_set_last_eb_blk,
177 .eo_get_last_eb_blk = ocfs2_xattr_value_get_last_eb_blk,
178 .eo_update_clusters = ocfs2_xattr_value_update_clusters,
179 .eo_sanity_check = ocfs2_xattr_value_sanity_check,
179};
180
181static void ocfs2_xattr_tree_set_last_eb_blk(struct ocfs2_extent_tree *et,
182 u64 blkno)
183{
184 struct ocfs2_xattr_block *xb =
185 (struct ocfs2_xattr_block *) et->root_bh->b_data;
186 struct ocfs2_xattr_tree_root *xt = &xb->xb_attrs.xb_root;

--- 22 unchanged lines hidden (view full) ---

209
210static int ocfs2_xattr_tree_sanity_check(struct inode *inode,
211 struct ocfs2_extent_tree *et)
212{
213 return 0;
214}
215
216static struct ocfs2_extent_tree_operations ocfs2_xattr_tree_et_ops = {
180};
181
182static void ocfs2_xattr_tree_set_last_eb_blk(struct ocfs2_extent_tree *et,
183 u64 blkno)
184{
185 struct ocfs2_xattr_block *xb =
186 (struct ocfs2_xattr_block *) et->root_bh->b_data;
187 struct ocfs2_xattr_tree_root *xt = &xb->xb_attrs.xb_root;

--- 22 unchanged lines hidden (view full) ---

210
211static int ocfs2_xattr_tree_sanity_check(struct inode *inode,
212 struct ocfs2_extent_tree *et)
213{
214 return 0;
215}
216
217static struct ocfs2_extent_tree_operations ocfs2_xattr_tree_et_ops = {
217 .set_last_eb_blk = ocfs2_xattr_tree_set_last_eb_blk,
218 .get_last_eb_blk = ocfs2_xattr_tree_get_last_eb_blk,
219 .update_clusters = ocfs2_xattr_tree_update_clusters,
220 .sanity_check = ocfs2_xattr_tree_sanity_check,
218 .eo_set_last_eb_blk = ocfs2_xattr_tree_set_last_eb_blk,
219 .eo_get_last_eb_blk = ocfs2_xattr_tree_get_last_eb_blk,
220 .eo_update_clusters = ocfs2_xattr_tree_update_clusters,
221 .eo_sanity_check = ocfs2_xattr_tree_sanity_check,
221};
222
223static struct ocfs2_extent_tree*
224 ocfs2_new_extent_tree(struct inode *inode,
225 struct buffer_head *bh,
226 enum ocfs2_extent_tree_type et_type,
227 void *private)
228{

--- 31 unchanged lines hidden (view full) ---

260static void ocfs2_free_extent_tree(struct ocfs2_extent_tree *et)
261{
262 if (et) {
263 brelse(et->root_bh);
264 kfree(et);
265 }
266}
267
222};
223
224static struct ocfs2_extent_tree*
225 ocfs2_new_extent_tree(struct inode *inode,
226 struct buffer_head *bh,
227 enum ocfs2_extent_tree_type et_type,
228 void *private)
229{

--- 31 unchanged lines hidden (view full) ---

261static void ocfs2_free_extent_tree(struct ocfs2_extent_tree *et)
262{
263 if (et) {
264 brelse(et->root_bh);
265 kfree(et);
266 }
267}
268
268static inline void ocfs2_set_last_eb_blk(struct ocfs2_extent_tree *et,
269 u64 new_last_eb_blk)
269static inline void ocfs2_et_set_last_eb_blk(struct ocfs2_extent_tree *et,
270 u64 new_last_eb_blk)
270{
271{
271 et->eops->set_last_eb_blk(et, new_last_eb_blk);
272 et->eops->eo_set_last_eb_blk(et, new_last_eb_blk);
272}
273
273}
274
274static inline u64 ocfs2_get_last_eb_blk(struct ocfs2_extent_tree *et)
275static inline u64 ocfs2_et_get_last_eb_blk(struct ocfs2_extent_tree *et)
275{
276{
276 return et->eops->get_last_eb_blk(et);
277 return et->eops->eo_get_last_eb_blk(et);
277}
278
278}
279
279static inline void ocfs2_update_clusters(struct inode *inode,
280 struct ocfs2_extent_tree *et,
281 u32 clusters)
280static inline void ocfs2_et_update_clusters(struct inode *inode,
281 struct ocfs2_extent_tree *et,
282 u32 clusters)
282{
283{
283 et->eops->update_clusters(inode, et, clusters);
284 et->eops->eo_update_clusters(inode, et, clusters);
284}
285
285}
286
287static inline int ocfs2_et_sanity_check(struct inode *inode,
288 struct ocfs2_extent_tree *et)
289{
290 return et->eops->eo_sanity_check(inode, et);
291}
292
286static void ocfs2_free_truncate_context(struct ocfs2_truncate_context *tc);
287static int ocfs2_cache_extent_block_free(struct ocfs2_cached_dealloc_ctxt *ctxt,
288 struct ocfs2_extent_block *eb);
289
290/*
291 * Structures which describe a path through a btree, and functions to
292 * manipulate them.
293 *

--- 614 unchanged lines hidden (view full) ---

908 i = le16_to_cpu(el->l_next_free_rec);
909 el->l_recs[i].e_blkno = cpu_to_le64(next_blkno);
910 el->l_recs[i].e_cpos = cpu_to_le32(new_cpos);
911 el->l_recs[i].e_int_clusters = 0;
912 le16_add_cpu(&el->l_next_free_rec, 1);
913
914 /* fe needs a new last extent block pointer, as does the
915 * next_leaf on the previously last-extent-block. */
293static void ocfs2_free_truncate_context(struct ocfs2_truncate_context *tc);
294static int ocfs2_cache_extent_block_free(struct ocfs2_cached_dealloc_ctxt *ctxt,
295 struct ocfs2_extent_block *eb);
296
297/*
298 * Structures which describe a path through a btree, and functions to
299 * manipulate them.
300 *

--- 614 unchanged lines hidden (view full) ---

915 i = le16_to_cpu(el->l_next_free_rec);
916 el->l_recs[i].e_blkno = cpu_to_le64(next_blkno);
917 el->l_recs[i].e_cpos = cpu_to_le32(new_cpos);
918 el->l_recs[i].e_int_clusters = 0;
919 le16_add_cpu(&el->l_next_free_rec, 1);
920
921 /* fe needs a new last extent block pointer, as does the
922 * next_leaf on the previously last-extent-block. */
916 ocfs2_set_last_eb_blk(et, new_last_eb_blk);
923 ocfs2_et_set_last_eb_blk(et, new_last_eb_blk);
917
918 eb = (struct ocfs2_extent_block *) (*last_eb_bh)->b_data;
919 eb->h_next_leaf_blk = cpu_to_le64(new_last_eb_blk);
920
921 status = ocfs2_journal_dirty(handle, *last_eb_bh);
922 if (status < 0)
923 mlog_errno(status);
924 status = ocfs2_journal_dirty(handle, et->root_bh);

--- 99 unchanged lines hidden (view full) ---

1024 root_el->l_recs[0].e_int_clusters = cpu_to_le32(new_clusters);
1025 for (i = 1; i < le16_to_cpu(root_el->l_next_free_rec); i++)
1026 memset(&root_el->l_recs[i], 0, sizeof(struct ocfs2_extent_rec));
1027 root_el->l_next_free_rec = cpu_to_le16(1);
1028
1029 /* If this is our 1st tree depth shift, then last_eb_blk
1030 * becomes the allocated extent block */
1031 if (root_el->l_tree_depth == cpu_to_le16(1))
924
925 eb = (struct ocfs2_extent_block *) (*last_eb_bh)->b_data;
926 eb->h_next_leaf_blk = cpu_to_le64(new_last_eb_blk);
927
928 status = ocfs2_journal_dirty(handle, *last_eb_bh);
929 if (status < 0)
930 mlog_errno(status);
931 status = ocfs2_journal_dirty(handle, et->root_bh);

--- 99 unchanged lines hidden (view full) ---

1031 root_el->l_recs[0].e_int_clusters = cpu_to_le32(new_clusters);
1032 for (i = 1; i < le16_to_cpu(root_el->l_next_free_rec); i++)
1033 memset(&root_el->l_recs[i], 0, sizeof(struct ocfs2_extent_rec));
1034 root_el->l_next_free_rec = cpu_to_le16(1);
1035
1036 /* If this is our 1st tree depth shift, then last_eb_blk
1037 * becomes the allocated extent block */
1038 if (root_el->l_tree_depth == cpu_to_le16(1))
1032 ocfs2_set_last_eb_blk(et, le64_to_cpu(eb->h_blkno));
1039 ocfs2_et_set_last_eb_blk(et, le64_to_cpu(eb->h_blkno));
1033
1034 status = ocfs2_journal_dirty(handle, et->root_bh);
1035 if (status < 0) {
1036 mlog_errno(status);
1037 goto bail;
1038 }
1039
1040 *ret_new_eb_bh = new_eb_bh;

--- 1381 unchanged lines hidden (view full) ---

2422 mlog_errno(ret);
2423
2424 if (del_right_subtree) {
2425 ocfs2_unlink_subtree(inode, handle, left_path, right_path,
2426 subtree_index, dealloc);
2427 ocfs2_update_edge_lengths(inode, handle, left_path);
2428
2429 eb = (struct ocfs2_extent_block *)path_leaf_bh(left_path)->b_data;
1040
1041 status = ocfs2_journal_dirty(handle, et->root_bh);
1042 if (status < 0) {
1043 mlog_errno(status);
1044 goto bail;
1045 }
1046
1047 *ret_new_eb_bh = new_eb_bh;

--- 1381 unchanged lines hidden (view full) ---

2429 mlog_errno(ret);
2430
2431 if (del_right_subtree) {
2432 ocfs2_unlink_subtree(inode, handle, left_path, right_path,
2433 subtree_index, dealloc);
2434 ocfs2_update_edge_lengths(inode, handle, left_path);
2435
2436 eb = (struct ocfs2_extent_block *)path_leaf_bh(left_path)->b_data;
2430 ocfs2_set_last_eb_blk(et, le64_to_cpu(eb->h_blkno));
2437 ocfs2_et_set_last_eb_blk(et, le64_to_cpu(eb->h_blkno));
2431
2432 /*
2433 * Removal of the extent in the left leaf was skipped
2434 * above so we could delete the right path
2435 * 1st.
2436 */
2437 if (right_has_empty)
2438 ocfs2_remove_empty_extent(left_leaf_el);

--- 244 unchanged lines hidden (view full) ---

2683{
2684 int ret, subtree_index;
2685 u32 cpos;
2686 struct ocfs2_path *left_path = NULL;
2687 struct ocfs2_extent_block *eb;
2688 struct ocfs2_extent_list *el;
2689
2690
2438
2439 /*
2440 * Removal of the extent in the left leaf was skipped
2441 * above so we could delete the right path
2442 * 1st.
2443 */
2444 if (right_has_empty)
2445 ocfs2_remove_empty_extent(left_leaf_el);

--- 244 unchanged lines hidden (view full) ---

2690{
2691 int ret, subtree_index;
2692 u32 cpos;
2693 struct ocfs2_path *left_path = NULL;
2694 struct ocfs2_extent_block *eb;
2695 struct ocfs2_extent_list *el;
2696
2697
2691 ret = et->eops->sanity_check(inode, et);
2698 ret = ocfs2_et_sanity_check(inode, et);
2692 if (ret)
2693 goto out;
2694 /*
2695 * There's two ways we handle this depending on
2696 * whether path is the only existing one.
2697 */
2698 ret = ocfs2_extend_rotate_transaction(handle, 0,
2699 handle->h_buffer_credits,

--- 42 unchanged lines hidden (view full) ---

2742
2743 subtree_index = ocfs2_find_subtree_root(inode, left_path, path);
2744
2745 ocfs2_unlink_subtree(inode, handle, left_path, path,
2746 subtree_index, dealloc);
2747 ocfs2_update_edge_lengths(inode, handle, left_path);
2748
2749 eb = (struct ocfs2_extent_block *)path_leaf_bh(left_path)->b_data;
2699 if (ret)
2700 goto out;
2701 /*
2702 * There's two ways we handle this depending on
2703 * whether path is the only existing one.
2704 */
2705 ret = ocfs2_extend_rotate_transaction(handle, 0,
2706 handle->h_buffer_credits,

--- 42 unchanged lines hidden (view full) ---

2749
2750 subtree_index = ocfs2_find_subtree_root(inode, left_path, path);
2751
2752 ocfs2_unlink_subtree(inode, handle, left_path, path,
2753 subtree_index, dealloc);
2754 ocfs2_update_edge_lengths(inode, handle, left_path);
2755
2756 eb = (struct ocfs2_extent_block *)path_leaf_bh(left_path)->b_data;
2750 ocfs2_set_last_eb_blk(et, le64_to_cpu(eb->h_blkno));
2757 ocfs2_et_set_last_eb_blk(et, le64_to_cpu(eb->h_blkno));
2751 } else {
2752 /*
2753 * 'path' is also the leftmost path which
2754 * means it must be the only one. This gets
2755 * handled differently because we want to
2756 * revert the inode back to having extents
2757 * in-line.
2758 */
2759 ocfs2_unlink_path(inode, handle, dealloc, path, 1);
2760
2761 el = et->root_el;
2762 el->l_tree_depth = 0;
2763 el->l_next_free_rec = 0;
2764 memset(&el->l_recs[0], 0, sizeof(struct ocfs2_extent_rec));
2765
2758 } else {
2759 /*
2760 * 'path' is also the leftmost path which
2761 * means it must be the only one. This gets
2762 * handled differently because we want to
2763 * revert the inode back to having extents
2764 * in-line.
2765 */
2766 ocfs2_unlink_path(inode, handle, dealloc, path, 1);
2767
2768 el = et->root_el;
2769 el->l_tree_depth = 0;
2770 el->l_next_free_rec = 0;
2771 memset(&el->l_recs[0], 0, sizeof(struct ocfs2_extent_rec));
2772
2766 ocfs2_set_last_eb_blk(et, 0);
2773 ocfs2_et_set_last_eb_blk(et, 0);
2767 }
2768
2769 ocfs2_journal_dirty(handle, path_root_bh(path));
2770
2771out:
2772 ocfs2_free_path(left_path);
2773 return ret;
2774}

--- 1200 unchanged lines hidden (view full) ---

3975 insert_rec, type);
3976 if (ret) {
3977 mlog_errno(ret);
3978 goto out;
3979 }
3980
3981out_update_clusters:
3982 if (type->ins_split == SPLIT_NONE)
2774 }
2775
2776 ocfs2_journal_dirty(handle, path_root_bh(path));
2777
2778out:
2779 ocfs2_free_path(left_path);
2780 return ret;
2781}

--- 1200 unchanged lines hidden (view full) ---

3982 insert_rec, type);
3983 if (ret) {
3984 mlog_errno(ret);
3985 goto out;
3986 }
3987
3988out_update_clusters:
3989 if (type->ins_split == SPLIT_NONE)
3983 ocfs2_update_clusters(inode, et,
3984 le16_to_cpu(insert_rec->e_leaf_clusters));
3990 ocfs2_et_update_clusters(inode, et,
3991 le16_to_cpu(insert_rec->e_leaf_clusters));
3985
3986 ret = ocfs2_journal_dirty(handle, et->root_bh);
3987 if (ret)
3988 mlog_errno(ret);
3989
3990out:
3991 ocfs2_free_path(left_path);
3992 ocfs2_free_path(right_path);

--- 231 unchanged lines hidden (view full) ---

4224 if (el->l_tree_depth) {
4225 /*
4226 * If we have tree depth, we read in the
4227 * rightmost extent block ahead of time as
4228 * ocfs2_figure_insert_type() and ocfs2_add_branch()
4229 * may want it later.
4230 */
4231 ret = ocfs2_read_block(OCFS2_SB(inode->i_sb),
3992
3993 ret = ocfs2_journal_dirty(handle, et->root_bh);
3994 if (ret)
3995 mlog_errno(ret);
3996
3997out:
3998 ocfs2_free_path(left_path);
3999 ocfs2_free_path(right_path);

--- 231 unchanged lines hidden (view full) ---

4231 if (el->l_tree_depth) {
4232 /*
4233 * If we have tree depth, we read in the
4234 * rightmost extent block ahead of time as
4235 * ocfs2_figure_insert_type() and ocfs2_add_branch()
4236 * may want it later.
4237 */
4238 ret = ocfs2_read_block(OCFS2_SB(inode->i_sb),
4232 ocfs2_get_last_eb_blk(et), &bh,
4239 ocfs2_et_get_last_eb_blk(et), &bh,
4233 OCFS2_BH_CACHED, inode);
4234 if (ret) {
4235 mlog_exit(ret);
4236 goto out;
4237 }
4238 eb = (struct ocfs2_extent_block *) bh->b_data;
4239 el = &eb->h_list;
4240 }

--- 60 unchanged lines hidden (view full) ---

4301 insert->ins_contig = CONTIG_NONE;
4302
4303 /*
4304 * Ok, so we can simply compare against last_eb to figure out
4305 * whether the path doesn't exist. This will only happen in
4306 * the case that we're doing a tail append, so maybe we can
4307 * take advantage of that information somehow.
4308 */
4240 OCFS2_BH_CACHED, inode);
4241 if (ret) {
4242 mlog_exit(ret);
4243 goto out;
4244 }
4245 eb = (struct ocfs2_extent_block *) bh->b_data;
4246 el = &eb->h_list;
4247 }

--- 60 unchanged lines hidden (view full) ---

4308 insert->ins_contig = CONTIG_NONE;
4309
4310 /*
4311 * Ok, so we can simply compare against last_eb to figure out
4312 * whether the path doesn't exist. This will only happen in
4313 * the case that we're doing a tail append, so maybe we can
4314 * take advantage of that information somehow.
4315 */
4309 if (ocfs2_get_last_eb_blk(et) ==
4316 if (ocfs2_et_get_last_eb_blk(et) ==
4310 path_leaf_bh(path)->b_blocknr) {
4311 /*
4312 * Ok, ocfs2_find_path() returned us the rightmost
4313 * tree path. This might be an appending insert. There are
4314 * two cases:
4315 * 1) We're doing a true append at the tail:
4316 * -This might even be off the end of the leaf
4317 * 2) We're "appending" by rotating in the tail

--- 491 unchanged lines hidden (view full) ---

4809 * The core merge / split code wants to know how much room is
4810 * left in this inodes allocation tree, so we pass the
4811 * rightmost extent list.
4812 */
4813 if (path->p_tree_depth) {
4814 struct ocfs2_extent_block *eb;
4815
4816 ret = ocfs2_read_block(OCFS2_SB(inode->i_sb),
4317 path_leaf_bh(path)->b_blocknr) {
4318 /*
4319 * Ok, ocfs2_find_path() returned us the rightmost
4320 * tree path. This might be an appending insert. There are
4321 * two cases:
4322 * 1) We're doing a true append at the tail:
4323 * -This might even be off the end of the leaf
4324 * 2) We're "appending" by rotating in the tail

--- 491 unchanged lines hidden (view full) ---

4816 * The core merge / split code wants to know how much room is
4817 * left in this inodes allocation tree, so we pass the
4818 * rightmost extent list.
4819 */
4820 if (path->p_tree_depth) {
4821 struct ocfs2_extent_block *eb;
4822
4823 ret = ocfs2_read_block(OCFS2_SB(inode->i_sb),
4817 ocfs2_get_last_eb_blk(et),
4824 ocfs2_et_get_last_eb_blk(et),
4818 &last_eb_bh, OCFS2_BH_CACHED, inode);
4819 if (ret) {
4820 mlog_exit(ret);
4821 goto out;
4822 }
4823
4824 eb = (struct ocfs2_extent_block *) last_eb_bh->b_data;
4825 if (!OCFS2_IS_VALID_EXTENT_BLOCK(eb)) {

--- 150 unchanged lines hidden (view full) ---

4976 */
4977 el = path_leaf_el(path);
4978 rec = &el->l_recs[index];
4979 ocfs2_make_right_split_rec(inode->i_sb, &split_rec, new_range, rec);
4980
4981 depth = path->p_tree_depth;
4982 if (depth > 0) {
4983 ret = ocfs2_read_block(OCFS2_SB(inode->i_sb),
4825 &last_eb_bh, OCFS2_BH_CACHED, inode);
4826 if (ret) {
4827 mlog_exit(ret);
4828 goto out;
4829 }
4830
4831 eb = (struct ocfs2_extent_block *) last_eb_bh->b_data;
4832 if (!OCFS2_IS_VALID_EXTENT_BLOCK(eb)) {

--- 150 unchanged lines hidden (view full) ---

4983 */
4984 el = path_leaf_el(path);
4985 rec = &el->l_recs[index];
4986 ocfs2_make_right_split_rec(inode->i_sb, &split_rec, new_range, rec);
4987
4988 depth = path->p_tree_depth;
4989 if (depth > 0) {
4990 ret = ocfs2_read_block(OCFS2_SB(inode->i_sb),
4984 ocfs2_get_last_eb_blk(et),
4991 ocfs2_et_get_last_eb_blk(et),
4985 &last_eb_bh, OCFS2_BH_CACHED, inode);
4986 if (ret < 0) {
4987 mlog_errno(ret);
4988 goto out;
4989 }
4990
4991 eb = (struct ocfs2_extent_block *) last_eb_bh->b_data;
4992 rightmost_el = &eb->h_list;

--- 2193 unchanged lines hidden ---
4992 &last_eb_bh, OCFS2_BH_CACHED, inode);
4993 if (ret < 0) {
4994 mlog_errno(ret);
4995 goto out;
4996 }
4997
4998 eb = (struct ocfs2_extent_block *) last_eb_bh->b_data;
4999 rightmost_el = &eb->h_list;

--- 2193 unchanged lines hidden ---