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)
Sat, Oct 11, 9:43 PM
Unknown Object (File)
Sat, Oct 11, 9:43 PM
Unknown Object (File)
Sat, Oct 11, 9:43 PM
Unknown Object (File)
Sat, Oct 11, 9:43 PM
Unknown Object (File)
Sat, Oct 11, 9:43 PM
Unknown Object (File)
Sat, Oct 11, 12:33 PM
Unknown Object (File)
Sat, Oct 4, 12:27 AM
Unknown Object (File)
Fri, Oct 3, 9:01 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.