Ver Fonte

graphdriver/btrfs: use kernel UAPI headers

By relying on the kernel UAPI (userspace API), we can drop a dependency
and simplify building Moby, while also ensuring that we are using a
stable/supported source of the C types and defines we need.

btrfs-progs mirrors the kernel headers, but the headers it ships with
are not the canonical source and as [we have seen before][44698], could
be subject to changes.

Depending on the canonical headers from the kernel both is more
idiomatic, and ensures we are protected by the kernel's promise to not
break userspace.

  [44698]: https://github.com/moby/moby/issues/44698

Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
Bjorn Neergaard há 2 anos atrás
pai
commit
3208dcabdc
1 ficheiros alterados com 3 adições e 4 exclusões
  1. 3 4
      daemon/graphdriver/btrfs/btrfs.go

+ 3 - 4
daemon/graphdriver/btrfs/btrfs.go

@@ -5,12 +5,11 @@ package btrfs // import "github.com/docker/docker/daemon/graphdriver/btrfs"
 
 /*
 #include <stdlib.h>
+#include <stdio.h>
 #include <dirent.h>
 
-// keep struct field name compatible with btrfs-progs < 6.1.
-#define max_referenced max_rfer
-#include <btrfs/ioctl.h>
-#include <btrfs/ctree.h>
+#include <linux/btrfs.h>
+#include <linux/btrfs_tree.h>
 
 static void set_name_btrfs_ioctl_vol_args_v2(struct btrfs_ioctl_vol_args_v2* btrfs_struct, const char* value) {
     snprintf(btrfs_struct->name, BTRFS_SUBVOL_NAME_MAX, "%s", value);