mirror of
https://github.com/minio/minio.git
synced 2025-12-08 08:42:43 -05:00
This change provides new implementations of the XL backend operations: - create file - read file - heal file Further this change adds table based tests for all three operations. This affects also the bitrot algorithm integration. Algorithms are now integrated in an idiomatic way (like crypto.Hash). Fixes #4696 Fixes #4649 Fixes #4359
This commit is contained in:
committed by
Dee Koder
parent
617f2394fb
commit
85fcee1919
@@ -262,8 +262,7 @@ func (n *networkStorage) ReadFile(volume string, path string, offset int64, buff
|
||||
}
|
||||
|
||||
// ReadFileWithVerify - reads a file at remote path and fills the buffer.
|
||||
func (n *networkStorage) ReadFileWithVerify(volume string, path string, offset int64,
|
||||
buffer []byte, algo HashAlgo, expectedHash string) (m int64, err error) {
|
||||
func (n *networkStorage) ReadFileWithVerify(volume string, path string, offset int64, buffer []byte, verifier *BitrotVerifier) (m int64, err error) {
|
||||
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
@@ -279,8 +278,8 @@ func (n *networkStorage) ReadFileWithVerify(volume string, path string, offset i
|
||||
Path: path,
|
||||
Offset: offset,
|
||||
Buffer: buffer,
|
||||
Algo: algo,
|
||||
ExpectedHash: expectedHash,
|
||||
Algo: verifier.algorithm,
|
||||
ExpectedHash: verifier.sum,
|
||||
}, &result)
|
||||
|
||||
// Copy results to buffer.
|
||||
|
||||
Reference in New Issue
Block a user