From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) by mail19.linbit.com (LINBIT Mail Daemon) with ESMTP id C2AC11630D7 for ; Fri, 27 Mar 2026 23:38:54 +0100 (CET) Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-439b97a8a8cso2632868f8f.1 for ; Fri, 27 Mar 2026 15:38:54 -0700 (PDT) From: =?UTF-8?q?Christoph=20B=C3=B6hmwalder?= To: Jens Axboe Subject: [PATCH 03/20] drbd: introduce DRBD 9 on-disk metadata format Date: Fri, 27 Mar 2026 23:38:03 +0100 Message-ID: <20260327223820.2244227-4-christoph.boehmwalder@linbit.com> In-Reply-To: <20260327223820.2244227-1-christoph.boehmwalder@linbit.com> References: <20260327223820.2244227-1-christoph.boehmwalder@linbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Philipp Reisner , linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, Lars Ellenberg , drbd-dev@lists.linbit.com List-Id: "*Coordination* of development, patches, contributions -- *Questions* \(even to developers\) go to drbd-user, please." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Add a new header that captures the DRBD 9 on-disk metadata layout, enabling state tracking for mutiple peers. It includes the per-device superblock and per-peer slot structures needed to track bitmap UUIDs and sync state for each peer. Co-developed-by: Philipp Reisner Signed-off-by: Philipp Reisner Co-developed-by: Lars Ellenberg Signed-off-by: Lars Ellenberg Co-developed-by: Joel Colledge Signed-off-by: Joel Colledge Co-developed-by: Christoph Böhmwalder Signed-off-by: Christoph Böhmwalder --- drivers/block/drbd/drbd_meta_data.h | 126 ++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 drivers/block/drbd/drbd_meta_data.h diff --git a/drivers/block/drbd/drbd_meta_data.h b/drivers/block/drbd/drbd_meta_data.h new file mode 100644 index 000000000000..af77e8d53f02 --- /dev/null +++ b/drivers/block/drbd/drbd_meta_data.h @@ -0,0 +1,126 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef DRBD_META_DATA_H +#define DRBD_META_DATA_H + +/* how I came up with this magic? + * base64 decode "actlog==" ;) */ +#define DRBD_AL_MAGIC 0x69cb65a2 + +#define BM_BLOCK_SHIFT_4k 12 /* 4k per bit */ +#define BM_BLOCK_SHIFT_MIN BM_BLOCK_SHIFT_4k +#define BM_BLOCK_SHIFT_MAX 20 +#define BM_BLOCK_SIZE_4k 4096 +#define BM_BLOCK_SIZE_MIN (1<