diff options
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/print-tree.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/fs/btrfs/print-tree.c b/fs/btrfs/print-tree.c index fe7bf4a12568..32022f3f169b 100644 --- a/fs/btrfs/print-tree.c +++ b/fs/btrfs/print-tree.c | |||
@@ -155,6 +155,25 @@ static void print_extent_ref_v0(struct extent_buffer *eb, int slot) | |||
155 | } | 155 | } |
156 | #endif | 156 | #endif |
157 | 157 | ||
158 | static void print_uuid_item(struct extent_buffer *l, unsigned long offset, | ||
159 | u32 item_size) | ||
160 | { | ||
161 | if (!IS_ALIGNED(item_size, sizeof(u64))) { | ||
162 | pr_warn("btrfs: uuid item with illegal size %lu!\n", | ||
163 | (unsigned long)item_size); | ||
164 | return; | ||
165 | } | ||
166 | while (item_size) { | ||
167 | __le64 subvol_id; | ||
168 | |||
169 | read_extent_buffer(l, &subvol_id, offset, sizeof(subvol_id)); | ||
170 | printk(KERN_INFO "\t\tsubvol_id %llu\n", | ||
171 | (unsigned long long)le64_to_cpu(subvol_id)); | ||
172 | item_size -= sizeof(u64); | ||
173 | offset += sizeof(u64); | ||
174 | } | ||
175 | } | ||
176 | |||
158 | void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l) | 177 | void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l) |
159 | { | 178 | { |
160 | int i; | 179 | int i; |
@@ -301,6 +320,11 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l) | |||
301 | case BTRFS_DEV_REPLACE_KEY: | 320 | case BTRFS_DEV_REPLACE_KEY: |
302 | printk(KERN_INFO "\t\tdev replace\n"); | 321 | printk(KERN_INFO "\t\tdev replace\n"); |
303 | break; | 322 | break; |
323 | case BTRFS_UUID_KEY_SUBVOL: | ||
324 | case BTRFS_UUID_KEY_RECEIVED_SUBVOL: | ||
325 | print_uuid_item(l, btrfs_item_ptr_offset(l, i), | ||
326 | btrfs_item_size_nr(l, i)); | ||
327 | break; | ||
304 | }; | 328 | }; |
305 | } | 329 | } |
306 | } | 330 | } |