]> Pileus Git - ~andy/linux/log
~andy/linux
15 years agoFS-Cache: Add netfs registration
David Howells [Fri, 3 Apr 2009 15:42:38 +0000 (16:42 +0100)]
FS-Cache: Add netfs registration

Add functions to register and unregister a network filesystem or other client
of the FS-Cache service.  This allocates and releases the cookie representing
the top-level index for a netfs, and makes it available to the netfs.

If the FS-Cache facility is disabled, then the calls are optimised away at
compile time.

Note that whilst this patch may appear to work with FS-Cache enabled and a
netfs attempting to use it, it will leak the cookie it allocates for the netfs
as fscache_relinquish_cookie() is implemented in a later patch.  This will
cause the slab code to emit a warning when the module is removed.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Steve Dickson <steved@redhat.com>
Acked-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Tested-by: Daire Byrne <Daire.Byrne@framestore.com>
15 years agoFS-Cache: Provide a slab for cookie allocation
David Howells [Fri, 3 Apr 2009 15:42:38 +0000 (16:42 +0100)]
FS-Cache: Provide a slab for cookie allocation

Provide a slab from which can be allocated the FS-Cache cookies that will be
presented to the netfs.

Also provide a slab constructor and a function to recursively discard a cookie
and its ancestor chain.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Steve Dickson <steved@redhat.com>
Acked-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Tested-by: Daire Byrne <Daire.Byrne@framestore.com>
15 years agoFS-Cache: Add cache management
David Howells [Fri, 3 Apr 2009 15:42:37 +0000 (16:42 +0100)]
FS-Cache: Add cache management

Implement the entry points by which a cache backend may initialise, add,
declare an error upon and withdraw a cache.

Further, an object is created in sysfs under which each cache added will get
an object created:

/sys/fs/fscache/<cachetag>/

All of this is described in Documentation/filesystems/caching/backend-api.txt
added by a previous patch.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Steve Dickson <steved@redhat.com>
Acked-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Tested-by: Daire Byrne <Daire.Byrne@framestore.com>
15 years agoFS-Cache: Add cache tag handling
David Howells [Fri, 3 Apr 2009 15:42:37 +0000 (16:42 +0100)]
FS-Cache: Add cache tag handling

Implement two features of FS-Cache:

 (1) The ability to request and release cache tags - names by which a cache may
     be known to a netfs, and thus selected for use.

 (2) An internal function by which a cache is selected by consulting the netfs,
     if the netfs wishes to be consulted.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Steve Dickson <steved@redhat.com>
Acked-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Tested-by: Daire Byrne <Daire.Byrne@framestore.com>
15 years agoFS-Cache: Root index definition
David Howells [Fri, 3 Apr 2009 15:42:37 +0000 (16:42 +0100)]
FS-Cache: Root index definition

Add a description of the root index of the cache for later patches to make use
of.

The root index is owned by FS-Cache itself.  When a netfs requests caching
facilities, FS-Cache will, if one doesn't already exist, create an entry in
the root index with the key being the name of the netfs ("AFS" for example),
and the auxiliary data holding the index structure version supplied by the
netfs:

     FSDEF
       |
 +-----------+
 |           |
NFS         AFS
       [v=1]       [v=1]

If an entry with the appropriate name does already exist, the version is
compared.  If the version is different, the entire subtree from that entry
will be discarded and a new entry created.

The new entry will be an index, and a cookie referring to it will be passed to
the netfs.  This is then the root handle by which the netfs accesses the
cache.  It can create whatever objects it likes in that index, including
further indices.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Steve Dickson <steved@redhat.com>
Acked-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Tested-by: Daire Byrne <Daire.Byrne@framestore.com>
15 years agoFS-Cache: Add use of /proc and presentation of statistics
David Howells [Fri, 3 Apr 2009 15:42:37 +0000 (16:42 +0100)]
FS-Cache: Add use of /proc and presentation of statistics

Make FS-Cache create its /proc interface and present various statistical
information through it.  Also provide the functions for updating this
information.

These features are enabled by:

CONFIG_FSCACHE_PROC
CONFIG_FSCACHE_STATS
CONFIG_FSCACHE_HISTOGRAM

The /proc directory for FS-Cache is also exported so that caching modules can
add their own statistics there too.

The FS-Cache module is loadable at this point, and the statistics files can be
examined by userspace:

cat /proc/fs/fscache/stats
cat /proc/fs/fscache/histogram

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Steve Dickson <steved@redhat.com>
Acked-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Tested-by: Daire Byrne <Daire.Byrne@framestore.com>
15 years agoFS-Cache: Add main configuration option, module entry points and debugging
David Howells [Fri, 3 Apr 2009 15:42:36 +0000 (16:42 +0100)]
FS-Cache: Add main configuration option, module entry points and debugging

Add the main configuration option, allowing FS-Cache to be selected; the
module entry and exit functions and the debugging stuff used by these patches.

The two configuration options added are:

CONFIG_FSCACHE
CONFIG_FSCACHE_DEBUG

The first enables the facility, and the second makes the debugging statements
enableable through the "debug" module parameter.  The value of this parameter
is a bitmask as described in:

Documentation/filesystems/caching/fscache.txt

The module can be loaded at this point, but all it will do at this point in
the patch series is to start up the slow work facility and shut it down again.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Steve Dickson <steved@redhat.com>
Acked-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Tested-by: Daire Byrne <Daire.Byrne@framestore.com>
15 years agoFS-Cache: Add the FS-Cache cache backend API and documentation
David Howells [Fri, 3 Apr 2009 15:42:36 +0000 (16:42 +0100)]
FS-Cache: Add the FS-Cache cache backend API and documentation

Add the API for a generic facility (FS-Cache) by which caches may declare them
selves open for business, and may obtain work to be done from network
filesystems.  The header file is included by:

#include <linux/fscache-cache.h>

Documentation for the API is also added to:

Documentation/filesystems/caching/backend-api.txt

This API is not usable without the implementation of the utility functions
which will be added in further patches.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Steve Dickson <steved@redhat.com>
Acked-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Tested-by: Daire Byrne <Daire.Byrne@framestore.com>
15 years agoFS-Cache: Add the FS-Cache netfs API and documentation
David Howells [Fri, 3 Apr 2009 15:42:36 +0000 (16:42 +0100)]
FS-Cache: Add the FS-Cache netfs API and documentation

Add the API for a generic facility (FS-Cache) by which filesystems (such as AFS
or NFS) may call on local caching capabilities without having to know anything
about how the cache works, or even if there is a cache:

+---------+
|         |                        +--------------+
|   NFS   |--+                     |              |
|         |  |                 +-->|   CacheFS    |
+---------+  |   +----------+  |   |  /dev/hda5   |
             |   |          |  |   +--------------+
+---------+  +-->|          |  |
|         |      |          |--+
|   AFS   |----->| FS-Cache |
|         |      |          |--+
+---------+  +-->|          |  |
             |   |          |  |   +--------------+
+---------+  |   +----------+  |   |              |
|         |  |                 +-->|  CacheFiles  |
|  ISOFS  |--+                     |  /var/cache  |
|         |                        +--------------+
+---------+

General documentation and documentation of the netfs specific API are provided
in addition to the header files.

As this patch stands, it is possible to build a filesystem against the facility
and attempt to use it.  All that will happen is that all requests will be
immediately denied as if no cache is present.

Further patches will implement the core of the facility.  The facility will
transfer requests from networking filesystems to appropriate caches if
possible, or else gracefully deny them.

If this facility is disabled in the kernel configuration, then all its
operations will trivially reduce to nothing during compilation.

WHY NOT I_MAPPING?
==================

