mirror of
https://github.com/Zygo/bees.git
synced 2025-06-16 09:36:17 +02:00
crucible: extentwalker: add compressed() and bytenr() methods
Also use C++11 syntax for construction. Signed-off-by: Zygo Blaxell <bees@furryterror.org>
This commit is contained in:
@ -79,17 +79,6 @@ namespace crucible {
|
||||
<< "] }";
|
||||
}
|
||||
|
||||
Extent::Extent() :
|
||||
m_begin(0),
|
||||
m_end(0),
|
||||
m_physical(0),
|
||||
m_flags(0),
|
||||
m_physical_len(0),
|
||||
m_logical_len(0),
|
||||
m_offset(0)
|
||||
{
|
||||
}
|
||||
|
||||
Extent::operator bool() const
|
||||
{
|
||||
THROW_CHECK2(invalid_argument, m_begin, m_end, m_end >= m_begin);
|
||||
@ -109,6 +98,18 @@ namespace crucible {
|
||||
return m_begin == that.m_begin && m_end == that.m_end && m_physical == that.m_physical && m_flags == that.m_flags;
|
||||
}
|
||||
|
||||
bool
|
||||
Extent::compressed() const
|
||||
{
|
||||
return m_flags & FIEMAP_EXTENT_ENCODED;
|
||||
}
|
||||
|
||||
uint64_t
|
||||
Extent::bytenr() const
|
||||
{
|
||||
return compressed() ? m_physical : m_physical - m_offset;
|
||||
}
|
||||
|
||||
ExtentWalker::ExtentWalker(Fd fd) :
|
||||
m_fd(fd),
|
||||
m_current(m_extents.begin())
|
||||
|
Reference in New Issue
Block a user