Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 128584
b: refs/heads/master
c: 8f662a7
h: refs/heads/master
v: v3
  • Loading branch information
Chris Mason committed Sep 25, 2008
1 parent 4bc2f29 commit 39e8244
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 10 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: e52ec0eb62e76ea584c8438ef92933e9b815db80
refs/heads/master: 8f662a76c6af8eb367fa519e9bb9766040d9cea8
9 changes: 6 additions & 3 deletions trunk/fs/btrfs/ctree.c
Original file line number Diff line number Diff line change
Expand Up @@ -2654,9 +2654,9 @@ int btrfs_del_item(struct btrfs_trans_handle *trans, struct btrfs_root *root,
*/
int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_path *path)
{
u64 bytenr;
int slot;
int level = 1;
u64 bytenr;
struct extent_buffer *c;
struct extent_buffer *next = NULL;

Expand Down Expand Up @@ -2687,11 +2687,14 @@ int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_path *path)
level--;
c = path->nodes[level];
free_extent_buffer(c);
slot = btrfs_header_nritems(next);
if (slot != 0)
slot--;
path->nodes[level] = next;
path->slots[level] = 0;
path->slots[level] = slot;
if (!level)
break;
next = read_tree_block(root, btrfs_node_blockptr(next, 0),
next = read_tree_block(root, btrfs_node_blockptr(next, slot),
btrfs_level_size(root, level - 1));
}
return 0;
Expand Down
1 change: 1 addition & 0 deletions trunk/fs/btrfs/ctree.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ struct btrfs_fs_info {
u64 last_trans_committed;
unsigned long mount_opt;
u64 max_extent;
u64 alloc_start;
struct btrfs_transaction *running_transaction;
struct btrfs_super_block super_copy;
struct extent_buffer *sb_buffer;
Expand Down
9 changes: 5 additions & 4 deletions trunk/fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -1630,11 +1630,11 @@ int btrfs_alloc_extent(struct btrfs_trans_handle *trans,
struct btrfs_path *path;

btrfs_set_stack_extent_refs(&extent_item, 1);
#if 0
new_hint = max(hint_byte, 16ULL * 1024 * 1024 * 1024);

new_hint = max(hint_byte, root->fs_info->alloc_start);
if (new_hint < btrfs_super_total_bytes(&info->super_copy))
hint_byte = new_hint;
#endif

WARN_ON(num_bytes < root->sectorsize);
ret = find_free_extent(trans, root, num_bytes, empty_size,
search_start, search_end, hint_byte, ins,
Expand Down Expand Up @@ -2239,7 +2239,7 @@ static int relocate_one_reference(struct btrfs_root *extent_root,
free_extent_buffer(eb);

path->lowest_level = level;
path->reada = 0;
path->reada = 2;
ret = btrfs_search_slot(trans, found_root, &found_key, path,
0, 1);
path->lowest_level = 0;
Expand Down Expand Up @@ -2372,6 +2372,7 @@ int btrfs_shrink_extent_tree(struct btrfs_root *root, u64 new_size)
block_group_cache = &info->block_group_cache;
path = btrfs_alloc_path();
root = root->fs_info->extent_root;
path->reada = 2;

again:
total_found = 0;
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -2058,7 +2058,7 @@ int btrfs_page_mkwrite(struct vm_area_struct *vma, struct page *page)

mutex_lock(&root->fs_info->fs_mutex);
ret = btrfs_check_free_space(root, PAGE_CACHE_SIZE, 0);
mutex_lock(&root->fs_info->fs_mutex);
mutex_unlock(&root->fs_info->fs_mutex);
if (ret)
goto out;

Expand Down
16 changes: 15 additions & 1 deletion trunk/fs/btrfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,16 @@ static void btrfs_put_super (struct super_block * sb)
}

enum {
Opt_subvol, Opt_nodatasum, Opt_nodatacow, Opt_max_extent, Opt_err,
Opt_subvol, Opt_nodatasum, Opt_nodatacow, Opt_max_extent,
Opt_alloc_start, Opt_err,
};

static match_table_t tokens = {
{Opt_subvol, "subvol=%s"},
{Opt_nodatasum, "nodatasum"},
{Opt_nodatacow, "nodatacow"},
{Opt_max_extent, "max_extent=%s"},
{Opt_alloc_start, "alloc_start=%s"},
{Opt_err, NULL}
};

Expand Down Expand Up @@ -162,6 +164,18 @@ static int parse_options (char * options,
}
}
break;
case Opt_alloc_start:
if (info) {
char *num = match_strdup(&args[0]);
if (num) {
info->alloc_start =
btrfs_parse_size(num);
kfree(num);
printk("btrfs: allocations start at "
"%Lu\n", info->alloc_start);
}
}
break;
default:
break;
}
Expand Down

0 comments on commit 39e8244

Please sign in to comment.