Skip to content
API Documentation
BastionGuard™
xfs::Superblock Struct Reference

#include <xfs_format.hpp>

Public Member Functions

unsigned format_version () const
bool is_v5 () const
bool is_v4 () const
bool has_crc () const
bool has_ftype () const
uint64_t volume_size_bytes () const
std::string label () const

Public Attributes

uint32_t magicnum {0}
uint32_t blocksize {0}
uint64_t dblocks {0}
uint64_t rblocks {0}
uint64_t rextents {0}
std::array< uint8_t, 16 > uuid {}
uint64_t logstart {0}
uint64_t rootino {0}
uint64_t rbmino {0}
uint64_t rsumino {0}
uint32_t rextsize {0}
uint32_t agblocks {0}
uint32_t agcount {0}
uint32_t rbmblocks {0}
uint32_t logblocks {0}
uint16_t versionnum {0}
uint16_t sectsize {0}
uint16_t inodesize {0}
uint16_t inopblock {0}
std::array< char, 12 > fname {}
uint8_t blocklog {0}
uint8_t sectlog {0}
uint8_t inodelog {0}
uint8_t inopblog {0}
uint8_t agblklog {0}
uint8_t rextslog {0}
uint8_t inprogress {0}
uint8_t imax_pct {0}
uint64_t icount {0}
uint64_t ifree {0}
uint64_t fdblocks {0}
uint64_t frextents {0}
uint64_t uquotino {0}
uint64_t gquotino {0}
uint16_t qflags {0}
uint8_t flags {0}
uint8_t shared_vn {0}
uint32_t inoalignmt {0}
uint32_t unit {0}
uint32_t width {0}
uint8_t dirblklog {0}
uint8_t logsectlog {0}
uint16_t logsectsize {0}
uint32_t logsunit {0}
uint32_t features2 {0}
uint32_t bad_features2 {0}
uint32_t features_compat {0}
uint32_t features_ro_compat {0}
uint32_t features_incompat {0}
uint32_t features_log_incompat {0}
uint32_t crc {0}
uint32_t spino_align {0}
uint64_t pquotino {0}
uint64_t lsn {0}
std::array< uint8_t, 16 > meta_uuid {}

Detailed Description

Definition at line 132 of file xfs_format.hpp.

Member Function Documentation

◆ format_version()

unsigned xfs::Superblock::format_version ( ) const
inline

◆ has_crc()

bool xfs::Superblock::has_crc ( ) const
inline

Definition at line 196 of file xfs_format.hpp.

196{ return is_v5(); }
bool is_v5() const

References is_v5().

◆ has_ftype()

bool xfs::Superblock::has_ftype ( ) const
inline

Definition at line 197 of file xfs_format.hpp.

197 {
198 // FTYPE bit on V5 lives in features_incompat; on V4 it's part of features2
200 // V4 stored ftype in features2 bit 0x80 (XFS_SB_VERSION2_FTYPE)
201 return (features2 & 0x00000080u) != 0;
202 }
constexpr uint32_t XFS_SB_FEAT_INCOMPAT_FTYPE
uint32_t features_incompat

References features2, features_incompat, is_v5(), and xfs::XFS_SB_FEAT_INCOMPAT_FTYPE.

Referenced by XfsRecovery::recover(), and anonymous_namespace{filesystem_probes.cpp}::xfs_probe().

◆ is_v4()

bool xfs::Superblock::is_v4 ( ) const
inline

Definition at line 195 of file xfs_format.hpp.

195{ return format_version() == XFS_SB_VERSION_4; }
constexpr uint16_t XFS_SB_VERSION_4
unsigned format_version() const

References format_version(), and xfs::XFS_SB_VERSION_4.

◆ is_v5()

◆ label()

std::string xfs::Superblock::label ( ) const
inline

Definition at line 204 of file xfs_format.hpp.

204 {
205 std::string s(fname.data(), fname.size());
206 while (!s.empty() && (s.back() == '\0' || s.back() == ' ')) s.pop_back();
207 return s;
208 }
std::array< char, 12 > fname

References fname.

Referenced by XfsRecovery::recover(), and anonymous_namespace{filesystem_probes.cpp}::xfs_probe().

