frontswap: get rid of swap_lock dependency
Frontswap initialization routine depends on swap_lock, which want to be
atomic about frontswap's first appearance. IOW, frontswap is not present
and will fail all calls OR frontswap is fully functional but if new
swap_info_struct isn't registered by enable_swap_info, swap subsystem
doesn't start I/O so there is no race between init procedure and page I/O
working on frontswap.
So let's remove unnecessary swap_lock dependency.
Cc: Dan Magenheimer <[email protected]>
Signed-off-by: Minchan Kim <[email protected]>
[v1: Rebased on my branch, reworked to work with backends loading late]
[v2: Added a check for !map]
[v3: Made the invalidate path follow the init path]
[v4: Address comments by Wanpeng Li <
[email protected]>]
Signed-off-by: Konrad Rzeszutek Wilk <[email protected]>
Signed-off-by: Bob Liu <[email protected]>
Cc: Wanpeng Li <[email protected]>
Cc: Andor Daam <[email protected]>
Cc: Florian Schmaus <[email protected]>
Cc: Stefan Hengelein <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>