Re: [PATCH] sysctl: add support for poll()

From: Andrew Morton
Date: Fri Aug 26 2011 - 17:07:36 EST


On Thu, 4 Aug 2011 15:57:18 -0300
Lucas De Marchi <lucas.demarchi@xxxxxxxxxxxxxx> wrote:

> Adding support for poll() in sysctl fs allows userspace to receive
> notifications of changes in sysctl entries. This adds a infrastructure
> to allow files in sysctl fs to be pollable and implements it for
> hostname and domainname.
>

Seems reasonable. One slight nit:

> +#define __CTL_TABLE_POLL_INITIALIZER(name) { \
> + .event = ATOMIC_INIT(0), \
> + .wait = __WAIT_QUEUE_HEAD_INITIALIZER(name.wait) }
> +
> +#define DECLARE_CTL_TABLE_POLL(name) \
> + struct ctl_table_poll name = __CTL_TABLE_POLL_INITIALIZER(name)

This macro is used to define an instance of ctl_table_poll. Hence it
should be called DEFINE_CTL_TABLE_POLL, not DECLARE_*.

declaration: "one of these exists"
definition: "here it is".

This matters a bit, because sometimes we'll have separate macros for
declaring and defining.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/