diff options
author | OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> | 2013-02-20 21:26:36 +0900 |
---|---|---|
committer | Daniel Phillips <daniel@tux3.org> | 2013-02-20 21:26:36 +0900 |
commit | 3411c604c7cbe1aadd5c354942d61ba06bb1e044 (patch) | |
tree | de8a7ec6c80dcf520c3f278fc99adcc7287d916c | |
parent | 551b5ba02635919939bf730bc6ba582fb043edac (diff) | |
download | linux-tux3-3411c604c7cbe1aadd5c354942d61ba06bb1e044.tar.gz |
tux3: Fix bufindex() on 32bits arch
On 32bits arch, we can't divide 64bits by 32bits. there are several
way to fix this though.
Best way would be pass "sb" to bufindex(), and use "sb->blockbits".
For now, this fixes by hack as minimal patch.
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
-rw-r--r-- | fs/tux3/tux3.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/tux3/tux3.h b/fs/tux3/tux3.h index 15e92f58e2ee19..8eb370f4eae5d5 100644 --- a/fs/tux3/tux3.h +++ b/fs/tux3/tux3.h @@ -602,7 +602,12 @@ static inline block_t bufindex(struct buffer_head *buffer) { struct page *page = buffer->b_page; /* FIXME: maybe we want to remove buffer->b_size */ +#if BITS_PER_LONG == 64 return (page_offset(page) + bh_offset(buffer)) / buffer->b_size; +#else + const int blockbits = ffs(buffer->b_size) - 1; + return (page_offset(page) + bh_offset(buffer)) >> blockbits; +#endif } /* dir.c */ |