summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Hao <kexin.hao@windriver.com>2020-07-14 08:53:22 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-07-31 22:02:52 +0100
commit1a24aed9055ae0af628a4137f1390d013dcb196a (patch)
tree176e46fe9b07a8932a188a1fc74db644651806c8
parent1d0fbc64c85a99151acc2fe3bfe9d42d1232dc4a (diff)
downloadpoky-1a24aed9055ae0af628a4137f1390d013dcb196a.tar.gz
wic/filemap: Drop the unused get_unmapped_ranges()
This method is not used by any code, so drop it. (From OE-Core rev: 19078f9540c455ccddb6f2986b96562a8186ec35) Signed-off-by: Kevin Hao <kexin.hao@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 6513fd9302b9989f97fc9d95e76e06ad5d266774) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--scripts/lib/wic/filemap.py38
1 files changed, 2 insertions, 36 deletions
diff --git a/scripts/lib/wic/filemap.py b/scripts/lib/wic/filemap.py
index 8cfed5afa8..f8c6e09d01 100644
--- a/scripts/lib/wic/filemap.py
+++ b/scripts/lib/wic/filemap.py
@@ -155,15 +155,6 @@ class _FilemapBase(object):
155 155
156 raise Error("the method is not implemented") 156 raise Error("the method is not implemented")
157 157
158 def get_unmapped_ranges(self, start, count): # pylint: disable=W0613,R0201
159 """
160 This method has has to be implemented by child classes. Just like
161 'get_mapped_ranges()', but yields unmapped block ranges instead
162 (holes).
163 """
164
165 raise Error("the method is not implemented")
166
167 158
168# The 'SEEK_HOLE' and 'SEEK_DATA' options of the file seek system call 159# The 'SEEK_HOLE' and 'SEEK_DATA' options of the file seek system call
169_SEEK_DATA = 3 160_SEEK_DATA = 3
@@ -258,9 +249,8 @@ class FilemapSeek(_FilemapBase):
258 249
259 def _get_ranges(self, start, count, whence1, whence2): 250 def _get_ranges(self, start, count, whence1, whence2):
260 """ 251 """
261 This function implements 'get_mapped_ranges()' and 252 This function implements 'get_mapped_ranges()' depending
262 'get_unmapped_ranges()' depending on what is passed in the 'whence1' 253 on what is passed in the 'whence1' and 'whence2' arguments.
263 and 'whence2' arguments.
264 """ 254 """
265 255
266 assert whence1 != whence2 256 assert whence1 != whence2
@@ -290,12 +280,6 @@ class FilemapSeek(_FilemapBase):
290 % (start, count, start + count - 1)) 280 % (start, count, start + count - 1))
291 return self._get_ranges(start, count, _SEEK_DATA, _SEEK_HOLE) 281 return self._get_ranges(start, count, _SEEK_DATA, _SEEK_HOLE)
292 282
293 def get_unmapped_ranges(self, start, count):
294 """Refer the '_FilemapBase' class for the documentation."""
295 self._log.debug("FilemapSeek: get_unmapped_ranges(%d, %d(%d))"
296 % (start, count, start + count - 1))
297 return self._get_ranges(start, count, _SEEK_HOLE, _SEEK_DATA)
298
299 283
300# Below goes the FIEMAP ioctl implementation, which is not very readable 284# Below goes the FIEMAP ioctl implementation, which is not very readable
301# because it deals with the rather complex FIEMAP ioctl. To understand the 285# because it deals with the rather complex FIEMAP ioctl. To understand the
@@ -485,24 +469,6 @@ class FilemapFiemap(_FilemapBase):
485 % (first_prev, last_prev)) 469 % (first_prev, last_prev))
486 yield (first_prev, last_prev) 470 yield (first_prev, last_prev)
487 471
488 def get_unmapped_ranges(self, start, count):
489 """Refer the '_FilemapBase' class for the documentation."""
490 self._log.debug("FilemapFiemap: get_unmapped_ranges(%d, %d(%d))"
491 % (start, count, start + count - 1))
492 hole_first = start
493 for first, last in self._do_get_mapped_ranges(start, count):
494 if first > hole_first:
495 self._log.debug("FilemapFiemap: yielding range (%d, %d)"
496 % (hole_first, first - 1))
497 yield (hole_first, first - 1)
498
499 hole_first = last + 1
500
501 if hole_first < start + count:
502 self._log.debug("FilemapFiemap: yielding range (%d, %d)"
503 % (hole_first, start + count - 1))
504 yield (hole_first, start + count - 1)
505
506def filemap(image, log=None): 472def filemap(image, log=None):
507 """ 473 """
508 Create and return an instance of a Filemap class - 'FilemapFiemap' or 474 Create and return an instance of a Filemap class - 'FilemapFiemap' or