Commit d0dbc6245cefa36e19dff49c557ccf05e3063e9c
Committed by
David Woodhouse
1 parent
1b05da2ee6
Exists in
master
and in
7 other branches
Btrfs: drop owner and parentid
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Showing 6 changed files with 6 additions and 47 deletions Side-by-side Diff
fs/btrfs/ctree.c
... | ... | @@ -688,8 +688,6 @@ |
688 | 688 | btrfs_set_header_level(&c->header, level); |
689 | 689 | btrfs_set_header_blocknr(&c->header, t->b_blocknr); |
690 | 690 | btrfs_set_header_generation(&c->header, trans->transid); |
691 | - btrfs_set_header_parentid(&c->header, | |
692 | - btrfs_header_parentid(btrfs_buffer_header(root->node))); | |
693 | 691 | lower = btrfs_buffer_node(path->nodes[level-1]); |
694 | 692 | memcpy(c->header.fsid, root->fs_info->disk_super->fsid, |
695 | 693 | sizeof(c->header.fsid)); |
... | ... | @@ -784,8 +782,6 @@ |
784 | 782 | btrfs_set_header_level(&split->header, btrfs_header_level(&c->header)); |
785 | 783 | btrfs_set_header_blocknr(&split->header, split_buffer->b_blocknr); |
786 | 784 | btrfs_set_header_generation(&split->header, trans->transid); |
787 | - btrfs_set_header_parentid(&split->header, | |
788 | - btrfs_header_parentid(btrfs_buffer_header(root->node))); | |
789 | 785 | memcpy(split->header.fsid, root->fs_info->disk_super->fsid, |
790 | 786 | sizeof(split->header.fsid)); |
791 | 787 | mid = (c_nritems + 1) / 2; |
... | ... | @@ -1145,8 +1141,6 @@ |
1145 | 1141 | btrfs_set_header_blocknr(&right->header, right_buffer->b_blocknr); |
1146 | 1142 | btrfs_set_header_generation(&right->header, trans->transid); |
1147 | 1143 | btrfs_set_header_level(&right->header, 0); |
1148 | - btrfs_set_header_parentid(&right->header, | |
1149 | - btrfs_header_parentid(btrfs_buffer_header(root->node))); | |
1150 | 1144 | memcpy(right->header.fsid, root->fs_info->disk_super->fsid, |
1151 | 1145 | sizeof(right->header.fsid)); |
1152 | 1146 | if (mid <= slot) { |
... | ... | @@ -1237,8 +1231,6 @@ |
1237 | 1231 | btrfs_set_header_blocknr(&right->header, right_buffer->b_blocknr); |
1238 | 1232 | btrfs_set_header_generation(&right->header, trans->transid); |
1239 | 1233 | btrfs_set_header_level(&right->header, 0); |
1240 | - btrfs_set_header_parentid(&right->header, | |
1241 | - btrfs_header_parentid(btrfs_buffer_header(root->node))); | |
1242 | 1234 | memcpy(right->header.fsid, root->fs_info->disk_super->fsid, |
1243 | 1235 | sizeof(right->header.fsid)); |
1244 | 1236 | btrfs_cpu_key_to_disk(&disk_key, ins_key); |
fs/btrfs/ctree.h
... | ... | @@ -60,7 +60,6 @@ |
60 | 60 | u8 fsid[16]; /* FS specific uuid */ |
61 | 61 | __le64 blocknr; /* which block this node is supposed to live in */ |
62 | 62 | __le64 generation; |
63 | - __le64 parentid; /* objectid of the tree root */ | |
64 | 63 | __le16 nritems; |
65 | 64 | __le16 flags; |
66 | 65 | u8 level; |
... | ... | @@ -147,7 +146,6 @@ |
147 | 146 | */ |
148 | 147 | struct btrfs_extent_item { |
149 | 148 | __le32 refs; |
150 | - __le64 owner; | |
151 | 149 | } __attribute__ ((__packed__)); |
152 | 150 | |
153 | 151 | struct btrfs_inode_timespec { |
... | ... | @@ -443,16 +441,6 @@ |
443 | 441 | ts->nsec = cpu_to_le32(val); |
444 | 442 | } |
445 | 443 | |
446 | -static inline u64 btrfs_extent_owner(struct btrfs_extent_item *ei) | |
447 | -{ | |
448 | - return le64_to_cpu(ei->owner); | |
449 | -} | |
450 | - | |
451 | -static inline void btrfs_set_extent_owner(struct btrfs_extent_item *ei, u64 val) | |
452 | -{ | |
453 | - ei->owner = cpu_to_le64(val); | |
454 | -} | |
455 | - | |
456 | 444 | static inline u32 btrfs_extent_refs(struct btrfs_extent_item *ei) |
457 | 445 | { |
458 | 446 | return le32_to_cpu(ei->refs); |
... | ... | @@ -652,17 +640,6 @@ |
652 | 640 | h->generation = cpu_to_le64(val); |
653 | 641 | } |
654 | 642 | |
655 | -static inline u64 btrfs_header_parentid(struct btrfs_header *h) | |
656 | -{ | |
657 | - return le64_to_cpu(h->parentid); | |
658 | -} | |
659 | - | |
660 | -static inline void btrfs_set_header_parentid(struct btrfs_header *h, | |
661 | - u64 parentid) | |
662 | -{ | |
663 | - h->parentid = cpu_to_le64(parentid); | |
664 | -} | |
665 | - | |
666 | 643 | static inline u16 btrfs_header_nritems(struct btrfs_header *h) |
667 | 644 | { |
668 | 645 | return le16_to_cpu(h->nritems); |
... | ... | @@ -919,7 +896,7 @@ |
919 | 896 | struct btrfs_root *root); |
920 | 897 | int btrfs_alloc_extent(struct btrfs_trans_handle *trans, struct btrfs_root |
921 | 898 | *root, u64 num_blocks, u64 search_start, u64 |
922 | - search_end, u64 owner, struct btrfs_key *ins); | |
899 | + search_end, struct btrfs_key *ins); | |
923 | 900 | int btrfs_inc_ref(struct btrfs_trans_handle *trans, struct btrfs_root *root, |
924 | 901 | struct buffer_head *buf); |
925 | 902 | int btrfs_free_extent(struct btrfs_trans_handle *trans, struct btrfs_root |
fs/btrfs/extent-tree.c
... | ... | @@ -157,8 +157,6 @@ |
157 | 157 | struct btrfs_fs_info *info = extent_root->fs_info; |
158 | 158 | |
159 | 159 | btrfs_set_extent_refs(&extent_item, 1); |
160 | - btrfs_set_extent_owner(&extent_item, | |
161 | - btrfs_header_parentid(btrfs_buffer_header(extent_root->node))); | |
162 | 160 | ins.offset = 1; |
163 | 161 | ins.flags = 0; |
164 | 162 | btrfs_set_key_type(&ins, BTRFS_EXTENT_ITEM_KEY); |
... | ... | @@ -457,7 +455,7 @@ |
457 | 455 | */ |
458 | 456 | int btrfs_alloc_extent(struct btrfs_trans_handle *trans, struct btrfs_root |
459 | 457 | *root, u64 num_blocks, u64 search_start, u64 |
460 | - search_end, u64 owner, struct btrfs_key *ins) | |
458 | + search_end, struct btrfs_key *ins) | |
461 | 459 | { |
462 | 460 | int ret; |
463 | 461 | int pending_ret; |
... | ... | @@ -467,7 +465,6 @@ |
467 | 465 | struct btrfs_extent_item extent_item; |
468 | 466 | |
469 | 467 | btrfs_set_extent_refs(&extent_item, 1); |
470 | - btrfs_set_extent_owner(&extent_item, owner); | |
471 | 468 | |
472 | 469 | if (root == extent_root) { |
473 | 470 | BUG_ON(extent_root->fs_info->current_insert.offset == 0); |
... | ... | @@ -510,8 +507,7 @@ |
510 | 507 | int ret; |
511 | 508 | struct buffer_head *buf; |
512 | 509 | |
513 | - ret = btrfs_alloc_extent(trans, root, 1, 0, (unsigned long)-1, | |
514 | - btrfs_header_parentid(btrfs_buffer_header(root->node)), &ins); | |
510 | + ret = btrfs_alloc_extent(trans, root, 1, 0, (unsigned long)-1, &ins); | |
515 | 511 | if (ret) { |
516 | 512 | BUG(); |
517 | 513 | return NULL; |
fs/btrfs/file-item.c
fs/btrfs/print-tree.c
... | ... | @@ -50,8 +50,8 @@ |
50 | 50 | break; |
51 | 51 | case BTRFS_EXTENT_ITEM_KEY: |
52 | 52 | ei = btrfs_item_ptr(l, i, struct btrfs_extent_item); |
53 | - printk("\t\textent data refs %u owner %Lu\n", | |
54 | - btrfs_extent_refs(ei), btrfs_extent_owner(ei)); | |
53 | + printk("\t\textent data refs %u\n", | |
54 | + btrfs_extent_refs(ei)); | |
55 | 55 | break; |
56 | 56 | case BTRFS_STRING_ITEM_KEY: |
57 | 57 | printk("\t\titem data %.*s\n", btrfs_item_size(item), |
fs/btrfs/transaction.c
... | ... | @@ -163,7 +163,6 @@ |
163 | 163 | int i; |
164 | 164 | int ret; |
165 | 165 | int err; |
166 | -printk("add dirty\n"); | |
167 | 166 | while(1) { |
168 | 167 | ret = radix_tree_gang_lookup_tag(radix, (void **)gang, 0, |
169 | 168 | ARRAY_SIZE(gang), |
... | ... | @@ -188,7 +187,6 @@ |
188 | 187 | dirty->commit_root = root->commit_root; |
189 | 188 | root->commit_root = NULL; |
190 | 189 | dirty->root = root; |
191 | -printk("adding dirty root %Lu gen %Lu blocknr %Lu\n", root->root_key.objectid, root->root_key.offset, dirty->commit_root->b_blocknr); | |
192 | 190 | root->root_key.offset = root->fs_info->generation; |
193 | 191 | btrfs_set_root_blocknr(&root->root_item, |
194 | 192 | root->node->b_blocknr); |
... | ... | @@ -199,7 +197,6 @@ |
199 | 197 | list_add(&dirty->list, list); |
200 | 198 | } |
201 | 199 | } |
202 | -printk("add dirty done\n"); | |
203 | 200 | return 0; |
204 | 201 | } |
205 | 202 | |
206 | 203 | |
... | ... | @@ -213,12 +210,10 @@ |
213 | 210 | dirty = list_entry(list->next, struct dirty_root, list); |
214 | 211 | list_del_init(&dirty->list); |
215 | 212 | trans = btrfs_start_transaction(tree_root, 1); |
216 | -printk("drop snapshot root %p, commit_root blocknr %Lu generation %Lu\n", dirty->root, dirty->commit_root->b_blocknr, dirty->snap_key.offset); | |
217 | 213 | ret = btrfs_drop_snapshot(trans, dirty->root, |
218 | 214 | dirty->commit_root); |
219 | 215 | BUG_ON(ret); |
220 | 216 | |
221 | -printk("del root objectid %Lu, offset %Lu\n", dirty->snap_key.objectid, dirty->snap_key.offset); | |
222 | 217 | ret = btrfs_del_root(trans, tree_root, &dirty->snap_key); |
223 | 218 | BUG_ON(ret); |
224 | 219 | ret = btrfs_end_transaction(trans, tree_root); |
... | ... | @@ -240,7 +235,6 @@ |
240 | 235 | |
241 | 236 | mutex_lock(&root->fs_info->trans_mutex); |
242 | 237 | if (trans->transaction->in_commit) { |
243 | -printk("already in commit!, waiting\n"); | |
244 | 238 | cur_trans = trans->transaction; |
245 | 239 | trans->transaction->use_count++; |
246 | 240 | btrfs_end_transaction(trans, root); |