]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit - net/xfrm/xfrm_state.c
xfrm: remove useless hash_resize_mutex locks
authorYing Xue <ying.xue@windriver.com>
Fri, 29 Aug 2014 09:09:07 +0000 (17:09 +0800)
committerSteffen Klassert <steffen.klassert@secunet.com>
Fri, 29 Aug 2014 09:40:03 +0000 (11:40 +0200)
commit0244790c8ad2408dfb313e5c886e6e5a808ea946
tree8d1868c1455d876f535b2a82ac8dee0fc2690dde
parenta3d1214688d5259a200414def4d38f1e4531febd
xfrm: remove useless hash_resize_mutex locks

In xfrm_state.c, hash_resize_mutex is defined as a local variable
and only used in xfrm_hash_resize() which is declared as a work
handler of xfrm.state_hash_work. But when the xfrm.state_hash_work
work is put in the global workqueue(system_wq) with schedule_work(),
the work will be really inserted in the global workqueue if it was
not already queued, otherwise, it is still left in the same position
on the the global workqueue. This means the xfrm_hash_resize() work
handler is only executed once at any time no matter how many times
its work is scheduled, that is, xfrm_hash_resize() is not called
concurrently at all, so hash_resize_mutex is redundant for us.

Cc: Christophe Gouault <christophe.gouault@6wind.com>
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Ying Xue <ying.xue@windriver.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/xfrm/xfrm_state.c