Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.5.75 /kernel/acct.c

Filename:/kernel/acct.c
Lines Added:17
Lines Deleted:9
Also changed in: (Previous) 2.5.74-bk7  2.5.74-bk6  2.5.74-bk5  2.5.73  2.5.70  2.5.69-bk19 
(Following)

Location
[  2.5.75
  [  kernel
     o  acct.c

Patch

diff -Nru a/kernel/acct.c b/kernel/acct.c
--- a/kernel/acct.c   Thu Jul 10 13:16:27 2003
+++ b/kernel/acct.c   Thu Jul 10 13:16:27 2003
@@ -394,17 +394,25 @@
 /*
  * acct_process - now just a wrapper around do_acct_process
  */
-int acct_process(long exitcode)
+void acct_process(long exitcode)
 {
    struct file *file = NULL;
+
+   /*
+    * accelerate the common fastpath:
+    */
+   if (!acct_globals.file)
+      return;
+
    spin_lock(&acct_globals.lock);
-   if (acct_globals.file) {
-      file = acct_globals.file;
-      get_file(file);
+   file = acct_globals.file;
+   if (unlikely(!file)) {
       spin_unlock(&acct_globals.lock);
-      do_acct_process(exitcode, file);
-      fput(file);
-   } else
-      spin_unlock(&acct_globals.lock);
-   return 0;
+      return;
+   }
+   get_file(file);
+   spin_unlock(&acct_globals.lock);
+
+   do_acct_process(exitcode, file);
+   fput(file);
 }


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.