diff --git a/Documentation/mkfs.btrfs.asciidoc b/Documentation/mkfs.btrfs.asciidoc index 2ddd63c0..a3b2b5cd 100644 --- a/Documentation/mkfs.btrfs.asciidoc +++ b/Documentation/mkfs.btrfs.asciidoc @@ -161,12 +161,6 @@ Print the *mkfs.btrfs* version and exit. *--help*:: Print help. -*-A|--alloc-start *:: -*deprecated, will be removed* -(An option to help debugging chunk allocator.) -Specify the (physical) offset from the start of the device at which allocations -start. The default value is zero. - SIZE UNITS ---------- The default unit is 'byte'. All size parameters accept suffixes in the 1024 diff --git a/ctree.h b/ctree.h index 71eb6732..39e03640 100644 --- a/ctree.h +++ b/ctree.h @@ -1173,7 +1173,6 @@ struct btrfs_fs_info { u64 data_alloc_profile; u64 metadata_alloc_profile; u64 system_alloc_profile; - u64 alloc_start; struct btrfs_trans_handle *running_transaction; struct btrfs_super_block *super_copy; diff --git a/mkfs/main.c b/mkfs/main.c index 74e1ed6e..0a4de617 100644 --- a/mkfs/main.c +++ b/mkfs/main.c @@ -361,7 +361,6 @@ static void print_usage(int ret) printf("\t-V|--version print the mkfs.btrfs version and exit\n"); printf("\t--help print this help and exit\n"); printf(" deprecated:\n"); - printf("\t-A|--alloc-start START the offset to start the filesystem\n"); printf("\t-l|--leafsize SIZE deprecated, alias for nodesize\n"); exit(ret); } @@ -920,7 +919,6 @@ int BOX_MAIN(mkfs)(int argc, char **argv) char *label = NULL; u64 block_count = 0; u64 dev_block_count = 0; - u64 alloc_start = 0; u64 metadata_profile = 0; u64 data_profile = 0; u32 nodesize = max_t(u32, sysconf(_SC_PAGESIZE), @@ -960,7 +958,6 @@ int BOX_MAIN(mkfs)(int argc, char **argv) int c; enum { GETOPT_VAL_SHRINK = 257, GETOPT_VAL_CHECKSUM }; static const struct option long_options[] = { - { "alloc-start", required_argument, NULL, 'A'}, { "byte-count", required_argument, NULL, 'b' }, { "csum", required_argument, NULL, GETOPT_VAL_CHECKSUM }, @@ -991,9 +988,6 @@ int BOX_MAIN(mkfs)(int argc, char **argv) if (c < 0) break; switch(c) { - case 'A': - alloc_start = parse_size(optarg); - break; case 'f': force_overwrite = 1; break; @@ -1348,7 +1342,6 @@ int BOX_MAIN(mkfs)(int argc, char **argv) close(fd); fd = -1; root = fs_info->fs_root; - fs_info->alloc_start = alloc_start; ret = create_metadata_block_groups(root, mixed, &allocation); if (ret) { diff --git a/volumes.c b/volumes.c index e8b4aad8..538f799e 100644 --- a/volumes.c +++ b/volumes.c @@ -487,7 +487,7 @@ static int find_free_dev_extent_start(struct btrfs_device *device, * used by the boot loader (grub for example), so we make sure to start * at an offset of at least 1MB. */ - min_search_start = max(root->fs_info->alloc_start, (u64)SZ_1M); + min_search_start = BTRFS_BLOCK_RESERVED_1M_FOR_SUPER; search_start = max(search_start, min_search_start); path = btrfs_alloc_path(); @@ -906,7 +906,7 @@ static u64 chunk_bytes_by_type(u64 type, u64 calc_size, * It is not equal to "device->total_bytes - device->bytes_used". * We do not allocate any chunk in 1M at beginning of device, and not * allowed to allocate any chunk before alloc_start if it is specified. - * So search holes from max(1M, alloc_start) to device->total_bytes. + * So search holes from 1M to device->total_bytes. */ static int btrfs_device_avail_bytes(struct btrfs_trans_handle *trans, struct btrfs_device *device, @@ -917,21 +917,19 @@ static int btrfs_device_avail_bytes(struct btrfs_trans_handle *trans, struct btrfs_key key; struct btrfs_dev_extent *dev_extent = NULL; struct extent_buffer *l; - u64 search_start = root->fs_info->alloc_start; + u64 search_start = BTRFS_BLOCK_RESERVED_1M_FOR_SUPER;; u64 search_end = device->total_bytes; u64 extent_end = 0; u64 free_bytes = 0; int ret; int slot = 0; - search_start = max(BTRFS_BLOCK_RESERVED_1M_FOR_SUPER, search_start); - path = btrfs_alloc_path(); if (!path) return -ENOMEM; key.objectid = device->devid; - key.offset = root->fs_info->alloc_start; + key.offset = search_start; key.type = BTRFS_DEV_EXTENT_KEY; path->reada = READA_FORWARD;