/linux-6.12.1/fs/btrfs/tests/ |
D | inode-tests.c | 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() [all …]
|
D | free-space-tests.c | 90 static int test_bitmaps(struct btrfs_block_group *cache, u32 sectorsize) in test_bitmaps() argument 130 next_bitmap_offset = (u64)(BITS_PER_BITMAP * sectorsize); in test_bitmaps() 159 u32 sectorsize) in test_bitmaps_and_extents() argument 161 u64 bitmap_offset = (u64)(BITS_PER_BITMAP * sectorsize); in test_bitmaps_and_extents() 396 u32 sectorsize) in test_steal_space_from_bitmap_to_extent() argument 533 ret = btrfs_add_free_space(cache, SZ_128M + SZ_16M, sectorsize); in test_steal_space_from_bitmap_to_extent() 591 if (cache->free_space_ctl->free_space != (SZ_1M + sectorsize)) { in test_steal_space_from_bitmap_to_extent() 592 test_err("cache free space is not 1Mb + %u", sectorsize); in test_steal_space_from_bitmap_to_extent() 614 if (cache->free_space_ctl->free_space != sectorsize) { in test_steal_space_from_bitmap_to_extent() 615 test_err("cache free space is not %u", sectorsize); in test_steal_space_from_bitmap_to_extent() [all …]
|
D | btrfs-tests.c | 116 struct btrfs_fs_info *btrfs_alloc_dummy_fs_info(u32 nodesize, u32 sectorsize) in btrfs_alloc_dummy_fs_info() argument 142 fs_info->sectorsize = sectorsize; in btrfs_alloc_dummy_fs_info() 143 fs_info->sectorsize_bits = ilog2(sectorsize); in btrfs_alloc_dummy_fs_info() 228 cache->full_stripe_len = fs_info->sectorsize; in btrfs_alloc_dummy_block_group() 261 u32 sectorsize, nodesize; in btrfs_run_sanity_tests() local 269 sectorsize = test_sectorsize[i]; in btrfs_run_sanity_tests() 270 for (nodesize = sectorsize; in btrfs_run_sanity_tests() 274 sectorsize, nodesize); in btrfs_run_sanity_tests() 275 ret = btrfs_test_free_space_cache(sectorsize, nodesize); in btrfs_run_sanity_tests() 278 ret = btrfs_test_extent_buffer_operations(sectorsize, in btrfs_run_sanity_tests() [all …]
|
D | btrfs-tests.h | 34 int btrfs_test_extent_buffer_operations(u32 sectorsize, u32 nodesize); 35 int btrfs_test_free_space_cache(u32 sectorsize, u32 nodesize); 36 int btrfs_test_extent_io(u32 sectorsize, u32 nodesize); 37 int btrfs_test_inodes(u32 sectorsize, u32 nodesize); 38 int btrfs_test_qgroups(u32 sectorsize, u32 nodesize); 39 int btrfs_test_free_space_tree(u32 sectorsize, u32 nodesize); 42 struct btrfs_fs_info *btrfs_alloc_dummy_fs_info(u32 nodesize, u32 sectorsize);
|
D | extent-io-tests.c | 109 static int test_find_delalloc(u32 sectorsize, u32 nodesize) in test_find_delalloc() argument 127 fs_info = btrfs_alloc_dummy_fs_info(nodesize, sectorsize); in test_find_delalloc() 180 set_extent_bit(tmp, 0, sectorsize - 1, EXTENT_DELALLOC, NULL); in test_find_delalloc() 189 if (start != 0 || end != (sectorsize - 1)) { in test_find_delalloc() 191 sectorsize - 1, start, end); in test_find_delalloc() 211 set_extent_bit(tmp, sectorsize, max_bytes - 1, EXTENT_DELALLOC, NULL); in test_find_delalloc() 239 test_start = max_bytes + sectorsize; in test_find_delalloc() 506 static int test_eb_bitmaps(u32 sectorsize, u32 nodesize) in test_eb_bitmaps() argument 515 fs_info = btrfs_alloc_dummy_fs_info(nodesize, sectorsize); in test_eb_bitmaps() 545 eb = __alloc_dummy_extent_buffer(fs_info, sectorsize, nodesize); in test_eb_bitmaps() [all …]
|
D | free-space-tree-tests.c | 71 offset += fs_info->sectorsize; in __check_free_space_extents() 424 static int run_test(test_func_t test_func, int bitmaps, u32 sectorsize, in run_test() argument 434 fs_info = btrfs_alloc_dummy_fs_info(nodesize, sectorsize); in run_test() 525 static int run_test_both_formats(test_func_t test_func, u32 sectorsize, in run_test_both_formats() argument 531 ret = run_test(test_func, 0, sectorsize, nodesize, alignment); in run_test_both_formats() 535 test_func, sectorsize, nodesize, alignment); in run_test_both_formats() 539 ret = run_test(test_func, 1, sectorsize, nodesize, alignment); in run_test_both_formats() 543 test_func, sectorsize, nodesize, alignment); in run_test_both_formats() 550 int btrfs_test_free_space_tree(u32 sectorsize, u32 nodesize) in btrfs_test_free_space_tree() argument 577 ret = run_test_both_formats(tests[i], sectorsize, nodesize, in btrfs_test_free_space_tree() [all …]
|
D | extent-buffer-tests.c | 13 static int test_btrfs_split_item(u32 sectorsize, u32 nodesize) in test_btrfs_split_item() argument 31 fs_info = btrfs_alloc_dummy_fs_info(nodesize, sectorsize); in test_btrfs_split_item() 219 int btrfs_test_extent_buffer_operations(u32 sectorsize, u32 nodesize) in btrfs_test_extent_buffer_operations() argument 222 return test_btrfs_split_item(sectorsize, nodesize); in btrfs_test_extent_buffer_operations()
|
D | qgroup-tests.c | 206 u32 sectorsize, u32 nodesize) in test_no_shared_qgroup() argument 318 u32 sectorsize, u32 nodesize) in test_multiple_refs() argument 471 int btrfs_test_qgroups(u32 sectorsize, u32 nodesize) in btrfs_test_qgroups() argument 478 fs_info = btrfs_alloc_dummy_fs_info(nodesize, sectorsize); in btrfs_test_qgroups() 551 ret = test_no_shared_qgroup(root, sectorsize, nodesize); in btrfs_test_qgroups() 554 ret = test_multiple_refs(root, sectorsize, nodesize); in btrfs_test_qgroups()
|
/linux-6.12.1/fs/btrfs/ |
D | lzo.c | 136 const u32 sectorsize) in copy_compressed_data_to_page() argument 150 ASSERT((*cur_out / sectorsize) == (*cur_out + LZO_LEN - 1) / sectorsize); in copy_compressed_data_to_page() 170 u32 copy_len = min_t(u32, sectorsize - *cur_out % sectorsize, in copy_compressed_data_to_page() 198 sector_bytes_left = round_up(*cur_out, sectorsize) - *cur_out; in copy_compressed_data_to_page() 217 const u32 sectorsize = inode_to_fs_info(mapping->host)->sectorsize; in lzo_compress_folios() local 240 const u32 sectorsize_mask = sectorsize - 1; in lzo_compress_folios() 253 in_len = min_t(u32, start + len - cur_in, sectorsize - sector_off); in lzo_compress_folios() 269 &cur_out, sectorsize); in lzo_compress_folios() 279 if (cur_in - start > sectorsize * 2 && cur_in - start < cur_out) { in lzo_compress_folios() 335 const u32 sectorsize = fs_info->sectorsize; in lzo_decompress_bio() local [all …]
|
D | delalloc-space.c | 121 bytes = ALIGN(bytes, fs_info->sectorsize); in btrfs_alloc_data_chunk_ondemand() 138 len = round_up(start + len, fs_info->sectorsize) - in btrfs_check_data_free_space() 139 round_down(start, fs_info->sectorsize); in btrfs_check_data_free_space() 140 start = round_down(start, fs_info->sectorsize); in btrfs_check_data_free_space() 176 ASSERT(IS_ALIGNED(len, fs_info->sectorsize)); in btrfs_free_reserved_data_space_noquota() 195 len = round_up(start + len, fs_info->sectorsize) - in btrfs_free_reserved_data_space() 196 round_down(start, fs_info->sectorsize); in btrfs_free_reserved_data_space() 197 start = round_down(start, fs_info->sectorsize); in btrfs_free_reserved_data_space() 332 num_bytes = ALIGN(num_bytes, fs_info->sectorsize); in btrfs_delalloc_reserve_metadata() 333 disk_num_bytes = ALIGN(disk_num_bytes, fs_info->sectorsize); in btrfs_delalloc_reserve_metadata() [all …]
|
D | tree-checker.c | 129 end = ALIGN(key->offset + len, leaf->fs_info->sectorsize); in file_extent_end() 212 u32 sectorsize = fs_info->sectorsize; in check_extent_data_item() local 216 if (unlikely(!IS_ALIGNED(key->offset, sectorsize))) { in check_extent_data_item() 219 key->offset, sectorsize); in check_extent_data_item() 305 if (unlikely(CHECK_FE_ALIGNED(leaf, slot, fi, ram_bytes, sectorsize) || in check_extent_data_item() 306 CHECK_FE_ALIGNED(leaf, slot, fi, disk_bytenr, sectorsize) || in check_extent_data_item() 307 CHECK_FE_ALIGNED(leaf, slot, fi, disk_num_bytes, sectorsize) || in check_extent_data_item() 308 CHECK_FE_ALIGNED(leaf, slot, fi, offset, sectorsize) || in check_extent_data_item() 309 CHECK_FE_ALIGNED(leaf, slot, fi, num_bytes, sectorsize))) in check_extent_data_item() 368 u32 sectorsize = fs_info->sectorsize; in check_csum_item() local [all …]
|
D | raid56.c | 272 rbio->bioc->fs_info->sectorsize); in cache_rbio_pages() 299 const u32 sectorsize = rbio->bioc->fs_info->sectorsize; in full_page_sectors_uptodate() local 300 const u32 sectors_per_page = PAGE_SIZE / sectorsize; in full_page_sectors_uptodate() 321 const u32 sectorsize = rbio->bioc->fs_info->sectorsize; in index_stripe_sectors() local 325 for (i = 0, offset = 0; i < rbio->nr_sectors; i++, offset += sectorsize) { in index_stripe_sectors() 337 const u32 sectorsize = src->bioc->fs_info->sectorsize; in steal_rbio_page() local 338 const u32 sectors_per_page = PAGE_SIZE / sectorsize; in steal_rbio_page() 993 ASSERT(IS_ALIGNED(PAGE_SIZE, fs_info->sectorsize)); in alloc_rbio() 1129 const u32 sectorsize = rbio->bioc->fs_info->sectorsize; in rbio_add_io_sector() local 1148 disk_start = stripe->physical + sector_nr * sectorsize; in rbio_add_io_sector() [all …]
|
D | file-item.c | 92 ASSERT(IS_ALIGNED(start + len, inode->root->fs_info->sectorsize)); in btrfs_inode_set_file_extent_range() 121 ASSERT(IS_ALIGNED(start + len, inode->root->fs_info->sectorsize) || in btrfs_inode_clear_file_extent_range() 130 ASSERT(IS_ALIGNED(bytes, fs_info->sectorsize)); in bytes_to_csum_size() 286 const u32 sectorsize = fs_info->sectorsize; in search_csum_tree() local 293 ASSERT(IS_ALIGNED(disk_bytenr, sectorsize) && in search_csum_tree() 294 IS_ALIGNED(len, sectorsize)); in search_csum_tree() 304 csum_len = (itemsize / csum_size) * sectorsize; in search_csum_tree() 322 csum_len = (itemsize / csum_size) * sectorsize; in search_csum_tree() 347 const u32 sectorsize = fs_info->sectorsize; in btrfs_lookup_bio_sums() local 438 file_offset + sectorsize - 1, in btrfs_lookup_bio_sums() [all …]
|
D | file.c | 101 u64 block_start = round_down(pos, fs_info->sectorsize); in btrfs_drop_pages() 102 u64 block_len = round_up(pos + copied, fs_info->sectorsize) - block_start; in btrfs_drop_pages() 146 start_pos = round_down(pos, fs_info->sectorsize); in btrfs_dirty_pages() 148 fs_info->sectorsize); in btrfs_dirty_pages() 466 fs_info->sectorsize); in btrfs_drop_extents() 1002 start_pos = round_down(pos, fs_info->sectorsize); in lock_and_cleanup_extent_if_need() 1003 last_pos = round_up(pos + write_bytes, fs_info->sectorsize) - 1; in lock_and_cleanup_extent_if_need() 1091 lockstart = round_down(pos, fs_info->sectorsize); in btrfs_check_nocow_lock() 1093 fs_info->sectorsize) - 1; in btrfs_check_nocow_lock() 1175 start_pos = round_down(pos, fs_info->sectorsize); in btrfs_write_check() [all …]
|
D | defrag.c | 275 cur = max(cur + fs_info->sectorsize, range.start); in btrfs_run_defrag_inode() 752 const u32 sectorsize = BTRFS_I(inode)->root->fs_info->sectorsize; in defrag_lookup_extent() local 759 em = lookup_extent_mapping(em_tree, start, sectorsize); in defrag_lookup_extent() 778 u64 end = start + sectorsize - 1; in defrag_lookup_extent() 1202 const u32 sectorsize = inode->root->fs_info->sectorsize; in defrag_one_range() local 1210 ASSERT(IS_ALIGNED(start, sectorsize) && IS_ALIGNED(len, sectorsize)); in defrag_one_range() 1277 const u32 sectorsize = inode->root->fs_info->sectorsize; in defrag_one_cluster() local 1300 (max_sectors - *sectors_defragged) * sectorsize); in defrag_one_cluster() 1397 cur = round_down(range->start, fs_info->sectorsize); in btrfs_defrag_file() 1398 last_byte = round_up(last_byte, fs_info->sectorsize) - 1; in btrfs_defrag_file()
|
D | reflink.c | 64 const u32 block_size = fs_info->sectorsize; in copy_inline_to_page() 181 fs_info->sectorsize); in clone_copy_inline_extent() 521 ASSERT(datal <= fs_info->sectorsize); in btrfs_clone() 524 WARN_ON(datal > fs_info->sectorsize)) { in btrfs_clone() 557 fs_info->sectorsize); in btrfs_clone() 640 const u64 bs = fs_info->sectorsize; in btrfs_extent_same_range() 710 u64 bs = fs_info->sectorsize; in btrfs_clone_files() 780 u64 bs = BTRFS_I(inode_out)->root->fs_info->sectorsize; in btrfs_remap_file_range_prep()
|
D | bio.c | 198 repair_bbio->file_offset, fs_info->sectorsize, in btrfs_end_repair_bio() 222 const u32 sectorsize = fs_info->sectorsize; in repair_one_sector() local 232 num_copies = btrfs_num_copies(fs_info, logical, sectorsize); in repair_one_sector() 268 u32 sectorsize = fs_info->sectorsize; in btrfs_check_read_bio() local 292 bv.bv_len = min(bv.bv_len, sectorsize); in btrfs_check_read_bio() 296 bio_advance_iter_single(&bbio->bio, iter, sectorsize); in btrfs_check_read_bio() 297 offset += sectorsize; in btrfs_check_read_bio()
|
D | disk-io.c | 558 if (fs_info->sectorsize == PAGE_SIZE) { in btree_dirty_folio() 582 cur = page_start + cur_bit * fs_info->sectorsize; in btree_dirty_folio() 2345 u64 sectorsize = btrfs_super_sectorsize(sb); in btrfs_validate_super() local 2385 if (!is_power_of_2(sectorsize) || sectorsize < 4096 || in btrfs_validate_super() 2386 sectorsize > BTRFS_MAX_METADATA_BLOCKSIZE) { in btrfs_validate_super() 2387 btrfs_err(fs_info, "invalid sectorsize %llu", sectorsize); in btrfs_validate_super() 2399 if (sectorsize > PAGE_SIZE || (sectorsize != SZ_4K && sectorsize != PAGE_SIZE)) { in btrfs_validate_super() 2402 sectorsize, PAGE_SIZE); in btrfs_validate_super() 2406 if (!is_power_of_2(nodesize) || nodesize < sectorsize || in btrfs_validate_super() 2418 if (!IS_ALIGNED(btrfs_super_root(sb), sectorsize)) { in btrfs_validate_super() [all …]
|
D | extent_io.c | 460 const u32 sectorsize = fs_info->sectorsize; in end_bbio_data_write() local 472 if (!IS_ALIGNED(fi.offset, sectorsize)) in end_bbio_data_write() 476 else if (!IS_ALIGNED(fi.length, sectorsize)) in end_bbio_data_write() 518 const u32 sectorsize = fs_info->sectorsize; in end_bbio_data_read() local 543 if (!IS_ALIGNED(fi.offset, sectorsize)) in end_bbio_data_read() 547 else if (!IS_ALIGNED(fi.offset + fi.length, sectorsize)) in end_bbio_data_read() 958 size_t blocksize = fs_info->sectorsize; in btrfs_do_readpage() 981 ASSERT(IS_ALIGNED(cur, fs_info->sectorsize)); in btrfs_do_readpage() 1283 const u32 sectorsize = fs_info->sectorsize; in submit_one_sector() local 1285 ASSERT(IS_ALIGNED(filepos, sectorsize)); in submit_one_sector() [all …]
|
D | print-tree.c | 153 if (!IS_ALIGNED(offset, eb->fs_info->sectorsize)) in print_extent_item() 156 offset, eb->fs_info->sectorsize); in print_extent_item() 170 if (!IS_ALIGNED(offset, eb->fs_info->sectorsize)) in print_extent_item() 173 offset, eb->fs_info->sectorsize); in print_extent_item()
|
/linux-6.12.1/arch/um/drivers/ |
D | cow_user.c | 29 __s32 sectorsize; member 48 __s32 sectorsize; member 91 __u32 sectorsize; member 103 __u32 sectorsize; member 125 void cow_sizes(int version, __u64 size, int sectorsize, int align, in cow_sizes() argument 130 *bitmap_len_out = (size + sectorsize - 1) / (8 * sectorsize); in cow_sizes() 133 *data_offset_out = (*data_offset_out + sectorsize - 1) / in cow_sizes() 134 sectorsize; in cow_sizes() 135 *data_offset_out *= sectorsize; in cow_sizes() 138 *bitmap_len_out = DIV_ROUND(size, sectorsize); in cow_sizes() [all …]
|
D | cow.h | 8 int sectorsize, int alignment, int *bitmap_offset_out, 19 int sectorsize, int alignment, 22 extern void cow_sizes(int version, __u64 size, int sectorsize, int align,
|
D | ubd_kern.c | 63 int sectorsize; member 610 int fd, err, sectorsize, asked_switch, mode = 0644; in open_ubd_file() local 641 &size, §orsize, &align, bitmap_offset_out); in open_ubd_file() 659 sectorsize, align, &size); in open_ubd_file() 671 cow_sizes(version, size, sectorsize, align, *bitmap_offset_out, in open_ubd_file() 682 int sectorsize, int alignment, int *bitmap_offset_out, in create_cow_file() argument 696 err = init_cow_file(fd, cow_file, backing_file, sectorsize, alignment, in create_cow_file() 1247 io_req->sectorsize = SECTOR_SIZE; in ubd_alloc_req() 1427 nsectors = desc->length / req->sectorsize; in do_io() 1437 start * req->sectorsize; in do_io() [all …]
|
/linux-6.12.1/drivers/mtd/nand/raw/atmel/ |
D | pmecc.c | 226 if (req->ecc.sectorsize == 512) { in atmel_pmecc_create_gf_tables() 260 if (req->ecc.sectorsize == 512) in atmel_pmecc_get_gf_tables() 289 if (req->ecc.sectorsize == ATMEL_PMECC_SECTOR_SIZE_AUTO) { in atmel_pmecc_prepare_user_req() 294 req->ecc.sectorsize = 1024; in atmel_pmecc_prepare_user_req() 296 req->ecc.sectorsize = 512; in atmel_pmecc_prepare_user_req() 299 if (req->ecc.sectorsize != 512 && req->ecc.sectorsize != 1024) in atmel_pmecc_prepare_user_req() 302 if (req->pagesize % req->ecc.sectorsize) in atmel_pmecc_prepare_user_req() 305 req->ecc.nsectors = req->pagesize / req->ecc.sectorsize; in atmel_pmecc_prepare_user_req() 316 nbytes = DIV_ROUND_UP(strength * fls(8 * req->ecc.sectorsize), in atmel_pmecc_prepare_user_req() 400 if (req->ecc.sectorsize == 1024) in atmel_pmecc_create_user() [all …]
|
/linux-6.12.1/drivers/md/ |
D | dm-log-writes.c | 86 __le32 sectorsize; member 107 u32 sectorsize; member 240 lc->sectorsize - entrylen - datalen); in write_metadata() 243 ret = bio_add_page(bio, page, lc->sectorsize, 0); in write_metadata() 244 if (ret != lc->sectorsize) { in write_metadata() 282 pg_sectorlen = ALIGN(pg_datalen, lc->sectorsize); in write_inline_data() 408 super.sectorsize = cpu_to_le32(lc->sectorsize); in log_super() 550 lc->sectorsize = bdev_logical_block_size(lc->dev->bdev); in log_writes_ctr() 551 lc->sectorshift = ilog2(lc->sectorsize); in log_writes_ctr() 566 lc->next_sector = lc->sectorsize >> SECTOR_SHIFT; in log_writes_ctr() [all …]
|