Andi Kleen [Fri, 11 Oct 2002 13:07:19 +0000 (06:07 -0700)]
[PATCH] Efficient bswab64 for i386
Due to some bugs in byteorder/generic.h linux would always use C handcoded
swab64 for 64bit ntohq or cpu_to_be64. The C version is very inefficient
and expands to 30+ instructions of horrible code.
This hurts on filesystems that use on disk big endian data structures
with 64bit data types.
This patch adds an assembly optimized swab64 to fix it. Now bswab64 is
4 instructions when your CPU supports bswap and 9 when it doesn't.
Tests were done with gcc 3.2, may be different on older gcc.
This is good for ~600 bytes code size reduction in XFS (gcc 3.2):
Before:
503199 3296 1682 508177 7c111 fs/xfs/xfs.o
After:
502543 3296 1682 507521 7be81 fs/xfs/xfs.o
Jan Harkes [Fri, 11 Oct 2002 13:04:51 +0000 (06:04 -0700)]
[PATCH] Coda FS update
Most of these changes have been tested and used in the 2.4 tree, so this
is mostly a forward port of 2.4 bugfixes.
* C99 initializers
* Added specific initializations instead of assuming that the private
part of the inode is already initialized.
* Remove unused code.
* Moved container file to the struct file private data, this is to
* correct the session semantics model when file updates are fetched from
* the server (old 'sessions' shouldn't see the new container yet).
* Fixed consistency (and occasional oopes) when mmap-ing Coda files.
* Fixing up inode numbers in readdir, old libc5 getcwd was broken.
* Nuked upcall_stats, all of this can easily be maintained in userspace,
and the existing code suffers from overflows in the fixed point
calculations.
Peter Chubb [Fri, 11 Oct 2002 12:59:50 +0000 (05:59 -0700)]
[PATCH] fix crash in yenta_bh() on card insertion/removal
In the current kernels, when a PCMCIA card is inserted into or
removed from a socket, the kernel oopses because yenta_bh() tries to
dereference a NULL pointer.
The attached patch initialises the argument to yenta_bh() so that this
doesn't happen.
Neil Brown [Fri, 11 Oct 2002 12:40:10 +0000 (05:40 -0700)]
[PATCH] kNFSd: Provide generic code for making an upcall.
This code enhances 'cache_check' to try to initiate
an up-call if the cache entry is not up-to-date, and also
defines add_word and add_hex for formating up-call
requests. See rpc-cache.txt for more detail.
Neil Brown [Fri, 11 Oct 2002 12:40:05 +0000 (05:40 -0700)]
[PATCH] kNFSd: Create files: /proc/net/rpc/$CACHENAME/channel for communicating cache updates with kernel
Each cache gets it's own 'channel' at
/proc/net/rpc/$CACHENAME/channel
Reads from the file will return all pending requests, one at a time.
select will block when at end of file.
writes will pass full lines in to be processed.
Neil Brown [Fri, 11 Oct 2002 12:39:55 +0000 (05:39 -0700)]
[PATCH] kNFSd: decode symlink inplace to avoid modifying request
Rather than possibly modifying a request (as
xdr_decode_string can) we use xdr_decode_string_inplace
to symlink contents. This string may not be nul terminated
(though it often is) so in the 'unlikely' event that is isn't
nul terminated, we copy it into a kmalloced space first.
It might be nice if vfs_symlink took a length, but then every
filesystem would have to as well....
Neil Brown [Fri, 11 Oct 2002 12:39:50 +0000 (05:39 -0700)]
[PATCH] kNFSd: Don't over-write rpc request with response.
We are going to want rpc request to be immutable so that
we can take a copy and put it aside to be processed later.
Currently the tcp code writes the response into the same
buffer as the request, thus corrupting the request.
With this patch, the response goes after the request. There should
always be enough room as large reqeusts (Write) has small
responses, and large responses (read) are for small requests.
buflen is changed for requests to record the length of the
request. It already gets reset for each new request.
Neil Brown [Fri, 11 Oct 2002 12:39:30 +0000 (05:39 -0700)]
[PATCH] kNFSd: Move auth domain lookup into svcauth
Instead of doing the lookup from ipaddr to domain inside
the nfs server, (and also when lockd calls into nfsd) it is
now done at the rpc authentication level which is a more
sensible place for it.
Note that both AUTH_UNIX and AUTH_NULL do the same lookup.
So that the rpc layer knows that nfsd and lockd both uses the
name space of domains (while other hypothetical services may
not) we introduce a 'class' for each service which svc_auth combines
with the IP address when doing a lookup.
Neil Brown [Fri, 11 Oct 2002 12:39:25 +0000 (05:39 -0700)]
[PATCH] kNFSd: Use new cache infrastructure for auth_unix specific lookups.
This patch introduces two caches using the new infrastucture, and the
concept of a 'domain'.
A 'domain' refers to a collection of clients that all have the same
view of the nfs server, and all have the same access rights (modulo
different users on the clients). For AUTH_UNIX (and AUTH_NULL), the
domain is determined from the IP address. For other authentication
styles, the domain might be determined directly from the credentials.
Each auth flavour knows how to allocate and free it's domain-specific
infomation.
auth_domain_cache maps a name to a domain which is owned by
an auth flavour.
ip_map_cache is a cache specific to AUTH_UNIX which maps
IP address to domain.
With this patch, svcauth_unix.c is created to store all
auth_unix related code.
The IP address lookup code is removed from nfsd/exports.c
sunrpc module initilisation is moved out of stats.c into sunrpc_syms
which seemed to be the most central .c file. It now registers these
two caches.
Now that the caches are being used, nfsd needs to call cache_clean
periodically.
Neil Brown [Fri, 11 Oct 2002 12:39:19 +0000 (05:39 -0700)]
[PATCH] kNFSd: Initialial caching infrastructure for RPC authentication caches
This patch provides a "virtual class" for defining caches
that make user-space information available in the kernel
It is intended for RPC services or clients that need user-space
support for authentication.
As yet, support for userspace interaction isn't included as I want
that to be able to have separate review.
Neil Brown [Fri, 11 Oct 2002 12:34:43 +0000 (05:34 -0700)]
[PATCH] kNFSd: Giant patch importing NFSv4 server functionality
Now that all the hooks are in place, this large patch imports all
of the new code for the NFSv4 server.
This patch makes almost no changes to the existing nfsd codebase
(these have been taken care of by the preceding patches).
One aspect of the NFSv4 code deserves comment. The most natural scheme
for processing a COMPOUND request would seem to be:
1a. XDR decode phase, decode args of all operations
2a. processing phase, process all operations
3a. XDR encode phase, encode results of all operations
However, we use a scheme which works as follows:
1b. XDR decode phase, decode args of all operations
2b. For each operation,
process the operation
encode the result
To see what is wrong with the first scheme, consider a COMPOUND
of the form READ REMOVE. Since the last bit of processing for
the READ request occurs in XDR encode, we might discover in step
3a that the READ request should return an error. Therefore, the
REMOVE request should not be processed at all. This is a fatal
problem, since the REMOVE was already been done in step 2a!
Another type of problem would occur in a COMPOUND of the form
READ WRITE. Assume that both operations succeed. Under scheme
(a), the WRITE is actually performed _before_ the READ (since
the "real" READ is really done during XDR encode). This is
certainly incorrect if the READ and WRITE ranges overlap.
These examples might seem a little artificial, but nevertheless
it does seem that in order to process a COMPOUND correctly in
all cases, we need to use scheme (b) instead of scheme (a).
(To construct less artificial examples, just substitute GETATTR
for READ in the examples above. This works because the "real"
GETATTR is done during XDR encode: one would really have to
bend over backwards in order to arrange things otherwise.)
Neil Brown [Fri, 11 Oct 2002 12:34:38 +0000 (05:34 -0700)]
[PATCH] kNFSd: Stub support for name lookup
NFSv4 need to be able to make from user/group name
to user/group id. This include file contains some
simple stubs to do this. They will be replaced with
something that really works later.
Neil Brown [Fri, 11 Oct 2002 12:34:33 +0000 (05:34 -0700)]
[PATCH] kNFSd: ensure XDR buffer is large enough for NFSv4
This patch changes the 'xdrsize' parameter to svc_create(), to be
NFS4_SVC_XDRSIZE if v4 is defined
else NFS3_SVC_XDRSIZE if v3 is defined
else NFS2_SVC_XDRSIZE (formerly NFSSVC_XDRSIZE)
This always works, since
NFS4_SVC_XDRSIZE >= NFS3_SVC_XDRSIZE >= NFS2_SVC_XDRSIZE.
The value of NFSD_BUFSIZE has also been moved to const.h, since we need
the definition available in nfs4proc.c
Neil Brown [Fri, 11 Oct 2002 12:34:28 +0000 (05:34 -0700)]
[PATCH] kNFSd: New routine exp_pseudoroot() to find 'root' filehandle for nfsv4
NFSv4 has a concept of a 'root' filehandle (from which all other can
be found via LOOKUP, so no need for mountd).
This patch defines exp_pseudoroot(), which is used to set the filehandle
for the root of the pseudofs. The root is defined to be the export
point with fsid == 0.
Neil Brown [Fri, 11 Oct 2002 12:34:23 +0000 (05:34 -0700)]
[PATCH] kNFSd: new routine fh_dup2()
Define fh_dup2(), which copies a _verified_ filehandle, taking care
of refcounts accordingly. (This will be used by RESTOREFH/SAVEFH and
a few other places.)
Neil Brown [Fri, 11 Oct 2002 12:30:54 +0000 (05:30 -0700)]
[PATCH] kNFSd: pre-zero response for lockd _msg requests.
All the lockd *_msg requests are implemented by
calling the equivalent non- *_msg request and sending off
the response as a new message (*_res).
For the non- *_msg requests, the response buffer is
pre-zeroed by the RPC layer, but the *_msg handlers weren't
pre-zeroing the buffer, would could in some circumstances lead to
an Oops.
Trond Myklebust [Fri, 11 Oct 2002 09:59:52 +0000 (02:59 -0700)]
[PATCH] A basic NFSv4 client for 2.5.x
Now that all calls to nfs_async_handle_jukebox() have been moved to
fs/nfs/nfs3proc.c, we clean up by moving the nfs_async_jukebox() routine
itself there. We also rename it nfs3_async_handle_jukebox(), to be
consistent with the naming conventions of that file.
Trond Myklebust [Fri, 11 Oct 2002 09:59:43 +0000 (02:59 -0700)]
[PATCH] A basic NFSv4 client for 2.5.x
In NFSv3, an RPC is retried if the special error NFSERR_JUKEBOX is
received. This generic bit of postprocessing happens invisibly for
synchronous RPC's, but in the async case, the ->tk_exit callback
must call nfs_async_handle_jukebox() by hand.
In NFSv4, we also need generic postprocessing of async RPC's, but
the details are different. Therefore, we don't want to call
nfs_async_handle_jukebox(); we want to call a different, NFSv4-specific
routine. Therefore, we want to move calls to nfs_async_handle_jukebox()
out of the "generic" NFS code and into NFSv3-specific routines. This
has already been done for async READ and WRITE in the preceding patches,
but there is still one outstanding case: the async REMOVE in sillyrename.
This patch removes nfs_async_handle_jukebox() from the async sillyrename
path, and puts in the NFSv3 ->unlink_done() rpc_op.
Trond Myklebust [Fri, 11 Oct 2002 09:59:34 +0000 (02:59 -0700)]
[PATCH] A basic NFSv4 client for 2.5.x
This is a nontrivial change to the NFS client.
This patch does for the async WRITE and COMMIT paths what patch 15
did for the async READ path, by defining new nfs_rpc_ops ->setup_write()
and ->setup_commit().
Trond Myklebust [Fri, 11 Oct 2002 09:59:24 +0000 (02:59 -0700)]
[PATCH] A basic NFSv4 client for 2.5.x
This is a nontrivial change to the NFS client.
This patch does for the async WRITE and COMMIT paths what patch 14
did for the async READ path, by changing 'struct nfs_write_data'
so that the v2- and v3-specific parts are moved into a private area,
with room for a v4-specific part in parallel. None of the logic is
changed.
Trond Myklebust [Fri, 11 Oct 2002 09:54:33 +0000 (02:54 -0700)]
[PATCH] Disable Nagle algorithm for RPC over TCP.
The Nagle algorithm gets in the way when sending short RPC messages to
the server. The following patch from Chuck does the equivalent of
setting TCP_NODELAY on the socket.
Doug Ledford [Fri, 11 Oct 2002 07:01:38 +0000 (00:01 -0700)]
[PATCH] aic7xxx_old update and a compile warning fix in scsi.c
Rework lots of cruft in the aic7xxx_old driver so that it can be more
easily read and understood by other people and so it starts on the road
to giving a clearer picture of how to interact with the scsi mid layer.
Doug Ledford [Fri, 11 Oct 2002 07:01:28 +0000 (00:01 -0700)]
[PATCH] tcq fixes for the issue on linux-kernel
This does 4 things. Fixes the oversight James found about cmd_per_lun.
Makes scsi_adjust_queue_depth() implement the usage of tagged that I
described in my email to linux-scsi. Updates some comments to highlight
things that are going to go away shortly. Removes the call to
host->select_queue_depths() entirely since drivers that implement this
will try to set SDptr->queue_depth to the desired depth, which in reality
will do nothing but confuse the mid layer since that is now the actual
allocated command counter, so it won't make the mid layer allocate more
commands, it will make the mid layer think more commands have been
allocated.
Doug Ledford [Fri, 11 Oct 2002 07:01:08 +0000 (00:01 -0700)]
[PATCH] redo of scsi.h changes
Start removing items from scsi.h that are driver specific and provide a
patch to NCR53C9x.? that switches to driver private storage instead as
an example of how drivers should do private struct storage
Jay Vosburgh [Fri, 11 Oct 2002 08:42:42 +0000 (04:42 -0400)]
Prevent EFAULT errors when checking link status, in bonding net driver.
Also some minor cleanups as well.
[This patch qualifies for the cavemen ugh-lympics, because the driver does
some really nasty things in interrupt context and this patch does
not correct that. However, the patch is an incremental improvement
over the current code so it's still worth applying. I'll fix it
further if IBM does not fix it first. -jgarzik]
Jeb J. Cramer [Fri, 11 Oct 2002 07:57:59 +0000 (03:57 -0400)]
e1000 net driver minor fixes/cleanups:
* don't read PCI bus for values stored in struct pci_dev
* remove silly BUG() in e1000_sw_init, and
* return error from e1000_sw_init
Jean Tourrilhes [Fri, 11 Oct 2002 09:34:33 +0000 (05:34 -0400)]
irda update 5/6:
o [FEATURE] Fix some comments
o [FEATURE] printk warning when we detect buggy QoS from peer
o [CORRECT] Workaround NULL QoS bitfields
o [CORRECT] Workaround oversized QoS bitfields
o [FEATURE] Add sysctl "max_tx_window" to limit IrLAP Tx Window
Jean Tourrilhes [Fri, 11 Oct 2002 09:31:52 +0000 (05:31 -0400)]
irda update 4/6:
o [FEATURE] Fix spelling UNITIALISED => UNINITIALISED
o [CORRECT] Accept data from TTY before link initialisation
This seems necessary to avoid chat (via pppd) dropping chars
o [CRITICA] Remember allocated skb size to avoid to over-write it
o [FEATURE] Remove LM-IAS object once connected
o [CORRECT] Avoid declaring link ready when it's not true
Jean Tourrilhes [Fri, 11 Oct 2002 09:26:41 +0000 (05:26 -0400)]
irda update 2/6:
<Following patch from Martin Lucina & Christian Gennerat>
o [FEATURE] Rewrite of the toshoboe driver using documentation
o [FEATURE] Support Donau oboe chipsets.
o [FEATURE] FIR support
o [CORRECT] Probe chip before opening
o [FEATURE] suspend/resume support
o [FEATURE] Numerous other improvements/cleanups
o [CORRECT] (me) Remove save_flags()/cli() for spinlock
<Currently, we keep the old toshoboe driver around>
o [FEATURE] Config.help for ma600 driver (unrelated ;-)
Jean Tourrilhes [Fri, 11 Oct 2002 09:22:51 +0000 (05:22 -0400)]
irda update 1/6, big vlsi_ir driver update:
<Following patch from Martin Diehl>
* merge+sync with changes from recent kernels: pci_[sg]et_drvdata,
__devexit_p, netdev->last_rx, irda header cleanup
* add netdev tx_timeout which re-initializes the whole thing
* add power management support consistent with pci driver api
* major rework of the ring descriptor operations
* make correct usage of consistent and streaming pci dma api
* nuke last virt_to_bus() and friends
* support MIR/FIR highspeed interaction pulse (SIP)
* review all paths for packet-size issues (rx and tx)
* fix an old issue requiring hw powercycle caused by a race
between IrLAP and hardware when switching _back_ to default
speed at LAP disconnect. This was opened by the complete async
behaviour of netdev->xmit but didn't happen before your latency
improvements went into the stack.
* add driver status readout under /proc/driver/vlsi_ir/irda%
For 2.5, this will probably go into driverfs once things have
stabilized.
* fix potential deadlock in speed changing code
* make identical driver working for both 2.4 and 2.5
* add __attribute__((packed)) to hardware-exposed struct
* add suggested pci_dma_prep_single() to flush cpu cache before
streaming dma buffer gets reused for busmastering
Since 2.5.32 the keyboard repeat code was broken.
The reason Vojtech broke it was the stupid name of a field
in struct kbd_repeat, namely "rate". Every sane person
expects that a rate has dimension [1/sec], but here the
"rate" is a time period measured in msec.
So, the patch below first of all fixes the code,
and secondly changes the name.
Since Vojtech used PERIOD as index, I also used period
as field name in the struct.
Half of the stuff below is actually from Alan Stern.
Ingo Molnar [Fri, 11 Oct 2002 03:05:46 +0000 (20:05 -0700)]
[PATCH] sched-2.5.41-A0
This fixes the scheduler's migration code to not disable preemption. It
also fixes the bug that was hidden by the broken disable-preempt change:
the migration thread did not kick idle CPUs if a task is migrated to
them, which causes a hung boot when ksoftirqds are started. It was pure
luck it worked until now, it was broken pretty much from day 1 on.
Armin Schindler [Thu, 10 Oct 2002 17:09:15 +0000 (12:09 -0500)]
ISDN: Add new Eicon driver
Armin Schindler:
- Divas driver V2 for Eicon Networks DIVA-Server ISDN PCI cards,
consists of 5 modules: internal link-module, main driver,
capi-interpreter module, user interface module and maint-driver
for debugging and logging.
ISDN: ref counting for isdn_net_local / isdn_net_dev
Make sure that we elevate the ref count for isdn_net_dev's in states
other than ST_NULL, so only after we get back to ST_NULL, our net_device
may be closed (only afterwards, the isdn_net_dev's could be deleted).
ISDN: Move generic bits from isdn_net_lib to isdn_common
o When accepting an incoming call, leave it to the common code to set
usage, numbers etc.
o Make USAGE_EXCLUSIVE just another flag when getting / accepting
a channel, getting rid of some special case code.
o No need to pass the current usage when freeing a channel
Move the incoming call handling from isdn_net.c to isdn_net_lib.c.
We use a spinlock protected list for finding a matching device on incoming
calls, making sure that a concurrent net_device::close() cannot corrupt
the list under us or destroy the isdn_net_dev before its ref count hits
zero.
Also, remove superfluous #ifdefs from isdn_concap.c