diff options
author | Xiao Jin <jin.xiao@samsung.com> | 2018-03-28 22:25:14 +0800 |
---|---|---|
committer | Xiao Jin <jin.xiao@samsung.com> | 2018-03-28 22:26:02 +0800 |
commit | dd404ed2260c89d758f485144396bfbccb98684b (patch) | |
tree | 4a845cf4152dfd2aeb491b1f0d5baddb32907762 | |
parent | b55c3d8b3845bca2b5dff3451334d4959a22f4a8 (diff) | |
download | mic-dd404ed2260c89d758f485144396bfbccb98684b.tar.gz mic-dd404ed2260c89d758f485144396bfbccb98684b.tar.bz2 mic-dd404ed2260c89d758f485144396bfbccb98684b.zip |
change __resize_to_minimal function
Change-Id: I7b50e83cc8b1294f1d9b524ffbd69769eebd914b
-rwxr-xr-x[-rw-r--r--] | mic/utils/fs_related.py | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/mic/utils/fs_related.py b/mic/utils/fs_related.py index 0040fa2..9be1a10 100644..100755 --- a/mic/utils/fs_related.py +++ b/mic/utils/fs_related.py @@ -539,21 +539,8 @@ class ExtDiskMount(DiskMount): def __resize_to_minimal(self): msger.info("Resizing filesystem to minimal ...") self.__fsck() - - # - # Use a binary search to find the minimal size - # we can resize the image to - # - bot = 0 - top = self.__get_size_from_filesystem() - while top != (bot + 1): - t = bot + ((top - bot) / 2) - - if not resize2fs(self.disk.lofile, t): - top = t - else: - bot = t - return top + resize2fs(self.disk.lofile, 0) + return self.__get_size_from_filesystem() def resparse(self, size = None): self.cleanup() |