I have added my own API to implement caching rather than using i_mapping to do
this for a number of reasons.  These have been discussed a lot on the LKML and
CacheFS mailing lists, but to summarise the basics:

 (1) Most filesystems don't do hole reportage.  Holes in files are treated as
     blocks of zeros and can't be distinguished otherwise, making it difficult
     to distinguish blocks that have been read from the network and cached from
     those that haven't.

 (2) The backing inode must be fully populated before being exposed to
     userspace through the main inode because the VM/VFS goes directly to the
     backing inode and does not interrogate the front inode's VM ops.

     Therefore:

     (a) The backing inode must fit entirely within the cache.

     (b) All backed files currently open must fit entirely within the cache at
       the same time.

     (c) A working set of files in total larger than the cache may not be
       cached.

     (d) A file may not grow larger than the available space in the cache.

     (e) A file that's open and cached, and remotely grows larger than the
       cache is potentially stuffed.

 (3) Writes go to the backing filesystem, and can only be transferred to the
     network when the file is closed.

 (4) There's no record of what changes have been made, so the whole file must
     be written back.

 (5) The pages belong to the backing filesystem, and all metadata associated
     with that page are relevant only to the backing filesystem, and not
     anything stacked atop it.

OVERVIEW
========

FS-Cache provides (or will provide) the following facilities:

 (1) Caches can be added / removed at any time, even whilst in use.

 (2) Adds a facility by which tags can be used to refer to caches, even if
     they're not available yet.

 (3) More than one cache can be used at once.  Caches can be selected
     explicitly by use of tags.

 (4) The netfs is provided with an interface that allows either party to
     withdraw caching facilities from a file (required for (1)).

 (5) A netfs may annotate cache objects that belongs to it.  This permits the
     storage of coherency maintenance data.

 (6) Cache objects will be pinnable and space reservations will be possible.

 (7) The interface to the netfs returns as few errors as possible, preferring
     rather to let the netfs remain oblivious.

 (8) Cookies are used to represent indices, files and other objects to the
     netfs.  The simplest cookie is just a NULL pointer - indicating nothing
     cached there.

 (9) The netfs is allowed to propose - dynamically - any index hierarchy it
     desires, though it must be aware that the index search function is
     recursive, stack space is limited, and indices can only be children of
     indices.

(10) Indices can be used to group files together to reduce key size and to make
     group invalidation easier.  The use of indices may make lookup quicker,
     but that's cache dependent.

(11) Data I/O is effectively done directly to and from the netfs's pages.  The
     netfs indicates that page A is at index B of the data-file represented by
     cookie C, and that it should be read or written.  The cache backend may or
     may not start I/O on that page, but if it does, a netfs callback will be
     invoked to indicate completion.  The I/O may be either synchronous or
     asynchronous.

(12) Cookies can be "retired" upon release.  At this point FS-Cache will mark
     them as obsolete and the index hierarchy rooted at that point will get
     recycled.

(13) The netfs provides a "match" function for index searches.  In addition to
     saying whether a match was made or not, this can also specify that an
     entry should be updated or deleted.

FS-Cache maintains a virtual index tree in which all indices, files, objects
and pages are kept.  Bits of this tree may actually reside in one or more
caches.

                                           FSDEF
                                             |
                        +------------------------------------+
                        |                                    |
                       NFS                                  AFS
                        |                                    |
           +--------------------------+                +-----------+
           |                          |                |           |
        homedir                     mirror          afs.org   redhat.com
           |                          |                            |
     +------------+           +---------------+              +----------+
     |            |           |               |              |          |
   00001        00002       00007           00125        vol00001   vol00002
     |            |           |               |                         |
 +---+---+     +-----+      +---+      +------+------+            +-----+----+
 |   |   |     |     |      |   |      |      |      |            |     |    |
PG0 PG1 PG2   PG0  XATTR   PG0 PG1   DIRENT DIRENT DIRENT        R/W   R/O  Bak
                     |                                            |
                    PG0                                       +-------+
                                                              |       |
                                                            00001   00003
                                                              |
                                                          +---+---+
                                                          |   |   |
                                                         PG0 PG1 PG2

In the example above, two netfs's can be seen to be backed: NFS and AFS.  These
have different index hierarchies:

 (*) The NFS primary index will probably contain per-server indices.  Each
     server index is indexed by NFS file handles to get data file objects.
     Each data file objects can have an array of pages, but may also have
     further child objects, such as extended attributes and directory entries.
     Extended attribute objects themselves have page-array contents.

 (*) The AFS primary index contains per-cell indices.  Each cell index contains
     per-logical-volume indices.  Each of volume index contains up to three
     indices for the read-write, read-only and backup mirrors of those volumes.
     Each of these contains vnode data file objects, each of which contains an
     array of pages.

The very top index is the FS-Cache master index in which individual netfs's
have entries.

Any index object may reside in more than one cache, provided it only has index
children.  Any index with non-index object children will be assumed to only
reside in one cache.

The FS-Cache overview can be found in:

Documentation/filesystems/caching/fscache.txt

The netfs API to FS-Cache can be found in:

Documentation/filesystems/caching/netfs-api.txt

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Steve Dickson <steved@redhat.com>
Acked-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Tested-by: Daire Byrne <Daire.Byrne@framestore.com>
15 years agoFS-Cache: Recruit a page flags for cache management
David Howells [Fri, 3 Apr 2009 15:42:36 +0000 (16:42 +0100)]
FS-Cache: Recruit a page flags for cache management

Recruit a page flag to aid in cache management.  The following extra flag is
defined:

 (1) PG_fscache (PG_private_2)

     The marked page is backed by a local cache and is pinning resources in the
     cache driver.

If PG_fscache is set, then things that checked for PG_private will now also
check for that.  This includes things like truncation and page invalidation.
The function page_has_private() had been added to make the checks for both
PG_private and PG_private_2 at the same time.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Steve Dickson <steved@redhat.com>
Acked-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Acked-by: Rik van Riel <riel@redhat.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Tested-by: Daire Byrne <Daire.Byrne@framestore.com>
15 years agoFS-Cache: Release page->private after failed readahead
David Howells [Fri, 3 Apr 2009 15:42:35 +0000 (16:42 +0100)]
FS-Cache: Release page->private after failed readahead

The attached patch causes read_cache_pages() to release page-private data on a
page for which add_to_page_cache() fails.  If the filler function fails, then
the problematic page is left attached to the pagecache (with appropriate flags
set, one presumes) and the remaining to-be-attached pages are invalidated and
discarded.  This permits pages with caching references associated with them to
be cleaned up.

The invalidatepage() address space op is called (indirectly) to do the honours.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Steve Dickson <steved@redhat.com>
Acked-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Acked-by: Rik van Riel <riel@redhat.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Tested-by: Daire Byrne <Daire.Byrne@framestore.com>
15 years agoDocument the slow work thread pool
David Howells [Fri, 3 Apr 2009 15:42:35 +0000 (16:42 +0100)]
Document the slow work thread pool

Document the slow work thread pool.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Steve Dickson <steved@redhat.com>
Acked-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Tested-by: Daire Byrne <Daire.Byrne@framestore.com>
15 years agoMake the slow work pool configurable
David Howells [Fri, 3 Apr 2009 15:42:35 +0000 (16:42 +0100)]
Make the slow work pool configurable

Make the slow work pool configurable through /proc/sys/kernel/slow-work.

 (*) /proc/sys/kernel/slow-work/min-threads

     The minimum number of threads that should be in the pool as long as it is
     in use.  This may be anywhere between 2 and max-threads.

 (*) /proc/sys/kernel/slow-work/max-threads

     The maximum number of threads that should in the pool.  This may be
     anywhere between min-threads and 255 or NR_CPUS * 2, whichever is greater.

 (*) /proc/sys/kernel/slow-work/vslow-percentage

     The percentage of active threads in the pool that may be used to execute
     very slow work items.  This may be between 1 and 99.  The resultant number
     is bounded to between 1 and one fewer than the number of active threads.
     This ensures there is always at least one thread that can process very
     slow work items, and always at least one thread that won't.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Acked-by: Steve Dickson <steved@redhat.com>
