/* SPDX-License-Identifier: GPL-2.0 */ /* * bitmap.h: Copyright (C) Peter T. Breuer ([email protected]) 2003 * * additions: Copyright (C) 2003-2004, Paul Clements, SteelEye Technology, Inc. */ #ifndef BITMAP_H #define BITMAP_H … #define BITMAP_MAGIC … bitmap_counter_t; #define COUNTER_BITS … #define COUNTER_BIT_SHIFT … #define COUNTER_BYTE_SHIFT … #define NEEDED_MASK … #define RESYNC_MASK … #define COUNTER_MAX … /* use these for bitmap->flags and bitmap->sb->state bit-fields */ enum bitmap_state { … }; /* the superblock at the front of the bitmap file -- little endian */ bitmap_super_t; /* notes: * (1) This event counter is updated before the eventcounter in the md superblock * When a bitmap is loaded, it is only accepted if this event counter is equal * to, or one greater than, the event counter in the superblock. * (2) This event counter is updated when the other one is *if*and*only*if* the * array is not degraded. As bits are not cleared when the array is degraded, * this represents the last time that any bits were cleared. * If a device is being added that has an event count with this value or * higher, it is accepted as conforming to the bitmap. * (3)This is the number of sectors represented by the bitmap, and is the range that * resync happens across. For raid1 and raid5/6 it is the size of individual * devices. For raid10 it is the size of the array. */ struct md_bitmap_stats { … }; struct bitmap_operations { … }; /* the bitmap API */ void mddev_set_bitmap_ops(struct mddev *mddev); #endif