Lines Matching refs:em
223 struct extent_map *em = NULL; in test_btrfs_get_extent() local
261 em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, sectorsize); in test_btrfs_get_extent()
262 if (IS_ERR(em)) { in test_btrfs_get_extent()
263 em = NULL; in test_btrfs_get_extent()
267 if (em->disk_bytenr != EXTENT_MAP_HOLE) { in test_btrfs_get_extent()
268 test_err("expected a hole, got %llu", em->disk_bytenr); in test_btrfs_get_extent()
271 free_extent_map(em); in test_btrfs_get_extent()
281 em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, (u64)-1); in test_btrfs_get_extent()
282 if (IS_ERR(em)) { in test_btrfs_get_extent()
286 if (em->disk_bytenr != EXTENT_MAP_INLINE) { in test_btrfs_get_extent()
287 test_err("expected an inline, got %llu", em->disk_bytenr); in test_btrfs_get_extent()
301 if (em->start != 0 || em->len != sectorsize) { in test_btrfs_get_extent()
304 sectorsize, em->start, em->len); in test_btrfs_get_extent()
307 if (em->flags != 0) { in test_btrfs_get_extent()
308 test_err("unexpected flags set, want 0 have %u", em->flags); in test_btrfs_get_extent()
316 offset = em->start + em->len; in test_btrfs_get_extent()
317 free_extent_map(em); in test_btrfs_get_extent()
319 em = btrfs_get_extent(BTRFS_I(inode), NULL, offset, sectorsize); in test_btrfs_get_extent()
320 if (IS_ERR(em)) { in test_btrfs_get_extent()
324 if (em->disk_bytenr != EXTENT_MAP_HOLE) { in test_btrfs_get_extent()
325 test_err("expected a hole, got %llu", em->disk_bytenr); in test_btrfs_get_extent()
328 if (em->start != offset || em->len != 4) { in test_btrfs_get_extent()
331 offset, em->start, em->len); in test_btrfs_get_extent()
334 if (em->flags != 0) { in test_btrfs_get_extent()
335 test_err("unexpected flags set, want 0 have %u", em->flags); in test_btrfs_get_extent()
338 offset = em->start + em->len; in test_btrfs_get_extent()
339 free_extent_map(em); in test_btrfs_get_extent()
342 em = btrfs_get_extent(BTRFS_I(inode), NULL, offset, sectorsize); in test_btrfs_get_extent()
343 if (IS_ERR(em)) { in test_btrfs_get_extent()
347 if (em->disk_bytenr >= EXTENT_MAP_LAST_BYTE) { in test_btrfs_get_extent()
348 test_err("expected a real extent, got %llu", em->disk_bytenr); in test_btrfs_get_extent()
351 if (em->start != offset || em->len != sectorsize - 1) { in test_btrfs_get_extent()
354 offset, em->start, em->len); in test_btrfs_get_extent()
357 if (em->flags != 0) { in test_btrfs_get_extent()
358 test_err("unexpected flags set, want 0 have %u", em->flags); in test_btrfs_get_extent()
361 if (em->offset != 0) { in test_btrfs_get_extent()
362 test_err("wrong offset, want 0, have %llu", em->offset); in test_btrfs_get_extent()
365 offset = em->start + em->len; in test_btrfs_get_extent()
366 free_extent_map(em); in test_btrfs_get_extent()
369 em = btrfs_get_extent(BTRFS_I(inode), NULL, offset, sectorsize); in test_btrfs_get_extent()
370 if (IS_ERR(em)) { in test_btrfs_get_extent()
374 if (em->disk_bytenr >= EXTENT_MAP_LAST_BYTE) { in test_btrfs_get_extent()
375 test_err("expected a real extent, got %llu", em->disk_bytenr); in test_btrfs_get_extent()
378 if (em->start != offset || em->len != sectorsize) { in test_btrfs_get_extent()
381 offset, sectorsize, em->start, em->len); in test_btrfs_get_extent()
384 if (em->flags != 0) { in test_btrfs_get_extent()
385 test_err("unexpected flags set, want 0 have %u", em->flags); in test_btrfs_get_extent()
388 if (em->offset != 0) { in test_btrfs_get_extent()
389 test_err("wrong offset, want 0, have %llu", em->offset); in test_btrfs_get_extent()
392 disk_bytenr = extent_map_block_start(em); in test_btrfs_get_extent()
393 orig_start = em->start; in test_btrfs_get_extent()
394 offset = em->start + em->len; in test_btrfs_get_extent()
395 free_extent_map(em); in test_btrfs_get_extent()
397 em = btrfs_get_extent(BTRFS_I(inode), NULL, offset, sectorsize); in test_btrfs_get_extent()
398 if (IS_ERR(em)) { in test_btrfs_get_extent()
402 if (em->disk_bytenr != EXTENT_MAP_HOLE) { in test_btrfs_get_extent()
403 test_err("expected a hole, got %llu", em->disk_bytenr); in test_btrfs_get_extent()
406 if (em->start != offset || em->len != sectorsize) { in test_btrfs_get_extent()
409 offset, sectorsize, em->start, em->len); in test_btrfs_get_extent()
412 if (em->flags != 0) { in test_btrfs_get_extent()
413 test_err("unexpected flags set, want 0 have %u", em->flags); in test_btrfs_get_extent()
416 offset = em->start + em->len; in test_btrfs_get_extent()
417 free_extent_map(em); in test_btrfs_get_extent()
419 em = btrfs_get_extent(BTRFS_I(inode), NULL, offset, sectorsize); in test_btrfs_get_extent()
420 if (IS_ERR(em)) { in test_btrfs_get_extent()
424 if (em->disk_bytenr >= EXTENT_MAP_LAST_BYTE) { in test_btrfs_get_extent()
425 test_err("expected a real extent, got %llu", em->disk_bytenr); in test_btrfs_get_extent()
428 if (em->start != offset || em->len != 2 * sectorsize) { in test_btrfs_get_extent()
431 offset, 2 * sectorsize, em->start, em->len); in test_btrfs_get_extent()
434 if (em->flags != 0) { in test_btrfs_get_extent()
435 test_err("unexpected flags set, want 0 have %u", em->flags); in test_btrfs_get_extent()
438 if (em->start - em->offset != orig_start) { in test_btrfs_get_extent()
440 em->start, em->offset, orig_start); in test_btrfs_get_extent()
443 disk_bytenr += (em->start - orig_start); in test_btrfs_get_extent()
444 if (extent_map_block_start(em) != disk_bytenr) { in test_btrfs_get_extent()
446 disk_bytenr, extent_map_block_start(em)); in test_btrfs_get_extent()
449 offset = em->start + em->len; in test_btrfs_get_extent()
450 free_extent_map(em); in test_btrfs_get_extent()
453 em = btrfs_get_extent(BTRFS_I(inode), NULL, offset, sectorsize); in test_btrfs_get_extent()
454 if (IS_ERR(em)) { in test_btrfs_get_extent()
458 if (em->disk_bytenr >= EXTENT_MAP_LAST_BYTE) { in test_btrfs_get_extent()
459 test_err("expected a real extent, got %llu", em->disk_bytenr); in test_btrfs_get_extent()
462 if (em->start != offset || em->len != sectorsize) { in test_btrfs_get_extent()
465 offset, sectorsize, em->start, em->len); in test_btrfs_get_extent()
468 if (em->flags != prealloc_only) { in test_btrfs_get_extent()
470 prealloc_only, em->flags); in test_btrfs_get_extent()
473 if (em->offset != 0) { in test_btrfs_get_extent()
474 test_err("wrong offset, want 0, have %llu", em->offset); in test_btrfs_get_extent()
477 offset = em->start + em->len; in test_btrfs_get_extent()
478 free_extent_map(em); in test_btrfs_get_extent()
481 em = btrfs_get_extent(BTRFS_I(inode), NULL, offset, sectorsize); in test_btrfs_get_extent()
482 if (IS_ERR(em)) { in test_btrfs_get_extent()
486 if (em->disk_bytenr >= EXTENT_MAP_LAST_BYTE) { in test_btrfs_get_extent()
487 test_err("expected a real extent, got %llu", em->disk_bytenr); in test_btrfs_get_extent()
490 if (em->start != offset || em->len != sectorsize) { in test_btrfs_get_extent()
493 offset, sectorsize, em->start, em->len); in test_btrfs_get_extent()
496 if (em->flags != prealloc_only) { in test_btrfs_get_extent()
498 prealloc_only, em->flags); in test_btrfs_get_extent()
501 if (em->offset != 0) { in test_btrfs_get_extent()
502 test_err("wrong offset, want 0, have %llu", em->offset); in test_btrfs_get_extent()
505 disk_bytenr = extent_map_block_start(em); in test_btrfs_get_extent()
506 orig_start = em->start; in test_btrfs_get_extent()
507 offset = em->start + em->len; in test_btrfs_get_extent()
508 free_extent_map(em); in test_btrfs_get_extent()
510 em = btrfs_get_extent(BTRFS_I(inode), NULL, offset, sectorsize); in test_btrfs_get_extent()
511 if (IS_ERR(em)) { in test_btrfs_get_extent()
515 if (em->disk_bytenr >= EXTENT_MAP_HOLE) { in test_btrfs_get_extent()
516 test_err("expected a real extent, got %llu", em->disk_bytenr); in test_btrfs_get_extent()
519 if (em->start != offset || em->len != sectorsize) { in test_btrfs_get_extent()
522 offset, sectorsize, em->start, em->len); in test_btrfs_get_extent()
525 if (em->flags != 0) { in test_btrfs_get_extent()
526 test_err("unexpected flags set, want 0 have %u", em->flags); in test_btrfs_get_extent()
529 if (em->start - em->offset != orig_start) { in test_btrfs_get_extent()
531 em->start - orig_start, em->offset); in test_btrfs_get_extent()
534 if (extent_map_block_start(em) != disk_bytenr + em->offset) { in test_btrfs_get_extent()
536 disk_bytenr + em->offset, extent_map_block_start(em)); in test_btrfs_get_extent()
539 offset = em->start + em->len; in test_btrfs_get_extent()
540 free_extent_map(em); in test_btrfs_get_extent()
542 em = btrfs_get_extent(BTRFS_I(inode), NULL, offset, sectorsize); in test_btrfs_get_extent()
543 if (IS_ERR(em)) { in test_btrfs_get_extent()
547 if (em->disk_bytenr >= EXTENT_MAP_LAST_BYTE) { in test_btrfs_get_extent()
548 test_err("expected a real extent, got %llu", em->disk_bytenr); in test_btrfs_get_extent()
551 if (em->start != offset || em->len != 2 * sectorsize) { in test_btrfs_get_extent()
554 offset, 2 * sectorsize, em->start, em->len); in test_btrfs_get_extent()
557 if (em->flags != prealloc_only) { in test_btrfs_get_extent()
559 prealloc_only, em->flags); in test_btrfs_get_extent()
562 if (em->start - em->offset != orig_start) { in test_btrfs_get_extent()
564 em->start, em->offset, orig_start); in test_btrfs_get_extent()
567 if (extent_map_block_start(em) != disk_bytenr + em->offset) { in test_btrfs_get_extent()
569 disk_bytenr + em->offset, extent_map_block_start(em)); in test_btrfs_get_extent()
572 offset = em->start + em->len; in test_btrfs_get_extent()
573 free_extent_map(em); in test_btrfs_get_extent()
576 em = btrfs_get_extent(BTRFS_I(inode), NULL, offset, sectorsize); in test_btrfs_get_extent()
577 if (IS_ERR(em)) { in test_btrfs_get_extent()
581 if (em->disk_bytenr >= EXTENT_MAP_LAST_BYTE) { in test_btrfs_get_extent()
582 test_err("expected a real extent, got %llu", em->disk_bytenr); in test_btrfs_get_extent()
585 if (em->start != offset || em->len != 2 * sectorsize) { in test_btrfs_get_extent()
588 offset, 2 * sectorsize, em->start, em->len); in test_btrfs_get_extent()
591 if (em->flags != compressed_only) { in test_btrfs_get_extent()
593 compressed_only, em->flags); in test_btrfs_get_extent()
596 if (em->offset != 0) { in test_btrfs_get_extent()
597 test_err("wrong offset, want 0, have %llu", em->offset); in test_btrfs_get_extent()
600 if (extent_map_compression(em) != BTRFS_COMPRESS_ZLIB) { in test_btrfs_get_extent()
602 BTRFS_COMPRESS_ZLIB, extent_map_compression(em)); in test_btrfs_get_extent()
605 offset = em->start + em->len; in test_btrfs_get_extent()
606 free_extent_map(em); in test_btrfs_get_extent()
609 em = btrfs_get_extent(BTRFS_I(inode), NULL, offset, sectorsize); in test_btrfs_get_extent()
610 if (IS_ERR(em)) { in test_btrfs_get_extent()
614 if (em->disk_bytenr >= EXTENT_MAP_LAST_BYTE) { in test_btrfs_get_extent()
615 test_err("expected a real extent, got %llu", em->disk_bytenr); in test_btrfs_get_extent()
618 if (em->start != offset || em->len != sectorsize) { in test_btrfs_get_extent()
621 offset, sectorsize, em->start, em->len); in test_btrfs_get_extent()
624 if (em->flags != compressed_only) { in test_btrfs_get_extent()
626 compressed_only, em->flags); in test_btrfs_get_extent()
629 if (em->offset != 0) { in test_btrfs_get_extent()
630 test_err("wrong offset, want 0, have %llu", em->offset); in test_btrfs_get_extent()
633 if (extent_map_compression(em) != BTRFS_COMPRESS_ZLIB) { in test_btrfs_get_extent()
635 BTRFS_COMPRESS_ZLIB, extent_map_compression(em)); in test_btrfs_get_extent()
638 disk_bytenr = extent_map_block_start(em); in test_btrfs_get_extent()
639 orig_start = em->start; in test_btrfs_get_extent()
640 offset = em->start + em->len; in test_btrfs_get_extent()
641 free_extent_map(em); in test_btrfs_get_extent()
643 em = btrfs_get_extent(BTRFS_I(inode), NULL, offset, sectorsize); in test_btrfs_get_extent()
644 if (IS_ERR(em)) { in test_btrfs_get_extent()
648 if (em->disk_bytenr >= EXTENT_MAP_LAST_BYTE) { in test_btrfs_get_extent()
649 test_err("expected a real extent, got %llu", em->disk_bytenr); in test_btrfs_get_extent()
652 if (em->start != offset || em->len != sectorsize) { in test_btrfs_get_extent()
655 offset, sectorsize, em->start, em->len); in test_btrfs_get_extent()
658 if (em->flags != 0) { in test_btrfs_get_extent()
659 test_err("unexpected flags set, want 0 have %u", em->flags); in test_btrfs_get_extent()
662 if (em->offset != 0) { in test_btrfs_get_extent()
663 test_err("wrong offset, want 0, have %llu", em->offset); in test_btrfs_get_extent()
666 offset = em->start + em->len; in test_btrfs_get_extent()
667 free_extent_map(em); in test_btrfs_get_extent()
669 em = btrfs_get_extent(BTRFS_I(inode), NULL, offset, sectorsize); in test_btrfs_get_extent()
670 if (IS_ERR(em)) { in test_btrfs_get_extent()
674 if (extent_map_block_start(em) != disk_bytenr) { in test_btrfs_get_extent()
676 disk_bytenr, extent_map_block_start(em)); in test_btrfs_get_extent()
679 if (em->start != offset || em->len != 2 * sectorsize) { in test_btrfs_get_extent()
682 offset, 2 * sectorsize, em->start, em->len); in test_btrfs_get_extent()
685 if (em->flags != compressed_only) { in test_btrfs_get_extent()
687 compressed_only, em->flags); in test_btrfs_get_extent()
690 if (em->start - em->offset != orig_start) { in test_btrfs_get_extent()
692 em->start, em->offset, orig_start); in test_btrfs_get_extent()
695 if (extent_map_compression(em) != BTRFS_COMPRESS_ZLIB) { in test_btrfs_get_extent()
697 BTRFS_COMPRESS_ZLIB, extent_map_compression(em)); in test_btrfs_get_extent()
700 offset = em->start + em->len; in test_btrfs_get_extent()
701 free_extent_map(em); in test_btrfs_get_extent()
704 em = btrfs_get_extent(BTRFS_I(inode), NULL, offset + 6, sectorsize); in test_btrfs_get_extent()
705 if (IS_ERR(em)) { in test_btrfs_get_extent()
709 if (em->disk_bytenr >= EXTENT_MAP_LAST_BYTE) { in test_btrfs_get_extent()
710 test_err("expected a real extent, got %llu", em->disk_bytenr); in test_btrfs_get_extent()
713 if (em->start != offset || em->len != sectorsize) { in test_btrfs_get_extent()
716 offset, sectorsize, em->start, em->len); in test_btrfs_get_extent()
719 if (em->flags != 0) { in test_btrfs_get_extent()
720 test_err("unexpected flags set, want 0 have %u", em->flags); in test_btrfs_get_extent()
723 if (em->offset != 0) { in test_btrfs_get_extent()
724 test_err("wrong offset, want 0, have %llu", em->offset); in test_btrfs_get_extent()
727 offset = em->start + em->len; in test_btrfs_get_extent()
728 free_extent_map(em); in test_btrfs_get_extent()
730 em = btrfs_get_extent(BTRFS_I(inode), NULL, offset, SZ_4M); in test_btrfs_get_extent()
731 if (IS_ERR(em)) { in test_btrfs_get_extent()
735 if (em->disk_bytenr != EXTENT_MAP_HOLE) { in test_btrfs_get_extent()
736 test_err("expected a hole extent, got %llu", em->disk_bytenr); in test_btrfs_get_extent()
744 if (em->start != offset || em->len != 3 * sectorsize) { in test_btrfs_get_extent()
747 offset, 3 * sectorsize, em->start, em->len); in test_btrfs_get_extent()
750 if (em->flags != vacancy_only) { in test_btrfs_get_extent()
752 vacancy_only, em->flags); in test_btrfs_get_extent()
755 if (em->offset != 0) { in test_btrfs_get_extent()
756 test_err("wrong offset, want 0, have %llu", em->offset); in test_btrfs_get_extent()
759 offset = em->start + em->len; in test_btrfs_get_extent()
760 free_extent_map(em); in test_btrfs_get_extent()
762 em = btrfs_get_extent(BTRFS_I(inode), NULL, offset, sectorsize); in test_btrfs_get_extent()
763 if (IS_ERR(em)) { in test_btrfs_get_extent()
767 if (em->disk_bytenr >= EXTENT_MAP_LAST_BYTE) { in test_btrfs_get_extent()
768 test_err("expected a real extent, got %llu", em->disk_bytenr); in test_btrfs_get_extent()
771 if (em->start != offset || em->len != sectorsize) { in test_btrfs_get_extent()
774 offset, sectorsize, em->start, em->len); in test_btrfs_get_extent()
777 if (em->flags != 0) { in test_btrfs_get_extent()
778 test_err("unexpected flags set, want 0 have %u", em->flags); in test_btrfs_get_extent()
781 if (em->offset != 0) { in test_btrfs_get_extent()
782 test_err("wrong orig offset, want 0, have %llu", em->offset); in test_btrfs_get_extent()
787 if (!IS_ERR(em)) in test_btrfs_get_extent()
788 free_extent_map(em); in test_btrfs_get_extent()
800 struct extent_map *em = NULL; in test_hole_first() local
841 em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, 2 * sectorsize); in test_hole_first()
842 if (IS_ERR(em)) { in test_hole_first()
846 if (em->disk_bytenr != EXTENT_MAP_HOLE) { in test_hole_first()
847 test_err("expected a hole, got %llu", em->disk_bytenr); in test_hole_first()
850 if (em->start != 0 || em->len != sectorsize) { in test_hole_first()
853 sectorsize, em->start, em->len); in test_hole_first()
856 if (em->flags != vacancy_only) { in test_hole_first()
858 em->flags); in test_hole_first()
861 free_extent_map(em); in test_hole_first()
863 em = btrfs_get_extent(BTRFS_I(inode), NULL, sectorsize, 2 * sectorsize); in test_hole_first()
864 if (IS_ERR(em)) { in test_hole_first()
868 if (extent_map_block_start(em) != sectorsize) { in test_hole_first()
869 test_err("expected a real extent, got %llu", extent_map_block_start(em)); in test_hole_first()
872 if (em->start != sectorsize || em->len != sectorsize) { in test_hole_first()
875 sectorsize, sectorsize, em->start, em->len); in test_hole_first()
878 if (em->flags != 0) { in test_hole_first()
880 em->flags); in test_hole_first()
885 if (!IS_ERR(em)) in test_hole_first()
886 free_extent_map(em); in test_hole_first()