Skip to content

Commit

Permalink
Merge pull request containerd#16 from stevvooe/handle-compile-errors
Browse files Browse the repository at this point in the history
btrfs: remove C constant redefinitions
  • Loading branch information
stevvooe authored Mar 6, 2018
2 parents 9874fdf + 9686d82 commit 0a73180
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions btrfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ import "sort"
#include <btrfs/ioctl.h>
#include "btrfs.h"
// Required because Go has struct casting rules for negative numbers
const __u64 u64_BTRFS_LAST_FREE_OBJECTID = (__u64)BTRFS_LAST_FREE_OBJECTID;
const __u64 negative_one = (__u64)-1;
static char* get_name_btrfs_ioctl_vol_args_v2(struct btrfs_ioctl_vol_args_v2* btrfs_struct) {
return btrfs_struct->name;
}
Expand Down Expand Up @@ -100,9 +96,9 @@ func subvolMap(path string) (map[uint64]*Info, error) {
args.key.min_type = C.BTRFS_ROOT_ITEM_KEY
args.key.max_type = C.BTRFS_ROOT_BACKREF_KEY
args.key.min_objectid = C.BTRFS_FS_TREE_OBJECTID
args.key.max_objectid = C.u64_BTRFS_LAST_FREE_OBJECTID
args.key.max_offset = C.negative_one
args.key.max_transid = C.negative_one
args.key.max_objectid = C.BTRFS_LAST_FREE_OBJECTID
args.key.max_offset = ^C.__u64(0)
args.key.max_transid = ^C.__u64(0)

subvolsByID := make(map[uint64]*Info)

Expand Down

0 comments on commit 0a73180

Please sign in to comment.