On Thu, Nov 02, 2023 at 07:07:25PM +0100, Stefano Brivio wrote:
On Thu, 5 Oct 2023 14:44:40 +1100 David Gibson
wrote: Most of our helpers which need to enter the pasta network namespace are quite specialised. Add one which is rather general - it just open()s a given file in the namespace context and returns the fd back to the main namespace. This will have some future uses.
Signed-off-by: David Gibson
--- util.c | 39 +++++++++++++++++++++++++++++++++++++++ util.h | 1 + 2 files changed, 40 insertions(+) diff --git a/util.c b/util.c index a8f3b35..92ad375 100644 --- a/util.c +++ b/util.c @@ -364,6 +364,45 @@ bool ns_is_init(void) return ret; }
+struct open_in_ns_args {
It would be nice to have the usual kerneldoc-style comment to this (at a first reading: are "flags" the flags for open(2) or something specialised for internal use?).
+ const struct ctx *c; + int fd; + int err; + const char *path; + int flags; +}; + +static int do_open_in_ns(void *arg)
Same for this one.
Eh, ok. I left it out originally, because they both seemed like they were essentially internals of open_in_ns() itself, but I've added them now.
The rest of the series makes sense and looks good to me.
-- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson