[ovs-dev] [PATCH 1/2] datapath: Define kmemdup() for kernels older than 2.6.19

Jesse Gross jesse at nicira.com
Thu Apr 22 16:35:36 UTC 2010

On Thu, Apr 22, 2010 at 4:47 AM, Justin Pettit <jpettit at nicira.com> wrote:

> On Apr 21, 2010, at 7:26 AM, Jesse Gross wrote:
> > On Wed, Apr 21, 2010 at 1:50 AM, Justin Pettit <jpettit at nicira.com>
> wrote:
> > +#if !defined(CONFIG_XEN) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
> >
> > I think a configure test might be more appropriate here given that we are
> already dealing with backported code.  Also, CONFIG_XEN is a configuration
> option which presumably does not also remove this function if you turn it
> off.
> >
> > Otherwise looks good.
> Thanks for keeping me honest.  ;-)  I initially was going to do a configure
> test, but Xen's backported kmemdup was an inline function in "string.h",
> while the upstream version was defined as an extern function in "slab.h".
>  Doing it that way seemed easiest, and I figured 2.6.18 and earlier users
> who aren't running Xen was a fairly small subset of our users.  However,
> you're right that it wasn't very clean.  Below, is a reworked version based
> on a suggestion from Ben.
> Let me know if this one gives you more warm fuzzies.

Yeah, this seems a bit nicer to me.  One thing, and obviously this really
isn't that important: is there a reason why you put the prototype in
string.h?  I would have expected that it be in slab.h, to make it look like
newer kernels.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20100422/28cb2b61/attachment-0003.html>

More information about the dev mailing list