Lines Matching refs:el

588 		node->el = NULL;
631 dest->p_node[i].el = src->p_node[i].el;
653 dest->p_node[i].el = src->p_node[i].el;
656 src->p_node[i].el = NULL;
679 path->p_node[index].el = &eb->h_list;
768 int ocfs2_search_extent_list(struct ocfs2_extent_list *el, u32 v_cluster)
775 for(i = 0; i < le16_to_cpu(el->l_next_free_rec); i++) {
776 rec = &el->l_recs[i];
779 clusters = ocfs2_rec_clusters(el, rec);
953 struct ocfs2_extent_list *el = NULL;
958 el = et->et_root_el;
969 el = &eb->h_list;
972 BUG_ON(el->l_tree_depth != 0);
974 retval = le16_to_cpu(el->l_count) - le16_to_cpu(el->l_next_free_rec);
1079 static inline u32 ocfs2_sum_rightmost_rec(struct ocfs2_extent_list *el)
1083 i = le16_to_cpu(el->l_next_free_rec) - 1;
1085 return le32_to_cpu(el->l_recs[i].e_cpos) +
1086 ocfs2_rec_clusters(el, &el->l_recs[i]);
1098 struct ocfs2_extent_list *el;
1125 el = path_leaf_el(path);
1126 rec = &el->l_recs[le16_to_cpu(el->l_next_free_rec) - 1];
1158 struct ocfs2_extent_list *el;
1165 el = &eb->h_list;
1167 el = et->et_root_el;
1170 BUG_ON(!el->l_tree_depth);
1172 new_blocks = le16_to_cpu(el->l_tree_depth);
1305 /* Link the new branch into the rest of the tree (el will
1307 i = le16_to_cpu(el->l_next_free_rec);
1308 el->l_recs[i].e_blkno = cpu_to_le64(next_blkno);
1309 el->l_recs[i].e_cpos = cpu_to_le32(new_cpos);
1310 el->l_recs[i].e_int_clusters = 0;
1311 le16_add_cpu(&el->l_next_free_rec, 1);
1457 struct ocfs2_extent_list *el;
1463 el = et->et_root_el;
1465 while(le16_to_cpu(el->l_tree_depth) > 1) {
1466 if (le16_to_cpu(el->l_next_free_rec) == 0) {
1472 i = le16_to_cpu(el->l_next_free_rec) - 1;
1473 blkno = le64_to_cpu(el->l_recs[i].e_blkno);
1491 el = &eb->h_list;
1493 if (le16_to_cpu(el->l_next_free_rec) <
1494 le16_to_cpu(el->l_count)) {
1503 el = et->et_root_el;
1504 if (!lowest_bh && (el->l_next_free_rec == el->l_count))
1529 struct ocfs2_extent_list *el = et->et_root_el;
1530 int depth = le16_to_cpu(el->l_tree_depth);
1595 static void ocfs2_shift_records_right(struct ocfs2_extent_list *el)
1597 int next_free = le16_to_cpu(el->l_next_free_rec);
1598 int count = le16_to_cpu(el->l_count);
1607 memmove(&el->l_recs[1], &el->l_recs[0], num_bytes);
1610 static void ocfs2_rotate_leaf(struct ocfs2_extent_list *el,
1617 next_free = le16_to_cpu(el->l_next_free_rec);
1618 has_empty = ocfs2_is_empty_extent(&el->l_recs[0]);
1623 BUG_ON(el->l_next_free_rec == el->l_count && !has_empty);
1636 el->l_recs[i] = el->l_recs[i+1];
1645 rec = &el->l_recs[i];
1654 le16_to_cpu(el->l_count));
1657 BUG_ON(insert_index >= le16_to_cpu(el->l_count));
1664 BUG_ON(next_free >= le16_to_cpu(el->l_count));
1668 memmove(&el->l_recs[insert_index + 1],
1669 &el->l_recs[insert_index],
1679 el->l_next_free_rec = cpu_to_le16(next_free);
1683 BUG_ON(le16_to_cpu(el->l_next_free_rec) > le16_to_cpu(el->l_count));
1685 el->l_recs[insert_index] = *insert_rec;
1689 static void ocfs2_remove_empty_extent(struct ocfs2_extent_list *el)
1691 int size, num_recs = le16_to_cpu(el->l_next_free_rec);
1695 if (ocfs2_is_empty_extent(&el->l_recs[0])) {
1698 memmove(&el->l_recs[0], &el->l_recs[1], size);
1699 memset(&el->l_recs[num_recs], 0,
1701 el->l_next_free_rec = cpu_to_le16(num_recs);
1712 static void ocfs2_create_empty_extent(struct ocfs2_extent_list *el)
1714 int next_free = le16_to_cpu(el->l_next_free_rec);
1716 BUG_ON(le16_to_cpu(el->l_tree_depth) != 0);
1721 if (ocfs2_is_empty_extent(&el->l_recs[0]))
1724 mlog_bug_on_msg(el->l_count == el->l_next_free_rec,
1727 le16_to_cpu(el->l_count),
1728 le16_to_cpu(el->l_tree_depth));
1730 ocfs2_shift_records_right(el);
1733 le16_add_cpu(&el->l_next_free_rec, 1);
1734 memset(&el->l_recs[0], 0, sizeof(struct ocfs2_extent_rec));
1796 struct ocfs2_extent_list *el;
1799 el = root_el;
1800 while (el->l_tree_depth) {
1801 if (le16_to_cpu(el->l_next_free_rec) == 0) {
1805 le16_to_cpu(el->l_tree_depth));
1811 for(i = 0; i < le16_to_cpu(el->l_next_free_rec) - 1; i++) {
1812 rec = &el->l_recs[i];
1820 ocfs2_rec_clusters(el, rec);
1825 blkno = le64_to_cpu(el->l_recs[i].e_blkno);
1830 le16_to_cpu(el->l_tree_depth), i);
1844 el = &eb->h_list;
1846 if (le16_to_cpu(el->l_next_free_rec) >
1847 le16_to_cpu(el->l_count)) {
1852 le16_to_cpu(el->l_next_free_rec),
1853 le16_to_cpu(el->l_count));
1908 struct ocfs2_extent_list *el = &eb->h_list;
1912 if (le16_to_cpu(el->l_tree_depth) == 0) {
2043 struct ocfs2_extent_list *el, *left_el, *right_el;
2070 el = left_path->p_node[i].el;
2072 left_rec = &el->l_recs[idx];
2074 el = right_path->p_node[i].el;
2075 right_rec = &el->l_recs[0];
2086 left_el = left_path->p_node[i].el;
2087 right_el = right_path->p_node[i].el;
2095 el = left_path->p_node[subtree_index].el;
2096 left_el = left_path->p_node[subtree_index + 1].el;
2097 right_el = right_path->p_node[subtree_index + 1].el;
2099 ocfs2_adjust_root_records(el, left_el, right_el,
2215 struct ocfs2_extent_list *el;
2226 el = path->p_node[i].el;
2232 for(j = 0; j < le16_to_cpu(el->l_next_free_rec); j++) {
2233 if (le64_to_cpu(el->l_recs[j].e_blkno) == blkno) {
2252 *cpos = le32_to_cpu(el->l_recs[j - 1].e_cpos);
2253 *cpos = *cpos + ocfs2_rec_clusters(el,
2254 &el->l_recs[j - 1]);
2323 static int ocfs2_leftmost_rec_contains(struct ocfs2_extent_list *el, u32 cpos)
2325 int next_free = le16_to_cpu(el->l_next_free_rec);
2332 rec = &el->l_recs[0];
2337 rec = &el->l_recs[1];
2340 range = le32_to_cpu(rec->e_cpos) + ocfs2_rec_clusters(el, rec);
2529 struct ocfs2_extent_list *el;
2543 el = &eb->h_list;
2544 BUG_ON(le16_to_cpu(el->l_next_free_rec) == 0);
2545 idx = le16_to_cpu(el->l_next_free_rec) - 1;
2546 rec = &el->l_recs[idx];
2547 range = le32_to_cpu(rec->e_cpos) + ocfs2_rec_clusters(el, rec);
2550 el = path->p_node[i].el;
2551 idx = le16_to_cpu(el->l_next_free_rec) - 1;
2552 rec = &el->l_recs[idx];
2570 struct ocfs2_extent_list *el;
2581 el = &eb->h_list;
2582 if (le16_to_cpu(el->l_next_free_rec) > 1) {
2588 le16_to_cpu(el->l_next_free_rec));
2595 el->l_next_free_rec = 0;
2596 memset(&el->l_recs[0], 0, sizeof(struct ocfs2_extent_rec));
2617 struct ocfs2_extent_list *root_el = left_path->p_node[subtree_index].el;
2810 struct ocfs2_extent_list *el;
2824 el = path->p_node[i].el;
2830 next_free = le16_to_cpu(el->l_next_free_rec);
2831 for(j = 0; j < le16_to_cpu(el->l_next_free_rec); j++) {
2832 if (le64_to_cpu(el->l_recs[j].e_blkno) == blkno) {
2851 *cpos = le32_to_cpu(el->l_recs[j + 1].e_cpos);
2880 struct ocfs2_extent_list *el = path_leaf_el(path);
2882 if (!ocfs2_is_empty_extent(&el->l_recs[0]))
2892 ocfs2_remove_empty_extent(el);
3025 struct ocfs2_extent_list *el;
3090 el = et->et_root_el;
3091 el->l_tree_depth = 0;
3092 el->l_next_free_rec = 0;
3093 memset(&el->l_recs[0], 0, sizeof(struct ocfs2_extent_rec));
3153 struct ocfs2_extent_list *el;
3155 el = path_leaf_el(path);
3156 if (!ocfs2_is_empty_extent(&el->l_recs[0]))
3185 el = &eb->h_list;
3192 if (le16_to_cpu(el->l_next_free_rec) > 1)
3195 if (le16_to_cpu(el->l_next_free_rec) == 0) {
3256 static void ocfs2_cleanup_merge(struct ocfs2_extent_list *el,
3259 struct ocfs2_extent_rec *rec = &el->l_recs[index];
3274 BUG_ON(ocfs2_is_empty_extent(&el->l_recs[0]));
3276 memmove(&el->l_recs[1], &el->l_recs[0], size);
3284 memset(&el->l_recs[0], 0, sizeof(struct ocfs2_extent_rec));
3355 struct ocfs2_extent_list *el = path_leaf_el(left_path);
3359 BUG_ON(index >= le16_to_cpu(el->l_next_free_rec));
3360 left_rec = &el->l_recs[index];
3362 if (index == le16_to_cpu(el->l_next_free_rec) - 1 &&
3363 le16_to_cpu(el->l_next_free_rec) == le16_to_cpu(el->l_count)) {
3423 BUG_ON(index == le16_to_cpu(el->l_next_free_rec) - 1);
3424 right_rec = &el->l_recs[index + 1];
3442 ocfs2_cleanup_merge(el, index);
3519 struct ocfs2_extent_list *el = path_leaf_el(right_path);
3527 right_rec = &el->l_recs[index];
3584 left_rec = &el->l_recs[index - 1];
3585 if (ocfs2_is_empty_extent(&el->l_recs[0]))
3610 ocfs2_cleanup_merge(el, index);
3622 le16_to_cpu(el->l_next_free_rec) == 1) {
3663 struct ocfs2_extent_list *el = path_leaf_el(path);
3664 struct ocfs2_extent_rec *rec = &el->l_recs[split_index];
3690 rec = &el->l_recs[split_index];
3723 BUG_ON(!ocfs2_is_empty_extent(&el->l_recs[0]));
3741 rec = &el->l_recs[split_index];
3862 struct ocfs2_extent_list *el,
3869 BUG_ON(le16_to_cpu(el->l_tree_depth) != 0);
3872 i = ocfs2_search_extent_list(el, le32_to_cpu(insert_rec->e_cpos));
3874 rec = &el->l_recs[i];
3885 rec = &el->l_recs[i];
3898 if (le16_to_cpu(el->l_next_free_rec) == 0 ||
3899 ((le16_to_cpu(el->l_next_free_rec) == 1) &&
3900 ocfs2_is_empty_extent(&el->l_recs[0]))) {
3901 el->l_recs[0] = *insert_rec;
3902 el->l_next_free_rec = cpu_to_le16(1);
3910 i = le16_to_cpu(el->l_next_free_rec) - 1;
3911 rec = &el->l_recs[i];
3916 mlog_bug_on_msg(le16_to_cpu(el->l_next_free_rec) >=
3917 le16_to_cpu(el->l_count),
3922 le16_to_cpu(el->l_tree_depth),
3923 le16_to_cpu(el->l_count),
3924 le16_to_cpu(el->l_next_free_rec),
3925 le32_to_cpu(el->l_recs[i].e_cpos),
3926 le16_to_cpu(el->l_recs[i].e_leaf_clusters),
3930 el->l_recs[i] = *insert_rec;
3931 le16_add_cpu(&el->l_next_free_rec, 1);
3946 ocfs2_rotate_leaf(el, insert_rec);
3956 struct ocfs2_extent_list *el;
3964 el = path->p_node[i].el;
3966 next_free = le16_to_cpu(el->l_next_free_rec);
3974 rec = &el->l_recs[next_free - 1];
3993 struct ocfs2_extent_list *el;
4009 el = path_leaf_el(right_path);
4010 next_free = le16_to_cpu(el->l_next_free_rec);
4012 (next_free == 1 && ocfs2_is_empty_extent(&el->l_recs[0]))) {
4079 struct ocfs2_extent_list *left_el = NULL, *right_el, *insert_el, *el;
4086 el = right_el;
4088 index = ocfs2_search_extent_list(el, cpos);
4091 BUG_ON(ocfs2_is_empty_extent(&el->l_recs[0]));
4123 el = left_el;
4137 el = left_el;
4139 index = ocfs2_search_extent_list(el, cpos);
4143 rec = &el->l_recs[index];
4247 struct ocfs2_extent_list *el;
4249 el = et->et_root_el;
4258 if (le16_to_cpu(el->l_tree_depth) == 0) {
4259 ocfs2_insert_at_leaf(et, insert_rec, el, type);
4352 struct ocfs2_extent_list *el, int index,
4367 rec = &el->l_recs[index - 1];
4410 if (split_rec->e_cpos == el->l_recs[index].e_cpos)
4418 if (index < (le16_to_cpu(el->l_next_free_rec) - 1))
4419 rec = &el->l_recs[index + 1];
4420 else if (le16_to_cpu(el->l_next_free_rec) == le16_to_cpu(el->l_count) &&
4480 struct ocfs2_extent_list *el,
4486 BUG_ON(le16_to_cpu(el->l_tree_depth) != 0);
4488 for(i = 0; i < le16_to_cpu(el->l_next_free_rec); i++) {
4489 contig_type = ocfs2_et_extent_contig(et, &el->l_recs[i],
4500 &el->l_recs[insert->ins_contig_index];
4525 struct ocfs2_extent_list *el,
4534 BUG_ON(le16_to_cpu(el->l_tree_depth) != 0);
4536 if (!el->l_next_free_rec)
4539 if (ocfs2_is_empty_extent(&el->l_recs[0])) {
4541 if (le16_to_cpu(el->l_next_free_rec) == 1)
4545 i = le16_to_cpu(el->l_next_free_rec) - 1;
4546 rec = &el->l_recs[i];
4579 struct ocfs2_extent_list *el;
4585 el = et->et_root_el;
4586 insert->ins_tree_depth = le16_to_cpu(el->l_tree_depth);
4588 if (el->l_tree_depth) {
4603 el = &eb->h_list;
4614 *free_records = le16_to_cpu(el->l_count) -
4615 le16_to_cpu(el->l_next_free_rec);
4618 ocfs2_figure_contig_type(et, insert, el, insert_rec);
4619 ocfs2_figure_appending_type(insert, el, insert_rec);
4642 el = path_leaf_el(path);
4652 ocfs2_figure_contig_type(et, insert, el, insert_rec);
4683 ocfs2_figure_appending_type(insert, el, insert_rec);
4984 struct ocfs2_extent_list *el;
4998 el = path_leaf_el(path);
4999 split_index = ocfs2_search_extent_list(el, cpos);
5018 struct ocfs2_extent_list *el,
5031 el->l_recs[split_index] = *split_rec;
5066 struct ocfs2_extent_list *el = path_leaf_el(path);
5068 struct ocfs2_extent_rec *rec = &el->l_recs[split_index];
5079 ret = ocfs2_figure_merge_contig_type(et, path, el,
5109 ctxt.c_has_empty_extent = ocfs2_is_empty_extent(&el->l_recs[0]);
5117 ret = ocfs2_replace_extent_rec(handle, et, path, el,
5162 struct ocfs2_extent_list *el;
5177 el = path_leaf_el(left_path);
5179 index = ocfs2_search_extent_list(el, cpos);
5190 rec = &el->l_recs[index];
5281 struct ocfs2_extent_list *rightmost_el, *el;
5289 el = path_leaf_el(path);
5290 rec = &el->l_recs[index];
5353 struct ocfs2_extent_list *el = path_leaf_el(path);
5357 if (ocfs2_is_empty_extent(&el->l_recs[0]) && index > 0) {
5376 if (index == (le16_to_cpu(el->l_next_free_rec) - 1) &&
5389 rec = &el->l_recs[index];
5411 if (left_cpos && le16_to_cpu(el->l_next_free_rec) > 1) {
5448 rec_range = le32_to_cpu(rec->e_cpos) + ocfs2_rec_clusters(el, rec);
5455 ocfs2_cleanup_merge(el, index);
5457 next_free = le16_to_cpu(el->l_next_free_rec);
5463 rec = &el->l_recs[next_free - 1];
5515 struct ocfs2_extent_list *el;
5537 el = path_leaf_el(path);
5538 index = ocfs2_search_extent_list(el, cpos);
5564 rec = &el->l_recs[index];
5565 rec_range = le32_to_cpu(rec->e_cpos) + ocfs2_rec_clusters(el, rec);
5573 ocfs2_rec_clusters(el, rec));
5602 el = path_leaf_el(path);
5603 index = ocfs2_search_extent_list(el, cpos);
5617 rec = &el->l_recs[index];
5619 ocfs2_rec_clusters(el, rec);
5625 ocfs2_rec_clusters(el, rec));
7206 struct ocfs2_extent_list *el;
7257 * By now, el will point to the extent list on the bottom most
7267 el = path_leaf_el(path);
7268 if (le16_to_cpu(el->l_next_free_rec) == 0) {
7277 i = le16_to_cpu(el->l_next_free_rec) - 1;
7278 rec = &el->l_recs[i];
7280 range = le32_to_cpu(rec->e_cpos) + ocfs2_rec_clusters(el, rec);
7310 trunc_len = ocfs2_rec_clusters(el, rec);