Loading fs/btrfs/extent_io.c +22 −6 Original line number Diff line number Diff line Loading @@ -607,7 +607,8 @@ static int insert_state(struct extent_io_tree *tree, static int split_state(struct extent_io_tree *tree, struct extent_state *orig, struct extent_state *prealloc, u64 split) { struct rb_node *node; struct rb_node *parent = NULL; struct rb_node **node; if (tree->private_data && is_data_inode(tree->private_data)) btrfs_split_delalloc_extent(tree->private_data, orig, split); Loading @@ -617,12 +618,27 @@ static int split_state(struct extent_io_tree *tree, struct extent_state *orig, prealloc->state = orig->state; orig->start = split; node = tree_insert(&tree->state, &orig->rb_node, prealloc->end, &prealloc->rb_node, NULL, NULL); if (node) { parent = &orig->rb_node; node = &parent; while (*node) { struct tree_entry *entry; parent = *node; entry = rb_entry(parent, struct tree_entry, rb_node); if (prealloc->end < entry->start) { node = &(*node)->rb_left; } else if (prealloc->end > entry->end) { node = &(*node)->rb_right; } else { free_extent_state(prealloc); return -EEXIST; } } rb_link_node(&prealloc->rb_node, parent, node); rb_insert_color(&prealloc->rb_node, &tree->state); return 0; } Loading Loading
fs/btrfs/extent_io.c +22 −6 Original line number Diff line number Diff line Loading @@ -607,7 +607,8 @@ static int insert_state(struct extent_io_tree *tree, static int split_state(struct extent_io_tree *tree, struct extent_state *orig, struct extent_state *prealloc, u64 split) { struct rb_node *node; struct rb_node *parent = NULL; struct rb_node **node; if (tree->private_data && is_data_inode(tree->private_data)) btrfs_split_delalloc_extent(tree->private_data, orig, split); Loading @@ -617,12 +618,27 @@ static int split_state(struct extent_io_tree *tree, struct extent_state *orig, prealloc->state = orig->state; orig->start = split; node = tree_insert(&tree->state, &orig->rb_node, prealloc->end, &prealloc->rb_node, NULL, NULL); if (node) { parent = &orig->rb_node; node = &parent; while (*node) { struct tree_entry *entry; parent = *node; entry = rb_entry(parent, struct tree_entry, rb_node); if (prealloc->end < entry->start) { node = &(*node)->rb_left; } else if (prealloc->end > entry->end) { node = &(*node)->rb_right; } else { free_extent_state(prealloc); return -EEXIST; } } rb_link_node(&prealloc->rb_node, parent, node); rb_insert_color(&prealloc->rb_node, &tree->state); return 0; } Loading