freebsd-dev/sys/fs
Konstantin Belousov 081e36e760 Add tmpfs page cache read support.
Or it could be explained as lockless (for vnode lock) reads.  Reads
are performed from the node tn_obj object.  Tmpfs regular vnode object
lifecycle is significantly different from the normal OBJT_VNODE: it is
alive as far as ref_count > 0.

Ensure liveness of the tmpfs VREG node and consequently v_object
inside VOP_READ_PGCACHE by referencing tmpfs node in tmpfs_open().
Provide custom tmpfs fo_close() method on file, to ensure that close
is paired with open.

Add tmpfs VOP_READ_PGCACHE that takes advantage of all tmpfs quirks.
It is quite cheap in code size sense to support page-ins for read for
tmpfs even if we do not own tmpfs vnode lock.  Also, we can handle
holes in tmpfs node without additional efforts, and do not have
limitation of the transfer size.

Reviewed by:	markj
Discussed with and benchmarked by:	mjg (previous version)
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D26346
2020-09-15 22:19:16 +00:00
..
autofs fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
cd9660 fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
cuse fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
deadfs vfs: flatten vop vectors 2019-12-16 00:06:22 +00:00
devfs fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
ext2fs fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
fdescfs fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
fifofs fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
fuse fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
mntfs Add a new "mntfs" pseudo file system which provides private device vnodes for 2020-03-06 18:41:37 +00:00
msdosfs fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
nfs Do not copy vp into f_data for DTYPE_VNODE files. 2020-09-15 21:55:21 +00:00
nfsclient fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
nfsserver Fix a case where the NFSv4.0 server might crash if delegations are enabled. 2020-09-14 00:44:50 +00:00
nullfs fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
procfs fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
pseudofs vfs: remove the thread argument from vget 2020-08-16 17:18:54 +00:00
smbfs fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
tmpfs Add tmpfs page cache read support. 2020-09-15 22:19:16 +00:00
udf fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
unionfs fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00