Commit 46052b73 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] remove unneeded locking in do_syslog()

Lots of nonsensical locking in there.
parent cf336416
...@@ -243,19 +243,13 @@ int do_syslog(int type, char * buf, int len) ...@@ -243,19 +243,13 @@ int do_syslog(int type, char * buf, int len)
break; break;
case 5: /* Clear ring buffer */ case 5: /* Clear ring buffer */
spin_lock_irq(&logbuf_lock);
logged_chars = 0; logged_chars = 0;
spin_unlock_irq(&logbuf_lock);
break; break;
case 6: /* Disable logging to console */ case 6: /* Disable logging to console */
spin_lock_irq(&logbuf_lock);
console_loglevel = minimum_console_loglevel; console_loglevel = minimum_console_loglevel;
spin_unlock_irq(&logbuf_lock);
break; break;
case 7: /* Enable logging to console */ case 7: /* Enable logging to console */
spin_lock_irq(&logbuf_lock);
console_loglevel = default_console_loglevel; console_loglevel = default_console_loglevel;
spin_unlock_irq(&logbuf_lock);
break; break;
case 8: /* Set level of messages printed to console */ case 8: /* Set level of messages printed to console */
error = -EINVAL; error = -EINVAL;
...@@ -263,15 +257,11 @@ int do_syslog(int type, char * buf, int len) ...@@ -263,15 +257,11 @@ int do_syslog(int type, char * buf, int len)
goto out; goto out;
if (len < minimum_console_loglevel) if (len < minimum_console_loglevel)
len = minimum_console_loglevel; len = minimum_console_loglevel;
spin_lock_irq(&logbuf_lock);
console_loglevel = len; console_loglevel = len;
spin_unlock_irq(&logbuf_lock);
error = 0; error = 0;
break; break;
case 9: /* Number of chars in the log buffer */ case 9: /* Number of chars in the log buffer */
spin_lock_irq(&logbuf_lock);
error = log_end - log_start; error = log_end - log_start;
spin_unlock_irq(&logbuf_lock);
break; break;
default: default:
error = -EINVAL; error = -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment