X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/a136ca38d83fae60994a54f5da88120e545895e1..50b4ecfb1b28e9b1dfc57b6a876fcdf938092152:/lunaix-os/kernel/block/blkbuf.c diff --git a/lunaix-os/kernel/block/blkbuf.c b/lunaix-os/kernel/block/blkbuf.c index 4f255c9..302cd96 100644 --- a/lunaix-os/kernel/block/blkbuf.c +++ b/lunaix-os/kernel/block/blkbuf.c @@ -3,6 +3,7 @@ #include #include #include +#include LOG_MODULE("blkbuf") @@ -17,7 +18,8 @@ static struct cake_pile* bb_pile; static inline u64_t __tolba(struct blkbuf_cache* cache, unsigned int blk_id) { - return ((u64_t)cache->blksize * (u64_t)blk_id) / cache->blkdev->blk_size; + return udiv64(((u64_t)cache->blksize * (u64_t)blk_id), + cache->blkdev->blk_size); } static void