]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commit
ide-floppy: allocate only toplevel packet commands
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 2 Jan 2009 15:12:51 +0000 (16:12 +0100)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Fri, 2 Jan 2009 15:12:51 +0000 (16:12 +0100)
commit07bd3f4731f9c7ebcbab90905ca4ad6fc6825f96
treea221416a18a4b1d69009ecd933496b3edafaba01
parentbf64741fe89280bd81a9e3a1beadec1570861848
ide-floppy: allocate only toplevel packet commands

This makes the top-level function just allocate a single pc entry, and then
pass it down as a pointer to all the helper functions that also need one
of those "struct ide_atapi_pc" things. As far as I can tell, the use of
these things never overlaps each other, BUT I DID NOT CHECK VERY CLOSELY!

So I'm not guaranteeing this is correct, and I don't have the hardware. It
would be good for somebody who knows the code more, and has the hardware,
could please test this?

With this, ide-floppy still has fairly big stack usage, but instead of

idefloppy_ioctl [vmlinux]:              1208
ide_floppy_get_capacity [vmlinux]:      872
idefloppy_release [vmlinux]:            408
idefloppy_open [vmlinux]:               408

where those two first ones are at the very top of the list of stack users
for me, it's now

ide_floppy_get_capacity [vmlinux]:           404
ide_floppy_ioctl [vmlinux]:                  364

ie they are still high, but they are no longer at the top.

Borislav: Since ide_floppy_get_capacity is passed as a function pointer to other
parts of the kernel (e.g., block layer) we need that ide_atapi_pc to be created
on stack. Also, redid stack users numbers above. The two functions missing from
Linus' original 'make stackusage' output are due to ide being
rewritten/reorganized atm.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/ide-floppy.c
drivers/ide/ide-floppy_ioctl.c