[Dovecot] add inotify support to dovecot
Hi,
attached patch against test76 adds inotify support and the --with-notify=... configure option that defaults to the current check for dnotify using no special method if dnotify cannot be compiled, and can be set to none, dnotify and inotify. If it is set to dnotify or inotify, failure to compile a test program results in an error.
Also, it adds | file change notification method ..... : <method> to the output at the end of configure.
The only thing I don't like about this patch is the fact that I had to add a field notify_context to struct io, but I didn't see a different way to handle this. Also, the patch doesn't support the condition parameter, it simply always asks for all the relevant changes. I don't really see that it is useful for in the context of file system notifications anyway.
I modeled this after ioloop-notify-dn.c with my other patch applied to it, if you don't like the other patch you'll want to "revert" that change in the new ioloop-notify-inotify.c file as well.
Oh, and obviously I didn't include patches to configure and all the Makefiles, so of course you'll have to run automake. But you already knew that :)
I only tested this with maildir. I did add IN_MODIFY so I think it should work with mbox too, but someone should probably verify.
Have fun, johannes
On Fri, 2005-07-08 at 13:32 +0200, Johannes Berg wrote:
The only thing I don't like about this patch is the fact that I had to add a field notify_context to struct io, but I didn't see a different way to handle this.
I guess that's fine for now.
I committed the patch into CVS, but I did some small and some larger changes. Don't know if it works anymore, please try :)
On Tue, 2005-07-12 at 18:47 +0300, Timo Sirainen wrote:
On Fri, 2005-07-08 at 13:32 +0200, Johannes Berg wrote:
The only thing I don't like about this patch is the fact that I had to add a field notify_context to struct io, but I didn't see a different way to handle this.
I guess that's fine for now.
I committed the patch into CVS, but I did some small and some larger changes. Don't know if it works anymore, please try :)
Will do as soon as I get to it.
Btw. inotify doesn't require an open fd, so you could, in theory, change the notification API so that the backend (dnotify,inotify,none) gets to decide whether the fd should be kept open. With inotify, you could start listening to events on all folders without the noticable overhead of keeping fds open for all. But that would require a major change in the code, so I didn't do it.
johannes
participants (2)
-
Johannes Berg
-
Timo Sirainen