NeilBrown [Fri, 6 Jan 2006 08:20:13 +0000 (00:20 -0800)]
[PATCH] md: improve raid10 "IO Barrier" concept
raid10 needs to put up a barrier to new requests while it does resync or other
background recovery. The code for this is currently open-coded, slighty
obscure by its use of two waitqueues, and not documented.
This patch gathers all the related code into 4 functions, and includes a
comment which (hopefully) explains what is happening.
Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
NeilBrown [Fri, 6 Jan 2006 08:20:12 +0000 (00:20 -0800)]
[PATCH] md: improve raid1 "IO Barrier" concept
raid1 needs to put up a barrier to new requests while it does resync or other
background recovery. The code for this is currently open-coded, slighty
obscure by its use of two waitqueues, and not documented.
This patch gathers all the related code into 4 functions, and includes a
comment which (hopefully) explains what is happening.
Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Darrick J. Wong [Fri, 6 Jan 2006 08:20:11 +0000 (00:20 -0800)]
[PATCH] make dm-mirror not issue invalid resync requests
I've been attempting to set up a (Host)RAID mirror with dm_mirror on
2.6.14.3, and I've been having a strange little problem. The configuration
in question is a set of 9GB SCSI disks that have 17942584 sectors. I set
up the dm_mirror table as such:
If I'm not mistaken, this sets up a 9GB RAID1 mriror with 1MB stripes
across both SCSI disks. The sector count of the dm device is less than the
size of the disks, so we shouldn't fall off the end. However, I always get
the messages like this in dmesg when I set up the dm table:
attempt to access beyond end of device
sdd: rw=0, want=17958656, limit=17942584
Clearly, something is trying to read sectors past the end of the drive. I
traced it down to the __rh_recovery_prepare function in dm-raid1.c, which
gets called when we're putting the mirror set together. This function
calls the dirty region log's get_resync_work function to see if there's any
resync that needs to be done, and queues up any areas that are out of sync.
The log's get_resync_work function is actually a pointer to the
core_get_resync_work function in dm-log.c.
The core_get_resync_work function queries a bitset lc->sync_bits to find
out if there are any regions that are out of date (i.e. the bit is 0),
which is where the problem occurs. If every bit in lc->sync_bits is 1
(which is the case when we've just configured a new RAID1 with the nosync
option), the find_next_zero_bit does NOT return the size parameter
(lc->region_count in this case), it returns the size parameter rounded up
to the nearest multiple of 32! I don't know if this is intentional, but
i386 and x86_64 both exhibit this behavior.
In any case, the statement "if (*region == lc->region_count)" looks like
it's supposed to catch the case where are no regions to resync and
return 0. Since find_next_zero_bit apparently has a habit of returning
a value that's larger than lc->region_count, the enclosed patch changes
the equality test to a greater-than test so that we don't try to resync
areas outside of the RAID1 region. Seeing as the HostRAID metadata
lives just past the end of the RAID1 data, mucking around in that area
is not a good idea.
I suppose another way to fix this would be to amend find_next_zero_bit so
that it doesn't return values larger than "size", but I don't know if
there's a reason for the current behavior.
Signed-Off-By: Darrick J. Wong <djwong@us.ibm.com> Acked-by: Alasdair G Kergon <agk@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Neil Brown [Fri, 6 Jan 2006 08:19:59 +0000 (00:19 -0800)]
[PATCH] knfsd: reduce stack consumption
A typical nfsd call trace is
nfsd -> svc_process -> nfsd_dispatch -> nfsd3_proc_write ->
nfsd_write ->nfsd_vfs_write -> vfs_writev
These add up to over 300 bytes on the stack.
Looking at each of these, I see that nfsd_write (which includes
nfsd_vfs_write) contributes 0x8c to stack usage itself!!
It turns out this is because it puts a 'struct iattr' on the stack so
it can kill suid if needed. The following patch saves about 50 bytes
off the stack in this call path.
Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
David Shaw [Fri, 6 Jan 2006 08:19:58 +0000 (00:19 -0800)]
[PATCH] knfsd: check error status from vfs_getattr and i_op->fsync
Both vfs_getattr and i_op->fsync return error statuses which nfsd was
largely ignoring. This as noticed when exporting directories using fuse.
This patch cleans up most of the offences, which involves moving the call
to vfs_getattr out of the xdr encoding routines (where it is too late to
report an error) into the main NFS procedure handling routines.
There is still a called to vfs_gettattr (related to the ACL code) where the
status is ignored, and called to nfsd_sync_dir don't check return status
either.
Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Olaf Kirch [Fri, 6 Jan 2006 08:19:56 +0000 (00:19 -0800)]
[PATCH] Keep nfsd from exiting when seeing recv() errors
I submitted this one previously - svc_tcp_recvfrom currently returns
any errors to the caller, including ECONNRESET and the like.
This is something svc_recv isn't able to deal with:
len = svsk->sk_recvfrom(rqstp);
[...]
if (len == 0 || len == -EAGAIN) {
[...]
return -EAGAIN;
}
[...]
return len;
The nfsd main loop will exit when it sees an error code other than
EAGAIN.
The following patch fixes this problem
svc_recv is not equipped to deal with error codes other than EAGAIN,
and will propagate anything else (such as ECONNRESET) up to nfsd,
causing it to exit.
Signed-off-by: Olaf Kirch <okir@suse.de> Cc: Trond Myklebust <trond.myklebust@fys.uio.no> Cc: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jan Kara [Fri, 6 Jan 2006 08:19:55 +0000 (00:19 -0800)]
[PATCH] jbd: split checkpoint lists
Split the checkpoint list of the transaction into two lists. In the first
list we keep the buffers that need to be submitted for IO. In the second
list are kept buffers that were already submitted and we just have to wait
for the IO to complete. This should simplify a handling of checkpoint
lists a bit and can eventually be also a performance gain.
Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[PATCH] fix remaining list_for_each_safe_rcu in -mm (take 2)
I missed a use of list_for_each_rcu_safe() in -mm tree. Here is an updated
patch to fix it. This time tested on a machine that actually uses IPMI...
(Thanks to Serge Hallyn for spotting this.)
Signed-off-by: "Paul E. McKenney" <paulmck@us.ibm.com> Cc: Corey Minyard <minyard@acm.org> Cc: Matt Domsch <Matt_Domsch@dell.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Marko Kohtala [Fri, 6 Jan 2006 08:19:44 +0000 (00:19 -0800)]
[PATCH] parport: phase fixes
Did not move the parport interface properly into IEEE1284_PH_REV_IDLE phase at
end of data due to comparing bytes with nibbles. Internal phase
IEEE1284_PH_HBUSY_DNA became unused, so remove it.
Signed-off-by: Marko Kohtala <marko.kohtala@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Marko Kohtala [Fri, 6 Jan 2006 08:19:43 +0000 (00:19 -0800)]
[PATCH] parport: buffer overflow fix
Fix potential buffer overflow in case the device ID did not end in semicolon.
Also might fail to negotiate back to IEEE1284_MODE_COMPAT in case of failure.
parport_device_id did not return what Documentation/parport-lowlevel.txt said,
so I changed it to match it.
Determining device ID length is overly complicated, but Tim Waugh recalled on
linux-parport seeing some buggy device that might need it.
Signed-off-by: Marko Kohtala <marko.kohtala@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Miklos Szeredi [Fri, 6 Jan 2006 08:19:43 +0000 (00:19 -0800)]
[PATCH] fuse: check file type in lookup
Previously invalid types were quietly changed to regular files, but at
revalidation the inode was changed to bad. This was rather inconsistent
behavior.
Now check if the type is valid on initial lookup, and return -EIO if not.
Miklos Szeredi [Fri, 6 Jan 2006 08:19:42 +0000 (00:19 -0800)]
[PATCH] fuse: ensure progress in read and write
In direct_io mode, send at least one page per reqest. Previously it was
possible that reqests with zero data were sent, and hence the read/write
didn't make any progress, resulting in an infinite (though interruptible)
loop.
Miklos Szeredi [Fri, 6 Jan 2006 08:19:41 +0000 (00:19 -0800)]
[PATCH] fuse: make maximum write data configurable
Make the maximum size of write data configurable by the filesystem. The
previous fixed 4096 limit only worked on architectures where the page size is
less or equal to this. This change make writing work on other architectures
too, and also lets the filesystem receive bigger write requests in direct_io
mode.
Normal writes which go through the page cache are still limited to a page
sized chunk per request.
Miklos Szeredi [Fri, 6 Jan 2006 08:19:38 +0000 (00:19 -0800)]
[PATCH] fuse: support caching negative dentries
Add support for caching negative dentries.
Up till now, ->d_revalidate() always forced a new lookup on these. Now let
the lookup method return a zero node ID (not used for anything else) meaning a
negative entry, but with a positive cache timeout. The old way of signaling
negative entry (replying ENOENT) still works.
Userspace should check the ABI minor version to see whether sending a zero ID
is allowed by the kernel or not.
Miklos Szeredi [Fri, 6 Jan 2006 08:19:37 +0000 (00:19 -0800)]
[PATCH] fuse: add frsize to statfs reply
Add 'frsize' member to the statfs reply.
I'm not sure if sending f_fsid will ever be needed, but just in case leave
some space at the end of the structure, so less compatibility mess would be
required.
Markus Lidel [Fri, 6 Jan 2006 08:19:29 +0000 (00:19 -0800)]
[PATCH] I2O: changed I2O API to create I2O messages in kernel memory
Changed the I2O API to create I2O messages first in kernel memory and then
transfer it at once over the PCI bus instead of sending each quad-word over
the PCI bus.
Signed-off-by: Markus Lidel <Markus.Lidel@shadowconnect.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Sanitize some s390 Kconfig options. We have ARCH_S390, ARCH_S390X,
ARCH_S390_31, 64BIT, S390_SUPPORT and COMPAT. Replace these 6 options by
S390, 64BIT and COMPAT.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
When the sclp_cpi module is loaded on a system which does not support the
required SCLP call (e.g. on z/VM), ENOSUPP is returned to user space. The
correct return value is EOPNOTSUPP.
Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Cornelia Huck [Fri, 6 Jan 2006 08:19:25 +0000 (00:19 -0800)]
[PATCH] s390: multiple subchannel sets support
Add support for multiple subchannel sets. Works with arbitrary devices in
subchannel set 1 and is transparent to device drivers. Although currently
only two subchannel sets are available, this will work with the architectured
maximum number of subchannel sets as well.
Signed-off-by: Cornelia Huck <cohuck@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Cornelia Huck [Fri, 6 Jan 2006 08:19:22 +0000 (00:19 -0800)]
[PATCH] s390: introduce for_each_subchannel
for_each_subchannel() is an iterator calling a function for every possible
subchannel id until non-zero is returned. Convert the current iterating
functions to it.
Signed-off-by: Cornelia Huck <cohuck@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Cornelia Huck [Fri, 6 Jan 2006 08:19:21 +0000 (00:19 -0800)]
[PATCH] s390: introduce struct subchannel_id
This patch introduces a struct subchannel_id containing the subchannel number
(formerly referred to as "irq") and switches code formerly relying on the
subchannel number over to it.
While we're touching inline assemblies anyway, make sure they have correct
memory constraints.
Signed-off-by: Cornelia Huck <cohuck@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Frank Pavlic [Fri, 6 Jan 2006 08:19:20 +0000 (00:19 -0800)]
[PATCH] s390: qdio V=V pass-through
New feature V=V qdio pass-through.
QDIO and HiperSockets processing in z/VM V=V guest environments (as well as
V=R with z/VM running in LPAR mode) requires shadowing of all QDIO
architecture queue elements. Especially the shadowing of SBALs and SLSBs
structures in the hypervisor, and the need to issue SIGA SYNC operations to
observe state changes, eventually causes significant CPU processing overhead
in the hypervisor.
The QDIO pass-through support for V=V guests avoids the shadowing of SBALs and
SLSBs. This significantly reduces the hypervisor overhead for QDIO based I/O.
Signed-off-by: Frank Pavlic <pavlic@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jan Glauber [Fri, 6 Jan 2006 08:19:17 +0000 (00:19 -0800)]
[PATCH] s390: in-kernel crypto rename
Replace all references to z990 by s390 in the in-kernel crypto files in
arch/s390/crypto. The code is not specific to a particular machine (z990) but
to the s390 platform. Big diff, does nothing..
Signed-off-by: Jan Glauber <jan.glauber@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Horst Hummel [Fri, 6 Jan 2006 08:19:15 +0000 (00:19 -0800)]
[PATCH] s390: dasd failfast support
To properly support multipath-failover handling, the linux block layer has
introduced a special request flag, 'REQ_FAILFAST'. This flag is now used to
return requests immediately in case the device is not operational.
Signed-off-by: Horst Hummel <horst.hummel@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Horst Hummel [Fri, 6 Jan 2006 08:19:14 +0000 (00:19 -0800)]
[PATCH] s390: BIODASDPRRD ioctl return code
The IOCTL BIODASDPRRD had no return code for 'profiling is inactive' and
therefore tunedasd wrote misleading message for request-counter = 0.
Introduce return-code EIO for inactive profiling.
Signed-off-by: Horst Hummel <horst.hummel@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Cornelia Huck [Fri, 6 Jan 2006 08:19:13 +0000 (00:19 -0800)]
[PATCH] s390: re-activated path detection
If we receive path not operational indications (pnom in pmcw nonzero), we
switch off those paths. To catch them becoming available again, we have to
recalculate the lpm from the pmcw each time we start path verification.
Signed-off-by: Cornelia Huck <cohuck@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
There are some more places where the use of cputime_t instead of an integer
type and the associated macros is necessary for the virtual cputime accounting
on s390. Affected are the s390 specific appldata code and BSD process
accounting.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Fix the broken atomic_cmpxchg primitive. Add atomic_sub_and_test,
atomic64_sub_return, atomic64_sub_and_test, atomic64_cmpxchg,
atomic64_add_unless and atomic64_inc_not_zero. Replace old style
atomic_compare_and_swap by atomic_cmpxchg. Shorten the whole header by
defining most primitives with the two inline functions atomic_add_return and
atomic_sub_return.
In addition this patch contains the s390 related fixes of Hugh's "mm: fill
arch atomic64 gaps" patch.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Hugh Dickins <hugh@veritas.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jeff Dike [Fri, 6 Jan 2006 08:19:06 +0000 (00:19 -0800)]
[PATCH] uml: free network IRQ correctly
Free the network IRQ when closing down the network devices at shutdown.
Delete the device from the opened devices list on close.
These prevent an -EBADF when later disabling SIGIO on all extant descriptors
and a complaint from free_irq about freeing the IRQ twice.
Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jeff Dike [Fri, 6 Jan 2006 08:19:05 +0000 (00:19 -0800)]
[PATCH] uml: fix whitespace in mconsole driver
Fix up some bogus spacing in the mconsole driver. Also delete the
emacs formatting comment at the end.
Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jeff Dike [Fri, 6 Jan 2006 08:19:05 +0000 (00:19 -0800)]
[PATCH] uml: capture printk output for mconsole sysrq
Pass sysrq output back to the mconsole client using the mechanism
introduced for stack output.
Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jeff Dike [Fri, 6 Jan 2006 08:19:04 +0000 (00:19 -0800)]
[PATCH] uml: capture printk output for mconsole stack
The stack command now sends the printk output back to the mconsole client.
This is done by registering a special console for the mconsole driver. This
receives all printk output. Normally, it is ignored, but when a stack command
is issued, any printk output will be sent back to the client.
This will capture any printk output, whether it is stack output or not, since
we can't tell the difference.
Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jeff Dike [Fri, 6 Jan 2006 08:19:03 +0000 (00:19 -0800)]
[PATCH] uml: add mconsole_reply variant with length param
This is needed for the console output patch, since we have a possibly
non-NULL-terminated string there. So, the new interface takes a string and a
length, and the old interface calls strlen on its string and calls the new
interface with the length.
There's also a bit of whitespace cleanup.
Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jeff Dike [Fri, 6 Jan 2006 08:19:02 +0000 (00:19 -0800)]
[PATCH] uml: better diagnostics for broken configs
Produce a compile-time error if both MODE_SKAS and MODE_TT are disabled.
Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jeff Dike [Fri, 6 Jan 2006 08:19:01 +0000 (00:19 -0800)]
[PATCH] uml: SIGWINCH handling cleanup
Code cleanup - unregister_winch and winch_cleanup had some duplicate code.
This is now abstracted out into free_winch.
Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jeff Dike [Fri, 6 Jan 2006 08:19:01 +0000 (00:19 -0800)]
[PATCH] uml: umid cleanup
This patch cleans up the umid code:
- The only_if_set argument to get_umid is gone.
- get_umid returns an empty string rather than NULL if there is no umid.
- umid_is_random is gone since its users went away.
- Some printfs were turned into printks because the code runs late enough
that printk is working.
- Error paths were cleaned up.
- Some functions now return an error and let the caller print the error
message rather than printing it themselves. This eliminates the practice of
passing a pointer to printf or printk in, depending on where in the boot
process we are.
- Major tidying of not_dead_yet - mostly error path cleanup, plus a comment
explaining why it doesn't react to errors the way you might expect.
- Calls to os_* interfaces that were moved under os are changed back to
their native libc forms.
- snprintf, strlcpy, and their bounds-checking friends are used more often,
replacing by-hand bounds checking in some places.
Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jeff Dike [Fri, 6 Jan 2006 08:18:59 +0000 (00:18 -0800)]
[PATCH] uml: separate libc-dependent umid code
I reworked Gennady's umid OS abstraction patch because the code shouldn't
be moved entirely to os. As it turns out, I moved most of it anyway. This
patch is the minimal one needed to move the code and have it work.
It turns out that the concept of the umid is OS-independent, but
almost everything else about the implementation is OS-dependent.
This is code movement without cleanup - a follow-on patch tidies
everything up without shuffling code around.
Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jeff Dike [Fri, 6 Jan 2006 08:18:58 +0000 (00:18 -0800)]
[PATCH] uml: Add throttling to console driver
This patch adds support for throttling and unthrottling input when the tty
driver can't handle it.
Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jeff Dike [Fri, 6 Jan 2006 08:18:58 +0000 (00:18 -0800)]
[PATCH] uml: Fix flip_buf full handling
When the tty flip_buf is full, it's a good idea to delay the input processing
for a jiffy, rather than just scheduling the tasklet immediately.
Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jeff Dike [Fri, 6 Jan 2006 08:18:57 +0000 (00:18 -0800)]
[PATCH] uml: Simplify console opening/closing and irq registration
This patch simplifies the opening and closing of host console devices and the
registration and deregistration of IRQs. The intent is to make it obvious
that an IRQ can't exist without an open file descriptor.
chan_enable will now open the channel, and when both opening and IRQ
registration are desired, this should be used. Opening only is done for the
initial console, so that interface still needs to exist.
The free_irqs_later interface is now gone. It was intended to avoid freeing
an IRQ while it was being processed. It did this, but it didn't eliminate the
possiblity of free_irq being called from an interrupt, which is bad. In its
place is a list of irqs to be freed, which is processed by the signal handler
just before exiting. close_one_chan now disables irqs.
When a host device disappears, it is just closed, and that disables IRQs.
The device id registered with the IRQ is now the chan structure, not the tty.
This is because the interrupt arrives on a descriptor associated with the
channel. This caused equivalent changes in the arguments to line_timer_cb.
line_disable is gone since it is not used any more.
The count field in the line structure is gone. tty->count is used instead.
The complicated logic in sigio_handler with freeing IRQs when necessary and
making sure its idea of the next irq is correct is now much simpler. The irq
list can't be rearranged underneath it, so it is now a simple list walk.
Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jeff Dike [Fri, 6 Jan 2006 08:18:55 +0000 (00:18 -0800)]
[PATCH] uml: move console configuration
This patch changes when console devices are configured in order to prepare the
ground for the next patch.
parse_chan_pair is now done earlier, when initcalls are run, rather than when
the device is opened.
When a host device disappears, the channel list is closed, but not freed.
This is required by the previous change. line_config now takes the options
structure as an argument, and line_open doesn't.
Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jeff Dike [Fri, 6 Jan 2006 08:18:54 +0000 (00:18 -0800)]
[PATCH] uml: line_setup interface change
line_setup is changed to return the device which it set up, rather than just
success or failure. This will be important in the line-config patch.
Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jeff Dike [Fri, 6 Jan 2006 08:18:54 +0000 (00:18 -0800)]
[PATCH] uml: Add static initializations and declarations
Some structure fields were being dynamically initialized when they could be
initialized at compile-time instead. This also makes some declarations static
(in the C sense).
Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jeff Dike [Fri, 6 Jan 2006 08:18:53 +0000 (00:18 -0800)]
[PATCH] uml: Move mconsole support out of generic code
A bit of restructuring which eliminates the all_allowed argument (which is
mconsole-specific) to line_setup. That logic is moved to the mconsole
callback.
Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jeff Dike [Fri, 6 Jan 2006 08:18:52 +0000 (00:18 -0800)]
[PATCH] uml: Remove unneeded structure field
This removes a structure field which turned out to be pointless, and
references to it.
Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jeff Dike [Fri, 6 Jan 2006 08:18:51 +0000 (00:18 -0800)]
[PATCH] uml: use ARRAY_SIZE
This patch replaces instances of "sizeof(foo)/sizeof(foo[0])" with
ARRAY_SIZE(foo), which expands to the same thing.
Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jeff Dike [Fri, 6 Jan 2006 08:18:50 +0000 (00:18 -0800)]
[PATCH] uml: Formatting changes
This patch makes a bunch of non-functional changes -
return(foo); becomes return foo;
some statements are broken across lines for readability
some trailing whitespace is cleaned up
open_one_chan took four arguments, three of which could be
deduced from the first. Accordingly, they were eliminated.
some examples of "} else {" had a newline added
some whitespace cleanup in the indentation
lines_init got some control flow cleanup
some long lines were broken
removed another emacs-specific C formatting comment
Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jeff Dike [Fri, 6 Jan 2006 08:18:49 +0000 (00:18 -0800)]
[PATCH] uml: non-void functions should return something
There are a few functions which are declared to return something, but don't.
These are actually infinite loops which are forced to be declared as non-void.
This makes them all return 0.
Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jeff Dike [Fri, 6 Jan 2006 08:18:48 +0000 (00:18 -0800)]
[PATCH] uml: use kstrdup
There were a bunch of calls to uml_strdup dating from before kstrdup was
introduced. This changes those calls. It doesn't eliminate the definition
since there is still a couple of calls in userspace code (which should
probably call the libc strdup).
Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>