lkml.org 
[lkml]   [2000]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch-2.3.50-pre2] cleanup of bdflush()
Hi Linus,

1. bdflush() should use strcpy() instead of sprintf() to setup tsk->comm

2. saving current in a local variable tsk instead of referring to current
all the time saves 48 bytes of kernel code. Also, it makes it look the
same as kupdate() code - uniform kernel code is a good thing.

Hence the patch:

http://www.oscton.org/~tigran/patches/bdflush-2.3.50-p2.patch

Regards,
------
Tigran A. Aivazian | http://www.sco.com
Escalations Research Group | tel: +44-(0)1923-813796
Santa Cruz Operation Ltd | http://www.ocston.org/~tigran

--- buffer.c.0 Mon Mar 6 10:43:37 2000
+++ buffer.c Mon Mar 6 10:43:25 2000
@@ -2474,6 +2474,7 @@
*/
int bdflush(void * unused)
{
+ struct task_struct *tsk = current;
int flushed;
/*
* We have a bare-bones task_struct, and really should fill
@@ -2481,17 +2482,17 @@
* display semi-sane things. Not real crucial though...
*/

- current->session = 1;
- current->pgrp = 1;
- sprintf(current->comm, "kflushd");
- bdflush_tsk = current;
+ tsk->session = 1;
+ tsk->pgrp = 1;
+ strcpy(tsk->comm, "kflushd");
+ bdflush_tsk = tsk;

/* avoid getting signals */
- spin_lock_irq(&current->sigmask_lock);
- flush_signals(current);
- sigfillset(&current->blocked);
- recalc_sigpending(current);
- spin_unlock_irq(&current->sigmask_lock);
+ spin_lock_irq(&tsk->sigmask_lock);
+ flush_signals(tsk);
+ sigfillset(&tsk->blocked);
+ recalc_sigpending(tsk);
+ spin_unlock_irq(&tsk->sigmask_lock);

for (;;) {
CHECK_EMERGENCY_SYNC

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:56    [W:0.020 / U:0.452 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site