diff options
author | James Peach <jpeach@samba.org> | 2006-02-13 04:07:15 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:10:05 -0500 |
commit | 8fbdd112b2c69a54d05807163bfc52b34f4d0424 (patch) | |
tree | 838fb54ed67656e49ac9f2780b5b2ae4d0eaa8b2 /source3/smbd/notify_fam.c | |
parent | 71247a2f0507d13fa37d5b3c7136e299995af877 (diff) | |
download | samba-8fbdd112b2c69a54d05807163bfc52b34f4d0424.tar.gz samba-8fbdd112b2c69a54d05807163bfc52b34f4d0424.tar.bz2 samba-8fbdd112b2c69a54d05807163bfc52b34f4d0424.zip |
r13482: Push the FAM notification file descriptor into the select
set to avoid unnecessary polling.
(This used to be commit 1dce945ccbba25092cf54890301c8f78f8aede33)
Diffstat (limited to 'source3/smbd/notify_fam.c')
-rw-r--r-- | source3/smbd/notify_fam.c | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/source3/smbd/notify_fam.c b/source3/smbd/notify_fam.c index 413340266e..9f02bfdee9 100644 --- a/source3/smbd/notify_fam.c +++ b/source3/smbd/notify_fam.c @@ -63,9 +63,30 @@ static int global_fc_generation; #define FAM_TRACE 8 #define FAM_TRACE_LOW 10 -#define FAM_NOTIFY_CHECK_TIMEOUT 1 /* secs */ #define FAM_EVENT_DRAIN ((uint32_t)(-1)) +static void * fam_register_notify(connection_struct * conn, + char * path, + uint32 flags); + +static BOOL fam_check_notify(connection_struct * conn, + uint16_t vuid, + char * path, + uint32_t flags, + void * data, + time_t when); + +static void fam_remove_notify(void * data) + +static struct cnotify_fns global_fam_notify = +{ + fam_register_notify, + fam_check_notify, + fam_remove_notify, + -1, + -1 +}; + /* Turn a FAM event code into a string. Don't rely on specific code values, * because that might not work across all flavours of FAM. */ @@ -110,6 +131,7 @@ fam_check_reconnect(void) } } + global_fam_notify.notification_fd = FAMCONNECTION_GETFD(&global_fc); return(True); } @@ -420,18 +442,6 @@ fam_remove_notify(void * data) struct cnotify_fns * fam_notify_init(void) { - static struct cnotify_fns global_fam_notify = - { - fam_register_notify, - fam_check_notify, - fam_remove_notify, - FAM_NOTIFY_CHECK_TIMEOUT - }; - - /* TODO: rather than relying on FAM_NOTIFY_CHECK_TIMEOUT, we should have an - * API to push the FAM fd into the global server fd set. - */ - FAMCONNECTION_GETFD(&global_fc) = -1; if (!fam_test_connection()) { |