diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2014-09-18 17:03:46 -0400 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2014-09-21 14:20:20 -0400 |
commit | 5466112f0935f079e225514905c57d5e5285a9b6 (patch) | |
tree | 15af329f5f931d2dec8c015d1ca9caa6deb9946e /fs/nfs | |
parent | b262b35c2ceb989c6b89dae6b8e0c0ce466cc90d (diff) |
pnfs/blocklayout: Fix a 64-bit division/remainder issue in bl_map_stripe
kbuild test robot reports:
fs/built-in.o: In function `bl_map_stripe':
>> :(.text+0x965b4): undefined reference to `__aeabi_uldivmod'
>> :(.text+0x965cc): undefined reference to `__aeabi_uldivmod'
>> :(.text+0x96604): undefined reference to `__aeabi_uldivmod'
Fixes: 5c83746a0cf2 (pnfs/blocklayout: in-kernel GETDEVICEINFO XDR parsing)
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Christoph Hellwig <hch@lst.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/blocklayout/dev.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/nfs/blocklayout/dev.c b/fs/nfs/blocklayout/dev.c index 00f159da06ee..5aed4f98df41 100644 --- a/fs/nfs/blocklayout/dev.c +++ b/fs/nfs/blocklayout/dev.c | |||
@@ -150,10 +150,13 @@ static bool bl_map_stripe(struct pnfs_block_dev *dev, u64 offset, | |||
150 | struct pnfs_block_dev_map *map) | 150 | struct pnfs_block_dev_map *map) |
151 | { | 151 | { |
152 | struct pnfs_block_dev *child; | 152 | struct pnfs_block_dev *child; |
153 | u64 chunk = (offset / dev->chunk_size); | 153 | u64 chunk; |
154 | int chunk_idx = chunk % dev->nr_children; | 154 | u32 chunk_idx; |
155 | u64 disk_offset; | 155 | u64 disk_offset; |
156 | 156 | ||
157 | chunk = div_u64(offset, dev->chunk_size); | ||
158 | div_u64_rem(chunk, dev->nr_children, &chunk_idx); | ||
159 | |||
157 | if (chunk_idx > dev->nr_children) { | 160 | if (chunk_idx > dev->nr_children) { |
158 | dprintk("%s: invalid chunk idx %d (%lld/%lld)\n", | 161 | dprintk("%s: invalid chunk idx %d (%lld/%lld)\n", |
159 | __func__, chunk_idx, offset, dev->chunk_size); | 162 | __func__, chunk_idx, offset, dev->chunk_size); |
@@ -165,7 +168,7 @@ static bool bl_map_stripe(struct pnfs_block_dev *dev, u64 offset, | |||
165 | offset = chunk * dev->chunk_size; | 168 | offset = chunk * dev->chunk_size; |
166 | 169 | ||
167 | /* disk offset of the stripe */ | 170 | /* disk offset of the stripe */ |
168 | disk_offset = offset / dev->nr_children; | 171 | disk_offset = div_u64(offset, dev->nr_children); |
169 | 172 | ||
170 | child = &dev->children[chunk_idx]; | 173 | child = &dev->children[chunk_idx]; |
171 | child->map(child, disk_offset, map); | 174 | child->map(child, disk_offset, map); |