zfs: remove fake struct file definition

We have an strange and incorrect 'struct file' definition for zfs, but
a forward declaration is all that is needed.

Remove the unsafe definition.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
vfs_syscalls.c: convert to C++

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Add helper for converting designated initializers to C++

Unfortunately, C++ does not support designated initializers.  Add a function
that helps fill their place.

Use example:

-static struct netisr_handler ether_nh = {
-       .nh_name = "ether",
-       .nh_handler = ether_nh_input,
-       .nh_proto = NETISR_ETHER,
-       .nh_policy = NETISR_POLICY_SOURCE,
-       .nh_dispatch = NETISR_DISPATCH_DIRECT,
-};
+static netisr_handler ether_nh = initialize_with([] (netisr_handler& x) {
+       x.nh_name = "ether";
+       x.nh_handler = ether_nh_input;
+       x.nh_proto = NETISR_ETHER;
+       x.nh_policy = NETISR_POLICY_SOURCE;
+       x.nh_dispatch = NETISR_DISPATCH_DIRECT;
+});

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
vfs_fops.c: convert to C++

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
ramfs_vnops: convert to C++

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
devfs_vnops: convert to C++

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
file: move file operations out-of-line

In preparation for making 'file' a C++ type.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
socketpair: fix wierd initialization

socketpair() stores temporary data in the field they're going to be copied
into.

Use a local instead.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
file: add helpers for accessing fields

Needed for C++ conversion.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
file: make it a C++ type

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>