OSDN Git Service

rhashtable: Allow rhashtable to be used from irq-safe contexts
authorTejun Heo <tj@kernel.org>
Tue, 6 Dec 2022 21:36:32 +0000 (11:36 -1000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 9 Dec 2022 10:42:56 +0000 (10:42 +0000)
commite47877c7aa821c413b45e05f804819579bdfa1a3
tree281f4a159cd9d5ddfa0c940636a72868e8c19cff
parentb602d00384bdfb8874cc4dcb298fc87cc369630b
rhashtable: Allow rhashtable to be used from irq-safe contexts

rhashtable currently only does bh-safe synchronization making it impossible
to use from irq-safe contexts. Switch it to use irq-safe synchronization to
remove the restriction.

v2: Update the lock functions to return the ulong flags value and unlock
    functions to take the value directly instead of passing around the
    pointer. Suggested by Linus.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: David Vernet <dvernet@meta.com>
Acked-by: Josh Don <joshdon@google.com>
Acked-by: Hao Luo <haoluo@google.com>
Acked-by: Barret Rhoden <brho@google.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/rhashtable.h
lib/rhashtable.c