diff options
author | David Sterba <dsterba@suse.cz> | 2015-02-20 18:42:11 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2015-03-03 17:24:01 +0100 |
commit | 9d644a623ec48e28ca3887e616456aba63fd0558 (patch) | |
tree | 2f9bf8f9d055ecdf08cf6526b2368c45134d3af1 /fs/btrfs/volumes.c | |
parent | 47c5713f4737e460a3b2535abb8ae2e2afe2d2d0 (diff) | |
download | linux-9d644a623ec48e28ca3887e616456aba63fd0558.tar.gz linux-9d644a623ec48e28ca3887e616456aba63fd0558.tar.bz2 linux-9d644a623ec48e28ca3887e616456aba63fd0558.zip |
btrfs: cleanup, use correct type in div_u64_rem
div_u64_rem expects u32 for divisior and reminder.
Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r-- | fs/btrfs/volumes.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index bf38ed09810a..3df83539f532 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -4953,7 +4953,7 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info, int rw, u64 stripe_nr_orig; u64 stripe_nr_end; u64 stripe_len; - int stripe_index; + u32 stripe_index; int i; int ret = 0; int num_stripes; @@ -5171,7 +5171,7 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info, int rw, } } else if (map->type & BTRFS_BLOCK_GROUP_RAID10) { - int factor = map->num_stripes / map->sub_stripes; + u32 factor = map->num_stripes / map->sub_stripes; stripe_nr = div_u64_rem(stripe_nr, factor, &stripe_index); stripe_index *= map->sub_stripes; @@ -5262,7 +5262,8 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info, int rw, need_raid_map && ((rw & (REQ_WRITE | REQ_GET_READ_MIRRORS)) || mirror_num > 1)) { u64 tmp; - int i, rot; + int i; + unsigned rot; bbio->raid_map = (u64 *)((void *)bbio->stripes + sizeof(struct btrfs_bio_stripe) * @@ -5285,8 +5286,8 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info, int rw, } if (rw & REQ_DISCARD) { - int factor = 0; - int sub_stripes = 0; + u32 factor = 0; + u32 sub_stripes = 0; u64 stripes_per_dev = 0; u32 remaining_stripes = 0; u32 last_stripe = 0; |