mirror of
https://github.com/minio/minio.git
synced 2025-11-09 21:49:46 -05:00
Lock free multipart backend implementation for FS (#5401)
This commit is contained in:
committed by
kannappanr
parent
018813b98f
commit
3b2486ebaf
@@ -90,3 +90,8 @@ func TryLockedOpenFile(path string, flag int, perm os.FileMode) (*LockedFile, er
|
||||
func LockedOpenFile(path string, flag int, perm os.FileMode) (*LockedFile, error) {
|
||||
return lockedOpenFile(path, flag, perm, 0)
|
||||
}
|
||||
|
||||
// Open - Call os.OpenFile
|
||||
func Open(path string, flag int, perm os.FileMode) (*os.File, error) {
|
||||
return os.OpenFile(path, flag, perm)
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ const (
|
||||
|
||||
// lockedOpenFile is an internal function.
|
||||
func lockedOpenFile(path string, flag int, perm os.FileMode, lockType uint32) (*LockedFile, error) {
|
||||
f, err := open(path, flag, perm)
|
||||
f, err := Open(path, flag, perm)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -168,7 +168,7 @@ func fixLongPath(path string) string {
|
||||
// perm param is ignored, on windows file perms/NT acls
|
||||
// are not octet combinations. Providing access to NT
|
||||
// acls is out of scope here.
|
||||
func open(path string, flag int, perm os.FileMode) (*os.File, error) {
|
||||
func Open(path string, flag int, perm os.FileMode) (*os.File, error) {
|
||||
if path == "" {
|
||||
return nil, syscall.ERROR_FILE_NOT_FOUND
|
||||
}
|
||||
@@ -190,6 +190,8 @@ func open(path string, flag int, perm os.FileMode) (*os.File, error) {
|
||||
fallthrough
|
||||
case syscall.O_WRONLY | syscall.O_CREAT:
|
||||
access = syscall.GENERIC_READ | syscall.GENERIC_WRITE
|
||||
case syscall.O_WRONLY | syscall.O_CREAT | syscall.O_APPEND:
|
||||
access = syscall.FILE_APPEND_DATA
|
||||
default:
|
||||
return nil, fmt.Errorf("Unsupported flag (%d)", flag)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user