mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
remove rename2 entirely, avoids the risk of moving data (#19058)
This commit is contained in:
@@ -22,16 +22,8 @@ package cmd
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
// Rename2 captures time taken to call os.Rename
|
||||
func Rename2(src, dst string) (err error) {
|
||||
defer updateOSMetrics(osMetricRename2, src, dst)(err)
|
||||
return unix.Renameat2(unix.AT_FDCWD, src, unix.AT_FDCWD, dst, uint(2)) // RENAME_EXCHANGE from 'man renameat2'
|
||||
}
|
||||
|
||||
// RenameSys is low level call in case of Linux this uses syscall.Rename() directly.
|
||||
func RenameSys(src, dst string) (err error) {
|
||||
return syscall.Rename(src, dst)
|
||||
|
||||
Reference in New Issue
Block a user