]> git.baikalelectronics.ru Git - kernel.git/commit
fs: hlist UP debug fixup
authorNick Piggin <npiggin@kernel.dk>
Fri, 14 Jan 2011 02:36:43 +0000 (02:36 +0000)
committerNick Piggin <npiggin@hera.kernel.org>
Fri, 14 Jan 2011 02:36:43 +0000 (02:36 +0000)
commitf75263d70acfa8f58cbf95f5c74be49b4bb6d77a
tree84eea829cab7b28585000f6fd7fe0dc176b746c5
parent4bd1b167d273db10245b7c9aeb6320dce121397f
fs: hlist UP debug fixup

Po-Yu Chuang <ratbert.chuang@gmail.com> noticed that hlist_bl_set_first could
crash on a UP system when LIST_BL_LOCKMASK is 0, because

LIST_BL_BUG_ON(!((unsigned long)h->first & LIST_BL_LOCKMASK));

always evaulates to true.

Fix the expression, and also avoid a dependency between bit spinlock
implementation and list bl code (list code shouldn't know anything
except that bit 0 is set when adding and removing elements). Eventually
if a good use case comes up, we might use this list to store 1 or more
arbitrary bits of data, so it really shouldn't be tied to locking either,
but for now they are helpful for debugging.

Signed-off-by: Nick Piggin <npiggin@kernel.dk>
include/linux/list_bl.h
include/linux/rculist_bl.h