summaryrefslogtreecommitdiff
path: root/mkfs.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-04-25 16:55:21 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2008-04-25 16:55:21 -0400
commit083faf794fd87a7897545a2a16a15599f62beffb (patch)
tree6ad1c8046d93fefd2e0614da0137f6f1f8294260 /mkfs.c
parent4415143185b8c3ac799301a72a9cdbbd746fc723 (diff)
Add mkfs.btrfs -A offset to control allocation start on devices
This is a utility option for the resizer, it makes sure to allocate at offset bytes in the disk or higher. It ensures the resizer will have something to move when testing it.
Diffstat (limited to 'mkfs.c')
-rw-r--r--mkfs.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/mkfs.c b/mkfs.c
index 7317bcd3..ac81ab5a 100644
--- a/mkfs.c
+++ b/mkfs.c
@@ -280,6 +280,7 @@ static char *parse_label(char *input)
}
static struct option long_options[] = {
+ { "alloc-start", 1, NULL, 'A'},
{ "byte-count", 1, NULL, 'b' },
{ "leafsize", 1, NULL, 'l' },
{ "label", 1, NULL, 'L'},
@@ -300,6 +301,7 @@ int main(int ac, char **av)
u64 block_count = 0;
u64 dev_block_count = 0;
u64 blocks[6];
+ u64 alloc_start;
u64 metadata_profile = BTRFS_BLOCK_GROUP_RAID1 | BTRFS_BLOCK_GROUP_DUP;
u64 data_profile = BTRFS_BLOCK_GROUP_RAID0;
u32 leafsize = getpagesize();
@@ -315,11 +317,14 @@ int main(int ac, char **av)
while(1) {
int c;
- c = getopt_long(ac, av, "b:l:n:s:m:d:L:", long_options,
+ c = getopt_long(ac, av, "A:b:l:n:s:m:d:L:", long_options,
&option_index);
if (c < 0)
break;
switch(c) {
+ case 'A':
+ alloc_start = parse_size(optarg);
+ break;
case 'd':
data_profile = parse_profile(optarg);
break;
@@ -397,6 +402,7 @@ int main(int ac, char **av)
exit(1);
}
root = open_ctree(file, 0);
+ root->fs_info->alloc_start = alloc_start;
trans = btrfs_start_transaction(root, 1);
if (ac == 0)