Lines Matching defs:chunk
1458 * Try to find a chunk that intersects [start, start + len] range and when one
1858 btrfs_err(fs_info, "corrupted chunk tree devid -1 matched");
1880 * the device information is stored in the chunk root
2916 "Failed lookup while freeing chunk.");
2924 "Failed to delete chunk item.");
2934 struct btrfs_chunk *chunk;
2956 chunk = (struct btrfs_chunk *)(ptr + len);
2957 num_stripes = btrfs_stack_chunk_num_stripes(chunk);
2997 "unable to find chunk map for logical %llu length %llu",
3004 "found a bad chunk map, wanted %llu-%llu, found %llu-%llu",
3110 * After we relocate and before we remove the chunk with offset
3115 * or chunk trees) to find chunks. Otherwise the cleaner kthread might
3117 * we release the path used to search the chunk/dev tree and before
3122 /* step one, relocate all the extents inside this chunk */
3145 * chunk tree entries
3157 struct btrfs_chunk *chunk;
3195 chunk = btrfs_item_ptr(leaf, path->slots[0],
3197 chunk_type = btrfs_chunk_type(leaf, chunk);
3227 * return 1 : allocate a data chunk successfully,
3228 * return <0: errors during allocating a data chunk,
3229 * return 0 : no need to allocate a data chunk.
3368 * Turn on soft mode for chunk types that were being converted.
3425 * Balance filters. Return 1 if chunk should be filtered out
3498 struct btrfs_chunk *chunk,
3502 int num_stripes = btrfs_chunk_num_stripes(leaf, chunk);
3506 stripe = btrfs_stripe_nr(chunk, i);
3528 struct btrfs_chunk *chunk,
3532 int num_stripes = btrfs_chunk_num_stripes(leaf, chunk);
3542 type = btrfs_chunk_type(leaf, chunk);
3546 stripe = btrfs_stripe_nr(chunk, i);
3551 stripe_length = btrfs_chunk_length(leaf, chunk);
3564 struct btrfs_chunk *chunk,
3569 chunk_offset + btrfs_chunk_length(leaf, chunk) > bargs->vstart)
3570 /* at least part of the chunk is inside this vrange */
3577 struct btrfs_chunk *chunk,
3580 int num_stripes = btrfs_chunk_num_stripes(leaf, chunk);
3605 struct btrfs_chunk *chunk, u64 chunk_offset)
3610 u64 chunk_type = btrfs_chunk_type(leaf, chunk);
3642 chunk_devid_filter(leaf, chunk, bargs)) {
3648 chunk_drange_filter(leaf, chunk, bargs)) {
3654 chunk_vrange_filter(leaf, chunk, chunk_offset, bargs)) {
3660 chunk_stripes_range_filter(leaf, chunk, bargs)) {
3698 struct btrfs_chunk *chunk;
3778 chunk = btrfs_item_ptr(leaf, slot, struct btrfs_chunk);
3779 chunk_type = btrfs_chunk_type(leaf, chunk);
3787 ret = should_balance_chunk(leaf, chunk, found_key.offset);
3827 * We may be relocating the only data chunk we have,
4658 * The chunk relocation code actually frees the device extent
4770 * We may be relocating the only data chunk we have,
4849 struct btrfs_chunk *chunk, int item_size)
4868 memcpy(ptr, chunk, item_size);
4967 /* We don't want a chunk larger than 10% of writable space */
5096 * Use the number of data stripes to figure out how big this chunk is
5098 * that answer with the max chunk size. If it's higher, we try to
5267 btrfs_err(info, "invalid chunk type 0x%llx requested", type);
5298 * that makes the new allocated chunk usable, but does not do any operation
5299 * that modifies the chunk tree. The second part does the work that
5300 * requires modifying the chunk tree. This division is important for the
5311 struct btrfs_chunk *chunk;
5329 chunk = kzalloc(item_size, GFP_NOFS);
5330 if (!chunk) {
5360 stripe = &chunk->stripe;
5372 btrfs_set_stack_chunk_length(chunk, chunk_size);
5373 btrfs_set_stack_chunk_owner(chunk, extent_root->root_key.objectid);
5374 btrfs_set_stack_chunk_stripe_len(chunk, map->stripe_len);
5375 btrfs_set_stack_chunk_type(chunk, map->type);
5376 btrfs_set_stack_chunk_num_stripes(chunk, map->num_stripes);
5377 btrfs_set_stack_chunk_io_align(chunk, map->stripe_len);
5378 btrfs_set_stack_chunk_io_width(chunk, map->stripe_len);
5379 btrfs_set_stack_chunk_sector_size(chunk, fs_info->sectorsize);
5380 btrfs_set_stack_chunk_sub_stripes(chunk, map->sub_stripes);
5386 ret = btrfs_insert_item(trans, chunk_root, &key, chunk, item_size);
5389 * TODO: Cleanup of inserted chunk root in case of
5392 ret = btrfs_add_system_chunk(fs_info, &key, chunk, item_size);
5396 kfree(chunk);
5452 * we can not write the data into that chunk successfully, so
6009 * Returns < 0 in case a chunk for the given logical address cannot be found,
6032 /* Offset of this logical address in the chunk */
6034 /* Len of a stripe in a chunk */
6038 /* Offset of stripe in the chunk */
6681 struct btrfs_chunk *chunk)
6696 length = btrfs_chunk_length(leaf, chunk);
6697 num_stripes = btrfs_chunk_num_stripes(leaf, chunk);
6700 * Only need to verify chunk item if we're reading from sys chunk array,
6701 * as chunk item in tree block is already verified by tree-checker.
6704 ret = btrfs_check_chunk_valid(leaf, chunk, logical);
6739 map->io_width = btrfs_chunk_io_width(leaf, chunk);
6740 map->io_align = btrfs_chunk_io_align(leaf, chunk);
6741 map->stripe_len = btrfs_chunk_stripe_len(leaf, chunk);
6742 map->type = btrfs_chunk_type(leaf, chunk);
6743 map->sub_stripes = btrfs_chunk_sub_stripes(leaf, chunk);
6749 btrfs_stripe_offset_nr(leaf, chunk, i);
6750 devid = btrfs_stripe_devid_nr(leaf, chunk, i);
6752 btrfs_stripe_dev_uuid_nr(chunk, i),
6785 "failed to add chunk map, start=%llu len=%llu: %d",
6974 struct btrfs_chunk *chunk;
7038 chunk = (struct btrfs_chunk *)sb_array_offset;
7047 num_stripes = btrfs_chunk_num_stripes(sb, chunk);
7056 type = btrfs_chunk_type(sb, chunk);
7059 "invalid chunk type %llu in sys_array at offset %u",
7069 ret = read_one_chunk(&key, sb, chunk);
7095 * Return false if any chunk doesn't meet the minimal RW mount requirements.
7108 /* No chunk at all? Return false anyway */
7136 "chunk %llu missing %d devices, max tolerance is %d for writable mount",
7198 * Read all device items, and then all the chunk items. All
7199 * device items are found before any chunk item (their object id
7200 * is smaller than the lowest possible object id for a chunk
7243 struct btrfs_chunk *chunk;
7244 chunk = btrfs_item_ptr(leaf, slot, struct btrfs_chunk);
7246 ret = read_one_chunk(&found_key, leaf, chunk);
7255 * After loading chunk tree, we've got all device information,
7643 "dev extent physical offset %llu on devid %llu doesn't have corresponding chunk",
7653 "dev extent physical offset %llu on devid %llu length doesn't match chunk %llu, have %llu expect %llu",
7666 "too many dev extents for chunk %llu found",
7677 "dev extent physical offset %llu devid %llu has no corresponding chunk",
7731 "chunk %llu has missing dev extent, have %d expect %d",
7744 * Ensure that all dev extents are mapped to correct chunk, otherwise
7745 * later chunk allocation/free would cause unexpected behavior.
7748 * the same size level as the chunk tree. This slightly increases mount time.