// 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 btrfs -struct SuperBlock -input superblock.h -endianness LittleEndian"; DO NOT EDIT.

package btrfs

import "encoding/binary"

var _ = binary.LittleEndian

// SuperBlock is a byte slice representing the superblock.h C header.
type SuperBlock []byte

// Get_csum returns checksum.
func (s SuperBlock) Get_csum() []byte {
	return s[0:32]
}

// Put_csum sets checksum.
func (s SuperBlock) Put_csum(v []byte) {
	copy(s[0:32], v)
}

// Get_fsid returns filesystem UUID.
func (s SuperBlock) Get_fsid() []byte {
	return s[32:48]
}

// Put_fsid sets filesystem UUID.
func (s SuperBlock) Put_fsid(v []byte) {
	copy(s[32:48], v)
}

// Get_bytenr returns this block number.
func (s SuperBlock) Get_bytenr() uint64 {
	return binary.LittleEndian.Uint64(s[48:56])
}

// Put_bytenr sets this block number.
func (s SuperBlock) Put_bytenr(v uint64) {
	binary.LittleEndian.PutUint64(s[48:56], v)
}

// Get_flags returns flags.
func (s SuperBlock) Get_flags() uint64 {
	return binary.LittleEndian.Uint64(s[56:64])
}

// Put_flags sets flags.
func (s SuperBlock) Put_flags(v uint64) {
	binary.LittleEndian.PutUint64(s[56:64], v)
}

// Get_magic returns BTRFS_MAGIC.
func (s SuperBlock) Get_magic() uint64 {
	return binary.LittleEndian.Uint64(s[64:72])
}

// Put_magic sets BTRFS_MAGIC.
func (s SuperBlock) Put_magic(v uint64) {
	binary.LittleEndian.PutUint64(s[64:72], v)
}

// Get_generation returns generation.
func (s SuperBlock) Get_generation() uint64 {
	return binary.LittleEndian.Uint64(s[72:80])
}

// Put_generation sets generation.
func (s SuperBlock) Put_generation(v uint64) {
	binary.LittleEndian.PutUint64(s[72:80], v)
}

// Get_root returns tree root.
func (s SuperBlock) Get_root() uint64 {
	return binary.LittleEndian.Uint64(s[80:88])
}

// Put_root sets tree root.
func (s SuperBlock) Put_root(v uint64) {
	binary.LittleEndian.PutUint64(s[80:88], v)
}

// Get_chunk_root returns chunk tree root.
func (s SuperBlock) Get_chunk_root() uint64 {
	return binary.LittleEndian.Uint64(s[88:96])
}

// Put_chunk_root sets chunk tree root.
func (s SuperBlock) Put_chunk_root(v uint64) {
	binary.LittleEndian.PutUint64(s[88:96], v)
}

// Get_log_root returns log tree root.
func (s SuperBlock) Get_log_root() uint64 {
	return binary.LittleEndian.Uint64(s[96:104])
}

// Put_log_root sets log tree root.
func (s SuperBlock) Put_log_root(v uint64) {
	binary.LittleEndian.PutUint64(s[96:104], v)
}

// Get_log_root_transid returns log root transid.
func (s SuperBlock) Get_log_root_transid() uint64 {
	return binary.LittleEndian.Uint64(s[104:112])
}

// Put_log_root_transid sets log root transid.
func (s SuperBlock) Put_log_root_transid(v uint64) {
	binary.LittleEndian.PutUint64(s[104:112], v)
}

// Get_total_bytes returns total filesystem size.
func (s SuperBlock) Get_total_bytes() uint64 {
	return binary.LittleEndian.Uint64(s[112:120])
}

// Put_total_bytes sets total filesystem size.
func (s SuperBlock) Put_total_bytes(v uint64) {
	binary.LittleEndian.PutUint64(s[112:120], v)
}

// Get_bytes_used returns bytes used.
func (s SuperBlock) Get_bytes_used() uint64 {
	return binary.LittleEndian.Uint64(s[120:128])
}

// Put_bytes_used sets bytes used.
func (s SuperBlock) Put_bytes_used(v uint64) {
	binary.LittleEndian.PutUint64(s[120:128], v)
}

// Get_root_dir_objectid returns root dir objectid.
func (s SuperBlock) Get_root_dir_objectid() uint64 {
	return binary.LittleEndian.Uint64(s[128:136])
}

// Put_root_dir_objectid sets root dir objectid.
func (s SuperBlock) Put_root_dir_objectid(v uint64) {
	binary.LittleEndian.PutUint64(s[128:136], v)
}

// Get_num_devices returns number of devices.
func (s SuperBlock) Get_num_devices() uint64 {
	return binary.LittleEndian.Uint64(s[136:144])
}

// Put_num_devices sets number of devices.
func (s SuperBlock) Put_num_devices(v uint64) {
	binary.LittleEndian.PutUint64(s[136:144], v)
}

