gvisor/pkg/sentry/fs/ramfs
Michael Pratt 085a907565 Cache directory entries in the overlay
Currently, the overlay dirCache is only used for a single logical use of
getdents. i.e., it is discard when the FD is closed or seeked back to
the beginning.

But the initial work of getting the directory contents can be quite
expensive (particularly sorting large directories), so we should keep it
as long as possible.

This is very similar to the readdirCache in fs/gofer.

Since the upper filesystem does not have to allow caching readdir
entries, the new CacheReaddir MountSourceOperations method controls this
behavior.

This caching should be trivially movable to all Inodes if desired,
though that adds an additional copy step for non-overlay Inodes.
(Overlay Inodes already do the extra copy).

PiperOrigin-RevId: 255477592
2019-06-27 14:24:03 -07:00
..
BUILD Update canonical repository. 2019-06-13 16:50:15 -07:00
dir.go Cache directory entries in the overlay 2019-06-27 14:24:03 -07:00
socket.go Update canonical repository. 2019-06-13 16:50:15 -07:00
symlink.go Update canonical repository. 2019-06-13 16:50:15 -07:00
tree.go Plumb context through more layers of filesytem. 2019-06-13 18:40:38 -07:00
tree_test.go Plumb context through more layers of filesytem. 2019-06-13 18:40:38 -07:00