Page MenuHomeFreeBSD

linuxkpi: Add Linux 6.12 variant of `kvrealloc()`
Needs RevisionPublic

Authored by dumbbell on Thu, Apr 16, 9:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 19, 7:35 AM
Unknown Object (File)
Sun, Apr 19, 4:47 AM
Unknown Object (File)
Sun, Apr 19, 2:37 AM
Unknown Object (File)
Sat, Apr 18, 7:49 AM
Unknown Object (File)
Sat, Apr 18, 7:49 AM
Unknown Object (File)
Sat, Apr 18, 6:10 AM
Subscribers

Details

Reviewers
bz
Group Reviewers
linuxkpi
Summary

In Linux 6.12, the API changed to be closer to krealloc():

  • The function does not take the old size anymore
  • The function becomes a wrapper around krealloc() with a fallback mechanism.

This is part of the update of DRM drivers to Linux 6.12.

Sponsored by: The FreeBSD Foundation

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

bz requested changes to this revision.Mon, Apr 20, 11:15 PM
bz added a subscriber: bz.
bz added inline comments.
sys/compat/linuxkpi/common/include/linux/slab.h
252

Again, I believe this should be the new default and the old version should require LINUXKPI_VERSION.

270

So if ptr is NULL we are in bad shape anyway also in the old version.

I believe what we could do to simplify this is:

size_t oldsize = ksize(ptr);

_lkpi_kvrealloc( ... ) which is the old versions and then the old version is a plain wrapper around the __lkpi_kvrealloc() one used by both. That way it is a lot less code duplication. And is we want we can add the ptr != NULL check there too if really needed.

This revision now requires changes to proceed.Mon, Apr 20, 11:15 PM