aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-01-03 09:22:38 -0500
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:03:58 -0400
commitf9ef6604ace23a6fcd698e08b58a883d6009157b (patch)
tree2fd2868313ac5b5c6390dc6fee3730afd0f4addb /fs
parent4313b3994d719fcdeb7e661473019ca3d62e829b (diff)
Btrfs: 32 bit compile fixes for the resizer and enospc checks
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/extent-tree.c4
-rw-r--r--fs/btrfs/inode.c10
2 files changed, 10 insertions, 4 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 6137f06091e8..54f2b1d8bdfd 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -2501,6 +2501,7 @@ int btrfs_grow_extent_tree(struct btrfs_trans_handle *trans,
2501 u64 nr = 0; 2501 u64 nr = 0;
2502 u64 cur_byte; 2502 u64 cur_byte;
2503 u64 old_size; 2503 u64 old_size;
2504 unsigned long rem;
2504 struct btrfs_block_group_cache *cache; 2505 struct btrfs_block_group_cache *cache;
2505 struct btrfs_block_group_item *item; 2506 struct btrfs_block_group_item *item;
2506 struct btrfs_fs_info *info = root->fs_info; 2507 struct btrfs_fs_info *info = root->fs_info;
@@ -2538,7 +2539,8 @@ int btrfs_grow_extent_tree(struct btrfs_trans_handle *trans,
2538 struct btrfs_block_group_item); 2539 struct btrfs_block_group_item);
2539 2540
2540 btrfs_set_disk_block_group_used(leaf, item, 0); 2541 btrfs_set_disk_block_group_used(leaf, item, 0);
2541 if (nr % 3) { 2542 div_long_long_rem(nr, 3, &rem);
2543 if (rem) {
2542 btrfs_set_disk_block_group_flags(leaf, item, 2544 btrfs_set_disk_block_group_flags(leaf, item,
2543 BTRFS_BLOCK_GROUP_DATA); 2545 BTRFS_BLOCK_GROUP_DATA);
2544 } else { 2546 } else {
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index b62f35e862bd..8a2001bbf104 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -81,9 +81,11 @@ int btrfs_check_free_space(struct btrfs_root *root, u64 num_required,
81 int ret = 0; 81 int ret = 0;
82 82
83 if (for_del) 83 if (for_del)
84 thresh = (total * 90) / 100; 84 thresh = total * 90;
85 else 85 else
86 thresh = (total * 85) / 100; 86 thresh = total * 85;
87
88 do_div(thresh, 100);
87 89
88 spin_lock(&root->fs_info->delalloc_lock); 90 spin_lock(&root->fs_info->delalloc_lock);
89 if (used + root->fs_info->delalloc_bytes + num_required > thresh) 91 if (used + root->fs_info->delalloc_bytes + num_required > thresh)
@@ -2475,7 +2477,9 @@ static int btrfs_ioctl_resize(struct btrfs_root *root, void __user *arg)
2475 ret = -EFBIG; 2477 ret = -EFBIG;
2476 goto out_unlock; 2478 goto out_unlock;
2477 } 2479 }
2478 new_size = (new_size / root->sectorsize) * root->sectorsize; 2480
2481 do_div(new_size, root->sectorsize);
2482 new_size *= root->sectorsize;
2479 2483
2480printk("new size is %Lu\n", new_size); 2484printk("new size is %Lu\n", new_size);
2481 if (new_size > old_size) { 2485 if (new_size > old_size) {