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

Re: [PATCH 1/2] Use parted.Device's sectorSize attr instead of physicalSectorSize.



Ack.

On 11/03/2009 07:27 PM, David Lehman wrote:
---
  storage/partitioning.py |   12 ++++++------
  1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/storage/partitioning.py b/storage/partitioning.py
index b1b4899..80a2c7f 100644
--- a/storage/partitioning.py
+++ b/storage/partitioning.py
@@ -659,7 +659,7 @@ def addPartition(disk, free, part_type, size):
          end = free.end
      else:
          # size is in MB
-        length = sizeToSectors(size, disk.device.physicalSectorSize)
+        length = sizeToSectors(size, disk.device.sectorSize)
          end = start + length
          if not _a.isAligned(free, end):
              end = _a.alignNearest(free, end)
@@ -868,7 +868,7 @@ def allocatePartitions(disks, partitions, freespace):
          # loop through disks
          for _disk in req_disks:
              disklabel = disklabels[_disk.path]
-            sectorSize = disklabel.partedDevice.physicalSectorSize
+            sectorSize = disklabel.partedDevice.sectorSize
              best = None
              current_free = free

@@ -951,7 +951,7 @@ def allocatePartitions(disks, partitions, freespace):

                          # grow all growable requests
                          disk_growth = 0
-                        disk_sector_size = disklabels[disk_path].partedDevice.physicalSectorSize
+                        disk_sector_size = disklabels[disk_path].partedDevice.sectorSize
                          for chunk in chunks:
                              chunk.growRequests()
                              # record the growth for this layout
@@ -1077,7 +1077,7 @@ class Request(object):
          self.done = not partition.req_grow  # can we grow this request more?
          self.base = partition.partedPartition.geometry.length   # base sectors

-        sector_size = partition.partedPartition.disk.device.physicalSectorSize
+        sector_size = partition.partedPartition.disk.device.sectorSize

          if partition.req_grow:
              max_size = partition.req_max_size
@@ -1129,7 +1129,7 @@ class Chunk(object):
          """
          self.geometry = geometry            # parted.Geometry
          self.pool = self.geometry.length    # free sector count
-        self.sectorSize = self.geometry.device.physicalSectorSize
+        self.sectorSize = self.geometry.device.sectorSize
          self.base = 0                       # sum of growable requests' base
                                              # sizes, in sectors
          self.requests = []                  # list of Request instances
@@ -1328,7 +1328,7 @@ def growPartitions(disks, partitions, free):

      for disk in disks:
          log.debug("growing partitions on %s" % disk.name)
-        sector_size = disk.format.partedDevice.physicalSectorSize
+        sector_size = disk.format.partedDevice.sectorSize
          _a = getDiskAlignment(disk.format.partedDisk)

          # find any extended partition on this disk


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