mirror of
https://github.com/minio/minio.git
synced 2026-02-04 18:00:15 -05:00
use O_DIRECT for all ReadFileStream (#13324)
This PR also removes #13312 to ensure that we can use a better mechanism to handle page-cache, using O_DIRECT even for Range GETs.
This commit is contained in:
@@ -41,14 +41,7 @@ func Fdatasync(f *os.File) error {
|
||||
return syscall.Fdatasync(int(f.Fd()))
|
||||
}
|
||||
|
||||
// fdavise advice constants
|
||||
const (
|
||||
FadvSequential = unix.FADV_SEQUENTIAL
|
||||
FadvNoReuse = unix.FADV_NOREUSE
|
||||
)
|
||||
|
||||
// Fadvise implements possibility of choosing
|
||||
// offset: 0, length: 0
|
||||
func Fadvise(f *os.File, advice int) error {
|
||||
return unix.Fadvise(int(f.Fd()), 0, 0, advice)
|
||||
// FadviseDontNeed invalidates page-cache
|
||||
func FadviseDontNeed(f *os.File) error {
|
||||
return unix.Fadvise(int(f.Fd()), 0, 0, unix.FADV_DONTNEED)
|
||||
}
|
||||
|
||||
@@ -30,14 +30,7 @@ func Fdatasync(f *os.File) error {
|
||||
return syscall.Fsync(int(f.Fd()))
|
||||
}
|
||||
|
||||
// fdavise advice constants
|
||||
const (
|
||||
FadvSequential = 0
|
||||
FadvNoReuse = 0
|
||||
)
|
||||
|
||||
// Fadvise implements possibility of choosing
|
||||
// offset: 0, length: 0
|
||||
func Fadvise(f *os.File, advice int) error {
|
||||
// FadviseDontNeed is a no-op
|
||||
func FadviseDontNeed(f *os.File) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -29,14 +29,7 @@ func Fdatasync(f *os.File) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// fdavise advice constants
|
||||
const (
|
||||
FadvSequential = 0
|
||||
FadvNoReuse = 0
|
||||
)
|
||||
|
||||
// Fadvise implements possibility of choosing
|
||||
// offset: 0, length: 0
|
||||
func Fadvise(f *os.File, advice int) error {
|
||||
// FadviseDontNeed is a no-op
|
||||
func FadviseDontNeed(f *os.File) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user