Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 128335
b: refs/heads/master
c: 3eb0314
h: refs/heads/master
i:
  128333: c8be457
  128331: 5bb499b
  128327: f5dcf53
  128319: f7e6059
v: v3
  • Loading branch information
Chris Mason authored and David Woodhouse committed Apr 5, 2007
1 parent e2336f6 commit 05ae330
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5be6f7f174146d91039a27ebb2f1b4ac599172b3
refs/heads/master: 3eb0314dc1053b1ae617dcc8d6d93f776c5baa31
1 change: 0 additions & 1 deletion trunk/fs/btrfs/TODO
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* Add block mapping tree (simple dm layer)
* Make allocator smarter
* add a block group to struct inode
* Make directory hashing work on 32 bit
* Make sure nobh stuff is working properly for cows
* Do actual block accounting
* Check compat and incompat flags on the inode
Expand Down
12 changes: 12 additions & 0 deletions trunk/fs/btrfs/ctree.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,10 @@ static int check_leaf(struct btrfs_root *root, struct btrfs_path *path,
static int check_block(struct btrfs_root *root, struct btrfs_path *path,
int level)
{
struct btrfs_node *node = btrfs_buffer_node(path->nodes[level]);
if (memcmp(node->header.fsid, root->fs_info->disk_super->fsid,
sizeof(node->header.fsid)))
BUG();
if (level == 0)
return check_leaf(root, path, level);
return check_node(root, path, level);
Expand Down Expand Up @@ -687,6 +691,8 @@ static int insert_new_root(struct btrfs_trans_handle *trans, struct btrfs_root
btrfs_set_header_parentid(&c->header,
btrfs_header_parentid(btrfs_buffer_header(root->node)));
lower = btrfs_buffer_node(path->nodes[level-1]);
memcpy(c->header.fsid, root->fs_info->disk_super->fsid,
sizeof(c->header.fsid));
if (btrfs_is_leaf(lower))
lower_key = &((struct btrfs_leaf *)lower)->items[0].key;
else
Expand Down Expand Up @@ -780,6 +786,8 @@ static int split_node(struct btrfs_trans_handle *trans, struct btrfs_root
btrfs_set_header_generation(&split->header, trans->transid);
btrfs_set_header_parentid(&split->header,
btrfs_header_parentid(btrfs_buffer_header(root->node)));
memcpy(split->header.fsid, root->fs_info->disk_super->fsid,
sizeof(split->header.fsid));
mid = (c_nritems + 1) / 2;
btrfs_memcpy(root, split, split->ptrs, c->ptrs + mid,
(c_nritems - mid) * sizeof(struct btrfs_key_ptr));
Expand Down Expand Up @@ -1139,6 +1147,8 @@ static int split_leaf(struct btrfs_trans_handle *trans, struct btrfs_root
btrfs_set_header_level(&right->header, 0);
btrfs_set_header_parentid(&right->header,
btrfs_header_parentid(btrfs_buffer_header(root->node)));
memcpy(right->header.fsid, root->fs_info->disk_super->fsid,
sizeof(right->header.fsid));
if (mid <= slot) {
if (nritems == 1 ||
leaf_space_used(l, mid, nritems - mid) + space_needed >
Expand Down Expand Up @@ -1229,6 +1239,8 @@ static int split_leaf(struct btrfs_trans_handle *trans, struct btrfs_root
btrfs_set_header_level(&right->header, 0);
btrfs_set_header_parentid(&right->header,
btrfs_header_parentid(btrfs_buffer_header(root->node)));
memcpy(right->header.fsid, root->fs_info->disk_super->fsid,
sizeof(right->header.fsid));
btrfs_cpu_key_to_disk(&disk_key, ins_key);
btrfs_set_header_nritems(&right->header, 0);
wret = insert_ptr(trans, root, path,
Expand Down
4 changes: 1 addition & 3 deletions trunk/fs/btrfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -483,10 +483,8 @@ static int btrfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
if (btrfs_disk_key_objectid(&item->key) != key.objectid)
break;
if (btrfs_disk_key_offset(&item->key) >
root->fs_info->highest_inode) {
printk("stopping at highest inode %Lu\n", root->fs_info->highest_inode);
root->fs_info->highest_inode)
break;
}
if (btrfs_disk_key_type(&item->key) != BTRFS_DIR_INDEX_KEY)
continue;
if (btrfs_disk_key_offset(&item->key) < filp->f_pos)
Expand Down

0 comments on commit 05ae330

Please sign in to comment.