Re: [PATCH v2 09/17] xen/hypfs: move per-node function pointers into a dedicated struct

2020-12-03 Thread Jürgen Groß
On 03.12.20 10:12, Jan Beulich wrote: On 03.12.2020 09:47, Jürgen Groß wrote: On 02.12.20 16:36, Jan Beulich wrote: On 01.12.2020 09:21, Juergen Gross wrote: static int hypfs_write(struct hypfs_entry *entry, XEN_GUEST_HANDLE_PARAM(void) uaddr, unsigned long ulen)

Re: [PATCH v2 09/17] xen/hypfs: move per-node function pointers into a dedicated struct

2020-12-03 Thread Jan Beulich
On 03.12.2020 09:47, Jürgen Groß wrote: > On 02.12.20 16:36, Jan Beulich wrote: >> On 01.12.2020 09:21, Juergen Gross wrote: >>> static int hypfs_write(struct hypfs_entry *entry, >>> XEN_GUEST_HANDLE_PARAM(void) uaddr, unsigned long >>> ulen) >> >> As a tangent, is there

Re: [PATCH v2 09/17] xen/hypfs: move per-node function pointers into a dedicated struct

2020-12-03 Thread Jürgen Groß
On 02.12.20 16:36, Jan Beulich wrote: On 01.12.2020 09:21, Juergen Gross wrote: static int hypfs_write(struct hypfs_entry *entry, XEN_GUEST_HANDLE_PARAM(void) uaddr, unsigned long ulen) As a tangent, is there a reason these write functions don't take handles of "cons

Re: [PATCH v2 09/17] xen/hypfs: move per-node function pointers into a dedicated struct

2020-12-02 Thread Jürgen Groß
On 02.12.20 16:36, Jan Beulich wrote: On 01.12.2020 09:21, Juergen Gross wrote: @@ -297,6 +321,7 @@ int hypfs_write_leaf(struct hypfs_entry_leaf *leaf, int ret; ASSERT(this_cpu(hypfs_locked) == hypfs_write_locked); +ASSERT(leaf->e.max_size); if ( ulen > leaf->e.max_s

Re: [PATCH v2 09/17] xen/hypfs: move per-node function pointers into a dedicated struct

2020-12-02 Thread Jan Beulich
On 01.12.2020 09:21, Juergen Gross wrote: > @@ -297,6 +321,7 @@ int hypfs_write_leaf(struct hypfs_entry_leaf *leaf, > int ret; > > ASSERT(this_cpu(hypfs_locked) == hypfs_write_locked); > +ASSERT(leaf->e.max_size); > > if ( ulen > leaf->e.max_size ) > return -ENOSPC;

[PATCH v2 09/17] xen/hypfs: move per-node function pointers into a dedicated struct

2020-12-01 Thread Juergen Gross
Move the function pointers currently stored in each hypfs node into a dedicated structure in order to save some space for each node. This will save even more space with additional callbacks added in future. Provide some standard function vectors. Instead of testing the write pointer to be not NUL