[Devel] Re: [PATCH 10/12] Move uts ns into kernel/utsname*.c

Nathan Lynch ntl at pobox.com
Fri Feb 26 10:49:14 PST 2010


On Fri, 2010-02-26 at 00:45 -0800, Matt Helsley wrote:
> Unlike other checkpoint object ops we're moving out of checkpoint/objhash.c,
> the one for uts namespaces needs to be defined even if CONFIG_UTS_NS is not.
> Because the definitions used in kernel/utsname_sysctl.c can come from
> kernel/utsname.c, we declare them in include/linux/utsname.h. If the
> definitions are missing then utsname_sysctl.c defines its own.
> 

...

> diff --git a/kernel/utsname.c b/kernel/utsname.c
> index c82ed83..865a6f4 100644
> --- a/kernel/utsname.c
> +++ b/kernel/utsname.c
> @@ -74,3 +74,88 @@ void free_uts_ns(struct kref *kref)
>  	ns = container_of(kref, struct uts_namespace, kref);
>  	kfree(ns);
>  }
> +
> +#ifdef CONFIG_CHECKPOINT
> +/* default debug level for output */
> +#undef CKPT_DFLAG
> +#define CKPT_DFLAG  CKPT_DSYS
> +#include <linux/checkpoint.h>
> +#include <linux/checkpoint_hdr.h>

I don't have any problem with #ifdef CONFIG_CHECKPOINT around blocks of
functions -- it's pretty much unavoidable and it's common practice.  But
#undef and #include in such an #ifdef block are somewhat unusual, and in
this case they seem to be additions, not code movement.  Can you explain
what's going on here?



_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list