Skip to content

Commit 7d2197b

Browse files
fdmananakdave
authored andcommitted
btrfs: print-tree: print information about dir log items
We currently don't print information about dir log items (other than the key, item offset and item size), which is useful to look at when debugging problems with a log tree. So print their specific information (currently they only have an end index number) in a format similar to btrfs-progs. Reviewed-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 7317555 commit 7d2197b

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

fs/btrfs/print-tree.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,14 @@ static void print_inode_extref_item(const struct extent_buffer *eb, int i)
317317
}
318318
}
319319

320+
static void print_dir_log_index_item(const struct extent_buffer *eb, int i)
321+
{
322+
struct btrfs_dir_log_item *dlog;
323+
324+
dlog = btrfs_item_ptr(eb, i, struct btrfs_dir_log_item);
325+
pr_info("\t\tdir log end %llu\n", btrfs_dir_log_end(eb, dlog));
326+
}
327+
320328
void btrfs_print_leaf(const struct extent_buffer *l)
321329
{
322330
struct btrfs_fs_info *fs_info;
@@ -362,6 +370,9 @@ void btrfs_print_leaf(const struct extent_buffer *l)
362370
case BTRFS_XATTR_ITEM_KEY:
363371
print_dir_item(l, i);
364372
break;
373+
case BTRFS_DIR_LOG_INDEX_KEY:
374+
print_dir_log_index_item(l, i);
375+
break;
365376
case BTRFS_ROOT_ITEM_KEY:
366377
ri = btrfs_item_ptr(l, i, struct btrfs_root_item);
367378
pr_info("\t\troot data bytenr %llu refs %u\n",

0 commit comments

Comments
 (0)