From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f73.google.com (mail-wm1-f73.google.com [209.85.128.73]) (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 9B54421FF41 for ; Fri, 8 Aug 2025 08:35:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754642140; cv=none; b=Bqu6wp7dsOXcBc1xt/2omeSDRmHfdTP9ffXy8pEaC6VVRHvDS/itx9MzVXxzIPGYeCTDyE995EWUql2WHKxmwrlDFE5Dt6MaCSNcqpa/rOq3D+PgpXVbnP6j/yXSsKIrxjkVs18xB9pCo9dJADH6jSP+oAThs4+mqOEbwqxkm7g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754642140; c=relaxed/simple; bh=vKceCiGfd3IVcIs98f/Qu+5VwMWaT6kmEXI0d+RFbZU=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Content-Type; b=OZPgbMVFA7BLO1eMKHFJFRcN7CmeG7B7apgu23db9Eco0qqBeZjpuIH9cg5HJhbp03NYe1xNfeKHogSkgaaW5PD16teHBd5fcQzPyht8tB5tHXjeyatTfoh5AfyDEnigX5Q37f06FSfAoRasfib9OX3X+7gSCMcuZL7salN7CHo= 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=TJDjVg4a; arc=none smtp.client-ip=209.85.128.73 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="TJDjVg4a" Received: by mail-wm1-f73.google.com with SMTP id 5b1f17b1804b1-459d6c83e2eso10681485e9.1 for ; Fri, 08 Aug 2025 01:35:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1754642137; x=1755246937; darn=vger.kernel.org; h=to:from:subject:message-id:references:mime-version:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=/R1bV19pK3qvSZa+wMMUXQzKmczCiuKCY7TytXZ0iqc=; b=TJDjVg4a7jrT7nl1J8B1Cwf8ffS9fYli8bbs3gXlxulTNUdvfWoWEin55TCTlpi/M8 MzqfPiLKQy6ydMx4fxk2WnAaanhnLl2kUVLDvKOKOzruYgEW89U73KkAUAFAj6st9+HH zevjLYWfd/rXDwiX3eaLIAtM0Oj4JbtSPb3qaEn9r0J59p9xB5JEDeisWUqiuuCURNzT RPJkDy3zf1D0Rj9sYacVDXoRO8fxenbET98/s62X8n1dfaQkaYeFyy/sfCe1JRE7tKfD P1sR9ENr3XC1+WUtTms9m0hUGqa6GsHiK8l0gXVtVcaKBb0tGpZWVkX6bCn9BrQWR2ut QU3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754642137; x=1755246937; h=to:from:subject:message-id:references:mime-version:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/R1bV19pK3qvSZa+wMMUXQzKmczCiuKCY7TytXZ0iqc=; b=JVKY8I8QUcnkqearPtB4ZdgTqJ1saXcPMhONQ1OBXyinSfPqh3r4IO8jFNEMdQE5mU COsLbV04pDjHmA0wSCI3M7h6wLXTHPWhjnDVcC1ephKndGKzPc9R3LMLR1tr6CUtrHwd uHCgpT9rdFVH016YoxufFFrU4l5OGj0geBh48pzvIAa0l4Vg4jLDp7cngNcCfSvI32cI /T/uxfbD+vmf1j/6f2ZBYlU2SyMgDsyqQgo4c9aSdvfi/WXTsdlEVjxZ1JFLluuOsFh1 57PlwFnSxYMWXOP72gnTqt06dXM+muNkWOIcbUz/Tl2jj1cV9aJ6dYSZT9MSY8SQtaXb VQJg== X-Forwarded-Encrypted: i=1; AJvYcCXWScPMSQS2nC8/1rPT5CJNa0y8qmV+jJNypFiQaUgsUjM0QVRZw+0HBhyA0Htq4CA7xpIR2U9JIVOor03PHg==@vger.kernel.org X-Gm-Message-State: AOJu0YxmHRnLeIUWU0rFQ/V+6dLaVWJbfPBEOOoAFNrYWkL3f6o/PDY6 EOuGdf69N+yucssM6Nm8J2IHqOrnkM5Mf5rO1JCStMj17xeATYSPIFiNFD9V4VaXp8soBx1kmt8 Ptyn6KztccKjZBMCLHg== X-Google-Smtp-Source: AGHT+IGKioo4/mPR0GvMMcSDoArJNfBPaVCcGranqSUlVsAF0ZD3fGdgTPzyNQOZ/mXV9Qs7yu/HmncxP2+dbew= X-Received: from wmjq13.prod.google.com ([2002:a7b:ce8d:0:b0:459:dcca:571e]) (user=aliceryhl job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:19cb:b0:459:d3d0:6507 with SMTP id 5b1f17b1804b1-459f4f519ebmr16137435e9.32.1754642136722; Fri, 08 Aug 2025 01:35:36 -0700 (PDT) Date: Fri, 8 Aug 2025 08:35:34 +0000 In-Reply-To: Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20250726-maple-tree-v1-0-27a3da7cb8e5@google.com> <20250726-maple-tree-v1-3-27a3da7cb8e5@google.com> Message-ID: Subject: Re: [PATCH 3/3] rust: maple_tree: add MapleTreeAlloc From: Alice Ryhl To: "Liam R. Howlett" , Andrew Morton , Lorenzo Stoakes , Miguel Ojeda , Andrew Ballance , Boqun Feng , Gary Guo , "=?utf-8?B?QmrDtnJu?= Roy Baron" , Benno Lossin , Andreas Hindborg , Trevor Gross , Danilo Krummrich , linux-kernel@vger.kernel.org, maple-tree@lists.infradead.org, rust-for-linux@vger.kernel.org, linux-mm@kvack.org Content-Type: text/plain; charset="utf-8" On Thu, Aug 07, 2025 at 12:29:19PM -0400, Liam R. Howlett wrote: > * Alice Ryhl [250726 09:23]: > > To support allocation trees, we introduce a new type MapleTreeAlloc for > > the case where the tree is created using MT_FLAGS_ALLOC_RANGE. To ensure > > that you can only call mtree_alloc_range on an allocation tree, we > > restrict thta method to the new MapleTreeAlloc type. However, all > Typo here ^ > > > methods on MapleTree remain accessible to MapleTreeAlloc as allocation > > trees can use the other methods without issues. > > I guess this is for some rust side error translation because the C side > already returns the error? Already returns what error? The API here makes it so that it fails to compile when you call alloc_range on a tree that isn't an allocation tree. That's why there is a separate type. Alice