Re: [patch 2.6.12-rc1-mm4] fork_connector: add a fork connector

Andrew Morton
2005-03-31T22:54:28Z

Guillaume Thouvenin <guillaume.thouvenin@bull.net> wrote:
>
> This patch adds a fork connector in the do_fork() routine.

>
> +config FORK_CONNECTOR
> + bool "Enable fork connector"
> + depends on CONNECTOR=y

This kind of defeats connector's ability to be built as a module. Doing

select CONNECTOR

may be better here.

> +static void cn_fork_callback(void *data)
> +{
> + struct cn_msg *msg = (struct cn_msg *)data;

The cast is unnecessary.

>
> extern int cn_already_initialized;
> +extern int cn_fork_enable;
> +extern struct cb_id cb_fork_id;

Should these declarations be inside CONFIG_FORK_CONNECTOR?

> +
> +static DEFINE_PER_CPU(unsigned long, fork_counts);
> +

This will cause fork_counts to be defined in each compilation unit which
includes this header file. You should use DEFINE_PER_CPU in .c and
DECLARE_PER_CPU in .h.