From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34E91CCA473 for ; Mon, 4 Jul 2022 00:28:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233098AbiGDA2J (ORCPT ); Sun, 3 Jul 2022 20:28:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230245AbiGDA2I (ORCPT ); Sun, 3 Jul 2022 20:28:08 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B9FC36276 for ; Sun, 3 Jul 2022 17:28:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656894486; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=KaOqL05Ps6uhrMzHuCOajL20Q0d9A5HdIZuOghHczsA=; b=JIDx6Og8Gj6ddCslj/9+hSBi/N3OjNMkLVfDr5O5wVmFZSl5QMg1+CoLyOCSj5/IikGKsv eDJfSHDgPpnjUkvun30Ew3FLYC0xfwubmxdeD2k+euGuD90clztNmuE9GdOyHkEvHuI8Sz PcFjyDu8b5JLucHu/F+Ids/djoz4D60= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-357-qv5Rm-zuOvCvTDAA6QhQxQ-1; Sun, 03 Jul 2022 20:28:05 -0400 X-MC-Unique: qv5Rm-zuOvCvTDAA6QhQxQ-1 Received: by mail-ed1-f70.google.com with SMTP id h16-20020a05640250d000b00435bab1a7b4so6030523edb.10 for ; Sun, 03 Jul 2022 17:28:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=KaOqL05Ps6uhrMzHuCOajL20Q0d9A5HdIZuOghHczsA=; b=z33Q83egXltj6Wb4dbwEjqGEvlZnLvb39UcmnCg7aUh4naWoxb5UQk5Db/fJiQnYN9 GJP0WX88TPSQzoi1WUzcKINyCEbVTeMW3hyb3bLezhJfGxWVjpJMMfYN7Eu5UDBJFZE/ ar1EYNedmnh2yse3GozCooNhDZBU8wiGcQ+UJ5JjHcHe6ogQqufCLQ2N4TkY8CBW6Zzl hg8AASisc+CjKut7kgQ17x+EoJlUMg5/grdbgx+/Vi4wu1x6sdyWu+tnfQd4KuBpSIDv cLt5frhdn4vHpwt5jJe/kL0GUg9yPHHY+asw39HaE3SlCbmQGJqiNK4Q0SrduPNgaJv0 DRug== X-Gm-Message-State: AJIora+shOXlCObhg78LummE0J3K2juj1sthJn7zmFOQ7KxytDOrZDx1 OUqZL0VyK3p94jqfSBSDaQ2TrIx3KRChfprOvlJ5jlk69mbFa2JUKv5ljKz6zsZyaJo6e5BRJsC hARWwAA28bIBP0iHrJmruZLOn X-Received: by 2002:a17:907:9488:b0:722:e5c8:c647 with SMTP id dm8-20020a170907948800b00722e5c8c647mr25659275ejc.291.1656894484452; Sun, 03 Jul 2022 17:28:04 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tcUAU1lKCz9GNKy7EtOXC3/ZrGPSQpn7jqZTgAk6gvwW3u4/BpvwAo+0cmPpJ0xoClkP5dRw== X-Received: by 2002:a17:907:9488:b0:722:e5c8:c647 with SMTP id dm8-20020a170907948800b00722e5c8c647mr25659267ejc.291.1656894484297; Sun, 03 Jul 2022 17:28:04 -0700 (PDT) Received: from pollux ([2a02:810d:4b40:2ee8:642:1aff:fe31:a15c]) by smtp.gmail.com with ESMTPSA id jz2-20020a170906bb0200b00726314d0655sm13524634ejb.39.2022.07.03.17.28.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Jul 2022 17:28:03 -0700 (PDT) Date: Mon, 4 Jul 2022 02:28:02 +0200 From: Danilo Krummrich To: Matthew Wilcox Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] treewide: idr: align IDR and IDA APIs Message-ID: References: <20220703181739.387584-1-dakr@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jul 03, 2022 at 09:49:14PM +0100, Matthew Wilcox wrote: > On Sun, Jul 03, 2022 at 08:17:38PM +0200, Danilo Krummrich wrote: > > For allocating IDs the ID allocator (IDA) provides the following > > functions: ida_alloc(), ida_alloc_range(), ida_alloc_min() and > > ida_alloc_max() whereas for IDRs only idr_alloc() is available. > > > > In contrast to ida_alloc(), idr_alloc() behaves like ida_alloc_range(), > > which takes MIN and MAX arguments to define the bounds within an ID > > should be allocated - ida_alloc() instead implicitly uses the maximal > > bounds possible for MIN and MAX without taking those arguments. > > > > In order to align the IDR and IDA APIs this patch provides > > implementations for idr_alloc(), idr_alloc_range(), idr_alloc_min() and > > idr_alloc_max(), which are analogue to the IDA API. > > I don't really want to make any changes to the IDR API. I want to get > rid of the IDR API. Forgot to mention, I noticed that there is even a new user of the IDR API in next/master: commit d8782ec59eb8 ("mlxsw: Add an initial PGT table support") Maybe it makes sense to point out that the IDR API is deprecated and XArray should be used instead at the beginning of the IDR documentation file, such that it's obvious for new potential users? - Danilo