summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChris Mason <chris.mason@fusionio.com>2013-01-04 15:39:43 -0500
committerChris Mason <chris.mason@fusionio.com>2013-02-01 14:24:24 -0500
commit8de972b4faa4be9b2a3c53103e18d86092a5da45 (patch)
treec81436a4a777362f27d6982d8eed904c4131ba40 /fs
parent6ac0f4884eaad28441c6e0f9d1400a08c2149049 (diff)
downloadop-kernel-dev-8de972b4faa4be9b2a3c53103e18d86092a5da45.zip
op-kernel-dev-8de972b4faa4be9b2a3c53103e18d86092a5da45.tar.gz
Btrfs: fix cluster alignment for mount -o ssd
With the new raid56 code, we want to make sure we're properly aligning our allocation clusters with -o ssd Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/extent-tree.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 3345f68..f1340210 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -5715,6 +5715,7 @@ have_block_group:
* lets look there
*/
if (last_ptr) {
+ unsigned long aligned_cluster;
/*
* the refill lock keeps out other
* people trying to start a new cluster
@@ -5781,11 +5782,15 @@ refill_cluster:
goto unclustered_alloc;
}
+ aligned_cluster = max_t(unsigned long,
+ empty_cluster + empty_size,
+ block_group->full_stripe_len);
+
/* allocate a cluster in this block group */
ret = btrfs_find_space_cluster(trans, root,
block_group, last_ptr,
search_start, num_bytes,
- empty_cluster + empty_size);
+ aligned_cluster);
if (ret == 0) {
/*
* now pull our allocation out of this
OpenPOWER on IntegriCloud