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, Sep 24, 3:22 AM
Unknown Object (File)
Mon, Sep 23, 4:00 PM
Unknown Object (File)
Mon, Sep 23, 1:59 PM
Unknown Object (File)
Mon, Sep 16, 12:33 PM
Unknown Object (File)
Mon, Sep 9, 5:13 PM
Unknown Object (File)
Mon, Sep 9, 2:28 AM
Unknown Object (File)
Sun, Sep 8, 7:07 PM
Unknown Object (File)
Sun, Sep 8, 3:58 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
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.