Acked-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Tested-by: Daire Byrne <Daire.Byrne@framestore.com>
15 years agoMake slow-work thread pool actually dynamic
David Howells [Fri, 3 Apr 2009 15:42:35 +0000 (16:42 +0100)]
Make slow-work thread pool actually dynamic

Make the slow-work thread pool actually dynamic in the number of threads it
contains.  With this patch, it will both create additional threads when it has
extra work to do, and cull excess threads that aren't doing anything.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Acked-by: Steve Dickson <steved@redhat.com>
Acked-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Tested-by: Daire Byrne <Daire.Byrne@framestore.com>
15 years agoCreate a dynamically sized pool of threads for doing very slow work items
David Howells [Fri, 3 Apr 2009 15:42:35 +0000 (16:42 +0100)]
Create a dynamically sized pool of threads for doing very slow work items

Create a dynamically sized pool of threads for doing very slow work items, such
as invoking mkdir() or rmdir() - things that may take a long time and may
sleep, holding mutexes/semaphores and hogging a thread, and are thus unsuitable
for workqueues.

The number of threads is always at least a settable minimum, but more are
started when there's more work to do, up to a limit.  Because of the nature of
the load, it's not suitable for a 1-thread-per-CPU type pool.  A system with
one CPU may well want several threads.

This is used by FS-Cache to do slow caching operations in the background, such
as looking up, creating or deleting cache objects.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Acked-by: Steve Dickson <steved@redhat.com>
Acked-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Tested-by: Daire Byrne <Daire.Byrne@framestore.com>
15 years agoMerge branch 'dma-debug' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/linux...
Ingo Molnar [Fri, 3 Apr 2009 14:35:09 +0000 (16:35 +0200)]
Merge branch 'dma-debug' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/linux-2.6-iommu into x86/urgent

15 years agox86, setup: compile with -DDISABLE_BRANCH_PROFILING
H. Peter Anvin [Thu, 2 Apr 2009 00:35:00 +0000 (17:35 -0700)]
x86, setup: compile with -DDISABLE_BRANCH_PROFILING

Impact: code size reduction (possibly critical)

The x86 boot and decompression code has no use of the branch profiling
constructs, so disable them.  This would bloat the setup code by as
much as 14K, eating up a fairly large chunk of the 32K area we are
guaranteed to have.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86/dma: unify definition of pci_unmap_addr* and pci_unmap_len macros
Joerg Roedel [Thu, 2 Apr 2009 13:55:55 +0000 (15:55 +0200)]
x86/dma: unify definition of pci_unmap_addr* and pci_unmap_len macros

Impact: unification of pci-dma macros and pci_32.h removal

