Rusty Russell [Thu, 20 Jun 2002 05:42:08 +0000 (22:42 -0700)]
[PATCH] Async Futex
This patch adds a FUTEX_FD call, for opening a file descriptor
attached to a futex, which can be used with poll, select or SIGIO.
Rewritten so that closing fd unpins page, as per Linus's suggestion,
and fixed not to call poll_wait with a spinlock as per Martin Wirth's
sharp eyes.
Albert Cranford [Thu, 20 Jun 2002 05:40:05 +0000 (22:40 -0700)]
[PATCH] 2.5.23 i2c updates 4/4
i2c-elektor.c:Adding call to pcf_isa_init to i2c_pcfisa_init causes:
i2c-elektor.o: In function `i2c_pcfisa_init':
i2c-elektor.o(.text.init+0x95): undefined reference to `local symbol
i2c-elektor.c: fix by removing __exit for inline compiling.
Albert Cranford [Thu, 20 Jun 2002 05:39:52 +0000 (22:39 -0700)]
[PATCH] 2.5.23 i2c updates 3/4
i2c-algo-bit.c: Leave kernel time_before/after_eq
Remove #ifdef MODULE_LICENSE around MODULE_LICENSE.
Remove #include <linux/sched.h> since i2c.h has it now.
i2c-algo-pcf.c: Remove #include <linux/sched.h> since i2c.h has it now.
Remove #ifdef MODULE_LICENSE around MODULE_LICENSE.
Remove #include <linux/sched.h> since i2c.h has it now.
i2c/i2c-elektor.c: Leave kernel __exit pcf_isa_exit(void)
Remove #ifdef MODULE_LICENSE around MODULE_LICENSE.
i2c-elv.c: Leave kernel __exit bit_elv_exit(void)
Remove #ifdef MODULE_LICENSE around MODULE_LICENSE.
i2c-philips-par.c: Remove #ifdef MODULE_LICENSE around MODULE_LICENSE.
i2c/i2c-velleman.c: Leave kernel __exit bit_velle_exit(void)
Remove #ifdef MODULE_LICENSE around MODULE_LICENSE.
Drop i2c-algo-8xx.[ch] deltas
Drop i2c-algo-ppc405.[ch] deltas
Drop i2c-pcf-epp.c deltas
Drop i2c-ppc405.[ch] deltas
Drop i2c-ppc405adap.h deltas
Drop i2c-pport.c deltas
Drop i2c-rpx.c deltas
Albert Cranford [Thu, 20 Jun 2002 05:39:39 +0000 (22:39 -0700)]
[PATCH] 2.5.23 i2c updates 2/4
i2c-core.c:Leave LINUX_VERSION in kernel. Leave i2c_debug=1. Leave
CONFIG names as in the kernel. Remove #ifdef MODULE_LICENSE around
MODULE_LICENSE.
i2c-dev.c:Remove #ifdef MODULE_LICENSE around MODULE_LICENSE.
Remove compatibality code for < 2.4.0
i2c-proc.c: Print message on kmalloc failure. Leave ENOMEM as in kernel.
Remove #ifdef MODULE_LICENSE around MODULE_LICENSE. Remove 2.2.19 compat
code.
Stephen Rothwell [Thu, 20 Jun 2002 05:25:59 +0000 (22:25 -0700)]
[PATCH] make kstack_depth_to_print and some APM stuff static
Tridge has written a little utility
(http://samba.org/ftp/unpacked/junkcode/findstatic.pl) that (given a set of
object files) works out a list of candidate finctions and variables that
may be able to be made static. Obviously some hand checking is needed
(different configs and/or architectures etc), but it seems useful.
Here is my first patch using its outout.
kstack_depth_to_print is used in many architectures, but only in one
file in each. In some architectures it is declared and not used. It
is not even clear why kstack_depth_to_print is not a #define. Tridge
suggested that maybe you could change its value with a debugger ...
The APM code has a function and a struct that can be static.
David Mosberger [Thu, 20 Jun 2002 05:24:19 +0000 (22:24 -0700)]
[PATCH] nasty bug in free_pgtables() (for ia64)
Strictly speaking, this patch is needed only for arches which use
discontiguous virtual address bits for the PGD index.
When we originally worked on this code (~ 2 years ago or so, in
response to a bug report & patch from an Intel guy), I had myself
convinced that the code is correct, but of course I missed the fact
that:
pgd_index(first) < pgd_index(last)
does NOT imply that:
first < last
For example, with a 16KB page size on ia64, we might end up with:
Note here that first_idx < last_idx even though first > last. This is
because pgd_index() ignores bits 44..60.
I suppose we could put the extra check inside #ifdef __ia64__, but
that would be rather ugly and would really mean that Linux does not
support discontiguous PGD indices.
Neil Brown [Thu, 20 Jun 2002 05:23:32 +0000 (22:23 -0700)]
[PATCH] Make ITERATE_MDDEV work on non-SMP
For an SMP kernel, spin_lock() et.al. are functions.
For a UP kernel, they are statements that must be terminated
by a ';'. This is not quite the same thing, and hence spin_lock()
cannot be using inside a parenthesised expession.
This patch changes ITERATE_MDDEV to use gcc's "statement expressions"
instead which has the benefit of making the conditionals
more readable.
Neil Brown [Thu, 20 Jun 2002 05:23:20 +0000 (22:23 -0700)]
[PATCH] Md sync: Remove compiler warning that revealed a bug.
When we abort a resync before we even started (because we were
interrupted while waiting for a conflicting resync to finish)
we should not wait or, particularly, do the closing sync_request
(as we haven't even calculated max_sectors yet).
Pam Delaney [Thu, 20 Jun 2002 05:08:20 +0000 (22:08 -0700)]
[PATCH] Fusion driver update
This upgrades the fusion driver
- Provides support for the Ultra320 1030/1020 parts
- Provides support for the PCI-X FC parts (919X/929X)
- Provides proper support for high memory cases
- Provides IA64 support
- Adds kernels calls (pci_enable_device, pci_set_dma_mask,
scsi_set_pci_device) for proper registration of PCI devics.
- Adds New Error Handling support
Matthew Wilcox [Thu, 20 Jun 2002 05:02:14 +0000 (22:02 -0700)]
[PATCH] Convert cm206 to a tasklet
Removes CM206_BH (patch approved by maintainer).
Deletes the no-longer-used BH entries from the enum. Explicit numbers
added so as not to destroy binary compatibility needlessly.
Martin Dalecki [Thu, 20 Jun 2002 04:59:43 +0000 (21:59 -0700)]
[PATCH] IDE 93
- Revert patch number 92. It turned out to be broken behind hope. Personally I
attribute this to the recent heat wave over here and apologize for the
problems this may have caused. Turned out that my note about the change
beeing dnagerous in the last change log was more then true...
- Locking issues for ioctl handling.
- Remove waiting_for_dma bit field. Use IDE_DMA bit flag instead.
Apply this bit globally and not in the corresponding implementation
functions.
NTFS: 2.0.10 - There can only be 2^32 - 1 inodes on an NTFS volume.
- Add check at mount time to verify that the number of inodes on the
volume does not exceed 2^32 - 1, which is the maximum allowed for
NTFS according to Microsoft.
- Change mft_no member of ntfs_inode structure to be unsigned long.
Update all users. This makes ntfs_inode->mft_no just a copy of struct
inode->i_ino. But we can't just always use struct inode->i_ino and
remove mft_no because extent inodes do not have an attached struct
inode.
Ingo Molnar [Wed, 19 Jun 2002 12:44:33 +0000 (14:44 +0200)]
- this patch fixes the migration init to correctly work with the
new hot-pluggable CPU enumeration method, and the possibility
to not boot on CPU#0.
(btw., i find RR's comment offensive. How can any code be called 'crap' just
because the author of a new patch has not converted the code to the new
assumptions yet? The original code was perfectly valid.)
NTFS: 2.0.9 release. Decompression engine now uses a single buffer and other cleanups.
- Remove unused variables left over after Rusty's patch to the decompression
engine.
- Change buffer size in ntfs_readdir()/ntfs_filldir() to use
NLS_MAX_CHARSET_SIZE.
- Miscellaneous minor cleanups to comments.
Dave Kleikamp [Wed, 19 Jun 2002 04:13:56 +0000 (23:13 -0500)]
Exclusive access to JFS journal devices
Use bd_claim/bd_release to guarentee exclusive access to the external
log device. I also fixed a struct block_device leak once I touched
that code (missing bdput() both in lmLogClose and the lmLogOpen
error path) and sanitized the failure path labels.
I suppose one can argue whether that is ugly or rather nice for
documentary purposes, but make on its own cannot figure out where a file
is supposed to live, so we have to help it.
(For the targets handled by Rules.make the situation is different, there
Rules.make knows what's source and what's object and can add prefixes
as necessary, so the most of the Makefiles are actually not affected by
this kind of change)
For now, as $(obj) = $(src) = ., we only add "./", so the potential for
breakage is rather small.
Linus Torvalds [Tue, 18 Jun 2002 11:23:01 +0000 (04:23 -0700)]
Merge penguin.transmeta.com:/home/penguin/torvalds/repositories/kernel/md-merge
into penguin.transmeta.com:/home/penguin/torvalds/repositories/kernel/linux
Neil Brown [Tue, 18 Jun 2002 11:21:49 +0000 (04:21 -0700)]
[PATCH] md 22 of 22 - Generalise md sync threads
Previously each raid personality (Well, 1 and 5) started their
own thread to do resync, but md.c had a single common thread to do
reconstruct. Apart from being untidy, this means that you cannot
have two arrays reconstructing at the same time, though you can have
to array resyncing at the same time..
This patch changes the personalities so they don't start the resync,
but just leave a flag to say that it is needed.
The common thread (mdrecoveryd) now just monitors things and starts a
separate per-array thread whenever resync or recovery (or both) is
needed.
When the recovery finishes, mdrecoveryd will be woken up to re-lock
the device and activate the spares or whatever.
raid1 needs to know when resync/recovery starts and ends so it can
allocate and release resources.
It allocated when a resync request for stripe 0 is received.
Previously it deallocated for resync in it's own thread, and
deallocated for recovery when the spare is made active or inactive
(depending on success).
As raid1 doesn't own a thread anymore this needed to change. So to
match the "alloc on 0", the md_do_resync now calls sync_request one
last time asking to sync one block past the end. This is a signal to
release any resources.
Neil Brown [Tue, 18 Jun 2002 11:17:56 +0000 (04:17 -0700)]
[PATCH] md 21 of 22 - Improve handling of MD super blocks
1/ don't free the rdev->sb on an error -- it might be
accessed again later. Just wait for the device to be
exported.
2/ Change md_update_sb to __md_update_sb and have it
clear the sb_dirty flag.
New md_update_sb locks the device and calls __md_update_sb
if sb_dirty. This avoids any possbile races around
updating the superblock
Neil Brown [Tue, 18 Jun 2002 11:17:48 +0000 (04:17 -0700)]
[PATCH] md 20 of 22 - Provide SMP safe locking for all_mddevs list.
Provide SMP safe locking for all_mddevs list.
the all_mddevs_lock is added to protect all_mddevs and mddev_map.
ITERATE_MDDEV is moved to md.c (it isn't needed elsewhere) and enhanced
to take the lock appropriately and always have a refcount on the object
that is given to the body of the loop.
mddev_find is changed so that the structure is allocated outside a lock,
but test-and-set is done inside the lock.
Neil Brown [Tue, 18 Jun 2002 11:17:40 +0000 (04:17 -0700)]
[PATCH] md 19 of 22 - Improve serialisation of md syncing
If two md arrays which share real devices (i.e they each own a partition
on some device) need to sync/reconstruct at the same time, it is much
more efficient to have one wait while the other completes.
The current code uses interruptible_sleep_on which isn't SMP safe (without the BKL).
This patch re-does this code to make it more secure. Even it two start simultaneously,
one will reliably get priority, and the other wont wait for ever.
Neil Brown [Tue, 18 Jun 2002 11:17:26 +0000 (04:17 -0700)]
[PATCH] md 17 of 22 - Strengthen the locking of mddev.
Strengthen the locking of mddev.
mddev is only ever locked in md.c, so we move {,un}lock_mddev
out of the header and into md.c, and rename to mddev_{,un}lock
for consistancy with mddev_{get,put,find}.
When building arrays (typically at boot time) we now lock, and unlock
as it is the "right" thing to do. The lock should never fail.
When generating /proc/mdstat, we lock each array before inspecting it.
In md_ioctl, we lock the mddev early and unlock at the end, rather than
locking in two different places.
In md_open we make sure we can get a lock before completing the open. This
ensures that we sync with do_md_stop properly.
In md_do_recovery, we lock each mddev before checking it's status.
md_do_recovery must unlock while recovery happens, and a do_md_stop at this
point will deadlock when md_do_recovery tries to regain the lock. This will be
fixed in a later patch.
Neil Brown [Tue, 18 Jun 2002 11:17:12 +0000 (04:17 -0700)]
[PATCH] md 15 of 22 - Get rid of kdev_to_mddev
Only two users of kdev_to_mddev remain, md_release and
md_queue_proc.
For md_release we can store the mddev in the md_inode
at md_open time so we can find it easily.
For md_queue_proc, we use mddev_find because we only have the
device number to work with. Hopefully the ->queue function
will get more arguements one day...
Neil Brown [Tue, 18 Jun 2002 11:17:05 +0000 (04:17 -0700)]
[PATCH] md 14 of 22 - Second step to tidying mddev refcounts and locking
This patch gets md_open to use mddev_find instead of kdev_to_mddev, thus
creating the mddev if necessary.
This guarantees that md_release will be able to find an mddev to
mddev_put.
Now that we are certain of getting the refcount right at open/close time,
we don't need the "countdev" stuff. If START_ARRAY happens to start and
array other than that the one that is currently opened, it won't confuse
things at all.
Neil Brown [Tue, 18 Jun 2002 11:16:59 +0000 (04:16 -0700)]
[PATCH] md 13 of 22 - First step to tidying mddev recounting and locking.
First step to tidying mddev recounting and locking.
This patches introduces
mddev_get which incs the refcount on an mddev
mddev_put which decs it and, if it becomes unused, frees it
mddev_find which finds or allocated an mddev for a given minor
This is mostly the old alloc_mddev
free_mddev no longer actually frees it. It just disconnects all drives
so that mddev_put will do the free.
Now the test for "does an mddev exist" is not "mddev != NULL"
but involves checking if the mddev has disks or a superblock
attached.
This makes the semantics of do_md_stop a bit cleaner. Previously
if do_md_stop succeed for a real stop (not a read-only stop) then
you didn't have to unlock the mddev, otherwise you did. Now
you always unlock the mddev after do_md_stop.
Neil Brown [Tue, 18 Jun 2002 11:16:49 +0000 (04:16 -0700)]
[PATCH] md 12 of 22 - Remove "data" from dev_mapping and tidy up
The mapping from minor number to mddev structure allows for a
'data' that is never used. This patch removes that and explicitly
inlines some inline functions that become trivial.
mddev_map also becomes completely local to md.c
Neil Brown [Tue, 18 Jun 2002 11:16:28 +0000 (04:16 -0700)]
[PATCH] md 10 of 22 - Remove nb_dev from mddev_s
The nb_dev field is not needed.
Most uses are the test if it is zero or not, and they can be replaced
by tests on the emptiness of the disks list.
Other uses are for iterating through devices in numerical order and
it makes the code clearer (IMO) to unroll the devices into an array first
(which has to be done at some stage anyway) and then walk that array.
Neil Brown [Tue, 18 Jun 2002 11:16:14 +0000 (04:16 -0700)]
[PATCH] md 8 of 22 - Discard md_make_request in favour of per-personality make_request functions.
As we now have per-device queues, we don't need a common make_request
function that dispatches, we can dispatch directly.
Each *_make_request function is changed to take a request_queue_t
from which it extract the mddev that it needs, and to deduce the
"rw" flag directly from the bio.
Neil Brown [Tue, 18 Jun 2002 11:15:33 +0000 (04:15 -0700)]
[PATCH] md 2 of 22 - Make device plugging work for md/raid5
We embed a request_queue_t in the mddev structure and so
have a separate one for each mddev.
This is used for plugging (in raid5).
Given this embeded request_queue_t, md_make_request no-longer
needs to make from device number to mddev, but can map from
the queue to the mddev instead.
Neil Brown [Tue, 18 Jun 2002 10:38:57 +0000 (03:38 -0700)]
[PATCH] Umem 2 of 2 - Make device plugging work for umem
We embed a request_queue_t in the card structure and so have a separate
one for each card. This is used for plugging.
Given this embeded request_queue_t, mm_make_request no-longer needs to
make from device number to mddev, but can map from the queue to the card
instead.