Page MenuHomeFreeBSD

LinuxKPI: add kvmemdup()
ClosedPublic

Authored by bz on Mon, May 13, 5:44 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, May 22, 2:40 AM
Unknown Object (File)
Tue, May 21, 10:19 PM
Unknown Object (File)
Mon, May 20, 2:26 AM
Unknown Object (File)
Sun, May 19, 11:53 PM
Unknown Object (File)
Sun, May 19, 8:15 PM
Unknown Object (File)
Sat, May 18, 8:21 PM
Unknown Object (File)
Fri, May 17, 7:21 PM
Unknown Object (File)
Fri, May 17, 5:04 PM
Subscribers

Details

Reviewers
emaste
Group Reviewers
linuxkpi
Commits
rG8e4b8e9d807a: LinuxKPI: add kvmemdup()
Summary

Add kvmemdup() as a variant of kmemdup().
This is used by an updated wireless driver.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bz requested review of this revision.Mon, May 13, 5:44 PM

Do we have our approach documented somewhere? This looks acceptable given that we already #define kvfree(arg) kfree(arg) but it would be good to have that mentioned somewhere.

This revision is now accepted and ready to land.Tue, May 14, 1:03 AM

Do we have our approach documented somewhere? This looks acceptable given that we already #define kvfree(arg) kfree(arg) but it would be good to have that mentioned somewhere.

Other than the way we both looked probably not. kvfree() pre-dated me by a few years and given it is in slab.h I am not sure if there is a single place to document this well.

In theory I should probablu duplicate kmemdup and use kvmalloc() so in case someone ever decided to re-define kvmalloc/kvfree we wouldn't notice?

Duplicate the implmentation and add a comment for kvmalloc/kvfree in slab.h

I'll update the proposed commit message locally.

This revision now requires review to proceed.Tue, May 14, 11:01 PM

In theory I should probablu duplicate kmemdup and use kvmalloc() so in case someone ever decided to re-define kvmalloc/kvfree we wouldn't notice?

Yeah that's better I think; I was thinking that a comment about us not having a distinction would be sufficient but this is future-proof against someone separating kmalloc from kvmalloc in the future.

This revision is now accepted and ready to land.Tue, May 14, 11:25 PM
This revision was automatically updated to reflect the committed changes.