// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

// Code generated by "cstruct -pkg md -struct MDSuperblock -input md_header.h -endianness LittleEndian"; DO NOT EDIT.

package md

import "encoding/binary"

var _ = binary.LittleEndian

// MDSuperblock is a byte slice representing the md_header.h C header.
type MDSuperblock []byte

// Get_magic returns MD_SB_MAGIC: 0xa92b4efc - little endian.
func (s MDSuperblock) Get_magic() uint32 {
	return binary.LittleEndian.Uint32(s[0:4])
}

// Put_magic sets MD_SB_MAGIC: 0xa92b4efc - little endian.
func (s MDSuperblock) Put_magic(v uint32) {
	binary.LittleEndian.PutUint32(s[0:4], v)
}

// Get_major_version returns 1.
func (s MDSuperblock) Get_major_version() uint32 {
	return binary.LittleEndian.Uint32(s[4:8])
}

// Put_major_version sets 1.
func (s MDSuperblock) Put_major_version(v uint32) {
	binary.LittleEndian.PutUint32(s[4:8], v)
}

// Get_feature_map returns bit 0 set if 'bitmap_offset' is meaningful.
func (s MDSuperblock) Get_feature_map() uint32 {
	return binary.LittleEndian.Uint32(s[8:12])
}

// Put_feature_map sets bit 0 set if 'bitmap_offset' is meaningful.
func (s MDSuperblock) Put_feature_map(v uint32) {
	binary.LittleEndian.PutUint32(s[8:12], v)
}

// Get_pad0 returns always set to 0 when writing.
func (s MDSuperblock) Get_pad0() uint32 {
	return binary.LittleEndian.Uint32(s[12:16])
}

// Put_pad0 sets always set to 0 when writing.
func (s MDSuperblock) Put_pad0(v uint32) {
	binary.LittleEndian.PutUint32(s[12:16], v)
}

// Get_set_uuid returns user-object uuid.
func (s MDSuperblock) Get_set_uuid() []byte {
	return s[16:32]
}

// Put_set_uuid sets user-object uuid.
func (s MDSuperblock) Put_set_uuid(v []byte) {
	copy(s[16:32], v)
}

// Get_set_name returns set and interpreted by user-space.
func (s MDSuperblock) Get_set_name() []byte {
	return s[32:64]
}

// Put_set_name sets set and interpreted by user-space.
func (s MDSuperblock) Put_set_name(v []byte) {
	copy(s[32:64], v)
}

// Get_ctime returns lo 40 bits are seconds, top 24 are microseconds or 0.
func (s MDSuperblock) Get_ctime() uint64 {
	return binary.LittleEndian.Uint64(s[64:72])
}

// Put_ctime sets lo 40 bits are seconds, top 24 are microseconds or 0.
func (s MDSuperblock) Put_ctime(v uint64) {
	binary.LittleEndian.PutUint64(s[64:72], v)
}

// Get_level returns -4 (multipath), -1 (linear), 0,1,4,5.
func (s MDSuperblock) Get_level() uint32 {
	return binary.LittleEndian.Uint32(s[72:76])
}

// Put_level sets -4 (multipath), -1 (linear), 0,1,4,5.
func (s MDSuperblock) Put_level(v uint32) {
	binary.LittleEndian.PutUint32(s[72:76], v)
}

// Get_layout returns only for raid5 and raid10 currently.
func (s MDSuperblock) Get_layout() uint32 {
	return binary.LittleEndian.Uint32(s[76:80])
}

// Put_layout sets only for raid5 and raid10 currently.
func (s MDSuperblock) Put_layout(v uint32) {
	binary.LittleEndian.PutUint32(s[76:80], v)
}

// Get_size returns used size of component devices, in 512byte sectors.
func (s MDSuperblock) Get_size() uint64 {
	return binary.LittleEndian.Uint64(s[80:88])
}

// Put_size sets used size of component devices, in 512byte sectors.
func (s MDSuperblock) Put_size(v uint64) {
	binary.LittleEndian.PutUint64(s[80:88], v)
}

// Get_chunksize returns in 512byte sectors.
func (s MDSuperblock) Get_chunksize() uint32 {
	return binary.LittleEndian.Uint32(s[88:92])
}

// Put_chunksize sets in 512byte sectors.
func (s MDSuperblock) Put_chunksize(v uint32) {
	binary.LittleEndian.PutUint32(s[88:92], v)
}

