[PATCH] proc: less LOCK/UNLOCK in remove_proc_entry()

Previous thread: [PATCHSET] x86: unify x86_32 and 64 NUMA init paths, take#2 by Tejun Heo on Saturday, November 27, 2010 - 8:21 am. (37 messages)

Next thread: [GIT PULL] sound fixes for 2.6.37-rc4 by Takashi Iwai on Saturday, November 27, 2010 - 9:39 am. (1 message)
From: Alexey Dobriyan
Date: Saturday, November 27, 2010 - 8:24 am

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

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 fs/proc/generic.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -834,12 +834,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;
 
--

Previous thread: [PATCHSET] x86: unify x86_32 and 64 NUMA init paths, take#2 by Tejun Heo on Saturday, November 27, 2010 - 8:21 am. (37 messages)

Next thread: [GIT PULL] sound fixes for 2.6.37-rc4 by Takashi Iwai on Saturday, November 27, 2010 - 9:39 am. (1 message)