Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 128321
b: refs/heads/master
c: d602557
h: refs/heads/master
i:
  128319: f7e6059
v: v3
  • Loading branch information
Chris Mason authored and David Woodhouse committed Mar 30, 2007
1 parent 53d8edc commit f736188
Show file tree
Hide file tree
Showing 12 changed files with 188 additions and 106 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: 22b0ebda6c63a1ad66b6a9e806bd226a4a03a049
refs/heads/master: d6025579531b7ea170ba283b171ff7a6bf7d0e12
9 changes: 7 additions & 2 deletions trunk/fs/btrfs/bit-radix.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ int set_radix_bit(struct radix_tree_root *radix, unsigned long bit)

bits = radix_tree_lookup(radix, slot);
if (!bits) {
bits = kmalloc(BIT_ARRAY_BYTES, GFP_NOIO);
bits = kmalloc(BIT_ARRAY_BYTES, GFP_NOFS);
if (!bits)
return -ENOMEM;
memset(bits + 1, 0, BIT_ARRAY_BYTES - sizeof(unsigned long));
bits[0] = slot;
radix_tree_preload(GFP_NOFS);
ret = radix_tree_insert(radix, slot, bits);
radix_tree_preload_end();
if (ret)
return ret;
}
Expand Down Expand Up @@ -59,7 +61,7 @@ int clear_radix_bit(struct radix_tree_root *radix, unsigned long bit)
if (!bits)
return 0;
clear_bit(bit_slot, bits + 1);

#if 0
for (i = 1; i < BIT_ARRAY_BYTES / sizeof(unsigned long); i++) {
if (bits[i]) {
empty = 0;
Expand All @@ -69,8 +71,11 @@ int clear_radix_bit(struct radix_tree_root *radix, unsigned long bit)

if (empty) {
bits = radix_tree_delete(radix, slot);
synchronize_rcu();
BUG_ON(!bits);
kfree(bits);
}
#endif
return 0;
}

Expand Down
Loading

0 comments on commit f736188

Please sign in to comment.