blob: 522397f2604abdc4ae9193f59e8ed1e5eaa0afbd [file] [log] [blame]
Victor Hsieh88ac6ca2020-11-13 15:20:24 -08001/*
2 * Copyright (C) 2021 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Victor Hsiehda3fbc42021-02-23 16:12:49 -080017/// Common block and page size in Linux.
18pub const CHUNK_SIZE: u64 = 4096;
Victor Hsieh88ac6ca2020-11-13 15:20:24 -080019
20pub fn divide_roundup(dividend: u64, divisor: u64) -> u64 {
21 (dividend + divisor - 1) / divisor
22}