Signed-off-by: Qu Wenruo <wqu@xxxxxxxx>
---
free-space-cache.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/free-space-cache.c b/free-space-cache.c
index 50356d0462dd..f933f9f1cf3f 100644
--- a/free-space-cache.c
+++ b/free-space-cache.c
@@ -54,8 +54,7 @@ static int io_ctl_init(struct io_ctl *io_ctl, u64 size, u64 ino,
struct btrfs_root *root)
{
memset(io_ctl, 0, sizeof(struct io_ctl));
- io_ctl->num_pages = (size + root->fs_info->sectorsize - 1) /
- root->fs_info->sectorsize;
+ io_ctl->num_pages = DIV_ROUND_UP(size, root->fs_info->sectorsize);
io_ctl->buffer = kzalloc(size, GFP_NOFS);
if (!io_ctl->buffer)
return -ENOMEM;
--
2.16.2
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html