◆ volume_size_bytes()

Member Data Documentation

◆ agblklog

◆ agblocks

◆ agcount

◆ bad_features2

uint32_t xfs::Superblock::bad_features2 {0}

Definition at line 181 of file xfs_format.hpp.

Referenced by xfs::parse_superblock().

◆ blocklog

uint8_t xfs::Superblock::blocklog {0}

Definition at line 154 of file xfs_format.hpp.

Referenced by xfs::parse_superblock().

◆ blocksize

◆ crc

uint32_t xfs::Superblock::crc {0}

Definition at line 186 of file xfs_format.hpp.

Referenced by xfs::parse_superblock().

◆ dblocks

uint64_t xfs::Superblock::dblocks {0}

◆ dirblklog

uint8_t xfs::Superblock::dirblklog {0}

Definition at line 174 of file xfs_format.hpp.

Referenced by xfs::parse_superblock().

◆ fdblocks

uint64_t xfs::Superblock::fdblocks {0}

Definition at line 164 of file xfs_format.hpp.

Referenced by xfs::parse_superblock().

◆ features2

uint32_t xfs::Superblock::features2 {0}

Definition at line 178 of file xfs_format.hpp.

Referenced by has_ftype(), and xfs::parse_superblock().

◆ features_compat

uint32_t xfs::Superblock::features_compat {0}

Definition at line 182 of file xfs_format.hpp.

Referenced by xfs::parse_superblock().

◆ features_incompat

uint32_t xfs::Superblock::features_incompat {0}

◆ features_log_incompat

uint32_t xfs::Superblock::features_log_incompat {0}

Definition at line 185 of file xfs_format.hpp.

Referenced by xfs::parse_superblock().

◆ features_ro_compat

◆ flags

uint8_t xfs::Superblock::flags {0}

Definition at line 169 of file xfs_format.hpp.

Referenced by xfs::parse_superblock().

◆ fname

std::array<char, 12> xfs::Superblock::fname {}

Definition at line 153 of file xfs_format.hpp.

Referenced by label(), and xfs::parse_superblock().

◆ frextents

uint64_t xfs::Superblock::frextents {0}

Definition at line 165 of file xfs_format.hpp.

Referenced by xfs::parse_superblock().

◆ gquotino

uint64_t xfs::Superblock::gquotino {0}

Definition at line 167 of file xfs_format.hpp.

Referenced by xfs::parse_superblock().

◆ icount

uint64_t xfs::Superblock::icount {0}

Definition at line 162 of file xfs_format.hpp.

Referenced by xfs::parse_superblock().

◆ ifree

uint64_t xfs::Superblock::ifree {0}

Definition at line 163 of file xfs_format.hpp.

Referenced by xfs::parse_superblock().

◆ imax_pct

uint8_t xfs::Superblock::imax_pct {0}

Definition at line 161 of file xfs_format.hpp.

Referenced by xfs::parse_superblock().

◆ inoalignmt

uint32_t xfs::Superblock::inoalignmt {0}

Definition at line 171 of file xfs_format.hpp.

Referenced by xfs::parse_superblock().

◆ inodelog

uint8_t xfs::Superblock::inodelog {0}

Definition at line 156 of file xfs_format.hpp.

Referenced by xfs::parse_superblock().

◆ inodesize

◆ inopblock

◆ inopblog

uint8_t xfs::Superblock::inopblog {0}

◆ inprogress

uint8_t xfs::Superblock::inprogress {0}

Definition at line 160 of file xfs_format.hpp.

Referenced by xfs::parse_superblock().

◆ logblocks

uint32_t xfs::Superblock::logblocks {0}

Definition at line 148 of file xfs_format.hpp.

Referenced by xfs::parse_superblock().

◆ logsectlog

uint8_t xfs::Superblock::logsectlog {0}

Definition at line 175 of file xfs_format.hpp.

Referenced by xfs::parse_superblock().

◆ logsectsize

uint16_t xfs::Superblock::logsectsize {0}

Definition at line 176 of file xfs_format.hpp.

Referenced by xfs::parse_superblock().

◆ logstart

