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)
Sat, Apr 19, 10:02 AM
Unknown Object (File)
Fri, Apr 18, 2:41 PM
Unknown Object (File)
Fri, Apr 18, 11:03 AM
Unknown Object (File)
Mar 15 2025, 9:23 PM
Unknown Object (File)
Feb 4 2025, 11:22 AM
Unknown Object (File)
Jan 25 2025, 9:22 PM
Unknown Object (File)
Jan 11 2025, 11:41 AM
Unknown Object (File)
Jan 6 2025, 11:46 PM

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.