diff options
author | dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> | 2021-06-03 09:34:51 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-03 09:34:51 +0000 |
commit | 735470ff234a319d2f02f634204bc74af77cc60e (patch) | |
tree | d3ba0b984e1b7be272efed23cc015f776769f0cc /vendor/go.etcd.io/bbolt/mlock_unix.go | |
parent | b64e20a53d3f5de262f2c475be490b35977d5f32 (diff) | |
download | podman-735470ff234a319d2f02f634204bc74af77cc60e.tar.gz podman-735470ff234a319d2f02f634204bc74af77cc60e.tar.bz2 podman-735470ff234a319d2f02f634204bc74af77cc60e.zip |
Bump go.etcd.io/bbolt from 1.3.5 to 1.3.6
Bumps [go.etcd.io/bbolt](https://github.com/etcd-io/bbolt) from 1.3.5 to 1.3.6.
- [Release notes](https://github.com/etcd-io/bbolt/releases)
- [Commits](https://github.com/etcd-io/bbolt/compare/v1.3.5...v1.3.6)
---
updated-dependencies:
- dependency-name: go.etcd.io/bbolt
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Diffstat (limited to 'vendor/go.etcd.io/bbolt/mlock_unix.go')
-rw-r--r-- | vendor/go.etcd.io/bbolt/mlock_unix.go | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/vendor/go.etcd.io/bbolt/mlock_unix.go b/vendor/go.etcd.io/bbolt/mlock_unix.go new file mode 100644 index 000000000..6a6c7b353 --- /dev/null +++ b/vendor/go.etcd.io/bbolt/mlock_unix.go @@ -0,0 +1,36 @@ +// +build !windows + +package bbolt + +import "golang.org/x/sys/unix" + +// mlock locks memory of db file +func mlock(db *DB, fileSize int) error { + sizeToLock := fileSize + if sizeToLock > db.datasz { + // Can't lock more than mmaped slice + sizeToLock = db.datasz + } + if err := unix.Mlock(db.dataref[:sizeToLock]); err != nil { + return err + } + return nil +} + +//munlock unlocks memory of db file +func munlock(db *DB, fileSize int) error { + if db.dataref == nil { + return nil + } + + sizeToUnlock := fileSize + if sizeToUnlock > db.datasz { + // Can't unlock more than mmaped slice + sizeToUnlock = db.datasz + } + + if err := unix.Munlock(db.dataref[:sizeToUnlock]); err != nil { + return err + } + return nil +} |