uint64_t xfs::Superblock::logstart {0}

Definition at line 140 of file xfs_format.hpp.

Referenced by xfs::parse_superblock().

◆ logsunit

uint32_t xfs::Superblock::logsunit {0}

Definition at line 177 of file xfs_format.hpp.

Referenced by xfs::parse_superblock().

◆ lsn

uint64_t xfs::Superblock::lsn {0}

Definition at line 189 of file xfs_format.hpp.

Referenced by xfs::parse_superblock().

◆ magicnum

uint32_t xfs::Superblock::magicnum {0}

Definition at line 134 of file xfs_format.hpp.

Referenced by xfs::parse_superblock().

◆ meta_uuid

std::array<uint8_t, 16> xfs::Superblock::meta_uuid {}

Definition at line 190 of file xfs_format.hpp.

Referenced by xfs::parse_superblock().

◆ pquotino

uint64_t xfs::Superblock::pquotino {0}

Definition at line 188 of file xfs_format.hpp.

Referenced by xfs::parse_superblock().

◆ qflags

uint16_t xfs::Superblock::qflags {0}

Definition at line 168 of file xfs_format.hpp.

Referenced by xfs::parse_superblock().

◆ rblocks

uint64_t xfs::Superblock::rblocks {0}

Definition at line 137 of file xfs_format.hpp.

Referenced by xfs::parse_superblock().

◆ rbmblocks

uint32_t xfs::Superblock::rbmblocks {0}

Definition at line 147 of file xfs_format.hpp.

Referenced by xfs::parse_superblock().

◆ rbmino

uint64_t xfs::Superblock::rbmino {0}

Definition at line 142 of file xfs_format.hpp.

Referenced by xfs::parse_superblock().

◆ rextents

uint64_t xfs::Superblock::rextents {0}

Definition at line 138 of file xfs_format.hpp.

Referenced by xfs::parse_superblock().

◆ rextsize

uint32_t xfs::Superblock::rextsize {0}

Definition at line 144 of file xfs_format.hpp.

Referenced by xfs::parse_superblock().

◆ rextslog

uint8_t xfs::Superblock::rextslog {0}

Definition at line 159 of file xfs_format.hpp.

Referenced by xfs::parse_superblock().

◆ rootino

uint64_t xfs::Superblock::rootino {0}

Definition at line 141 of file xfs_format.hpp.

Referenced by xfs::parse_superblock(), and XfsRecovery::recover().

◆ rsumino

uint64_t xfs::Superblock::rsumino {0}

Definition at line 143 of file xfs_format.hpp.

Referenced by xfs::parse_superblock().

◆ sectlog

uint8_t xfs::Superblock::sectlog {0}

Definition at line 155 of file xfs_format.hpp.

Referenced by xfs::parse_superblock().

◆ sectsize

◆ shared_vn

uint8_t xfs::Superblock::shared_vn {0}

Definition at line 170 of file xfs_format.hpp.

Referenced by xfs::parse_superblock().

◆ spino_align

uint32_t xfs::Superblock::spino_align {0}

Definition at line 187 of file xfs_format.hpp.

Referenced by xfs::parse_superblock().

◆ unit

uint32_t xfs::Superblock::unit {0}

Definition at line 172 of file xfs_format.hpp.

Referenced by xfs::parse_superblock().

◆ uquotino

uint64_t xfs::Superblock::uquotino {0}

Definition at line 166 of file xfs_format.hpp.

Referenced by xfs::parse_superblock().

◆ uuid

std::array<uint8_t, 16> xfs::Superblock::uuid {}

Definition at line 139 of file xfs_format.hpp.

Referenced by xfs::parse_superblock().

◆ versionnum

uint16_t xfs::Superblock::versionnum {0}

Definition at line 149 of file xfs_format.hpp.

Referenced by format_version(), and xfs::parse_superblock().

◆ width

uint32_t xfs::Superblock::width {0}

Definition at line 173 of file xfs_format.hpp.

Referenced by xfs::parse_superblock().


The documentation for this struct was generated from the following file:
  • BastionGuard/thirdparty/bastionguard-recovery-data/src/xfs_format.hpp