<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/lib/klist.c, branch v3.4-rc2</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/lib/klist.c?h=v3.4-rc2</id>
<link rel='self' href='https://git.amat.us/linux/atom/lib/klist.c?h=v3.4-rc2'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2012-03-07T20:04:04Z</updated>
<entry>
<title>lib: reduce the use of module.h wherever possible</title>
<updated>2012-03-07T20:04:04Z</updated>
<author>
<name>Paul Gortmaker</name>
<email>paul.gortmaker@windriver.com</email>
</author>
<published>2011-11-17T02:29:17Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=8bc3bcc93a2b4e47d5d410146f6546bca6171663'/>
<id>urn:sha1:8bc3bcc93a2b4e47d5d410146f6546bca6171663</id>
<content type='text'>
For files only using THIS_MODULE and/or EXPORT_SYMBOL, map
them onto including export.h -- or if the file isn't even
using those, then just delete the include.  Fix up any implicit
include dependencies that were being masked by module.h along
the way.

Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
</content>
</entry>
<entry>
<title>driver core: Remove completion from struct klist_node</title>
<updated>2009-01-06T18:44:30Z</updated>
<author>
<name>Matthew Wilcox</name>
<email>matthew@wil.cx</email>
</author>
<published>2008-10-16T20:57:54Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=210272a28465a7a31bcd580d2f9529f924965aa5'/>
<id>urn:sha1:210272a28465a7a31bcd580d2f9529f924965aa5</id>
<content type='text'>
Removing the completion from klist_node reduces its size from 64 bytes
to 28 on x86-64.  To maintain the semantics of klist_remove(), we add
a single list of klist nodes which are pending deletion and scan them.

Signed-off-by: Matthew Wilcox &lt;willy@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>klist: don't iterate over deleted entries</title>
<updated>2008-10-09T06:56:04Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2008-08-25T17:50:16Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a1ed5b0cffe4b16a93a6a3390e8cee0fbef94f86'/>
<id>urn:sha1:a1ed5b0cffe4b16a93a6a3390e8cee0fbef94f86</id>
<content type='text'>
A klist entry is kept on the list till all its current iterations are
finished; however, a new iteration after deletion also iterates over
deleted entries as long as their reference count stays above zero.
This causes problems for cases where there are users which iterate
over the list while synchronized against list manipulations and
natuarally expect already deleted entries to not show up during
iteration.

This patch implements dead flag which gets set on deletion so that
iteration can skip already deleted entries.  The dead flag piggy backs
on the lowest bit of knode-&gt;n_klist and only visible to klist
implementation proper.

While at it, drop klist_iter-&gt;i_head as it's redundant and doesn't
offer anything in semantics or performance wise as klist_iter-&gt;i_klist
is dereferenced on every iteration anyway.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
Cc: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Cc: Jens Axboe &lt;jens.axboe@oracle.com&gt;
Signed-off-by: Jens Axboe &lt;jens.axboe@oracle.com&gt;
</content>
</entry>
<entry>
<title>klist: fix coding style errors in klist.h and klist.c</title>
<updated>2008-04-30T23:52:58Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@suse.de</email>
</author>
<published>2008-04-30T23:43:45Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=c3bb7fadaf52de3637b834002dac27f6250b4b49'/>
<id>urn:sha1:c3bb7fadaf52de3637b834002dac27f6250b4b49</id>
<content type='text'>
Finally clean up the odd spacing in these files.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>klist: implement klist_add_{after|before}()</title>
<updated>2008-04-30T23:52:47Z</updated>
<author>
<name>Tejun Heo</name>
<email>htejun@gmail.com</email>
</author>
<published>2008-04-22T09:58:46Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=93dd40013f4f7f4b18d19d0d77855f025bcc57c3'/>
<id>urn:sha1:93dd40013f4f7f4b18d19d0d77855f025bcc57c3</id>
<content type='text'>
Add klist_add_after() and klist_add_before() which puts a new node
after and before an existing node, respectively.  This is useful for
callers which need to keep klist ordered.  Note that synchronizing
between simultaneous additions for ordering is the caller's
responsibility.

