| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
class FreeSpaceExtent(): |
| 20 |
"""Helper object for listing free space tree extents. |
| 21 |
|
| 22 |
In the free space tree, information about free space can be stored as free |
| 23 |
space extent item, in which case it has information about a single gap of |
| 24 |
free space. Alternatively, it can be stored in a compacted format, as free |
| 25 |
space bitmap. In that case, to find out where the tiny gaps of free space |
| 26 |
are located, the bitmap needs to be unpacked. |
| 27 |
|
| 28 |
This object serves as a helper when doing so. It is used by the |
| 29 |
:func:`~btrfs.ctree.FreeSpaceBitmap.unpack` function of a |
| 30 |
:class:`btrfs.ctree.FreeSpaceBitmap`. It's also used by the |
| 31 |
:func:`~btrfs.ctree.FileSystem.free_space_extents` convenience method of a |
| 32 |
:class:`btrfs.ctree.FileSystem` object for generating a simple stream of free |
| 33 |
space extent info transparently unpacking bitmaps. |
| 34 |
|
| 35 |
:ivar int vaddr: Logical address of the start of the free space extent. |
| 36 |
:ivar int length: Length of the free space extent. |
| 37 |
""" |
| 38 |
def __init__(self, vaddr, length): |
| 39 |
self.vaddr = vaddr |
| 40 |
self.length = length |
| 41 |
|
| 42 |
def __str__(self): |
| 43 |
return "free space extent vaddr {self.vaddr} length {self.length}".format(self=self) |