// SPDX-License-Identifier: GPL-2.0-or-later
/*
drbd_bitmap.c
This file is part of DRBD by Philipp Reisner and Lars Ellenberg.
Copyright (C) 2004-2008, LINBIT Information Technologies GmbH.
Copyright (C) 2004-2008, Philipp Reisner <philipp.reisner@linbit.com>.
Copyright (C) 2004-2008, Lars Ellenberg <lars.ellenberg@linbit.com>.
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/bitmap.h>
#include <linux/vmalloc.h>
#include <linux/string.h>
#include <linux/drbd.h>
#include <linux/slab.h>
#include <linux/highmem.h>
#include "drbd_int.h"
/* OPAQUE outside this file!
* interface defined in drbd_int.h
* convention:
* function name drbd_bm_... => used elsewhere, "public".
* function name bm_... => internal to implementation, "private".
*/
/*
* LIMITATIONS:
* We want to support >= peta byte of backend storage, while for now still using
* a granularity of one bit per 4KiB of storage.
* 1 << 50 bytes backend storage (1 PiB)
* 1 << (50 - 12) bits needed
* 38 --> we need u64 to index and count bits
* 1 << (38 - 3) bitmap bytes needed
* 35 --> we still need u64 to index and count bytes
*
|