Page MenuHomeFreeBSD

md(4): move type-specific data under union
ClosedPublic

Authored by kib on Jul 2 2025, 1:14 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Mar 9, 8:23 PM
Unknown Object (File)
Mon, Mar 9, 1:26 PM
Unknown Object (File)
Sun, Mar 8, 1:41 PM
Unknown Object (File)
Sat, Mar 7, 10:05 PM
Unknown Object (File)
Thu, Feb 26, 10:11 PM
Unknown Object (File)
Feb 8 2026, 3:42 PM
Unknown Object (File)
Feb 8 2026, 2:06 PM
Unknown Object (File)
Feb 8 2026, 11:42 AM
Subscribers

Details

Summary

This way it is clear which type uses which members.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

sys/dev/md/md.c
300

Isn't it ok to use anonymous unions in kernel code?

1577

Shouldn't we handle MD_PRELOAD here too? It looks like that case is reachable.

kib marked 2 inline comments as done.Jul 2 2025, 2:05 PM
kib added inline comments.
sys/dev/md/md.c
300

I removed 's', but the names of the structure members is the point of the commit.

kib marked an inline comment as done.

Drop internal union member name.
Handle MD_PRELOAD in mddestroy().

Correct diff, with all 's.' eliminated.

markj added inline comments.
sys/dev/md/md.c
300

Right, I just meant that the s didn't seem useful.

This revision is now accepted and ready to land.Jul 2 2025, 2:24 PM
This revision was automatically updated to reflect the committed changes.