mirror of https://github.com/minio/minio.git
when o_direct is disabled do not attempt fadvise call (#14230)
This commit is contained in:
parent
67d07e895c
commit
24657859a8
|
@ -1715,7 +1715,11 @@ func (s *xlStorage) ReadFileStream(ctx context.Context, volume, path string, off
|
|||
}{Reader: io.LimitReader(or, length), Closer: closeWrapper(func() error {
|
||||
if !alignment || offset+length%xioutil.DirectioAlignSize != 0 {
|
||||
// invalidate page-cache for unaligned reads.
|
||||
disk.FadviseDontNeed(file)
|
||||
if !globalAPIConfig.isDisableODirect() {
|
||||
// skip removing from page-cache only
|
||||
// if O_DIRECT was disabled.
|
||||
disk.FadviseDontNeed(file)
|
||||
}
|
||||
}
|
||||
return or.Close()
|
||||
})}
|
||||
|
|
Loading…
Reference in New Issue