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

Ben Pfaff blp at nicira.com
Thu Apr 22 16:10:49 UTC 2010


On Thu, Apr 22, 2010 at 01:47:10AM -0700, Justin Pettit 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.

This is indeed what I had in mind.  It looks good.  (I assume that you tried
it.)




More information about the dev mailing list