Date: Mon, 10 Nov 2003 00:56:40 -0800 From: John-Mark Gurney <gurney_j@efn.org> To: andi payn <andi_payn@speedymail.org> Cc: freebsd-hackers@freebsd.org Subject: Re: kevent and related stuff Message-ID: <20031110085640.GB64793@funkthat.com> In-Reply-To: <1067529247.36829.2138.camel@verdammt.falcotronic.net> References: <1067529247.36829.2138.camel@verdammt.falcotronic.net>
next in thread | previous in thread | raw e-mail | index | archive | help
andi payn wrote this message on Thu, Oct 30, 2003 at 07:54 -0800: > * The kevent mechanism doesn't monitor directories in a sufficient way > to make fam happy. If you change a file in a directory that you're > watching, unlike imon or dnotify, kevent won't see anything worth > reporting at all. This means that for directory monitoring, kevent is > useless as-is. Again, if I wanted to patch kevent to provide this > additional notification, would others want this? This is to prevent running out of memory.. one of the great advantages of kqueue's is that all memory necessary is allocated at the time the event is posted. If kevent successfully set your event, then you know you'll get all instances of the event. The problem with putting a notify on a directory and having it watch the children is that file's ATIMES change w/o the directory knowing about it. Are you suggesting that files start to know which directory they are located in? What happens when you link the same file into the directory thousands of times? Do you get the one notification or thousands of notifications? The solution to that is to open each file in the directory, and monitor that. You also monitor the directory for changes to get notified of any new or removed files. As for getting notified of atime, etc, it shouldn't be hard to add a VN_KNOTE(vp, NOTE_ATTRIB); to ufs_itimes, though you should only post it if any of the three times get modified. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031110085640.GB64793>