Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

proc: less LOCK/UNLOCK in remove_proc_entry()

For the common case where a proc entry is being removed and nobody is in
the process of using it, save a LOCK/UNLOCK pair.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Alexey Dobriyan and committed by
Linus Torvalds
3740a20c a6fc86d2

+1 -4
+1 -4
fs/proc/generic.c
··· 826 826 827 827 wait_for_completion(de->pde_unload_completion); 828 828 829 - goto continue_removing; 829 + spin_lock(&de->pde_unload_lock); 830 830 } 831 - spin_unlock(&de->pde_unload_lock); 832 831 833 - continue_removing: 834 - spin_lock(&de->pde_unload_lock); 835 832 while (!list_empty(&de->pde_openers)) { 836 833 struct pde_opener *pdeo; 837 834