Fiemap: fix internal buffer size calculations
authorArtem Bityutskiy <artem.bityutskiy@intel.com>
Wed, 28 Nov 2012 06:59:53 +0000 (08:59 +0200)
committerArtem Bityutskiy <artem.bityutskiy@intel.com>
Wed, 28 Nov 2012 06:59:53 +0000 (08:59 +0200)
... I used 'buf_size' instead of 'self._buf_size' by a mistake.

Change-Id: If92b92e4aa09653fe27e41e5a2cc236fce3042af
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
bmaptools/Fiemap.py

index 79a108a..add086c 100644 (file)
@@ -79,7 +79,7 @@ class Fiemap:
         buf_size -= _FIEMAP_SIZE
         self._fiemap_extent_cnt = buf_size / _FIEMAP_EXTENT_SIZE
         self._buf_size = self._fiemap_extent_cnt * _FIEMAP_EXTENT_SIZE
-        buf_size += _FIEMAP_SIZE
+        self._buf_size += _FIEMAP_SIZE
 
         # Allocate a mutable buffer for the FIEMAP ioctl
         self._buf = array.array('B', [0] * self._buf_size)