mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-29 09:32:24 +00:00
btrfs-progs: free-space-cache: Use DIV_ROUND_UP() to replace open code
Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
f44a055012
commit
bb338fb0f0
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user