Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 128587
b: refs/heads/master
c: f9ef660
h: refs/heads/master
i:
  128585: d75e169
  128583: 4bc2f29
v: v3
  • Loading branch information
Chris Mason committed Sep 25, 2008
1 parent 45083a8 commit abb8bda
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 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: 4313b3994d719fcdeb7e661473019ca3d62e829b
refs/heads/master: f9ef6604ace23a6fcd698e08b58a883d6009157b
4 changes: 3 additions & 1 deletion trunk/fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -2501,6 +2501,7 @@ int btrfs_grow_extent_tree(struct btrfs_trans_handle *trans,
u64 nr = 0;
u64 cur_byte;
u64 old_size;
unsigned long rem;
struct btrfs_block_group_cache *cache;
struct btrfs_block_group_item *item;
struct btrfs_fs_info *info = root->fs_info;
Expand Down Expand Up @@ -2538,7 +2539,8 @@ int btrfs_grow_extent_tree(struct btrfs_trans_handle *trans,
struct btrfs_block_group_item);

btrfs_set_disk_block_group_used(leaf, item, 0);
if (nr % 3) {
div_long_long_rem(nr, 3, &rem);
if (rem) {
btrfs_set_disk_block_group_flags(leaf, item,
BTRFS_BLOCK_GROUP_DATA);
} else {
Expand Down
10 changes: 7 additions & 3 deletions trunk/fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,11 @@ int btrfs_check_free_space(struct btrfs_root *root, u64 num_required,
int ret = 0;

if (for_del)
thresh = (total * 90) / 100;
thresh = total * 90;
else
thresh = (total * 85) / 100;
thresh = total * 85;

do_div(thresh, 100);

spin_lock(&root->fs_info->delalloc_lock);
if (used + root->fs_info->delalloc_bytes + num_required > thresh)
Expand Down Expand Up @@ -2475,7 +2477,9 @@ static int btrfs_ioctl_resize(struct btrfs_root *root, void __user *arg)
ret = -EFBIG;
goto out_unlock;
}
new_size = (new_size / root->sectorsize) * root->sectorsize;

do_div(new_size, root->sectorsize);
new_size *= root->sectorsize;

printk("new size is %Lu\n", new_size);
if (new_size > old_size) {
Expand Down

0 comments on commit abb8bda

Please sign in to comment.