Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

442 B
Raw Blame
//go:build linux

package util

import "golang.org/x/sys/unix"

// DropOSPageCache advises the kernel that the given byte range is no longer
// needed in the page cache. This is useful after reading from a user-space
// cache (e.g., on-disk chunk cache) to prevent the kernel from double-caching
// the same data.
func DropOSPageCache(fd int, offset int64, length int64) error {
	return unix.Fadvise(fd, offset, length, unix.FADV_DONTNEED)
}