Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2529675rbb; Wed, 28 Feb 2024 05:00:55 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVgKxVSOsYq7/25r7Yb8ug23DopTHxtoXd4ea6dZ+ycMW3N045F/KQbh1GVjETG0Thfsr4N+lx8+LKB8RHEwTNnlKnxngx0f4GqeXqLZg== X-Google-Smtp-Source: AGHT+IG5nLgC3kN89JuxqWO4yGBaT5ki1nko4XHxq3yv8qJd7HM7VaCII1ZEcDhOpz+L9R1h7opM X-Received: by 2002:a0c:db04:0:b0:68f:8c72:b894 with SMTP id d4-20020a0cdb04000000b0068f8c72b894mr5539640qvk.62.1709125255556; Wed, 28 Feb 2024 05:00:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709125255; cv=pass; d=google.com; s=arc-20160816; b=lk/LY7wfBKeq8oW8IeQq99t272ZDTfbfPCaoCJ3hE3XwtUjq4evdTi7u1fDyG51FMm 1baBH/6oBUHEBEficSxqHjO4Db1y7ahBXRrkeYiShgvY7T0q1xR3KVDHlJOvIBdZJmht a/7W+3bPiKBriCp6BkS12b0G6H5pK+xCh7ShHZxVAQoiHu8Ay6M7npN8y72Qw8T2liVA sHiutgxfQ4+prXNbSiE8Ntm2q5Z6l1V18KCBOiq+iiNjQ1IC1Y43RO6U3XeMbjZrftFW tthbHw4YDblSaS+hFkdTyE5zpfcSkU2HrK4sHxAH/gUQvYzKRgjdoMHDh23qUvBH9Squ ZvpQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature; bh=h06r0ujGHNkRnzrxW3wJz3Jl8jpVfkRZ0v6DvWovm5A=; fh=5sxw2OGy9/IQFv6+wuq7SWUqo/F9wFnlljNBUignSzI=; b=zl5ESyhL1Su6GxbtvAfMrOp/DZvj0/XHd/QlcVvibzfiqF4fRmPhYgb7lw3KslT8z8 B+C4huJed4Ve/L3CaDu/bFMyi+/ov3wVcyM1LDvTBF6ndgHhB0vzFi0D6Jv8sX4oPuyP UHthr1Vlcdj84JVbgPH+WN/t4o+3YfDx6FmaL/sGm1ptIBmipAmLedO35yyM8UM7Kk8y gPgndg9l0mtSIFbPqF0tumQ8iA2b7mMXUZCt6kBEdEVBZ6Eo3uiNzgXx7VMTCnaihALT nxTqGsNtM7ghFLqD+ddf/yqFJP4XLkCnEKPzMxe6Omd4GixOajWI9vCnwlhCOK87rvUq 9Frg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=rBcpXY0u; arc=pass (i=1 spf=pass spfdomain=flex--aliceryhl.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-85049-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85049-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id gm3-20020a056214268300b0068f34f21e75si9747340qvb.109.2024.02.28.05.00.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 05:00:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85049-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=rBcpXY0u; arc=pass (i=1 spf=pass spfdomain=flex--aliceryhl.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-85049-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85049-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 513871C2412B for ; Wed, 28 Feb 2024 13:00:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E6C72208C5; Wed, 28 Feb 2024 13:00:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="rBcpXY0u" Received: from mail-lf1-f74.google.com (mail-lf1-f74.google.com [209.85.167.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5AF7773508 for ; Wed, 28 Feb 2024 13:00:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709125247; cv=none; b=SsE9+W8ohtG3wiWC1lwwX9OxFWyU58g6NL24OZ+Ooyc6hHV7T5dwfr5Z+lyuCrU1sRQ6Q0EosRyKkuSaurivuDG4CWZYKO5BpA2xlyOXlK7CQ8ldEjbC2F3+Sm7X9D3HYjw4ZEcRK+ajm7Mo+YZ85EDxGqP5BOBjnmi1hTY5MdE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709125247; c=relaxed/simple; bh=5eKyUMXaVKoGDR1LS8Xh6qVotw5zgKEUJmt6pSFL7jo=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=OAw9xpqWBOOT++W2rHjPMhoyYL5GIP95GaWJLFkbSvaMjBAw0pA2HLtWf1B0KWqcl9twYBuQ3RP4GyGAnQHCZJkUn18FKl31hGBRz1cGIx4b/GHPp/Mr/DvkHuybNFKtYKE+BoxDMD64f8kdMaFVSOnaRLMCj9OiFhcotHs1mPg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=rBcpXY0u; arc=none smtp.client-ip=209.85.167.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com Received: by mail-lf1-f74.google.com with SMTP id 2adb3069b0e04-5131496ad16so1301023e87.3 for ; Wed, 28 Feb 2024 05:00:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709125243; x=1709730043; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=h06r0ujGHNkRnzrxW3wJz3Jl8jpVfkRZ0v6DvWovm5A=; b=rBcpXY0uV3sS3jzXNBJdOOnQSlxSn+aXb2kPYC2HuW3NqF/1M2UZ3CJ778LH68QYxQ QDzx04qtvSac/w5gfs3FSwHlxAbYUPYi9Y4Y+wFM5rL5n7j/YAGod4uk8vM1d5Vtkmtj ziIqqWPsjC+DOrCIQL0fuJ/cK7xG7NE/xB7gEDNy/ERsQu2EDNrAYJQq2JhTNbTyurfn W12uUab3e21OEV7UuHPt7877DjYjTOYAddidyGNyaqvkQ6Rz5tZmWvWlRs30UeeLAeV1 AsaGELO7vvWyTI17+bxuKW4xipb8u0R09lCAXQmnWHdxgMsHIh4lsSve0l4DfGVX5Oyn Yh0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709125243; x=1709730043; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=h06r0ujGHNkRnzrxW3wJz3Jl8jpVfkRZ0v6DvWovm5A=; b=vO8yFWPZZ9tnMSofIwmaGfeJPx9Jyaz+TXb9kvGQWq35UYATNP5qzO6y4vsq+m+14z 8ynpjRU5E4h2WJe9otEHsDuJCcD//hkZsRNAO6Q72YHO3NxU2SEMFkdGKEYfTVO66nuQ GE8YK89iVxO3fwadqlNQeyDv7xHOMuSVGl4f0ZjSTn/3JtgpbRamv9AOuvUXljFM/kus iz6XZGF6q2mMWLPgh2ZSECAc4HB1T6ZcPfm/o1SeahNEjXZb+xLsCNxQYbyVzW0AF2SU zXgjwh+LBc7VhpzIejmDW8PvtVXpRnJhPhdWiCDb0wjC4SFqJZ8UhsYAyugBQcT20ltL UbDw== X-Forwarded-Encrypted: i=1; AJvYcCValU0HxjhETZUVMvF9VlcY4UicrSTcEMknBTqjJD2PZss0tvrsdfK0rwOw6Usky3KZLUSuGlBMizlWwDmjemxYxqe+NCOVsYkXefHz X-Gm-Message-State: AOJu0Yw/oZPdAOzSB6/aolJNRn+Nw8T2fPZtNbJnGTleeql+zXJUt4H+ nJ92yq8cVuoGuuHT1oPqiQWVTOnEp+hmsJ16VfrDzlDGUuoSUYUm6xyDAWp6Yodx/Hq0IWAXB1/ 9CJsJDbk745fZww== X-Received: from aliceryhl2.c.googlers.com ([fda3:e722:ac3:cc00:68:949d:c0a8:572]) (user=aliceryhl job=sendgmr) by 2002:a05:6512:5d4:b0:513:1ed6:fda0 with SMTP id o20-20020a05651205d400b005131ed6fda0mr488lfo.12.1709125243459; Wed, 28 Feb 2024 05:00:43 -0800 (PST) Date: Wed, 28 Feb 2024 13:00:33 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAHEu32UC/13MwQrCMAzG8VcZORtpg07nyfeQHWqadYW5jlaKM vru1uHJ4z/k+62QJHpJcGlWiJJ98mGuQbsGeDSzE/S2NpCigyLVoYmMQ4g4+fREQ6ypZTL2yFA nS5TBvzbu1tce61OI703P+nv9QfoPyhoV2u7MtiM+tep+dSG4SfYcHtCXUj5bRRqWqQAAAA== X-Developer-Key: i=aliceryhl@google.com; a=openpgp; fpr=49F6C1FAA74960F43A5B86A1EE7A392FDE96209F X-Developer-Signature: v=1; a=openpgp-sha256; l=1319; i=aliceryhl@google.com; h=from:subject:message-id; bh=5eKyUMXaVKoGDR1LS8Xh6qVotw5zgKEUJmt6pSFL7jo=; b=owEBbQKS/ZANAwAKAQRYvu5YxjlGAcsmYgBl3y5yuv+52DxXqIdJX5uK8sHE9psCaXeBKlBHv I8zNx57MouJAjMEAAEKAB0WIQSDkqKUTWQHCvFIvbIEWL7uWMY5RgUCZd8ucgAKCRAEWL7uWMY5 RvICD/9CvqAzix1mcz6EHZdV75Dm00UMuf04pwwDvO0KjBVz6lZkWE0pYiJaNM8HEGSjExROVVz Z1iZIQduKxdPZUis4i16l6saaphR16US4FW4xjRxiGYfsqGOc8NqerKT6Sl+BT80jabm5JoNU1n 8MbD/yaZlECu2DKPFc3gVt1tHKY6E/9H+1EZLZw3dAaqloBkguwM9w2hFAIVwMntr/7VCc0embX P8zkjDCp7HdgfEgNeGihuODbOpvLJRvhb3PmosVMTEoabKBdkNnvUwnkHIWEKkiRD/ehBfBDiEo Vqk+PLcx7rUMTlbtdADNB34HXTKoSZ3/LwXJLViRuXIsXFwvi6/Y3A++HRP/FM2rCrh3Kitcgdh Z4a3jLhqFACDs/QxX6HRaxeCXWokUktAMcpiuf7mj48HgbNrYGjpT03gWk2QwQ+DUabGuhD+fQA xzj/l7bW16i0C1wZtgxaP1Nr3zRK4gdJhiHqE8JPV4mWcsl3QqVxwnRNL8m8OEXSEal6EnjeFJm gAZITPrW4Rv/ITWv7Rpr1ELmNyv4C3R1lBQ5d40PFzhCSQ4T6OPOaLoFDMtT+iZkPbw4E4jC2xY ulmREotrVbYfOw2MseMm8ToQdGWOdXNynhKukJVdPvyyW3YF+ZRmHqmws/KN7bU3s031ncnHiZp DLHrdsXYZw20JIA== X-Mailer: b4 0.13-dev-26615 Message-ID: <20240228-arc-for-list-v2-0-ae93201426b4@google.com> Subject: [PATCH v2 0/2] Arc methods for linked list From: Alice Ryhl To: Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , "=?utf-8?q?Bj=C3=B6rn_Roy_Baron?=" , Benno Lossin , Andreas Hindborg Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, Alice Ryhl Content-Type: text/plain; charset="utf-8" This patchset contains two useful methods for the Arc type. They will be used in my Rust linked list implementation, which Rust Binder uses. See the Rust Binder RFC [1] for more information. Both these commits and the linked list that uses them are present in the branch referenced by the RFC. I will send the linked list to the mailing list soon. This patchset is based on rust-next and depends on [2]. Link: https://lore.kernel.org/rust-for-linux/20231101-rust-binder-v1-0-08ba9197f637@google.com/ [1] Link: https://lore.kernel.org/all/20240215104601.1267763-1-aliceryhl@google.com/ [2] Signed-off-by: Alice Ryhl --- Changes in v2: - Move raw_to_inner_ptr to ArcInner and rename to container_of. - Reword safety conditions for raw_to_inner_ptr to match its users. - Link to v1: https://lore.kernel.org/r/20240219-arc-for-list-v1-0-d98cd92c760b@google.com --- Alice Ryhl (2): rust: sync: add `ArcBorrow::from_raw` rust: sync: add `Arc::into_unique_or_drop` rust/kernel/sync/arc.rs | 107 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 89 insertions(+), 18 deletions(-) --- base-commit: e944171070b65521c0513c01c56174ec8fd7d249 change-id: 20240209-arc-for-list-a2c126c2ad5c Best regards, -- Alice Ryhl