From patchwork Tue Jan 7 00:25:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Schubert X-Patchwork-Id: 13927929 Received: from outbound-ip191a.ess.barracuda.com (outbound-ip191a.ess.barracuda.com [209.222.82.58]) (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 5C2896F099 for ; Tue, 7 Jan 2025 00:25:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=209.222.82.58 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736209543; cv=fail; b=cbbMBbWQq8oe5k3iqEgxFvS9zWmInndphY2lHIrZWsrjfyALxYMFb13fPwMIPTbWwkHReVeOoyO4OIs8x3493r4xQ5caEEVZAHepXJ1CzYBp0gwKgkrSSf6gcCPU4/qyUxmHrHh3iWam/6Aqpe8AlPKeoC6b3bKvqimugrABGRY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736209543; c=relaxed/simple; bh=455vpR6hkQ2u3HTcvd4tTICV/lcjLmUkyQgxI7osccQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MaxwLWO6GBqYv/DnfaiQ5ak3j/otRu9pgEt0swReZmRK39HYEsO0vYDdYKGVxfy9eKLemVYySHec+5WD4ehR164E4BBPJxBdfJUqAeoGeyd8vrr2eb4G4EnXZk8snnFD7WOhMSMCCr+fxQ9vhfdCNLJpD5UaqoGNyxe4c8bS6xA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=ddn.com; spf=pass smtp.mailfrom=ddn.com; dkim=pass (1024-bit key) header.d=ddn.com header.i=@ddn.com header.b=AHLy027o; arc=fail smtp.client-ip=209.222.82.58 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=ddn.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ddn.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ddn.com header.i=@ddn.com header.b="AHLy027o" Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2168.outbound.protection.outlook.com [104.47.55.168]) by mx-outbound45-144.us-east-2c.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 07 Jan 2025 00:25:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=SDhUE0dC6ndckVWVPjzGhz4hHMb9WVYxr2ncyn2GDZqUlLNO+rx2JjZFSLXsS21KKxzcYzQWSZ6Koxj5HhCApdJCW4/QDVMZPm74gRepr+wHuTBlPZa6K9LTRxCm/8ZXfkIkatKHKK3XQ+9DCYH7eDFZCKBMyA0JP+GEtejVNZxWphf+EBR99+7xi0sBYMACbPgre1vIp3WJ803M5u3/CZ1zd/Zha8+tdgSf/odmbPE6Yo8xcpODDs2RzemM5EQ7deydHZNtoT/onrLGbBH/xu7dExOLkSu03roQABkzDkGIwXkNskmNN0Cib9jxQA4mEetuzvphwA0MeyYjOjW+DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=HuXSOUK7SIRmeDldD+kaeaGEIQyBJaCc0JTjXP0ob2Y=; b=Ik806x+IeFWkuAkIHx4XkSek4SR51WzTHi0uBw9sjqYobbyahlga6hpfIYsrLN3/6N37UODrAyWDK/2i+WMAO2RcJiwK4UnYqJVWaEo76sHvU1JWmjCP4ZkpItexS4jaKikl1Ll4BqcVVRsdQ/MMcS9+ogJ9B2pSyYv1rReoEYwnZArUGFTkv3fUeyZ9OKLMeVprO8BrUAPZL//VkSVOLclTxVWitrrYYLczXqII5+C/uDjJnFt24spoJTm8Tg8pxZsyYaZgtNlkhz0HOVAA6yosrmQOJwdmsGJZ3XQthQOEgC25Xsq6Xb6gDCSgKzFwcKH9BIbnGTUdxlKTN0xFww== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 50.222.100.11) smtp.rcpttodomain=bsbernd.com smtp.mailfrom=ddn.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=ddn.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ddn.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HuXSOUK7SIRmeDldD+kaeaGEIQyBJaCc0JTjXP0ob2Y=; b=AHLy027oKzeIUKkCUgsiOn4ALiELsNvISCPbStysP5dTTNhlpZhDmJALupf3Y+CYJ2i4slD3W+NTu5jvXzN+rNvYJCpreChElITBVSLKEtSakJC1Pb7cnIWWj4FYKRgnucgZVmHZ8TiJkRu/QKkyam/nb6jNaibJoEnbY8Ja9y0= Received: from CH2PR17CA0018.namprd17.prod.outlook.com (2603:10b6:610:53::28) by CY5PR19MB6217.namprd19.prod.outlook.com (2603:10b6:930:2a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.16; Tue, 7 Jan 2025 00:25:19 +0000 Received: from DS3PEPF000099E1.namprd04.prod.outlook.com (2603:10b6:610:53:cafe::4) by CH2PR17CA0018.outlook.office365.com (2603:10b6:610:53::28) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8314.18 via Frontend Transport; Tue, 7 Jan 2025 00:25:19 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 50.222.100.11) smtp.mailfrom=ddn.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=ddn.com; Received-SPF: Pass (protection.outlook.com: domain of ddn.com designates 50.222.100.11 as permitted sender) receiver=protection.outlook.com; client-ip=50.222.100.11; helo=uww-mrp-01.datadirectnet.com; pr=C Received: from uww-mrp-01.datadirectnet.com (50.222.100.11) by DS3PEPF000099E1.mail.protection.outlook.com (10.167.17.196) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8335.7 via Frontend Transport; Tue, 7 Jan 2025 00:25:18 +0000 Received: from localhost (unknown [10.68.0.8]) by uww-mrp-01.datadirectnet.com (Postfix) with ESMTP id 29D1855; Tue, 7 Jan 2025 00:25:18 +0000 (UTC) From: Bernd Schubert Date: Tue, 07 Jan 2025 01:25:12 +0100 Subject: [PATCH v9 07/17] fuse: Make fuse_copy non static Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250107-fuse-uring-for-6-10-rfc4-v9-7-9c786f9a7a9d@ddn.com> References: <20250107-fuse-uring-for-6-10-rfc4-v9-0-9c786f9a7a9d@ddn.com> In-Reply-To: <20250107-fuse-uring-for-6-10-rfc4-v9-0-9c786f9a7a9d@ddn.com> To: Miklos Szeredi Cc: Jens Axboe , Pavel Begunkov , linux-fsdevel@vger.kernel.org, io-uring@vger.kernel.org, Joanne Koong , Josef Bacik , Amir Goldstein , Ming Lei , David Wei , bernd@bsbernd.com, Bernd Schubert X-Mailer: b4 0.15-dev-2a633 X-Developer-Signature: v=1; a=ed25519-sha256; t=1736209509; l=3717; i=bschubert@ddn.com; s=20240529; h=from:subject:message-id; bh=455vpR6hkQ2u3HTcvd4tTICV/lcjLmUkyQgxI7osccQ=; b=TCWwmXzKTF8KHT7JdLy4Ewdm/RfRjcPH+Umz3B8+QwTnsmERDLvFE4ngYin9Fobh1Iu3UlXV3 MbL/KOLy2zKDfXr4labY/xqe2ylCW/lv0GJjzgghX8Q8P8h5eAJAYZY X-Developer-Key: i=bschubert@ddn.com; a=ed25519; pk=EZVU4bq64+flgoWFCVQoj0URAs3Urjno+1fIq9ZJx8Y= X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF000099E1:EE_|CY5PR19MB6217:EE_ X-MS-Office365-Filtering-Correlation-Id: 7df00a6e-9851-40f8-d65e-08dd2eb1c411 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|7416014|376014|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: =?utf-8?q?BAvSctiQCTAq2zxvdXYfZBYlBGyTqkm?= =?utf-8?q?IyB++H7stWegDcVYTbZP+ozBI00tNEMOoBFd/wQ8fpDxJL2ZOFL4pdu07xNl9//Lg?= =?utf-8?q?AUfJ4miBuGMAdiwSQhaheyHw+tYNWPr4kzjWJzNr0qCcAxBio+fuKBiSjxvgGVJIV?= =?utf-8?q?m9uEJ3Jqlbd+bz6eNjS1mVOn7d7Ux738+byd05Y+Z4XC23uyVdSQ5SKiCCkMgaATT?= =?utf-8?q?8Af1+2mkMNXc9hLxK639EIvpcteFMlQ8rjxbOLy/zQqhtXb5LwZMYwVn8r07w6ydo?= =?utf-8?q?JSesZpVCIG13crkZJVjmbq91TTfMkQa0e7lPJr79DASnXTLf0cC6ps5D5sKlQ3RJD?= =?utf-8?q?STirHpS8pjsiFyOR/hx6ROuieLhYgIAXHcC8wcGqSM1vOjnTq3O1fE2cnvsiThMD6?= =?utf-8?q?EeVpSNx/JquauEtCVkWpOa9sHB6X/mtn1KKDBoB9fr5jW1Gf+W44EMeMkb/4QJJfr?= =?utf-8?q?Nc+7kB9lLVQwhYWnbtQOmdSIr9iAglbAYEibt0BVucnAQFaD/GD6AmuREB/Yg3Ysn?= =?utf-8?q?BPsJbwH6NExbrgPhp4wI/K3I4g7h1K1bwaLi6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U=3D?= X-Forefront-Antispam-Report: CIP:50.222.100.11;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:uww-mrp-01.datadirectnet.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(7416014)(376014)(36860700013)(82310400026);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: hMK+iKxQJI96Jla1EYXDtk5/CVVDbWx3Y6W6fZo7D3S2Pz7D20AQLDt2Rvo9mHNQ6b2Rb2yrnHgUQGJBTvwu/4eauh8jEANhu/c+E3Sw+lvsMD9e4tETJufSz1AiB+ldFcc/fR7zPd+s2iw7ouudN1b3cbXzTZDkKNlV6Ung2SYUhVGr+ifzjhtZrXAOR9jfAMk8V4XSnm4t+RKYrJHYkGYRvhj6H+5BQ+UmmlOQ9NM9+ccMNv44H6mvqzdTy+ce0GXaYMjFqiyNtpNi1jatGYUOaj781MlyfuJF5mHitWUSMK+kM8ZUtbAabasoPDM5YQ15dC7pevabEpTTyIE4TzKlmwzXMwkdPMuYY1EfLi8IihcFxnoDvBGrAAsyFWSpRTmi80SGkqF8SaA4V7wbybCdf6MFWNimdOzX0kQt4jAc+PRv3pBfKtsyEMnQU9hdOP/18ymyeEhdD2jgS5aGVVzgWQyPFkjpt8wYEnaa7xPhFPGmWkQhYOADhcumUuAIgLOgfLCezBsdPUYygwflV6hWebBmCmZiCny52qpifN6xl3scx6p2iRVc6uAiTPzMDnHRqDHNgHAPTnxNMEUb2Th3OjY+cVKijYb5iiF/B6uscqsU7WJK3TDtBUmZZ/FiMA5aY+26wwZCwgsMY5Cz7A== X-OriginatorOrg: ddn.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jan 2025 00:25:18.8820 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7df00a6e-9851-40f8-d65e-08dd2eb1c411 X-MS-Exchange-CrossTenant-Id: 753b6e26-6fd3-43e6-8248-3f1735d59bb4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=753b6e26-6fd3-43e6-8248-3f1735d59bb4;Ip=[50.222.100.11];Helo=[uww-mrp-01.datadirectnet.com] X-MS-Exchange-CrossTenant-AuthSource: DS3PEPF000099E1.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR19MB6217 X-BESS-ID: 1736209526-111664-20218-24697-1 X-BESS-VER: 2019.1_20241219.1759 X-BESS-Apparent-Source-IP: 104.47.55.168 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVsZmBgZAVgZQ0NTMxMAsydQ8OT k1ySwxLdXAOMXANDHV1Nwi2dQgzcJQqTYWALZTIqNBAAAA X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.261635 [from cloudscan11-187.us-east-2a.ess.aws.cudaops.com] Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.00 using account:ESS124931 scores of KILL_LEVEL=7.0 tests=BSF_BESS_OUTBOUND X-BESS-BRTS-Status: 1 Move 'struct fuse_copy_state' and fuse_copy_* functions to fuse_dev_i.h to make it available for fuse-io-uring. 'copy_out_args()' is renamed to 'fuse_copy_out_args'. Signed-off-by: Bernd Schubert Reviewed-by: Joanne Koong --- fs/fuse/dev.c | 30 ++++++++---------------------- fs/fuse/fuse_dev_i.h | 25 +++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 22 deletions(-) diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 623c5a067c1841e8210b5b4e063e7b6690f1825a..6ee7e28a84c80a3e7c8dc933986c0388371ff6cd 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -678,22 +678,8 @@ static int unlock_request(struct fuse_req *req) return err; } -struct fuse_copy_state { - int write; - struct fuse_req *req; - struct iov_iter *iter; - struct pipe_buffer *pipebufs; - struct pipe_buffer *currbuf; - struct pipe_inode_info *pipe; - unsigned long nr_segs; - struct page *pg; - unsigned len; - unsigned offset; - unsigned move_pages:1; -}; - -static void fuse_copy_init(struct fuse_copy_state *cs, int write, - struct iov_iter *iter) +void fuse_copy_init(struct fuse_copy_state *cs, int write, + struct iov_iter *iter) { memset(cs, 0, sizeof(*cs)); cs->write = write; @@ -1054,9 +1040,9 @@ static int fuse_copy_one(struct fuse_copy_state *cs, void *val, unsigned size) } /* Copy request arguments to/from userspace buffer */ -static int fuse_copy_args(struct fuse_copy_state *cs, unsigned numargs, - unsigned argpages, struct fuse_arg *args, - int zeroing) +int fuse_copy_args(struct fuse_copy_state *cs, unsigned numargs, + unsigned argpages, struct fuse_arg *args, + int zeroing) { int err = 0; unsigned i; @@ -1933,8 +1919,8 @@ static struct fuse_req *request_find(struct fuse_pqueue *fpq, u64 unique) return NULL; } -static int copy_out_args(struct fuse_copy_state *cs, struct fuse_args *args, - unsigned nbytes) +int fuse_copy_out_args(struct fuse_copy_state *cs, struct fuse_args *args, + unsigned nbytes) { unsigned reqsize = sizeof(struct fuse_out_header); @@ -2036,7 +2022,7 @@ static ssize_t fuse_dev_do_write(struct fuse_dev *fud, if (oh.error) err = nbytes != sizeof(oh) ? -EINVAL : 0; else - err = copy_out_args(cs, req->args, nbytes); + err = fuse_copy_out_args(cs, req->args, nbytes); fuse_copy_finish(cs); spin_lock(&fpq->lock); diff --git a/fs/fuse/fuse_dev_i.h b/fs/fuse/fuse_dev_i.h index 08a7e88e002773fcd18c25a229c7aa6450831401..21eb1bdb492d04f0a406d25bb8d300b34244dce2 100644 --- a/fs/fuse/fuse_dev_i.h +++ b/fs/fuse/fuse_dev_i.h @@ -12,6 +12,23 @@ #define FUSE_INT_REQ_BIT (1ULL << 0) #define FUSE_REQ_ID_STEP (1ULL << 1) +struct fuse_arg; +struct fuse_args; + +struct fuse_copy_state { + int write; + struct fuse_req *req; + struct iov_iter *iter; + struct pipe_buffer *pipebufs; + struct pipe_buffer *currbuf; + struct pipe_inode_info *pipe; + unsigned long nr_segs; + struct page *pg; + unsigned int len; + unsigned int offset; + unsigned int move_pages:1; +}; + static inline struct fuse_dev *fuse_get_dev(struct file *file) { /* @@ -23,5 +40,13 @@ static inline struct fuse_dev *fuse_get_dev(struct file *file) void fuse_dev_end_requests(struct list_head *head); +void fuse_copy_init(struct fuse_copy_state *cs, int write, + struct iov_iter *iter); +int fuse_copy_args(struct fuse_copy_state *cs, unsigned int numargs, + unsigned int argpages, struct fuse_arg *args, + int zeroing); +int fuse_copy_out_args(struct fuse_copy_state *cs, struct fuse_args *args, + unsigned int nbytes); + #endif