// Get_raid_disks returns raid_disks.
func (s MDSuperblock) Get_raid_disks() uint32 {
	return binary.LittleEndian.Uint32(s[92:96])
}

// Put_raid_disks sets raid_disks.
func (s MDSuperblock) Put_raid_disks(v uint32) {
	binary.LittleEndian.PutUint32(s[92:96], v)
}

// Get_bitmap_offset returns sectors after start of superblock that bitmap starts.
func (s MDSuperblock) Get_bitmap_offset() uint32 {
	return binary.LittleEndian.Uint32(s[96:100])
}

// Put_bitmap_offset sets sectors after start of superblock that bitmap starts.
func (s MDSuperblock) Put_bitmap_offset(v uint32) {
	binary.LittleEndian.PutUint32(s[96:100], v)
}

// Get_new_level returns only for feature bit '4'.
func (s MDSuperblock) Get_new_level() uint32 {
	return binary.LittleEndian.Uint32(s[100:104])
}

// Put_new_level sets only for feature bit '4'.
func (s MDSuperblock) Put_new_level(v uint32) {
	binary.LittleEndian.PutUint32(s[100:104], v)
}

// Get_reshape_position returns only for feature bit '4'.
func (s MDSuperblock) Get_reshape_position() uint64 {
	return binary.LittleEndian.Uint64(s[104:112])
}

// Put_reshape_position sets only for feature bit '4'.
func (s MDSuperblock) Put_reshape_position(v uint64) {
	binary.LittleEndian.PutUint64(s[104:112], v)
}

// Get_delta_disks returns only for feature bit '4'.
func (s MDSuperblock) Get_delta_disks() uint32 {
	return binary.LittleEndian.Uint32(s[112:116])
}

// Put_delta_disks sets only for feature bit '4'.
func (s MDSuperblock) Put_delta_disks(v uint32) {
	binary.LittleEndian.PutUint32(s[112:116], v)
}

// Get_new_layout returns only for feature bit '4'.
func (s MDSuperblock) Get_new_layout() uint32 {
	return binary.LittleEndian.Uint32(s[116:120])
}

// Put_new_layout sets only for feature bit '4'.
func (s MDSuperblock) Put_new_layout(v uint32) {
	binary.LittleEndian.PutUint32(s[116:120], v)
}

// Get_new_chunk returns only for feature bit '4'.
func (s MDSuperblock) Get_new_chunk() uint32 {
	return binary.LittleEndian.Uint32(s[120:124])
}

// Put_new_chunk sets only for feature bit '4'.
func (s MDSuperblock) Put_new_chunk(v uint32) {
	binary.LittleEndian.PutUint32(s[120:124], v)
}

// Get_new_offset returns only for feature bit '4'.
func (s MDSuperblock) Get_new_offset() uint32 {
	return binary.LittleEndian.Uint32(s[124:128])
}

// Put_new_offset sets only for feature bit '4'.
func (s MDSuperblock) Put_new_offset(v uint32) {
	binary.LittleEndian.PutUint32(s[124:128], v)
}

// Get_data_offset returns sector start of data, often 0.
func (s MDSuperblock) Get_data_offset() uint64 {
	return binary.LittleEndian.Uint64(s[128:136])
}

// Put_data_offset sets sector start of data, often 0.
func (s MDSuperblock) Put_data_offset(v uint64) {
	binary.LittleEndian.PutUint64(s[128:136], v)
}

// Get_data_size returns sectors in this device that can be used for data.
func (s MDSuperblock) Get_data_size() uint64 {
	return binary.LittleEndian.Uint64(s[136:144])
}

// Put_data_size sets sectors in this device that can be used for data.
func (s MDSuperblock) Put_data_size(v uint64) {
	binary.LittleEndian.PutUint64(s[136:144], v)
}

// Get_super_offset returns sector start of this superblock.
func (s MDSuperblock) Get_super_offset() uint64 {
	return binary.LittleEndian.Uint64(s[144:152])
}

// Put_super_offset sets sector start of this superblock.
func (s MDSuperblock) Put_super_offset(v uint64) {
	binary.LittleEndian.PutUint64(s[144:152], v)
}

// MDSUPERBLOCK_SIZE is the size of the MDSuperblock struct.
const MDSUPERBLOCK_SIZE = 152
