summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-04-10 12:36:58 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-04-10 12:36:58 -0400
commite52d2e2fa1aac3c777672a74d1234fc07ef74304 (patch)
treef6fec192246ff998f5f50b6b1967e3b54e96091f
parent1b4ca380ed92eac7b8897c812e21ca92ccc346c4 (diff)
drop owner and parentid
-rw-r--r--ctree.c6
-rw-r--r--ctree.h23
-rw-r--r--extent-tree.c9
-rw-r--r--mkfs.c9
-rw-r--r--print-tree.c10
5 files changed, 6 insertions, 51 deletions
diff --git a/ctree.c b/ctree.c
index e91ff8da..b2befb21 100644
--- a/ctree.c
+++ b/ctree.c
@@ -661,8 +661,6 @@ static int insert_new_root(struct btrfs_trans_handle *trans, struct btrfs_root
btrfs_set_header_nritems(&c->header, 1);
btrfs_set_header_level(&c->header, level);
btrfs_set_header_blocknr(&c->header, t->blocknr);
- btrfs_set_header_parentid(&c->header,
- btrfs_header_parentid(&root->node->node.header));
lower = &path->nodes[level-1]->node;
if (btrfs_is_leaf(lower))
lower_key = &((struct btrfs_leaf *)lower)->items[0].key;
@@ -748,8 +746,6 @@ static int split_node(struct btrfs_trans_handle *trans, struct btrfs_root
btrfs_set_header_flags(&split->header, btrfs_header_flags(&c->header));
btrfs_set_header_level(&split->header, btrfs_header_level(&c->header));
btrfs_set_header_blocknr(&split->header, split_buffer->blocknr);
- btrfs_set_header_parentid(&split->header,
- btrfs_header_parentid(&root->node->node.header));
mid = (c_nritems + 1) / 2;
memcpy(split->ptrs, c->ptrs + mid,
(c_nritems - mid) * sizeof(struct btrfs_key_ptr));
@@ -1092,8 +1088,6 @@ static int split_leaf(struct btrfs_trans_handle *trans, struct btrfs_root
btrfs_set_header_nritems(&right->header, nritems - mid);
btrfs_set_header_blocknr(&right->header, right_buffer->blocknr);
btrfs_set_header_level(&right->header, 0);
- btrfs_set_header_parentid(&right->header,
- btrfs_header_parentid(&root->node->node.header));
data_copy_size = btrfs_item_end(l->items + mid) -
leaf_data_end(root, l);
memcpy(right->items, l->items + mid,
diff --git a/ctree.h b/ctree.h
index 178ab79c..62478941 100644
--- a/ctree.h
+++ b/ctree.h
@@ -56,7 +56,6 @@ struct btrfs_header {
u8 fsid[16]; /* FS specific uuid */
__le64 blocknr; /* which block this node is supposed to live in */
__le64 generation;
- __le64 parentid; /* objectid of the tree root */
__le16 nritems;
__le16 flags;
u8 level;
@@ -143,7 +142,6 @@ struct btrfs_path {
*/
struct btrfs_extent_item {
__le32 refs;
- __le64 owner;
} __attribute__ ((__packed__));
struct btrfs_inode_timespec {
@@ -431,16 +429,6 @@ static inline void btrfs_set_timespec_nsec(struct btrfs_inode_timespec *ts,
ts->nsec = cpu_to_le32(val);
}
-static inline u64 btrfs_extent_owner(struct btrfs_extent_item *ei)
-{
- return le64_to_cpu(ei->owner);
-}
-
-static inline void btrfs_set_extent_owner(struct btrfs_extent_item *ei, u64 val)
-{
- ei->owner = cpu_to_le64(val);
-}
-
static inline u32 btrfs_extent_refs(struct btrfs_extent_item *ei)
{
return le32_to_cpu(ei->refs);
@@ -640,17 +628,6 @@ static inline void btrfs_set_header_generation(struct btrfs_header *h,
h->generation = cpu_to_le64(val);
}
-static inline u64 btrfs_header_parentid(struct btrfs_header *h)
-{
- return le64_to_cpu(h->parentid);
-}
-
-static inline void btrfs_set_header_parentid(struct btrfs_header *h,
- u64 parentid)
-{
- h->parentid = cpu_to_le64(parentid);
-}
-
static inline u16 btrfs_header_nritems(struct btrfs_header *h)
{
return le16_to_cpu(h->nritems);
diff --git a/extent-tree.c b/extent-tree.c
index 868d4b95..0dc2ee42 100644
--- a/extent-tree.c
+++ b/extent-tree.c
@@ -138,8 +138,6 @@ static int finish_current_insert(struct btrfs_trans_handle *trans, struct
struct btrfs_fs_info *info = extent_root->fs_info;
btrfs_set_extent_refs(&extent_item, 1);
- btrfs_set_extent_owner(&extent_item,
- btrfs_header_parentid(&extent_root->node->node.header));
ins.offset = 1;
ins.flags = 0;
btrfs_set_key_type(&ins, BTRFS_EXTENT_ITEM_KEY);
@@ -397,7 +395,7 @@ error:
*/
static int alloc_extent(struct btrfs_trans_handle *trans, struct btrfs_root
*root, u64 num_blocks, u64 search_start, u64
- search_end, u64 owner, struct btrfs_key *ins)
+ search_end, struct btrfs_key *ins)
{
int ret;
int pending_ret;
@@ -407,7 +405,6 @@ static int alloc_extent(struct btrfs_trans_handle *trans, struct btrfs_root
struct btrfs_extent_item extent_item;
btrfs_set_extent_refs(&extent_item, 1);
- btrfs_set_extent_owner(&extent_item, owner);
if (root == extent_root) {
BUG_ON(extent_root->fs_info->current_insert.offset == 0);
@@ -450,9 +447,7 @@ struct btrfs_buffer *btrfs_alloc_free_block(struct btrfs_trans_handle *trans,
int ret;
struct btrfs_buffer *buf;
- ret = alloc_extent(trans, root, 1, 0, (unsigned long)-1,
- btrfs_header_parentid(&root->node->node.header),
- &ins);
+ ret = alloc_extent(trans, root, 1, 0, (unsigned long)-1, &ins);
if (ret) {
BUG();
return NULL;
diff --git a/mkfs.c b/mkfs.c
index fa5b1be9..f32aa934 100644
--- a/mkfs.c
+++ b/mkfs.c
@@ -134,8 +134,6 @@ int mkfs(int fd, u64 num_blocks, u32 blocksize)
/* create the tree of root objects */
empty_leaf = malloc(blocksize);
memset(empty_leaf, 0, blocksize);
- btrfs_set_header_parentid(&empty_leaf->header,
- BTRFS_ROOT_TREE_OBJECTID);
btrfs_set_header_blocknr(&empty_leaf->header, start_block + 1);
btrfs_set_header_nritems(&empty_leaf->header, 2);
btrfs_set_header_generation(&empty_leaf->header, 0);
@@ -175,8 +173,6 @@ int mkfs(int fd, u64 num_blocks, u32 blocksize)
ret = pwrite(fd, empty_leaf, blocksize, (start_block + 1) * blocksize);
/* create the items for the extent tree */
- btrfs_set_header_parentid(&empty_leaf->header,
- BTRFS_EXTENT_TREE_OBJECTID);
btrfs_set_header_blocknr(&empty_leaf->header, start_block + 2);
btrfs_set_header_nritems(&empty_leaf->header, 4);
@@ -190,7 +186,6 @@ int mkfs(int fd, u64 num_blocks, u32 blocksize)
btrfs_set_item_offset(&item, itemoff);
btrfs_set_item_size(&item, sizeof(struct btrfs_extent_item));
btrfs_set_extent_refs(&extent_item, 1);
- btrfs_set_extent_owner(&extent_item, 0);
memcpy(empty_leaf->items, &item, sizeof(item));
memcpy(btrfs_leaf_data(empty_leaf) + btrfs_item_offset(&item),
&extent_item, btrfs_item_size(&item));
@@ -200,7 +195,6 @@ int mkfs(int fd, u64 num_blocks, u32 blocksize)
btrfs_set_disk_key_offset(&item.key, 1);
itemoff = itemoff - sizeof(struct btrfs_extent_item);
btrfs_set_item_offset(&item, itemoff);
- btrfs_set_extent_owner(&extent_item, BTRFS_ROOT_TREE_OBJECTID);
memcpy(empty_leaf->items + 1, &item, sizeof(item));
memcpy(btrfs_leaf_data(empty_leaf) + btrfs_item_offset(&item),
&extent_item, btrfs_item_size(&item));
@@ -210,7 +204,6 @@ int mkfs(int fd, u64 num_blocks, u32 blocksize)
btrfs_set_disk_key_offset(&item.key, 1);
itemoff = itemoff - sizeof(struct btrfs_extent_item);
btrfs_set_item_offset(&item, itemoff);
- btrfs_set_extent_owner(&extent_item, BTRFS_EXTENT_TREE_OBJECTID);
memcpy(empty_leaf->items + 2, &item, sizeof(item));
memcpy(btrfs_leaf_data(empty_leaf) + btrfs_item_offset(&item),
&extent_item, btrfs_item_size(&item));
@@ -220,7 +213,6 @@ int mkfs(int fd, u64 num_blocks, u32 blocksize)
btrfs_set_disk_key_offset(&item.key, 1);
itemoff = itemoff - sizeof(struct btrfs_extent_item);
btrfs_set_item_offset(&item, itemoff);
- btrfs_set_extent_owner(&extent_item, BTRFS_FS_TREE_OBJECTID);
memcpy(empty_leaf->items + 3, &item, sizeof(item));
memcpy(btrfs_leaf_data(empty_leaf) + btrfs_item_offset(&item),
&extent_item, btrfs_item_size(&item));
@@ -229,7 +221,6 @@ int mkfs(int fd, u64 num_blocks, u32 blocksize)
return -1;
/* finally create the FS root */
- btrfs_set_header_parentid(&empty_leaf->header, BTRFS_FS_TREE_OBJECTID);
btrfs_set_header_blocknr(&empty_leaf->header, start_block + 3);
btrfs_set_header_nritems(&empty_leaf->header, 0);
ret = pwrite(fd, empty_leaf, blocksize, (start_block + 3) * blocksize);
diff --git a/print-tree.c b/print-tree.c
index 03dfeb59..49acb282 100644
--- a/print-tree.c
+++ b/print-tree.c
@@ -18,10 +18,9 @@ void btrfs_print_leaf(struct btrfs_root *root, struct btrfs_leaf *l)
char *p;
u32 type;
- printf("leaf %Lu ptrs %d free space %d parent %Lu generation %Lu\n",
+ printf("leaf %Lu ptrs %d free space %d generation %Lu\n",
btrfs_header_blocknr(&l->header), nr,
btrfs_leaf_free_space(root, l),
- btrfs_header_parentid(&l->header),
btrfs_header_generation(&l->header));
fflush(stdout);
for (i = 0 ; i < nr ; i++) {
@@ -73,8 +72,8 @@ void btrfs_print_leaf(struct btrfs_root *root, struct btrfs_leaf *l)
break;
case BTRFS_EXTENT_ITEM_KEY:
ei = btrfs_item_ptr(l, i, struct btrfs_extent_item);
- printf("\t\textent data refs %u owner %Lu\n",
- btrfs_extent_refs(ei), btrfs_extent_owner(ei));
+ printf("\t\textent data refs %u\n",
+ btrfs_extent_refs(ei));
break;
case BTRFS_EXTENT_DATA_KEY:
fi = btrfs_item_ptr(l, i,
@@ -108,11 +107,10 @@ void btrfs_print_tree(struct btrfs_root *root, struct btrfs_buffer *t)
btrfs_print_leaf(root, (struct btrfs_leaf *)c);
return;
}
- printf("node %Lu level %d ptrs %d free %u parent %Lu generation %Lu\n",
+ printf("node %Lu level %d ptrs %d free %u generation %Lu\n",
t->blocknr,
btrfs_header_level(&c->header), nr,
(u32)BTRFS_NODEPTRS_PER_BLOCK(root) - nr,
- btrfs_header_parentid(&c->header),
btrfs_header_generation(&c->header));
fflush(stdout);
for (i = 0; i < nr; i++) {