From patchwork Wed May 29 18:00:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Schubert X-Patchwork-Id: 13679408 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 5A8EE15B552 for ; Wed, 29 May 2024 18:33:30 +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=1717007612; cv=fail; b=MZry3alIM5YNgblTyxTv2BdzpczWSupLSWqhenwuyaQaJTFrn4kqZE5H7kyNLrtIuO6K+EnJxY8BQt0sfwhgkmWMIpZKPohfNkTYtrI7JNCCJA8Dwv8g6SFOjzqynD82iCXOfs4z5722k7khUvBDTN4caU2Igek+rwU0x9UbXHQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717007612; c=relaxed/simple; bh=ykdZ3lsNXXK395eD8JO7ON7n6z6X51OKzfrXSwxvITs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To; b=TgIBMAfVW/kuGoLZkUEK8+s7D1MOdq0If4tRXESveiiv1Q5/w4iAzDslaImfCD1oNar00UDS8byyhGP989fZIgU8JkwnPmSdg6ycp+bz5namEBBaZ+qLgtB6FiTqJawEnOas3IpdL0XsizsTcnV0FkYN3UuuivSvWUA1pVNS+xM= 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=1DdteggO; 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="1DdteggO" Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2044.outbound.protection.outlook.com [104.47.66.44]) by mx-outbound42-38.us-east-2c.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 29 May 2024 18:33:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iBRKPBKCw0EI/SMrorFMEAr2wEomwhD5EmYr6YyZqASh/YGM27dLIidbpz+1xXR+Vw59DMkgokg+6DgeUPvTex9GVflIqBbX0/fkg6aLocrkRSRjOVz3M4VvDvo+DmgjybfXGikwENY7M5nskpHLmsGn7Whc7fK3WzS3wLAY3C/r1bdjjN/vCIECyf6iEqUgMU3X7LIfjxv6eFV7LknqLT4bj1XU77l7k48UPEeBH42F9sIJhhnugCnREmwJco4XOBHaWXVtxU+X7y8wTJfk5A211FbMeBJExfTdumFyPZMNMUE7E8lvFcvG5p+zbPd/ngGqJafFxEKzpPGKj1MS7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=zjv5dbjJ16GG3iK99Ld3pUZNQSnzorgHj+tlht9zc94=; b=jJ3DVv+TspziOOr0JcKDLudcn7TZuPID6+rh6Ksowa2DeLl+sdhhWx1UvN2F897Y/Yx2t2d4akbqnohTyv+rCNtC2QcgoFagxKPx+7gwKXhGV9Zn+pFiLaWKhMBPsUUBsqpe6nQ2dhCnmd9EvhINovij4EEcm7kL76bGzI79EPo/t9HWvpX8uibZ23gFX1cfs6RcQeGMy2SWcJm0sF/8HmfQbk1bRFSkyDOYf3DwTqUOUVTpEyMI0Fx5LFAxy1/P4aFA6exQREi+Jl1pBZEo7GruJQ/Z1DXL0vJvxo44kQRK79jyMh7yi8qwN+gdxgTG7E8A5pOovFXWql+IkzEb3A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 50.222.100.11) smtp.rcpttodomain=ddn.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=zjv5dbjJ16GG3iK99Ld3pUZNQSnzorgHj+tlht9zc94=; b=1DdteggO0vpQkJZJgVLAM0CYRARMJDXV8kW72YeqgoF2wPUL9rZDAiTt4fSsou9aNFHlLhdYLdqiqXA09Eg6ejdgCeP4zYZv30tL8okmGodWT4moGLZDL7b7SXk3+NR+2y+2zZmcpdw/1wkxFzmS7gf0QaOp5AwvwbyeQpOHhiY= Received: from BN8PR15CA0017.namprd15.prod.outlook.com (2603:10b6:408:c0::30) by BY3PR19MB5185.namprd19.prod.outlook.com (2603:10b6:a03:368::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.30; Wed, 29 May 2024 18:00:57 +0000 Received: from BN1PEPF00004683.namprd03.prod.outlook.com (2603:10b6:408:c0:cafe::c3) by BN8PR15CA0017.outlook.office365.com (2603:10b6:408:c0::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.30 via Frontend Transport; Wed, 29 May 2024 18:00:57 +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 BN1PEPF00004683.mail.protection.outlook.com (10.167.243.89) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7633.15 via Frontend Transport; Wed, 29 May 2024 18:00:56 +0000 Received: from localhost (unknown [10.68.0.8]) by uww-mrp-01.datadirectnet.com (Postfix) with ESMTP id 1A5D725; Wed, 29 May 2024 18:00:55 +0000 (UTC) From: Bernd Schubert Date: Wed, 29 May 2024 20:00:42 +0200 Subject: [PATCH RFC v2 07/19] fuse uring: Add an mmap method Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240529-fuse-uring-for-6-9-rfc2-out-v1-7-d149476b1d65@ddn.com> References: <20240529-fuse-uring-for-6-9-rfc2-out-v1-0-d149476b1d65@ddn.com> In-Reply-To: <20240529-fuse-uring-for-6-9-rfc2-out-v1-0-d149476b1d65@ddn.com> To: Miklos Szeredi , Amir Goldstein , linux-fsdevel@vger.kernel.org, Bernd Schubert , bernd.schubert@fastmail.fm X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=ed25519-sha256; t=1717005648; l=5745; i=bschubert@ddn.com; s=20240529; h=from:subject:message-id; bh=ykdZ3lsNXXK395eD8JO7ON7n6z6X51OKzfrXSwxvITs=; b=6s6Jqt7xriWk0pHQmXWy1wE8RRBQQ80JOavLoDZ20WF4qs4HDHzjFfF/4V3YJMXh+5+f8zYC0 1n844CFktjvDjpXPSqBMAIWZQGeJj2nOSkjbbTO4rsTFhN0dwKfpljD X-Developer-Key: i=bschubert@ddn.com; a=ed25519; pk=EZVU4bq64+flgoWFCVQoj0URAs3Urjno+1fIq9ZJx8Y= X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN1PEPF00004683:EE_|BY3PR19MB5185:EE_ X-MS-Office365-Filtering-Correlation-Id: fe5c6d7d-d726-4cb2-7332-08dc80094a68 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|82310400017|36860700004|376005|1800799015; X-Microsoft-Antispam-Message-Info: =?utf-8?q?xyumyx7NEO2Q0DAK5Nqjg6pWa9Aq5jC?= =?utf-8?q?mH/6ttlmIUssOMph8tYU0CpXAHwRPyi6e77bZndEkXdAMboXvpCN4mdbg2MAT7GeK?= =?utf-8?q?irZ5INCNNs7muNc0ClSBZtWNg+JDE1TKmGHuGmfU6/8/kutxF9IZ1ehB6tZH1spI9?= =?utf-8?q?Yud9qZnrS/WyH9YmmhWXuvbgE2SGuze931c6HVd4to2Zq9F+D4t9DDu6OkeVhOIz/?= =?utf-8?q?PJwPeqneFUWuWUWcEbVMCAiRWyxyWcvgj9Us3H9VyLahwYAnBEVGv9zY1H1dYI9zz?= =?utf-8?q?otrrEGuMEEiqpaeoNpzRpQEXYH4L4yN1xlZwEI2+q3Zacok8GiKI1k9uYiyxWWSSc?= =?utf-8?q?kydNSwmrz2LbxQ4wz9RD1bEd5sm1SA/D+B88WpuWvZWRMHnpUo+qbst4fVRkj63C3?= =?utf-8?q?2t4CG+e2TX36xsGTl03rYvR09usltnO6De8ml8fBITnMiQ9Idba7GWm7qV+0rhClB?= =?utf-8?q?gfs+2moxqSJfKNji/QKsdvHTl1AmFw+X65cr7CSsOSnWC7sTNLcEsmOSMdEDC1OSC?= =?utf-8?q?wXcNpzt/8iY3yBb7tCVVw9ZKNvl/L2m4JX/vCYsdFqMMJwkQ+HS17IRZhKQ2PoYq6?= =?utf-8?q?Z5Vq7r9WMv7Ed4WCIcaT558vo2b3DYjf/YmQD4cJF07TFrDRuW+Au1dsDXkCbPrEY?= =?utf-8?q?SeRELqC39+bGbrYphuxnu3gVMmb8cZlYwNSYIO+IjgcoRWFfgT1EJnd8BNkpqtohg?= =?utf-8?q?wXY0Q3om5PSEkbv0+PTqANXetRBpv/j39JYbWDh0gixtMjurwGjcUE/R6akqujduF?= =?utf-8?q?Q4wLzKRm1B+I/RnlWfohRdMeNHhsfGDnsj+qgVDQsTf0QNp4vIAQ/KS2G6gCgY/Hb?= =?utf-8?q?f4+YOI73FmQVLudI5W+yHNiCcU32KYgM6xh9INLT/NsX90DVmak1XjzD6kzggYavT?= =?utf-8?q?VF9s5Bm37RfsPm4IKag2bxEkH15ZrArtzLyUdPdfo3ddjOqy6skbSsZXOb0EeT3Vq?= =?utf-8?q?aEKRrEwDQDBBUQWTsfqZ8Umhbz1701viFqxSD0NhRXKfzlTfKAboTLBvMhixcl02J?= =?utf-8?q?TnbfJX7gOrkX0dhhFmDC2unrHQRjHdoWFcrRljLwSola6xdCDO5FafOzf8plxg5tR?= =?utf-8?q?6OFQwNuSZ4byGb+w0H0D4udeDY+Rsb1Ib17XaciFO22mNKuOXnWIDLGCTsD0ruDrq?= =?utf-8?q?Nkm48iDKlu+m3WhFXjf2klJC058Li2I07g71knFpvvmxNXI+PWwOPG3DDm8iAFr2y?= =?utf-8?q?BYqoWAIgG8I98KxKlVte+5ASFQfAnJSuNUvEjegsAYMALN695/uwCIcVRmwgApvco?= =?utf-8?q?KkjWba6Rc55lXsl81AdLjLuwL2Gt8QMjX3A+sOruIE52ND+r0L/Vd5Jjrty+0lsmt?= =?utf-8?q?5HJayX0Jpmvw?= 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:(13230031)(82310400017)(36860700004)(376005)(1800799015);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: EDzWxt2VZc1gGdGdYEBxQXTH7zd8gZIf14vXuSzduwWkVv/9E2Ci75eqoWG6tjxd59kA3AKRyravaS8tHLdzF9A8odIXWkwfOri19ZzwJnbJIdmYywHUxkLm1l+wwDLzf+BhJcuxZeR09NxPOADBFKS1RPG0AbDKTRzHcdM7IqGid+iIi1tnasBwW3yls88h5B48cNTUPQRyTspS2yI3Ba4WG3lvz89cDojHdSs2w2Q28IfQF9j9lBcY/hyObnHgJPunWI02ReAiKTvt0CRpSUak6Hg7wJ4Fvp5HcVWBnoaeAxUFfY5a3CGQm1iM2Ofn75G8cwlyPK6bALW66yv/0RQFjDfLkNFcRsmsmXn1J7keiya8WY6kmpMB/h/yb2Cy/hID3W33JhH7sow0aSgI6oB7Ducdqf402pOQw0/f3VgaVPqstU7r9KvAw1XC7/Knj2ze5Vovt7l1tOjcZCDNz/ohPI9OEWemnFGZSk7O0j+wTEqRPjvtoDpJ7IY/fC6020O+NwTLr2AuLDFraXU4L1M3ggq1PpiH8msibqFk9qzek0vxX6jlNLpqiO9SRypyYF2nFbyGjZ4hiMG2wAIlg3osBecnUrVo758Od0ISB9eoQn2RsUKX2mXSy0PBCCVC0C/ljEvoQeINXf7EqLavDw== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 May 2024 18:00:56.9781 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fe5c6d7d-d726-4cb2-7332-08dc80094a68 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: BN1PEPF00004683.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY3PR19MB5185 X-OriginatorOrg: ddn.com X-BESS-ID: 1717007608-110790-12643-48789-1 X-BESS-VER: 2019.1_20240429.2309 X-BESS-Apparent-Source-IP: 104.47.66.44 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVqamJuZAVgZQMNXYLNnM1DjVMs nYyNwg0cjYMNE4zTLJ0MI0ydIg1TBRqTYWACRdiIZBAAAA X-BESS-Outbound-Spam-Score: 0.50 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.256584 [from cloudscan19-133.us-east-2b.ess.aws.cudaops.com] Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.00 BSF_SC0_MISMATCH_TO META: Envelope rcpt doesn't match header 0.50 BSF_RULE7568M META: Custom Rule 7568M 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.50 using account:ESS124931 scores of KILL_LEVEL=7.0 tests=BSF_SC0_MISMATCH_TO, BSF_RULE7568M, BSF_BESS_OUTBOUND X-BESS-BRTS-Status: 1 Signed-off-by: Bernd Schubert --- fs/fuse/dev.c | 3 ++ fs/fuse/dev_uring.c | 114 ++++++++++++++++++++++++++++++++++++++++++++++ fs/fuse/dev_uring_i.h | 22 +++++++++ include/uapi/linux/fuse.h | 3 ++ 4 files changed, 142 insertions(+) diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index bc77413932cf..349c1d16b0df 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -2470,6 +2470,9 @@ const struct file_operations fuse_dev_operations = { .fasync = fuse_dev_fasync, .unlocked_ioctl = fuse_dev_ioctl, .compat_ioctl = compat_ptr_ioctl, +#if IS_ENABLED(CONFIG_FUSE_IO_URING) + .mmap = fuse_uring_mmap, +#endif }; EXPORT_SYMBOL_GPL(fuse_dev_operations); diff --git a/fs/fuse/dev_uring.c b/fs/fuse/dev_uring.c index 702a994cf192..9491bdaa5716 100644 --- a/fs/fuse/dev_uring.c +++ b/fs/fuse/dev_uring.c @@ -120,3 +120,117 @@ void fuse_uring_ring_destruct(struct fuse_ring *ring) mutex_destroy(&ring->start_stop_lock); } + +static inline int fuse_uring_current_nodeid(void) +{ + int cpu; + const struct cpumask *proc_mask = current->cpus_ptr; + + cpu = cpumask_first(proc_mask); + + return cpu_to_node(cpu); +} + +static char *fuse_uring_alloc_queue_buf(int size, int node) +{ + char *buf; + + if (size <= 0) { + pr_info("Invalid queue buf size: %d.\n", size); + return ERR_PTR(-EINVAL); + } + + buf = vmalloc_node_user(size, node); + return buf ? buf : ERR_PTR(-ENOMEM); +} + +/** + * fuse uring mmap, per ring qeuue. + * Userpsace maps a kernel allocated ring/queue buffer. For numa awareness, + * userspace needs to run the do the mapping from a core bound thread. + */ +int +fuse_uring_mmap(struct file *filp, struct vm_area_struct *vma) +{ + struct fuse_dev *fud = fuse_get_dev(filp); + struct fuse_conn *fc; + struct fuse_ring *ring; + size_t sz = vma->vm_end - vma->vm_start; + int ret; + struct fuse_uring_mbuf *new_node = NULL; + void *buf = NULL; + int nodeid; + + if (vma->vm_pgoff << PAGE_SHIFT != FUSE_URING_MMAP_OFF) { + pr_debug("Invalid offset, expected %llu got %lu\n", + FUSE_URING_MMAP_OFF, vma->vm_pgoff << PAGE_SHIFT); + return -EINVAL; + } + + if (!fud) + return -ENODEV; + fc = fud->fc; + ring = fc->ring; + if (!ring) + return -ENODEV; + + nodeid = ring->numa_aware ? fuse_uring_current_nodeid() : NUMA_NO_NODE; + + /* check if uring is configured and if the requested size matches */ + if (ring->nr_queues == 0 || ring->queue_depth == 0) { + ret = -EINVAL; + goto out; + } + + if (sz != ring->queue_buf_size) { + ret = -EINVAL; + pr_devel("mmap size mismatch, expected %zu got %zu\n", + ring->queue_buf_size, sz); + goto out; + } + + if (current->nr_cpus_allowed != 1 && ring->numa_aware) { + ret = -EINVAL; + pr_debug( + "Numa awareness, but thread has more than allowed cpu.\n"); + goto out; + } + + buf = fuse_uring_alloc_queue_buf(ring->queue_buf_size, nodeid); + if (IS_ERR(buf)) { + ret = PTR_ERR(buf); + goto out; + } + + new_node = kmalloc(sizeof(*new_node), GFP_USER); + if (unlikely(new_node == NULL)) { + ret = -ENOMEM; + goto out; + } + + ret = remap_vmalloc_range(vma, buf, 0); + if (ret) + goto out; + + mutex_lock(&ring->start_stop_lock); + /* + * In this function we do not know the queue the buffer belongs to. + * Later server side will pass the mmaped address, the kernel address + * will be found through the map. + */ + new_node->kbuf = buf; + new_node->ubuf = (void *)vma->vm_start; + rb_add(&new_node->rb_node, &ring->mem_buf_map, + fuse_uring_rb_tree_buf_less); + mutex_unlock(&ring->start_stop_lock); +out: + if (ret) { + kfree(new_node); + vfree(buf); + } + + pr_devel("%s: pid %d addr: %p sz: %zu ret: %d\n", __func__, + current->pid, (char *)vma->vm_start, sz, ret); + + return ret; +} diff --git a/fs/fuse/dev_uring_i.h b/fs/fuse/dev_uring_i.h index 58ab4671deff..c455ae0e729a 100644 --- a/fs/fuse/dev_uring_i.h +++ b/fs/fuse/dev_uring_i.h @@ -181,6 +181,7 @@ struct fuse_ring { void fuse_uring_abort_end_requests(struct fuse_ring *ring); int fuse_uring_conn_cfg(struct fuse_ring *ring, struct fuse_ring_config *rcfg); +int fuse_uring_mmap(struct file *filp, struct vm_area_struct *vma); int fuse_uring_queue_cfg(struct fuse_ring *ring, struct fuse_ring_queue_config *qcfg); void fuse_uring_ring_destruct(struct fuse_ring *ring); @@ -208,6 +209,27 @@ static inline void fuse_uring_conn_destruct(struct fuse_conn *fc) kfree(ring); } +static inline int fuse_uring_rb_tree_buf_cmp(const void *key, + const struct rb_node *node) +{ + const struct fuse_uring_mbuf *entry = + rb_entry(node, struct fuse_uring_mbuf, rb_node); + + if (key == entry->ubuf) + return 0; + + return (unsigned long)key < (unsigned long)entry->ubuf ? -1 : 1; +} + +static inline bool fuse_uring_rb_tree_buf_less(struct rb_node *node1, + const struct rb_node *node2) +{ + const struct fuse_uring_mbuf *entry1 = + rb_entry(node1, struct fuse_uring_mbuf, rb_node); + + return fuse_uring_rb_tree_buf_cmp(entry1->ubuf, node2) < 0; +} + static inline struct fuse_ring_queue * fuse_uring_get_queue(struct fuse_ring *ring, int qid) { diff --git a/include/uapi/linux/fuse.h b/include/uapi/linux/fuse.h index 0449640f2501..00d0154ec2da 100644 --- a/include/uapi/linux/fuse.h +++ b/include/uapi/linux/fuse.h @@ -1259,4 +1259,7 @@ struct fuse_supp_groups { #define FUSE_RING_HEADER_BUF_SIZE 4096 #define FUSE_RING_MIN_IN_OUT_ARG_SIZE 4096 +/* The offset parameter is used to identify the request type */ +#define FUSE_URING_MMAP_OFF 0xf8000000ULL + #endif /* _LINUX_FUSE_H */