Messages in this thread Patch in this message | | | Date | Mon, 6 Mar 2000 13:16:19 +0000 (GMT) | From | Tigran Aivazian <> | 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(¤t->sigmask_lock); - flush_signals(current); - sigfillset(¤t->blocked); - recalc_sigpending(current); - spin_unlock_irq(¤t->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/
| |