/linux/fs/btrfs/tests/ |
H A 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 …]
|
H A 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 …]
|
H A 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 …]
|
H A 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 …]
|
H A 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()
|
H A 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/fs/btrfs/ |
H A 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 …]
|
H A 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 …]
|
H A 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 …]
|
H A 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 …]
|
H A D | file.c | 92 u64 block_start = round_down(pos, fs_info->sectorsize); in btrfs_drop_folio() 93 u64 block_len = round_up(pos + copied, fs_info->sectorsize) - block_start; in btrfs_drop_folio() 133 start_pos = round_down(pos, fs_info->sectorsize); in btrfs_dirty_folio() 135 fs_info->sectorsize); in btrfs_dirty_folio() 448 fs_info->sectorsize); in btrfs_drop_extents() 957 start_pos = round_down(pos, fs_info->sectorsize); in lock_and_cleanup_extent_if_need() 958 last_pos = round_up(pos + write_bytes, fs_info->sectorsize) - 1; in lock_and_cleanup_extent_if_need() 1039 lockstart = round_down(pos, fs_info->sectorsize); in btrfs_check_nocow_lock() 1041 fs_info->sectorsize) - 1; in btrfs_check_nocow_lock() 1106 start_pos = round_down(pos, fs_info->sectorsize); in btrfs_write_check() [all …]
|
H A 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()
|
H A D | bio.c | 201 repair_bbio->file_offset, fs_info->sectorsize, in btrfs_end_repair_bio() 225 const u32 sectorsize = fs_info->sectorsize; in repair_one_sector() local 235 num_copies = btrfs_num_copies(fs_info, logical, sectorsize); in repair_one_sector() 271 u32 sectorsize = fs_info->sectorsize; in btrfs_check_read_bio() local 295 bv.bv_len = min(bv.bv_len, sectorsize); in btrfs_check_read_bio() 299 bio_advance_iter_single(&bbio->bio, iter, sectorsize); in btrfs_check_read_bio() 300 offset += sectorsize; in btrfs_check_read_bio() 661 return ALIGN_DOWN(sector_offset << SECTOR_SHIFT, bbio->fs_info->sectorsize); in btrfs_append_map_length()
|
H A 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()
|
H A 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() 1187 btrfs_folio_set_lock(fs_info, folio, start, fs_info->sectorsize); in writepage_delalloc() 1329 const u32 sectorsize = fs_info->sectorsize; in submit_one_sector() local [all …]
|
H A 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() 2344 u64 sectorsize = btrfs_super_sectorsize(sb); in btrfs_validate_super() local 2384 if (!is_power_of_2(sectorsize) || sectorsize < 4096 || in btrfs_validate_super() 2385 sectorsize > BTRFS_MAX_METADATA_BLOCKSIZE) { in btrfs_validate_super() 2386 btrfs_err(fs_info, "invalid sectorsize %llu", sectorsize); in btrfs_validate_super() 2398 if (sectorsize > PAGE_SIZE || (sectorsize != SZ_4K && sectorsize != PAGE_SIZE)) { in btrfs_validate_super() 2401 sectorsize, PAGE_SIZE); in btrfs_validate_super() 2405 if (!is_power_of_2(nodesize) || nodesize < sectorsize || in btrfs_validate_super() 2417 if (!IS_ALIGNED(btrfs_super_root(sb), sectorsize)) { in btrfs_validate_super() [all …]
|
H A 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()
|
H A D | compression.c | 381 ASSERT(IS_ALIGNED(ordered->file_offset, fs_info->sectorsize)); in btrfs_submit_compressed_write() 382 ASSERT(IS_ALIGNED(ordered->num_bytes, fs_info->sectorsize)); in btrfs_submit_compressed_write() 443 if (fs_info->sectorsize < PAGE_SIZE) in add_ra_bio_pages() 513 (cur + fs_info->sectorsize > extent_map_end(em)) || in add_ra_bio_pages() 547 if (fs_info->sectorsize < PAGE_SIZE) in add_ra_bio_pages() 584 em = lookup_extent_mapping(em_tree, file_offset, fs_info->sectorsize); in btrfs_submit_compressed_read() 1071 const u32 sectorsize = fs_info->sectorsize; in btrfs_decompress() local 1079 ASSERT(dest_pgoff + destlen <= PAGE_SIZE && destlen <= sectorsize); in btrfs_decompress()
|
H A D | free-space-tree.c | 52 bitmap_range = cache->fs_info->sectorsize * BTRFS_FREE_SPACE_BITMAP_BITS; in set_free_space_tree_thresholds() 261 fs_info->sectorsize); in convert_free_space_to_bitmaps() 263 fs_info->sectorsize); in convert_free_space_to_bitmaps() 304 bitmap_range = fs_info->sectorsize * BTRFS_FREE_SPACE_BITMAP_BITS; in convert_free_space_to_bitmaps() 400 fs_info->sectorsize * in convert_free_space_to_extents() 443 key.objectid = start + start_bit * block_group->fs_info->sectorsize; in convert_free_space_to_extents() 445 key.offset = (end_bit - start_bit) * block_group->fs_info->sectorsize; in convert_free_space_to_extents() 532 block_group->fs_info->sectorsize); in free_space_test_bit() 622 u64 prev_block = start - block_group->fs_info->sectorsize; in modify_free_space_bitmap() 1547 offset += fs_info->sectorsize; in load_free_space_bitmaps()
|
H A D | fiemap.c | 644 const u64 sectorsize = inode->root->fs_info->sectorsize; in extent_fiemap() local 660 range_start = round_down(start, sectorsize); in extent_fiemap() 661 range_end = round_up(start + len, sectorsize); in extent_fiemap()
|
/linux/arch/um/drivers/ |
H A 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 …]
|
H A 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,
|
H A 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() 1249 io_req->sectorsize = SECTOR_SIZE; in ubd_alloc_req() 1429 nsectors = desc->length / req->sectorsize; in do_io() 1439 start * req->sectorsize; in do_io() [all …]
|
/linux/drivers/mtd/nand/raw/atmel/ |
H A 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 …]
|
H A D | pmecc.h | 47 int sectorsize; member
|