Skip to content

Commit 4bd94db

Browse files
committed
btrfs-progs: mkfs: remove alloc start options and docs
The option -A was used long time ago for debugging and marked as obsolete since 4.14.1. Remove the option and set the alloc start to the default value 1MiB. Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 43b8ceb commit 4bd94db

File tree

4 files changed

+4
-20
lines changed

4 files changed

+4
-20
lines changed

Documentation/mkfs.btrfs.asciidoc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,6 @@ Print the *mkfs.btrfs* version and exit.
161161
*--help*::
162162
Print help.
163163

164-
*-A|--alloc-start <offset>*::
165-
*deprecated, will be removed*
166-
(An option to help debugging chunk allocator.)
167-
Specify the (physical) offset from the start of the device at which allocations
168-
start. The default value is zero.
169-
170164
SIZE UNITS
171165
----------
172166
The default unit is 'byte'. All size parameters accept suffixes in the 1024

ctree.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1173,7 +1173,6 @@ struct btrfs_fs_info {
11731173
u64 data_alloc_profile;
11741174
u64 metadata_alloc_profile;
11751175
u64 system_alloc_profile;
1176-
u64 alloc_start;
11771176

11781177
struct btrfs_trans_handle *running_transaction;
11791178
struct btrfs_super_block *super_copy;

mkfs/main.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,6 @@ static void print_usage(int ret)
361361
printf("\t-V|--version print the mkfs.btrfs version and exit\n");
362362
printf("\t--help print this help and exit\n");
363363
printf(" deprecated:\n");
364-
printf("\t-A|--alloc-start START the offset to start the filesystem\n");
365364
printf("\t-l|--leafsize SIZE deprecated, alias for nodesize\n");
366365
exit(ret);
367366
}
@@ -920,7 +919,6 @@ int BOX_MAIN(mkfs)(int argc, char **argv)
920919
char *label = NULL;
921920
u64 block_count = 0;
922921
u64 dev_block_count = 0;
923-
u64 alloc_start = 0;
924922
u64 metadata_profile = 0;
925923
u64 data_profile = 0;
926924
u32 nodesize = max_t(u32, sysconf(_SC_PAGESIZE),
@@ -960,7 +958,6 @@ int BOX_MAIN(mkfs)(int argc, char **argv)
960958
int c;
961959
enum { GETOPT_VAL_SHRINK = 257, GETOPT_VAL_CHECKSUM };
962960
static const struct option long_options[] = {
963-
{ "alloc-start", required_argument, NULL, 'A'},
964961
{ "byte-count", required_argument, NULL, 'b' },
965962
{ "csum", required_argument, NULL,
966963
GETOPT_VAL_CHECKSUM },
@@ -991,9 +988,6 @@ int BOX_MAIN(mkfs)(int argc, char **argv)
991988
if (c < 0)
992989
break;
993990
switch(c) {
994-
case 'A':
995-
alloc_start = parse_size(optarg);
996-
break;
997991
case 'f':
998992
force_overwrite = 1;
999993
break;
@@ -1348,7 +1342,6 @@ int BOX_MAIN(mkfs)(int argc, char **argv)
13481342
close(fd);
13491343
fd = -1;
13501344
root = fs_info->fs_root;
1351-
fs_info->alloc_start = alloc_start;
13521345

13531346
ret = create_metadata_block_groups(root, mixed, &allocation);
13541347
if (ret) {

volumes.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ static int find_free_dev_extent_start(struct btrfs_device *device,
487487
* used by the boot loader (grub for example), so we make sure to start
488488
* at an offset of at least 1MB.
489489
*/
490-
min_search_start = max(root->fs_info->alloc_start, (u64)SZ_1M);
490+
min_search_start = BTRFS_BLOCK_RESERVED_1M_FOR_SUPER;
491491
search_start = max(search_start, min_search_start);
492492

493493
path = btrfs_alloc_path();
@@ -906,7 +906,7 @@ static u64 chunk_bytes_by_type(u64 type, u64 calc_size,
906906
* It is not equal to "device->total_bytes - device->bytes_used".
907907
* We do not allocate any chunk in 1M at beginning of device, and not
908908
* allowed to allocate any chunk before alloc_start if it is specified.
909-
* So search holes from max(1M, alloc_start) to device->total_bytes.
909+
* So search holes from 1M to device->total_bytes.
910910
*/
911911
static int btrfs_device_avail_bytes(struct btrfs_trans_handle *trans,
912912
struct btrfs_device *device,
@@ -917,21 +917,19 @@ static int btrfs_device_avail_bytes(struct btrfs_trans_handle *trans,
917917
struct btrfs_key key;
918918
struct btrfs_dev_extent *dev_extent = NULL;
919919
struct extent_buffer *l;
920-
u64 search_start = root->fs_info->alloc_start;
920+
u64 search_start = BTRFS_BLOCK_RESERVED_1M_FOR_SUPER;;
921921
u64 search_end = device->total_bytes;
922922
u64 extent_end = 0;
923923
u64 free_bytes = 0;
924924
int ret;
925925
int slot = 0;
926926

927-
search_start = max(BTRFS_BLOCK_RESERVED_1M_FOR_SUPER, search_start);
928-
929927
path = btrfs_alloc_path();
930928
if (!path)
931929
return -ENOMEM;
932930

933931
key.objectid = device->devid;
934-
key.offset = root->fs_info->alloc_start;
932+
key.offset = search_start;
935933
key.type = BTRFS_DEV_EXTENT_KEY;
936934

937935
path->reada = READA_FORWARD;

0 commit comments

Comments
 (0)