Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp910692rdb; Fri, 9 Feb 2024 05:07:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IF1kjpk7rIZOyVnc0nxofyBlH6Hj8aGqszqqs96fem2ctewtvBD+c/DGDghF8GuKz//Szaf X-Received: by 2002:a17:90b:3658:b0:296:530:996e with SMTP id nh24-20020a17090b365800b002960530996emr1322399pjb.20.1707484075581; Fri, 09 Feb 2024 05:07:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707484075; cv=pass; d=google.com; s=arc-20160816; b=XUBcgf8sG6B4wraaMNp/4ZiwkOxE0smh61/bP5oAz9Z4cIHMouFmC1X/sKxPSbiUwR CcKgxY6LZ3UN3xDCxHx9GIQpF1iNPYTDLnpSwXNATmQJ/h2SoQ3I7Iic9iSke+isW6IE dyTW1I5MkhEjy6b7E3L0ujt8LsJhX3QOqlp3cd+dCEGu1GZjP6uTq9RsTEnRCrM3gIi8 bUqLbVCMf/IKOK+RJOQLn37npO5KcPhKB+yFof2YXDfBAc6ZrOD1jNV/ia4V75282HnF zWABdELuHdiiJ0OD5Ll8o8hDygMfJdSlGHiGy94LKeEOUwPor9cDxkVLw1x6dqf06Ai6 0UGg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=2Rw/g85sJGphAZrvH5ci9NlrmUd7mEl1/NsrSKYc4qU=; fh=h69qRnL5CUPnNYxRyTNm8NrXoCR7YQAvqbOvzrZV4+M=; b=LS/z1VdiT7l2/nNVztcuWq6b2RHlQUo0VprTs3Xq1nPhkwx5ic8g6tb92LVfcq4gIN Sd/OMnx0/M0IORMFE3BPb1VUOhv+YXjHafGTgvCKPVerVBoWAJjGhupIGT9Msp53EdCC 5HKvBLX8iFgtVFj5xSqASy7no07pGwWEZr08nXeFF20ABisQF+7epNHRer6ykI1XO2sF CSI8ntJBORbS8VM3SAw0+7WzQPe6UQoT6F8g1hIidlynH13JyFcIy5RzqMQYmxxAYsA3 cHNij2DvHKAu5jmIIqICZcBw6xWFzBzihI64K+Na0P79yiHCw+OcM5ipaTt2ePreUvRj 61fQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Spi1Q4Jn; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-59341-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59341-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com X-Forwarded-Encrypted: i=2; AJvYcCUuI7wDGH8xYHvkGXsd6jEh9145ix4nLxHaaoVRrRUm8nXgnarRlquu0TB9mtNyP3JBXj2JDICFlVXjvKgEZoada8m4SqX/bH+C+p1TOQ== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id r1-20020a17090a438100b00290b369b456si1592568pjg.155.2024.02.09.05.07.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 05:07:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59341-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Spi1Q4Jn; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-59341-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59341-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 42AC4282A7A for ; Fri, 9 Feb 2024 13:07:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D64A73C484; Fri, 9 Feb 2024 13:07:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Spi1Q4Jn" Received: from mail-qv1-f53.google.com (mail-qv1-f53.google.com [209.85.219.53]) (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 A916C3C461 for ; Fri, 9 Feb 2024 13:07:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707484065; cv=none; b=hxpKrATFSrNbPCMKnE5hF96uEWwLn1ERNMWfD8Jpla/sA86Cu619LfL5YzXtI/2bSs60mLwXQbBl4HRW4hzukqyWc5Xu76/n2nOySQI4kka7aCZcWVkMpx3wk/hWQJsCrJSK8ni/K3isuooSuuinaElXnixA+g9tWxbaTMHX63k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707484065; c=relaxed/simple; bh=2Rw/g85sJGphAZrvH5ci9NlrmUd7mEl1/NsrSKYc4qU=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=DXTS44ypyq5zWqukxa7FRP0TGjjl8tkC+0xGr/oRPuie6ZQmjsRzGMuzQTJi11rYInuNAUzqRmUTOpdJfs+t7GBCSJknn0qoC97vIfeyOnNoBKpTaBVaIIkKg+AguR1HX6OJPR4nvs1IOwRFgFT422MRTfANqgvQ255MKGog3bk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=Spi1Q4Jn; arc=none smtp.client-ip=209.85.219.53 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=google.com Received: by mail-qv1-f53.google.com with SMTP id 6a1803df08f44-68cc2a389a9so6804686d6.1 for ; Fri, 09 Feb 2024 05:07:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1707484062; x=1708088862; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=2Rw/g85sJGphAZrvH5ci9NlrmUd7mEl1/NsrSKYc4qU=; b=Spi1Q4JnB3TMfs8OlpWnbKVGkG5Qb26lsBwFQQqJKc+jlmzZ6kdetGTb9+vPuPk/ut Nx0bsfaC6+qMn/ynA9S137Thizl+cYyJ3pEl0xb59q5SZp4CzoqxJH15X16DygqWBfGI rn0w7JqofcZyhi05bA5P6UlaYfb49EJUw8nIDE7TLJQYcpbviQobD0dNar0RwB78laLp 72HiKY5eOhrzicF6DAiuUTnVWvCfvP61YQQuY4Ju3u8fogZf4H+iOam1QeVyWDmpbX5b QfaeNHaJd8xkvkNBcjCbIaWNA8X/8NyPOFSule7ym/Gs91+mjzej0b16mH4lzVr8QgiK KZnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707484062; x=1708088862; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2Rw/g85sJGphAZrvH5ci9NlrmUd7mEl1/NsrSKYc4qU=; b=bzQnjYTPWM6eWrJ0Z4CFm+fUpEz+K4/rqoNk4sED0FioC1rX8Dk0yF6RH95aAdMOzb WslXmgbFyxJspkeUbvmdVc44OzOOjgUbUufFsfyZACkmyU0oq0ZbpHvh5pPcWTONeVSS stpVOpkx8pqRO7o45MUGhkTaH4NFdc/Y15wxx24HVU4d+8mWO9eHG8Sje5ThQFBmsSGq HEUkLRxnz0BtEOQrzAzqUoLT4ddzqUYg1mcF4huLJsQgeJqoBLqZhOYaCz8AOKE+u/w1 l3jy7f/pAEPDUd1f35T1w1jJPPa/nHGnCsOQlJKX6vRUv97Nf/rxIyBDnX/vwNXf6HXD tp7A== X-Gm-Message-State: AOJu0YxB+abg33akCza7FX1doZUdbHpAOABcrNA+YFHANEtWCgsoLnAB CYCeas6SYcI0ymH2/3WEeI6b4xAmS5CNO9AOrUEXHJSSP/pafCHHAh1uysthLGD3nWnFhOqqSx3 l17sB31JEYB8i6koDJ6cmTblSKqr0qmkGl/wd X-Received: by 2002:a0c:cd03:0:b0:68c:7302:8974 with SMTP id b3-20020a0ccd03000000b0068c73028974mr1030374qvm.30.1707484062427; Fri, 09 Feb 2024 05:07:42 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240205-b4-rbtree-v1-0-995e3eee38c0@google.com> <20240205-b4-rbtree-v1-6-995e3eee38c0@google.com> In-Reply-To: <20240205-b4-rbtree-v1-6-995e3eee38c0@google.com> From: Alice Ryhl Date: Fri, 9 Feb 2024 14:07:31 +0100 Message-ID: Subject: Re: [PATCH 6/6] rust: rbtree: add `RBTree::entry` To: mattgilbride@google.com Cc: Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Greg Kroah-Hartman , =?UTF-8?B?QXJ2ZSBIasO4bm5ldsOlZw==?= , Todd Kjos , Martijn Coenen , Joel Fernandes , Carlos Llamas , Suren Baghdasaryan , Christian Brauner , Rob Landley , Davidlohr Bueso , Michel Lespinasse , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Feb 5, 2024 at 4:50=E2=80=AFPM wrote: > > From: Alice Ryhl > > This mirrors the entry API [1] from the Rust standard library on > `RBTree`. This API can be used to access the entry at a specific key and > make modifications depending on whether the key is vacant or occupied. > This API is useful because it can often be used to avoid traversing the > tree multiple times. > > This is used by binder to look up and conditionally access or insert a > value, depending on whether it is there or not [2]. > > Link: https://doc.rust-lang.org/stable/std/collections/btree_map/enum.Ent= ry.html [1] > Link: https://android-review.googlesource.com/c/kernel/common/+/2849906 [= 2] > Signed-off-by: Alice Ryhl > Signed-off-by: Matt Gilbride I wrote this patch, so I will not review it, but I have used it in Rust Binder, so: Tested-by: Alice Ryhl