1 // Replace Linux spin_lock/spin_unlock calls by lockmgr ones
2 // Usage: spatch --no-includes --sp-file scripts/linux_spin_locks.cocci --in-place <files>
4 @@ expression E1, E2; @@
8 + lockmgr(E1, LK_EXCLUSIVE);
11 + lockmgr(E1, LK_RELEASE);
14 + lockmgr_try(E1, LK_EXCLUSIVE);
16 - spin_lock_nested(E1, E2);
17 + lockmgr(E1, LK_EXCLUSIVE);