diff options
author | Liu Bo <bo.li.liu@oracle.com> | 2017-04-03 23:45:33 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2017-04-18 15:07:26 +0300 |
commit | 972d7219398651aaf7ae086b4f17c3416b51c7db (patch) | |
tree | 7c58f201d852515a80f401f35eafc1f2590ae395 /fs/btrfs | |
parent | c725328c55443f150577efcf445a7924687342e4 (diff) | |
download | linux-972d7219398651aaf7ae086b4f17c3416b51c7db.tar.xz |
Btrfs: update scrub_parity to use u64 stripe_len
Commit 3d8da6781760 ("Btrfs: fix divide error upon chunk's stripe_len")
changed stripe_len in struct map_lookup to u64, but didn't update
stripe_len in struct scrub_parity.
This updates the type and switches to div64_u64_rem to match u64 divisor.
Cc: David Sterba <dsterba@suse.cz>
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/scrub.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index 48dd6f170c36..58c5864bf709 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c @@ -140,7 +140,7 @@ struct scrub_parity { int nsectors; - int stripe_len; + u64 stripe_len; refcount_t refs; @@ -2396,7 +2396,7 @@ static inline void __scrub_mark_bitmap(struct scrub_parity *sparity, unsigned long *bitmap, u64 start, u64 len) { - u32 offset; + u64 offset; int nsectors; int sectorsize = sparity->sctx->fs_info->sectorsize; @@ -2406,8 +2406,8 @@ static inline void __scrub_mark_bitmap(struct scrub_parity *sparity, } start -= sparity->logic_start; - start = div_u64_rem(start, sparity->stripe_len, &offset); - offset /= sectorsize; + start = div64_u64_rem(start, sparity->stripe_len, &offset); + offset = div_u64(offset, sectorsize); nsectors = (int)len / sectorsize; if (offset + nsectors <= sparity->nsectors) { |