Commit a1516c89 authored by Chris Mason's avatar Chris Mason Committed by David Woodhouse

Btrfs: reorder key offset and flags

Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent 123abc88
* cleanup, add more error checking, get rid of BUG_ONs * cleanup, add more error checking, get rid of BUG_ONs
* Make IO functions look more like the page cache * Make IO functions look more like the page cache
* Fix ENOSPC handling * Fix ENOSPC handling
* make blocksize a mkfs parameter instead of #define
* make a real mkfs and superblock * make a real mkfs and superblock
* Do checksumming * Do checksumming
* Define FS objects in terms of different item types * Define FS objects in terms of different item types
......
...@@ -26,14 +26,14 @@ ...@@ -26,14 +26,14 @@
*/ */
struct btrfs_disk_key { struct btrfs_disk_key {
__le64 objectid; __le64 objectid;
__le32 flags;
__le64 offset; __le64 offset;
__le32 flags;
} __attribute__ ((__packed__)); } __attribute__ ((__packed__));
struct btrfs_key { struct btrfs_key {
u64 objectid; u64 objectid;
u32 flags;
u64 offset; u64 offset;
u32 flags;
} __attribute__ ((__packed__)); } __attribute__ ((__packed__));
/* /*
......
...@@ -18,11 +18,11 @@ void btrfs_print_leaf(struct btrfs_root *root, struct btrfs_leaf *l) ...@@ -18,11 +18,11 @@ void btrfs_print_leaf(struct btrfs_root *root, struct btrfs_leaf *l)
fflush(stdout); fflush(stdout);
for (i = 0 ; i < nr ; i++) { for (i = 0 ; i < nr ; i++) {
item = l->items + i; item = l->items + i;
printf("\titem %d key (%Lu %u %Lu) itemoff %d itemsize %d\n", printf("\titem %d key (%Lu %Lu %u) itemoff %d itemsize %d\n",
i, i,
btrfs_key_objectid(&item->key), btrfs_key_objectid(&item->key),
btrfs_key_flags(&item->key),
btrfs_key_offset(&item->key), btrfs_key_offset(&item->key),
btrfs_key_flags(&item->key),
btrfs_item_offset(item), btrfs_item_offset(item),
btrfs_item_size(item)); btrfs_item_size(item));
printf("\t\titem data %.*s\n", btrfs_item_size(item), printf("\t\titem data %.*s\n", btrfs_item_size(item),
...@@ -55,10 +55,12 @@ void btrfs_print_tree(struct btrfs_root *root, struct btrfs_buffer *t) ...@@ -55,10 +55,12 @@ void btrfs_print_tree(struct btrfs_root *root, struct btrfs_buffer *t)
(u32)BTRFS_NODEPTRS_PER_BLOCK(root) - nr); (u32)BTRFS_NODEPTRS_PER_BLOCK(root) - nr);
fflush(stdout); fflush(stdout);
for (i = 0; i < nr; i++) { for (i = 0; i < nr; i++) {
printf("\tkey %d (%Lu %u %Lu) block %Lu\n", printf("\tkey %d (%Lu %Lu %u) block %Lu\n",
i, i,
c->ptrs[i].key.objectid, c->ptrs[i].key.flags, c->ptrs[i].key.objectid,
c->ptrs[i].key.offset, btrfs_node_blockptr(c, i)); c->ptrs[i].key.offset,
c->ptrs[i].key.flags,
btrfs_node_blockptr(c, i));
fflush(stdout); fflush(stdout);
} }
for (i = 0; i < nr; i++) { for (i = 0; i < nr; i++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment