From 22b73a9a7800b71944529846a5c9ce212c92c218 Mon Sep 17 00:00:00 2001 From: Shengjing Zhu Date: Fri, 17 Jan 2020 10:56:32 +0800 Subject: [PATCH] vendor: bump containerd/btrfs to 153935315f4ab9be5bf03650a1341454b05efa5d Fix building issue on mipsle Signed-off-by: Shengjing Zhu --- vendor.conf | 2 +- vendor/github.com/containerd/btrfs/README.md | 5 +-- vendor/github.com/containerd/btrfs/btrfs.go | 32 ++++++------------- vendor/github.com/containerd/btrfs/doc.go | 15 --------- vendor/github.com/containerd/btrfs/go.mod | 5 +++ vendor/github.com/containerd/btrfs/helpers.go | 17 +--------- vendor/github.com/containerd/btrfs/info.go | 15 --------- vendor/github.com/containerd/btrfs/ioctl.go | 15 --------- 8 files changed, 20 insertions(+), 86 deletions(-) create mode 100644 vendor/github.com/containerd/btrfs/go.mod diff --git a/vendor.conf b/vendor.conf index e31f2fb96..98beb0e57 100644 --- a/vendor.conf +++ b/vendor.conf @@ -1,7 +1,7 @@ github.com/beorn7/perks 37c8de3658fcb183f997c4e13e8337516ab753e6 # v1.0.1 github.com/BurntSushi/toml 3012a1dbe2e4bd1391d42b32f0577cb7bbc7f005 # v0.3.1 github.com/cespare/xxhash/v2 d7df74196a9e781ede915320c11c378c1b2f3a1f # v2.1.1 -github.com/containerd/btrfs af5082808c833de0e79c1e72eea9fea239364877 +github.com/containerd/btrfs 153935315f4ab9be5bf03650a1341454b05efa5d github.com/containerd/cgroups 7347743e5d1e8500d9f27c8e748e689ed991d92b github.com/containerd/console 8375c3424e4d7b114e8a90a4a40c8e1b40d1d4e6 github.com/containerd/continuity 0ec596719c75bfd42908850990acea594b7593ac diff --git a/vendor/github.com/containerd/btrfs/README.md b/vendor/github.com/containerd/btrfs/README.md index d2f99c905..a05299d7f 100644 --- a/vendor/github.com/containerd/btrfs/README.md +++ b/vendor/github.com/containerd/btrfs/README.md @@ -1,5 +1,6 @@ # go-btrfs -[![GoDoc](https://godoc.org/github.com/containerd/btrfs?status.svg)](https://godoc.org/github.com/containerd/btrfs) [![Build Status](https://travis-ci.org/stevvooe/go-btrfs.svg?branch=master)](https://travis-ci.org/stevvooe/go-btrfs) +[![GoDoc](https://godoc.org/github.com/containerd/btrfs?status.svg)](https://godoc.org/github.com/containerd/btrfs) +[![Build Status](https://travis-ci.org/containerd/btrfs.svg?branch=master)](https://travis-ci.org/containerd/btrfs) Native Go bindings for btrfs. @@ -14,7 +15,7 @@ This package may not cover all the use cases for btrfs. If something you need is missing, please don't hesitate to submit a PR. Note that due to struct alignment issues, this isn't yet fully native. -Preferrably, this could be resolved, so contributions in this direction are +Preferably, this could be resolved, so contributions in this direction are greatly appreciated. ## Applying License Header to New Files diff --git a/vendor/github.com/containerd/btrfs/btrfs.go b/vendor/github.com/containerd/btrfs/btrfs.go index 27b7bc442..a055890eb 100644 --- a/vendor/github.com/containerd/btrfs/btrfs.go +++ b/vendor/github.com/containerd/btrfs/btrfs.go @@ -14,25 +14,8 @@ limitations under the License. */ -/* - Copyright The containerd Authors - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ package btrfs -import "sort" - /* #include #include @@ -47,12 +30,17 @@ import "C" import ( "os" "path/filepath" + "sort" "syscall" "unsafe" "github.com/pkg/errors" ) +// maxByteSliceSize is the smallest size that Go supports on various platforms. +// On mipsle, 1<<31-1 overflows the address space. +const maxByteSliceSize = 1 << 30 + // IsSubvolume returns nil if the path is a valid subvolume. An error is // returned if the path does not exist or the path is not a valid subvolume. func IsSubvolume(path string) error { @@ -146,7 +134,7 @@ func subvolMap(path string) (map[uint64]*Info, error) { var ( sh C.struct_btrfs_ioctl_search_header shSize = unsafe.Sizeof(sh) - buf = (*[1<<31 - 1]byte)(unsafe.Pointer(&args.buf[0]))[:C.BTRFS_SEARCH_ARGS_BUFSIZE] + buf = (*[maxByteSliceSize]byte)(unsafe.Pointer(&args.buf[0]))[:C.BTRFS_SEARCH_ARGS_BUFSIZE] ) for i := 0; i < int(args.key.nr_items); i++ { @@ -287,7 +275,7 @@ func SubvolCreate(path string) error { if len(name) > C.BTRFS_PATH_NAME_MAX { return errors.Errorf("%q too long for subvolume", name) } - nameptr := (*[1<<31 - 1]byte)(unsafe.Pointer(&args.name[0])) + nameptr := (*[maxByteSliceSize]byte)(unsafe.Pointer(&args.name[0])) copy(nameptr[:C.BTRFS_PATH_NAME_MAX], []byte(name)) if err := ioctl(fp.Fd(), C.BTRFS_IOC_SUBVOL_CREATE, uintptr(unsafe.Pointer(&args))); err != nil { @@ -304,7 +292,7 @@ func SubvolSnapshot(dst, src string, readonly bool) error { dstfp, err := openSubvolDir(dstdir) if err != nil { - return errors.Wrapf(err, "opening snapshot desination subvolume failed") + return errors.Wrapf(err, "opening snapshot destination subvolume failed") } defer dstfp.Close() @@ -323,7 +311,7 @@ func SubvolSnapshot(dst, src string, readonly bool) error { return errors.Errorf("%q too long for subvolume", dstname) } - nameptr := (*[1<<31 - 1]byte)(unsafe.Pointer(name)) + nameptr := (*[maxByteSliceSize]byte)(unsafe.Pointer(name)) copy(nameptr[:C.BTRFS_SUBVOL_NAME_MAX], []byte(dstname)) if readonly { @@ -382,7 +370,7 @@ func SubvolDelete(path string) error { return errors.Errorf("%q too long for subvolume", name) } - nameptr := (*[1<<31 - 1]byte)(unsafe.Pointer(&args.name[0])) + nameptr := (*[maxByteSliceSize]byte)(unsafe.Pointer(&args.name[0])) copy(nameptr[:C.BTRFS_SUBVOL_NAME_MAX], []byte(name)) if err := ioctl(fp.Fd(), C.BTRFS_IOC_SNAP_DESTROY, uintptr(unsafe.Pointer(&args))); err != nil { diff --git a/vendor/github.com/containerd/btrfs/doc.go b/vendor/github.com/containerd/btrfs/doc.go index 11ee64f60..6aaf2d056 100644 --- a/vendor/github.com/containerd/btrfs/doc.go +++ b/vendor/github.com/containerd/btrfs/doc.go @@ -14,20 +14,5 @@ limitations under the License. */ -/* - Copyright The containerd Authors - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ // Package btrfs provides bindings for working with btrfs partitions from Go. package btrfs diff --git a/vendor/github.com/containerd/btrfs/go.mod b/vendor/github.com/containerd/btrfs/go.mod new file mode 100644 index 000000000..d5488a51d --- /dev/null +++ b/vendor/github.com/containerd/btrfs/go.mod @@ -0,0 +1,5 @@ +module github.com/containerd/btrfs + +go 1.13 + +require github.com/pkg/errors v0.8.1 diff --git a/vendor/github.com/containerd/btrfs/helpers.go b/vendor/github.com/containerd/btrfs/helpers.go index c06f95353..475f1c60f 100644 --- a/vendor/github.com/containerd/btrfs/helpers.go +++ b/vendor/github.com/containerd/btrfs/helpers.go @@ -14,21 +14,6 @@ limitations under the License. */ -/* - Copyright The containerd Authors - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ package btrfs /* @@ -66,7 +51,7 @@ var ( ) func uuidString(uuid *[C.BTRFS_UUID_SIZE]C.u8) string { - b := (*[1<<31 - 1]byte)(unsafe.Pointer(uuid))[:C.BTRFS_UUID_SIZE] + b := (*[maxByteSliceSize]byte)(unsafe.Pointer(uuid))[:C.BTRFS_UUID_SIZE] if bytes.Equal(b, zeros) { return "" diff --git a/vendor/github.com/containerd/btrfs/info.go b/vendor/github.com/containerd/btrfs/info.go index 83278a758..0f96be6b8 100644 --- a/vendor/github.com/containerd/btrfs/info.go +++ b/vendor/github.com/containerd/btrfs/info.go @@ -14,21 +14,6 @@ limitations under the License. */ -/* - Copyright The containerd Authors - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ package btrfs // Info describes metadata about a btrfs subvolume. diff --git a/vendor/github.com/containerd/btrfs/ioctl.go b/vendor/github.com/containerd/btrfs/ioctl.go index 29354dbff..bac1dbdd6 100644 --- a/vendor/github.com/containerd/btrfs/ioctl.go +++ b/vendor/github.com/containerd/btrfs/ioctl.go @@ -14,21 +14,6 @@ limitations under the License. */ -/* - Copyright The containerd Authors - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ package btrfs import "syscall"