Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 263100
b: refs/heads/master
c: bb3ac5a
h: refs/heads/master
v: v3
  • Loading branch information
Miao Xie authored and Chris Mason committed Aug 17, 2011
1 parent fe2aaaa commit ded59d9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 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: f4ac904c411b55e58bb240f332f93db2455f0010
refs/heads/master: bb3ac5a4dfc8eeb881206c77d9f925e320d9c41a
16 changes: 11 additions & 5 deletions trunk/fs/btrfs/free-space-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -1168,9 +1168,9 @@ static void recalculate_thresholds(struct btrfs_free_space_ctl *ctl)
div64_u64(extent_bytes, (sizeof(struct btrfs_free_space)));
}

static void bitmap_clear_bits(struct btrfs_free_space_ctl *ctl,
struct btrfs_free_space *info, u64 offset,
u64 bytes)
static inline void __bitmap_clear_bits(struct btrfs_free_space_ctl *ctl,
struct btrfs_free_space *info,
u64 offset, u64 bytes)
{
unsigned long start, count;

Expand All @@ -1181,6 +1181,13 @@ static void bitmap_clear_bits(struct btrfs_free_space_ctl *ctl,
bitmap_clear(info->bitmap, start, count);

info->bytes -= bytes;
}

static void bitmap_clear_bits(struct btrfs_free_space_ctl *ctl,
struct btrfs_free_space *info, u64 offset,
u64 bytes)
{
__bitmap_clear_bits(ctl, info, offset, bytes);
ctl->free_space -= bytes;
}

Expand Down Expand Up @@ -1984,7 +1991,7 @@ static u64 btrfs_alloc_from_bitmap(struct btrfs_block_group_cache *block_group,
return 0;

ret = search_start;
bitmap_clear_bits(ctl, entry, ret, bytes);
__bitmap_clear_bits(ctl, entry, ret, bytes);

return ret;
}
Expand Down Expand Up @@ -2039,7 +2046,6 @@ u64 btrfs_alloc_from_cluster(struct btrfs_block_group_cache *block_group,
continue;
}
} else {

ret = entry->offset;

entry->offset += bytes;
Expand Down

0 comments on commit ded59d9

Please sign in to comment.