From patchwork Tue Jun 18 20:47:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13703026 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 205A8C27C4F for ; Tue, 18 Jun 2024 20:48:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 645E78D0053; Tue, 18 Jun 2024 16:48:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 551508D0058; Tue, 18 Jun 2024 16:48:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 009578D0055; Tue, 18 Jun 2024 16:48:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id AEE0A8D0056 for ; Tue, 18 Jun 2024 16:48:43 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 366851A0B4D for ; Tue, 18 Jun 2024 20:48:43 +0000 (UTC) X-FDA: 82245198126.24.02C3C71 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf14.hostedemail.com (Postfix) with ESMTP id E2243100023 for ; Tue, 18 Jun 2024 20:48:39 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b="mJM+sdI/"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=cdNp+xx0; spf=pass (imf14.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; dmarc=pass (policy=reject) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718743714; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=eSYIOHTKRzu7IUz6tv4eIyVN7yGr4LGzTFAAcrhpaf4=; b=Yma0EkkumRtHe0mLwbINFI3dxhJ3K/fb1BTxcMdoikx1CDUprLs4KJmamYwsiSpQNTxcjl oksGkG2V3aryOrWpY9Ob8H2mUW/jEQGSKWbCD0G5O6ht3OXTtN0NsOqBV49SKThX93V/tz L52p7nKaGKzBs8SAE2KyKt2W5r+Hkrs= ARC-Authentication-Results: i=2; imf14.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b="mJM+sdI/"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=cdNp+xx0; spf=pass (imf14.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; dmarc=pass (policy=reject) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1718743714; a=rsa-sha256; cv=pass; b=VLQMdM16gfYHpkgF2WJJzDubg1o3++D8vszwp6jVNvIMLSQ68gAcUXFBRSiEFU0aqlRHLO hoRBrfgjUlP6+RHNRnyi7/LhjnpVkDcEk0pVoWNc4nVFd6BysQtF61UN5DEce4PJWLjY+r 0DbS3TrkrcSQbHTHMINfxsUhGOOWGsM= Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45IIUqvm005347; Tue, 18 Jun 2024 20:48:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-transfer-encoding:content-type:mime-version; s= corp-2023-11-20; bh=eSYIOHTKRzu7IUz6tv4eIyVN7yGr4LGzTFAAcrhpaf4=; b= mJM+sdI/QHeNqSbSSlhOcxN+FtwLkK2OAvhh1h9mIQa1GJKTLYQePY8uS7+fZE+9 gq/BtA3R+TdaUO59teZxWJkP4+d9YvIGDrM2SoGqQQwELJOiYR+zVcYdWV0jAdpt eiFE0GrirNphAR1dNUWt69fRPckb1Yxq5G7vEp1B9Je6uFLJ97GZjMtLz7ZZYiNw gcuFc+JCwQuwPRk9RT/Pj8nBlvgkgCrKbkkoij71JziX6Pu6wSeyJvLhhGQR6LvY VKuZ9AQODAgcQFXEYuIIhe+PeLcv/ppbdL78wkuL+QqsIMEFZtW+gkTBUTlmaNrl gSJBxh86DRz+P0YI2d5H8w== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3ys1j05xam-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Jun 2024 20:48:33 +0000 (GMT) Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 45IJlTIQ034656; Tue, 18 Jun 2024 20:48:32 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2168.outbound.protection.outlook.com [104.47.57.168]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ys1dey4ud-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Jun 2024 20:48:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SOir+CvolmvIj/F9c3zLO9xckFuE0N5eSibwZz5ZOwqy+h44u7w1lf7hBVwIoa46xzhQdpcTu5Y/3LVwLcXxG7dvAb5R0JHsSwrge0uNwhokK7JVABq5X3ujhCVB9K2fRYhYJyRUarTRepDtgaLPiNXVv2r0mVgf6zefpm5LVSm23gKI3HkBZqkZXNbxGF8vOLZnjNVupTIWXEa/dwNfUaUpYDTXUMz7Ze3sqRsc2lYqTh1/E/QYFH7jcS4YqwSC/trLUfZ/1S5l/UTCIbr3V5OizfEM3YBf5ywcI5gtzlsH7/XqH3OoGEGCWZBFLDdaIjtlIdPHozZB+wawNXrT6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=eSYIOHTKRzu7IUz6tv4eIyVN7yGr4LGzTFAAcrhpaf4=; b=lDc+BjBTK21ORjJEZOMGj+VWW191+flXT9SIU518zD6q6oYLc2f+Gf2Cuh663FEQ7vKbLusNzd9jLpRZF6L/R7GCVEbgqkK1xgdbmfzvzMOnQR7GDoPxR4BusVGtbJ5pDOAoEnjZDFgkEk2ZuLcaqsdHk+Pgukdy7wa/eFjrM8vd1wWW+yJwSXW8vq5o8xQE31Yni3lqOL5OQsRABzGKMc56k6eTdKw/DoFIJ9QJTtGDRt6U8ROvZ7LeXzYWlm62fFDGstkGJ/S4OTOnW7gHHxKHpAE4VaUWDyS5uhVQjylKCAn1i+J1r+1I36/DwMJRlUwZhbUuXMxIH50DdTLC/A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eSYIOHTKRzu7IUz6tv4eIyVN7yGr4LGzTFAAcrhpaf4=; b=cdNp+xx0KUwO/8P8vP0ZnNVcn7P6Gc9Thlrwlq8yip4Bkh8brhGcRB9OPaX82VXxHe5Y61Cnq35uohoyP/64QglZqw/1LJpx66NnYJVTFZC59ZyhQEGqefmEjxNDkit/Jeh0ovu7IPRv9c/hYDrmbU5i7618m+Ga4bNTIwuwUhw= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by CY8PR10MB6465.namprd10.prod.outlook.com (2603:10b6:930:63::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.30; Tue, 18 Jun 2024 20:48:18 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::eab6:6dcc:f05f:5cb2]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::eab6:6dcc:f05f:5cb2%7]) with mapi id 15.20.7677.030; Tue, 18 Jun 2024 20:48:18 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, maple-tree@lists.infradead.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, liam.howlett@oracle.com, willy@infradead.org, Sidhartha Kumar Subject: [PATCH v3 09/16] maple_tree: use store type in mas_wr_store_entry() Date: Tue, 18 Jun 2024 13:47:43 -0700 Message-ID: <20240618204750.79512-10-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240618204750.79512-1-sidhartha.kumar@oracle.com> References: <20240618204750.79512-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BYAPR21CA0029.namprd21.prod.outlook.com (2603:10b6:a03:114::39) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|CY8PR10MB6465:EE_ X-MS-Office365-Filtering-Correlation-Id: f674a0f9-2001-488f-6739-08dc8fd7fb98 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|366013|376011|1800799021; X-Microsoft-Antispam-Message-Info: 2zl6mvJ21ioLsaISeb/eOkTBYM9pyAQ+0GPn0SFl11lhssbl17AvCg/BY+LrPQgBIiKz6wHmacP9AarLnzpIrULkxaPF2eFVQ/UkQ5yCuQkJvFq1NGwhGiCF+s9jmHh3UViAtffzA92b9OcehANFNrXzQ1eHfQ3KPUGbDdlxcN8UW0yV6ePhYgIa80cnDPgBBNZk3zh+1MpsaoeJIwKnjUNq0fs6yIgtqNfYpmquOkE7y4SEAqPMEL0Glbe4pm1hFne94fJnzsjiiEx18LLGIgADIb22JMPc/VZx1vf/Zm9sMiNGIMebj77Rce8gbt4OdAmT1Tpx/iyQ12nuftEflUtdiB/d5Kw6aPo2HSeRvqNudNomYln0KNtsMmIrSfYF+SKWy2+bQrVX+Ch5GwWG/oQUkZhOM4e3UZ20NjPffpnpoGuGPZfO8mE9RsskiIHaECK6a5lV01Vwe65dP3qDoWq5l4Es3+AO1AvZ4UkAMe1a32EcrJXWnBLDPFmHc0D7ByEondv+D1KRetUwN+OGW83H0e4U4E/7dVX5CUn3FGPEryu/kXDq/wcdOv2ohgKdd0eayhislMFh7xOOhdBR0sp7Luu4cEqrlCeJptcLKfUxNeGqxqGdp13lZHCiEAR5orP9wdbRs0Rxun7PKgLi78C2VCyNsaQHGsK+ExlqTCwzmsYgTUnEMIIqzJA1XO8jlDcrEAQcivs/E0n6wSMY88CszLOaaTtgI47yKXOGlzFIcJKtv6WwopDlSy+V0Zn6no0GKJlQm5gEiI4onXcFdQyKC3b2l48WHmi16+6RM4o7aSYlI47iR/Fovy+koMrI1FlSzgEKA/BkotDgksyhFHxqEpL0mgFmWjp81fHPsIhjN8Hlv/tIYIxkxwSg/+iRkR1fZa271f82Rg+Mg6yrSlUH9Np9zWBVvbeHG9WWls+Gf4lK95mk7B5gm+rsXVxw8hPnvJh7TvKin0cdEBTQrJNUhis+FifBb5Y+vWv9xtdhzwuYoQE9CvEHlYrauQP+ApLzlcEytJ+TVx+gsfGul7jWLNRk8yXNDHyYm0vLWj9nHAHsKjpNByz3Cw7kwWuGOH1wtd6DAV/8XeCZIf1oLts/64q2Etn99i54ewGARLQD2QIYj9IZkxdI5YbE9LCTx8GpCfC3U+vlJp9DCa8kPQlkz8c8uWsWDOGy5wAQTZFgCW/eCvOxkNvsPgHOsXDOECU6d4z6E0N2D1tv497ZmPGi9EtKAIIpc+CrTcFwv1eg0iJoraVsJtUxHlzFZGTXor47fISbc8mdGq12tTFHzQSvCWpRsDnqjmeHcXwOvWblXwmEdhGa3YLVlNOzuAFM X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR10MB5113.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230037)(366013)(376011)(1800799021);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1cWqxqKVCo8RoLdZiPbiuZxOyV1wdeQ8LSD52ze3ygXneFXUwdKzYTiZertwZh8TEWK0l/OhMbKVRVh1flMc3Pb0D6Piw/GQ3PHJGtWbZ8l977VLX4fm+M5wNYyzckoFK2fwclLV3ueVN/tCo+fjlj5i+adyqXLKrP2e9HhuEV+TdAzyECxXW7PgLGPTBJMeVxJ8LFFPZy96alOG4qNPz4cnj5cnuu5Nz1KVDT+PCkXQM7wmly0Nmr3GKc3o+Z6cMEYr6bdJThyujW4LAhsZXZHGCZCyI3tTMSykMrYE2uggYqjYDrvQP92f2Q+Zv0e3coss0O7B5IFtdpS7D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Ory7mjJmpIZw62b/M1fY6qJke80DdfRuLd1HihzzWoNk2dZG+rdXshIEw7vf7JCXAvgG3T8zBmiIDTFb4+vxLeh8PHuGbjI38j0sCk9IGshDK/COP5CaJpApELP1zXHJiIP+OvXTTurX5OilWGqQSTYkJw/Kv2vJFsxjOiPYxGS7QMziY5cHJOD/SDdj9XxowuNbMy/ruO0GnZLVkW9LIMLxbCzbT8iOGWF6UJPp5AMU= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: ZL8dQ25Ukl+uQ7s5qgtypcxTFPUoLfZo1fVxlC9/5z6mnP6vpuQ+b+5GcNrRXa/QS3UZfFEKZHhKPdDENjfy6tRQnqWcpGCwsr8v8ruUHIAHHB9HAKvb2Rhdp4HhMQiiUd6mJJ0zCD6QFfbbgRshFe4Tbzj9UiBAlsAyZVaYch4Cl4y/9zj141Zq1rzsgp6SK9oXl7VD9T9jdUG9uFckVi1ukjyRsptaPxLHfTIlNLHN/diGrxQiunnBsTjIaDivJjhrxu8x4s4PqA8pD90y0wpH1Fwl+zt/YMwSTMyShr/lpAdh9W5cmZLrLxzfchYez0usaqgfbYElkRuZSGEPbjAfNWsZzE3pBGlf8iRypcxDv5FLkSZeORuGC/i2rMxDkFrvYcEDXcuHOtduXPn+xVNyLAVdiZOkfMcJypXF0kcUqFPl75Z3rJZpTzBJWkBaCXtDHraHDNkND1bhhAP4zBqdvoAv+bC8yWlsj2pJ9RvVnsM51q74BO7YYYztsJ3bgq8ez8fXHLiO4GgODHsuScDe5rhiR20c+RD3YEGMLkXwwlWGG3D25cbgmq9ukZYy0Fz/+ICovtZ1qsbSieb6P4M1zqXUldoSMIyBR2LjUek= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: f674a0f9-2001-488f-6739-08dc8fd7fb98 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2024 20:48:18.2859 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: CArCkYCB8THhFQuY9MzIqKcFq+FDI4ZyRW31mlB1QiKVW9MbCeQJoa0ScUBw0t9dLzRq+NEIITuoMrgoqO4q84YTpxlvIFaLuMHh2R4lK3I= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB6465 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-18_04,2024-06-17_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 mlxlogscore=999 adultscore=0 bulkscore=0 malwarescore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406180153 X-Proofpoint-GUID: DvFan6nl07_jfjjaEFKhP8QRb8ieQPi1 X-Proofpoint-ORIG-GUID: DvFan6nl07_jfjjaEFKhP8QRb8ieQPi1 X-Stat-Signature: 8bafir51kqaz1qr5kc7wydrxgxrq8ghn X-Rspam-User: X-Rspamd-Queue-Id: E2243100023 X-Rspamd-Server: rspam02 X-HE-Tag: 1718743719-882082 X-HE-Meta: U2FsdGVkX1+3Js20zVU92ei2nwBs25EfrS6PL0BAsCmISNLroqdfLVIOJgH8bAl6QXjnmE/BMRdb576adI0DZfslD17ix2t51BjBNWjxz7B0S1glSnSz7UnDzZnmGAOUasm9ilov1n8oH45e4qUWzuD5Rzm1WBddasSjtY9aGwr2xe1t2SoLRypKzh/P/Mgl/4MRRUHLbh+2Vn5zCGfk+IHQIrFVzJpFZaRVl5O427ZFfpS7XvFMngpTd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GymodvHWqagFKdHhCd92lmeo8WhaCKihhv+UTJc7tYz50olaomSJXyfpFqiSFdN9mAby9np7vlqOuUJ4V3LujQqncvADOYXOckZabAGls/enkW1ALu5r6/VnIpMPOusnrBkbgNg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: When storing an entry, we can read the store type that was set from a previous partial walk of the tree. Now that the type of store is known, select the correct write helper function to use to complete the store. Also noinline mas_wr_spanning_store() to limit stack frame usage in mas_wr_store_entry() as it allocates a maple_big_node on the stack. Signed-off-by: Sidhartha Kumar --- lib/maple_tree.c | 54 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 37 insertions(+), 17 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index f40732229c9a..8ae87e512961 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -3780,7 +3780,7 @@ static inline int mas_new_root(struct ma_state *mas, void *entry) * * Return: 0 on error, positive on success. */ -static inline int mas_wr_spanning_store(struct ma_wr_state *wr_mas) +static noinline int mas_wr_spanning_store(struct ma_wr_state *wr_mas) { struct maple_subtree_state mast; struct maple_big_node b_node; @@ -4206,25 +4206,43 @@ static inline void mas_wr_modify(struct ma_wr_state *wr_mas) static inline void mas_wr_store_entry(struct ma_wr_state *wr_mas) { struct ma_state *mas = wr_mas->mas; + unsigned char new_end = mas_wr_new_end(wr_mas); - wr_mas->content = mas_start(mas); - if (mas_is_none(mas) || mas_is_ptr(mas)) { - mas_store_root(mas, wr_mas->entry); + switch (mas->store_type) { + case wr_invalid: + MT_BUG_ON(mas->tree, 1); return; - } - - if (unlikely(!mas_wr_walk(wr_mas))) { + case wr_new_root: + mas_new_root(mas, wr_mas->entry); + break; + case wr_store_root: + mas_store_root(mas, wr_mas->entry); + break; + case wr_exact_fit: + rcu_assign_pointer(wr_mas->slots[mas->offset], wr_mas->entry); + if (!!wr_mas->entry ^ !!wr_mas->content) + mas_update_gap(mas); + break; + case wr_append: + mas_wr_append(wr_mas, new_end); + break; + case wr_slot_store: + mas_wr_slot_store(wr_mas); + break; + case wr_node_store: + mas_wr_node_store(wr_mas, new_end); + break; + case wr_spanning_store: mas_wr_spanning_store(wr_mas); - return; + break; + case wr_split_store: + case wr_rebalance: + case wr_bnode: + mas_wr_bnode(wr_mas); + break; } - /* At this point, we are at the leaf node that needs to be altered. */ - mas_wr_end_piv(wr_mas); - /* New root for a single pointer */ - if (unlikely(!mas->index && mas->last == ULONG_MAX)) - mas_new_root(mas, wr_mas->entry); - else - mas_wr_modify(wr_mas); + return; } static void mas_wr_store_setup(struct ma_wr_state *wr_mas) @@ -5587,7 +5605,8 @@ void *mas_store(struct ma_state *mas, void *entry) * want to examine what happens if a single store operation was to * overwrite multiple entries within a self-balancing B-Tree. */ - mas_wr_store_setup(&wr_mas); + mas_wr_prealloc_setup(&wr_mas); + mas_wr_store_type(&wr_mas); mas_wr_store_entry(&wr_mas); return wr_mas.content; } @@ -5636,7 +5655,8 @@ void mas_store_prealloc(struct ma_state *mas, void *entry) { MA_WR_STATE(wr_mas, mas, entry); - mas_wr_store_setup(&wr_mas); + mas_wr_prealloc_setup(&wr_mas); + mas_wr_store_type(&wr_mas); trace_ma_write(__func__, mas, 0, entry); mas_wr_store_entry(&wr_mas); MAS_WR_BUG_ON(&wr_mas, mas_is_err(mas));