Lines Matching refs:eh

141 ext4_ext_walk_header(struct inode *ip, struct ext4_extent_header *eh, int depth)
145 error = ext4_ext_check_header(ip, eh, depth);
151 eh, le16toh(eh->eh_ecount),
152 le16toh(eh->eh_max), le16toh(eh->eh_depth),
153 le32toh(eh->eh_gen));
155 for (i = 0; i < le16toh(eh->eh_ecount) && error == 0; i++)
156 if (eh->eh_depth != 0)
158 (struct ext4_extent_index *)(eh + 1 + i), depth - 1,
162 (struct ext4_extent *)(eh + 1 + i));
403 ext4_validate_extent_entries(struct inode *ip, struct ext4_extent_header *eh,
408 count = le16toh(eh->eh_ecount);
413 struct ext4_extent *ext = EXT_FIRST_EXTENT(eh);
433 struct ext4_extent_index *ext_idx = EXT_FIRST_INDEX(eh);
447 ext4_ext_check_header(struct inode *ip, struct ext4_extent_header *eh,
456 if (le16toh(eh->eh_magic) != EXT4_EXT_MAGIC) {
460 if (le16toh(eh->eh_depth) != depth ||
461 le16toh(eh->eh_depth) > EXT4_EXT_DEPTH_MAX)
466 if (eh->eh_max == 0) {
470 if (le16toh(eh->eh_max) > ext4_ext_max_entries(ip, depth)) {
474 if (le16toh(eh->eh_ecount) > le16toh(eh->eh_max)) {
478 if (le16toh(eh->eh_depth) > EXT4_EXT_DEPTH_MAX) {
482 if (ext4_validate_extent_entries(ip, eh, depth)) {
497 struct ext4_extent_header *eh;
500 eh = path->ep_header;
502 KASSERT(le16toh(eh->eh_ecount) <= le16toh(eh->eh_max) &&
503 le16toh(eh->eh_ecount) > 0,
506 l = EXT_FIRST_INDEX(eh) + 1;
507 r = EXT_FIRST_INDEX(eh) + le16toh(eh->eh_ecount) - 1;
522 struct ext4_extent_header *eh;
525 eh = path->ep_header;
527 KASSERT(le16toh(eh->eh_ecount) <= le16toh(eh->eh_max),
530 if (eh->eh_ecount == 0)
533 l = EXT_FIRST_EXTENT(eh) + 1;
534 r = EXT_FIRST_EXTENT(eh) + le16toh(eh->eh_ecount) - 1;
603 struct ext4_extent_header *eh;
609 eh = ext4_ext_inode_header(ip);
614 error = ext4_ext_check_header(ip, eh, depth);
630 path[0].ep_header = eh;
659 eh = ext4_ext_block_header(path[ppos].ep_data);
660 if (ext4_ext_check_header(ip, eh, i - 1) ||
666 path[ppos].ep_header = eh;
671 error = ext4_ext_check_header(ip, eh, 0);
677 path[ppos].ep_header = eh;
1199 struct ext4_extent_header *eh;
1205 eh = path[depth].ep_header;
1208 if (ex == NULL || eh == NULL)
1215 if (ex != EXT_FIRST_EXTENT(eh))
1238 struct ext4_extent_header * eh;
1253 eh = path[depth].ep_header;
1260 eh = path[depth].ep_header;
1261 if (le16toh(eh->eh_ecount) < le16toh(eh->eh_max))
1265 nex = EXT_LAST_EXTENT(eh);
1281 eh = npath[depth].ep_header;
1282 if (le16toh(eh->eh_ecount) < le16toh(eh->eh_max)) {
1297 eh = path[depth].ep_header;
1303 path[depth].ep_ext = EXT_FIRST_EXTENT(eh);
1305 if (nearex != EXT_LAST_EXTENT(eh)) {
1306 len = EXT_MAX_EXTENT(eh) - nearex;
1313 len = (EXT_MAX_EXTENT(eh) - nearex) * sizeof(struct ext4_extent);
1319 eh->eh_ecount = htole16(le16toh(eh->eh_ecount) + 1);
1328 while (nearex < EXT_LAST_EXTENT(eh)) {
1335 if (nearex + 1 < EXT_LAST_EXTENT(eh)) {
1336 len = (EXT_LAST_EXTENT(eh) - nearex - 1) *
1341 eh->eh_ecount = htole16(le16toh(eh->eh_ecount) - 1);
1342 KASSERT(le16toh(eh->eh_ecount) != 0,
1551 struct ext4_extent_header *eh;
1567 eh = path[depth].ep_header;
1568 if (!eh) {
1574 ex = EXT_LAST_EXTENT(eh);
1580 while (ex >= EXT_FIRST_EXTENT(eh) && ex_blk + ex_len > start) {
1601 if (ex == EXT_FIRST_EXTENT(eh))
1610 eh->eh_ecount = htole16(le16toh(eh->eh_ecount) - 1);
1623 if (correct_index && le16toh(eh->eh_ecount))
1630 if (error == 0 && eh->eh_ecount == 0 &&
1643 struct ext4_extent_header *eh;
1654 eh = ext4_ext_block_header(bp->b_data);
1655 if (le16toh(eh->eh_depth) != depth) {
1661 error = ext4_ext_check_header(ip, eh, depth);