summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/volumes.c
diff options
context:
space:
mode:
authorArne Jansen <sensille@gmx.net>2011-04-12 11:01:20 +0200
committerArne Jansen <sensille@gmx.net>2011-05-13 15:36:12 +0200
commita9c9bf68276c36898e23db770a65bd9b75bfac58 (patch)
treeba18ea840825d8c2bc6199fda17bb44f52fb85c4 /fs/btrfs/volumes.c
parentbcd53741cc2af4342ac3ff6983bddc4a1b63b9b4 (diff)
downloadtalos-op-linux-a9c9bf68276c36898e23db770a65bd9b75bfac58.tar.gz
talos-op-linux-a9c9bf68276c36898e23db770a65bd9b75bfac58.zip
btrfs: heed alloc_start
currently alloc_start is disregarded if the requested chunk size is bigger than (device size - alloc_start), but smaller than the device size. The only situation where I see this could have made sense was when a chunk equal the size of the device has been requested. This was possible as the allocator failed to take alloc_start into account when calculating the request chunk size. As this gets fixed by this patch, the workaround is not necessary anymore.
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r--fs/btrfs/volumes.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index a9f1fc23278b..45c592a7335e 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -849,10 +849,7 @@ int find_free_dev_extent(struct btrfs_trans_handle *trans,
/* we don't want to overwrite the superblock on the drive,
* so we make sure to start at an offset of at least 1MB
*/
- search_start = 1024 * 1024;
-
- if (root->fs_info->alloc_start + num_bytes <= search_end)
- search_start = max(root->fs_info->alloc_start, search_start);
+ search_start = max(root->fs_info->alloc_start, 1024ull * 1024);
max_hole_start = search_start;
max_hole_size = 0;
OpenPOWER on IntegriCloud