diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2024-05-15 08:49:56 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2024-05-15 08:49:56 +0200 |
commit | 5a9302bab9c9bb3d1577f04678d074fb7af4115f (patch) | |
tree | 21d04573dfa733e020315d08853c00fc119fb959 /cooker/call.c | |
parent | bdbec30a849807fb5e6841a38cfe0d168e5962b9 (diff) | |
download | seitan-5a9302bab9c9bb3d1577f04678d074fb7af4115f.tar seitan-5a9302bab9c9bb3d1577f04678d074fb7af4115f.tar.gz seitan-5a9302bab9c9bb3d1577f04678d074fb7af4115f.tar.bz2 seitan-5a9302bab9c9bb3d1577f04678d074fb7af4115f.tar.lz seitan-5a9302bab9c9bb3d1577f04678d074fb7af4115f.tar.xz seitan-5a9302bab9c9bb3d1577f04678d074fb7af4115f.tar.zst seitan-5a9302bab9c9bb3d1577f04678d074fb7af4115f.zip |
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 <sbrivio@redhat.com>
Diffstat (limited to 'cooker/call.c')
-rw-r--r-- | cooker/call.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/cooker/call.c b/cooker/call.c index dd37fe9..dbdc52b 100644 --- a/cooker/call.c +++ b/cooker/call.c @@ -72,7 +72,9 @@ static union value parse_metadata(struct gluten_ctx *g, struct field *f, if (tag_offset.type == OFFSET_NULL) die(" tag not found"); - if ((*base_offset)->type == OFFSET_NULL || (f->flags & WBUF)) { + if (f->flags & FD) { + emit_fdget(g, tag_offset, offset); + } else if ((*base_offset)->type == OFFSET_NULL || (f->flags & WBUF)) { **base_offset = tag_offset; } else if (f->flags & MASK || add) { emit_bitwise(g, f->type, BITWISE_OR, offset, offset, @@ -374,6 +376,7 @@ bool arg_needs_temp(struct field *f, int pos, JSON_Value *jvalue, return false; case FDPATH: + case FDMOUNT: case STRING: return false; case STRUCT: @@ -433,7 +436,8 @@ static void parse_call(struct gluten_ctx *g, struct context_desc *cdesc, struct gluten_offset offset[6] = { 0 }, ret_offset = { 0 }; bool is_ptr[6] = { false }; /* Minimum requirements for argument specification: - * - if argument can be FDPATH, exactly one value for that position + * - if argument can be FDPATH/FDMOUNT, exactly one value for that + * position * - if argument is a size field, value is optional * - otherwise, every argument needs to be specified */ @@ -459,7 +463,7 @@ static void parse_call(struct gluten_ctx *g, struct context_desc *cdesc, arg_check[a->pos].multi_field = true; arg_check[a->pos].found = true; - if (a->f.type == FDPATH) + if (a->f.type == FDPATH || a->f.type == FDMOUNT) arg_check[a->pos].needs_fd = true; if (a->f.size) |