diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2022-07-12 17:01:13 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2022-07-12 17:01:13 -0600 |
commit | bba3428e8f034802b4b5ceb772bde1285a65ee50 (patch) | |
tree | 7b56b8241385c4474c232ccb584bf07089e47e92 /cmd/btrfs-fsck/pass1.go | |
parent | 54ba669b644f13c158fcbbde76943543eaf66e0a (diff) |
Don't include the offset and size in btrfs.Item
Diffstat (limited to 'cmd/btrfs-fsck/pass1.go')
-rw-r--r-- | cmd/btrfs-fsck/pass1.go | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/cmd/btrfs-fsck/pass1.go b/cmd/btrfs-fsck/pass1.go index c75e066..e8398f9 100644 --- a/cmd/btrfs-fsck/pass1.go +++ b/cmd/btrfs-fsck/pass1.go @@ -92,12 +92,10 @@ func pass1WriteReconstructedChunks(fs *btrfs.FS) { for _, dev := range fs.LV.PhysicalVolumes() { superblock, _ := dev.Superblock() reconstructedNode.Data.BodyLeaf = append(reconstructedNode.Data.BodyLeaf, btrfs.Item{ - Head: btrfs.ItemHeader{ - Key: btrfs.Key{ - ObjectID: btrfs.DEV_ITEMS_OBJECTID, - ItemType: btrfsitem.DEV_ITEM_KEY, - Offset: uint64(superblock.Data.DevItem.DevID), - }, + Key: btrfs.Key{ + ObjectID: btrfs.DEV_ITEMS_OBJECTID, + ItemType: btrfsitem.DEV_ITEM_KEY, + Offset: uint64(superblock.Data.DevItem.DevID), }, Body: superblock.Data.DevItem, }) @@ -105,14 +103,12 @@ func pass1WriteReconstructedChunks(fs *btrfs.FS) { for _, mapping := range fs.LV.Mappings() { chunkIdx := len(reconstructedNode.Data.BodyLeaf) - 1 - if len(reconstructedNode.Data.BodyLeaf) == 0 || reconstructedNode.Data.BodyLeaf[chunkIdx].Head.Key.Offset != uint64(mapping.LAddr) { + if len(reconstructedNode.Data.BodyLeaf) == 0 || reconstructedNode.Data.BodyLeaf[chunkIdx].Key.Offset != uint64(mapping.LAddr) { reconstructedNode.Data.BodyLeaf = append(reconstructedNode.Data.BodyLeaf, btrfs.Item{ - Head: btrfs.ItemHeader{ - Key: btrfs.Key{ - ObjectID: btrfs.FIRST_CHUNK_TREE_OBJECTID, - ItemType: btrfsitem.CHUNK_ITEM_KEY, - Offset: uint64(mapping.LAddr), - }, + Key: btrfs.Key{ + ObjectID: btrfs.FIRST_CHUNK_TREE_OBJECTID, + ItemType: btrfsitem.CHUNK_ITEM_KEY, + Offset: uint64(mapping.LAddr), }, Body: btrfsitem.Chunk{ Head: btrfsitem.ChunkHeader{ |