Page MenuHomeFreeBSD

kern: osd: abstract away the math for locating a slot method
Needs RevisionPublic

Authored by kevans on Dec 14 2024, 4:21 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jan 12, 6:15 AM
Unknown Object (File)
Fri, Jan 10, 9:05 AM
Unknown Object (File)
Tue, Jan 7, 4:32 AM
Unknown Object (File)
Mon, Jan 6, 9:18 PM
Unknown Object (File)
Mon, Jan 6, 1:43 PM
Unknown Object (File)
Dec 18 2024, 6:45 PM
Unknown Object (File)
Dec 16 2024, 9:02 PM
Subscribers

Details

Reviewers
markj
jamie
pjd
imp
Summary

It's relatively simple, but we'll do it a couple of times; pull it
out into a macro.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 61152
Build 58036: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Dec 14 2024, 4:42 AM

I'd prefer it to take the slot number, and do the "slot - 1" translation in the macro. That came to mind looking at D48075 which passes in slot - 1.

That prompted a quick scan of kern_osd.c, which has a lot of "i" starting at zero, and "i + 1" to refer to the slot number. But then osd_exit has 1 one-based "i", with "i - 1" referring to the slot index. and osd_init has "i" being the type and hiding its zero-based-ness with OSD_FIRST. This all seems to be an off-by-one waiting to happen.

This revision now requires changes to proceed.Dec 14 2024, 4:47 AM