Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 128379
b: refs/heads/master
c: e37c9e6
h: refs/heads/master
i:
  128377: be62ee8
  128375: 32e4b92
v: v3
  • Loading branch information
Chris Mason authored and David Woodhouse committed May 10, 2007
1 parent 1d5d8c5 commit 3243e38
Show file tree
Hide file tree
Showing 9 changed files with 341 additions and 60 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: 3e1ad54fe2839319c1aa66b954da0753f5b1f906
refs/heads/master: e37c9e6921207cf503634b06bee37ecb7904408d
1 change: 1 addition & 0 deletions trunk/fs/btrfs/TODO
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* Get rid of struct ctree_path, limiting tree levels held at one time
* Add generation number to key pointer in nodes
* Add generation number to inode
* Add ability to switch a block group from data to metadata or vice versa
* Release
* Do real tree locking
* Add extent mirroring (backup copies of blocks)
Expand Down
10 changes: 7 additions & 3 deletions trunk/fs/btrfs/bit-radix.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,21 @@ int clear_radix_bit(struct radix_tree_root *radix, unsigned long bit)
}

int find_first_radix_bit(struct radix_tree_root *radix, unsigned long *retbits,
int nr)
unsigned long start, int nr)
{
unsigned long *bits;
unsigned long *gang[4];
int found;
int ret;
int i;
int total_found = 0;
unsigned long slot;

ret = radix_tree_gang_lookup(radix, (void **)gang, 0, ARRAY_SIZE(gang));
slot = start / BIT_RADIX_BITS_PER_ARRAY;
ret = radix_tree_gang_lookup(radix, (void **)gang, slot,
ARRAY_SIZE(gang));
found = start % BIT_RADIX_BITS_PER_ARRAY;
for (i = 0; i < ret && nr > 0; i++) {
found = 0;
bits = gang[i];
while(nr > 0) {
found = find_next_bit(bits + 1,
Expand All @@ -104,6 +107,7 @@ int find_first_radix_bit(struct radix_tree_root *radix, unsigned long *retbits,
} else
break;
}
found = 0;
}
return total_found;
}
2 changes: 1 addition & 1 deletion trunk/fs/btrfs/bit-radix.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ int set_radix_bit(struct radix_tree_root *radix, unsigned long bit);
int test_radix_bit(struct radix_tree_root *radix, unsigned long bit);
int clear_radix_bit(struct radix_tree_root *radix, unsigned long bit);
int find_first_radix_bit(struct radix_tree_root *radix, unsigned long *retbits,
int nr);
unsigned long start, int nr);

static inline void init_bit_radix(struct radix_tree_root *radix)
{
Expand Down
3 changes: 3 additions & 0 deletions trunk/fs/btrfs/ctree.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,9 @@ struct btrfs_block_group_cache {
u64 first_free;
u64 last_alloc;
u64 pinned;
u64 last_prealloc;
int data;
int cached;
};

struct crypto_hash;
Expand All @@ -273,6 +275,7 @@ struct btrfs_fs_info {
struct radix_tree_root dev_radix;
struct radix_tree_root block_group_radix;
struct radix_tree_root block_group_data_radix;
struct radix_tree_root extent_map_radix;

u64 extent_tree_insert[BTRFS_MAX_LEVEL * 3];
int extent_tree_insert_nr;
Expand Down
1 change: 1 addition & 0 deletions trunk/fs/btrfs/disk-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,7 @@ struct btrfs_root *open_ctree(struct super_block *sb)

init_bit_radix(&fs_info->pinned_radix);
init_bit_radix(&fs_info->pending_del_radix);
init_bit_radix(&fs_info->extent_map_radix);
INIT_RADIX_TREE(&fs_info->fs_roots_radix, GFP_NOFS);
INIT_RADIX_TREE(&fs_info->dev_radix, GFP_NOFS);
INIT_RADIX_TREE(&fs_info->block_group_radix, GFP_KERNEL);
Expand Down
Loading

0 comments on commit 3243e38

Please sign in to comment.