VFS event hooks in Linux

Jeremy Allison jallison at cthulhu.engr.sgi.com
Tue Jun 29 18:30:18 GMT 1999


Richard Gooch wrote:
> 
> Well, I've been talking to Linus about this, and he hates the idea. He
> doesn't like the idea of throwing anonymous events to user space,
> claiming that it's a bad design.

Well it works for the kernel oplock code :-).

> He suggested that if Samba really needed this information, it might be
> better to put it in kernel space so it can cheaply check the inodes (I
> presume he was referring to avoiding syscall overheads).

I hope he doesn't mean Samba here. Putting Samba in the kernel
would be a very *bad* idea :-).

> Somehow I doubt that Samba stat()s a large number of files every 60
> seconds. It would load the system too much.

No, that's exactly what it has to do to provide close-to-NT ChangeNotify
semantics. It has to scan every directory the client has expressed an
interest in.

> So I'd like to revist the
> requirements again. What is actually necessary for SMB support? What
> must be done at the server side and what happens at the client side?

Client opens a directory. Client issues a ChangeNotify request on
directory handle to server. Client request completes when change occurs
(it's a one shot event).

> Let me come to this from another direction. Suppose that an SMB server
> need only send directory upate events to clients that have the
> directory open (say in their browser). In that case, it would make
> sense for the SMB protocol to have the server know that a client has
> the directory open. In that case, the VFS poll() patch I've
> implemented for Linux should do fine. You just need one open fd per
> client/browser.

That works as it is close to the desired semantics (the
server knows the client has a directory open). The problem
is that the NT semantics allow a client to set notification
on a change in a directory *or any subdirectory within it*,
although how many clients actually use that is open to debate
(no one has complained about the current Samba behaviour, which
is only to scan the current directory).

Regards,

	Jeremy Allison,
	Samba Team.

-- 
--------------------------------------------------------
Buying an operating system without source is like buying
a self-assembly Space Shuttle with no instructions.
--------------------------------------------------------


More information about the samba-technical mailing list