Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3740a20c authored by Alexey Dobriyan's avatar Alexey Dobriyan Committed by Linus Torvalds
Browse files

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: default avatarAlexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent a6fc86d2
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -826,12 +826,9 @@ void remove_proc_entry(const char *name, struct proc_dir_entry *parent)

		wait_for_completion(de->pde_unload_completion);

		goto continue_removing;
		spin_lock(&de->pde_unload_lock);
	}
	spin_unlock(&de->pde_unload_lock);

continue_removing:
	spin_lock(&de->pde_unload_lock);
	while (!list_empty(&de->pde_openers)) {
		struct pde_opener *pdeo;