diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-04-25 16:55:21 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@hera.kernel.org> | 2008-04-25 16:55:21 -0400 |
commit | 083faf794fd87a7897545a2a16a15599f62beffb (patch) | |
tree | 6ad1c8046d93fefd2e0614da0137f6f1f8294260 /volumes.c | |
parent | 4415143185b8c3ac799301a72a9cdbbd746fc723 (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 'volumes.c')
-rw-r--r-- | volumes.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -252,6 +252,10 @@ static int find_free_dev_extent(struct btrfs_trans_handle *trans, * so we make sure to start at an offset of at least 1MB */ search_start = max((u64)1024 * 1024, search_start); + + if (root->fs_info->alloc_start + num_bytes <= device->total_bytes) + search_start = max(root->fs_info->alloc_start, search_start); + key.objectid = device->devid; key.offset = search_start; key.type = BTRFS_DEV_EXTENT_KEY; |