Signed-off-by: Tejun Heo &lt;htejun@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>Driver core: Don't call put methods while holding a spinlock</title>
<updated>2006-09-26T04:08:40Z</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2006-09-18T20:28:06Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=7e9f4b2d3e21e87c26025810413ef1592834e63b'/>
<id>urn:sha1:7e9f4b2d3e21e87c26025810413ef1592834e63b</id>
<content type='text'>
The klist utility routines currently call _put methods while holding a
spinlock.  This is of course illegal; a put routine could try to
unregister a device and hence need to sleep.

No problems have arisen until now because in many cases klist removals
were done synchronously, so the _put methods were never actually used.
In other cases we may simply have been lucky.

This patch (as784) reworks the klist routines so that _put methods are
called only _after_ the klist's spinlock has been released.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>[PATCH] klist: Fix broken kref counting in find functions</title>
<updated>2006-01-05T00:18:08Z</updated>
<author>
<name>Frank Pavlic</name>
<email>pavlic@de.ibm.com</email>
</author>
<published>2005-11-27T04:48:40Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=e22dafbcd7a579c29a424d5203b5b33b131948a7'/>
<id>urn:sha1:e22dafbcd7a579c29a424d5203b5b33b131948a7</id>
<content type='text'>
The klist reference counting in the find functions that use
klist_iter_init_node is broken.  If the function (for example
driver_find_device) is called with a NULL start object then everything is
fine, the first call to next_device()/klist_next increases the ref-count of
the first node on the list and does nothing for the start object which is
NULL.

If they are called with a valid start object then klist_next will decrement
the ref-count for the start object but nobody has incremented it.  Logical
place to fix this would be klist_iter_init_node because the function puts a
reference of the object into the klist_iter struct.

Signed-off-by: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
Signed-off-by: Frank Pavlic &lt;pavlic@de.ibm.com&gt;
Cc: Patrick Mochel &lt;mochel@digitalimplant.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>[PATCH] fix klist semantics for lists which have elements removed on traversal</title>
<updated>2005-09-08T01:26:54Z</updated>
<author>
<name>James Bottomley</name>
<email>James.Bottomley@HansenPartnership.com</email>
</author>
<published>2005-09-06T23:56:51Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=34bb61f9ddabd7a7f909cbfb05592eb775f6662a'/>
<id>urn:sha1:34bb61f9ddabd7a7f909cbfb05592eb775f6662a</id>
<content type='text'>
The problem is that klists claim to provide semantics for safe traversal of
lists which are being modified.  The failure case is when traversal of a
list causes element removal (a fairly common case).  The issue is that
although the list node is refcounted, if it is embedded in an object (which
is universally the case), then the object will be freed regardless of the
klist refcount leading to slab corruption because the klist iterator refers
to the prior element to get the next.

The solution is to make the klist take and release references to the
embedding object meaning that the embedding object won't be released until
the list relinquishes the reference to it.

(akpm: fast-track this because it's needed for the 2.6.13 scsi merge)

Signed-off-by: James Bottomley &lt;James.Bottomley@SteelEye.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] klist: fix klist to have the same klist_add semantics as list_head</title>
<updated>2005-09-05T23:03:13Z</updated>
<author>
<name>James Bottomley</name>
<email>James.Bottomley@SteelEye.com</email>
</author>
<published>2005-08-19T13:14:01Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=d856f1e337782326c638c70c0b4df2b909350dec'/>
<id>urn:sha1:d856f1e337782326c638c70c0b4df2b909350dec</id>
<content type='text'>
at the moment, the list_head semantics are

list_add(node, head)

whereas current klist semantics are

klist_add(head, node)

This is bound to cause confusion, and since klist is the newcomer, it
should follow the list_head semantics.

I also added missing include guards to klist.h

Signed-off-by: James Bottomley &lt;James.Bottomley@SteelEye.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>[PATCH] Don't reference NULL klist pointer in klist_remove().</title>
<updated>2005-06-20T22:15:19Z</updated>
<author>
<name>mochel@digitalimplant.org</name>
<email>mochel@digitalimplant.org</email>
</author>
<published>2005-03-25T02:59:59Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0293a509405dccecc30783a5d729d615b68d6a77'/>
<id>urn:sha1:0293a509405dccecc30783a5d729d615b68d6a77</id>
<content type='text'>
Signed-off-by: Patrick Mochel &lt;mochel@digitalimplant.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

diff -Nru a/lib/klist.c b/lib/klist.c
</content>
</entry>
</feed>
