From nobody Sat Feb 7 06:21:19 2026 Received: from mail-wr1-f74.google.com (mail-wr1-f74.google.com [209.85.221.74]) (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 1119A1DF73A for ; Sun, 18 Jan 2026 11:00:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768734055; cv=none; b=appdFR3GMFp5AhwvQxRfJnxRGifvzWDjk7OainWsfXryQ3dcKQvMA6pr39i1MOhlk6rcmPnR5OODe5/Q+AWCuSgmRhPFnslqiz3fMkLAnSPFAG8vYgKMdPecrJoxwAhoI0oGF1OVQzHsDYHg1lTsxmhZCUk2PTj7amAA41sDmKc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768734055; c=relaxed/simple; bh=u9J/bJGSNnPdIKbJhrrHpNL0yNKiZTldG8Rd++APQeY=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=oLKBtxapkH7KYBuJJcdapy6NvoyVMQi+85btqOW6ctr0hDmEyutQ8s1mt5IYN8jp6c+KZgp3ZLNHkG/dPMzfkB+AMnI+EfwZwQ6DP5mj3mUGDfY+V+03d4wv+/g5S9nShiby+nTGRG+dTSe47zAnAZdFQgy5Tf1c9+SbxQMY1Lw= 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=C5bNYulh; arc=none smtp.client-ip=209.85.221.74 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="C5bNYulh" Received: by mail-wr1-f74.google.com with SMTP id ffacd0b85a97d-43009df5ab3so2390590f8f.1 for ; Sun, 18 Jan 2026 03:00:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1768734048; x=1769338848; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=wUST9cPr8T30JHIuQSYsAwA2N754vQ1EOIK7UDUsXC0=; b=C5bNYulhrLtI2hokZNyI9rYDabDyEsdfkTIVSmY3ysA1xB5HEB/jWnxhsWprN4FXef uHaRGf43hZ5VlF+viNCJDcbi2k1Dnf2I11FzpelOhgBvP4p/kSUgj+7JyE6FIUs4edTs +SDChRmz9+s5D6TDHNtTdcfdAGHY3R+dgVJCU8krViX1McWDrrxsLxn993V8nb7hmtcY tmat0vA8yHoQdQfiDew4ypUjJlvY1lpUWmJuEHyLDdDf7G6h4VKnfI5L/tYHzPxzVOrU sXD5NOLPrPTu/7oSacTpi5n/KyQ02/Y2AamRz4As+99KyvkmW1kDuGmUf2zveyJpPMZC fE5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768734048; x=1769338848; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=wUST9cPr8T30JHIuQSYsAwA2N754vQ1EOIK7UDUsXC0=; b=Ud3purTLIlE2p3wqSLTp8nlvz37jHmPIQAm3mGKvBXxG7Fdaq/Vl6VV9rjSxEVNKWc QJt9BVkOKgz2x0iL4xvhiq2HzbCCf4hpO6Qrjdyid2UFmWi5GbZ0WOeEtx4BPMoahZx2 jfLXse/lpRtJVlwKk4GizXsSRVonlme3YRtkxTfM2Art/tYlVuSGOF/kwR49PE9XAej7 zW6B4bU/ssKDEPPDBjECEQAXCCKuXoTM8kI+eJcG0kG9DxmiKgbVZh+5D9Pacsb5Sxrk GZSx+LQrNWM/hZ+t4U3kpxi7RDcNyRdtiNTV68zX8yqTGDOuwm+BojFE9agJHYdVouB6 prag== X-Forwarded-Encrypted: i=1; AJvYcCVRbXl3qxTQ2fIvu3M62WDavKBwaaAxJnj6afZONhA3zXA6tRfgpUAYuGxY62AUeGDFREnODLh/n4X/xlY=@vger.kernel.org X-Gm-Message-State: AOJu0Yw3iyu9djiareTRH87NefDojXt4RVdAWsK0HiNa4CI/l4s1+2Jw V9FBknnzX5R/Ejvebv6sZgAQPFIjCvu4GoL2zjcdxipsEJ8DSkr2r3RtCxNtmQo2fKGcxZHO3t8 VjA3jCauf1Q1FUTGMIw== X-Received: from wmpd39.prod.google.com ([2002:a05:600c:4c27:b0:479:2d82:5535]) (user=aliceryhl job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:8b78:b0:47e:e8c2:905f with SMTP id 5b1f17b1804b1-4801e30a790mr107192225e9.8.1768734048426; Sun, 18 Jan 2026 03:00:48 -0800 (PST) Date: Sun, 18 Jan 2026 11:00:41 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAFi9bGkC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDIzMDQ0ML3dzEYt281IoS3ZT8ZF0jA0Nzw5Q0C0PzpBQloJaCotS0zAqwcdG xtbUAJP5ixV4AAAA= X-Change-Id: 20260118-mas-next-doc-20171df817bd X-Developer-Key: i=aliceryhl@google.com; a=openpgp; fpr=49F6C1FAA74960F43A5B86A1EE7A392FDE96209F X-Developer-Signature: v=1; a=openpgp-sha256; l=1892; i=aliceryhl@google.com; h=from:subject:message-id; bh=u9J/bJGSNnPdIKbJhrrHpNL0yNKiZTldG8Rd++APQeY=; b=owEBbQKS/ZANAwAKAQRYvu5YxjlGAcsmYgBpbL1ae0lcj1GOZmP+tMN0ODnOJCFvuv+EfebbH GMWaZgr9juJAjMEAAEKAB0WIQSDkqKUTWQHCvFIvbIEWL7uWMY5RgUCaWy9WgAKCRAEWL7uWMY5 Rj5KD/4uV7ym/gmcwhBGHx24jiAXaPv/6im5InPLkxj6/orReLPeTNGRm59SXtP6qzxQDVa9bYz El8i+3Sw0WW5++kWKs17YIVtrkuIxUQQpycJvmZA2H5JW5Z4GgUCl/a5VjysNyamV09cBfLzolr VI15GPc+AT8siWnb6OSGWHYkzBV918u5WUwNQmJ+TSpjSr3wyU7fPxGZX0jUhrkbRU5FxEZiJwJ JulbvajrxFbBPsofsKGsW0bO5rbdKEz7sR5vmxKdLm2lgXJ2yBr7xVI/T71n10brWHdKEj7Y+Ls BH4c5WJmrLY0eMHwTv9Ua8GugxazsuLxWBq1xfRQ914F6yXz7tX49hIpZXHgHaFejqQ+AVrpIO6 8otogA7oPyxlwdLpafD9Qxxek37RkMWE6hwyYnXw4YBhlszbA54krA0KDtzqaU/ScMgY1M9LAyQ ts9BHH5pokO6kSqDCOCTNQfT+WvOiUdAJiTxhl1wAC5J171Ey8Fcv1+GU66hmOosOShbQQbktHL 7NOo6Hh/jsYl5Y7XTrppL41oM6Pz+1cRgDG23cPhGgevHaJzd4tO6p/lnzG1BpMkByiERuRtYKW JQRM+YXkBD1OEhva1UxgFnQFOZe2tqnp76nZWpBd4GNh8cY2GjpwXHY6yQZm1y5VxLT//EXjL+l Ok175H6aFWMTXpQ== X-Mailer: b4 0.14.2 Message-ID: <20260118-mas-next-doc-v1-1-827d9f4924ce@google.com> Subject: [PATCH] maple_tree: update mas_next[_range] docs From: Alice Ryhl To: Andrew Morton , "Liam R. Howlett" , Andrew Ballance Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Alice Ryhl Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable If you read the docs, it sounds like the difference between these functions is whether mas->index and mas->last are updated. However, if you read the implementation, you will instead find that the difference is whether NULL entries are skipped. Signed-off-by: Alice Ryhl --- lib/maple_tree.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 5aa4c95000188d3ba461418e09445be78098578e..fe0f0440cd84e7a0fe946d5371e= 651d153f40d21 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -5293,13 +5293,14 @@ static bool mas_next_setup(struct ma_state *mas, un= signed long max, } =20 /** - * mas_next() - Get the next entry. + * mas_next() - Advance the maple state to the next range, skipping zero e= ntries. * @mas: The maple state * @max: The maximum index to check. * * Returns the next entry after @mas->index. + * Updates @mas->index and @mas->last to the range. * Must hold rcu_read_lock or the write lock. - * Can return the zero entry. + * Skips entries reserved with XA_ZERO_ENTRY. * * Return: The next entry or %NULL */ @@ -5316,11 +5317,12 @@ void *mas_next(struct ma_state *mas, unsigned long = max) EXPORT_SYMBOL_GPL(mas_next); =20 /** - * mas_next_range() - Advance the maple state to the next range + * mas_next_range() - Advance the maple state to the next range. * @mas: The maple state * @max: The maximum index to check. * - * Sets @mas->index and @mas->last to the range. + * Returns the next entry after @mas->index. + * Updates @mas->index and @mas->last to the range. * Must hold rcu_read_lock or the write lock. * Can return the zero entry. * --- base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8 change-id: 20260118-mas-next-doc-20171df817bd Best regards, --=20 Alice Ryhl