diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2016-12-07 07:25:40 -0900 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2017-01-18 21:41:21 -0900 |
commit | c8f121d68ef8e72b9881194394d8a16633f4446b (patch) | |
tree | aa2e875b636b469e69b14074a65e9f3ac411713f | |
parent | 76a208ab4e1eb0ba8bb09ea5d576e199508f8318 (diff) |
bcache: fix hash usage for journal has_inode hash
-rw-r--r-- | drivers/md/bcache/journal.c | 2 | ||||
-rw-r--r-- | drivers/md/bcache/journal.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/bcache/journal.c b/drivers/md/bcache/journal.c index 9aef28203545..254c3d2ab8c1 100644 --- a/drivers/md/bcache/journal.c +++ b/drivers/md/bcache/journal.c @@ -1998,7 +1998,7 @@ static void journal_write_work(struct work_struct *work) */ u64 bch_inode_journal_seq(struct journal *j, u64 inode) { - size_t h = hash_64(inode, sizeof(j->buf[0].has_inode) * 8); + size_t h = hash_64(inode, ilog2(sizeof(j->buf[0].has_inode) * 8)); u64 seq = 0; if (!test_bit(h, j->buf[0].has_inode) && diff --git a/drivers/md/bcache/journal.h b/drivers/md/bcache/journal.h index 827ce358932b..43aa2b68e7bf 100644 --- a/drivers/md/bcache/journal.h +++ b/drivers/md/bcache/journal.h @@ -171,7 +171,7 @@ static inline u64 bch_journal_res_seq(struct journal *j, static inline void bch_journal_set_has_inode(struct journal_buf *buf, u64 inum) { - set_bit(hash_64(inum, sizeof(buf->has_inode) * 8), buf->has_inode); + set_bit(hash_64(inum, ilog2(sizeof(buf->has_inode) * 8)), buf->has_inode); } /* |