From e1ca45179419f96b831cc929ff46df39a4766388 Mon Sep 17 00:00:00 2001 From: Ira Cooper Date: Sun, 18 Apr 2010 15:02:23 +0200 Subject: s3: Improved support for GAMIN. Support the FAMNoExists API for gamin to reduce cpu use and problems when using GAMIN as FAM for vfs_notify_fam. --- source3/modules/vfs_notify_fam.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source3/modules') diff --git a/source3/modules/vfs_notify_fam.c b/source3/modules/vfs_notify_fam.c index 8f00c9207f..652e785e02 100644 --- a/source3/modules/vfs_notify_fam.c +++ b/source3/modules/vfs_notify_fam.c @@ -79,12 +79,27 @@ static NTSTATUS fam_open_connection(FAMConnection *fam_conn, ZERO_STRUCTP(fam_conn); FAMCONNECTION_GETFD(fam_conn) = -1; + +#ifdef HAVE_FAMNOEXISTS + /* We should honor outside setting of the GAM_CLIENT_ID. */ + setenv("GAM_CLIENT_ID","SAMBA",0); +#endif + if (asprintf(&name, "smbd (%lu)", (unsigned long)sys_getpid()) == -1) { DEBUG(0, ("No memory\n")); return NT_STATUS_NO_MEMORY; } res = FAMOpen2(fam_conn, name); + +#ifdef HAVE_FAMNOEXISTS + /* + * This reduces the chatter between GAMIN and samba making the pair + * much more reliable. + */ + FAMNoExists(fam_conn); +#endif + SAFE_FREE(name); if (res < 0) { -- cgit