From nobody Fri Aug 7 01:48:10 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4hGRqv6FsFz6ndxP for ; Fri, 07 Aug 2026 01:48:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hGRqv0dh5z3pKb for ; Fri, 07 Aug 2026 01:48:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786067291; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OMjcmHibXBKnXENKJ2kIyx9MB4EvQUXjeVFj5GkXJSE=; b=l+LMwHMV9BjU0F4hz7ff4MJbWp4sMvjYOBADBzwqMF8iOAWNZqJrhfeP1mI6T2qgT7nxiM NJYKj/uWzb/yLOOL0uU+DTJ1q4WgtA1U+UXk+dIUSZQCWHAY4XCXuoIGRuPA75x9z6Vhqa p6Ls/ZgYegiXXmikiqrQDjCyE3QcKtF5F1avFeU/oD39wqpEeE9k5KtkYFRnFRw+k95q0p WYHn7JL+Vr/CpDk+8SqOM3FVaC9GvesYycFjth4p1yYGEaEe27mpRYpwjIbnJnjHW9u/Tu SsZhrzO5c6wzURCm5FpzjiLjwPe1OuOcz8ClvTY0boOZstLC8flDrlFhH4xTrw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1786067291; a=rsa-sha256; cv=none; b=PaNKvoxxbVq6ZLMzhzyk+1Lum0HKynyc9wEKDAAbtL+XtOmFbYVzORWN70PQMhBtINNhZ7 +2CWTp1LyD7WaKcX5BOUSVfDEqtSwzY9GMhUy0o/sJCN8c6fmMnPP5IboArBn9VIEMr4ib FxnwaJPCq/SbrvrS8mLhfQFEHaEK4h9pdIy1ubOZSsIZH8tsd42ObCxoEO4nrCbNlxh6jz OvAzCom/0JN8msXUQyn9xaOSUghYKVJKJ4bkuThEqIDmGulEtgRMyCnAzpCcELdVacfnfT bPmcPiT0f1575cdUIP7yFzZn/TgSlPgtVcbW0n6oym0CfBmBnlrygpedJyyqvQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786067291; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OMjcmHibXBKnXENKJ2kIyx9MB4EvQUXjeVFj5GkXJSE=; b=Y3NrM1WqGQ8Pp9qA37xYTxPU8Kcen9cENG51t8Cv/LYiuNkbdB2cByIs1/6g2u/RxxnZMF lqenWWu31dcB+3D47jW6wjzYb4JSrUSDoiWZRnF5/fBsnxQU3PABVpW+pz8QBLyPAH9Son GRQupzsf+3lroAmwXp1BVx1xj0sjuRXW0XFiSW22DKq7qKmaZRMvEaPtz5xbyvgar91dY7 di8C3/kdIU063WffZOtYk1/Sh6iPwLuZN6z+nqZsqpIubdVKBt8O1mOVXo/JzRe/B0+F8T slxFPbW1dQpcft9lfsVP0FrN4DYeEASpME+5QbYVb3Wjq+YDAlHHmXMgrtkM0A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hGRqt6dcrzn4j for ; Fri, 07 Aug 2026 01:48:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3be07 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 07 Aug 2026 01:48:10 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 3e0270c52875 - stable/15 - kern: osd: abstract away the math for locating a slot method List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 3e0270c52875faefad6ddce7285f8c8047d423ef Auto-Submitted: auto-generated Date: Fri, 07 Aug 2026 01:48:10 +0000 Message-Id: <6a75395a.3be07.189c82dd@gitrepo.freebsd.org> The branch stable/15 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=3e0270c52875faefad6ddce7285f8c8047d423ef commit 3e0270c52875faefad6ddce7285f8c8047d423ef Author: Kyle Evans AuthorDate: 2026-06-25 03:08:05 +0000 Commit: Kyle Evans CommitDate: 2026-08-06 23:35:54 +0000 kern: osd: abstract away the math for locating a slot method It's relatively simple, but we'll do it a couple of times; pull it out into a macro. Reviewed by: imp (previous version), jamie (cherry picked from commit 72ebcfae48c42cb28ab6142980416082f8d70abc) --- sys/kern/kern_osd.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_osd.c b/sys/kern/kern_osd.c index 93809ccab8e5..b64735e7f93a 100644 --- a/sys/kern/kern_osd.c +++ b/sys/kern/kern_osd.c @@ -73,6 +73,9 @@ SYSCTL_INT(_debug, OID_AUTO, osd, CTLFLAG_RWTUN, &osd_debug, 0, "OSD debug level } \ } while (0) +#define OSD_METHOD(osdm, slot, method) \ + ((osdm).osd_methods[((slot) - 1) * (osdm).osd_nmethods + (method)]) + static void do_osd_del(u_int type, struct osd *osd, u_int slot, int list_locked); @@ -139,8 +142,8 @@ osd_register(u_int type, osd_destructor_t destructor, const osd_method_t *method osdm[type].osd_destructors[i] = destructor; if (osdm[type].osd_nmethods != 0) { for (m = 0; m < osdm[type].osd_nmethods; m++) - osdm[type].osd_methods[i * osdm[type].osd_nmethods + m] - = methods != NULL ? methods[m] : NULL; + OSD_METHOD(osdm[type], i + 1, m) = + methods != NULL ? methods[m] : NULL; } sx_xunlock(&osdm[type].osd_module_lock); return (i + 1); @@ -391,8 +394,7 @@ osd_call(u_int type, u_int method, void *obj, void *data) /* Hole in the slot map; avoid dereferencing. */ if (osdm[type].osd_destructors[i] == NULL) continue; - methodfun = osdm[type].osd_methods[i * osdm[type].osd_nmethods + - method]; + methodfun = OSD_METHOD(osdm[type], i + 1, method); if (methodfun != NULL && (error = methodfun(obj, data)) != 0) break; }