summaryrefslogtreecommitdiff
path: root/pkg/loopback
Commit message (Collapse)AuthorAgeFilesLines
* pkg/loopback: use ioctl helpers from x/sys/unixSebastiaan van Stijn2022-10-084-96/+12
| | | | | | | | | | Use the IoctlRetInt, IoctlSetInt and IoctlLoopSetStatus64 helper functions defined in the golang.org/x/sys/unix package instead of manually wrapping these using a locally defined function. Inspired by https://github.com/containerd/containerd/commit/3cc3d8a560a9d070466d7d58010beda61db5c1ba Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* pkg/*: fix "empty-lines" (revive)Sebastiaan van Stijn2022-09-281-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pkg/directory/directory.go:9:49: empty-lines: extra empty line at the start of a block (revive) pkg/pubsub/publisher.go:8:48: empty-lines: extra empty line at the start of a block (revive) pkg/loopback/attach_loopback.go:96:69: empty-lines: extra empty line at the start of a block (revive) pkg/devicemapper/devmapper_wrapper.go:136:48: empty-lines: extra empty line at the start of a block (revive) pkg/devicemapper/devmapper.go:391:35: empty-lines: extra empty line at the end of a block (revive) pkg/devicemapper/devmapper.go:676:35: empty-lines: extra empty line at the end of a block (revive) pkg/archive/changes_posix_test.go:15:38: empty-lines: extra empty line at the end of a block (revive) pkg/devicemapper/devmapper.go:241:51: empty-lines: extra empty line at the start of a block (revive) pkg/fileutils/fileutils_test.go:17:47: empty-lines: extra empty line at the end of a block (revive) pkg/fileutils/fileutils_test.go:34:48: empty-lines: extra empty line at the end of a block (revive) pkg/fileutils/fileutils_test.go:318:32: empty-lines: extra empty line at the end of a block (revive) pkg/tailfile/tailfile.go:171:6: empty-lines: extra empty line at the end of a block (revive) pkg/tarsum/fileinfosums_test.go:16:41: empty-lines: extra empty line at the end of a block (revive) pkg/tarsum/tarsum_test.go:198:42: empty-lines: extra empty line at the start of a block (revive) pkg/tarsum/tarsum_test.go:294:25: empty-lines: extra empty line at the start of a block (revive) pkg/tarsum/tarsum_test.go:407:34: empty-lines: extra empty line at the end of a block (revive) pkg/ioutils/fswriters_test.go:52:45: empty-lines: extra empty line at the end of a block (revive) pkg/ioutils/writers_test.go:24:39: empty-lines: extra empty line at the end of a block (revive) pkg/ioutils/bytespipe_test.go:78:26: empty-lines: extra empty line at the end of a block (revive) pkg/sysinfo/sysinfo_linux_test.go:13:37: empty-lines: extra empty line at the end of a block (revive) pkg/archive/archive_linux_test.go:57:64: empty-lines: extra empty line at the end of a block (revive) pkg/archive/changes.go:248:72: empty-lines: extra empty line at the start of a block (revive) pkg/archive/changes_posix_test.go:15:38: empty-lines: extra empty line at the end of a block (revive) pkg/archive/copy.go:248:124: empty-lines: extra empty line at the end of a block (revive) pkg/archive/diff_test.go:198:44: empty-lines: extra empty line at the end of a block (revive) pkg/archive/archive.go:304:12: empty-lines: extra empty line at the end of a block (revive) pkg/archive/archive.go:749:37: empty-lines: extra empty line at the end of a block (revive) pkg/archive/archive.go:812:81: empty-lines: extra empty line at the start of a block (revive) pkg/archive/copy_unix_test.go:347:34: empty-lines: extra empty line at the end of a block (revive) pkg/system/path.go:11:39: empty-lines: extra empty line at the end of a block (revive) pkg/system/meminfo_linux.go:29:21: empty-lines: extra empty line at the end of a block (revive) pkg/plugins/plugins.go:135:32: empty-lines: extra empty line at the end of a block (revive) pkg/authorization/response.go:71:48: empty-lines: extra empty line at the start of a block (revive) pkg/authorization/api_test.go:18:51: empty-lines: extra empty line at the end of a block (revive) pkg/authorization/middleware_test.go:23:44: empty-lines: extra empty line at the end of a block (revive) pkg/authorization/middleware_unix_test.go:17:46: empty-lines: extra empty line at the end of a block (revive) pkg/authorization/api_test.go:57:45: empty-lines: extra empty line at the end of a block (revive) pkg/authorization/response.go:83:50: empty-lines: extra empty line at the start of a block (revive) pkg/authorization/api_test.go:66:47: empty-lines: extra empty line at the end of a block (revive) pkg/authorization/middleware_unix_test.go:45:48: empty-lines: extra empty line at the end of a block (revive) pkg/authorization/response.go:145:75: empty-lines: extra empty line at the start of a block (revive) pkg/authorization/middleware_unix_test.go:56:51: empty-lines: extra empty line at the end of a block (revive) Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* Update to Go 1.17.0, and gofmt with Go 1.17Sebastiaan van Stijn2021-08-244-0/+4
| | | | Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* reformat "nolint" commentsSebastiaan van Stijn2021-06-101-1/+1
| | | | | | Unlike regular comments, nolint comments should not have a leading space. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* Use correct `LOOP_CTL_GET_FREE` API in `pkg/loopback`Daniel Sweet2019-08-271-3/+7
| | | | | | | | | | | | | | | | | | | | The `ioctl` interface for the `LOOP_CTL_GET_FREE` request on `/dev/loop-control` is a little different from what `unix.IoctlGetInt` expects: the first index is the returned status in `r1`, not an `int` pointer as the first parameter. Unfortunately we have to go a little lower level to get the appropriate loop device index out, using `unix.Syscall` directly to read from `r1`. Internally, the index is returned as a signed integer to match the internal `ioctl` expectations of interpreting a negative signed integer as an error at the userspace ABI boundary, so the direct interface of `ioctlLoopCtlGetFree` can remain as-is. [@kolyshkin: it still worked before this fix because of /dev scan fallback in ioctlLoopCtlGetFree()] Signed-off-by: Daniel Sweet <danieljsweet@icloud.com> Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
* Use loopback types and constants from x/sys/unix to implement pkg/loopback ↵Tobias Klauser2019-08-224-56/+28
| | | | | | without cgo Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
* cast Dev and Rdev of Stat_t to uint64 for mipsDominic2019-08-011-1/+2
| | | | | Signed-off-by: Dominic <yindongchao@inspur.com> Signed-off-by: Dominic Yin <yindongchao@inspur.com>
* Add canonical import commentDaniel Nephin2018-02-054-4/+4
| | | | Signed-off-by: Daniel Nephin <dnephin@docker.com>
* Add gosimple linterDaniel Nephin2017-09-121-8/+2
| | | | | | Update gometalinter Signed-off-by: Daniel Nephin <dnephin@docker.com>
* Update logrus to v1.0.1Derek McGowan2017-07-312-2/+2
| | | | | | Fixes case sensitivity issue Signed-off-by: Derek McGowan <derek@mcgstyle.net>
* Switch Stat syscalls to x/sys/unixTobias Klauser2017-07-271-4/+5
| | | | | | | Switch some more usage of the Stat function and the Stat_t type from the syscall package to golang.org/x/sys. Those were missing in PR #33399. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
* loopback: use IoctlGetInt/IoctlSetInt from x/sys/unixTobias Klauser2017-07-171-5/+5
| | | | | | | Use IoctlGetInt/IoctlSetInt from golang.org/x/sys/unix (where applicable) instead of manually reimplementing them. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
* [project] change syscall to /x/sys/unix|windowsChristopher Jones2017-07-112-9/+10
| | | | | | | | | | | | | | | | Changes most references of syscall to golang.org/x/sys/ Ones aren't changes include, Errno, Signal and SysProcAttr as they haven't been implemented in /x/sys/. Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com> [s390x] switch utsname from unsigned to signed per https://github.com/golang/sys/commit/33267e036fd93fcd26ea95b7bdaf2d8306cb743c char in s390x in the /x/sys/unix package is now signed, so change the buildtags Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
* Make pkg/devicemapper and pkg/loopback depend on cgo in build tagsAaron Lehmann2017-03-294-4/+4
| | | | Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
* Fix logrus formattingYong Tang2016-06-111-2/+2
| | | | | | | | | | This fix tries to fix logrus formatting by removing `f` from `logrus.[Error|Warn|Debug|Fatal|Panic|Info]f` when formatting string is not present. This fix fixes #23459. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* loopback: separate loop logic from devicemapperVincent Batts2015-12-184-0/+305
The loopback logic is not technically exclusive to the devicemapper driver. This reorganizes the code such that the loopback code is usable outside of the devicemapper package and driver. Signed-off-by: Vincent Batts <vbatts@redhat.com>