Lines Matching refs:el

586 		node->el = NULL;
629 dest->p_node[i].el = src->p_node[i].el;
651 dest->p_node[i].el = src->p_node[i].el;
654 src->p_node[i].el = NULL;
677 path->p_node[index].el = &eb->h_list;
766 int ocfs2_search_extent_list(struct ocfs2_extent_list *el, u32 v_cluster)
773 for(i = 0; i < le16_to_cpu(el->l_next_free_rec); i++) {
774 rec = &el->l_recs[i];
777 clusters = ocfs2_rec_clusters(el, rec);
951 struct ocfs2_extent_list *el = NULL;
956 el = et->et_root_el;
967 el = &eb->h_list;
970 BUG_ON(el->l_tree_depth != 0);
972 retval = le16_to_cpu(el->l_count) - le16_to_cpu(el->l_next_free_rec);
1077 static inline u32 ocfs2_sum_rightmost_rec(struct ocfs2_extent_list *el)
1081 i = le16_to_cpu(el->l_next_free_rec) - 1;
1083 return le32_to_cpu(el->l_recs[i].e_cpos) +
1084 ocfs2_rec_clusters(el, &el->l_recs[i]);
1096 struct ocfs2_extent_list *el;
1123 el = path_leaf_el(path);
1124 rec = &el->l_recs[le16_to_cpu(el->l_next_free_rec) - 1];
1156 struct ocfs2_extent_list *el;
1163 el = &eb->h_list;
1165 el = et->et_root_el;
1168 BUG_ON(!el->l_tree_depth);
1170 new_blocks = le16_to_cpu(el->l_tree_depth);
1303 /* Link the new branch into the rest of the tree (el will
1305 i = le16_to_cpu(el->l_next_free_rec);
1306 el->l_recs[i].e_blkno = cpu_to_le64(next_blkno);
1307 el->l_recs[i].e_cpos = cpu_to_le32(new_cpos);
1308 el->l_recs[i].e_int_clusters = 0;
1309 le16_add_cpu(&el->l_next_free_rec, 1);
1455 struct ocfs2_extent_list *el;
1461 el = et->et_root_el;
1463 while(le16_to_cpu(el->l_tree_depth) > 1) {
1464 if (le16_to_cpu(el->l_next_free_rec) == 0) {
1470 i = le16_to_cpu(el->l_next_free_rec) - 1;
1471 blkno = le64_to_cpu(el->l_recs[i].e_blkno);
1489 el = &eb->h_list;
1491 if (le16_to_cpu(el->l_next_free_rec) <
1492 le16_to_cpu(el->l_count)) {
1501 el = et->et_root_el;
1502 if (!lowest_bh && (el->l_next_free_rec == el->l_count))
1527 struct ocfs2_extent_list *el = et->et_root_el;
1528 int depth = le16_to_cpu(el->l_tree_depth);
1593 static void ocfs2_shift_records_right(struct ocfs2_extent_list *el)
1595 int next_free = le16_to_cpu(el->l_next_free_rec);
1596 int count = le16_to_cpu(el->l_count);
1605 memmove(&el->l_recs[1], &el->l_recs[0], num_bytes);
1608 static void ocfs2_rotate_leaf(struct ocfs2_extent_list *el,
1615 next_free = le16_to_cpu(el->l_next_free_rec);
1616 has_empty = ocfs2_is_empty_extent(&el->l_recs[0]);
1621 BUG_ON(el->l_next_free_rec == el->l_count && !has_empty);
1634 el->l_recs[i] = el->l_recs[i+1];
1643 rec = &el->l_recs[i];
1652 le16_to_cpu(el->l_count));
1655 BUG_ON(insert_index >= le16_to_cpu(el->l_count));
1662 BUG_ON(next_free >= le16_to_cpu(el->l_count));
1666 memmove(&el->l_recs[insert_index + 1],
1667 &el->l_recs[insert_index],
1677 el->l_next_free_rec = cpu_to_le16(next_free);
1681 BUG_ON(le16_to_cpu(el->l_next_free_rec) > le16_to_cpu(el->l_count));
1683 el->l_recs[insert_index] = *insert_rec;
1687 static void ocfs2_remove_empty_extent(struct ocfs2_extent_list *el)
1689 int size, num_recs = le16_to_cpu(el->l_next_free_rec);
1693 if (ocfs2_is_empty_extent(&el->l_recs[0])) {
1696 memmove(&el->l_recs[0], &el->l_recs[1], size);
1697 memset(&el->l_recs[num_recs], 0,
1699 el->l_next_free_rec = cpu_to_le16(num_recs);
1710 static void ocfs2_create_empty_extent(struct ocfs2_extent_list *el)
1712 int next_free = le16_to_cpu(el->l_next_free_rec);
1714 BUG_ON(le16_to_cpu(el->l_tree_depth) != 0);
1719 if (ocfs2_is_empty_extent(&el->l_recs[0]))
1722 mlog_bug_on_msg(el->l_count == el->l_next_free_rec,
1725 le16_to_cpu(el->l_count),
1726 le16_to_cpu(el->l_tree_depth));
1728 ocfs2_shift_records_right(el);
1731 le16_add_cpu(&el->l_next_free_rec, 1);
1732 memset(&el->l_recs[0], 0, sizeof(struct ocfs2_extent_rec));
1794 struct ocfs2_extent_list *el;
1797 el = root_el;
1798 while (el->l_tree_depth) {
1799 if (le16_to_cpu(el->l_next_free_rec) == 0) {
1803 le16_to_cpu(el->l_tree_depth));
1809 for(i = 0; i < le16_to_cpu(el->l_next_free_rec) - 1; i++) {
1810 rec = &el->l_recs[i];
1818 ocfs2_rec_clusters(el, rec);
1823 blkno = le64_to_cpu(el->l_recs[i].e_blkno);
1828 le16_to_cpu(el->l_tree_depth), i);
1842 el = &eb->h_list;
1844 if (le16_to_cpu(el->l_next_free_rec) >
1845 le16_to_cpu(el->l_count)) {
1850 le16_to_cpu(el->l_next_free_rec),
1851 le16_to_cpu(el->l_count));
1906 struct ocfs2_extent_list *el = &eb->h_list;
1910 if (le16_to_cpu(el->l_tree_depth) == 0) {
2041 struct ocfs2_extent_list *el, *left_el, *right_el;
2068 el = left_path->p_node[i].el;
2070 left_rec = &el->l_recs[idx];
2072 el = right_path->p_node[i].el;
2073 right_rec = &el->l_recs[0];
2084 left_el = left_path->p_node[i].el;
2085 right_el = right_path->p_node[i].el;
2093 el = left_path->p_node[subtree_index].el;
2094 left_el = left_path->p_node[subtree_index + 1].el;
2095 right_el = right_path->p_node[subtree_index + 1].el;
2097 ocfs2_adjust_root_records(el, left_el, right_el,
2213 struct ocfs2_extent_list *el;
2224 el = path->p_node[i].el;
2230 for(j = 0; j < le16_to_cpu(el->l_next_free_rec); j++) {
2231 if (le64_to_cpu(el->l_recs[j].e_blkno) == blkno) {
2250 *cpos = le32_to_cpu(el->l_recs[j - 1].e_cpos);
2251 *cpos = *cpos + ocfs2_rec_clusters(el,
2252 &el->l_recs[j - 1]);
2321 static int ocfs2_leftmost_rec_contains(struct ocfs2_extent_list *el, u32 cpos)
2323 int next_free = le16_to_cpu(el->l_next_free_rec);
2330 rec = &el->l_recs[0];
2335 rec = &el->l_recs[1];
2338 range = le32_to_cpu(rec->e_cpos) + ocfs2_rec_clusters(el, rec);
2527 struct ocfs2_extent_list *el;
2541 el = &eb->h_list;
2542 BUG_ON(le16_to_cpu(el->l_next_free_rec) == 0);
2543 idx = le16_to_cpu(el->l_next_free_rec) - 1;
2544 rec = &el->l_recs[idx];
2545 range = le32_to_cpu(rec->e_cpos) + ocfs2_rec_clusters(el, rec);
2548 el = path->p_node[i].el;
2549 idx = le16_to_cpu(el->l_next_free_rec) - 1;
2550 rec = &el->l_recs[idx];
2568 struct ocfs2_extent_list *el;
2579 el = &eb->h_list;
2580 if (le16_to_cpu(el->l_next_free_rec) > 1) {
2586 le16_to_cpu(el->l_next_free_rec));
2593 el->l_next_free_rec = 0;
2594 memset(&el->l_recs[0], 0, sizeof(struct ocfs2_extent_rec));
2615 struct ocfs2_extent_list *root_el = left_path->p_node[subtree_index].el;
2808 struct ocfs2_extent_list *el;
2822 el = path->p_node[i].el;
2828 next_free = le16_to_cpu(el->l_next_free_rec);
2829 for(j = 0; j < le16_to_cpu(el->l_next_free_rec); j++) {
2830 if (le64_to_cpu(el->l_recs[j].e_blkno) == blkno) {
2849 *cpos = le32_to_cpu(el->l_recs[j + 1].e_cpos);
2878 struct ocfs2_extent_list *el = path_leaf_el(path);
2880 if (!ocfs2_is_empty_extent(&el->l_recs[0]))
2890 ocfs2_remove_empty_extent(el);
3023 struct ocfs2_extent_list *el;
3088 el = et->et_root_el;
3089 el->l_tree_depth = 0;
3090 el->l_next_free_rec = 0;
3091 memset(&el->l_recs[0], 0, sizeof(struct ocfs2_extent_rec));
3151 struct ocfs2_extent_list *el;
3153 el = path_leaf_el(path);
3154 if (!ocfs2_is_empty_extent(&el->l_recs[0]))
3183 el = &eb->h_list;
3190 if (le16_to_cpu(el->l_next_free_rec) > 1)
3193 if (le16_to_cpu(el->l_next_free_rec) == 0) {
3254 static void ocfs2_cleanup_merge(struct ocfs2_extent_list *el,
3257 struct ocfs2_extent_rec *rec = &el->l_recs[index];
3272 BUG_ON(ocfs2_is_empty_extent(&el->l_recs[0]));
3274 memmove(&el->l_recs[1], &el->l_recs[0], size);
3282 memset(&el->l_recs[0], 0, sizeof(struct ocfs2_extent_rec));
3353 struct ocfs2_extent_list *el = path_leaf_el(left_path);
3357 BUG_ON(index >= le16_to_cpu(el->l_next_free_rec));
3358 left_rec = &el->l_recs[index];
3360 if (index == le16_to_cpu(el->l_next_free_rec) - 1 &&
3361 le16_to_cpu(el->l_next_free_rec) == le16_to_cpu(el->l_count)) {
3421 BUG_ON(index == le16_to_cpu(el->l_next_free_rec) - 1);
3422 right_rec = &el->l_recs[index + 1];
3440 ocfs2_cleanup_merge(el, index);
3517 struct ocfs2_extent_list *el = path_leaf_el(right_path);
3525 right_rec = &el->l_recs[index];
3582 left_rec = &el->l_recs[index - 1];
3583 if (ocfs2_is_empty_extent(&el->l_recs[0]))
3608 ocfs2_cleanup_merge(el, index);
3620 le16_to_cpu(el->l_next_free_rec) == 1) {
3661 struct ocfs2_extent_list *el = path_leaf_el(path);
3662 struct ocfs2_extent_rec *rec = &el->l_recs[split_index];
3688 rec = &el->l_recs[split_index];
3721 BUG_ON(!ocfs2_is_empty_extent(&el->l_recs[0]));
3739 rec = &el->l_recs[split_index];
3860 struct ocfs2_extent_list *el,
3867 BUG_ON(le16_to_cpu(el->l_tree_depth) != 0);
3870 i = ocfs2_search_extent_list(el, le32_to_cpu(insert_rec->e_cpos));
3872 rec = &el->l_recs[i];
3883 rec = &el->l_recs[i];
3896 if (le16_to_cpu(el->l_next_free_rec) == 0 ||
3897 ((le16_to_cpu(el->l_next_free_rec) == 1) &&
3898 ocfs2_is_empty_extent(&el->l_recs[0]))) {
3899 el->l_recs[0] = *insert_rec;
3900 el->l_next_free_rec = cpu_to_le16(1);
3908 i = le16_to_cpu(el->l_next_free_rec) - 1;
3909 rec = &el->l_recs[i];
3914 mlog_bug_on_msg(le16_to_cpu(el->l_next_free_rec) >=
3915 le16_to_cpu(el->l_count),
3920 le16_to_cpu(el->l_tree_depth),
3921 le16_to_cpu(el->l_count),
3922 le16_to_cpu(el->l_next_free_rec),
3923 le32_to_cpu(el->l_recs[i].e_cpos),
3924 le16_to_cpu(el->l_recs[i].e_leaf_clusters),
3928 el->l_recs[i] = *insert_rec;
3929 le16_add_cpu(&el->l_next_free_rec, 1);
3944 ocfs2_rotate_leaf(el, insert_rec);
3954 struct ocfs2_extent_list *el;
3962 el = path->p_node[i].el;
3964 next_free = le16_to_cpu(el->l_next_free_rec);
3972 rec = &el->l_recs[next_free - 1];
3991 struct ocfs2_extent_list *el;
4007 el = path_leaf_el(right_path);
4008 next_free = le16_to_cpu(el->l_next_free_rec);
4010 (next_free == 1 && ocfs2_is_empty_extent(&el->l_recs[0]))) {
4077 struct ocfs2_extent_list *left_el = NULL, *right_el, *insert_el, *el;
4084 el = right_el;
4086 index = ocfs2_search_extent_list(el, cpos);
4089 BUG_ON(ocfs2_is_empty_extent(&el->l_recs[0]));
4121 el = left_el;
4135 el = left_el;
4137 index = ocfs2_search_extent_list(el, cpos);
4141 rec = &el->l_recs[index];
4245 struct ocfs2_extent_list *el;
4247 el = et->et_root_el;
4256 if (le16_to_cpu(el->l_tree_depth) == 0) {
4257 ocfs2_insert_at_leaf(et, insert_rec, el, type);
4350 struct ocfs2_extent_list *el, int index,
4365 rec = &el->l_recs[index - 1];
4408 if (split_rec->e_cpos == el->l_recs[index].e_cpos)
4416 if (index < (le16_to_cpu(el->l_next_free_rec) - 1))
4417 rec = &el->l_recs[index + 1];
4418 else if (le16_to_cpu(el->l_next_free_rec) == le16_to_cpu(el->l_count) &&
4478 struct ocfs2_extent_list *el,
4484 BUG_ON(le16_to_cpu(el->l_tree_depth) != 0);
4486 for(i = 0; i < le16_to_cpu(el->l_next_free_rec); i++) {
4487 contig_type = ocfs2_et_extent_contig(et, &el->l_recs[i],
4498 &el->l_recs[insert->ins_contig_index];
4523 struct ocfs2_extent_list *el,
4532 BUG_ON(le16_to_cpu(el->l_tree_depth) != 0);
4534 if (!el->l_next_free_rec)
4537 if (ocfs2_is_empty_extent(&el->l_recs[0])) {
4539 if (le16_to_cpu(el->l_next_free_rec) == 1)
4543 i = le16_to_cpu(el->l_next_free_rec) - 1;
4544 rec = &el->l_recs[i];
4577 struct ocfs2_extent_list *el;
4583 el = et->et_root_el;
4584 insert->ins_tree_depth = le16_to_cpu(el->l_tree_depth);
4586 if (el->l_tree_depth) {
4601 el = &eb->h_list;
4612 *free_records = le16_to_cpu(el->l_count) -
4613 le16_to_cpu(el->l_next_free_rec);
4616 ocfs2_figure_contig_type(et, insert, el, insert_rec);
4617 ocfs2_figure_appending_type(insert, el, insert_rec);
4640 el = path_leaf_el(path);
4650 ocfs2_figure_contig_type(et, insert, el, insert_rec);
4681 ocfs2_figure_appending_type(insert, el, insert_rec);
4982 struct ocfs2_extent_list *el;
4996 el = path_leaf_el(path);
4997 split_index = ocfs2_search_extent_list(el, cpos);
5016 struct ocfs2_extent_list *el,
5029 el->l_recs[split_index] = *split_rec;
5064 struct ocfs2_extent_list *el = path_leaf_el(path);
5066 struct ocfs2_extent_rec *rec = &el->l_recs[split_index];
5077 ret = ocfs2_figure_merge_contig_type(et, path, el,
5107 ctxt.c_has_empty_extent = ocfs2_is_empty_extent(&el->l_recs[0]);
5115 ret = ocfs2_replace_extent_rec(handle, et, path, el,
5160 struct ocfs2_extent_list *el;
5175 el = path_leaf_el(left_path);
5177 index = ocfs2_search_extent_list(el, cpos);
5188 rec = &el->l_recs[index];
5279 struct ocfs2_extent_list *rightmost_el, *el;
5287 el = path_leaf_el(path);
5288 rec = &el->l_recs[index];
5351 struct ocfs2_extent_list *el = path_leaf_el(path);
5355 if (ocfs2_is_empty_extent(&el->l_recs[0]) && index > 0) {
5374 if (index == (le16_to_cpu(el->l_next_free_rec) - 1) &&
5387 rec = &el->l_recs[index];
5409 if (left_cpos && le16_to_cpu(el->l_next_free_rec) > 1) {
5446 rec_range = le32_to_cpu(rec->e_cpos) + ocfs2_rec_clusters(el, rec);
5453 ocfs2_cleanup_merge(el, index);
5455 next_free = le16_to_cpu(el->l_next_free_rec);
5461 rec = &el->l_recs[next_free - 1];
5513 struct ocfs2_extent_list *el;
5535 el = path_leaf_el(path);
5536 index = ocfs2_search_extent_list(el, cpos);
5562 rec = &el->l_recs[index];
5563 rec_range = le32_to_cpu(rec->e_cpos) + ocfs2_rec_clusters(el, rec);
5571 ocfs2_rec_clusters(el, rec));
5600 el = path_leaf_el(path);
5601 index = ocfs2_search_extent_list(el, cpos);
5615 rec = &el->l_recs[index];
5617 ocfs2_rec_clusters(el, rec);
5623 ocfs2_rec_clusters(el, rec));
7211 struct ocfs2_extent_list *el;
7262 * By now, el will point to the extent list on the bottom most
7272 el = path_leaf_el(path);
7273 if (le16_to_cpu(el->l_next_free_rec) == 0) {
7282 i = le16_to_cpu(el->l_next_free_rec) - 1;
7283 rec = &el->l_recs[i];
7285 range = le32_to_cpu(rec->e_cpos) + ocfs2_rec_clusters(el, rec);
7315 trunc_len = ocfs2_rec_clusters(el, rec);