Page MenuHomeFreeBSD

Add a callout_func_t typedef for functions used with callout_*().
ClosedPublic

Authored by jhb on Dec 10 2019, 7:02 PM.
Tags
None
Referenced Files
F134352123: D22751.diff
Sat, Nov 1, 3:11 PM
Unknown Object (File)
Thu, Oct 30, 4:33 AM
Unknown Object (File)
Tue, Oct 28, 4:45 AM
Unknown Object (File)
Sat, Oct 25, 11:52 PM
Unknown Object (File)
Sat, Oct 18, 8:34 AM
Unknown Object (File)
Mon, Oct 13, 8:10 AM
Unknown Object (File)
Mon, Oct 13, 8:10 AM
Unknown Object (File)
Mon, Oct 13, 8:10 AM
Subscribers

Details

Summary

This typedef is the same a timeout_t except that it is in the callout
namespace and header.

Use this typedef in various places of the callout implementation that
were either using the raw type or timeout_t.

While here, add <sys/callout.h> to the manpage.

Test Plan
  • booted an amd64 VM in bhyve

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

.Dd bump is the only thing I see...

This revision is now accepted and ready to land.Dec 10 2019, 7:16 PM
kib added inline comments.
sys/kern/kern_timeout.c
148 ↗(On Diff #65463)

The drain function is somewhat strange to convert to the same typedef as callout, but ok.

771 ↗(On Diff #65463)

Fix style while there, move local declaration to the start of the function ?

bcr added a subscriber: bcr.

My own callout is this: approved! ;-)

jhb marked an inline comment as done.Dec 10 2019, 9:30 PM
jhb added inline comments.
sys/kern/kern_timeout.c
148 ↗(On Diff #65463)

While I agree it is strange, the drain function pointer is saved in c_func by callout_drain_async(), and the manpage before my change used timeout_t for the drain function argument to callout_drain_async(). Given those, it seemed reasonable to me to use the typedef for the drain function pointers.