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)
Wed, May 8, 10:14 AM
Unknown Object (File)
Wed, May 8, 10:07 AM
Unknown Object (File)
Wed, May 8, 8:07 AM
Unknown Object (File)
Mon, Apr 22, 8:33 AM
Unknown Object (File)
Mon, Apr 22, 8:30 AM
Unknown Object (File)
Mon, Apr 22, 12:11 AM
Unknown Object (File)
Fri, Apr 19, 10:29 PM
Unknown Object (File)
Jan 10 2024, 5:29 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
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.