mirror of
https://github.com/minio/minio.git
synced 2025-11-21 10:16:03 -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
@@ -207,29 +207,18 @@ func (f *retryStorage) ReadAll(volume, path string) (buf []byte, err error) {
|
||||
}
|
||||
|
||||
// ReadFile - a retryable implementation of reading at offset from a file.
|
||||
func (f *retryStorage) ReadFile(volume, path string, offset int64, buffer []byte) (m int64, err error) {
|
||||
func (f *retryStorage) ReadFile(volume, path string, offset int64, buffer []byte, verifier *BitrotVerifier) (m int64, err error) {
|
||||
if f.IsOffline() {
|
||||
return m, errDiskNotFound
|
||||
}
|
||||
m, err = f.remoteStorage.ReadFile(volume, path, offset, buffer)
|
||||
m, err = f.remoteStorage.ReadFile(volume, path, offset, buffer, verifier)
|
||||
if f.reInitUponDiskNotFound(err) {
|
||||
m, err = f.remoteStorage.ReadFile(volume, path, offset, buffer)
|
||||
m, err = f.remoteStorage.ReadFile(volume, path, offset, buffer, verifier)
|
||||
return m, retryToStorageErr(err)
|
||||
}
|
||||
return m, retryToStorageErr(err)
|
||||
}
|
||||
|
||||
// ReadFileWithVerify - a retryable implementation of reading at
|
||||
// offset from a file with verification.
|
||||
func (f retryStorage) ReadFileWithVerify(volume, path string, offset int64, buffer []byte, verifier *BitrotVerifier) (m int64, err error) {
|
||||
|
||||
m, err = f.remoteStorage.ReadFileWithVerify(volume, path, offset, buffer, verifier)
|
||||
if f.reInitUponDiskNotFound(err) {
|
||||
m, err = f.remoteStorage.ReadFileWithVerify(volume, path, offset, buffer, verifier)
|
||||
}
|
||||
return m, retryToStorageErr(err)
|
||||
}
|
||||
|
||||
// ListDir - a retryable implementation of listing directory entries.
|
||||
func (f *retryStorage) ListDir(volume, path string) (entries []string, err error) {
|
||||
if f.IsOffline() {
|
||||
|
||||
Reference in New Issue
Block a user