From effe20367769a0e9bdb3acbc940ecb86f4f69fd2 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 28 Oct 2013 01:45:06 +0100 Subject: [PATCH] * grub-core/osdep/linux/getroot.c: Add new btrfs defines. --- ChangeLog | 4 ++++ grub-core/osdep/linux/getroot.c | 35 ++++++++++++++++++++++++++++++--- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 625385181..d6f078196 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2013-10-28 Vladimir Serbinenko + + * grub-core/osdep/linux/getroot.c: Add new btrfs defines. + 2013-10-28 Vladimir Serbinenko Make / in btrfs refer to real root, not the default volume. diff --git a/grub-core/osdep/linux/getroot.c b/grub-core/osdep/linux/getroot.c index 9bf841fa5..a3cb80d8a 100644 --- a/grub-core/osdep/linux/getroot.c +++ b/grub-core/osdep/linux/getroot.c @@ -49,7 +49,6 @@ #include -#include #include #include #include @@ -60,7 +59,6 @@ #define LVM_DEV_MAPPER_STRING "/dev/mapper/" -#if 0 /* Defines taken from btrfs/ioctl.h. */ struct btrfs_ioctl_dev_info_args @@ -81,11 +79,42 @@ struct btrfs_ioctl_fs_info_args grub_uint64_t reserved[124]; }; +struct btrfs_ioctl_ino_lookup_args +{ + grub_uint64_t treeid; + grub_uint64_t objectid; + char name[4080]; +}; + +struct btrfs_ioctl_search_key +{ + grub_uint64_t tree_id; + grub_uint64_t min_objectid; + grub_uint64_t max_objectid; + grub_uint64_t min_offset; + grub_uint64_t max_offset; + grub_uint64_t min_transid; + grub_uint64_t max_transid; + grub_uint32_t min_type; + grub_uint32_t max_type; + grub_uint32_t nr_items; + grub_uint32_t unused[9]; +}; + +struct btrfs_ioctl_search_args { + struct btrfs_ioctl_search_key key; + char buf[4096 - sizeof(struct btrfs_ioctl_search_key)]; +}; + +#define BTRFS_IOC_TREE_SEARCH _IOWR(0x94, 17, \ + struct btrfs_ioctl_search_args) +#define BTRFS_IOC_INO_LOOKUP _IOWR(0x94, 18, \ + struct btrfs_ioctl_ino_lookup_args) #define BTRFS_IOC_DEV_INFO _IOWR(0x94, 30, \ struct btrfs_ioctl_dev_info_args) #define BTRFS_IOC_FS_INFO _IOR(0x94, 31, \ struct btrfs_ioctl_fs_info_args) -#endif + static int grub_util_is_imsm (const char *os_dev);