From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg KH Date: Tue, 07 Feb 2006 00:23:07 +0000 Subject: Re: [Libusb-devel] udev craze: need /dev/bus/usb rationale Message-Id: <20060207002307.GA3321@kroah.com> List-Id: References: <20060126094517.GA4063@bode.aurel32.net> In-Reply-To: <20060126094517.GA4063@bode.aurel32.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Mon, Feb 06, 2006 at 04:00:19PM -0800, Johannes Erdfelt wrote: > On Mon, Feb 06, 2006, Greg KH wrote: > > On Mon, Feb 06, 2006 at 03:29:41PM -0800, Johannes Erdfelt wrote: > > > I'm working on implementing inotify support into libusb 1.0 right now. > > > > Does usbfs support inotify events? For some reason I didn't think it > > did, but I'm probably wrong... > > Well, it looks like it's trying to, but it's broken: > > belushi:..otify-utils-0.25% ./inotify_test /proc/bus/usb/002 > inotify device fd = 3 > /proc/bus/usb/002 WD=1 > read = 32 > sizeof inotify_event = 16 > pevent->len = 16 > EVENT ON WD=1 > DELETE (file) 0x00000200 > FILENAME4 > > read = 32 > sizeof inotify_event = 16 > pevent->len = 16 > EVENT ON WD=1 > DELETE (file) 0x00000200 > FILENAME5 > > That was an unplug followed by a replug. This was with my test Keyspan > serial device so there was a reset after the firmware was loaded. It > looks like we're only receiving DELETE events, and no CREATE ones. > It works correctly in /dev/bus/usb (which doesn't seem to create a > device node when it loads firmware): That's wierd that only the delete ones get sent and no others. And the /dev/bus/usb stuff will always show up, as that is userspace creating these files, not the kernel creating stuff underneath like the usbfs files. > belushi:..otify-utils-0.25% ./inotify_test /dev/bus/usb/2 > inotify device fd = 3 > /dev/bus/usb/2 WD=1 > read = 32 > sizeof inotify_event = 16 > pevent->len = 16 > EVENT ON WD=1 > DELETE (file) 0x00000200 > FILENAME& > > read = 32 > sizeof inotify_event = 16 > pevent->len = 16 > EVENT ON WD=1 > CREATE (file) 0x00000100 > FILENAME( > > I had planned on using the old method of polling on > /proc/bus/usb/devices for systems we use /proc/bus/usb anyway. Maybe I should poke around and see how to get inotify working on libfs based filesystems, I'm sure that sysfs could also use it... thanks, greg k-h ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642 _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel