Vojtech Pavlik [Tue, 27 Aug 2002 04:28:38 +0000 (06:28 +0200)]
Fix bits that have fallen out when merging input-based keyboard.c
into 2.5 - kbd0 init, sysrq support, show_regs, show_mem, show_state
support, correct handling of shifts across vt switches, console
blanking, console callback. Hope that's all.
Benjamin LaHaise [Mon, 26 Aug 2002 04:02:07 +0000 (21:02 -0700)]
[PATCH] convert quota.h to bsd 3 clause
For some reason, quota.h was derrived from BSD 4 clause code. Thankfully,
UCB gave permission to remove the advert clause a couple of years ago, so
it's now okay for us to actually distribute this code. The following patch
updates the header in quota.h.
Chuck Lever [Mon, 26 Aug 2002 04:01:55 +0000 (21:01 -0700)]
[PATCH] eliminate hangs during RPC client shutdown
this eliminates an infinite loop in rpciod if an RPC client's reference
counter accidentally goes negative. i've been running this under load
since 2.5.30 with no ill effects.
Kai Mäkisara [Mon, 26 Aug 2002 04:01:44 +0000 (21:01 -0700)]
[PATCH] SCSI tape direct transfers for 2.5.31
This adds direct write and read from/to the user space to/from the SCSI
adapter. If something (e.g., too high address) prevents direct
transfer, the existing driver buffer code is used. The patch contains
functions to map and pin the user buffer pages so that this patch is not
dependent on kiobufs. Similar functions are already used in sg.c.
Vojtech Pavlik [Mon, 26 Aug 2002 13:13:55 +0000 (15:13 +0200)]
Shorten the keycode handling code in keyboard.c and evdev.c.
Recompute keybit when keycode table changes.
Stricter checks on input keycode/scancode values.
Patrick Mochel [Mon, 26 Aug 2002 02:24:19 +0000 (19:24 -0700)]
Introduce struct device_interface.
Device interfaces are the logical interfaces of device classes that correlate
directly to userspace interfaces, like device nodes.
Device interfaces are registered with the class they belong to. As devices
are added to the class, they are added to each interface registered with
the class. The interface is responsible for determining whether the device
supports the interface or not.
The interface is responsible for allocating and initializing a struct
intf_data and calling interface_add_data() to add it to the device's list
of interfaces it belongs to. This list will be iterated over when the device
is removed from the class (instead of all possible interfaces for a class).
This structure should probably be embedded in whatever per-device data
structure the interface is allocating anyway.
Devices are enumerated within the interface. This happens in interface_add_data()
and the enumerated value is stored in the struct intf_data for that device.
Interfaces get a directory in driverfs under their class's directory. Each
time a device is added to the interface, a symlink is created in that
directory that points to the device's directory in the physical hierarchy.
The name of this symlink is the interface-enumerated value of the device.
Patrick Mochel [Mon, 26 Aug 2002 01:39:32 +0000 (18:39 -0700)]
Introduce struct device_class
Device classes describe a type (or class) of device, like an input device
or network device, etc. This changeset defines a struct device_class that
each subsystem is expected to implement and register with the core.
struct device_driver gains a devclass pointer which points to the class it
belongs to. When the driver is registered, it is added to the class's list
of drivers. Whenever a device is bound to that driver, it is added to the
class by calling the class's add_device callback.
struct device gains a class_num field which is the per-class enumerated value
of the device. It is incremented each time a device is registered with the
class.
Each device class gets a driverfs directory in class/<class name> and two
subdirectories: 'devices' and 'drivers'. For each device added to the class,
a symlink is created in the devices/ directory that points to the device's
directory in the physical hierarchy. The name of the symlink is the enumerated
number the device got when it was registered with the class.
For each driver that's added to the class, a symlink is created in the class's
drivers/ directory that points to the driver's directory. The name of this
symlink is a concatenation of <bus name>:<driver name> (to prevent namespace
conflicts of drivers with the same name on different buses).
Vojtech Pavlik [Sun, 25 Aug 2002 17:21:22 +0000 (19:21 +0200)]
This (re)implements getkeycode/setkeycode, kbd_rate and kd_mksound
as functions interfacing to the input core. PC-Speaker handling is
moved to a separate file. Uinput is moved to a input/misc directory.
Symbols CONFIG_BLK_DEV_NS87415, CONFIG_BLK_DEV_TRM290, CONFIG_DSCC4, and
CONFIG_USB_SERIAL_SAFE_PADDED had spurious (EXPERIMENTAL) tags in their
banners.
Symbol CONFIG_INPUT_UINPUT was missing an (EXPERIMENTAL) tag in it banner.
The symbol CONFIG_SOUND_CMPCI_FMIO is declared with a "hex" statement,
immediately preceded by a "define_hex" with the same value as the
default value from the "hex". In config and xconfig, this has no effect;
in menuconfig it prevents the user selecting any value other than the
default.
A number of dep_bools and dep_tristates have architecture constants
(e.g. CONFIG_X86) as dependencies. Such symbols have the property
that their value is constant for any particular arch tree, and is
either "y" or "", neither of which have any effect as dependencies,
so the dependencies have no effect. This patch removes some of them.
The menu 'AX.25 network device drivers' contained as its first
item a comment with identical banner. This is pointless duplication,
but more to the point it confused gcml2 unnecessarily.
David S. Miller [Fri, 23 Aug 2002 23:07:52 +0000 (16:07 -0700)]
SPARC64: Ultra-III+ bug fix and better bad trap logging.
- Do not use PC-relative branch/call in Ultra-III+ parity error
trap vectors, we patch this into the trap table and then the PC-relative
values are wrong.
- When we take an irrecoverable trap at tl > 0, save away the full
trap stack to the kernel stack, then log it from the C code handler.
David S. Miller [Fri, 23 Aug 2002 21:09:31 +0000 (14:09 -0700)]
[SPARC32]: Synchronize with 2.5.x changes
- Some places need to include sched.h because the already include ptrace.h
- CLONE_{SET,CLEAR}TID support
- Clear PT_DTRACE when execve succeeds.
- Add security bits to ptrace
- Add sys_security to syscall tables.
David S. Miller [Fri, 23 Aug 2002 21:00:43 +0000 (14:00 -0700)]
[SPARC64]: Synchronize with 2.5.x changes
- Some places need to include sched.h because the already include ptrace.h
- CLONE_{SET,CLEAR}TID support
- Clear PT_DTRACE when execve succeeds.
- Add security bits to ptrace and sys32_execve
- Add sys_security to syscall tables.
David S. Miller [Fri, 23 Aug 2002 20:58:36 +0000 (13:58 -0700)]
[CLONE_*TID]: Make tsk->user_tid and int so that 64-bit arches work.
- futex uses int as its atomic word type, we pass in user_tid
to the futex routines, so the types must match
David S. Miller [Fri, 23 Aug 2002 20:55:19 +0000 (13:55 -0700)]
SPARC64: Bug fixes in arch/sparc64/mm/ultra.S
- flush_dcpage_cheetah sized wrongly, it is 11 not 9 insns now
- xcall_report_regs and xcall_promstop should use etrap_irq not etrap
[PATCH] kNFSd: NFSv4: tweak nfsd_readdir() for NFSv4
This patch makes three small changes to nfsd_readdir().
First, the 'filldir' routine for NFSv4 may return an arbitrary error,
which should become the return value for nfsd_readdir(). I implemented
this by adding an 'nfserr' field to the 'struct readdir_cd'.
Second, in NFSv4 the caller of nfsd_readdir() will specify an attribute
bitmap, which must be communicated to the 'filldir' routine. I implemented
this by adding a @bitmap parameter to nfsd_readdir() and a corresponding
field in the 'struct readdir_cd'. (The bitmap is not interpreted in any
way by nfsd_readdir().)
Finally, NFSv4 defines a new error nfserr_readdir_nospc, which indicates
that there was not enough buffer space to encode a single entry.
[PATCH] kNFSd: NFSv4: new argument to nfsd_access()
NFSv4 defines a new field in the ACCESS response: a bitmap to indicate
which access bits requested by the client are "supported", i.e. meaningful
for the object in question.
This patch adds a new parameter @supported to nfsd_access(), so that
nfsd_access() can set the value of this bitmap.
[PATCH] kNFSd: NFSv4: tweak nfsd_create_v3() for NFSv4
File creation in NFSv4 is almost the same as in NFSv3, with one minor
difference. If an UNCHECKED create is done, and the file exists, we
don't set any attributes. Exception: If size==0 is specified as part
of the attributes, then we do truncate the file, but only after processing
the rest of the OPEN. (File creation is always part of an OPEN request.)
This patch defines a new argument *truncp to nfsd_create_v3(), which
will be NULL for v3 requests. For v4 requests, it will point to a
variable which should be set to 1 if file truncation is still needed.
The logic in nfsd_create_v3() is changed as follows: If
- *truncp is not NULL
- the create is UNCHECKED
- the file exists
then nfsd_create_v3() returns immediately. If size==0 is specified,
then *truncp is set to 1.
This is kind of a hack, but the only alternative I could see was creating
a new routine nfsd_create_v4(), which would be identical to nfsd_create_v3()
except for this point.
[PATCH] kNFSd: NFSv4: allow type==0 in nfsd_unlink()
If nfsd_unlink() is called with @type equal to 0, then let it do the
right thing regardless of the type of the file being unlinked. This
is needed for the NFSv4 REMOVE operation, which works for any type of
file, even directories.
[PATCH] kNFSd: NFSv4: overflow check in nfsd_commit()
Sanity check COMMIT arguments by ensuring that (start)+(length) < 2^64.
The check is done in a way which is free of signedness pathologies in
all cases.
This change was inspired by pynfs, Peter Astrand's regression testsuite
for NFSv4 servers. The change is necessary for all of the COMMIT tests
to pass. However, it's a little open to debate whether the change is
really needed. I'm curious to hear the opinions of other developers.
[PATCH] kNFSd: NFSv4: allow resfh==fhp in fh_compose()
Change fh_compose() so that it will do the right thing if fhp==res_fh.
(This is convenient in the NFSv4 LOOKUP operation, which _replaces_
CURRENT_FH with the filehandle obtained by lookup.)
This requires extracting the interesting parts of the reference
filehandle first, then calling fh_put if it is a re-use.
[PATCH] kNFSd: NFSv4: wipe out all evidence in fh_put()
When a filehandle is cleared with fh_put(), wipe out all traces by
clearing ->fh_pre_saved and ->fh_post_saved. This prevents
fill_post_wcc() from complaining if the filehandle is later reused.
(This could happen in NFSv4 to CURRENT_FH if, for example, LOOKUP LOOKUP
occurs in a COMPOUND.)
[PATCH] kNFSd: NFSv4: fix type checking in fh_verify()
Change the type checking in fh_verify(). This fixes a bug which
I reported on the mailing list a few days ago, and also adds a
new error code nfserr_symlink (v4 only). This is returned whenever
an operation which is illegal for symlinks is attempted on a symlink,
and takes precedence over ERR_NOTDIR or ERR_INVAL.
Neil Brown [Fri, 23 Aug 2002 04:27:25 +0000 (21:27 -0700)]
[PATCH] md: Remove per-personality 'operational' and 'write_only' flags
raid1, raid5 and multipath maintain their own
'operational' flag. This is equivalent to
!rdev->faulty
and so isn't needed.
Similarly raid1 and raid1 maintain a "write_only" flag
that is equivalnt to
!rdev->in_sync
so it isn't needed either.
As part of implementing this change, we introduce some extra
flag bit in raid5 that are meaningful only inside 'handle_stripe'.
Some of these replace the "action" array which recorded what
actions were required (and would be performed after the stripe
spinlock was released). This has the advantage of reducing our
dependance on MD_SB_DISKS which personalities shouldn't need
to know about.
Neil Brown [Fri, 23 Aug 2002 04:26:52 +0000 (21:26 -0700)]
[PATCH] md: Make spare handling simple ... personalities know less
1/ Personalities only know about raid_disks devices.
Some might be not in_sync and so cannot be read from,
but must be written to.
- change MD_SB_DISKS to ->raid_disks
- add tests for .write_only
2/ rdev->raid_disk is now -1 for spares. desc_nr is maintained
by analyse_sbs and sync_sbs.
3/ spare_inactive method is subsumed into hot_remove_disk
spare_writable is subsumed into hot_add_disk.
hot_add_disk decides which slot a new device will hold.
4/ spare_active now finds all non-in_sync devices and marks them
in_sync.
5/ faulty devices are removed by the md recovery thread as soon
as they are idle. Any spares that are available are then added.
Neil Brown [Fri, 23 Aug 2002 04:26:27 +0000 (21:26 -0700)]
[PATCH] md: Keep track of number of pending requests on each component device on an MD array
This will allow us to know, in the event of a device failure, when the
device is completely unused and so can be disconnected from the
array. Currently this isn't a problem as drives aren't normally disconnect
until after a repacement has been rebuilt, which is a LONG TIME, but that
will change shortly...
We always increment the count under a spinlock after checking that
it hasn't been disconnected already (rdev!= NULL).
We disconnect under the same spinlock after checking that the
count is zero.
Neil Brown [Fri, 23 Aug 2002 04:21:49 +0000 (21:21 -0700)]
[PATCH] call svc_sock_setbufsize when socket created.
bufsiz is re-evaluated on recv if SK_CHNGBUF is set,
but recv will never be reached if the buffers are too small.
So we have to set to to something vaguely reasonable
at init time.
Neil Brown [Fri, 23 Aug 2002 04:21:39 +0000 (21:21 -0700)]
[PATCH] Fix two problems with multiple concurrent nfs/tcp connects.
1/ connect requests would be get lost...
As the comment at the top of svcsock.c says when discussing
SK_CONN:
* after a set, svc_sock_enqueue must be called.
We didn't and so lost conneciton requests.
2/ set the max accept backlog to a more reasonable number to cope
with bursts of lots of connection requests.