Messages in this thread | ![/](/images/icornerl.gif) | | Date | Fri, 26 Aug 2011 14:06:10 -0700 | From | Andrew Morton <> | Subject | Re: [PATCH] sysctl: add support for poll() |
| |
On Thu, 4 Aug 2011 15:57:18 -0300 Lucas De Marchi <lucas.demarchi@profusion.mobi> 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.
| ![\](/images/icornerr.gif) |