mirror of
https://github.com/minio/minio.git
synced 2025-11-09 21:49:46 -05:00
remove ReadFileWithVerify from StorageAPI (#4947)
This change removes the ReadFileWithVerify function from the StorageAPI. The ReadFile was basically a redirection to ReadFileWithVerify. This change removes the redirection and moves the logic of ReadFileWithVerify directly into ReadFile. This removes a lot of unnecessary code in all StorageAPI implementations. Fixes #4946 * review: fix doc and typos
This commit is contained in:
committed by
Dee Koder
parent
4cadb33da2
commit
7e6b5bdbb7
@@ -40,8 +40,7 @@ type StorageAPI interface {
|
||||
|
||||
// File operations.
|
||||
ListDir(volume, dirPath string) ([]string, error)
|
||||
ReadFile(volume string, path string, offset int64, buf []byte) (n int64, err error)
|
||||
ReadFileWithVerify(volume string, path string, offset int64, buf []byte, verifier *BitrotVerifier) (n int64, err error)
|
||||
ReadFile(volume string, path string, offset int64, buf []byte, verifier *BitrotVerifier) (n int64, err error)
|
||||
PrepareFile(volume string, path string, len int64) (err error)
|
||||
AppendFile(volume string, path string, buf []byte) (err error)
|
||||
RenameFile(srcVolume, srcPath, dstVolume, dstPath string) error
|
||||
@@ -60,7 +59,7 @@ type storageReader struct {
|
||||
}
|
||||
|
||||
func (r *storageReader) Read(p []byte) (n int, err error) {
|
||||
nn, err := r.storage.ReadFile(r.volume, r.path, r.offset, p)
|
||||
nn, err := r.storage.ReadFile(r.volume, r.path, r.offset, p, nil)
|
||||
r.offset += nn
|
||||
n = int(nn)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user