Re: [6/9] [RFC] Steps to fixing the driver model locking

2005-03-23 Thread Patrick Mochel
On Wed, 23 Mar 2005, OGAWA Hirofumi wrote: > Patrick Mochel <[EMAIL PROTECTED]> writes: > > > +void klist_del(struct klist_node * n) > > +{ > > + struct klist * k = n->n_klist; > > + > > + spin_lock(>k_lock); > > + klist_dec_and_del(n); > > + spin_unlock(>k_lock); > > +} > > Can't we use

Re: [6/9] [RFC] Steps to fixing the driver model locking

2005-03-23 Thread OGAWA Hirofumi
Patrick Mochel <[EMAIL PROTECTED]> writes: > +void klist_del(struct klist_node * n) > +{ > + struct klist * k = n->n_klist; > + > + spin_lock(>k_lock); > + klist_dec_and_del(n); > + spin_unlock(>k_lock); > +} Can't we use atomic_dec_and_lock()? [...] > +void klist_remove(struct

Re: [6/9] [RFC] Steps to fixing the driver model locking

2005-03-23 Thread OGAWA Hirofumi
Patrick Mochel [EMAIL PROTECTED] writes: +void klist_del(struct klist_node * n) +{ + struct klist * k = n-n_klist; + + spin_lock(k-k_lock); + klist_dec_and_del(n); + spin_unlock(k-k_lock); +} Can't we use atomic_dec_and_lock()? [...] +void klist_remove(struct

Re: [6/9] [RFC] Steps to fixing the driver model locking

2005-03-23 Thread Patrick Mochel
On Wed, 23 Mar 2005, OGAWA Hirofumi wrote: Patrick Mochel [EMAIL PROTECTED] writes: +void klist_del(struct klist_node * n) +{ + struct klist * k = n-n_klist; + + spin_lock(k-k_lock); + klist_dec_and_del(n); + spin_unlock(k-k_lock); +} Can't we use

Re: [6/9] [RFC] Steps to fixing the driver model locking

2005-03-22 Thread Patrick Mochel
On Tue, 22 Mar 2005, Christoph Hellwig wrote: > On Mon, Mar 21, 2005 at 12:48:47PM -0800, Patrick Mochel wrote: > > > > [EMAIL PROTECTED], 2005-03-21 11:45:16-08:00, [EMAIL PROTECTED] > > [klist] Add initial implementation of klist helpers. > > > This klist interface provides a couple of

Re: [6/9] [RFC] Steps to fixing the driver model locking

2005-03-22 Thread Christoph Hellwig
On Mon, Mar 21, 2005 at 12:48:47PM -0800, Patrick Mochel wrote: > > [EMAIL PROTECTED], 2005-03-21 11:45:16-08:00, [EMAIL PROTECTED] > [klist] Add initial implementation of klist helpers. > This klist interface provides a couple of structures that wrap around > struct list_head to provide

Re: [6/9] [RFC] Steps to fixing the driver model locking

2005-03-22 Thread Christoph Hellwig
On Mon, Mar 21, 2005 at 12:48:47PM -0800, Patrick Mochel wrote: [EMAIL PROTECTED], 2005-03-21 11:45:16-08:00, [EMAIL PROTECTED] [klist] Add initial implementation of klist helpers. This klist interface provides a couple of structures that wrap around struct list_head to provide

Re: [6/9] [RFC] Steps to fixing the driver model locking

2005-03-22 Thread Patrick Mochel
On Tue, 22 Mar 2005, Christoph Hellwig wrote: On Mon, Mar 21, 2005 at 12:48:47PM -0800, Patrick Mochel wrote: [EMAIL PROTECTED], 2005-03-21 11:45:16-08:00, [EMAIL PROTECTED] [klist] Add initial implementation of klist helpers. This klist interface provides a couple of structures

[6/9] [RFC] Steps to fixing the driver model locking

2005-03-21 Thread Patrick Mochel
[EMAIL PROTECTED], 2005-03-21 11:45:16-08:00, [EMAIL PROTECTED] [klist] Add initial implementation of klist helpers. This klist interface provides a couple of structures that wrap around struct list_head to provide explicit list "head" (struct klist) and list "node" (struct klist_node)

[6/9] [RFC] Steps to fixing the driver model locking

2005-03-21 Thread Patrick Mochel
[EMAIL PROTECTED], 2005-03-21 11:45:16-08:00, [EMAIL PROTECTED] [klist] Add initial implementation of klist helpers. This klist interface provides a couple of structures that wrap around struct list_head to provide explicit list head (struct klist) and list node (struct klist_node)