Page MenuHomeFreeBSD

linuxkpi: Add refcount_dec_and_test
ClosedPublic

Authored by manu on Aug 10 2022, 6:46 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Oct 22, 2:09 PM
Unknown Object (File)
Tue, Oct 22, 2:09 PM
Unknown Object (File)
Tue, Oct 22, 2:09 PM
Unknown Object (File)
Tue, Oct 22, 1:52 PM
Unknown Object (File)
Oct 13 2024, 9:24 AM
Unknown Object (File)
Oct 13 2024, 9:23 AM
Unknown Object (File)
Oct 2 2024, 10:55 PM
Unknown Object (File)
Sep 25 2024, 6:26 AM

Details

Summary

In Linux this takes a refcount_t argument but in linuxkpi struct kref
uses an atomic_t for the refcount and code in drm directly uses this
function with a kref so use an atomic_t here.

Sponsored by: Beckhoff Automation GmbH & Co. KG

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 46815
Build 43704: arc lint + arc unit

Event Timeline

manu requested review of this revision.Aug 10 2022, 6:46 AM
bz added inline comments.
sys/compat/linuxkpi/common/include/linux/refcount.h
85

This may be a silly question, but why don't we fix kref instead to use refcount (now that it exists thanks to you)? Then this shouldn't be a problem here.

sys/compat/linuxkpi/common/include/linux/refcount.h
85

TBH I haven't tested if this open a big can of worms or not ...

bz added inline comments.
sys/compat/linuxkpi/common/include/linux/refcount.h
85

I'll be happy to get this in and defer the answer to the worms for later maybe with an XXX should kref use refcount_t? next to it as well?

This revision is now accepted and ready to land.Aug 10 2022, 4:04 PM
sys/compat/linuxkpi/common/include/linux/refcount.h
85

Yeah I'll add something in linux/kref.h too.

This revision was automatically updated to reflect the committed changes.