From patchwork Fri Jun 7 18:52:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sid Kumar X-Patchwork-Id: 13690601 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 69BE4C27C53 for ; Fri, 7 Jun 2024 18:53:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 271E46B00A5; Fri, 7 Jun 2024 14:53:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1F35E6B00A9; Fri, 7 Jun 2024 14:53:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CE9986B00AA; Fri, 7 Jun 2024 14:53:49 -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 A3C156B00A5 for ; Fri, 7 Jun 2024 14:53:49 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 59F8B4191D for ; Fri, 7 Jun 2024 18:53:49 +0000 (UTC) X-FDA: 82204991778.08.945DF43 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf28.hostedemail.com (Postfix) with ESMTP id 0D317C000B for ; Fri, 7 Jun 2024 18:53:45 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=mmAZov7q; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=CeUOI6fe; dmarc=pass (policy=quarantine) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf28.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1717786426; 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=FdLnC6elJcTLzta3VDOmOxQ9vkOouE2N1SeWytMh46M=; b=ce1OEJjzoXU0tvtEjJpBzTkvjHwcCqz6yGmGcZIodjaP2Yt7NHfCHZsRxg86vdwSseLaYe C6gqoY+966Jzy8sqzWHhYbuEx9YKuvj3QwekB1kHI6cetGton3OfBLVX54kQ6TEEboTivP 7nQi2MCI3cwu/XBTesn9fvHJRACALVY= ARC-Authentication-Results: i=2; imf28.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=mmAZov7q; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=CeUOI6fe; dmarc=pass (policy=quarantine) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf28.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1717786426; a=rsa-sha256; cv=pass; b=YKu57TaluS0L1yh9qLPnGNJmwH5Gq6yJjQIMnszEiKo/yFXDPpuX95X59BPe1J9MvMSDLD /MYRM/7QPZrdtMDe+4gr7lciGtzlUEB1JT3SMSqxrs07cle0V+1VHN5YOwTuxcHo3fX2k/ C2B6F9fYWdPgGkBLZ4/UoDnw/QGzvdg= Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 457Cv6SL010387; Fri, 7 Jun 2024 18:53:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc : content-transfer-encoding : content-type : date : from : in-reply-to : message-id : mime-version : references : subject : to; s=corp-2023-11-20; bh=FdLnC6elJcTLzta3VDOmOxQ9vkOouE2N1SeWytMh46M=; b=mmAZov7qNpW/CQ+J7pvpPoJ9rERDO4fr3jJZI5UDjuO0vbeIZJr1ij9CiryO9Naif8VU 37lOX2S+lToXi/5e5KQSgeoj9bGxJesgMhcRjGNGVWixtYrSxAL9kj02sl2/pXU61EjJ 0bhZjfKL82ThOLotCsDk2S/Ak43xqMi667CTJqsvf1PK71fiFm4IiLs0M374hc/ZEon+ LzwNu48Q4heSPUmVMAQxGVZAaUI2aIaxEJkelOK6C2kNPmBBvTZaVgcSBKdN9Sc/kB+a lu3Yevl/wjbj4bh8/g52BEqgaKwC0z1CpjKGcMB0xFCwXUOVAgwNrdGte0SR+XejuViC bA== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3yjbtwe89a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 07 Jun 2024 18:53:43 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 457ICR4H023938; Fri, 7 Jun 2024 18:53:41 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2169.outbound.protection.outlook.com [104.47.57.169]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ygrr2k7tv-6 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 07 Jun 2024 18:53:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lauC7seCsn1sPsf1tyJm23MhZTicEgnI3c+jWwhKiVBLjLHaqSqXQNlYVxznqKfS6yot9N1HKTEcLCHHS86JYdRa8ikypD+J/D27cE1O7bLxAro5r0+WwzMeg/bZ+3BodmYieYIZvi8aNs3W5B/m86oSQwU9tEmKfPYHpYO16KzLDKPof6PMVJPvS+/c3WHQuGg3Bf4PrlRtdFUYBUXwTHrj4Ajdg2LiZgYa4bFMMOY2pYic4u9bCWBLRPy/brS+Vi7kkJ7v5B3KnqtB0uZ8B3LV69mGD8MiHbl4WLHxJO2KReFWbMMVtaWKvwK//fk2Dyi2TvafvwjI5whmq6MdTQ== 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=FdLnC6elJcTLzta3VDOmOxQ9vkOouE2N1SeWytMh46M=; b=KlyO6JCWMQOENTQsL378WuGDQt26akF6kdrhYHkwEnEg+zfRlJ+a+dUuIhVJLM6pkPeN7vD0eidKa3ZRPTqhYBHP6vIc3g4z48SSPW9Gp/GO0szYH3h/B5OCOYaOrJt4B9nKDFQgezX9kk8S39HidVXHtDkxV94mP3NAS5fHvTrPkK5Al/VQ66QFUGKM9KYr+xWFpYykCXYy/H7vu7seYxa6Rc6gsBFuomAisj1mXLj8LUigAqWm89Tx2znwXOjLdTPWLEuXAj71+RQon3UeJyo2zDo6hzt7EkWFGbfcL0eOmum7gfgTFoOy85slAq4Kyiqc7NhqfCwfEcPN/jDCWQ== 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=FdLnC6elJcTLzta3VDOmOxQ9vkOouE2N1SeWytMh46M=; b=CeUOI6fe9sseLBeffNK03C40fud03HNC4nKgnKGCK/7umQerBcX+PoXqj2zNYPF0b+y9SI0usfmYZHxclwXm9G4+hmkscVQ2WdWmw/cfr5uzh8QgiA6OCVs7J8P3zGhBCDx8l2Z31UxznbEeOZMFAmKSg9ftORfDsnD4wMRbFVE= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by SJ0PR10MB5629.namprd10.prod.outlook.com (2603:10b6:a03:3e2::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.26; Fri, 7 Jun 2024 18:53:25 +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.7633.034; Fri, 7 Jun 2024 18:53:25 +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 v2 09/16] maple_tree: use store type in mas_wr_store_entry() Date: Fri, 7 Jun 2024 11:52:50 -0700 Message-ID: <20240607185257.963768-10-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240607185257.963768-1-sidhartha.kumar@oracle.com> References: <20240607185257.963768-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BL0PR1501CA0024.namprd15.prod.outlook.com (2603:10b6:207:17::37) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|SJ0PR10MB5629:EE_ X-MS-Office365-Filtering-Correlation-Id: cfb1a767-1a42-49b5-b21f-08dc87231c75 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|366007|1800799015; X-Microsoft-Antispam-Message-Info: SOrt0XI8XnAPZew8pEleIYc0pqE3lq/s4L4eIaqUwyHwPTvMD2vpEGtIq3iti2LRlcsFVPwNuiFcpGJS9BePNkEwuHt4Jy/p7Hux4iXqql++b9P3PKmnYekrn7ymsF8cEVyQFWwoj9DGDTE+BXxgb0M4zWYB8T/SVUrFiBqqljiiapCnPdemDMUdFSWsTYe9qOjsB9nthd9olSpVZGSK98IyCN+qhSJuAUeuJOQafHWO6BFLg4LiYmDHD/2nYEg1N/JR7Ngg01sgSsFLd/cEsB7biTTolmYHNzywe8v6+zpeTr/rx+m6GYYLgUY+gfNg1Mbt+t48kyM+h6jAAE+576SGcoAZixf88osHpEQp+k11UWXi3O32DWxh56mM9y93wETPhW8gRHJAe24hf5s2+kiyRQUd91iY9inBvaX5vJ/DYw0x7Nr+w4yIKVld3grJ6XGQMuqCXltkX3WaJyUSjG/fOtrkkjoE4vb8OoB8NDVPNPRBBou13LhWGNBa2udM2tZ+qxrjGtYrLIniVBaCVfY0tlnOrD+1nKHg6B8LpOym87hOw858XeNzX9o69kgDodG0OSAsqnaMKg3E+V9yogTsrDYdNJBlbkcXdI8ONaszT3J0NaEgjOGUZycNg8tN940RoRpEgWFlga1d7TsUMrkZGKN/6//x9wdgDik2R7++o5gRzmwjSUgFdPkf5blc7w+iwUc2M9h31JsLx3x4LfPeeZtTcZCXGBKbPFiK0fZvG7gyq82iMucisHkBeuOXt6t/5URXxX60fR2A9NsZZHEzoiQhtCes/xUz8mvUdHNtyKf4RiEBKnvaeMdRsE5KTVhXWRacdqMqck4hPg+ij/SiOVJa91CzhekY2wZneyueYjwVgTlFt4AqZLP+lY4v9T7xFq3C9me0ESg9QnQKK0gx0U/CzxG3M64Wkw28z1BFuntT88vnFQwTUFB4hrxVWGFR2i4Y3TfQFM7Vg/UQwL4Z9ywyQdkNndmhp17+pcdwWqQMN+qp6BTLWdidyCr2ofaCfQUBF3Ybw0twcZNdi+p14CDR2g02BNI6ACiIS6DMHEB6fxvzXsPsVaSrKHCj/59Nej0/jAgLepndm9zezi1HEvzBPtlvudhsgBBHvxGZcwOOYzmRkn5Rs1GRuDXFvsNJ9K488csx4MSaj8LNlvLCS14FY3vEoBawpVr4tPKxz6ARBoFsJn7cQJuKUl1iQ54wHBb3I5a8Kfv2sx2Y/rsbqgDhNUOGY9UkDyE4VmdZlmsaDb3mj/0PKDY/DTZXZl3N/cbokw+vopoRYGvQE6dveFjiFFr5UQQU1gLxW9TEMr3aTCEjMDpCkeJX7TBE 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:(13230031)(376005)(366007)(1800799015);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RBH6gLPWmishdK9gBpk9s0jWJkpqwagLssRkdcKt/N5Ipin6B8NmWchAaDdXH66nEnEUCYORdyvUXZqZTto44J6Lkxyx0cugUlk4AB3uOAYc874/Y5GuRIjJt3HxkmYU3AbkU3LumKIGV4+kgvIVRK6ircmJuXTah/cwwaacMkl1xsz3QKpvx1wvf0uCuPwLrudl/cDRatxlxzRDO2qIGVRN1OAD7uT68zCBcCxzl14ARsxtrjncORxTn3ZKyJEGPl3sdDzvS0Vr0mlT7oBnV26qpdKxumukbU4uYtoNg0I02nahCXY39sgGxLIFDws7aav5DWQou2j+4YjhsJJWyheHWLmTAKme4mVQatLJWfY3WjhtVCfORTN+W53Fe4VBLCtglch7xTBzbjQvZztP/EIA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L0BwZEryaoL6aAB8f5nI/pRq5+BKXpZPPslkTqcPzGByqVbPYS787kx1aQ5c6sAeqpb2F+WOCVQgCIQEL6ciJwNpAuGlDM5qY72rGESbWtmFQKuW2Cht4h0ZpzZJeS5CclhGpCG6XASawt9JcCgs= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 0ARf6/I/EUltTOs/J1BNkkDQJSfkHJcw3i8AC/ZpKcGK4Gtnn27RIOZE1HV7h5i9yU7PSZDOVYrRhv0eAH6zJ8oL6MBBqFwtZQAfsnP3GRmQQl+epiGrFR9uUKkgoPVD4psMxlpyAIfQwIBVnrZ7pHwSDRY1AJdinkLAMCLH+kd/7QDKLhdbng5MIpg8ngiAWpFk3Gff7QsyKWtSc2N8joNzB1bW/VdtQoDWJF9C8JO+IV7t4UDjEUKvZhoE/F+roGWn/WDgCQF0cgw6e4FRI0fa1qrAbt89Pg4Zk+ayeuCSAizbtIwfDE0IRTt/9czgREFaDpmYVt5oMJeCs/uOb/ZKCzz3nhY8vQwuC+rW25czSCgc03WK96aUus4joYtnwYpEburWcq/hM9law6/R1nT9nmD6H0T6w/GxOGnWReSBbYuQV1Cn/RTxnrKiEf80qoFoawdFRyYVsktNabzAtlpQVMiFRtp37uxEwzFUt1mZF6Awdm+yFh1dzAgupFtxILcziw/9+oqWXAeNcmCJL+mqCMnYfb06DO7jM+Od6U31bFrB6qdZ8ZXIoFLIan5IuWLe9Dt42xEVlMhj35U4pmcVowaHgg7cPbilRMeM/2Q= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: cfb1a767-1a42-49b5-b21f-08dc87231c75 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2024 18:53:25.1942 (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: 51HFLJJBeNcuU66D0H5AVBF6mC0NA9xyhsw8lrlAV1otaidoPFCvNp5RZuNyl1Nskd88T/1DdLWZ9WG81Vj4ZD6Zv+kundTB/du+8cnells= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB5629 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-07_11,2024-06-06_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 adultscore=0 phishscore=0 suspectscore=0 bulkscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406070138 X-Proofpoint-GUID: 8nkelKO-z_5mcRZ6sUp_6VQLTK08V6ol X-Proofpoint-ORIG-GUID: 8nkelKO-z_5mcRZ6sUp_6VQLTK08V6ol X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 0D317C000B X-Stat-Signature: 7awpnyenzr3r7fpo9tfj3gcea3h7jxp7 X-HE-Tag: 1717786425-734179 X-HE-Meta: U2FsdGVkX1+jzJl5FPFCyn8XscC4XkjyroHoYUBnB2X6tIiS63AGTNLoBpVEAOz9bJYrLGFGf+Fj/pntD+bjMuIptnZ6vKoHrKESv/lqfSUWUSEVRpp5D5acC0JLayoOubDpd0LoiFXsetUqJEdMV3BJ/HgcL23wrc888IuIejylH0pyCGI8zg4IulM6lsR58ipmXVzX0ZN6uqtECUR00L4NmMwIMsD4aFycD2ne7vpea5ov+Y+xmgSPqN0SuLYLPC2oid3rHxMaZy5SEm0FOTP0eS5SvGFbf0hHd/LeYP89wXiH5UJckkq08ZIvO2PYTnY3tRh9ZPLC+T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B2EH1hEtiSHZKe/M+2HYa+ZU5QLb6TlLMNI2ibBsQ1Jmjsw== 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 | 55 +++++++++++++++++++++++++++++++----------------- 1 file changed, 36 insertions(+), 19 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 91b18eef81e1..2c42e99c400c 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,27 +4206,42 @@ 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)) { + switch (mas->store_type) { + case wr_invalid: + MT_BUG_ON(mas->tree, 1); + return NULL; + case wr_new_root: + mas_new_root(mas, wr_mas->entry); + break; + case wr_store_root: mas_store_root(mas, wr_mas->entry); - return wr_mas->content; - } - - if (unlikely(!mas_wr_walk(wr_mas))) { + 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 wr_mas->content; - } - - /* 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); - return wr_mas->content; + break; + case wr_split_store: + case wr_rebalance: + case wr_bnode: + mas_wr_bnode(wr_mas); + break; } - mas_wr_modify(wr_mas); return wr_mas->content; } @@ -5590,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; } @@ -5639,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));