Page MenuHomeFreeBSD

LinuxKPI: add default_gfp()
ClosedPublic

Authored by bz on Tue, Apr 14, 3:32 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 29, 1:57 PM
Unknown Object (File)
Tue, Apr 28, 4:13 PM
Unknown Object (File)
Tue, Apr 28, 9:21 AM
Unknown Object (File)
Sun, Apr 26, 12:22 PM
Unknown Object (File)
Fri, Apr 24, 2:15 AM
Unknown Object (File)
Fri, Apr 24, 2:06 AM
Unknown Object (File)
Tue, Apr 21, 9:27 AM
Unknown Object (File)
Tue, Apr 21, 6:49 AM

Details

Summary

Various new allocation macros can take an optional gfp_t argument.
If the argument is not given we need to set the GFP_KERNEL default.
While this is only internally used and I initialy called it differently,
should this spread elsewhere having the same name as in Linux will be
good.

Sponsored by: The FreeBSD Foundaton
MFC after: 3 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 72244
Build 69127: arc lint + arc unit

Event Timeline

bz requested review of this revision.Tue, Apr 14, 3:32 PM

Why name it __lkpi_default_gfp() and not __default_gfp() like Linux? I'm sure some drivers will use it if it's available :)

Why name it __lkpi_default_gfp() and not __default_gfp() like Linux? I'm sure some drivers will use it if it's available :)

I would hope not.

I don't know the name of that thing in Linux either. I just prefixed it with lkpi for the internal part not supposed to be public KPI and added __ given it's macro.
I was silly enough initially to only use ``(_arg_or_default, ...) without the _discard only to be reminded that that gives you errors if you do not pass an argument in given ##VA_ARGS works on the "trailing" comma.

I'll rename it if that's easier.

Ranme "internal" part of the function to __default_gfp as suggested by @dumbbell to match Linux.

I agree it looks like a private API and I also hope it's not used. But I already saw functions and macros starting with underscores being used anyway...

This revision is now accepted and ready to land.Thu, Apr 16, 7:43 PM
This revision was automatically updated to reflect the committed changes.