lkml.org 
[lkml]   [2011]   [Aug]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.



\
 
 \ /
  Last update: 2011-08-26 23:09    [W:0.427 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site