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
F151503311: D51127.diff
Wed, Apr 8, 9:12 PM
Unknown Object (File)
Mon, Apr 6, 2:15 PM
Unknown Object (File)
Sun, Apr 5, 7:26 AM
Unknown Object (File)
Sat, Apr 4, 9:45 PM
Unknown Object (File)
Sat, Apr 4, 6:25 AM
Unknown Object (File)
Fri, Apr 3, 4:36 PM
Unknown Object (File)
Thu, Apr 2, 12:11 PM
Unknown Object (File)
Wed, Apr 1, 9:35 PM
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.