From nobody Tue Apr 7 18:47:01 2026 Received: from smtp03-ext2.udag.de (smtp03-ext2.udag.de [62.146.106.30]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AF0A736B04B; Thu, 26 Feb 2026 16:44:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.146.106.30 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772124249; cv=none; b=m513UhwYUpAnmr58cXJnibdKsiykYLo1mmpIKEhSWrTg13Z7Q79ECs1HvoQE53F5KWXONamITGmrWj27waEl/73AkdW3Pr+SYHh13pW6g3UmBxX6Ifzo+30jcWBDkczuO7LdaEhptgFYANPdjSeFRHtDBbofBbpj2j6XJO5ePgU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772124249; c=relaxed/simple; bh=0kzc9erjXODarwfpNMQnQ3iZ7a8L3MxgsLdlgnpU7Zo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=R4lX6qdg13DpFafV8Jljsd6j5A0R7q07LA/rz8sEpulEjSPX2oKOqaIajffuhYiaIqZxZZa2wC5Plgrr9rUsNbDLOWqQOR/QK14s5VHjBvFJYw/L8OYO9BtfVxSLMTPi6BsF7hEy7wmXSfoBNz+A4egC11h+elC7LlCzZJyN0z4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=birthelmer.com; spf=pass smtp.mailfrom=birthelmer.com; dkim=pass (2048-bit key) header.d=birthelmer.com header.i=@birthelmer.com header.b=DWRS2aar; arc=none smtp.client-ip=62.146.106.30 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=birthelmer.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=birthelmer.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=birthelmer.com header.i=@birthelmer.com header.b="DWRS2aar" Received: from fedora.fritz.box (200-143-067-156.ip-addr.inexio.net [156.67.143.200]) by smtp03-ext2.udag.de (Postfix) with ESMTPA id BE3BAE0360; Thu, 26 Feb 2026 17:43:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=birthelmer.com; s=uddkim-202310; t=1772124238; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eGydO6FwFqLLphmOSbDH/70Uh6txyr6vYs0h8O6bVb4=; b=DWRS2aarxCP7nUIvSpxjjkPMTtrJwZ5L8DydvWWkF0t0luLakoY82ZWQ4HY1teetm4GQCp JRN7gKy2fO4c6PBG6QrGJUnY+IuWwfBjz0KZjQUHEcurpoUkhB/3VyhrT48ldmMF8e0agl 1HddZcdwqtD1CYmauU6G4kHrRsxTw75eNwNDAMp6iO+eGvUZeMGp7HjyhAb/Bnl75ZgGbB Y3y6ORHf6ym60vdwk0JvSsvex0CtxyM0vQOSF0psXFMubJ5if6K8nSZEeHgJz/W8afZAS1 ZByQqJW5NNKqiiDQawZ37Oszy2SBbzuGuEVSIaVhEHE8DmZhh9N9PdIA4seQVQ== Authentication-Results: smtp03-ext2.udag.de; auth=pass smtp.auth=birthelmercom-0001 smtp.mailfrom=horst@birthelmer.com From: Horst Birthelmer Date: Thu, 26 Feb 2026 17:43:54 +0100 Subject: [PATCH v6 2/3] fuse: create helper functions for filling in fuse args for open and getattr Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260226-fuse-compounds-upstream-v6-2-8585c5fcd2fc@ddn.com> References: <20260226-fuse-compounds-upstream-v6-0-8585c5fcd2fc@ddn.com> In-Reply-To: <20260226-fuse-compounds-upstream-v6-0-8585c5fcd2fc@ddn.com> To: Miklos Szeredi , Bernd Schubert , Joanne Koong , Luis Henriques Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Horst Birthelmer X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1772124235; l=4228; i=hbirthelmer@ddn.com; s=20251006; h=from:subject:message-id; bh=fIrksBFbOfxzwmxEToaZUQ6D6sUY/NeffJ6fTnRgRhQ=; b=U7QVwGjdVV5qIwsDoRFOKdclptpzWtGK6qECtVOdXFZde0Vgzi2b95NZoOmTbqIdvlwZessfV VwZet4OemXwAQ5xQVEdVkJMx8Pc0SPZK4NwWPjvjGJ6GP4QLal35jT4 X-Developer-Key: i=hbirthelmer@ddn.com; a=ed25519; pk=v3BVDFoy16EzgHZ23ObqW+kbpURtjrwxgKu8YNDKjGg= From: Horst Birthelmer create fuse_getattr_args_fill() and fuse_open_args_fill() to fill in the parameters for the open and getattr calls. This is in preparation for implementing open+getattr and does not represent any functional change. Suggested-by: Joanne Koong Signed-off-by: Horst Birthelmer --- fs/fuse/dir.c | 26 ++++++++++++++++++-------- fs/fuse/file.c | 26 ++++++++++++++++++-------- fs/fuse/fuse_i.h | 6 ++++++ 3 files changed, 42 insertions(+), 16 deletions(-) diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 3927cb069236e9c52674301831c6d655397f24c5..e5ae033a15e85757a10a38b5e7d= 03dac86067c2a 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -1471,6 +1471,23 @@ static int fuse_do_statx(struct mnt_idmap *idmap, st= ruct inode *inode, return 0; } =20 +/* + * Helper function to initialize fuse_args for GETATTR operations + */ +void fuse_getattr_args_fill(struct fuse_args *args, u64 nodeid, + struct fuse_getattr_in *inarg, + struct fuse_attr_out *outarg) +{ + args->opcode =3D FUSE_GETATTR; + args->nodeid =3D nodeid; + args->in_numargs =3D 1; + args->in_args[0].size =3D sizeof(*inarg); + args->in_args[0].value =3D inarg; + args->out_numargs =3D 1; + args->out_args[0].size =3D sizeof(*outarg); + args->out_args[0].value =3D outarg; +} + static int fuse_do_getattr(struct mnt_idmap *idmap, struct inode *inode, struct kstat *stat, struct file *file) { @@ -1492,14 +1509,7 @@ static int fuse_do_getattr(struct mnt_idmap *idmap, = struct inode *inode, inarg.getattr_flags |=3D FUSE_GETATTR_FH; inarg.fh =3D ff->fh; } - args.opcode =3D FUSE_GETATTR; - args.nodeid =3D get_node_id(inode); - args.in_numargs =3D 1; - args.in_args[0].size =3D sizeof(inarg); - args.in_args[0].value =3D &inarg; - args.out_numargs =3D 1; - args.out_args[0].size =3D sizeof(outarg); - args.out_args[0].value =3D &outarg; + fuse_getattr_args_fill(&args, get_node_id(inode), &inarg, &outarg); err =3D fuse_simple_request(fm, &args); if (!err) { if (fuse_invalid_attr(&outarg.attr) || diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 3b2a171e652f0c9dd1c9e37253d3d3e88caab148..a408a9668abbb361e2c1e386eba= b9dfcb0a7a573 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -23,6 +23,23 @@ #include #include =20 +/* + * Helper function to initialize fuse_args for OPEN/OPENDIR operations + */ +static void fuse_open_args_fill(struct fuse_args *args, u64 nodeid, int op= code, + struct fuse_open_in *inarg, struct fuse_open_out *outarg) +{ + args->opcode =3D opcode; + args->nodeid =3D nodeid; + args->in_numargs =3D 1; + args->in_args[0].size =3D sizeof(*inarg); + args->in_args[0].value =3D inarg; + args->out_numargs =3D 1; + args->out_args[0].size =3D sizeof(*outarg); + args->out_args[0].value =3D outarg; +} + + static int fuse_send_open(struct fuse_mount *fm, u64 nodeid, unsigned int open_flags, int opcode, struct fuse_open_out *outargp) @@ -40,14 +57,7 @@ static int fuse_send_open(struct fuse_mount *fm, u64 nod= eid, inarg.open_flags |=3D FUSE_OPEN_KILL_SUIDGID; } =20 - args.opcode =3D opcode; - args.nodeid =3D nodeid; - args.in_numargs =3D 1; - args.in_args[0].size =3D sizeof(inarg); - args.in_args[0].value =3D &inarg; - args.out_numargs =3D 1; - args.out_args[0].size =3D sizeof(*outargp); - args.out_args[0].value =3D outargp; + fuse_open_args_fill(&args, nodeid, opcode, &inarg, outargp); =20 return fuse_simple_request(fm, &args); } diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index e46315aa428c9d0e704c62a0b80811172c5ec9c1..ff8222b66c4f7b04c0671a98023= 7a43871affd0a 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h @@ -1179,6 +1179,12 @@ struct fuse_io_args { void fuse_read_args_fill(struct fuse_io_args *ia, struct file *file, loff_= t pos, size_t count, int opcode); =20 +/* + * Helper functions to initialize fuse_args for common operations + */ +void fuse_getattr_args_fill(struct fuse_args *args, u64 nodeid, + struct fuse_getattr_in *inarg, + struct fuse_attr_out *outarg); =20 struct fuse_file *fuse_file_alloc(struct fuse_mount *fm, bool release); void fuse_file_free(struct fuse_file *ff); --=20 2.53.0