David Woodhouse [Thu, 21 Oct 2004 01:13:45 +0000 (02:13 +0100)]
MTD: NOR flash chip driver updates
Mostly from Eric Biederman for supporting BIOS flash.
- Move support firmware hub style lock and unlock into fhw_lock.h (from cfi_cmdset_0002)
- Move cfi_varsize_frob into cfi_util from cfi_cmdset_0001.c and cfi_cmdset_0002.c
- reduce gen_probe probe failuers to a debug level message
- Modify cfi_fixup to take a struct mtd_info instead of a struct map_info
So that the fixup routines can modify the mtd functions.
- Modify cfi_cmdset_0001() to allocate and initialize the mtd structure
before calling cfi_fixup.
- Modify cfi_cmdset_0002() to allocate and initialize the mtd structure
before calling cfi_fixup.
- Refactor the hard coded fixups in cfi_cmdset_0001 and cfi_cmdset_0002
so the improved cfi_fixup infrastructure.
- Rewrote amd76xrom and ichxrom.
They now report their starting physical address in their name.
They now both handle multiple bankwidth configurations
They both can create multipe mtd devices.
They both now assume the rom windows are properly opened by the BIOS
or whatever runs previous to them.
Their code is now synchromized so it is almost identical,
and could be a starting point for a x86_rom_probe.
Signed-Off-By: David Woodhouse <dwmw2@infradead.org>
Thomas Gleixner [Thu, 21 Oct 2004 00:53:32 +0000 (01:53 +0100)]
MTD char device access -- return data when ECC errors happen.
This is sane, as the driver returns the real data and the return
value is for information of NAND aware filesystems. Userspace
access to raw NAND is usually restricted to debugging tools which
are aware of the NAND specific problems.
Signed-Off-By: Thomas Gleixner <tglx@linutronix.de> Signed-Off-By: David Woodhouse <dwmw2@infradead.org>
Thomas Gleixner [Wed, 20 Oct 2004 23:55:08 +0000 (00:55 +0100)]
Shared Reed-Solomon ECC library
The attached patch contains a shared Reed-Solomon Library analogous to
the shared zlib.
(N)AND FLASH is gaining popularity and there are a lot of ASIC/SoC/FPGA
controllers around which implement hardware support for Reed-Solomon
error correction. As usual they use different implementations
(polynomials etc.). So it's obvious to use a shared library for the
common tasks of error correction.
A short scan through the kernel revealed that at least the ftape driver
uses Reed-Solomon error correction. It could be easily converted to use
the shared library code.
The encoder/decoder code is lifted from the GPL'd userspace RS-library
written by Phil Karn. I modified/wrapped it to provide the different
functions which we need in the MTD/NAND code.
The library is tested in extenso under various MTD/NAND configurations.
The lib should be usable for other purposes right out of the box.
Adjustment for currently not implemented functionality is an easy task.
I'm willing to take the maintainership of the library.
Signed-Off-By: Thomas Gleixner <tglx@linutronix.de> Signed-Off-By: David Woodhouse <dwmw2@infradead.org>
"No objections at all. Just keep the authorship notices." -- Phil Karn
The orphan list holds inodes that need to be truncated on recovery. In the
O_DIRECT case, it's used if we extend the inode --- the truncate on recovery
means we'll recover the newly-allocated disk blocks if we crash after the IO
starts but before i_size is updated on disk.
Now, the orphan list is *also* used to delete inodes that are unlinked but
still-open. Those get truncated but also deleted on recovery.
The orphan list is held both in memory and on disk. So the rules are that the
inode can't be reclaimed while on the orphan list. There are only two cases
--- either the inode is actively being written(O_DIRECT) or truncated (in
which case the inode is by definition not going to be reused), or it's
unlinked but still open (again, non-reclaimable).
But in the case where you're truncating or write(O_DIRECT)ing a file that is
*ALSO* unlinked, there's a problem --- the final unlink would put the inode on
the orphan list, but the write/truncate would try to add/remove it. End
result is that the inode disappears from the orphan list while it's still
unlinked-but-in-use.
That's just a leak-on-crash, it's not going to be detectable in normal use.
But it's still a bug, and the way we fix it is for direct-IO and truncate not
to do the ext3_orphan_del if the file is unlinked (ie. i_nlink==0).
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[PATCH] nfs4 lease: separate the lease processsing code
nfsd will not have a file descriptor, nor an owner on the filp. nfsd also
will not use signals. Seperate the lease processsing coe from
fcntl_setlease() into a __setlease() call.
Signed-off-by: Andy Adamson <andros@citi.umich.edu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[PATCH] nfs4 lease: add a lock manager copy lock callback
The following patches provide an interface to the lease subsystem in the
current VFS locking code. NFSv4 delegations and Samba op-locks share most
architecture features. The version 4 NFS server delegation implementation
should use leases to co-ordinate behavior between local, Samba, and NFS
access.
The main design points are
- Seperate the fcntl interface from the file_lock FL_LEASE processing in
fcntl_setlease, creating __setlease() called by fcntl_setlease()
- Add new lock_manager callbacks to enable lease properties to be set,
leases to be broken, and leases to be cleaned up: with default callbacks
preserving the current fcntl_setlease properties.
- Add a new interface, setlease() which also calls __setlease(), and
remove_lease() for kernel lease managers (e.g. the v4 NFS server)
This patch:
Add a lock manager copy lock callback to locks_copy_lock() so that nfsd can
set lease properties.
Signed-off-by: Andy Adamson <andros@citi.umich.edu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jeff Mahoney [Wed, 20 Oct 2004 01:43:11 +0000 (18:43 -0700)]
[PATCH] reiserfs: allow user_xattr and acl options to be ignored, with warning
This patch uses the REISERFS_UNSUPPORTED_OPT flag to denote -o(no)acl, and
-o(no)user_xattr as unsupported, but allowable, when support isn't built
into the kernel.
Signed-off-by: Jeff Mahoney <jeffm@novell.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Jeff Mahoney [Wed, 20 Oct 2004 01:42:56 +0000 (18:42 -0700)]
[PATCH] reiserfs: support for REISERFS_UNSUPPORTED_OPT notation
This patch adds a REISERFS_UNSUPPORTED_OPT flag to denote when a mount
option is allowable, but is unsupported in the running configuration. This
allows the potential for the set of mount options to be consistent,
regardless of what features the kernel is compiled with.
Rather than failing the mount, a warning is issued and the mount succeeds.
Signed-off-by: Jeff Mahoney <jeffm@novell.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Kenneth W. Chen [Wed, 20 Oct 2004 01:42:41 +0000 (18:42 -0700)]
[PATCH] Enable config_schedstats for all arches
Config option CONFIG_SCHEDSTATS is currently enabled via arch specific
Kconfig.debug. Only x86 and ppc arches has code to turn it on. Why not
put it in generic lib/Kconfig.debug so it is done once to enable everyone?
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Dean Gaudet [Wed, 20 Oct 2004 01:41:28 +0000 (18:41 -0700)]
[PATCH] transmeta efficeon support and cpuid update
This patch adds efficeon as a cpu option, and makes a small update to the
transmeta cpuid code. (i wasn't sure if the various doc files are UTF-8...
if they are, then the e should be a U-275 ;)
The compile options may not be ideal, but they're probably close. i used
-march=pentium3, but -march=pentium4 would have been good enough too.
The cpuid update teaches transmeta.c about the extended processor revision
present in cpuid level 0x80860002... the external documentation does not
indicate how to break apart this field, and instructs only that the 32-bit
value should be printed in hex (alas).
Signed-off-by: dean gaudet <dean@arctic.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
I've noticed that under specific circumstances the "console=" kernel
parameter is ignored. This happens when EARLY_PRINTK is enabled and the
serial console is the only available. In this case unregister_console()
when called for the early console sets preferred_console back to -1
replacing the value that was recorded by console_setup() -- the order of
calls is as follows:
1. register_console() -- for the early console,
2. console_setup() -- recording the console index for the real console,
3. unregister_console() -- for the early console, erasing the console
index recorded above,
4. register_console() -- for the real console, picking up the first device
available, instead of the selected one.
I've observed this problem with a DECstation system using ttyS3 -- its
default console device from the firmware's point of view.
The solution is to restore the setting of "console=" upon
unregister_console(). This made a snapshot of 2.4.26 work for me. I
wasn't able to test the changes with 2.6 because DECstation drivers don't
support it yet, but the code responsible for console selection appears
functionally the same. So I've concluded it needs the same change. Here's
a patch.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Ed Schouten [Wed, 20 Oct 2004 01:40:45 +0000 (18:40 -0700)]
[PATCH] lockd: remove hardcoded maximum NLM cookie length
At the moment, the NLM cookie length is fixed to 8 bytes, while 1024 is the
theoretical maximum. FreeBSD uses 16 bytes, Mac OS X uses 20 bytes.
Therefore we need to make the length dynamic (which I set to 32 bytes).
This patch is based on an old patch for Linux 2.4.23-pre9, which I changed
to patch properly (also added some stylish NIPQUAD fixes).
From: Neil Brown <neilb@cse.unsw.edu.au>
Further lockd tidyups.
- NIPQUAD everywhere that is appropriate
- use XDR_QUADLEN in more places as appropriate
- discard QUADLEN which is a lockd-specific version of XDR_QUADLEN
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Manfred Spraul [Wed, 20 Oct 2004 01:40:18 +0000 (18:40 -0700)]
[PATCH] slab: reduce fragmentation due to kmem_cache_alloc_node
Attached is a patch that fixes the fragmentation that Badri noticed with
kmem_cache_alloc_node.
kmem_cache_alloc_node tries to allocate memory from a given node. The
current implementation contains two bugs:
- the node aware code was used even for !CONFIG_NUMA systems. Fix:
inline function that redefines kmem_cache_alloc_node as kmem_cache_alloc
for !CONFIG_NUMA.
- the code always allocated a new slab for each new allocation. This
caused severe fragmentation. Fix: walk the slabp lists and search for a
matching page instead of allocating a new page.
- the patch also adds a new statistics field for node-local allocs. They
should be rare - the codepath is quite slow, especially compared to the
normal kmem_cache_alloc.
Marcelo Tosatti [Wed, 20 Oct 2004 01:40:03 +0000 (18:40 -0700)]
[PATCH] Remove redundant AND from swp_type()
There is a useless AND in swp_type() function.
We just shifted right SWP_TYPE_SHIFT() bits the value from the swp_entry_t,
and then we AND it with "(1 << 5) - 1" (which is a mask corresponding to
the number of bits used by "type").
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
/proc shows the wrong PID as parent in the following case
Process A creates Threads 1 & 2 (using pthread_create) Thread 2 then forks
and execs process B getppid() for Process B shows Process A (rightly) as
parent, however /proc/B/status shows Thread 3 as PPid (incorrect).
Use, in the rb_entry definition, the container_of macro instead of
reinventing the wheel; compared to using offset_of() as I did in the prev.
version, it has type safety checking.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Dell's Virtual Floppy (system management presents to the local system an
IDE floppy device, which is actually a floppy device in a remote system
connected over an IP link) exhibits this also, when connecting to a remote
floppy drive with no media present.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Hideo Aoki [Wed, 20 Oct 2004 01:36:51 +0000 (18:36 -0700)]
[PATCH] proc.txt cleanup
In Documentation/filesystems/proc.txt, explanation of /proc/meminfo is
described in section 1.3 (IDE devices in /proc/ide). I think that it
should be described in section 1.2 (Kernel data).
Hideo Aoki [Wed, 20 Oct 2004 01:36:36 +0000 (18:36 -0700)]
[PATCH] vm thrashing control tuning
This patch adds "swap_token_timeout" parameter in /proc/sys/vm. The
parameter means expired time of token. Unit of the value is HZ, and the
default value is the same as current SWAP_TOKEN_TIMEOUT (i.e. HZ * 300).
Matt Domsch [Wed, 20 Oct 2004 01:36:22 +0000 (18:36 -0700)]
[PATCH] EDD: use EXTENDED READ command, add CONFIG_EDD_SKIP_MBR
Some controller BIOSes have problems with the legacy int13 fn02 READ
SECTORS command. int13 fn42 EXTENDED READ is used in preference by most
boot loaders today, so lets use that. If EXTENDED READ fails or isn't
supported, fall back to READ SECTORS.
This hopefully resolves the three reports of BIOSes which would either
long-pause (30+ seconds) or hang completely on the legacy READ SECTORS
command.
This also adds CONFIG_EDD_SKIP_MBR to eliminate reading the MBR on each
BIOS-presented disk, in case there are further problems in this area.
Signed-off-by: Matt Domsch <Matt_Domsch@dell.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Ryan S. Arnold [Wed, 20 Oct 2004 01:36:07 +0000 (18:36 -0700)]
[PATCH] hvc_console fix to prevent oops and late hangup and write operations
This patch prevents execution of hvc_write() and hvc_hangup() after the tty
layer has executed a final hvc_close() against a device. This patch
provides a better method than was previously used. tty->driver_data is no
longer invalidated so we'll no longer get oopses when the tty layer allows
late hangup() and write() operations.
- Removed silly tty->driver_data = NULL; from hvc_close which prevents
possible oops in hvc_write() and hvc_hangup() due to improperly acting
ldisc close ordering.
- Added hp->count <= 0 check to hvc_write() and hvc_hangup() to prevent
execution of these function after hvc_close() has been invoked by the tty
layer. Same tty ldisc issues as above are the reason.
- Added some comments to clarify the situation.
- Awaiting a forth coming patch from Alan Cox which should clean up the
close ordering and prevent the late hangup and write ops from happening.
Signed-off-by: Ryan S. Arnold <rsa@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Duncan Sands [Wed, 20 Oct 2004 01:35:07 +0000 (18:35 -0700)]
[PATCH] firmware_class: avoid double free
The error exit path in request_firmware frees the allocated struct firmware
*firmware, which is good. What is not so good is that the value of
firmware has already been copied out to the caller as *firmware_p. The
risk is that the caller will pass this to release_firmware, a double free.
This is exactly what will happen if the caller copied the example code
[PATCH] Amifb: use new amifb:off logic to enhance audio experience
Amiga frame buffer: We used to have a local hack in fbmem.c to always call the
fbdev setup() routines, even when an fbdev was explicitly disabled on the
kernel command line (video=xxx:off). This allowed amifb to suspend the
monitor, but program the sync generator of the video controller in Denise/Lisa
to a 31 kHz/70 Hz mode, increasing the maximum audio playback frequency.
Thanks to the recently introduced fb_get_options() routine, we can kill the
local hack and just use the return value of fb_get_options().
Amiga frame buffer: The new convention (introduced in 2.6.9-rc1) requires that
the usable color depth for pseudocolor visuals is indicated by the lengths of
the color bitfields. Update amifb for this convention, and add a special case
for HAM (Hold-and-Modify) mode (colormap has 16 (HAM6) or 64 (HAM8) entries).
[PATCH] M68k: don't emit empty stack program header in vmlinux
Recent versions of ld add an empty stack program header to the kernel image,
which makes it incompatible with current m68k bootstrap loaders. Modify the
linker script to make sure we see only the program headers that are really
needed. (from Roman Zippel)
[PATCH] x86[64]: display phys_proc_id only when it is initialized
phys_proc_id gets initialized only when (smp_num_siblings > 1). But gets
printed even when (smp_num_siblings == 1). As a result we print incorrect
physical processor id in /proc/cpuinfo, when HT is disabled.
Oleg Nesterov [Wed, 20 Oct 2004 01:31:47 +0000 (18:31 -0700)]
[PATCH] detach_pid(): restore optimization
Kirill's kernel/pid.c rework broke optimization logic in detach_pid(). Non
zero return from __detach_pid() was used to indicate, that this pid can
probably be freed. Current version always (modulo idle threads) return non
zero value, thus resulting in unneccesary pid_hash scanning.
Also, uninlining __detach_pid() reduces pid.o text size from 2492 to 1600
bytes.
POSIX clocks are to be implemented in the following way according
to V3 of the Single Unix Specification:
1. CLOCK_PROCESS_CPUTIME_ID
Implementations shall also support the special clockid_t value
CLOCK_PROCESS_CPUTIME_ID, which represents the CPU-time clock of the
calling process when invoking one of the clock_*() or timer_*()
functions. For these clock IDs, the values returned by clock_gettime() and
specified by clock_settime() represent the amount of execution time of the
process associated with the clock.
2. CLOCK_THREAD_CPUTIME_ID
Implementations shall also support the special clockid_t value
CLOCK_THREAD_CPUTIME_ID, which represents the CPU-time clock of the
calling thread when invoking one of the clock_*() or timer_*()
functions. For these clock IDs, the values returned by clock_gettime()
and specified by clock_settime() shall represent the amount of
execution time of the thread associated with the clock.
These times mentioned are CPU processing times and not the time that has
passed since the startup of a process. Glibc currently provides its own
implementation of these two clocks which is designed to return the time
that passed since the startup of a process or a thread.
Moreover Glibc's clocks are bound to CPU timers which is problematic when the
frequency of the clock changes or the process is moved to a different
processor whose cpu timer may not be fully synchronized to the cpu timer
of the current CPU. This patchset results in a both clocks working reliably.
The patch also implements the access to other the thread and process clocks
of linux processes by using negative clockid's:
1. For CLOCK_PROCESS_CPUTIME_ID: -pid
2. For CLOCK_THREAD_CPUTIME_ID: -(pid + PID_MAX_LIMIT)
This allows
clock_getcpuclockid(pid) to return -pid
and
pthread_getcpuiclock(pid) to return -(pid + PID_MAX_LIMIT)
to allow access to the corresponding clocks.
Todo:
- The timer API to generate events by a non tick based timer is not
usable in its current state. The posix timer API seems to be only
useful at this point to define clock_get/set. Need to revise this.
- Implement timed interrupts in mmtimer after API is revised.
The mmtimer patch is unchanged from V6 and stays as is in 2.6.9-rc3-mm2.
But I expect to update the driver as soon as the interface to setup hardware
timer interrupts is usable.
Frank Hirtz [Wed, 20 Oct 2004 01:31:04 +0000 (18:31 -0700)]
[PATCH] Display committed memory limit and available in meminfo
The following patch will have the committed memory limit (per the current
overcommit ratio) and the amount of memory remaining under this limit
displayed in meminfo.
It's presently somewhat difficult to use the strict memory overcommit
settings as it's somewhat difficult to determine the amount of memory
remaining under the cap. This patch would make using strict overcommit a
good bit simpler.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
I have received positive feedback from various individuals who have applied my
BSD Secure Levels LSM patch, and so at this point I am submitting it to you
with a request to merge it in. Nothing has changed in this patch since when I
last posted it to the LKML, so I am not re-sending it there.
This first patch adds hooks to catch attempts to set the system clock back.
Signed-off-by: Michael A. Halcrow <mahalcro@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Roland McGrath [Wed, 20 Oct 2004 01:30:01 +0000 (18:30 -0700)]
[PATCH] move struct k_itimer out of linux/sched.h
I don't know why struct k_itimer was ever declared in sched.h; perhaps at
one time it was referenced by something else there. There is no need for
it now. This patch moves the struct where it belongs, in
linux/posix-timers.h. It has zero effect on anything except keeping the
source easier to read.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[PATCH] vm: convert users of remap_page_range() under sound/ to use remap_pfn_range()
This patch converts all users of remap_page_range() under sound/ to use
remap_pfn_range(), with the exception of maestro3 changelogs, which are likely
expected to be preserved intact apart from additions (as most changelogs are),
regardless of API changes.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[PATCH] vm: convert users of remap_page_range() under include/asm-*/ to use remap_pfn_range()
This patch converts uses of remap_page_range() via io_remap_page_range() in
include/asm-*/ to use remap_pfn_range(). io_remap_page_range() has a similar
physical address overflow issue that needs to be addressed later.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[PATCH] vm: introduce remap_pfn_range() to replace remap_page_range()
This patch introduces remap_pfn_range(), destined to replace
remap_page_range(), to which all callers of remap_page_range() are converted
in the sequel.
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Neil Brown [Wed, 20 Oct 2004 01:27:48 +0000 (18:27 -0700)]
[PATCH] nfsd4: move code to truncate on open to separate function
for OPEN with O_TRUNC, if the truncate fails, the open fails. for
nfs4_open_upgrade, this means undo the get_write_access. for new OPENs, this
means release the newly created stateid.
Signed-off-by: Andy Adamson <andros@citi.umich.edu> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Neil Brown [Wed, 20 Oct 2004 01:27:34 +0000 (18:27 -0700)]
[PATCH] nfsd4: fix putrootfh return
Thanks to Al Viro for noticing that putrootfh could return either a linux or
an nfs error.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Neil Brown [Wed, 20 Oct 2004 01:27:19 +0000 (18:27 -0700)]
[PATCH] nfsd: clean up nfsd4_process_open2
Comments, dprintk cleanup
Signed-off-by: Andy Adamson <andros@citi.umich.edu> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Neil Brown [Wed, 20 Oct 2004 01:27:05 +0000 (18:27 -0700)]
[PATCH] nfsd4: move some nfsd4_process_open2 code to nfs4_new_open
Move most of the code in the new_open case of nfsd4_process_open2 to
nfs4_new_open.
Signed-off-by: Andy Adamson <andros@umich.edu> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Neil Brown [Wed, 20 Oct 2004 01:26:49 +0000 (18:26 -0700)]
[PATCH] nfsd4: move open_upgrade code into a separate function
Move most of the code for the open_upgrade case into a separate
nfs4_upgrade_open.
Signed-off-by: Andy Adamson <andros@umich.edu> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Neil Brown [Wed, 20 Oct 2004 01:26:38 +0000 (18:26 -0700)]
[PATCH] nfsd4: reorganize "if" in nfsd4_process_open2 to make test clearer
Reorganize "if" in nfsd4_process_open2 to make test clearer; there was no real
reason to test for the negative here.
Signed-off-by: Andy Adamson <andros@umich.edu> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Neil Brown [Wed, 20 Oct 2004 01:26:23 +0000 (18:26 -0700)]
[PATCH] nfsd4: move seqid decrement on reclaim to separate function
Move seqid decrement on reclaim to separate function
Signed-off-by: Andy Adamson <andros@citi.umich.edu> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Neil Brown [Wed, 20 Oct 2004 01:26:11 +0000 (18:26 -0700)]
[PATCH] nfsd: set OPEN_RESULT_LOCKTYPE_POSIX in open()
We should set the OPEN_RESULT_LOCKTYPE_POSIX flag in the return to open, to
indicate that we support locking.
Signed-off-by: Andy Adamson <andros@citi.umich.edu> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Neil Brown [Wed, 20 Oct 2004 01:25:56 +0000 (18:25 -0700)]
[PATCH] nfsd4: move open owner checks from nfsd4_process_open2 into new function
nfsd4_process_open2 has become a bit long and contorted. The following
patches break nfsd4_process_open2 into smaller functions and add comments to
describe logic flow, in preparation for delegation state.
We begin by pulling out the code that searches for conflicting open owners
into a separate function.
Signed-off-by: Andy Adamson <andros@citi.umich.edu> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Neil Brown [Wed, 20 Oct 2004 01:25:41 +0000 (18:25 -0700)]
[PATCH] nfsd: remove incorrect stateid modification in nfsv4 open upgrade
When we upgrade an open, we keep the same stateid and bump only the seqid.
Signed-off-by: Andy Adamson <andros@umich.edu> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Neil Brown [Wed, 20 Oct 2004 01:25:26 +0000 (18:25 -0700)]
[PATCH] nfsd4: fix race in xdr encoding of lock_denied response.
We take a reference on the stateowner, and copy the clientid, instead of just
hoping no one destroys the stateowner before we reference it in
nfsd4_encode_lock_denied.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Neil Brown [Wed, 20 Oct 2004 01:25:12 +0000 (18:25 -0700)]
[PATCH] nfsd4: revert awkward extension of state lock over xdr for replay encoding
With the addition of a reference count, we no longer need the code that
conditionally extended the nfs4 state lock over the xdr encode stage.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>