Bmap: sync with the latest bmap-tools
authorArtem Bityutskiy <artem.bityutskiy@intel.com>
Wed, 22 Jan 2014 08:04:06 +0000 (10:04 +0200)
committerArtem Bityutskiy <artem.bityutskiy@intel.com>
Wed, 22 Jan 2014 10:10:19 +0000 (12:10 +0200)
commit8a35306e9da4a12b2315d064ac288e186d6cf477
treefdde854322169568d0eb90318c0c7d59fe6d99af
parent2d8f93d64130f83f9f0ac4e8e7af1ed8a3dd661b
Bmap: sync with the latest bmap-tools

This patch syncs MIC's copy of BmapCreate with the latest contents of the
bmap-tools project. The reason for syncing is to fix DEVT-139. The bugreport
tells that MIC cannot generate the bmap file when the image resides on tmpfs.
And now this is fixed.

We also re-named the Fiemap module to Filemap, because now this module supports
both FIEMAP ioctl and the SEEK_HOLE method. Here is some more description from
the bmap-tools release notes.

"
Make 'bmaptool create' (and hence, the BmapCreate module) work with the
"tmpfs" file-system. This file-system does not, unfortunately, support the
"FIEMAP" ioctl, but it supports the "SEEK_HOLE" option of the "lseek" system
call, which can also be used to find where the holes are. In this release we
have implemented support for "SEEK_HOLE" to cover tmpfs. Generally, FIEMAP
is faster than "SEEK_HOLE" for large files, so we always try to start with
using FIEMAP, and if it is not supported, we fall-back to using "SEEK_HOLE".
Therefore, the "Fiemap" module was re-named to "Filemap", since it is now
supports more than just the FIEMAP ioctl.

Unfortunately, the SEEK_HOLE method requires the directory where the image
resides to be accessible for writing, because in current implementation we
need to create a temporary file there for a short time. The temporary file
is used to detect whether SEEK_HOLE is really implemented, or the system
just fakes it by always returning EOF.
"

Change-Id: I75522cab3c32c9b0879967f8fa2587c71bae0395
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
mic/utils/BmapCreate.py
mic/utils/Fiemap.py [deleted file]
mic/utils/Filemap.py [new file with mode: 0644]