tmpfs: make vm_object point to the tmpfs node instead of vnode
authorKonstantin Belousov <kib@FreeBSD.org>
Thu, 20 Oct 2022 12:00:21 +0000 (15:00 +0300)
committerKonstantin Belousov <kib@FreeBSD.org>
Fri, 9 Dec 2022 12:15:37 +0000 (14:15 +0200)
commitd9dc64f1589360f2062ad92d63f69e13121e472a
treeadf09b224d4c015ebe963abbff9fa43fb22e0cf9
parentbaa1ccceefdf4954a88e54ca18c6ab1762faa326
tmpfs: make vm_object point to the tmpfs node instead of vnode

The vnode could be reclaimed and allocated again during the lifecycle of
the node, but the node cannot.  Also, referencing the node would allow
to reach it and tmpfs mount data from the object, regardless of the
state of the possibly absent vnode.

Still use swp_tmpfs for back-pointer, instead of using handle. Use of
named swap objects would incur taking the sw_alloc_sx on node allocation
and deallocation.

swp_tmpfs is renamed to swp_priv to remove the last bit of tmpfs in vm/.

Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D37097
sys/fs/tmpfs/tmpfs.h
sys/fs/tmpfs/tmpfs_subr.c
sys/fs/tmpfs/tmpfs_vfsops.c
sys/vm/vm_object.h