| Age | Commit message (Collapse) | Author |
|
Originally from Boaz Harrosh <bharrosh@panasas.com>
It hasn't been working in 2.5 or 2.6 ever, since it's still buffer_head
based.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
|
|
After Al Viro (finally) succeeded in removing the sched.h #include in module.h
recently, it makes sense again to remove other superfluous sched.h includes.
There are quite a lot of files which include it but don't actually need
anything defined in there. Presumably these includes were once needed for
macros that used to live in sched.h, but moved to other header files in the
course of cleaning it up.
To ease the pain, this time I did not fiddle with any header files and only
removed #includes from .c-files, which tend to cause less trouble.
Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha,
arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig,
allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all
configs in arch/arm/configs on arm. I also checked that no new warnings were
introduced by the patch (actually, some warnings are removed that were emitted
by unnecessarily included header files).
Signed-off-by: Tim Schmielau <tim@physik3.uni-rostock.de>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
|
|
Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
of passing regs around manually through all ~1800 interrupt handlers in the
Linux kernel.
The regs pointer is used in few places, but it potentially costs both stack
space and code to pass it around. On the FRV arch, removing the regs parameter
from all the genirq function results in a 20% speed up of the IRQ exit path
(ie: from leaving timer_interrupt() to leaving do_IRQ()).
Where appropriate, an arch may override the generic storage facility and do
something different with the variable. On FRV, for instance, the address is
maintained in GR28 at all times inside the kernel as part of general exception
handling.
Having looked over the code, it appears that the parameter may be handed down
through up to twenty or so layers of functions. Consider a USB character
device attached to a USB hub, attached to a USB controller that posts its
interrupts through a cascaded auxiliary interrupt controller. A character
device driver may want to pass regs to the sysrq handler through the input
layer which adds another few layers of parameter passing.
I've build this code with allyesconfig for x86_64 and i386. I've runtested the
main part of the code on FRV and i386, though I can't test most of the drivers.
I've also done partial conversion for powerpc and MIPS - these at least compile
with minimal configurations.
This will affect all archs. Mostly the changes should be relatively easy.
Take do_IRQ(), store the regs pointer at the beginning, saving the old one:
struct pt_regs *old_regs = set_irq_regs(regs);
And put the old one back at the end:
set_irq_regs(old_regs);
Don't pass regs through to generic_handle_irq() or __do_IRQ().
In timer_interrupt(), this sort of change will be necessary:
- update_process_times(user_mode(regs));
- profile_tick(CPU_PROFILING, regs);
+ update_process_times(user_mode(get_irq_regs()));
+ profile_tick(CPU_PROFILING);
I'd like to move update_process_times()'s use of get_irq_regs() into itself,
except that i386, alone of the archs, uses something other than user_mode().
Some notes on the interrupt handling in the drivers:
(*) input_dev() is now gone entirely. The regs pointer is no longer stored in
the input_dev struct.
(*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking. It does
something different depending on whether it's been supplied with a regs
pointer or not.
(*) Various IRQ handler function pointers have been moved to type
irq_handler_t.
Signed-Off-By: David Howells <dhowells@redhat.com>
(cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
|
|
Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
|
|
And remove the now unneeded number field.
Also fixes all drivers that set these fields.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
|
HDIO_GETGEO is implemented in most block drivers, and all of them have to
duplicate the code to copy the structure to userspace, as well as getting
the start sector. This patch moves that to common code [1] and adds a
->getgeo method to fill out the raw kernel hd_geometry structure. For many
drivers this means ->ioctl can go away now.
[1] the s390 block drivers are odd in this respect. xpram sets ->start
to 4 always which seems more than odd, and the dasd driver shifts
the start offset around, probably because of it's non-standard
sector size.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Jens Axboe <axboe@suse.de>
Cc: <mike.miller@hp.com>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Paolo Giarrusso <blaisorblade@yahoo.it>
Cc: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
Cc: Neil Brown <neilb@cse.unsw.edu.au>
Cc: Markus Lidel <Markus.Lidel@shadowconnect.com>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
|
|
Clean up timer initialization by introducing DEFINE_TIMER a'la
DEFINE_SPINLOCK. Build and boot-tested on x86. A similar patch has been
been in the -RT tree for some time.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Use the new lock initializers DEFINE_SPIN_LOCK and DEFINE_RW_LOCK
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Atari ACSI: Add missing include and fix duplicate parameter type
|
|
From: Andrey Borzenkov <arvidjaar@mail.ru>
Various block drivers are currently devfs-unaware. Andrey's patch attempts
to give them reasonable representations in devfs.
"The attached patch suggests some possible names for non-floppy devices
based on reading driver source. I have to ask if these make sense. At
least for cciss Mandrake devfsd patch expects different names but it
seems to be mistake (it assumes single controller always)
"For floppy it is not as simple. Floppy cannot use genhd and must
create names manually; but I do not know what names are appropriate or
expected.
"For acsi the target/lun name may have problem of creating compat names
(if any) by devfsd.
"Please note that none of them created any devfs name under 2.4 as well.
So it is not a regression ..."
|
|
To be able to properly be able to keep references to block queues,
we make blk_init_queue() return the queue that it initialized, and
let it be independently allocated and then cleaned up on the last
reference.
I have grepped high and low, and there really shouldn't be any broken
uses of blk_init_queue() in the kernel drivers left. The added bonus
being blk_init_queue() error checking is explicit now, most of the
drivers were broken in this regard (even IDE/SCSI).
No drivers have embedded request queue structures. Drivers that don't
use blk_init_queue() but blk_queue_make_request(), should allocate the
queue with blk_alloc_queue(gfp_mask). I've converted all of them to do
that, too. They can call blk_cleanup_queue() now too, using the define
blk_put_queue() is probably cleaner though.
|
|
This causes blk.h to print a warning and removes all uses of blk.h.
I've tested the compilation in 2.6.0-test1 with a .config that tries to
compile as many drivers as possible.
|
|
disk->minor_shift is not used anymore. Remove it.
|
|
M68k block drivers: Update to the new irq API (from Roman Zippel and me) [13/20]
|
|
This finally kills of blk_queue_empty(). This is similar to the patch I
recently sent to fix the SCSI logic as well. A lot of drivers are doing
this in our core, mainly because that is the way they always did it:
start_queue:
if (blk_queue_empty(q))
return;
rq = elv_next_request(q);
if (!rq)
return;
Patch simply removes the blk_queue_empty() check, and adds a check for
!rq return from elv_next_request() if the driver didn't already do that.
Additionally, the AS io scheduler can return NULL from
elv_next_request() if it thinks this is best. This way we are also
prepared for that to work well.
Patch was done by Nick Piggin.
|
|
Patch from Andries.Brouwer@cwi.nl
The following patch does the following:
- static const char *blkdevs[MAX_BLKDEV]; disappears
- get_blkdev_list, (un)register_blkdev, __bdevname
are moved from block_dev.c to genhd.c
- the third "fops" parameter of register_blkdev was unused;
now removed everywhere
- zillions of places had printk("cannot get major") upon
error return from register_blkdev; removed all of these
and inserted a single printk in register_blkdev.
Of course the reason for the patch is that one fixed size
array is eliminated.
|
|
Convert m68k block drivers to new local_irq*() framework:
- Atari ACSI
- Amiga floppy
- Atari floppy
- Macintosh IIfx/Quadra 900/Quadra 950 floppy
|
|
In <= 2.4 some of the mess in blk.h needed it defined, but that's
long gone now.
|
|
Results of a quick pass through everything under drivers/. We're
mostly OK in there. I will have missed some.
|
|
* remove blk_dev[]
* removed BLK_DEFAULT_QUEUE
* moved definition of CURRENT into drivers that used it
* removed definition of QUEUE from headers
|
|
* switched to private queue
* set ->queue and ->private_data
* switched to new methods
* cleaned up
* switched to use of ->bd_disk and ->rq_disk
|
|
Quite a few drivers don't need ->open() anymore - all it did was checking
that minor is good (== gendisk exists). That is handled by generic code
now...
|
|
new field - disk->minors (1 << disk->minor_shift). Almost all uses
of ->minor_shift had that form and thus had been replaced.
|
|
allocation of ->part[] moved to alloc_disk(); alloc_disk() got an
argument (number of minors expected). Freeing is in put_disk().
|
|
That's the last one. Now we can start doing refcounting...
|
|
char *major_name replaced with char disk_name[16]; All uses of ->major_name
replaced with those of ->disk_name and (obviously) simplified big way. Bunch
of arrays, kmallocs, etc. is gone.
|
|
Almost all callers of add_gendisk() were immediately followed by
register_disk(disk, mk_kdev(disk->major,disk->first_minor),
1<<disk->minor_shift, disk->fops, something);
The only exception (DAC960.c) massaged to that form.
New helper (add_disk(disk)) introduced and aforementioned sequence
replaced with
set_capacity(disk, something);
add_disk(disk);
|
|
* we remove the paritition 0 from ->part[] and put the old
contents of ->part[0] into gendisk itself; indexes are shifted, obviously.
* ->part is allocated at add_gendisk() time and freed at del_gendisk()
according to value of ->minor_shift; static arrays of hd_struct are gone
from drivers, ditto for manual allocations a-la ide. As the matter of fact,
none of the drivers know about struct hd_struct now.
|
|
new helpers - get_capacity(gendisk)/set_capacity(gendisk, sectors).
Drivers switched to these; that eliminates most of the accesses to
disk->part[]... in the drivers (and makes code more readable, while
we are at it). That had caught several bugs when minor had been
used in place of minor>>minor_shift (acsi.c is especially nasty in
that respect; I don't know if it had ever been used with multiple
devices...)
|
|
Since ->nr_real is always 1 now, we can remove that field completely.
Removed the last remnants of switch in disk_name() (it could be killed
a long time ago, I just forgot to remove the last two cases when md and i2o
got converted). Collapsed several instances of
disk->part[minor - disk->first_minor] - in cases when we know that we deal
with disk->part[0].
|
|
|
|
Big One. Flushing/rereading partition tables is taken from
->revalidate() for partitioned devices; now it's done in the
caller (check_disk_change()). BLKRRPART handling also moved
out of drivers - they are still allowed to override it (DAC960
and i2o are the only remaining ones), but common case is handled
in fs/block_dev.c.
Note: we are still only shifting stuff - bd_sem deadlocks in
check_disk_change() are still there. However, now we have all
relevant code outside of drivers and that will allow to fix the
thing (see next patches).
|
|
check_disk_change() converted to passing struct block_device.
Old variant is still needed for a couple of places; wrapper
is provided (__check_disk_change(kdev)). do_open() logics
with setting ->bd_op sanitized - now we do that before calling
->open().
|
|
kills use of blk_size[] for partitioned devices, removes ->sizes from
struct gendisk.
|
|
Use register_blkdev and unregister_blkdev as before, and everything will work just fine.
|
|
|
|
- Atari joystick device number updates
- Atari ACSI hard disk driver device updates
- Atari floppy driver device updates
- MVME147 serial driver dev_t update
|
|
blk_ioctl() not exported anymore; calls moved from drivers to block_dev.c.
|
|
Horrors with open/reread_partition exclusion are starting to get fixed.
It's not the final variant, but at least we are getting the logics into
one place; switch to final variant will happen once we get per-disk
analog of gendisks. New fields - ->bd_part_sem and ->bd_part_count.
The latter counts the amount of opened partitions. The former protects
said count _and_ is held while we are rereading partition tables.
Helpers - dev_part_lock()/dev_part_unlock() (currently taking kdev_t; that
will change pretty soon). No more ->open() and ->release() for partitions,
all that logics went to generic code. Lock hierachy is currently messy:
->bd_sem for partitions -> ->bd_part_sem -> ->bd_sem for entire disks
Ugly, but that'll go away and to get the final variant of locking right
now would take _really_ big patch - with a lot of steps glued together.
The damn thing is large as it is...
|
|
end_request(int) turned to end_request(req, int); all old callers
are converted to end_request(CURRENT, value). Now we can start
killing CURRENT/QUEUE - end_request() was the last obstacle to
that.
|
|
ditto for DEVICE_INTR/CLEAR_INTR. do_mfm/do_acsi/do_hd/... are
explicitly declared in the drivers that use DEVICE_INTR stuff;
DEVICE_INTR/CLEAR_INTR is gone from blk.h.
|
|
monstrous cascade of #ifdefs is gone from blk.h. This is the first
step of cleanup - we move #define in question into the code that
includes blk.h (i.e. DEVICE_NR, DEVICE_NAME and DEVICE_INTR are
explicitly set by drivers).
|
|
- Remove DEVICE_INTR and associated code from floppy driver.
- Savlage s390 xpram code from kernel version dependant compilation disease.
- Eliminate SET_INTR code from the places where it was used.
- Eliminate bogous support for multiple sbpcd controllers. The driver didn't
even compile right now before we could think about further supporting it at
all we have to get rid of this hack first.
Don't call invalidate_buffers in the release method there.
Why should it be necessary?
- Resurrect sonycd535 compilation.
- Let CURRENT request macro use the same primitive at the remaining QUEUE macro
in blk.h, which is still not quite right, but first things first :-).
|
|
- Eliminate all usages of the obscure QUEUE_EMPTY macro.
- Eliminate all unneccessary checks for RQ_INACTIVE, this can't happen during
the time we run the request strategy routine of a single major number block
device. Perhaps the still remaining usage in scsi and i2o_block.c should be
killed as well, since the upper ll_rw_blk layer shouldn't pass inactive
requests down.
Those are all places where we have deeply burried and hidden major number
indexed arrays. Let's deal with them slowly...
|
|
- put block size in bdev->bd_block_size, make do_open() and
check_partition() to set it (see above), switch set_blocksize() and
block_size() to use of ->bd_block_size. Remove manipulations with
blksize_size[] from drivers, remove blksize_size[] itself.
|
|
Originally by Christoph Hellwig back in February.
It recieved no objections when posted to l-k & Jens.
o remove DEVICE_REQUEST definitions - never used in blk.h itself.
o remove DEVICE_ON() - never used at all.
o define LOCAL_END_REQUEST when we do not want end_request() instead
of other hacks.
o remove DEVICE_OFF() - only used in floppy driver, thus one now has
a private end_request().
o use private end_request() functions for drivers not providing
randomness.
o remove TIMEOUT_VALUE - only ever used in hd.c
|
|
|
|
First batch of various kdev_t related changes that have accumulated on
linux-kernel, and some that got sent directly to me after you dropped them.
Some of these need additional fixes to make them work, Some of them
even to make them compile, but this is one step forward..
I have bio-related fixes for some of these also, I'll push those seperately.
|
|
Just the usual removal of the dead global arrays and associated cruft.
(Thistime not affecting lvm, which BTW. doesn't compile currently anyway
;-).
|