summaryrefslogtreecommitdiff
path: root/lib/btrfs/btrfsitem/item_freespacebitmap.go
blob: ad46204e7a1e10443d24deba13713207bb931966 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Copyright (C) 2022  Luke Shumaker <lukeshu@lukeshu.com>
//
// SPDX-License-Identifier: GPL-2.0-or-later

package btrfsitem

// key.objectid = object ID of the FreeSpaceInfo (logical_addr)
// key.offset = offset of the FreeSpaceInfo (size)
type FreeSpaceBitmap []byte // FREE_SPACE_BITMAP=200

func (o *FreeSpaceBitmap) UnmarshalBinary(dat []byte) (int, error) {
	*o = dat
	return len(dat), nil
}

func (o FreeSpaceBitmap) MarshalBinary() ([]byte, error) {
	return []byte(o), nil
}