xen/hypfs: add new enter() and exit() per node callbacks
authorJuergen Gross <jgross@suse.com>
Thu, 17 Dec 2020 15:50:21 +0000 (16:50 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 17 Dec 2020 15:50:21 +0000 (16:50 +0100)
commit641723f78d3a0b1982e1cd2ef37d8d877cfe542d
tree22747c9c2b1350074383c702527f4cca83c43a12
parentfbb2b92de0782b4ea183377e014d941fbec0bab7
xen/hypfs: add new enter() and exit() per node callbacks

In order to better support resource allocation and locking for dynamic
hypfs nodes add enter() and exit() callbacks to struct hypfs_funcs.

The enter() callback is called when entering a node during hypfs user
actions (traversing, reading or writing it), while the exit() callback
is called when leaving a node (accessing another node at the same or a
higher directory level, or when returning to the user).

For avoiding recursion this requires a parent pointer in each node.
Let the enter() callback return the entry address which is stored as
the last accessed node in order to be able to use a template entry for
that purpose in case of dynamic entries.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/common/hypfs.c
xen/include/xen/hypfs.h