On Sun, 26 Nov 2006, Oliver Neukum wrote:

> > Second, instead of putting a lock in the buffer_collection you could just 
> > use the inode's lock.
> 
> That's a layering violation.

Your patch already uses inode->i_mutex.  Does that mean it already 
contains a layering violation?

> Plus that lock is used for other things, plus it might be held a pretty long
> time (eg the full control timeout)

No -- the buffer's lock is used during data transfers.  The only time the
buffer_collection's lock might overlap a data transfer is during
orphan_all_buffers().  Since that happens only when the inode is being
removed anyway, I don't think it will hurt to tie up the inode's lock.

> > Fourth, you might consider deallocating the sysfs_buffer_collection as
> > soon as the last buffer is removed from its list.  I don't know if this
> > really matters...
> 
> That would mean having to use the inode's lock.

As mentioned above, you already use that lock when you create the
buffer_collection.  I don't see anything wrong with using the lock again
when you deallocate it.

Alan Stern


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to