From 5a9302bab9c9bb3d1577f04678d074fb7af4115f Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Wed, 15 May 2024 08:49:56 +0200 Subject: Add fsetxattr(), fremovexattr(), open_by_handle_at(), and "virtiofsd demo" Mostly assorted fixes, a new FDGET operation (get a copy of the target file descriptor via pidfd_getfd()) and a new "FD" flag that means we have to do that on direct tag reference. Signed-off-by: Stefano Brivio --- common/gluten.h | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) (limited to 'common/gluten.h') diff --git a/common/gluten.h b/common/gluten.h index 1414d9e..d06362a 100644 --- a/common/gluten.h +++ b/common/gluten.h @@ -21,10 +21,10 @@ extern struct seccomp_data anonymous_seccomp_data; -#define HEADER_SIZE 65536 -#define INST_SIZE 65536 -#define RO_DATA_SIZE 65536 -#define DATA_SIZE 65536 +#define HEADER_SIZE (1 << 20) +#define INST_SIZE (1 << 20) +#define RO_DATA_SIZE (1 << 20) +#define DATA_SIZE (1 << 20) #define INST_MAX 256 #define OFFSET_MAX \ @@ -67,13 +67,14 @@ enum op_type { OP_CALL, OP_COPY, OP_FD, + OP_FDGET, OP_RETURN, OP_LOAD, OP_STORE, OP_IOVLOAD, OP_BITWISE, OP_CMP, - OP_RESOLVEDFD, + OP_RESOLVEFD, }; /** @@ -199,6 +200,11 @@ struct op_fd { struct gluten_offset desc; /* struct fd_desc */ }; +struct op_fdget { + struct gluten_offset src; + struct gluten_offset dst; +}; + struct op_load { struct gluten_offset src; struct gluten_offset dst; @@ -261,14 +267,23 @@ struct op_bitwise { struct gluten_offset desc; /* struct bitwise_desc */ }; +enum resolvefd_type { + RESOLVEFD_PATH, + RESOLVEFD_MOUNT, + RESOLVEFD_MAX = RESOLVEFD_MOUNT, +}; + +extern const char *resolvefd_type_str[RESOLVEFD_MAX + 1]; + struct resolvefd_desc { - struct gluten_offset fd; - struct gluten_offset path; - size_t path_max; + struct gluten_offset fd; + struct gluten_offset path; + enum resolvefd_type type; + size_t path_max; }; struct op_resolvefd { - struct gluten_offset desc; + struct gluten_offset desc; /* struct resolvefd_desc */ }; struct op_copy { @@ -284,6 +299,7 @@ struct op { struct op_call call; struct op_return ret; struct op_fd fd; + struct op_fdget fdget; struct op_load load; struct op_store store; struct op_iovload iovload; -- cgit v1.2.3