[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH] Maintain request sort order by using req_disks instead of parents.



Request sorting is supposed to depend on the number of disks a given
request can be allocated from (req_disks), not what disk it is currently
allocated from (parents).
---
 storage/partitioning.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/storage/partitioning.py b/storage/partitioning.py
index 97316b4..66be38b 100644
--- a/storage/partitioning.py
+++ b/storage/partitioning.py
@@ -376,7 +376,7 @@ def partitionCompare(part1, part2):
     ret -= cmp(part1.req_bootable, part2.req_bootable) * 1000
 
     # more specific disk specs to the front of the list
-    ret += cmp(len(part1.parents), len(part2.parents)) * 500
+    ret += cmp(len(part1.req_disks), len(part2.req_disks)) * 500
 
     # primary-only to the front of the list
     ret -= cmp(part1.req_primary, part2.req_primary) * 200
-- 
1.6.0.6


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]