Lines Matching refs:sectorsize

96 static void setup_file_extents(struct btrfs_root *root, u32 sectorsize)  in setup_file_extents()  argument
110 offset = sectorsize; in setup_file_extents()
119 insert_extent(root, offset, sectorsize - 1, sectorsize - 1, 0, in setup_file_extents()
120 disk_bytenr, sectorsize - 1, BTRFS_FILE_EXTENT_REG, 0, slot); in setup_file_extents()
122 disk_bytenr += sectorsize; in setup_file_extents()
123 offset += sectorsize - 1; in setup_file_extents()
129 insert_extent(root, offset, sectorsize, 4 * sectorsize, 0, disk_bytenr, in setup_file_extents()
130 4 * sectorsize, BTRFS_FILE_EXTENT_REG, 0, slot); in setup_file_extents()
132 offset += sectorsize; in setup_file_extents()
133 insert_extent(root, offset, sectorsize, sectorsize, 0, 0, 0, in setup_file_extents()
136 offset += sectorsize; in setup_file_extents()
137 insert_extent(root, offset, 2 * sectorsize, 4 * sectorsize, in setup_file_extents()
138 2 * sectorsize, disk_bytenr, 4 * sectorsize, in setup_file_extents()
141 offset += 2 * sectorsize; in setup_file_extents()
142 disk_bytenr += 4 * sectorsize; in setup_file_extents()
145 insert_extent(root, offset, sectorsize, sectorsize, 0, disk_bytenr, in setup_file_extents()
146 sectorsize, BTRFS_FILE_EXTENT_PREALLOC, 0, slot); in setup_file_extents()
148 offset += sectorsize; in setup_file_extents()
154 disk_bytenr += 2 * sectorsize; in setup_file_extents()
161 insert_extent(root, offset, sectorsize, 4 * sectorsize, 0, disk_bytenr, in setup_file_extents()
162 4 * sectorsize, BTRFS_FILE_EXTENT_PREALLOC, 0, slot); in setup_file_extents()
164 offset += sectorsize; in setup_file_extents()
165 insert_extent(root, offset, sectorsize, 4 * sectorsize, sectorsize, in setup_file_extents()
166 disk_bytenr, 4 * sectorsize, BTRFS_FILE_EXTENT_REG, 0, in setup_file_extents()
169 offset += sectorsize; in setup_file_extents()
170 insert_extent(root, offset, 2 * sectorsize, 4 * sectorsize, in setup_file_extents()
171 2 * sectorsize, disk_bytenr, 4 * sectorsize, in setup_file_extents()
174 offset += 2 * sectorsize; in setup_file_extents()
175 disk_bytenr += 4 * sectorsize; in setup_file_extents()
178 insert_extent(root, offset, 2 * sectorsize, 2 * sectorsize, 0, in setup_file_extents()
179 disk_bytenr, sectorsize, BTRFS_FILE_EXTENT_REG, in setup_file_extents()
182 offset += 2 * sectorsize; in setup_file_extents()
184 disk_bytenr += 2 * sectorsize; in setup_file_extents()
187 insert_extent(root, offset, sectorsize, 4 * sectorsize, 0, disk_bytenr, in setup_file_extents()
188 sectorsize, BTRFS_FILE_EXTENT_REG, in setup_file_extents()
191 offset += sectorsize; in setup_file_extents()
192 insert_extent(root, offset, sectorsize, sectorsize, 0, in setup_file_extents()
193 disk_bytenr + sectorsize, sectorsize, in setup_file_extents()
196 offset += sectorsize; in setup_file_extents()
197 insert_extent(root, offset, 2 * sectorsize, 4 * sectorsize, in setup_file_extents()
198 2 * sectorsize, disk_bytenr, sectorsize, in setup_file_extents()
201 offset += 2 * sectorsize; in setup_file_extents()
202 disk_bytenr += 2 * sectorsize; in setup_file_extents()
205 insert_extent(root, offset, sectorsize, sectorsize, 0, disk_bytenr, in setup_file_extents()
206 sectorsize, BTRFS_FILE_EXTENT_REG, 0, slot); in setup_file_extents()
208 offset += 4 * sectorsize; in setup_file_extents()
209 disk_bytenr += sectorsize; in setup_file_extents()
210 insert_extent(root, offset, sectorsize, sectorsize, 0, disk_bytenr, in setup_file_extents()
211 sectorsize, BTRFS_FILE_EXTENT_REG, 0, slot); in setup_file_extents()
218 static noinline int test_btrfs_get_extent(u32 sectorsize, u32 nodesize) in test_btrfs_get_extent() argument
237 fs_info = btrfs_alloc_dummy_fs_info(nodesize, sectorsize); in test_btrfs_get_extent()
261 em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, sectorsize); in test_btrfs_get_extent()
279 setup_file_extents(root, sectorsize); 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()
319 em = btrfs_get_extent(BTRFS_I(inode), NULL, offset, sectorsize); in test_btrfs_get_extent()
342 em = btrfs_get_extent(BTRFS_I(inode), NULL, offset, sectorsize); in test_btrfs_get_extent()
351 if (em->start != offset || em->len != sectorsize - 1) { in test_btrfs_get_extent()
369 em = btrfs_get_extent(BTRFS_I(inode), NULL, offset, sectorsize); 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()
397 em = btrfs_get_extent(BTRFS_I(inode), NULL, offset, sectorsize); 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()
419 em = btrfs_get_extent(BTRFS_I(inode), NULL, offset, sectorsize); 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()
453 em = btrfs_get_extent(BTRFS_I(inode), NULL, offset, sectorsize); 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()
481 em = btrfs_get_extent(BTRFS_I(inode), NULL, offset, sectorsize); 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()
510 em = btrfs_get_extent(BTRFS_I(inode), NULL, offset, sectorsize); 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()
542 em = btrfs_get_extent(BTRFS_I(inode), NULL, offset, sectorsize); 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()
576 em = btrfs_get_extent(BTRFS_I(inode), NULL, offset, sectorsize); 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()
609 em = btrfs_get_extent(BTRFS_I(inode), NULL, offset, sectorsize); 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()
643 em = btrfs_get_extent(BTRFS_I(inode), NULL, offset, sectorsize); 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()
669 em = btrfs_get_extent(BTRFS_I(inode), NULL, offset, sectorsize); 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()
704 em = btrfs_get_extent(BTRFS_I(inode), NULL, offset + 6, sectorsize); 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()
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()
762 em = btrfs_get_extent(BTRFS_I(inode), NULL, offset, sectorsize); 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()
795 static int test_hole_first(u32 sectorsize, u32 nodesize) in test_hole_first() argument
811 fs_info = btrfs_alloc_dummy_fs_info(nodesize, sectorsize); in test_hole_first()
839 insert_extent(root, sectorsize, sectorsize, sectorsize, 0, sectorsize, in test_hole_first()
840 sectorsize, BTRFS_FILE_EXTENT_REG, 0, 1); in test_hole_first()
841 em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, 2 * sectorsize); 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()
863 em = btrfs_get_extent(BTRFS_I(inode), NULL, sectorsize, 2 * sectorsize); in test_hole_first()
868 if (extent_map_block_start(em) != sectorsize) { 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()
893 static int test_extent_accounting(u32 sectorsize, u32 nodesize) in test_extent_accounting() argument
908 fs_info = btrfs_alloc_dummy_fs_info(nodesize, sectorsize); in test_extent_accounting()
938 BTRFS_MAX_EXTENT_SIZE + sectorsize - 1, in test_extent_accounting()
954 (BTRFS_MAX_EXTENT_SIZE >> 1) + sectorsize - 1, in test_extent_accounting()
971 + sectorsize - 1, in test_extent_accounting()
988 BTRFS_MAX_EXTENT_SIZE + 2 * sectorsize, in test_extent_accounting()
989 (BTRFS_MAX_EXTENT_SIZE << 1) + 3 * sectorsize - 1, in test_extent_accounting()
1006 BTRFS_MAX_EXTENT_SIZE + sectorsize, in test_extent_accounting()
1007 BTRFS_MAX_EXTENT_SIZE + 2 * sectorsize - 1, 0, NULL); in test_extent_accounting()
1021 BTRFS_MAX_EXTENT_SIZE + sectorsize, in test_extent_accounting()
1022 BTRFS_MAX_EXTENT_SIZE + 2 * sectorsize - 1, in test_extent_accounting()
1041 BTRFS_MAX_EXTENT_SIZE + sectorsize, in test_extent_accounting()
1042 BTRFS_MAX_EXTENT_SIZE + 2 * sectorsize - 1, 0, NULL); in test_extent_accounting()
1080 int btrfs_test_inodes(u32 sectorsize, u32 nodesize) in btrfs_test_inodes() argument
1089 ret = test_btrfs_get_extent(sectorsize, nodesize); in btrfs_test_inodes()
1092 ret = test_hole_first(sectorsize, nodesize); in btrfs_test_inodes()
1095 return test_extent_accounting(sectorsize, nodesize); in btrfs_test_inodes()