// Get_sectorsize returns sector size.
func (s SuperBlock) Get_sectorsize() uint32 {
	return binary.LittleEndian.Uint32(s[144:148])
}

// Put_sectorsize sets sector size.
func (s SuperBlock) Put_sectorsize(v uint32) {
	binary.LittleEndian.PutUint32(s[144:148], v)
}

// Get_nodesize returns node size.
func (s SuperBlock) Get_nodesize() uint32 {
	return binary.LittleEndian.Uint32(s[148:152])
}

// Put_nodesize sets node size.
func (s SuperBlock) Put_nodesize(v uint32) {
	binary.LittleEndian.PutUint32(s[148:152], v)
}

// Get_leafsize returns leaf size (deprecated).
func (s SuperBlock) Get_leafsize() uint32 {
	return binary.LittleEndian.Uint32(s[152:156])
}

// Put_leafsize sets leaf size (deprecated).
func (s SuperBlock) Put_leafsize(v uint32) {
	binary.LittleEndian.PutUint32(s[152:156], v)
}

// Get_stripesize returns stripe size.
func (s SuperBlock) Get_stripesize() uint32 {
	return binary.LittleEndian.Uint32(s[156:160])
}

// Put_stripesize sets stripe size.
func (s SuperBlock) Put_stripesize(v uint32) {
	binary.LittleEndian.PutUint32(s[156:160], v)
}

// Get_sys_chunk_array_size returns size of sys_chunk_array.
func (s SuperBlock) Get_sys_chunk_array_size() uint32 {
	return binary.LittleEndian.Uint32(s[160:164])
}

// Put_sys_chunk_array_size sets size of sys_chunk_array.
func (s SuperBlock) Put_sys_chunk_array_size(v uint32) {
	binary.LittleEndian.PutUint32(s[160:164], v)
}

// Get_chunk_root_generation returns chunk root generation.
func (s SuperBlock) Get_chunk_root_generation() uint64 {
	return binary.LittleEndian.Uint64(s[164:172])
}

// Put_chunk_root_generation sets chunk root generation.
func (s SuperBlock) Put_chunk_root_generation(v uint64) {
	binary.LittleEndian.PutUint64(s[164:172], v)
}

// Get_compat_flags returns compat flags.
func (s SuperBlock) Get_compat_flags() uint64 {
	return binary.LittleEndian.Uint64(s[172:180])
}

// Put_compat_flags sets compat flags.
func (s SuperBlock) Put_compat_flags(v uint64) {
	binary.LittleEndian.PutUint64(s[172:180], v)
}

// Get_compat_ro_flags returns compat read-only flags.
func (s SuperBlock) Get_compat_ro_flags() uint64 {
	return binary.LittleEndian.Uint64(s[180:188])
}

// Put_compat_ro_flags sets compat read-only flags.
func (s SuperBlock) Put_compat_ro_flags(v uint64) {
	binary.LittleEndian.PutUint64(s[180:188], v)
}

// Get_incompat_flags returns incompat flags.
func (s SuperBlock) Get_incompat_flags() uint64 {
	return binary.LittleEndian.Uint64(s[188:196])
}

// Put_incompat_flags sets incompat flags.
func (s SuperBlock) Put_incompat_flags(v uint64) {
	binary.LittleEndian.PutUint64(s[188:196], v)
}

// Get_csum_type returns checksum type.
func (s SuperBlock) Get_csum_type() uint16 {
	return binary.LittleEndian.Uint16(s[196:198])
}

// Put_csum_type sets checksum type.
func (s SuperBlock) Put_csum_type(v uint16) {
	binary.LittleEndian.PutUint16(s[196:198], v)
}

// Get_root_level returns root level.
func (s SuperBlock) Get_root_level() byte {
	return s[198]
}

// Put_root_level sets root level.
func (s SuperBlock) Put_root_level(v byte) {
	s[198] = v
}

// Get_chunk_root_level returns chunk root level.
func (s SuperBlock) Get_chunk_root_level() byte {
	return s[199]
}

// Put_chunk_root_level sets chunk root level.
func (s SuperBlock) Put_chunk_root_level(v byte) {
	s[199] = v
}

// Get_log_root_level returns log root level.
func (s SuperBlock) Get_log_root_level() byte {
	return s[200]
}

// Put_log_root_level sets log root level.
func (s SuperBlock) Put_log_root_level(v byte) {
	s[200] = v
}

// Get_dev_item returns embedded device.
func (s SuperBlock) Get_dev_item() []byte {
	return s[201:299]
}

// Put_dev_item sets embedded device.
func (s SuperBlock) Put_dev_item(v []byte) {
	copy(s[201:299], v)
}

// Get_label returns filesystem label.
func (s SuperBlock) Get_label() []byte {
	return s[299:555]
}

// Put_label sets filesystem label.
func (s SuperBlock) Put_label(v []byte) {
	copy(s[299:555], v)
}

// SUPERBLOCK_SIZE is the size of the SuperBlock struct.
const SUPERBLOCK_SIZE = 555
