Lock free multipart backend implementation for FS (#5401)

This commit is contained in:
Krishna Srinivas
2018-01-31 13:17:24 -08:00
committed by kannappanr
parent 018813b98f
commit 3b2486ebaf
17 changed files with 668 additions and 1215 deletions

View File

@@ -23,6 +23,7 @@ import (
"runtime"
"github.com/minio/minio/pkg/errors"
"github.com/minio/minio/pkg/lock"
)
// Removes only the file at given path does not remove
@@ -266,7 +267,7 @@ func fsCreateFile(filePath string, reader io.Reader, buf []byte, fallocSize int6
return 0, errors.Trace(err)
}
writer, err := os.OpenFile((filePath), os.O_CREATE|os.O_WRONLY, 0666)
writer, err := lock.Open(filePath, os.O_CREATE|os.O_WRONLY, 0666)
if err != nil {
return 0, osErrToFSFileErr(err)
}
@@ -291,6 +292,7 @@ func fsCreateFile(filePath string, reader io.Reader, buf []byte, fallocSize int6
return 0, errors.Trace(err)
}
}
return bytesWritten, nil
}