No description
Find a file
magic_rb 09306beed7
More blockpointer data
Signed-off-by: magic_rb <richard@brezak.sk>
2024-11-30 14:24:47 +01:00
app Initial commit 2024-11-30 00:35:46 +01:00
src More blockpointer data 2024-11-30 14:24:47 +01:00
test Initial commit 2024-11-30 00:35:46 +01:00
.dir-locals.el Initial commit 2024-11-30 00:35:46 +01:00
.envrc Initial commit 2024-11-30 00:35:46 +01:00
.gitignore Initial commit 2024-11-30 00:35:46 +01:00
CHANGELOG.md Initial commit 2024-11-30 00:35:46 +01:00
flake.lock Initial commit 2024-11-30 00:35:46 +01:00
flake.nix Initial commit 2024-11-30 00:35:46 +01:00
fourmolu.yaml Initial commit 2024-11-30 00:35:46 +01:00
LICENSE Initial commit 2024-11-30 00:35:46 +01:00
README.org More blockpointer data 2024-11-30 14:24:47 +01:00
zfs-hs.cabal Initial commit 2024-11-30 00:35:46 +01:00

https://github.com/ARM-software/u-boot/blob/master/fs/zfs/zfs.c#L1505 https://smartos.org/man/3nvpair/nvlist_xpack https://www.giis.co.in/Zfs_ondiskformat.pdf https://arxiv.org/pdf/1908.10926 https://hackage.haskell.org/package/tar-0.6.3.0/docs/src/Codec.Archive.Tar.Index.Utils.html#readWord32OffPtrBE

  Right (
    NVList {
      encodingMethod = XDR,
      endianness = BigEndian,
      version = 0,
      flag = 1,
      nvpairs = [
        NVPair {
          encodedSize = 36,
          decodedSize = 32,
          name = "version",
          content = [
            NVWord64 1
          ]
        },
        NVPair {
          encodedSize = 36,
          decodedSize = 32,
          name = "name",
          content = [
            NVString "v1-pool"
          ]
        },
        NVPair {
          encodedSize = 36,
          decodedSize = 32,
          name = "state",
          content = [
            NVWord64 1
          ]
        },
        NVPair {
          encodedSize = 32,
          decodedSize = 32,
          name = "txg",
          content = [
            NVWord64 14
          ]
        },
        NVPair {
          encodedSize = 40,
          decodedSize = 40,
          name = "pool_guid",
          content = [
            NVWord64 453684623696461653
          ]
        },
        NVPair {
          encodedSize = 36,
          decodedSize = 40,
          name = "top_guid",
          content = [
            NVWord64 11169756012016735292
          ]
        },
        NVPair {
          encodedSize = 32,
          decodedSize = 32,
          name = "guid",
          content = [
            NVWord64 11169756012016735292
          ]
        },
        NVPair {
          encodedSize = 352,
          decodedSize = 56,
          name = "vdev_tree",
          content = [
            NVNVList (
              NVList {
                encodingMethod = XDR,
                endianness = BigEndian,
                version = 0,
                flag = 1,
                nvpairs = [
                  NVPair {
                    encodedSize = 32,
                    decodedSize = 32,
                    name = "type",
                    content = [
                      NVString "file"
                    ]
                  },
                  NVPair {
                    encodedSize = 32,
                    decodedSize = 32,
                    name = "id",
                    content = [
                      NVWord64 0
                    ]
                  },
                  NVPair {
                    encodedSize = 32,
                    decodedSize = 32,
                    name = "guid",
                    content = [
                      NVWord64 11169756012016735292
                    ]
                  },
                  NVPair {
                    encodedSize = 48,
                    decodedSize = 48,
                    name = "path",
                    content = [
                      NVString "/tmp/zfs-pool-v1.dat"
                    ]
                  },
                  NVPair {
                    encodedSize = 44,
                    decodedSize = 40,
                    name = "metaslab_array",
                    content = [
                      NVWord64 13
                    ]
                  },
                  NVPair {
                    encodedSize = 44,
                    decodedSize = 40,
                    name = "metaslab_shift",
                    content = [
                      NVWord64 19
                    ]
                  },
                  NVPair {
                    encodedSize = 36,
                    decodedSize = 32,
                    name = "ashift",
                    content = [
                      NVWord64 9
                    ]
                  },
                  NVPair {
                    encodedSize = 36,
                    decodedSize = 32,
                    name = "asize",
                    content = [
                      NVWord64 62390272
                    ]
                  }
                ]
              }
            )
          ]
        }
      ]
    },
    [
      UberBlock {
        magic = 12235020,
        version = 1,
        txg = 4,
        guidSum = 11623440635713196945,
        timestamp = 1149769727,
        rootBP = BlockPointer {
          vdev1 = 0,
          grid1 = 0,
          asize1 = 2,
          gang1 = False,
          offset1 = 8,
          vdev2 = 0,
          grid2 = 0,
          asize2 = 0,
          gang2 = False,
          offset2 = 0,
          vdev3 = 0,
          grid3 = 0,
          asize3 = 0,
          gang3 = False,
          offset3 = 0,
          endian = BigEndian,
          level = 0,
          type = 11,
          checksumType = 7,
          compression = 2,
          psize = 1,
          lsize = 1,
          birthTxg = 4,
          fillCount = 15,
          checksum = (12190111063,2591787263790,277019457471256,19847920761345837),
          indirect = <not yet>
        }
      },
      UberBlock {
        magic = 12235020,
        version = 1,
        txg = 5,
        guidSum = 11623440635713196945,
        timestamp = 1149769727,
        rootBP = BlockPointer {
          vdev1 = 0,
          grid1 = 0,
          asize1 = 2,
          gang1 = False,
          offset1 = 1030,
          vdev2 = 0,
          grid2 = 0,
          asize2 = 0,
          gang2 = False,
          offset2 = 0,
          vdev3 = 0,
          grid3 = 0,
          asize3 = 0,
          gang3 = False,
          offset3 = 0,
          endian = BigEndian,
          level = 0,
          type = 11,
          checksumType = 7,
          compression = 2,
          psize = 1,
          lsize = 1,
          birthTxg = 5,
          fillCount = 16,
          checksum = (8855224438,1882322937516,201187481417432,14418237006726082),
          indirect = <not yet>
        }
      },
      UberBlock {
        magic = 12235020,
        version = 1,
        txg = 6,
        guidSum = 11623440635713196945,
        timestamp = 1149769737,
        rootBP = BlockPointer {
          vdev1 = 0,
          grid1 = 0,
          asize1 = 2,
          gang1 = False,
          offset1 = 2388,
          vdev2 = 0,
          grid2 = 0,
          asize2 = 0,
          gang2 = False,
          offset2 = 0,
          vdev3 = 0,
          grid3 = 0,
          asize3 = 0,
          gang3 = False,
          offset3 = 0,
          endian = BigEndian,
          level = 0,
          type = 11,
          checksumType = 7,
          compression = 2,
          psize = 1,
          lsize = 1,
          birthTxg = 6,
          fillCount = 17,
          checksum = (11160243674,2377140477114,254543650405856,18271454497291322),
          indirect = <not yet>
        }
      },
      UberBlock {
        magic = 12235020,
        version = 1,
        txg = 9,
        guidSum = 11623440635713196945,
        timestamp = 1149769752,
        rootBP = BlockPointer {
          vdev1 = 0,
          grid1 = 0,
          asize1 = 2,
          gang1 = False,
          offset1 = 3076,
          vdev2 = 0,
          grid2 = 0,
          asize2 = 0,
          gang2 = False,
          offset2 = 0,
          vdev3 = 0,
          grid3 = 0,
          asize3 = 0,
          gang3 = False,
          offset3 = 0,
          endian = BigEndian,
          level = 0,
          type = 11,
          checksumType = 7,
          compression = 2,
          psize = 1,
          lsize = 1,
          birthTxg = 9,
          fillCount = 18,
          checksum = (11398995673,2422071078583,258717437673908,18525158765075605),
          indirect = <not yet>
        }
      },
      UberBlock {
        magic = 12235020,
        version = 1,
        txg = 14,
        guidSum = 11623440635713196945,
        timestamp = 1149769757,
        rootBP = BlockPointer {
          vdev1 = 0,
          grid1 = 0,
          asize1 = 2,
          gang1 = False,
          offset1 = 4160,
          vdev2 = 0,
          grid2 = 0,
          asize2 = 0,
          gang2 = False,
          offset2 = 0,
          vdev3 = 0,
          grid3 = 0,
          asize3 = 0,
          gang3 = False,
          offset3 = 0,
          endian = BigEndian,
          level = 0,
          type = 11,
          checksumType = 7,
          compression = 2,
          psize = 1,
          lsize = 1,
          birthTxg = 14,
          fillCount = 19,
          checksum = (6129323532,1300516700871,138803739712048,9937828100793666),
          indirect = <not yet>
        }
      }
    ]
  )