Samba 3.0.32 - internal change notify "legacy" mechanism

Shlomi Yaakobovich Shlomi at
Mon Dec 8 16:31:20 GMT 2008

Hi Volker,

Thanks for the answer. I looked at the vfs_notify_fam.c code, it was
quite helpful. If I get your idea correctly, you propose I create a new
VFS module (e.g. vfs_notify), implement only the SMB_VFS_OP_NOTIFY_WATCH
operation (and not all the FAM related code I can find in the original
module). This OP receives all the required data for change notify
mechanism (e.g. path of the directory, fsp as private_data). Create a
local list of watchers. The watch will use the talloc_set_destructor in
a similar way like fam_notify does, to remove the watched entry from the

Additionally, create some local function in this module, and use
event_add_timed to schedule it (over and over, as long as the watch is
required). Set this timer when the watch is created I presume. Then
implement older logic of notify mechanism in this function (i.e. stat of
directory, readdir, etc.). Possibly even take the older code as is to
avoid complications... If found that NOTIFY is required, call the
callback that was provided with the watch request. 

Let me know if I got this right.



> -----Original Message-----
> From: Volker Lendecke [mailto:Volker.Lendecke at SerNet.DE] 
> Sent: Monday, December 08, 2008 5:33 PM
> To: Shlomi Yaakobovich
> Cc: samba-technical at
> Subject: Re: Samba 3.0.32 - internal change notify "legacy" mechanism
> On Mon, Dec 08, 2008 at 02:06:03PM +0200, Shlomi Yaakobovich wrote:
> > My questions are- how hard is it to make the older code 
> work in newer 
> > samba?
> You might want to take a look at the notify_fam.c module. It 
> exports the SMB_VFS_OP_NOTIFY_WATCH operation which is 
> sufficient to support the new notify engine. You might want 
> to write a module that does the polling. With 
> "event_add_timed" recurring events are possible entirely 
> within the module without touching the main smbd event loop.
> Volker

More information about the samba-technical mailing list