]> git.baikalelectronics.ru Git - kernel.git/commit
rhashtable: Change rhashtable_walk_start to return void
authorTom Herbert <tom@quantonium.net>
Mon, 4 Dec 2017 18:31:41 +0000 (10:31 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 11 Dec 2017 14:58:38 +0000 (09:58 -0500)
commitf8240ec417a6074fb07e93b039de596932e61cb2
tree06f6f0559c003ac7f718d1453120bf21044d7a35
parentd5a550dbd47cc762c1164de25c0804d0a7988d40
rhashtable: Change rhashtable_walk_start to return void

Most callers of rhashtable_walk_start don't care about a resize event
which is indicated by a return value of -EAGAIN. So calls to
rhashtable_walk_start are wrapped wih code to ignore -EAGAIN. Something
like this is common:

       ret = rhashtable_walk_start(rhiter);
       if (ret && ret != -EAGAIN)
               goto out;

Since zero and -EAGAIN are the only possible return values from the
function this check is pointless. The condition never evaluates to true.

This patch changes rhashtable_walk_start to return void. This simplifies
code for the callers that ignore -EAGAIN. For the few cases where the
caller cares about the resize event, particularly where the table can be
walked in mulitple parts for netlink or seq file dump, the function
rhashtable_walk_start_check has been added that returns -EAGAIN on a
resize event.

Signed-off-by: Tom Herbert <tom@quantonium.net>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 files changed:
drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c
drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c
fs/gfs2/glock.c
include/linux/rhashtable.h
include/net/sctp/sctp.h
lib/rhashtable.c
lib/test_rhashtable.c
net/ipv6/ila/ila_xlat.c
net/ipv6/seg6.c
net/mac80211/mesh_pathtbl.c
net/netfilter/nft_set_hash.c
net/netlink/af_netlink.c
net/netlink/diag.c
net/sctp/proc.c
net/sctp/socket.c
net/tipc/socket.c