mirror of
https://github.com/containers/podman.git
synced 2025-06-26 04:46:57 +08:00
Update c/storage to v1.23.2
Signed-off-by: Matthew Heon <mheon@redhat.com>
This commit is contained in:

committed by
Matthew Heon

parent
72c5b35ea5
commit
1a30bcde30
2
go.mod
2
go.mod
@ -15,7 +15,7 @@ require (
|
|||||||
github.com/containers/conmon v2.0.19+incompatible
|
github.com/containers/conmon v2.0.19+incompatible
|
||||||
github.com/containers/image/v5 v5.5.2
|
github.com/containers/image/v5 v5.5.2
|
||||||
github.com/containers/psgo v1.5.1
|
github.com/containers/psgo v1.5.1
|
||||||
github.com/containers/storage v1.23.0
|
github.com/containers/storage v1.23.2
|
||||||
github.com/coreos/go-systemd/v22 v22.1.0
|
github.com/coreos/go-systemd/v22 v22.1.0
|
||||||
github.com/cri-o/ocicni v0.2.0
|
github.com/cri-o/ocicni v0.2.0
|
||||||
github.com/cyphar/filepath-securejoin v0.2.2
|
github.com/cyphar/filepath-securejoin v0.2.2
|
||||||
|
4
go.sum
4
go.sum
@ -90,6 +90,8 @@ github.com/containers/psgo v1.5.1/go.mod h1:2ubh0SsreMZjSXW1Hif58JrEcFudQyIy9EzP
|
|||||||
github.com/containers/storage v1.20.2/go.mod h1:oOB9Ie8OVPojvoaKWEGSEtHbXUAs+tSyr7RO7ZGteMc=
|
github.com/containers/storage v1.20.2/go.mod h1:oOB9Ie8OVPojvoaKWEGSEtHbXUAs+tSyr7RO7ZGteMc=
|
||||||
github.com/containers/storage v1.23.0 h1:gYyNkBiihC2FvGiHOjOjpnfojYwgxpLVooTUlmD6pxs=
|
github.com/containers/storage v1.23.0 h1:gYyNkBiihC2FvGiHOjOjpnfojYwgxpLVooTUlmD6pxs=
|
||||||
github.com/containers/storage v1.23.0/go.mod h1:I1EIAA7B4OwWRSA0b4yq2AW1wjvvfcY0zLWQuwTa4zw=
|
github.com/containers/storage v1.23.0/go.mod h1:I1EIAA7B4OwWRSA0b4yq2AW1wjvvfcY0zLWQuwTa4zw=
|
||||||
|
github.com/containers/storage v1.23.2 h1:GPZ8PXYezML1gmZ/uFaXQpyps7AH645lmdvvOJwJYNc=
|
||||||
|
github.com/containers/storage v1.23.2/go.mod h1:AyTMMiE5ANvZJiqvatQgSZ85wAl5yHucY3NDN/kemr4=
|
||||||
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
|
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
|
||||||
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
|
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
|
||||||
github.com/coreos/go-iptables v0.4.5 h1:DpHb9vJrZQEFMcVLFKAAGMUVX0XoRC0ptCthinRYm38=
|
github.com/coreos/go-iptables v0.4.5 h1:DpHb9vJrZQEFMcVLFKAAGMUVX0XoRC0ptCthinRYm38=
|
||||||
@ -259,6 +261,8 @@ github.com/klauspost/compress v1.10.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYs
|
|||||||
github.com/klauspost/compress v1.10.8/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
|
github.com/klauspost/compress v1.10.8/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
|
||||||
github.com/klauspost/compress v1.10.10 h1:a/y8CglcM7gLGYmlbP/stPE5sR3hbhFRUjCBfd/0B3I=
|
github.com/klauspost/compress v1.10.10 h1:a/y8CglcM7gLGYmlbP/stPE5sR3hbhFRUjCBfd/0B3I=
|
||||||
github.com/klauspost/compress v1.10.10/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
|
github.com/klauspost/compress v1.10.10/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
|
||||||
|
github.com/klauspost/compress v1.10.11 h1:K9z59aO18Aywg2b/WSgBaUX99mHy2BES18Cr5lBKZHk=
|
||||||
|
github.com/klauspost/compress v1.10.11/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
|
||||||
github.com/klauspost/pgzip v1.2.4 h1:TQ7CNpYKovDOmqzRHKxJh0BeaBI7UdQZYc6p7pMQh1A=
|
github.com/klauspost/pgzip v1.2.4 h1:TQ7CNpYKovDOmqzRHKxJh0BeaBI7UdQZYc6p7pMQh1A=
|
||||||
github.com/klauspost/pgzip v1.2.4/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs=
|
github.com/klauspost/pgzip v1.2.4/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs=
|
||||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||||
|
6
vendor/github.com/containers/storage/.cirrus.yml
generated
vendored
6
vendor/github.com/containers/storage/.cirrus.yml
generated
vendored
@ -106,7 +106,7 @@ lint_task:
|
|||||||
env:
|
env:
|
||||||
CIRRUS_WORKING_DIR: "/go/src/github.com/containers/storage"
|
CIRRUS_WORKING_DIR: "/go/src/github.com/containers/storage"
|
||||||
container:
|
container:
|
||||||
image: golang:1.13
|
image: golang:1.15
|
||||||
modules_cache:
|
modules_cache:
|
||||||
fingerprint_script: cat go.sum
|
fingerprint_script: cat go.sum
|
||||||
folder: $GOPATH/pkg/mod
|
folder: $GOPATH/pkg/mod
|
||||||
@ -142,7 +142,7 @@ meta_task:
|
|||||||
|
|
||||||
vendor_task:
|
vendor_task:
|
||||||
container:
|
container:
|
||||||
image: golang:1.14
|
image: golang:1.15
|
||||||
modules_cache:
|
modules_cache:
|
||||||
fingerprint_script: cat go.sum
|
fingerprint_script: cat go.sum
|
||||||
folder: $GOPATH/pkg/mod
|
folder: $GOPATH/pkg/mod
|
||||||
@ -157,6 +157,6 @@ success_task:
|
|||||||
- meta
|
- meta
|
||||||
- vendor
|
- vendor
|
||||||
container:
|
container:
|
||||||
image: golang:1.14
|
image: golang:1.15
|
||||||
clone_script: 'mkdir -p "$CIRRUS_WORKING_DIR"' # Source code not needed
|
clone_script: 'mkdir -p "$CIRRUS_WORKING_DIR"' # Source code not needed
|
||||||
script: /bin/true
|
script: /bin/true
|
||||||
|
2
vendor/github.com/containers/storage/VERSION
generated
vendored
2
vendor/github.com/containers/storage/VERSION
generated
vendored
@ -1 +1 @@
|
|||||||
1.23.1-dev
|
1.23.2
|
||||||
|
4
vendor/github.com/containers/storage/drivers/copy/copy_linux.go
generated
vendored
4
vendor/github.com/containers/storage/drivers/copy/copy_linux.go
generated
vendored
@ -143,10 +143,6 @@ func DirCopy(srcDir, dstDir string, copyMode Mode, copyXattrs bool) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dstPath := filepath.Join(dstDir, relPath)
|
dstPath := filepath.Join(dstDir, relPath)
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
stat, ok := f.Sys().(*syscall.Stat_t)
|
stat, ok := f.Sys().(*syscall.Stat_t)
|
||||||
if !ok {
|
if !ok {
|
||||||
return fmt.Errorf("Unable to get raw syscall.Stat_t data for %s", srcPath)
|
return fmt.Errorf("Unable to get raw syscall.Stat_t data for %s", srcPath)
|
||||||
|
4
vendor/github.com/containers/storage/drivers/counter.go
generated
vendored
4
vendor/github.com/containers/storage/drivers/counter.go
generated
vendored
@ -51,6 +51,10 @@ func (c *RefCounter) incdec(path string, infoOp func(minfo *minfo)) int {
|
|||||||
if c.checker.IsMounted(path) {
|
if c.checker.IsMounted(path) {
|
||||||
m.count++
|
m.count++
|
||||||
}
|
}
|
||||||
|
} else if !c.checker.IsMounted(path) {
|
||||||
|
// if the unmount was performed outside of this process (e.g. conmon cleanup)
|
||||||
|
//the ref counter would lose track of it. Check if it is still mounted.
|
||||||
|
m.count = 0
|
||||||
}
|
}
|
||||||
infoOp(m)
|
infoOp(m)
|
||||||
count := m.count
|
count := m.count
|
||||||
|
24
vendor/github.com/containers/storage/drivers/overlay/overlay.go
generated
vendored
24
vendor/github.com/containers/storage/drivers/overlay/overlay.go
generated
vendored
@ -274,22 +274,28 @@ func parseOptions(options []string) (*overlayOptions, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
key = strings.ToLower(key)
|
trimkey := strings.ToLower(key)
|
||||||
switch key {
|
trimkey = strings.TrimPrefix(trimkey, "overlay.")
|
||||||
case ".override_kernel_check", "overlay.override_kernel_check", "overlay2.override_kernel_check":
|
trimkey = strings.TrimPrefix(trimkey, "overlay2.")
|
||||||
|
trimkey = strings.TrimPrefix(trimkey, ".")
|
||||||
|
switch trimkey {
|
||||||
|
case "override_kernel_check":
|
||||||
logrus.Warnf("overlay: override_kernel_check option was specified, but is no longer necessary")
|
logrus.Warnf("overlay: override_kernel_check option was specified, but is no longer necessary")
|
||||||
case ".mountopt", "overlay.mountopt", "overlay2.mountopt":
|
case "mountopt":
|
||||||
o.mountOptions = val
|
o.mountOptions = val
|
||||||
case ".size", "overlay.size", "overlay2.size":
|
case "size":
|
||||||
logrus.Debugf("overlay: size=%s", val)
|
logrus.Debugf("overlay: size=%s", val)
|
||||||
size, err := units.RAMInBytes(val)
|
size, err := units.RAMInBytes(val)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
o.quota.Size = uint64(size)
|
o.quota.Size = uint64(size)
|
||||||
case ".imagestore", "overlay.imagestore", "overlay2.imagestore":
|
case "imagestore", "additionalimagestore":
|
||||||
logrus.Debugf("overlay: imagestore=%s", val)
|
logrus.Debugf("overlay: imagestore=%s", val)
|
||||||
// Additional read only image stores to use for lower paths
|
// Additional read only image stores to use for lower paths
|
||||||
|
if val == "" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
for _, store := range strings.Split(val, ",") {
|
for _, store := range strings.Split(val, ",") {
|
||||||
store = filepath.Clean(store)
|
store = filepath.Clean(store)
|
||||||
if !filepath.IsAbs(store) {
|
if !filepath.IsAbs(store) {
|
||||||
@ -304,17 +310,17 @@ func parseOptions(options []string) (*overlayOptions, error) {
|
|||||||
}
|
}
|
||||||
o.imageStores = append(o.imageStores, store)
|
o.imageStores = append(o.imageStores, store)
|
||||||
}
|
}
|
||||||
case ".mount_program", "overlay.mount_program", "overlay2.mount_program":
|
case "mount_program":
|
||||||
logrus.Debugf("overlay: mount_program=%s", val)
|
logrus.Debugf("overlay: mount_program=%s", val)
|
||||||
_, err := os.Stat(val)
|
_, err := os.Stat(val)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("overlay: can't stat program %s: %v", val, err)
|
return nil, fmt.Errorf("overlay: can't stat program %s: %v", val, err)
|
||||||
}
|
}
|
||||||
o.mountProgram = val
|
o.mountProgram = val
|
||||||
case "overlay2.skip_mount_home", "overlay.skip_mount_home", ".skip_mount_home":
|
case "skip_mount_home":
|
||||||
logrus.Debugf("overlay: skip_mount_home=%s", val)
|
logrus.Debugf("overlay: skip_mount_home=%s", val)
|
||||||
o.skipMountHome, err = strconv.ParseBool(val)
|
o.skipMountHome, err = strconv.ParseBool(val)
|
||||||
case ".ignore_chown_errors", "overlay2.ignore_chown_errors", "overlay.ignore_chown_errors":
|
case "ignore_chown_errors":
|
||||||
logrus.Debugf("overlay: ignore_chown_errors=%s", val)
|
logrus.Debugf("overlay: ignore_chown_errors=%s", val)
|
||||||
o.ignoreChownErrors, err = strconv.ParseBool(val)
|
o.ignoreChownErrors, err = strconv.ParseBool(val)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
6
vendor/github.com/containers/storage/go.mod
generated
vendored
6
vendor/github.com/containers/storage/go.mod
generated
vendored
@ -1,3 +1,5 @@
|
|||||||
|
go 1.15
|
||||||
|
|
||||||
module github.com/containers/storage
|
module github.com/containers/storage
|
||||||
|
|
||||||
require (
|
require (
|
||||||
@ -6,7 +8,7 @@ require (
|
|||||||
github.com/Microsoft/hcsshim v0.8.9
|
github.com/Microsoft/hcsshim v0.8.9
|
||||||
github.com/docker/go-units v0.4.0
|
github.com/docker/go-units v0.4.0
|
||||||
github.com/hashicorp/go-multierror v1.1.0
|
github.com/hashicorp/go-multierror v1.1.0
|
||||||
github.com/klauspost/compress v1.10.10
|
github.com/klauspost/compress v1.10.11
|
||||||
github.com/klauspost/pgzip v1.2.4
|
github.com/klauspost/pgzip v1.2.4
|
||||||
github.com/mattn/go-shellwords v1.0.10
|
github.com/mattn/go-shellwords v1.0.10
|
||||||
github.com/mistifyio/go-zfs v2.1.1+incompatible
|
github.com/mistifyio/go-zfs v2.1.1+incompatible
|
||||||
@ -25,5 +27,3 @@ require (
|
|||||||
golang.org/x/sys v0.0.0-20200327173247-9dae0f8f5775
|
golang.org/x/sys v0.0.0-20200327173247-9dae0f8f5775
|
||||||
gotest.tools v2.2.0+incompatible
|
gotest.tools v2.2.0+incompatible
|
||||||
)
|
)
|
||||||
|
|
||||||
go 1.13
|
|
||||||
|
4
vendor/github.com/containers/storage/go.sum
generated
vendored
4
vendor/github.com/containers/storage/go.sum
generated
vendored
@ -62,8 +62,8 @@ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ
|
|||||||
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
|
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
|
||||||
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
|
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
|
||||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||||
github.com/klauspost/compress v1.10.10 h1:a/y8CglcM7gLGYmlbP/stPE5sR3hbhFRUjCBfd/0B3I=
|
github.com/klauspost/compress v1.10.11 h1:K9z59aO18Aywg2b/WSgBaUX99mHy2BES18Cr5lBKZHk=
|
||||||
github.com/klauspost/compress v1.10.10/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
|
github.com/klauspost/compress v1.10.11/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
|
||||||
github.com/klauspost/pgzip v1.2.4 h1:TQ7CNpYKovDOmqzRHKxJh0BeaBI7UdQZYc6p7pMQh1A=
|
github.com/klauspost/pgzip v1.2.4 h1:TQ7CNpYKovDOmqzRHKxJh0BeaBI7UdQZYc6p7pMQh1A=
|
||||||
github.com/klauspost/pgzip v1.2.4/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs=
|
github.com/klauspost/pgzip v1.2.4/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs=
|
||||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||||
|
3
vendor/github.com/containers/storage/store.go
generated
vendored
3
vendor/github.com/containers/storage/store.go
generated
vendored
@ -2630,6 +2630,9 @@ func (s *store) mount(id string, options drivers.MountOpts) (string, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
s.graphLock.Lock()
|
||||||
|
defer s.graphLock.Unlock()
|
||||||
rlstore.Lock()
|
rlstore.Lock()
|
||||||
defer rlstore.Unlock()
|
defer rlstore.Unlock()
|
||||||
if modified, err := rlstore.Modified(); modified || err != nil {
|
if modified, err := rlstore.Modified(); modified || err != nil {
|
||||||
|
13
vendor/github.com/klauspost/compress/huff0/bitwriter.go
generated
vendored
13
vendor/github.com/klauspost/compress/huff0/bitwriter.go
generated
vendored
@ -43,6 +43,11 @@ func (b *bitWriter) addBits16Clean(value uint16, bits uint8) {
|
|||||||
func (b *bitWriter) encSymbol(ct cTable, symbol byte) {
|
func (b *bitWriter) encSymbol(ct cTable, symbol byte) {
|
||||||
enc := ct[symbol]
|
enc := ct[symbol]
|
||||||
b.bitContainer |= uint64(enc.val) << (b.nBits & 63)
|
b.bitContainer |= uint64(enc.val) << (b.nBits & 63)
|
||||||
|
if false {
|
||||||
|
if enc.nBits == 0 {
|
||||||
|
panic("nbits 0")
|
||||||
|
}
|
||||||
|
}
|
||||||
b.nBits += enc.nBits
|
b.nBits += enc.nBits
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,6 +59,14 @@ func (b *bitWriter) encTwoSymbols(ct cTable, av, bv byte) {
|
|||||||
sh := b.nBits & 63
|
sh := b.nBits & 63
|
||||||
combined := uint64(encA.val) | (uint64(encB.val) << (encA.nBits & 63))
|
combined := uint64(encA.val) | (uint64(encB.val) << (encA.nBits & 63))
|
||||||
b.bitContainer |= combined << sh
|
b.bitContainer |= combined << sh
|
||||||
|
if false {
|
||||||
|
if encA.nBits == 0 {
|
||||||
|
panic("nbitsA 0")
|
||||||
|
}
|
||||||
|
if encB.nBits == 0 {
|
||||||
|
panic("nbitsB 0")
|
||||||
|
}
|
||||||
|
}
|
||||||
b.nBits += encA.nBits + encB.nBits
|
b.nBits += encA.nBits + encB.nBits
|
||||||
}
|
}
|
||||||
|
|
||||||
|
10
vendor/github.com/klauspost/compress/huff0/compress.go
generated
vendored
10
vendor/github.com/klauspost/compress/huff0/compress.go
generated
vendored
@ -77,8 +77,11 @@ func compress(in []byte, s *Scratch, compressor func(src []byte) ([]byte, error)
|
|||||||
// Each symbol present maximum once or too well distributed.
|
// Each symbol present maximum once or too well distributed.
|
||||||
return nil, false, ErrIncompressible
|
return nil, false, ErrIncompressible
|
||||||
}
|
}
|
||||||
|
if s.Reuse == ReusePolicyMust && !canReuse {
|
||||||
if s.Reuse == ReusePolicyPrefer && canReuse {
|
// We must reuse, but we can't.
|
||||||
|
return nil, false, ErrIncompressible
|
||||||
|
}
|
||||||
|
if (s.Reuse == ReusePolicyPrefer || s.Reuse == ReusePolicyMust) && canReuse {
|
||||||
keepTable := s.cTable
|
keepTable := s.cTable
|
||||||
keepTL := s.actualTableLog
|
keepTL := s.actualTableLog
|
||||||
s.cTable = s.prevTable
|
s.cTable = s.prevTable
|
||||||
@ -90,6 +93,9 @@ func compress(in []byte, s *Scratch, compressor func(src []byte) ([]byte, error)
|
|||||||
s.OutData = s.Out
|
s.OutData = s.Out
|
||||||
return s.Out, true, nil
|
return s.Out, true, nil
|
||||||
}
|
}
|
||||||
|
if s.Reuse == ReusePolicyMust {
|
||||||
|
return nil, false, ErrIncompressible
|
||||||
|
}
|
||||||
// Do not attempt to re-use later.
|
// Do not attempt to re-use later.
|
||||||
s.prevTable = s.prevTable[:0]
|
s.prevTable = s.prevTable[:0]
|
||||||
}
|
}
|
||||||
|
24
vendor/github.com/klauspost/compress/huff0/decompress.go
generated
vendored
24
vendor/github.com/klauspost/compress/huff0/decompress.go
generated
vendored
@ -32,7 +32,7 @@ const use8BitTables = true
|
|||||||
// The size of the input may be larger than the table definition.
|
// The size of the input may be larger than the table definition.
|
||||||
// Any content remaining after the table definition will be returned.
|
// Any content remaining after the table definition will be returned.
|
||||||
// If no Scratch is provided a new one is allocated.
|
// If no Scratch is provided a new one is allocated.
|
||||||
// The returned Scratch can be used for decoding input using this table.
|
// The returned Scratch can be used for encoding or decoding input using this table.
|
||||||
func ReadTable(in []byte, s *Scratch) (s2 *Scratch, remain []byte, err error) {
|
func ReadTable(in []byte, s *Scratch) (s2 *Scratch, remain []byte, err error) {
|
||||||
s, err = s.prepare(in)
|
s, err = s.prepare(in)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -58,8 +58,8 @@ func ReadTable(in []byte, s *Scratch) (s2 *Scratch, remain []byte, err error) {
|
|||||||
s.symbolLen = uint16(oSize)
|
s.symbolLen = uint16(oSize)
|
||||||
in = in[iSize:]
|
in = in[iSize:]
|
||||||
} else {
|
} else {
|
||||||
if len(in) <= int(iSize) {
|
if len(in) < int(iSize) {
|
||||||
return s, nil, errors.New("input too small for table")
|
return s, nil, fmt.Errorf("input too small for table, want %d bytes, have %d", iSize, len(in))
|
||||||
}
|
}
|
||||||
// FSE compressed weights
|
// FSE compressed weights
|
||||||
s.fse.DecompressLimit = 255
|
s.fse.DecompressLimit = 255
|
||||||
@ -138,15 +138,33 @@ func ReadTable(in []byte, s *Scratch) (s2 *Scratch, remain []byte, err error) {
|
|||||||
if len(s.dt.single) != tSize {
|
if len(s.dt.single) != tSize {
|
||||||
s.dt.single = make([]dEntrySingle, tSize)
|
s.dt.single = make([]dEntrySingle, tSize)
|
||||||
}
|
}
|
||||||
|
cTable := s.prevTable
|
||||||
|
if cap(cTable) < maxSymbolValue+1 {
|
||||||
|
cTable = make([]cTableEntry, 0, maxSymbolValue+1)
|
||||||
|
}
|
||||||
|
cTable = cTable[:maxSymbolValue+1]
|
||||||
|
s.prevTable = cTable[:s.symbolLen]
|
||||||
|
s.prevTableLog = s.actualTableLog
|
||||||
|
|
||||||
for n, w := range s.huffWeight[:s.symbolLen] {
|
for n, w := range s.huffWeight[:s.symbolLen] {
|
||||||
if w == 0 {
|
if w == 0 {
|
||||||
|
cTable[n] = cTableEntry{
|
||||||
|
val: 0,
|
||||||
|
nBits: 0,
|
||||||
|
}
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
length := (uint32(1) << w) >> 1
|
length := (uint32(1) << w) >> 1
|
||||||
d := dEntrySingle{
|
d := dEntrySingle{
|
||||||
entry: uint16(s.actualTableLog+1-w) | (uint16(n) << 8),
|
entry: uint16(s.actualTableLog+1-w) | (uint16(n) << 8),
|
||||||
}
|
}
|
||||||
|
|
||||||
rank := &rankStats[w]
|
rank := &rankStats[w]
|
||||||
|
cTable[n] = cTableEntry{
|
||||||
|
val: uint16(*rank >> (w - 1)),
|
||||||
|
nBits: uint8(d.entry),
|
||||||
|
}
|
||||||
|
|
||||||
single := s.dt.single[*rank : *rank+length]
|
single := s.dt.single[*rank : *rank+length]
|
||||||
for i := range single {
|
for i := range single {
|
||||||
single[i] = d
|
single[i] = d
|
||||||
|
3
vendor/github.com/klauspost/compress/huff0/huff0.go
generated
vendored
3
vendor/github.com/klauspost/compress/huff0/huff0.go
generated
vendored
@ -55,6 +55,9 @@ const (
|
|||||||
// ReusePolicyNone will disable re-use of tables.
|
// ReusePolicyNone will disable re-use of tables.
|
||||||
// This is slightly faster than ReusePolicyAllow but may produce larger output.
|
// This is slightly faster than ReusePolicyAllow but may produce larger output.
|
||||||
ReusePolicyNone
|
ReusePolicyNone
|
||||||
|
|
||||||
|
// ReusePolicyMust must allow reuse and produce smaller output.
|
||||||
|
ReusePolicyMust
|
||||||
)
|
)
|
||||||
|
|
||||||
type Scratch struct {
|
type Scratch struct {
|
||||||
|
8
vendor/github.com/klauspost/compress/zstd/blockenc.go
generated
vendored
8
vendor/github.com/klauspost/compress/zstd/blockenc.go
generated
vendored
@ -295,7 +295,7 @@ func (b *blockEnc) encodeRaw(a []byte) {
|
|||||||
b.output = bh.appendTo(b.output[:0])
|
b.output = bh.appendTo(b.output[:0])
|
||||||
b.output = append(b.output, a...)
|
b.output = append(b.output, a...)
|
||||||
if debug {
|
if debug {
|
||||||
println("Adding RAW block, length", len(a))
|
println("Adding RAW block, length", len(a), "last:", b.last)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -308,7 +308,7 @@ func (b *blockEnc) encodeRawTo(dst, src []byte) []byte {
|
|||||||
dst = bh.appendTo(dst)
|
dst = bh.appendTo(dst)
|
||||||
dst = append(dst, src...)
|
dst = append(dst, src...)
|
||||||
if debug {
|
if debug {
|
||||||
println("Adding RAW block, length", len(src))
|
println("Adding RAW block, length", len(src), "last:", b.last)
|
||||||
}
|
}
|
||||||
return dst
|
return dst
|
||||||
}
|
}
|
||||||
@ -322,7 +322,7 @@ func (b *blockEnc) encodeLits(raw bool) error {
|
|||||||
// Don't compress extremely small blocks
|
// Don't compress extremely small blocks
|
||||||
if len(b.literals) < 32 || raw {
|
if len(b.literals) < 32 || raw {
|
||||||
if debug {
|
if debug {
|
||||||
println("Adding RAW block, length", len(b.literals))
|
println("Adding RAW block, length", len(b.literals), "last:", b.last)
|
||||||
}
|
}
|
||||||
bh.setType(blockTypeRaw)
|
bh.setType(blockTypeRaw)
|
||||||
b.output = bh.appendTo(b.output)
|
b.output = bh.appendTo(b.output)
|
||||||
@ -349,7 +349,7 @@ func (b *blockEnc) encodeLits(raw bool) error {
|
|||||||
switch err {
|
switch err {
|
||||||
case huff0.ErrIncompressible:
|
case huff0.ErrIncompressible:
|
||||||
if debug {
|
if debug {
|
||||||
println("Adding RAW block, length", len(b.literals))
|
println("Adding RAW block, length", len(b.literals), "last:", b.last)
|
||||||
}
|
}
|
||||||
bh.setType(blockTypeRaw)
|
bh.setType(blockTypeRaw)
|
||||||
b.output = bh.appendTo(b.output)
|
b.output = bh.appendTo(b.output)
|
||||||
|
1
vendor/github.com/klauspost/compress/zstd/encoder.go
generated
vendored
1
vendor/github.com/klauspost/compress/zstd/encoder.go
generated
vendored
@ -190,6 +190,7 @@ func (e *Encoder) nextBlock(final bool) error {
|
|||||||
s.filling = s.filling[:0]
|
s.filling = s.filling[:0]
|
||||||
s.headerWritten = true
|
s.headerWritten = true
|
||||||
s.fullFrameWritten = true
|
s.fullFrameWritten = true
|
||||||
|
s.eofWritten = true
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
4
vendor/modules.txt
vendored
4
vendor/modules.txt
vendored
@ -156,7 +156,7 @@ github.com/containers/psgo/internal/dev
|
|||||||
github.com/containers/psgo/internal/host
|
github.com/containers/psgo/internal/host
|
||||||
github.com/containers/psgo/internal/proc
|
github.com/containers/psgo/internal/proc
|
||||||
github.com/containers/psgo/internal/process
|
github.com/containers/psgo/internal/process
|
||||||
# github.com/containers/storage v1.23.0
|
# github.com/containers/storage v1.23.2
|
||||||
github.com/containers/storage
|
github.com/containers/storage
|
||||||
github.com/containers/storage/drivers
|
github.com/containers/storage/drivers
|
||||||
github.com/containers/storage/drivers/aufs
|
github.com/containers/storage/drivers/aufs
|
||||||
@ -325,7 +325,7 @@ github.com/inconshreveable/mousetrap
|
|||||||
github.com/ishidawataru/sctp
|
github.com/ishidawataru/sctp
|
||||||
# github.com/json-iterator/go v1.1.10
|
# github.com/json-iterator/go v1.1.10
|
||||||
github.com/json-iterator/go
|
github.com/json-iterator/go
|
||||||
# github.com/klauspost/compress v1.10.10
|
# github.com/klauspost/compress v1.10.11
|
||||||
github.com/klauspost/compress/flate
|
github.com/klauspost/compress/flate
|
||||||
github.com/klauspost/compress/fse
|
github.com/klauspost/compress/fse
|
||||||
github.com/klauspost/compress/huff0
|
github.com/klauspost/compress/huff0
|
||||||
|
Reference in New Issue
Block a user