Page MenuHomeFreeBSD

LinuxKPI: add default_gfp()
ClosedPublic

Authored by bz on Tue, Apr 14, 3:32 PM.
Tags
None
Referenced Files
F153127357: D56392.id175605.diff
Sun, Apr 19, 8:39 AM
F153101906: D56392.diff
Sun, Apr 19, 4:00 AM
Unknown Object (File)
Sat, Apr 18, 7:49 AM
Unknown Object (File)
Sat, Apr 18, 7:48 AM
Unknown Object (File)
Sat, Apr 18, 7:47 AM
Unknown Object (File)
Sat, Apr 18, 7:47 AM
Unknown Object (File)
Sat, Apr 18, 6:10 AM
Unknown Object (File)
Sat, Apr 18, 3:37 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 Not Applicable
Unit
Tests Not Applicable

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.