linux/include/uapi/linux/raid/md_p.h

/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
/*
   md_p.h : physical layout of Linux RAID devices
          Copyright (C) 1996-98 Ingo Molnar, Gadi Oxman

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2, or (at your option)
   any later version.
*/

#ifndef _MD_P_H
#define _MD_P_H

#include <linux/types.h>
#include <asm/byteorder.h>

/*
 * RAID superblock.
 *
 * The RAID superblock maintains some statistics on each RAID configuration.
 * Each real device in the RAID set contains it near the end of the device.
 * Some of the ideas are copied from the ext2fs implementation.
 *
 * We currently use 4096 bytes as follows:
 *
 *	word offset	function
 *
 *	   0  -    31	Constant generic RAID device information.
 *        32  -    63   Generic state information.
 *	  64  -   127	Personality specific information.
 *	 128  -   511	12 32-words descriptors of the disks in the raid set.
 *	 512  -   911	Reserved.
 *	 912  -  1023	Disk specific descriptor.
 */

/*
 * If x is the real device size in bytes, we return an apparent size of:
 *
 *	y = (x & ~(MD_RESERVED_BYTES - 1)) - MD_RESERVED_BYTES
 *
 * and place the 4kB superblock at offset y.
 */
#define MD_RESERVED_BYTES
#define MD_RESERVED_SECTORS

#define MD_NEW_SIZE_SECTORS(x)

#define MD_SB_BYTES
#define MD_SB_WORDS
#define MD_SB_SECTORS

/*
 * The following are counted in 32-bit words
 */
#define MD_SB_GENERIC_OFFSET
#define MD_SB_PERSONALITY_OFFSET
#define MD_SB_DISKS_OFFSET
#define MD_SB_DESCRIPTOR_OFFSET

#define MD_SB_GENERIC_CONSTANT_WORDS
#define MD_SB_GENERIC_STATE_WORDS
#define MD_SB_GENERIC_WORDS
#define MD_SB_PERSONALITY_WORDS
#define MD_SB_DESCRIPTOR_WORDS
#define MD_SB_DISKS
#define MD_SB_DISKS_WORDS
#define MD_SB_RESERVED_WORDS
#define MD_SB_EQUAL_WORDS

/*
 * Device "operational" state bits
 */
#define MD_DISK_FAULTY
#define MD_DISK_ACTIVE
#define MD_DISK_SYNC
#define MD_DISK_REMOVED
#define MD_DISK_CLUSTER_ADD
#define MD_DISK_CANDIDATE
#define MD_DISK_FAILFAST

#define MD_DISK_WRITEMOSTLY
#define MD_DISK_JOURNAL

#define MD_DISK_ROLE_SPARE
#define MD_DISK_ROLE_FAULTY
#define MD_DISK_ROLE_JOURNAL
#define MD_DISK_ROLE_MAX

mdp_disk_t;

#define MD_SB_MAGIC

/*
 * Superblock state bits
 */
#define MD_SB_CLEAN
#define MD_SB_ERRORS

#define MD_SB_CLUSTERED
#define MD_SB_BITMAP_PRESENT

/*
 * Notes:
 * - if an array is being reshaped (restriped) in order to change
 *   the number of active devices in the array, 'raid_disks' will be
 *   the larger of the old and new numbers.  'delta_disks' will
 *   be the "new - old".  So if +ve, raid_disks is the new value, and
 *   "raid_disks-delta_disks" is the old.  If -ve, raid_disks is the
 *   old value and "raid_disks+delta_disks" is the new (smaller) value.
 */


mdp_super_t;

static inline __u64 md_event(mdp_super_t *sb) {}

#define MD_SUPERBLOCK_1_TIME_SEC_MASK

/*
 * The version-1 superblock :
 * All numeric fields are little-endian.
 *
 * total size: 256 bytes plus 2 per device.
 *  1K allows 384 devices.
 */
struct mdp_superblock_1 {};

/* feature_map bits */
#define MD_FEATURE_BITMAP_OFFSET
#define MD_FEATURE_RECOVERY_OFFSET
#define MD_FEATURE_RESHAPE_ACTIVE
#define MD_FEATURE_BAD_BLOCKS
#define MD_FEATURE_REPLACEMENT
#define MD_FEATURE_RESHAPE_BACKWARDS
#define MD_FEATURE_NEW_OFFSET
#define MD_FEATURE_RECOVERY_BITMAP
#define MD_FEATURE_CLUSTERED
#define MD_FEATURE_JOURNAL
#define MD_FEATURE_PPL
#define MD_FEATURE_MULTIPLE_PPLS
#define MD_FEATURE_RAID0_LAYOUT
#define MD_FEATURE_ALL

struct r5l_payload_header {} __attribute__ ((packed));

enum r5l_payload_type {};

struct r5l_payload_data_parity {} __attribute__ ((packed));

enum r5l_payload_data_parity_flag {};

struct r5l_payload_flush {} __attribute__ ((packed));

enum r5l_payload_flush_flag {};

struct r5l_meta_block {} __attribute__ ((packed));

#define R5LOG_VERSION
#define R5LOG_MAGIC

struct ppl_header_entry {} __attribute__ ((packed));

#define PPL_HEADER_SIZE
#define PPL_HDR_RESERVED
#define PPL_HDR_ENTRY_SPACE
#define PPL_HDR_MAX_ENTRIES

struct ppl_header {} __attribute__ ((packed));

#endif