This patch unifies the definition of the pci_unmap_addr*, pci_unmap_len*
and DECLARE_PCI_UNMAP* macros. This makes sense because the pci_unmap
functions are no longer no-ops anymore when the kernel runs with
CONFIG_DMA_API_DEBUG. Without an iommu or DMA_API_DEBUG it is a no-op on 32 bit
because the dma mapping path returns a physical address and therefore the
dma-api implementation has no internal state which needs to be destroyed with
an unmap call.
This unification also simplifies the port of x86_64 iommu drivers to 32 bit x86
and let us get rid of pci_32.h.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
15 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux...
Chris Zankel [Fri, 3 Apr 2009 09:29:05 +0000 (02:29 -0700)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into merge

15 years agoxtensa: we don't need to include asm/io.h
Chris Zankel [Thu, 2 Apr 2009 23:56:49 +0000 (16:56 -0700)]
xtensa: we don't need to include asm/io.h

Remove include statement to include asm/io.h.

Signed-off-by: Chris Zankel <chris@zankel.net>
15 years agoxtensa: only build platform or variant if they contain a Makefile
Chris Zankel [Thu, 2 Apr 2009 23:58:53 +0000 (16:58 -0700)]
xtensa: only build platform or variant if they contain a Makefile

We only add the platform or variant directory to core-y if it
contains a Makefile. Consequently, we can remove the Makefiles
for the dc232b and fsf processor variants.

Signed-off-by: Chris Zankel <chris@zankel.net>
15 years agoxtensa: make startup code discardable
Daniel Glöckner [Wed, 11 Mar 2009 13:15:11 +0000 (14:15 +0100)]
xtensa: make startup code discardable

Move it from .text to .init.text to get rid of it after boot and
prevent illegal section references.

Signed-off-by: Daniel Glöckner <dg@emlix.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
15 years agoxtensa: ccount clocksource
Johannes Weiner [Wed, 4 Mar 2009 20:39:12 +0000 (21:39 +0100)]
xtensa: ccount clocksource

Switch to GENERIC_TIME by using the ccount register as a clock source.

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Chris Zankel <chris@zankel.net>
15 years agoxtensa: remove platform rtc hooks
Johannes Weiner [Wed, 4 Mar 2009 20:39:12 +0000 (21:39 +0100)]
xtensa: remove platform rtc hooks

platform_get/set_rtc_time() is not implemented by any of the supported
xtensa platforms.  Remove the facility completely.

The initial seconds for xtime come from read_persistent_clock() which
returns just 0 in the generic implementation.  Platforms that sport a
persistent clock can implement this function.

This is needed to implement the ccount as a clock source.

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Chris Zankel <chris@zankel.net>
15 years agoxtensa: use generic sched_clock()
Johannes Weiner [Wed, 4 Mar 2009 20:39:12 +0000 (21:39 +0100)]
xtensa: use generic sched_clock()

Current xtensa implementation of sched_clock() is the same as the
generic one.  Just remove it, the weak symbol in kernel/sched_clock.c
will be used instead.

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Chris Zankel <chris@zankel.net>
15 years agoxtensa: platform: s6105
Johannes Weiner [Wed, 4 Mar 2009 15:21:33 +0000 (16:21 +0100)]
xtensa: platform: s6105

Support for the S6105 IP Camera Reference Design Kit.

Signed-off-by: Johannes Weiner <jw@emlix.com>
Signed-off-by: Oskar Schirmer <os@emlix.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
15 years agoxtensa: let platform override KERNELOFFSET
Johannes Weiner [Wed, 4 Mar 2009 15:21:32 +0000 (16:21 +0100)]
xtensa: let platform override KERNELOFFSET

The linker script should not assume a fix offset in memory for the
kernel, this is platform-specific, so let the platform set it.

Signed-off-by: Johannes Weiner <jw@emlix.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
15 years agoxtensa: s6000 variant
Johannes Weiner [Wed, 4 Mar 2009 15:21:32 +0000 (16:21 +0100)]
xtensa: s6000 variant

Support for the Stretch S6000 Xtensa core variant.

Signed-off-by: Johannes Weiner <jw@emlix.com>
Signed-off-by: Oskar Schirmer <os@emlix.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
15 years agoxtensa: s6000 variant core definitions
Johannes Weiner [Wed, 4 Mar 2009 15:21:32 +0000 (16:21 +0100)]
xtensa: s6000 variant core definitions

S6000 core configuration files from Tensilica.

Signed-off-by: Johannes Weiner <jw@emlix.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
15 years agoxtensa: variant irq set callbacks
Johannes Weiner [Wed, 4 Mar 2009 15:21:31 +0000 (16:21 +0100)]
xtensa: variant irq set callbacks

Allow the core variant code to provide irq enable/disable callbacks.

Signed-off-by: Johannes Weiner <jw@emlix.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
15 years agoxtensa: variant-specific code
Johannes Weiner [Wed, 4 Mar 2009 15:21:31 +0000 (16:21 +0100)]
xtensa: variant-specific code

Allow the variant to provide real code.  Add empty dummy Makefiles for
the existing variants.

Signed-off-by: Johannes Weiner <jw@emlix.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
15 years agoxtensa: nommu support
Johannes Weiner [Wed, 4 Mar 2009 15:21:31 +0000 (16:21 +0100)]
xtensa: nommu support

Add support for !CONFIG_MMU setups.

Signed-off-by: Johannes Weiner <jw@emlix.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
15 years agoxtensa: add flat support
Oskar Schirmer [Wed, 4 Mar 2009 15:21:30 +0000 (16:21 +0100)]
xtensa: add flat support

Add the arch-specific header for flat support on xtensa in preparation
for the Xtensa S6000 nommu port.

Signed-off-by: Oskar Schirmer <os@emlix.com>
Signed-off-by: Johannes Weiner <jw@emlix.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
15 years agoxtensa: enforce slab alignment to maximum register width
Oskar Schirmer [Wed, 4 Mar 2009 15:21:30 +0000 (16:21 +0100)]
xtensa: enforce slab alignment to maximum register width

XCHAL_DATA_WIDTH is the maximum register width, slab caches should be
aligned to this.

Theoretical fix as all variants have had an XCHAL_DATA_WIDTH of 4
(wordsize) for now.  But the S6000 variant will raise this to 16.

Signed-off-by: Oskar Schirmer <os@emlix.com>
Signed-off-by: Johannes Weiner <jw@emlix.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
15 years agoxtensa: cope with ram beginning at higher addresses
Johannes Weiner [Wed, 4 Mar 2009 15:21:30 +0000 (16:21 +0100)]
xtensa: cope with ram beginning at higher addresses

The current assumption of the memory code is that the first RAM PFN in
the system is 0.

Adjust the relevant code to play well with setups where memory starts
at higher addresses, indicated by PLATFORM_DEFAULT_MEM_START.

The new memory model looks like this:

+----------+--+----------------------+----------------+
|          |  |                      |                |
|          |  |         RAM          |                |
|          |  |                      |                |
+----------+--+----------------------+----------------+
|          |  |                      |                |
+- PFN 0   |  +- min_low_pfn         +- max_low_pfn   +- max_pfn
           |
           +- ARCH_PFN_OFFSET
           +- PLATFORM_DEFAULT_MEM_START >> PAGE_SIZE

The memory map contains pages starting from pfn ARCH_PFN_OFFSET up to
max_low_pfn.  The only zone used right now will span exactly the same
region.

Usually, ARCH_PFN_OFFSET and min_low_pfn are the same value.  Handle
them separately for robustness.  Gapping pages will be in the memory
map but marked as reserved and won't be touched.

Signed-off-by: Johannes Weiner <jw@emlix.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
15 years agoxtensa: don't make bootmem bitmap larger than required
Johannes Weiner [Wed, 4 Mar 2009 15:21:29 +0000 (16:21 +0100)]
xtensa: don't make bootmem bitmap larger than required

If min_low_pfn is non-zero, the bitmap reserved for bootmem is bigger
than needed.  The number of pages bootmem has to maintain is the range
from min_low_pfn to max_low_pfn.

For now it has only been a theoretical mistake, min_low_pfn was always
zero.

Signed-off-by: Johannes Weiner <jw@emlix.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
15 years agoxtensa: fix init_bootmem_node() argument order
Johannes Weiner [Wed, 4 Mar 2009 15:21:29 +0000 (16:21 +0100)]
xtensa: fix init_bootmem_node() argument order

The second argument to init_bootmem_node() is the PFN to place the
bootmem bitmap at and the third argument is the first PFN on the node.

This is currently backwards but never made any problems as both values
were always zero.

Signed-off-by: Johannes Weiner <jw@emlix.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
15 years agoxtensa: use correct stack pointer for stack traces
Johannes Weiner [Wed, 4 Mar 2009 15:21:29 +0000 (16:21 +0100)]
xtensa: use correct stack pointer for stack traces

Right now, the xtensa stacktrace code reads the _current_ kernel stack
pointer if nothing is supplied.  With debugging facilities like sysrq
this means that the backtrace of the sysrq-handler is printed instead
of a trace of the given task's stack.

When no stack pointer is specified in show_trace() and show_stack(),
use the stack pointer that comes with the handed in task descriptor to
make stack traces more useful.

Signed-off-by: Johannes Weiner <jw@emlix.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
15 years agoxtensa: beat Kconfig into shape
Johannes Weiner [Wed, 4 Mar 2009 15:21:28 +0000 (16:21 +0100)]
xtensa: beat Kconfig into shape

Instead of making support code depend on variants or platforms, the
latter should select what they need explicitely.

Otherwise this starts looking weird when support code depends on
!XTENSA_PLATFORM_FOO && !XTENSA_PLATFORM_BAR etc.

This also includes some minor fixlets like converting bool and default
to def_bool and fixing indentation and whitespace errors.

Signed-off-by: Johannes Weiner <jw@emlix.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
15 years agoxtensa: remove redefinition of XCHAL_MMU_ASID_BITS
Johannes Weiner [Wed, 4 Mar 2009 15:21:28 +0000 (16:21 +0100)]
xtensa: remove redefinition of XCHAL_MMU_ASID_BITS

This constant is defined in all core headers.  Remove the redundant
definition which might error out if other includes lead to inclusion
of <variant/core.h>.

Signed-off-by: Johannes Weiner <jw@emlix.com>
Signed-off-by: Chris Zankel <chris@zankel.net>
15 years agoext3: Add replace-on-rename hueristics for data=writeback mode
Theodore Ts'o [Fri, 3 Apr 2009 05:34:49 +0000 (01:34 -0400)]
ext3: Add replace-on-rename hueristics for data=writeback mode

In data=writeback mode, start an asynchronous flush when renaming a
file on top of an already-existing file.  This lowers the probability
of data loss in the case of applications that attempt to replace a
file via using rename().

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoext3: Add replace-on-truncate hueristics for data=writeback mode
Theodore Ts'o [Fri, 3 Apr 2009 05:34:35 +0000 (01:34 -0400)]
ext3: Add replace-on-truncate hueristics for data=writeback mode

In data=writeback mode, start an asynchronous flush when closing a
file which had been previously truncated down to zero.  This lowers
the probability of data loss in the case of applications that attempt
to replace a file using truncate.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
Linus Torvalds [Fri, 3 Apr 2009 04:09:10 +0000 (21:09 -0700)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
  Remove two unneeded exports and make two symbols static in fs/mpage.c
  Cleanup after commit 585d3bc06f4ca57f975a5a1f698f65a45ea66225
  Trim includes of fdtable.h
  Don't crap into descriptor table in binfmt_som
  Trim includes in binfmt_elf
  Don't mess with descriptor table in load_elf_binary()
  Get rid of indirect include of fs_struct.h
  New helper - current_umask()
  check_unsafe_exec() doesn't care about signal handlers sharing
  New locking/refcounting for fs_struct
  Take fs_struct handling to new file (fs/fs_struct.c)
  Get rid of bumping fs_struct refcount in pivot_root(2)
  Kill unsharing fs_struct in __set_personality()

15 years agoMerge branch 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
Linus Torvalds [Fri, 3 Apr 2009 04:06:42 +0000 (21:06 -0700)]
Merge branch 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6

* 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: (21 commits)
  drm/radeon: load the right microcode on rs780
  drm: remove unused "can_grow" parameter from drm_crtc_helper_initial_config
  drm: fix EDID backward compat check
  drm: sync the mode validation for INTERLACE/DBLSCAN
  drm: fix typo in edid vendor parsing.
  DRM: drm_crtc_helper.h doesn't actually need i2c.h
  drm: fix missing inline function on 32-bit powerpc.
  drm: Use pgprot_writecombine in GEM GTT mapping to get the right bits for !PAT.
  drm/i915: Add a spinlock to protect the active_list
  drm/i915: Fix SDVO TV support
  drm/i915: Fix SDVO CREATE_PREFERRED_INPUT_TIMING command
  drm/i915: Fix error in SDVO DTD and modeline convert
  drm/i915: Fix SDVO command debug function
  drm/i915: fix TV mode setting in property change
  drm/i915: only set TV mode when any property changed
  drm/i915: clean up udelay usage
  drm/i915: add VGA hotplug support for 945+
  drm/i915: correctly set IGD device's gtt size for KMS.
  drm/i915: avoid hanging on to a stale pointer to raw_edid.
  drm/i915: check for -EINVAL from vm_insert_pfn
  ...

15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Linus Torvalds [Fri, 3 Apr 2009 04:05:30 +0000 (21:05 -0700)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (54 commits)
  glge: remove unused #include <version.h>
  dnet: remove unused #include <version.h>
  tcp: miscounts due to tcp_fragment pcount reset
  tcp: add helper for counter tweaking due mid-wq change
  hso: fix for the 'invalid frame length' messages
  hso: fix for crash when unplugging the device
  fsl_pq_mdio: Fix compile failure
  fsl_pq_mdio: Revive UCC MDIO support
  ucc_geth: Pass proper device to DMA routines, otherwise oops happens
  i.MX31: Fixing cs89x0 network building to i.MX31ADS
  tc35815: Fix build error if NAPI enabled
  hso: add Vendor/Product ID's for new devices
  ucc_geth: Remove unused header
  gianfar: Remove unused header
  kaweth: Fix locking to be SMP-safe
  net: allow multiple dev per napi with GRO
  r8169: reset IntrStatus after chip reset
  ixgbe: Fix potential memory leak/driver panic issue while setting up Tx & Rx ring parameters
  ixgbe: fix ethtool -A|a behavior
  ixgbe: Patch to fix driver panic while freeing up tx & rx resources
  ...

15 years agocpumask: fix slab corruption caused by alloc_cpumask_var_node()
Jack Steiner [Thu, 2 Apr 2009 23:59:48 +0000 (16:59 -0700)]
cpumask: fix slab corruption caused by alloc_cpumask_var_node()

Fix slab corruption caused by alloc_cpumask_var_node() overwriting the
tail end of an off-stack cpumask.

The function zeros out cpumask bits beyond the last possible cpu.  The
starting point for zeroing should be the beginning of the mask offset by a
byte count derived from the number of possible cpus.  The offset was
calculated in bits instead of bytes.  This resulted in overwriting the end
of the cpumask.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Acked-by: Mike Travis <travis.sgi.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: <stable@kernel.org> [2.6.29.x]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoia64: implement interrupt-enabling rwlocks
Robin Holt [Thu, 2 Apr 2009 23:59:47 +0000 (16:59 -0700)]
ia64: implement interrupt-enabling rwlocks

Implement __raw_read_lock_flags and __raw_write_lock_flags for the ia64
architecture.

[kosaki.motohiro@jp.fujitsu.com: typo fix]
Signed-off-by: Petr Tesarik <ptesarik@suse.cz>
Signed-off-by: Robin Holt <holt@sgi.com>
Cc: <linux-arch@vger.kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoAllow rwlocks to re-enable interrupts
Robin Holt [Thu, 2 Apr 2009 23:59:46 +0000 (16:59 -0700)]
Allow rwlocks to re-enable interrupts

Pass the original flags to rwlock arch-code, so that it can re-enable
interrupts if implemented for that architecture.

Initially, make __raw_read_lock_flags and __raw_write_lock_flags stubs
which just do the same thing as non-flags variants.

Signed-off-by: Petr Tesarik <ptesarik@suse.cz>
Signed-off-by: Robin Holt <holt@sgi.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: <linux-arch@vger.kernel.org>
Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: "Luck, Tony" <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoFactor out #ifdefs from kernel/spinlock.c to LOCK_CONTENDED_FLAGS
Robin Holt [Thu, 2 Apr 2009 23:59:45 +0000 (16:59 -0700)]
Factor out #ifdefs from kernel/spinlock.c to LOCK_CONTENDED_FLAGS

SGI has observed that on large systems, interrupts are not serviced for a
long period of time when waiting for a rwlock.  The following patch series
re-enables irqs while waiting for the lock, resembling the code which is
already there for spinlocks.

I only made the ia64 version, because the patch adds some overhead to the
fast path.  I assume there is currently no demand to have this for other
architectures, because the systems are not so large.  Of course, the
possibility to implement raw_{read|write}_lock_flags for any architecture
is still there.

This patch:

The new macro LOCK_CONTENDED_FLAGS expands to the correct implementation
depending on the config options, so that IRQ's are re-enabled when
possible, but they remain disabled if CONFIG_LOCKDEP is set.

Signed-off-by: Petr Tesarik <ptesarik@suse.cz>
Signed-off-by: Robin Holt <holt@sgi.com>
Cc: <linux-arch@vger.kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: "Luck, Tony" <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agofs/ufs: return f_fsid for statfs(2)
Coly Li [Thu, 2 Apr 2009 23:59:44 +0000 (16:59 -0700)]
fs/ufs: return f_fsid for statfs(2)

Make ufs return f_fsid info for statfs(2).

Signed-off-by: Coly Li <coly.li@suse.de>
Cc: Evgeniy Dushistov <dushistov@mail.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agofs/sysv: return f_fsid for statfs(2)
Coly Li [Thu, 2 Apr 2009 23:59:43 +0000 (16:59 -0700)]
fs/sysv: return f_fsid for statfs(2)

Make sysv file system return f_fsid info for statfs(2).

Signed-off-by: Coly Li <coly.li@suse.de>
Cc: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agofs/squashfs: return f_fsid for statfs(2)
Coly Li [Thu, 2 Apr 2009 23:59:42 +0000 (16:59 -0700)]
fs/squashfs: return f_fsid for statfs(2)

Make squashfs return f_fsid info for statfs(2).

Signed-off-by: Coly Li <coly.li@suse.de>
Cc: Phillip Lougher <phillip@lougher.demon.co.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agofs/reiserfs: return f_fsid for statfs(2)
Coly Li [Thu, 2 Apr 2009 23:59:41 +0000 (16:59 -0700)]
fs/reiserfs: return f_fsid for statfs(2)

Make reiserfs3 return f_fsid info for statfs(2).  By Andreas' suggestion,
this patch populates a persistent f_fsid between boots/mounts with help of
on-disk uuid record.

Randy Dunlap reported a compiling error from v2 patch like:
    fs/built-in.o: In function `reiserfs_statfs':
    super.c:(.text+0x7332b): undefined reference to `crc32_le'
    super.c:(.text+0x7333f): undefined reference to `crc32_le'
Also he provided helpful solution to fix this error. The modification of v3
patch is based on Randy's suggestion, add 'select CRC32' in fs/reiserfs/Kconfig.

Signed-off-by: Coly Li <coly.li@suse.de>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agofs/qnx4: return f_fsid for statfs(2)
Coly Li [Thu, 2 Apr 2009 23:59:40 +0000 (16:59 -0700)]
fs/qnx4: return f_fsid for statfs(2)

Make qnx4 file system return f_fsid info for statfs(2).

Signed-off-by: Coly Li <coly.li@suse.de>
Acked-by: Anders Larsen <al@alarsen.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agofs/omfs: return f_fsid for statfs(2)
Coly Li [Thu, 2 Apr 2009 23:59:39 +0000 (16:59 -0700)]
fs/omfs: return f_fsid for statfs(2)

Make omfs return f_fsid info for statfs(2).

Signed-off-by: Coly Li <coly.li@suse.de>
Acked-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agofs/minix: return f_fsid for statfs(2)
Coly Li [Thu, 2 Apr 2009 23:59:39 +0000 (16:59 -0700)]
fs/minix: return f_fsid for statfs(2)

Make minix file system return f_fsid info for statfs(2).

Signed-off-by: Coly Li <coly.li@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agofs/isofs: return f_fsid for statfs(2)
Coly Li [Thu, 2 Apr 2009 23:59:38 +0000 (16:59 -0700)]
fs/isofs: return f_fsid for statfs(2)

Make isofs return f_fsid info for statfs(2).

Signed-off-by: Coly Li <coly.li@suse.de>
Cc: Jan Kara <jack@ucw.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agofs/hpfs: return f_fsid for statfs(2)
Coly Li [Thu, 2 Apr 2009 23:59:37 +0000 (16:59 -0700)]
fs/hpfs: return f_fsid for statfs(2)

Make hpfs return f_fsid info for statfs(2).

Signed-off-by: Coly Li <coly.li@suse.de>
Cc: Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agofs/hfsplus: return f_fsid for statfs(2)
Coly Li [Thu, 2 Apr 2009 23:59:36 +0000 (16:59 -0700)]
fs/hfsplus: return f_fsid for statfs(2)

Make hfsplus return f_fsid info for statfs(2).

Signed-off-by: Coly Li <coly.li@suse.de>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agofs/hfs: return f_fsid for statfs(2)
Coly Li [Thu, 2 Apr 2009 23:59:35 +0000 (16:59 -0700)]
fs/hfs: return f_fsid for statfs(2)

Make hfs return f_fsid info for statfs(2).

Signed-off-by: Coly Li <coly.li@suse.de>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agofs/fat: return f_fsid for statfs(2)
Coly Li [Thu, 2 Apr 2009 23:59:35 +0000 (16:59 -0700)]
fs/fat: return f_fsid for statfs(2)

Make fat return f_fsid info for statfs(2).

Signed-off-by: Coly Li <coly.li@suse.de>
Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agofs/efs: return f_fsid for statfs(2)
Coly Li [Thu, 2 Apr 2009 23:59:34 +0000 (16:59 -0700)]
fs/efs: return f_fsid for statfs(2)

Make efs return f_fsid info for statfs(2), and do a little variable
renaming in efs_statfs().

Signed-off-by: Coly Li <coly.li@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agofs/cramfs: return f_fsid for statfs(2)
Coly Li [Thu, 2 Apr 2009 23:59:33 +0000 (16:59 -0700)]
fs/cramfs: return f_fsid for statfs(2)

Make cramfs return f_fsid info for statfs(2).

Signed-off-by: Coly Li <coly.li@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agofs/befs: return f_fsid for statfs(2)
Coly Li [Thu, 2 Apr 2009 23:59:32 +0000 (16:59 -0700)]
fs/befs: return f_fsid for statfs(2)

Make befs return f_fsid info for statfs(2).

Signed-off-by: Coly Li <coly.li@suse.de>
Cc: Sergey S. Kostyliov <rathamahata@php4.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agofs/affs: return f_fsid for statfs(2)
Coly Li [Thu, 2 Apr 2009 23:59:32 +0000 (16:59 -0700)]
fs/affs: return f_fsid for statfs(2)

Make affs return f_fsid info for statfs(2).

Signed-off-by: Coly Li <coly.li@suse.de>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agofs/adfs: return f_fsid for statfs(2)
Coly Li [Thu, 2 Apr 2009 23:59:27 +0000 (16:59 -0700)]
fs/adfs: return f_fsid for statfs(2)

Currently many file systems in Linux kernel do not return f_fsid in statfs
info, the value is set as 0 in vfs layer.  Anyway, in some conditions,
f_fsid from statfs(2) is useful, especially being used as (f_fsid, ino)
pair to uniquely identify a file.

Basic idea of the patches is generating a unique fs ID by
huge_encode_dev(sb->s_bdev->bd_dev) during file system mounting life time
(no endian consistent issue).  sb is a point of struct super_block of
current mounted file system being accessed by statfs(2).

This patch:

Make adfs return f_fsid info for statfs(2), and do a little variable
renaming in adfs_statfs().

Signed-off-by: Coly Li <coly.li@suse.de>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: "Sergey S. Kostyliov" <rathamahata@php4.ru>
Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>
Cc: Dave Kleikamp <shaggy@austin.ibm.com>
Cc: Bob Copeland <me@bobcopeland.com>
Cc: Anders Larsen <al@alarsen.net>
Cc: Phillip Lougher <phillip@lougher.demon.co.uk>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Evgeniy Dushistov <dushistov@mail.ru>
Cc: Jan Kara <jack@suse.cz>
Cc: Andreas Dilger <adilger@sun.com>
Cc: Jamie Lokier <jamie@shareable.org>
Cc: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agopreadv/pwritev: switch compat readv/preadv/writev/pwritev from fget to fget_light
Gerd Hoffmann [Thu, 2 Apr 2009 23:59:25 +0000 (16:59 -0700)]
preadv/pwritev: switch compat readv/preadv/writev/pwritev from fget to fget_light

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: <linux-api@vger.kernel.org>
Cc: <linux-arch@vger.kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agopreadv/pwritev: MIPS: Add preadv(2) and pwritev(2) syscalls.
Ralf Baechle [Thu, 2 Apr 2009 23:59:24 +0000 (16:59 -0700)]
preadv/pwritev: MIPS: Add preadv(2) and pwritev(2) syscalls.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: <linux-api@vger.kernel.org>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agopreadv/pwritev: Add preadv and pwritev system calls.
Gerd Hoffmann [Thu, 2 Apr 2009 23:59:23 +0000 (16:59 -0700)]
preadv/pwritev: Add preadv and pwritev system calls.

This patch adds preadv and pwritev system calls.  These syscalls are a
pretty straightforward combination of pread and readv (same for write).
They are quite useful for doing vectored I/O in threaded applications.
Using lseek+readv instead opens race windows you'll have to plug with
locking.

Other systems have such system calls too, for example NetBSD, check
here: http://www.daemon-systems.org/man/preadv.2.html

The application-visible interface provided by glibc should look like
this to be compatible to the existing implementations in the *BSD family:

  ssize_t preadv(int d, const struct iovec *iov, int iovcnt, off_t offset);
  ssize_t pwritev(int d, const struct iovec *iov, int iovcnt, off_t offset);

This prototype has one problem though: On 32bit archs is the (64bit)
offset argument unaligned, which the syscall ABI of several archs doesn't
allow to do.  At least s390 needs a wrapper in glibc to handle this.  As
we'll need a wrappers in glibc anyway I've decided to push problem to
glibc entriely and use a syscall prototype which works without
arch-specific wrappers inside the kernel: The offset argument is
explicitly splitted into two 32bit values.

The patch sports the actual system call implementation and the windup in
the x86 system call tables.  Other archs follow as separate patches.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: <linux-api@vger.kernel.org>
Cc: <linux-arch@vger.kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agopreadv/pwritev: create compat_writev()
Gerd Hoffmann [Thu, 2 Apr 2009 23:59:21 +0000 (16:59 -0700)]
preadv/pwritev: create compat_writev()

Factor out some code from compat_sys_writev() which can be shared with the
upcoming compat_sys_pwritev().

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: <linux-api@vger.kernel.org>
Cc: <linux-arch@vger.kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agopreadv/pwritev: create compat_readv()
Gerd Hoffmann [Thu, 2 Apr 2009 23:59:20 +0000 (16:59 -0700)]
preadv/pwritev: create compat_readv()

This patch series:

Implement the preadv() and pwritev() syscalls.  *BSD has this syscall for
quite some time.

Test code:

#if 0
set -x
gcc -Wall -O2 -o preadv $0
exit 0
#endif
/*
 * preadv demo / test
 *
 * (c) 2008 Gerd Hoffmann <kraxel@redhat.com>
 *
 * build with "sh $thisfile"
 */

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <inttypes.h>
#include <sys/uio.h>

/* ----------------------------------------------------------------- */
/* syscall windup                                                    */

#include <sys/syscall.h>
#if 0
/* WARNING: Be sure you know what you are doing if you enable this.
 * linux syscall code isn't upstream yet, syscall numbers are subject
 * to change */
# ifndef __NR_preadv
#  ifdef __i386__
#   define __NR_preadv  333
#   define __NR_pwritev 334
#  endif
#  ifdef __x86_64__
#   define __NR_preadv  295
#   define __NR_pwritev 296
#  endif
# endif
#endif
#ifndef __NR_preadv
# error preadv/pwritev syscall numbers are unknown
#endif

static ssize_t preadv(int fd, const struct iovec *iov, int iovcnt, off_t offset)
{
    uint32_t pos_high = (offset >> 32) & 0xffffffff;
    uint32_t pos_low  =  offset        & 0xffffffff;

    return syscall(__NR_preadv, fd, iov, iovcnt, pos_high, pos_low);
}

static ssize_t pwritev(int fd, const struct iovec *iov, int iovcnt, off_t offset)
{
    uint32_t pos_high = (offset >> 32) & 0xffffffff;
    uint32_t pos_low  =  offset        & 0xffffffff;

    return syscall(__NR_pwritev, fd, iov, iovcnt, pos_high, pos_low);
}

/* ----------------------------------------------------------------- */
/* demo/test app                                                     */

static char filename[] = "/tmp/preadv-XXXXXX";
static char outbuf[11] = "0123456789";
static char inbuf[11]  = "----------";

static struct iovec ovec[2] = {{
        .iov_base = outbuf + 5,
        .iov_len  = 5,
    },{
        .iov_base = outbuf + 0,
        .iov_len  = 5,
    }};

static struct iovec ivec[3] = {{
        .iov_base = inbuf + 6,
        .iov_len  = 2,
    },{
        .iov_base = inbuf + 4,
        .iov_len  = 2,
    },{
        .iov_base = inbuf + 2,
        .iov_len  = 2,
    }};

void cleanup(void)
{
    unlink(filename);
}

int main(int argc, char **argv)
{
    int fd, rc;

    fd = mkstemp(filename);
    if (-1 == fd) {
        perror("mkstemp");
        exit(1);
    }
    atexit(cleanup);

    /* write to file: "56789-01234" */
    rc = pwritev(fd, ovec, 2, 0);
    if (rc < 0) {
        perror("pwritev");
        exit(1);
    }

    /* read from file: "78-90-12" */
    rc = preadv(fd, ivec, 3, 2);
    if (rc < 0) {
        perror("preadv");
        exit(1);
    }

    printf("result  : %s\n", inbuf);
    printf("expected: %s\n", "--129078--");
    exit(0);
}

This patch:

Factor out some code from compat_sys_readv() which can be shared with the
upcoming compat_sys_preadv().

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: <linux-api@vger.kernel.org>
Cc: <linux-arch@vger.kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agocramfs: propagate uncompression errors
David VomLehn [Thu, 2 Apr 2009 23:59:15 +0000 (16:59 -0700)]
cramfs: propagate uncompression errors

Decompression errors can arise due to corruption of compressed blocks on
flash or in memory.  This patch propagates errors detected during
decompression back to the block layer.

Signed-off-by: David VomLehn <dvomlehn@cisco.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoxpc_sn2: fix max() warning about pointers of different types
Robin Holt [Thu, 2 Apr 2009 23:59:14 +0000 (16:59 -0700)]
xpc_sn2: fix max() warning about pointers of different types

Fix a minor compile warning when building on ia64.

drivers/misc/sgi-xp/xpc_sn2.c: In function `xpc_clear_remote_msgqueue_flags_sn2':
drivers/misc/sgi-xp/xpc_sn2.c:1746: warning: comparison of distinct pointer types lacks a cast

Signed-off-by: Robin Holt <holt@sgi.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-gru: remove SGI_GRU as a valid config option for ia64 configs with SGI_UV
Robin Holt [Thu, 2 Apr 2009 23:59:13 +0000 (16:59 -0700)]
sgi-gru: remove SGI_GRU as a valid config option for ia64 configs with SGI_UV

Some current configs turn on GRU for ia64.  The GRU code does not
correctly load on boot on ia64 (GRU does continue to work for x86-64), so
changing the IA64 Kconfig to not select GRU on ia64 configs for now until
we have time to fix.

Signed-off-by: Robin Holt <holt@sgi.com>
Acked-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-gru: support multiple pagesizes in GRU
Jack Steiner [Thu, 2 Apr 2009 23:59:12 +0000 (16:59 -0700)]
sgi-gru: support multiple pagesizes in GRU

Add multiple pagesize support to the GRU driver.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-gru: fix bugs related to module unload of the GRU driver
Jack Steiner [Thu, 2 Apr 2009 23:59:11 +0000 (16:59 -0700)]
sgi-gru: fix bugs related to module unload of the GRU driver

Fix bugs related to module unload of the GRU driver.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-gru: macro for scanning all gru chiplets
Jack Steiner [Thu, 2 Apr 2009 23:59:10 +0000 (16:59 -0700)]
sgi-gru: macro for scanning all gru chiplets

Add macro for scanning all active GRU chiplets.  Maximum chiplet id is
saved during GRU initialization.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-gru: add support to the GRU driver for message queue interrupts
Jack Steiner [Thu, 2 Apr 2009 23:59:10 +0000 (16:59 -0700)]
sgi-gru: add support to the GRU driver for message queue interrupts

Add support to the GRU driver for message queue interrupts.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Dean Nelson <dcn@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-gru: restructure the GRU vtop functions
Jack Steiner [Thu, 2 Apr 2009 23:59:09 +0000 (16:59 -0700)]
sgi-gru: restructure the GRU vtop functions

Restructure the GRU vtop functions in preparation for future changes.
This patch simply moves code around & does not change the algorithm.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-gru: aSID (context management) bug fixes
Jack Steiner [Thu, 2 Apr 2009 23:59:08 +0000 (16:59 -0700)]
sgi-gru: aSID (context management) bug fixes

This patch fixes bugs related to ASID (context id) management in the GRU
driver.  These changes are all internal to the SGI GRU driver and have no
effect on the base kernel.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-gru: add support for a user to explicitly unload a GRU context
Jack Steiner [Thu, 2 Apr 2009 23:59:07 +0000 (16:59 -0700)]
sgi-gru: add support for a user to explicitly unload a GRU context

Add support for a user to explicitly unload a GRU context.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-gru: add statistics to the GRU context management functions
Jack Steiner [Thu, 2 Apr 2009 23:59:06 +0000 (16:59 -0700)]
sgi-gru: add statistics to the GRU context management functions

Add statistics to the GRU context management functions.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-gru: change GRU CCH commands from inline functions to outofline functions
Jack Steiner [Thu, 2 Apr 2009 23:59:06 +0000 (16:59 -0700)]
sgi-gru: change GRU CCH commands from inline functions to outofline functions

Change the GRU instructions that manage contexts from inline functions to
out-of-line functions.  This simplifies adding statistics & error checking
to these functions.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-gru: improvements to GRU debug messages & statistics
Jack Steiner [Thu, 2 Apr 2009 23:59:05 +0000 (16:59 -0700)]
sgi-gru: improvements to GRU debug messages & statistics

Improvements to GRU debug messages & statistics.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-gru: misc GRU cleanup
Jack Steiner [Thu, 2 Apr 2009 23:59:04 +0000 (16:59 -0700)]
sgi-gru: misc GRU cleanup

Misc trivial GRU drivers fixes:
- fix long lines
- eliminate extra whitespace
- eliminate compiler warning
- better validation of invalidate user parameters
- bug fix for GRU TLB flush (not the cpu TLB flush)

These changes are all internal to the SGI GRU driver and have no effect
on the base kernel.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-gru: add macros for using the UV hub to send interrupts
Jack Steiner [Thu, 2 Apr 2009 23:59:03 +0000 (16:59 -0700)]
sgi-gru: add macros for using the UV hub to send interrupts

Add macros for using the UV hub to send interrupts.  Change the IPI code
to use these macros.  These macros will also be used in additional patches
that will follow.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-gru: add definitions of ia64 GRU MMRs
Jack Steiner [Thu, 2 Apr 2009 23:59:02 +0000 (16:59 -0700)]
sgi-gru: add definitions of ia64 GRU MMRs

Add definitions for IA64 GRU MMRs.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-gru: add definitions of x86_64 GRU MMRs
Jack Steiner [Thu, 2 Apr 2009 23:59:01 +0000 (16:59 -0700)]
sgi-gru: add definitions of x86_64 GRU MMRs

Add definitions for x86_64 GRU MMRs.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agosgi-gru: exclude UV definitions on 32-bit x86
Jack Steiner [Thu, 2 Apr 2009 23:59:00 +0000 (16:59 -0700)]
sgi-gru: exclude UV definitions on 32-bit x86

Eliminate compile errors on 32-bit X86 caused by UV.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agorelay: fix for possible loss/corruption of produced subbufs
Aravind Srinivasan [Thu, 2 Apr 2009 23:58:59 +0000 (16:58 -0700)]
relay: fix for possible loss/corruption of produced subbufs

Fix possible loss/corruption of produced subbufs in
relay_subbufs_consumed().

When buf->subbufs_produced wraps around after UINT_MAX and
buf->subbufs_consumed is still < UINT_MAX, the condition

if (buf->subbufs_consumed > buf->subbufs_produced)

will be true even for certain valid values of subbufs_consumed.  This may
lead to loss or corruption of produced subbufs.

Signed-off-by: Aravind Srinivasan <raa.aars@gmail.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
Cc: Tom Zanussi <zanussi@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agokexec: vmcoreinfo_data[] can become static
Dmitri Vorobiev [Thu, 2 Apr 2009 23:58:58 +0000 (16:58 -0700)]
kexec: vmcoreinfo_data[] can become static

The vmcoreinfo_data[] array is not used outside of kernel/kexec.c, and
can therefore become static. This patch adds the relevant keyword to the
definition of the array.

Noticed by sparse.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agokexec: add dmesg log symbols to /proc/vmcoreinfo lists
Neil Horman [Thu, 2 Apr 2009 23:58:57 +0000 (16:58 -0700)]
kexec: add dmesg log symbols to /proc/vmcoreinfo lists

It would be nice to be able to extract the dmesg log from a vmcore file
without needing to keep the debug symbols for the running kernel handy all
the time.  We have a facility to do this in /proc/vmcore.  This patch adds
the log_buf and log_end symbols to the vmcoreinfo area so that tools (like
makedumpfile) can easily extract the dmesg logs from a vmcore image.

[akpm@linux-foundation.org: several fixes and cleanups]
[akpm@linux-foundation.org: fix unused log_buf_kexec_setup()]
[akpm@linux-foundation.org: build fix]
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Cc: Simon Horman <horms@verge.net.au>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Cc: Neil Horman <nhorman@tuxdriver.com>
Cc: Simon Horman <horms@verge.net.au>
Cc: Vivek Goyal <vgoyal@redhat.com>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agow1: coding style cleanups in w1_io.c
Daniel Mack [Thu, 2 Apr 2009 23:58:54 +0000 (16:58 -0700)]
w1: coding style cleanups in w1_io.c

This fixes a number of coding style issues I stubled over.

Acked-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoparport: netmos 9845 & 9855 1P4S fixes
Philippe De Muyter [Thu, 2 Apr 2009 23:58:53 +0000 (16:58 -0700)]
parport: netmos 9845 & 9855 1P4S fixes

netmos serial/parallel adapters come in different flavour differing only
by the number of parallel and serial ports, which are encoded in the
subdevice ID.

Last fix of Christian Pellegrin for 9855 2P2S broke support for 9855 1P4S,
and works only by side-effect for the first parallel port of a 2P2S, as
this first parallel port is found by reading the second addr entry of
(struct parport_pc_pci) cards[netmos_9855], which is not initialized, and
hence has value 0, which happens to be the BAR of the first parallel port.

netmos_9xx5_combo entry in (struct parport_pc_pci) cards[], which is used
for a 9845 1P4S must also be fixed for the parallel port support when
there are 4 serial ports because this entry currently gives 2 as BAR index
for the parallel port.  Actually, in this case, BAR 2 is the 3rd serial
port while the parallel port is at BAR 4.

I fixed 9845 1P4S and 9855 1P4S support, while preserving 9855 2P2S support,

- by creating a netmos_9855_2p entry and using it for 9855 boards with 2
  parallel ports : 9855 2P2S and 9855 2P0S boards,

- and by allowing netmos_parallel_init to change not only the number of
  parallel ports (0 or 1), but making it also change the BAR index of the
  parallel port when the serial ports are before the parallel port.

PS: the netmos_9855_2p entry in (struct pciserial_board)
pci_parport_serial_boards[] is needed because netmos_parallel_init has no
clean way to replace FL_BASE2 by FL_BASE4 in the description of the serial
ports in function of the number of parallel ports on the card.

Tested with 9845 1P4S, 9855 1P4S and 9855 2P2S boards.

Signed-off-by: Philippe De Muyter <phdm@macqel.be>
Tested-by: Christian Pellegrin <chripell@fsfe.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoedac: AMD8111 driver Kconfig & Makefile
Harry Ciao [Thu, 2 Apr 2009 23:58:51 +0000 (16:58 -0700)]
edac: AMD8111 driver Kconfig & Makefile

Introduce Kconfig and Makefile options for AMD8111 EDAC driver.

Signed-off-by: Harry Ciao <qingtao.cao@windriver.com>
Cc: Doug Thompson <norsk5@yahoo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoedac: AMD8131 driver Kconfig & Makefile
Harry Ciao [Thu, 2 Apr 2009 23:58:51 +0000 (16:58 -0700)]
edac: AMD8131 driver Kconfig & Makefile

Introduce Kconfig and Makefile options for AMD8131 EDAC driver.

Signed-off-by: Harry Ciao <qingtao.cao@windriver.com>
Cc: Doug Thompson <norsk5@yahoo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoedac: AMD8131 driver source file
Harry Ciao [Thu, 2 Apr 2009 23:58:50 +0000 (16:58 -0700)]
edac: AMD8131 driver source file

Introduce AMD8131 EDAC driver source file, which makes use of error
detections on the PCI-X Bridge Controllers on the AMD8131 HyperTransport
PCI-X Tunnel.

Signed-off-by: Harry Ciao <qingtao.cao@windriver.com>
Cc: Doug Thompson <norsk5@yahoo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoedac: AMD8131 driver header file
Harry Ciao [Thu, 2 Apr 2009 23:58:49 +0000 (16:58 -0700)]
edac: AMD8131 driver header file

Introduce AMD8131 EDAC driver header file, which adds register and bits
definitions for the PCI-X Bridge Controller on the AMD8131 HyperTransport
I/O Hub.

Signed-off-by: Harry Ciao <qingtao.cao@windriver.com>
Cc: Doug Thompson <norsk5@yahoo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agopci: Add AMD8111 PCI Bridge PCI Device ID
Harry Ciao [Thu, 2 Apr 2009 23:58:48 +0000 (16:58 -0700)]
pci: Add AMD8111 PCI Bridge PCI Device ID

Add the PCI Device ID of the PCI Bridge Controller on AMD8111 chip.

Signed-off-by: Harry Ciao <qingtao.cao@windriver.com>
Cc: Doug Thompson <norsk5@yahoo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoedac: Add edac_pci_alloc_index()
Harry Ciao [Thu, 2 Apr 2009 23:58:47 +0000 (16:58 -0700)]
edac: Add edac_pci_alloc_index()

Add edac_pci_alloc_index(), because for MAPLE platform there may exist
several EDAC driver modules that could make use of edac_pci_ctl_info
structure at the same time.  The index allocation for these structures
should be taken care of by EDAC core.

Signed-off-by: Harry Ciao <qingtao.cao@windriver.com>
Cc: Doug Thompson <norsk5@yahoo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>