Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1766800rdb; Mon, 9 Oct 2023 02:06:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFsY4ZITi26ZCDs8B4V3Q44DqpTp2ExSzGt21szpL7R6pFtLvuRUQWaWxgsyDajaDqnJyAD X-Received: by 2002:a9d:798f:0:b0:6bd:cf64:d105 with SMTP id h15-20020a9d798f000000b006bdcf64d105mr14601484otm.12.1696842362173; Mon, 09 Oct 2023 02:06:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696842362; cv=none; d=google.com; s=arc-20160816; b=RXfxjC0974p1CG3d/hstziPyihpYDaFAQo346kHWIiDxGGep+pRNoO858pmC48joM1 BmWizDXCjoFbVPw5/2EDIxv9bUux+4Oyye3hKIw37h6Ap2CtMWEpGVMbrN48NXz5NwRx BDe3fDaIkPexjwPt+Ua1sH505wHYZNAU6jUZj8E6RE1IANhwrat5aowoUBaCDk+piil/ 87xF3238hTbzFLfsP/okiUBck6q8OoKX6HS+CdQYyMhvAuMaMM78TSuex4KjEEA6qJee AMnoEytxW2EePJqgPhaYdah9bZaTfRwTAv88uPRZcIBAGvNkSnUBigtB2+hKUPqT+2L7 4ljQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mFyp/FJQdSo4OvDS2koRMpNI0AcMCWskpm09jBYSG+0=; fh=W1ujNbDikRM6mL+MA7cZ93eipzimk+g+Mb7QYnlff5s=; b=nXuGDw7H7daCGjDAAaBIx+KVpgIzt+66qqCQyNmNJ+mSmEg39YXFwaN1Jrv3vewuJw uvqRpRBEW7fvC6AxYFVgFDXPz2KEuleVJ9mNRmLsqnjQEQiqSfdaxxsmrc8XEWRpEkCT 8pRgsTylPqgH3sB5erctx+FP6u3LAybYAg3/cShwORpoYUltXGic0FHZMSU6WafjpkvX /irCllkH2aDWzKlWY8+8PaA42lIiu9JQWjM+Q6bRP4te6L9pw/l8NCfpNEYpkmwMNVoj P7Jq6Zecx9NqOu6MP1+Df3Ac0IO/dLrc3NQ1qKArzeikc1OTP4Z7OQInzQx0EaayXqrx J9oA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=Hpy2F+Mv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id k14-20020a634b4e000000b00565e0624182si9328731pgl.404.2023.10.09.02.06.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 02:06:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=Hpy2F+Mv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 8A79C807EA33; Mon, 9 Oct 2023 02:05:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345643AbjJIJFI (ORCPT + 99 others); Mon, 9 Oct 2023 05:05:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345705AbjJIJEr (ORCPT ); Mon, 9 Oct 2023 05:04:47 -0400 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E4B1EB for ; Mon, 9 Oct 2023 02:04:23 -0700 (PDT) Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-692c70bc440so3185106b3a.3 for ; Mon, 09 Oct 2023 02:04:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1696842263; x=1697447063; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mFyp/FJQdSo4OvDS2koRMpNI0AcMCWskpm09jBYSG+0=; b=Hpy2F+Mvb3W9VVAH4+ymsu3MU2Io7PMRqFcpwEOQ58cohJI7P0Bq1G8b11S6Vv9wW0 lqq0/xvS7z9d9v3LPm1JVqrYKc7i+nddV7N10GtgKx1u+9zkY1jWX6uT3p9klUsmLmQ6 gPS5QgGfPryWoCNK54rLo7dE793jnpjVzgVtPSbthcF70GC9/W43sD6gzMDlAc19jkJE jrr7l4jP69R9IU8zEDdRDPBfHmq/pD4xyqUfDFjL58M8bITMupPdUQRBRAKdpttB1qR4 f7hFh5on7hJ45wdOCLsaFz1F8Xx9s9F3zwVUIyx4BeFfe4bo1miOY4d018SsXgpiqB5S yY/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696842263; x=1697447063; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mFyp/FJQdSo4OvDS2koRMpNI0AcMCWskpm09jBYSG+0=; b=Ya7voWb45PTHUBhqjtOJ75wofm+xNs3oKQAAJb8gLPdjSF6KS3ZJBKEG5nU8B60tgd n6TUAi5sWpxyLMa/yf7h1k9cCoP9qdUrlhX0j7iVN6kDllcsg9kOpcMM/2bBxL+KyKKs P06Wfk/kPugt6gb1ICrg0fFnNC/83LGBo7g2vWOumhDc1zEL1vvv8cn/hPwJYzSFVz6V WEpQuQ0gZtGZ0r13zOlInQCWrQqK5EtF9ZjfBS+qquVl7KVMHj3ie0AkmBGbQcLgOnUR j67Cx0G/jCElsYVz/9QNBD3EEjs2BBrafyYjciWjgc6AI+UoYlO2iTiAPYbnK3PjytA/ eiGQ== X-Gm-Message-State: AOJu0Yw7QOECngDOgka7Rt+6MNJ8Tphtd/JLYj0OBjvzBOXHsJpjtJ+O 3MlMZCw5hkeosLZTepJqNDzpOQ== X-Received: by 2002:a05:6a00:14d2:b0:693:3bed:e60b with SMTP id w18-20020a056a0014d200b006933bede60bmr13898154pfu.12.1696842262782; Mon, 09 Oct 2023 02:04:22 -0700 (PDT) Received: from GL4FX4PXWL.bytedance.net ([139.177.225.243]) by smtp.gmail.com with ESMTPSA id fk3-20020a056a003a8300b00690ca4356f1sm5884847pfb.198.2023.10.09.02.04.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Oct 2023 02:04:22 -0700 (PDT) From: Peng Zhang To: Liam.Howlett@oracle.com, corbet@lwn.net, akpm@linux-foundation.org, willy@infradead.org, brauner@kernel.org, surenb@google.com, michael.christie@oracle.com, mjguzik@gmail.com, mathieu.desnoyers@efficios.com, npiggin@gmail.com, peterz@infradead.org, oliver.sang@intel.com, mst@redhat.com Cc: zhangpeng.00@bytedance.com, maple-tree@lists.infradead.org, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH v4 06/10] maple_tree: Update the documentation of maple tree Date: Mon, 9 Oct 2023 17:03:16 +0800 Message-Id: <20231009090320.64565-7-zhangpeng.00@bytedance.com> X-Mailer: git-send-email 2.37.0 (Apple Git-136) In-Reply-To: <20231009090320.64565-1-zhangpeng.00@bytedance.com> References: <20231009090320.64565-1-zhangpeng.00@bytedance.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 09 Oct 2023 02:05:26 -0700 (PDT) X-Spam-Level: ** Introduce the new interface mtree_dup() in the documentation. Signed-off-by: Peng Zhang --- Documentation/core-api/maple_tree.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/core-api/maple_tree.rst b/Documentation/core-api/maple_tree.rst index 45defcf15da7..285e2d2b21ae 100644 --- a/Documentation/core-api/maple_tree.rst +++ b/Documentation/core-api/maple_tree.rst @@ -81,6 +81,9 @@ section. Sometimes it is necessary to ensure the next call to store to a maple tree does not allocate memory, please see :ref:`maple-tree-advanced-api` for this use case. +You can use mtree_dup() to duplicate an entire maple tree. It is a more +efficient way than inserting all elements one by one into a new tree. + Finally, you can remove all entries from a maple tree by calling mtree_destroy(). If the maple tree entries are pointers, you may wish to free the entries first. @@ -112,6 +115,7 @@ Takes ma_lock internally: * mtree_insert() * mtree_insert_range() * mtree_erase() + * mtree_dup() * mtree_destroy() * mt_set_in_rcu() * mt_clear_in_rcu() -- 2.20.1