Skip to content

Add btrfs helpers#608

Open
morbidrsa wants to merge 2 commits intoosandov:mainfrom
morbidrsa:btrfs
Open

Add btrfs helpers#608
morbidrsa wants to merge 2 commits intoosandov:mainfrom
morbidrsa:btrfs

Conversation

@morbidrsa
Copy link
Copy Markdown
Contributor

First small batch of helpers for debugging btrfs with drgn.

Add btrfs helpers to drgn. Currently this only consists of
btrfs_header(eb) to get ``struct btrfs_header`` from an extent_buffer
and BRTFS_EXTENT_BUFFER_FLAGS to be able to pretty print an
extent_buffer's flags using drgn's decode_flags() function.

Also add BTRFS_BLOCK_GROUP_FLAGS and BTRFS_BLOCK_GROUP_RUNTIME_FLAGS to
decode the flags and runtime flags of a ``struct btrfs_block_group``.

Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Now that drgn.helpers.linux.btrfs is there and has
BTRFS_BLOCK_GROUP_RUNTIME_FLAGS as well as
BTRFS_BLOCK_GROUP_RUNTIME_FLAGS definitions, use the ones built-in in
dump_btrfs_bgs.py.

Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
@osandov
Copy link
Copy Markdown
Owner

osandov commented Mar 11, 2026

Thanks for this! I'm out of the office until March 30, so I'll take a look when I get back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants