Hello. On 01/18/2013 10:51 PM, Greg KH wrote: >> + /* >> + * This is our custom open-coded lock, similar to r/w locks in concept. >> + * It prevents usb-storage, usbfs, and /proc from simultaneous access. >> + */ >> + wait_queue_head_t excl_wait; >> + spinlock_t excl_lock; >> + unsigned int excl_type; > > I _really_ don't like open-coded locks, and given the wide range of > existing kernel primitives, surely something that we already have can > work here as well, right? I'm not so sure. Not that I'm familiar with all the primitives but I think this open coded lock was used for a good reason. > I don't want to be maintaining this custom > lock code for the next 20+ years, ensuring that it stays working > properly under all conditions, do you? > So, any chance to use something non-custom? Unfortunately, I'm totally out of time at this point. Let's see if I can return to this in a month's time or so. I'd also appreciate any ideas about existing primitives (rwlock_t seems closest but it can't have 3rd, exclusive state, AFAIR). > thanks, > greg k-h WBR, Sergei -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html