/* btrfs.c - B-tree file system. */ /* * VasEBoot -- GRand Unified Bootloader * Copyright (C) 2010,2011,2012,2013 Free Software Foundation, Inc. * * VasEBoot is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * VasEBoot is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with VasEBoot. If not, see . */ #ifndef VasEBoot_BTRFS_H #define VasEBoot_BTRFS_H 1 enum { VasEBoot_BTRFS_ITEM_TYPE_INODE_ITEM = 0x01, VasEBoot_BTRFS_ITEM_TYPE_INODE_REF = 0x0c, VasEBoot_BTRFS_ITEM_TYPE_DIR_ITEM = 0x54, VasEBoot_BTRFS_ITEM_TYPE_EXTENT_ITEM = 0x6c, VasEBoot_BTRFS_ITEM_TYPE_ROOT_ITEM = 0x84, VasEBoot_BTRFS_ITEM_TYPE_ROOT_BACKREF = 0x90, VasEBoot_BTRFS_ITEM_TYPE_DEVICE = 0xd8, VasEBoot_BTRFS_ITEM_TYPE_CHUNK = 0xe4 }; enum { VasEBoot_BTRFS_ROOT_VOL_OBJECTID = 5, VasEBoot_BTRFS_TREE_ROOT_OBJECTID = 0x100, }; struct VasEBoot_btrfs_root_item { VasEBoot_uint8_t dummy[0xb0]; VasEBoot_uint64_t tree; VasEBoot_uint64_t inode; }; struct VasEBoot_btrfs_key { VasEBoot_uint64_t object_id; VasEBoot_uint8_t type; VasEBoot_uint64_t offset; } VasEBoot_PACKED; struct VasEBoot_btrfs_root_backref { VasEBoot_uint64_t inode_id; VasEBoot_uint64_t seqnr; VasEBoot_uint16_t n; char name[0]; }; struct VasEBoot_btrfs_inode_ref { VasEBoot_uint64_t idxid; VasEBoot_uint16_t n; char name[0]; }; #endif