pandora-kernel.git
15 years agoStaging: sxg: Fix the module in Kconfig file for Sahara SXG driver
Mithlesh Thukral [Mon, 16 Mar 2009 12:34:14 +0000 (08:34 -0400)]
Staging: sxg: Fix the module in Kconfig file for Sahara SXG driver

* Update the module name in Kconfig help section.
  This is a classic case of documentation keeping out of pace with
  development
  And this was overlooked by me ages ago when we had fixed the Makefile for
  sxg_ethtool to compile.

Signed-off-by: Mithlesh Thukral <mithlesh@linsyssoft.com>
Cc: Christopher Harrer <charrer@alacritech.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: sxg: Fix memory leak caused by double allocation of rings
Mithlesh Thukral [Tue, 24 Feb 2009 12:39:34 +0000 (18:09 +0530)]
Staging: sxg: Fix memory leak caused by double allocation of rings

* The receive rings were getting allocated twice. Once at probe time
  and once at open time. This leaked huge amounts of memory.
  Fix this leak and now allocation is done only once.

Signed-off-by: LinSysSoft Sahara Team <saharaproj@linsyssoft.com>
Signed-off-by: Mithlesh Thukral <mithlesh@linsyssoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: sxg: Add checksum control option through ethtool interface
Mithlesh Thukral [Tue, 24 Feb 2009 12:37:59 +0000 (18:07 +0530)]
Staging: sxg: Add checksum control option through ethtool interface

* This patch adds support for controling checksum feature using the ethtool
  interface.

Signed-off-by: LinSysSoft Sahara Team <saharaproj@linsyssoft.com>
Signed-off-by: Mithlesh Thukral <mithlesh@linsyssoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: sxg: Remove unused Rev A microcode files
Mithlesh Thukral [Wed, 18 Feb 2009 13:24:59 +0000 (18:54 +0530)]
Staging: sxg: Remove unused Rev A microcode files

Remove the deprecated microcode which was for Rev A.
Now on the driver will use Rev B microcode only.

Signed-off-by: Michael Miles <mmiles@alacritech.com>
Signed-off-by: Mithlesh Thukral <mithlesh@linsyssoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: sxg: Add Rev B support in the Sahara SXG driver
Mithlesh Thukral [Wed, 18 Feb 2009 13:24:14 +0000 (18:54 +0530)]
Staging: sxg: Add Rev B support in the Sahara SXG driver

This patch makes the Sahara SXG driver use Rev B firmware instead of Rev A.
The firmware version is 1.71

Signed-off-by: Michael Miles <mmiles@alacritech.com>
Signed-off-by: Mithlesh Thukral <mithlesh@linsyssoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: sxg: Add firmware files for Rev B card
Mithlesh Thukral [Wed, 18 Feb 2009 13:23:04 +0000 (18:53 +0530)]
Staging: sxg: Add firmware files for Rev B card

This patch adds the new firmware files required by Rev B cards.

Signed-off-by: Michael Miles <mmiles@alacritech.com>
Signed-off-by: Mithlesh Thukral <mithlesh@linsyssoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: sxg: Fix memory leak in case of allocation failure
Mithlesh Thukral [Wed, 18 Feb 2009 13:22:18 +0000 (18:52 +0530)]
Staging: sxg: Fix memory leak in case of allocation failure

* Fix a memory leak if allocation of skb fails in sxg_fill_descriptor_block.
  In sxg_fill_descriptor_block(), if allocation of skb failed in loop,
  we just came out shouting. This rollbacks all the successful operation
  before skb allocation fails and then returns.

Signed-off-by: LinSysSoft Sahara Team <saharaproj@linsyssoft.com>
Signed-off-by: Mithlesh Thukral <mithlesh@linsyssoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: sxg: Add Checksum Offload support for Sahara SXG driver
Mithlesh Thukral [Wed, 18 Feb 2009 13:21:29 +0000 (18:51 +0530)]
Staging: sxg: Add Checksum Offload support for Sahara SXG driver

* This patch adds support for offloading checksum to hardware.
  IP checksum have been tested for IPv4 and IPv6.

Signed-off-by: LinSysSoft Sahara Team <saharaproj@linsyssoft.com>
Signed-off-by: Mithlesh Thukral <mithlesh@linsyssoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: sxg: fix napi interface build
Randy Dunlap [Wed, 11 Feb 2009 21:22:56 +0000 (13:22 -0800)]
Staging: sxg: fix napi interface build

Fix staging/sxg napi interface calls:

drivers/staging/sxg/sxg.c:1271: error: implicit declaration of function 'netif_rx_schedule_prep'
linux-next-20090209/drivers/staging/sxg/sxg.c:1272: error: implicit declaration of function '__netif_rx_schedule'
drivers/staging/sxg/sxg.c:1325: error: implicit declaration of function 'netif_rx_complete'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Mithlesh Thukral <mithlesh@linsyssoft.com>
Cc: LinSysSoft Sahara Team <saharaproj@linsyssoft.com>
Cc: Christopher Harrer <charrer@alacritech.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: sxg: Make SXG driver use MSI-X interrupts if possible
Mithlesh Thukral [Fri, 6 Feb 2009 14:02:28 +0000 (19:32 +0530)]
Staging: sxg: Make SXG driver use MSI-X interrupts if possible

Make Sahara SXG driver use MSI-X interrupts instead of line based interrupts
if possible. In case of problems in getting MSI-X vectors or MSI-X not being
supported, driver will fall back to use previous line based interrupts.

Signed-off-by: LinSysSoft Sahara Team <saharaproj@linsyssoft.com>
Signed-off-by: Mithlesh Thukral <mithlesh@linsyssoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: sxg: Removed unnecessary checks while taking Transmit Locks
Mithlesh Thukral [Fri, 6 Feb 2009 14:01:40 +0000 (19:31 +0530)]
Staging: sxg: Removed unnecessary checks while taking Transmit Locks

Fix the locking issue of locks in transmit code path.
There was an unnecessary check for interrupt context in transmit code path.
Removed that.

Signed-off-by: LinSysSoft Sahara Team <saharaproj@linsyssoft.com>
Signed-off-by: Mithlesh Thukral <mithlesh@linsyssoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: sxg: Add Jumbo frames support to Sahara SXG Driver
Mithlesh Thukral [Fri, 6 Feb 2009 14:00:40 +0000 (19:30 +0530)]
Staging: sxg: Add Jumbo frames support to Sahara SXG Driver

This patch adds Jumbo frame support to Sahara's SXG Driver.

Signed-off-by: LinSysSoft Sahara Team <saharaproj@linsyssoft.com>
Signed-off-by: Mithlesh Thukral <mithlesh@linsyssoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: sxg: Cleanup the SXG driver of unused space and functions
Mithlesh Thukral [Fri, 30 Jan 2009 14:50:19 +0000 (20:20 +0530)]
Staging: sxg: Cleanup the SXG driver of unused space and functions

Miscellaneous cleanups.
* Removed unwanted spaces/lines.
* Removed unused functions.

Signed-off-by: LinSysSoft Sahara Team <saharaproj@linsyssoft.com>
Signed-off-by: Mithlesh Thukral <mithlesh@linsyssoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: sxg: Add NAPI feature to Sahara SXG Driver
Mithlesh Thukral [Fri, 30 Jan 2009 14:49:03 +0000 (20:19 +0530)]
Staging: sxg: Add NAPI feature to Sahara SXG Driver

* Add NAPI support for SXG driver for Alacritech's 10Gbe products.
  The driver will now work in NAPI mode by default.

Signed-off-by: LinSysSoft Sahara Team <saharaproj@linsyssoft.com>
Signed-off-by: Mithlesh Thukral <mithlesh@linsyssoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: sxg: Add multicast support for Sahara SXG driver
Mithlesh Thukral [Wed, 28 Jan 2009 01:38:11 +0000 (07:08 +0530)]
Staging: sxg: Add multicast support for Sahara SXG driver

* Add multicast support for SXG driver for Alacritech's 10Gbe products.

Signed-off-by: LinSysSoft Sahara Team <saharaproj@linsyssoft.com>
Signed-off-by: Mithlesh Thukral <mithlesh@linsyssoft.com>
Cc: Michael Miles <mmiles@alacritech.com>
Cc: Christopher Harrer <charrer@alacritech.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: sxg: fix build warnings in sxg.c
Greg Kroah-Hartman [Wed, 21 Jan 2009 16:17:45 +0000 (08:17 -0800)]
Staging: sxg: fix build warnings in sxg.c

This compiles out some functions that are not being used to keep the
build clean so that we can see the "real" warnings and errors.

Cc: Mithlesh Thukral <mithlesh@linsyssoft.com>
Cc: LinSysSoft Sahara Team <saharaproj@linsyssoft.com>
Cc: Christopher Harrer <charrer@alacritech.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: sxg: fix build warnings in downloadB firmware files
Greg Kroah-Hartman [Wed, 21 Jan 2009 16:15:58 +0000 (08:15 -0800)]
Staging: sxg: fix build warnings in downloadB firmware files

These variables are never used, so #ifdef them away.

This should probably be fixed up properly from someone who knows why we
are even including these files in the first place, when they do not seem
to be needed at all.

Cc: Mithlesh Thukral <mithlesh@linsyssoft.com>
Cc: LinSysSoft Sahara Team <saharaproj@linsyssoft.com>
Cc: Christopher Harrer <charrer@alacritech.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: sxg: remove firmware files from sgx_ethtool.c
Greg Kroah-Hartman [Wed, 21 Jan 2009 16:14:38 +0000 (08:14 -0800)]
Staging: sxg: remove firmware files from sgx_ethtool.c

They are not needed here and only cause build warnings and bloat the
object file.

Cc: Mithlesh Thukral <mithlesh@linsyssoft.com>
Cc: LinSysSoft Sahara Team <saharaproj@linsyssoft.com>
Cc: Christopher Harrer <charrer@alacritech.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: sxg: fix build warnings in sxg_ethtool
Greg Kroah-Hartman [Wed, 21 Jan 2009 16:12:10 +0000 (08:12 -0800)]
Staging: sxg: fix build warnings in sxg_ethtool

This fixes some build problems with the ethtool support recently added
for the sxg driver.

This is a very good example of why you need to check the build for
warnings and then fix them...

Cc: Mithlesh Thukral <mithlesh@linsyssoft.com>
Cc: LinSysSoft Sahara Team <saharaproj@linsyssoft.com>
Cc: Christopher Harrer <charrer@alacritech.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: sxg: Fix to load card on low memory machines
Mithlesh Thukral [Mon, 19 Jan 2009 14:59:59 +0000 (20:29 +0530)]
Staging: sxg: Fix to load card on low memory machines

* Fix problem of crash on 50MB machine.
* Fixed dma_addr_t bug, which resolves issues on x86_32 bit machines.

Signed-off-by: LinSysSoft Sahara Team <saharaproj@linsyssoft.com>
Signed-off-by: Christopher Harrer <charrer@alacritech.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: sxg: Firmware updates
Mithlesh Thukral [Mon, 19 Jan 2009 14:58:13 +0000 (20:28 +0530)]
Staging: sxg: Firmware updates

* Add new firmware and remove all firmware file.
* Add a switch to load either debug or free firmware.

Signed-off-by: Christopher Harrer <charrer@alacritech.com>
Signed-off-by: LinSysSoft Sahara Team <saharaproj@linsyssoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: sxg: Add Ethtool functionality enhancement and misc cleanups
Mithlesh Thukral [Mon, 19 Jan 2009 14:57:17 +0000 (20:27 +0530)]
Staging: sxg: Add Ethtool functionality enhancement and misc cleanups

Misc. cleanups in the driver.
* Remove debugging code and variables.
* Fix compile time warnings.
* Remove debugging comments.
* Start cleanup of sxg_stats structure. This structure will eventually become
  very small

Signed-off-by: LinSysSoft Sahara Team <saharaproj@linsyssoft.com>
Signed-off-by: Christopher Harrer <charrer@alacritech.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: sxg: Locking related changes. Fix locking levels
Mithlesh Thukral [Mon, 19 Jan 2009 14:54:30 +0000 (20:24 +0530)]
Staging: sxg: Locking related changes. Fix locking levels

* Fix locking related issues like taking locks at right level.
* Convert some variables to atomic, to prevent taking them while
  incrementing or decrementing them.

Signed-off-by: LinSysSoft Sahara Team <saharaproj@linsyssoft.com>
Signed-off-by: Christopher Harrer <charrer@alacritech.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: sxg: SXG SGL related cleanup in data structures and code
Mithlesh Thukral [Mon, 19 Jan 2009 14:53:22 +0000 (20:23 +0530)]
Staging: sxg: SXG SGL related cleanup in data structures and code

* Cleanup in allocation of SXG_SGLs.
* Locking issues related to SglQLock.
* XmtCmd and XmtZeroLock consistency fixes.

Signed-off-by: LinSysSoft Sahara Team <saharaproj@linsyssoft.com>
Signed-off-by: Christopher Harrer <charrer@alacritech.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: sxg: Ethtool framework and Receive code path changes
Mithlesh Thukral [Mon, 19 Jan 2009 14:52:34 +0000 (20:22 +0530)]
Staging: sxg: Ethtool framework and Receive code path changes

* Add Ethtool framework to driver
* Makefile changes to fix build redundancy.
* Fix ups to error code paths in receieve buffer allocation as well as receive code path.
* Read MAC address from FLASH/EEPROM

Signed-off-by: LinSysSoft Sahara Team <saharaproj@linsyssoft.com>
Signed-off-by: Christopher Harrer <charrer@alacritech.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: sxg: Receive code and data structure cleanups
Mithlesh Thukral [Mon, 5 Jan 2009 15:48:04 +0000 (21:18 +0530)]
Staging: sxg: Receive code and data structure cleanups

* Cleanup in recevive buffer structure
* Drop receive data buffer as its not needed with use of skbs
* Fix error code paths in receive skb failures

Signed-off-by: LinSysSoft Sahara Team <saharaproj@linsyssoft.com>
Signed-off-by: Christopher Harrer <charrer@alacritech.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: sxg: Indentation fixes - mostly 80 char lines
Mithlesh Thukral [Mon, 5 Jan 2009 15:46:56 +0000 (21:16 +0530)]
Staging: sxg: Indentation fixes - mostly 80 char lines

Fix up the indentation to Linux style. There was some indentation which was
not as per Linux style specially related to 80 char lines.

Signed-off-by: LinSysSoft Sahara Team <saharaproj@linsyssoft.com>
Signed-off-by: Christopher Harrer <charrer@alacritech.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: sxg: Commenting style fixes - Pending work
Mithlesh Thukral [Mon, 5 Jan 2009 15:45:29 +0000 (21:15 +0530)]
Staging: sxg: Commenting style fixes - Pending work

This patch cleans up the comment. Converts the comments to C89 style.
Fixes comment related TODO item.

Signed-off-by: LinSysSoft Sahara Team <saharaproj@linsyssoft.com>
Signed-off-by: Christopher Harrer <charrer@alacritech.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: sxg: Typedef removal - pending work
Mithlesh Thukral [Mon, 5 Jan 2009 15:44:34 +0000 (21:14 +0530)]
Staging: sxg: Typedef removal - pending work

This patch removes all typedefs in the code. These were the typedefs
which are still present in driver in staging tree after the cleanup patches.

Signed-off-by: LinSysSoft Sahara Team <saharaproj@linsyssoft.com>
Signed-off-by: Christopher Harrer <charrer@alacritech.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: sxg: New SXG_SGL design and MAC Header changes
Mithlesh Thukral [Mon, 5 Jan 2009 15:43:23 +0000 (21:13 +0530)]
Staging: sxg: New SXG_SGL design and MAC Header changes

* This patch introduces the new SXG_SGL design.
* Related changes to sxg_scatter_gather structure.
* Introduced PSXG_X64_SGL changes which are x64 friendly
* Setting the MAC HEADER pointer properly in skb before giving to higher
  layers.

Signed-off-by: Michael Miles <mmiles@alacritech.com>
Signed-off-by: LinSysSoft Sahara Team <saharaproj@linsyssoft.com>
Signed-off-by: Christopher Harrer <charrer@alacritech.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: slicoss: slichw.h cleanup
Greg Kroah-Hartman [Fri, 27 Feb 2009 00:21:46 +0000 (16:21 -0800)]
Staging: slicoss: slichw.h cleanup

Lots of spaces->tabs cleanups for slichw.h

It's much more sane and "Linux-like" now.

Cc: Lior Dotan <liodot@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: slicoss: delete slicdbg.h
Greg Kroah-Hartman [Thu, 26 Feb 2009 23:46:06 +0000 (15:46 -0800)]
Staging: slicoss: delete slicdbg.h

Move the ASSERT macro into slicoss.c as that's all that is currently
being used.

Cc: Lior Dotan <liodot@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: slicoss: remove ASSERTMSG macro
Greg Kroah-Hartman [Thu, 26 Feb 2009 23:37:08 +0000 (15:37 -0800)]
Staging: slicoss: remove ASSERTMSG macro

No one uses it, so drop it.

Cc: Lior Dotan <liodot@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: slicoss: remove DBG_ERROR macro
Greg Kroah-Hartman [Thu, 26 Feb 2009 23:32:42 +0000 (15:32 -0800)]
Staging: slicoss: remove DBG_ERROR macro

Use the dev_err() call instead, it is the standard and provides much
more information.

Cc: Lior Dotan <liodot@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: slicoss: remove SLICLEVEL and SLIC_DISPLAY macros
Greg Kroah-Hartman [Thu, 26 Feb 2009 22:56:25 +0000 (14:56 -0800)]
Staging: slicoss: remove SLICLEVEL and SLIC_DISPLAY macros

They aren't needed or used anymore.

Cc: Lior Dotan <liodot@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: slicoss: remove SLIC_ETHTOOL_SUPPORT
Greg Kroah-Hartman [Thu, 26 Feb 2009 22:52:19 +0000 (14:52 -0800)]
Staging: slicoss: remove SLIC_ETHTOOL_SUPPORT

It was always enabled, so just always use it.

Cleaned up the ioctl code a bit as well to make it more readable.

Cc: Lior Dotan <liodot@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: slicoss: remove DBG_MSG
Greg Kroah-Hartman [Thu, 26 Feb 2009 22:43:03 +0000 (14:43 -0800)]
Staging: slicoss: remove DBG_MSG

It's not being used for anything, so delete it and all instances of it.

Cc: Lior Dotan <liodot@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: slicoss: remove VALID_ADDRESS macro
Greg Kroah-Hartman [Thu, 26 Feb 2009 22:13:26 +0000 (14:13 -0800)]
Staging: slicoss: remove VALID_ADDRESS macro

It's quite wierd, and doesn't even do anything on x86_64, so just delete
it.

Cc: Lior Dotan <liodot@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: slicoss: remove SLIC_PING_TIMER_ENABLED
Greg Kroah-Hartman [Thu, 26 Feb 2009 22:09:38 +0000 (14:09 -0800)]
Staging: slicoss: remove SLIC_PING_TIMER_ENABLED

It was always enabled, so just enable it properly.

Cc: Lior Dotan <liodot@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: slicoss: remove LINUX_FREES_ADAPTER_RESOURCES
Greg Kroah-Hartman [Thu, 26 Feb 2009 22:07:57 +0000 (14:07 -0800)]
Staging: slicoss: remove LINUX_FREES_ADAPTER_RESOURCES

It was always enabled, so just enable it and take out the one place it
was being used.

Cc: Lior Dotan <liodot@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: slicoss: remove SLIC_POWER_MANAGEMENT_ENABLED
Greg Kroah-Hartman [Thu, 26 Feb 2009 22:06:08 +0000 (14:06 -0800)]
Staging: slicoss: remove SLIC_POWER_MANAGEMENT_ENABLED

It was always disabled, so just remove it and the 2 lines of
code it was protecting.

Also remove SLIC_POWER_MANAGEMENT which was also disabled, yet
was never used.

Cc: Lior Dotan <liodot@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: slicoss: add proper KERN_DEBUG to 2 printks
Greg Kroah-Hartman [Thu, 26 Feb 2009 22:03:54 +0000 (14:03 -0800)]
Staging: slicoss: add proper KERN_DEBUG to 2 printks

Added bonus is this fixes a compiler warning on 4.3.3

Cc: Lior Dotan <liodot@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: slicoss: remove SLIC_GET_STATS_ENABLED
Greg Kroah-Hartman [Thu, 26 Feb 2009 22:01:22 +0000 (14:01 -0800)]
Staging: slicoss: remove SLIC_GET_STATS_ENABLED

It was always enabled, so just turn on the code that was being always
enabled, and remove the #define.

Cc: Lior Dotan <liodot@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: slicoss: delete slicinc.h
Greg Kroah-Hartman [Thu, 26 Feb 2009 21:59:12 +0000 (13:59 -0800)]
Staging: slicoss: delete slicinc.h

Putting static function prototypes in a .h file doesn't make much sense.
Move the ones that we need into the .c file and delete the rest.

Cc: Lior Dotan <liodot@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: slicoss: remove SLIC_GET_STATS_TIMER_ENABLED
Greg Kroah-Hartman [Thu, 26 Feb 2009 02:41:13 +0000 (18:41 -0800)]
Staging: slicoss: remove SLIC_GET_STATS_TIMER_ENABLED

SLIC_GET_STATS_TIMER_ENABLED was never defined, so remove the code that
was bound by it.

Cc: Lior Dotan <liodot@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: slicoss: clean up SLIC_DUMP_ENABLED
Greg Kroah-Hartman [Thu, 26 Feb 2009 02:37:53 +0000 (18:37 -0800)]
Staging: slicoss: clean up SLIC_DUMP_ENABLED

As SLIC_DUMP_ENABLED was disabled, remove the code that it was keeping
from being built as it was not ever used.  This removed a lot.

Cc: Lior Dotan <liodot@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: slicoss: delete slicbuild.h
Greg Kroah-Hartman [Thu, 26 Feb 2009 02:24:19 +0000 (18:24 -0800)]
Staging: slicoss: delete slicbuild.h

It was just duplicating the same #defines already in the .c file
and it wasn't even being #included in any file.

Cc: Lior Dotan <liodot@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: slicoss: remove unused #defines
Greg Kroah-Hartman [Thu, 26 Feb 2009 02:20:24 +0000 (18:20 -0800)]
Staging: slicoss: remove unused #defines

There are a number of "config" defines that do nothing, remove them.

Cc: Lior Dotan <liodot@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: slicoss: remove slic_os.h
Greg Kroah-Hartman [Thu, 26 Feb 2009 02:11:24 +0000 (18:11 -0800)]
Staging: slicoss: remove slic_os.h

It's no longer needed, and empty, so remove it.

Cc: Lior Dotan <liodot@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: slicoss: remove WRITE_REG wrapper
Greg Kroah-Hartman [Thu, 26 Feb 2009 02:10:25 +0000 (18:10 -0800)]
Staging: slicoss: remove WRITE_REG wrapper

It's not needed, so just call the function instead of using a define.

Cc: Lior Dotan <liodot@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: slicoss: remove WRITE_REG64 wrapper
Greg Kroah-Hartman [Thu, 26 Feb 2009 01:43:28 +0000 (17:43 -0800)]
Staging: slicoss: remove WRITE_REG64 wrapper

It's not needed, so just call the function instead of using a define.

Cc: Lior Dotan <liodot@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: slicoss: remove DEBUG_REGISTER_TRACE
Greg Kroah-Hartman [Thu, 26 Feb 2009 01:29:34 +0000 (17:29 -0800)]
Staging: slicoss: remove DEBUG_REGISTER_TRACE

It's not ever defined, so remove it from the code base.

Cc: Lior Dotan <liodot@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: slicoss: remove jiffies macros
Greg Kroah-Hartman [Thu, 26 Feb 2009 01:28:05 +0000 (17:28 -0800)]
Staging: slicoss: remove jiffies macros

Use the ones built into the kernel, don't reinvent the wheel.

Cc: Lior Dotan <liodot@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: slicoss: remove TRUE/FALSE usage
Greg Kroah-Hartman [Thu, 26 Feb 2009 01:16:44 +0000 (17:16 -0800)]
Staging: slicoss: remove TRUE/FALSE usage

Don't use TRUE and FALSE, we have proper boolean types in the kernel.

Cc: Lior Dotan <liodot@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: SLICOSS: use gfp_kernel where possible
Lior Dotan [Wed, 11 Feb 2009 11:35:10 +0000 (13:35 +0200)]
Staging: SLICOSS: use gfp_kernel where possible

Use GFP_KERNEL instead of GFP_ATOMIC where possible.

Signed_off-by: Lior Dotan <liodot@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: SLICOSS: free resources on entry_probe error path
Lior Dotan [Wed, 11 Feb 2009 10:18:21 +0000 (12:18 +0200)]
Staging: SLICOSS: free resources on entry_probe error path

Call pci_disable_device() and free_netdev() if slic_entry_probe fails.

Signed_off-by: Lior Dotan <liodot@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: slicoss: add binary firmware to firmware directory
Lior Dotan [Fri, 30 Jan 2009 07:51:49 +0000 (09:51 +0200)]
Staging: slicoss: add binary firmware to firmware directory

Adds the firmware to the firmware directory in ihex format so it can be
installed when doing make firmware_install.

Also update the firmware location in the driver code so it can locate
the files in the right place.

This should conclude the move to request_firmware().

Signed-off-by: Lior Dotan <liodot@gmail.com>
Cc: Christopher Harrer <charrer@alacritech.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: SLICOSS: remove the static firmware header files
Lior Dotan [Mon, 26 Jan 2009 09:28:40 +0000 (11:28 +0200)]
Staging: SLICOSS: remove the static firmware header files

Remove the static headers with the firmware code, they are no longer needed.

Signed-off-by: Lior Dotan <liodot@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 years agoStaging: slicoss: use request_firmware
Lior Dotan [Thu, 22 Jan 2009 07:38:15 +0000 (09:38 +0200)]
Staging: slicoss: use request_firmware

This patch uses request_firmware() to download the firmware to the card.

Signed-off-by: Lior Dotan <liodot@gmail.com>
Cc: Christopher Harrer <charrer@alacritech.com>
15 years agoMerge branch 'ext3-latency-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Fri, 3 Apr 2009 18:10:33 +0000 (11:10 -0700)]
Merge branch 'ext3-latency-fixes' of git://git./linux/kernel/git/tytso/ext4

* 'ext3-latency-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
  ext3: Add replace-on-rename hueristics for data=writeback mode
  ext3: Add replace-on-truncate hueristics for data=writeback mode
  ext3: Use WRITE_SYNC for commits which are caused by fsync()
  block_write_full_page: Use synchronous writes for WBC_SYNC_ALL writebacks

15 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6
Linus Torvalds [Fri, 3 Apr 2009 17:39:20 +0000 (10:39 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/lrg/voltage-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6: (32 commits)
  regulator: twl4030 VAUX3 supports 3.0V
  regulator: Support disabling of unused regulators by machines
  regulator: Don't increment use_count for boot_on regulators
  twl4030-regulator: expose VPLL2
  regulator: refcount fixes
  regulator: Don't warn if we failed to get a regulator
  regulator: Allow boot_on regulators to be disabled by clients
  regulator: Implement list_voltage for WM835x LDOs and DCDCs
  twl4030-regulator: list more VAUX4 voltages
  regulator: Don't warn on omitted voltage constraints
  regulator: Implement list_voltage() for WM8400 DCDCs and LDOs
  MMC: regulator utilities
  regulator: twl4030 voltage enumeration (v2)
  regulator: twl4030 regulators
  regulator: get_status() grows kerneldoc
  regulator: enumerate voltages (v2)
  regulator: Fix get_mode() for WM835x DCDCs
  regulator: Allow regulators to set the initial operating mode
  regulator: Suggest use of datasheet supply or pin names for consumers
  regulator: email - update email address and regulator webpage.
  ...

15 years agoMerge git://git.infradead.org/iommu-2.6
Linus Torvalds [Fri, 3 Apr 2009 17:36:57 +0000 (10:36 -0700)]
Merge git://git.infradead.org/iommu-2.6

* git://git.infradead.org/iommu-2.6:
  intel-iommu: Fix address wrap on 32-bit kernel.
  intel-iommu: Enable DMAR on 32-bit kernel.
  intel-iommu: fix PCI device detach from virtual machine
  intel-iommu: VT-d page table to support snooping control bit
  iommu: Add domain_has_cap iommu_ops
  intel-iommu: Snooping control support

Fixed trivial conflicts in arch/x86/Kconfig and drivers/pci/intel-iommu.c

15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-2.6-fscache
Linus Torvalds [Fri, 3 Apr 2009 17:07:43 +0000 (10:07 -0700)]
Merge git://git./linux/kernel/git/dhowells/linux-2.6-fscache

* git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-2.6-fscache: (41 commits)
  NFS: Add mount options to enable local caching on NFS
  NFS: Display local caching state
  NFS: Store pages from an NFS inode into a local cache
  NFS: Read pages from FS-Cache into an NFS inode
  NFS: nfs_readpage_async() needs to be accessible as a fallback for local caching
  NFS: Add read context retention for FS-Cache to call back with
  NFS: FS-Cache page management
  NFS: Add some new I/O counters for FS-Cache doing things for NFS
  NFS: Invalidate FsCache page flags when cache removed
  NFS: Use local disk inode cache
  NFS: Define and create inode-level cache objects
  NFS: Define and create superblock-level objects
  NFS: Define and create server-level objects
  NFS: Register NFS for caching and retrieve the top-level index
  NFS: Permit local filesystem caching to be enabled for NFS
  NFS: Add FS-Cache option bit and debug bit
  NFS: Add comment banners to some NFS functions
  FS-Cache: Make kAFS use FS-Cache
  CacheFiles: A cache that backs onto a mounted filesystem
  CacheFiles: Export things for CacheFiles
  ...

15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm
Linus Torvalds [Fri, 3 Apr 2009 17:02:45 +0000 (10:02 -0700)]
Merge git://git./linux/kernel/git/agk/linux-2.6-dm

* git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm: (36 commits)
  dm: set queue ordered mode
  dm: move wait queue declaration
  dm: merge pushback and deferred bio lists
  dm: allow uninterruptible wait for pending io
  dm: merge __flush_deferred_io into caller
  dm: move bio_io_error into __split_and_process_bio
  dm: rename __split_bio
  dm: remove unnecessary struct dm_wq_req
  dm: remove unnecessary work queue context field
  dm: remove unnecessary work queue type field
  dm: bio list add bio_list_add_head
  dm snapshot: persistent fix dtr cleanup
  dm snapshot: move status to exception store
  dm snapshot: move ctr parsing to exception store
  dm snapshot: use DMEMIT macro for status
  dm snapshot: remove dm_snap header
  dm snapshot: remove dm_snap header use
  dm exception store: move cow pointer
  dm exception store: move chunk_fields
  dm exception store: move dm_target pointer
  ...

15 years agoMerge branch 'for-linus' of git://git.open-osd.org/linux-open-osd
Linus Torvalds [Fri, 3 Apr 2009 16:53:22 +0000 (09:53 -0700)]
Merge branch 'for-linus' of git://git.open-osd.org/linux-open-osd

* 'for-linus' of git://git.open-osd.org/linux-open-osd:
  fs: Add exofs to Kernel build
  exofs: Documentation
  exofs: export_operations
  exofs: super_operations and file_system_type
  exofs: dir_inode and directory operations
  exofs: address_space_operations
  exofs: symlink_inode and fast_symlink_inode operations
  exofs: file and file_inode operations
  exofs: Kbuild, Headers and osd utils

15 years agoMerge branch 'for-linus' of git://oss.sgi.com/xfs/xfs
Linus Torvalds [Fri, 3 Apr 2009 16:52:29 +0000 (09:52 -0700)]
Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs

* 'for-linus' of git://oss.sgi.com/xfs/xfs: (61 commits)
  Revert "xfs: increase the maximum number of supported ACL entries"
  xfs: cleanup uuid handling
  xfs: remove m_attroffset
  xfs: fix various typos
  xfs: pagecache usage optimization
  xfs: remove m_litino
  xfs: kill ino64 mount option
  xfs: kill mutex_t typedef
  xfs: increase the maximum number of supported ACL entries
  xfs: factor out code to find the longest free extent in the AG
  xfs: kill VN_BAD
  xfs: kill vn_atime_* helpers.
  xfs: cleanup xlog_bread
  xfs: cleanup xlog_recover_do_trans
  xfs: remove another leftover of the old inode log item format
  xfs: cleanup log unmount handling
  Fix xfs debug build breakage by pushing xfs_error.h after
  xfs: include header files for prototypes
  xfs: make symbols static
  xfs: move declaration to header file
  ...

15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6
Linus Torvalds [Fri, 3 Apr 2009 16:52:04 +0000 (09:52 -0700)]
Merge git://git./linux/kernel/git/kyle/parisc-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6: (23 commits)
  parisc: move dereference_function_descriptor to process.c
  parisc: Move kernel Elf_Fdesc define to <asm/elf.h>
  parisc: fix build when ARCH_HAS_KMAP
  parisc: fix "make tar-pkg"
  parisc: drivers: fix warnings
  parisc: select BUG always
  parisc: asm/pdc.h should include asm/page.h
  parisc: led: remove proc_dir_entry::owner
  parisc: fix macro expansion in atomic.h
  parisc: iosapic: fix build breakage
  parisc: oops_enter()/oops_exit() in die()
  parisc: document light weight syscall ABI
  parisc: blink all or loadavg LEDs on oops
  parisc: add ftrace (function and graph tracer) functionality
  parisc: simplify sys_clone()
  parisc: add LATENCYTOP_SUPPORT and CONFIG_STACKTRACE_SUPPORT
  parisc: allow to build with 16k default kernel page size
  parisc: expose 32/64-bit capabilities in cpuinfo
  parisc: use constants instead of numbers in assembly
  parisc: fix usage of 32bit PTE page table entries on 32bit kernels
  ...

15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/kyle/rtc-parisc
Linus Torvalds [Fri, 3 Apr 2009 16:51:35 +0000 (09:51 -0700)]
Merge git://git./linux/kernel/git/kyle/rtc-parisc

* git://git.kernel.org/pub/scm/linux/kernel/git/kyle/rtc-parisc:
  powerpc/ps3: Add rtc-ps3
  powerpc: Hook up rtc-generic, and kill rtc-ppc
  m68k: Hook up rtc-generic
  parisc: rtc: Rename rtc-parisc to rtc-generic
  parisc: rtc: Add missing module alias
  parisc: rtc: platform_driver_probe() fixups
  parisc: rtc: get_rtc_time() returns unsigned int

15 years agoMerge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux...
Linus Torvalds [Fri, 3 Apr 2009 16:50:39 +0000 (09:50 -0700)]
Merge branch 'for_linus' of git://git./linux/kernel/git/jack/linux-udf-2.6

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-udf-2.6:
  udf: Don't write integrity descriptor too often
  udf: Try anchor in block 256 first
  udf: Some type fixes and cleanups
  udf: use hardware sector size
  udf: fix novrs mount option
  udf: Fix oops when invalid character in filename occurs
  udf: return f_fsid for statfs(2)
  udf: Add checks to not underflow sector_t
  udf: fix default mode and dmode options handling
  udf: fix sparse warnings:
  udf: unsigned last[i] cannot be less than 0
  udf: implement mode and dmode mounting options
  udf: reduce stack usage of udf_get_filename
  udf: reduce stack usage of udf_load_pvoldesc
  Fix the udf code not to pass structs on stack where possible.
  Remove struct typedefs from fs/udf/ecma_167.h et al.

15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/rcu-doc-2.6
Linus Torvalds [Fri, 3 Apr 2009 16:50:14 +0000 (09:50 -0700)]
Merge git://git./linux/kernel/git/davem/rcu-doc-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/rcu-doc-2.6:
  Doc: Fix spelling in RCU/rculist_nulls.txt.
  Doc: Fix wrong API example usage of call_rcu().
  Doc: Fix missing whitespaces in RCU documentation.

15 years agomm: fix misuse of debug_kmap_atomic
Akinobu Mita [Thu, 2 Apr 2009 07:01:26 +0000 (16:01 +0900)]
mm: fix misuse of debug_kmap_atomic

Commit 7ca43e7564679604d86e9ed834e7bbcffd8a4a3f ("mm: use debug_kmap_atomic")
introduced some debug_kmap_atomic() in wrong places.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoFix highmem PPC build failure
Kumar Gala [Thu, 2 Apr 2009 04:38:49 +0000 (23:38 -0500)]
Fix highmem PPC build failure

Commit f4112de6b679d84bd9b9681c7504be7bdfb7c7d5 ("mm: introduce
debug_kmap_atomic") broke PPC builds with CONFIG_HIGHMEM=y:

   CC      init/main.o
  In file included from include/linux/highmem.h:25,
                   from include/linux/pagemap.h:11,
                   from include/linux/mempolicy.h:63,
                   from init/main.c:53:
  arch/powerpc/include/asm/highmem.h: In function 'kmap_atomic_prot':
  arch/powerpc/include/asm/highmem.h:98: error: implicit declaration of function 'debug_kmap_atomic'
  In file included from include/linux/pagemap.h:11,
                   from include/linux/mempolicy.h:63,
                   from init/main.c:53:
  include/linux/highmem.h: At top level:
  include/linux/highmem.h:196: warning: conflicting types for 'debug_kmap_atomic'
  include/linux/highmem.h:196: error: static declaration of 'debug_kmap_atomic' follows non-static declaration
  include/asm/highmem.h:98: error: previous implicit declaration of 'debug_kmap_atomic' was here
  make[1]: *** [init/main.o] Error 1
  make: *** [init] Error 2

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Acked-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Linus Torvalds [Fri, 3 Apr 2009 16:45:53 +0000 (09:45 -0700)]
Merge git://git./linux/kernel/git/herbert/crypto-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: ixp4xx - Fix handling of chained sg buffers
  crypto: shash - Fix unaligned calculation with short length
  hwrng: timeriomem - Use phys address rather than virt

15 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu
Linus Torvalds [Fri, 3 Apr 2009 16:44:58 +0000 (09:44 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/gerg/m68knommu

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu: (41 commits)
  m68knommu: improve compile arch switch settings
  m68knommu: fix 5407 ColdFire UART vector setup
  m68knommu: fix 5307 ColdFire UART vector setup
  m68knommu: fix 5249 ColdFire UART vector setup
  m68knommu: fix 5249 ColdFire UART setup
  m68knommu: fix end of uart table marker
  m68knommu: switch to using generic_handle_irq()
  m68k: merge the mmu and non-mmu versions of tlbflush.h
  m68knommu: introduce basic clk infrastructure
  m68k: merge the mmu and non-mmu versions of module.h
  m68knommu: add missing interrupt line definition for UART 2
  m68k: merge the mmu and non-mmu versions of mmu_context.h
  m68k: merge the mmu and non-mmu versions of current.h
  m68k: merge the mmu and non-mmu versions of div64.h
  m68k: merge the mmu and non-mmu versions of bugs.h
  m68k: merge the mmu and non-mmu versions of bug.h
  m68k: use the mmu version of cache.h for m68knommu as well
  m68k: use the mmu version of bootinfo.h for m68knommu as well
  m68k: merge the mmu and non-mmu versions of fb.h
  m68k: merge the mmu and non-mmu versions of segment.h
  ...

15 years agoMerge branch 'for-linus' of git://neil.brown.name/md
Linus Torvalds [Fri, 3 Apr 2009 16:08:19 +0000 (09:08 -0700)]
Merge branch 'for-linus' of git://neil.brown.name/md

* 'for-linus' of git://neil.brown.name/md: (53 commits)
  md/raid5 revise rules for when to update metadata during reshape
  md/raid5: minor code cleanups in make_request.
  md: remove CONFIG_MD_RAID_RESHAPE config option.
  md/raid5: be more careful about write ordering when reshaping.
  md: don't display meaningless values in sysfs files resync_start and sync_speed
  md/raid5: allow layout and chunksize to be changed on active array.
  md/raid5: reshape using largest of old and new chunk size
  md/raid5: prepare for allowing reshape to change layout
  md/raid5: prepare for allowing reshape to change chunksize.
  md/raid5: clearly differentiate 'before' and 'after' stripes during reshape.
  Documentation/md.txt update
  md: allow number of drives in raid5 to be reduced
  md/raid5: change reshape-progress measurement to cope with reshaping backwards.
  md: add explicit method to signal the end of a reshape.
  md/raid5: enhance raid5_size to work correctly with negative delta_disks
  md/raid5: drop qd_idx from r6_state
  md/raid6: move raid6 data processing to raid6_pq.ko
  md: raid5 run(): Fix max_degraded for raid level 4.
  md: 'array_size' sysfs attribute
  md: centralize ->array_sectors modifications
  ...

15 years agoMerge master.kernel.org:/home/rmk/linux-2.6-arm
Linus Torvalds [Fri, 3 Apr 2009 16:05:40 +0000 (09:05 -0700)]
Merge master.kernel.org:/home/rmk/linux-2.6-arm

* master.kernel.org:/home/rmk/linux-2.6-arm:
  [ARM] fix build-breaking 7a192ec commit
  ARM: Add SMSC911X support to Overo platform (V2)
  arm: update omap_ldp defconfig to use smsc911x
  arm: update realview defconfigs to use smsc911x
  arm: update pcm037 defconfig to use smsc911x
  arm: convert omap ldp platform to use smsc911x
  arm: convert realview platform to use smsc911x
  arm: convert pcm037 platform to use smsc911x
  [ARM] 5444/1: ARM: Realview: Fix event-device multiplicators in localtimer.c
  [ARM] 5442/1: pxa/cm-x255: fix reverse RDY gpios in PCMCIA driver
  [ARM] 5441/1: Use pr_err on error paths in at91 pm
  [ARM] 5440/1: Fix VFP state corruption due to preemption during VFP exceptions
  [ARM] 5439/1: Do not clear bit 10 of DFSR during abort handling on ARMv6
  [ARM] 5437/1: Add documentation for "nohlt" kernel parameter
  [ARM] 5436/1: ARM: OMAP: Fix compile for rx51
  [ARM] arch_reset() now takes a second parameter
  [ARM] Kirkwood: small L2 code cleanup
  [ARM] Kirkwood: invalidate L2 cache before enabling it

15 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/bart/linux-hdreg-h-cleanup
Linus Torvalds [Fri, 3 Apr 2009 16:02:32 +0000 (09:02 -0700)]
Merge git://git./linux/kernel/git/bart/linux-hdreg-h-cleanup

* git://git.kernel.org/pub/scm/linux/kernel/git/bart/linux-hdreg-h-cleanup:
  remove <linux/ata.h> include from <linux/hdreg.h>
  include/linux/hdreg.h: remove unused defines
  isd200: use ATA_* defines instead of *_STAT and *_ERR ones
  include/linux/hdreg.h: cover WIN_* and friends with #ifndef/#endif __KERNEL__
  aoe: WIN_* -> ATA_CMD_*
  isd200: WIN_* -> ATA_CMD_*
  include/linux/hdreg.h: cover struct hd_driveid with #ifndef/#endif __KERNEL__
  xsysace: make it 'struct hd_driveid'-free
  ubd_kern: make it 'struct hd_driveid'-free
  isd200: make it 'struct hd_driveid'-free

15 years agoNFS: Add mount options to enable local caching on NFS
David Howells [Fri, 3 Apr 2009 15:42:48 +0000 (16:42 +0100)]
NFS: Add mount options to enable local caching on NFS

Add NFS mount options to allow the local caching support to be enabled.

The attached patch makes it possible for the NFS filesystem to be told to make
use of the network filesystem local caching service (FS-Cache).

To be able to use this, a recent nfsutils package is required.

There are three variant NFS mount options that can be added to a mount command
to control caching for a mount.  Only the last one specified takes effect:

 (*) Adding "fsc" will request caching.

 (*) Adding "fsc=<string>" will request caching and also specify a uniquifier.

 (*) Adding "nofsc" will disable caching.

For example:

mount warthog:/ /a -o fsc

The cache of a particular superblock (NFS FSID) will be shared between all
mounts of that volume, provided they have the same connection parameters and
are not marked 'nosharecache'.

Where it is otherwise impossible to distinguish superblocks because all the
parameters are identical, but the 'nosharecache' option is supplied, a
uniquifying string must be supplied, else only the first mount will be
permitted to use the cache.

If there's a key collision, then the second mount will disable caching and give
a warning into the kernel log.

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 agoNFS: Display local caching state
David Howells [Fri, 3 Apr 2009 15:42:47 +0000 (16:42 +0100)]
NFS: Display local caching state

Display the local caching state in /proc/fs/nfsfs/volumes.

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 agoNFS: Store pages from an NFS inode into a local cache
David Howells [Fri, 3 Apr 2009 15:42:45 +0000 (16:42 +0100)]
NFS: Store pages from an NFS inode into a local cache

Store pages from an NFS inode into the cache data storage object associated
with that inode.

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 agoNFS: Read pages from FS-Cache into an NFS inode
David Howells [Fri, 3 Apr 2009 15:42:44 +0000 (16:42 +0100)]
NFS: Read pages from FS-Cache into an NFS inode

Read pages from an FS-Cache data storage object representing an inode into an
NFS inode.

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 agoNFS: nfs_readpage_async() needs to be accessible as a fallback for local caching
David Howells [Fri, 3 Apr 2009 15:42:44 +0000 (16:42 +0100)]
NFS: nfs_readpage_async() needs to be accessible as a fallback for local caching

nfs_readpage_async() needs to be non-static so that it can be used as a
fallback for the local on-disk caching should an EIO crop up when reading the
cache.

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 agoNFS: Add read context retention for FS-Cache to call back with
David Howells [Fri, 3 Apr 2009 15:42:44 +0000 (16:42 +0100)]
NFS: Add read context retention for FS-Cache to call back with

Add read context retention so that FS-Cache can call back into NFS when a read
operation on the cache fails EIO rather than reading data.  This permits NFS to
then fetch the data from the server instead using the appropriate security
context.

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 agoNFS: FS-Cache page management
David Howells [Fri, 3 Apr 2009 15:42:44 +0000 (16:42 +0100)]
NFS: FS-Cache page management

FS-Cache page management for NFS.  This includes hooking the releasing and
invalidation of pages marked with PG_fscache (aka PG_private_2) and waiting for
completion of the write-to-cache flag (PG_fscache_write aka PG_owner_priv_2).

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 agoNFS: Add some new I/O counters for FS-Cache doing things for NFS
David Howells [Fri, 3 Apr 2009 15:42:43 +0000 (16:42 +0100)]
NFS: Add some new I/O counters for FS-Cache doing things for NFS

Add some new NFS I/O counters for FS-Cache doing things for NFS.  A new line is
emitted into /proc/pid/mountstats if caching is enabled that looks like:

fsc: <rok> <rfl> <wok> <wfl> <unc>

Where <rok> is the number of pages read successfully from the cache, <rfl> is
the number of failed page reads against the cache, <wok> is the number of
successful page writes to the cache, <wfl> is the number of failed page writes
to the cache, and <unc> is the number of NFS pages that have been disconnected
from the cache.

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 agoNFS: Invalidate FsCache page flags when cache removed
David Howells [Fri, 3 Apr 2009 15:42:43 +0000 (16:42 +0100)]
NFS: Invalidate FsCache page flags when cache removed

Invalidate the FsCache page flags on the pages belonging to an inode when the
cache backing that NFS inode is removed.

This allows a live cache to be withdrawn.

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 agoNFS: Use local disk inode cache
David Howells [Fri, 3 Apr 2009 15:42:43 +0000 (16:42 +0100)]
NFS: Use local disk inode cache

Bind data storage objects in the local cache to NFS inodes.

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 agoNFS: Define and create inode-level cache objects
David Howells [Fri, 3 Apr 2009 15:42:43 +0000 (16:42 +0100)]
NFS: Define and create inode-level cache objects

Define and create inode-level cache data storage objects (as managed by
nfs_inode structs).

Each inode-level object is created in a superblock-level index object and is
itself a data storage object into which pages from the inode are stored.

The inode object key is the NFS file handle for the inode.

The inode object is given coherency data to carry in the auxiliary data
permitted by the cache.  This is a sequence made up of:

 (1) i_mtime from the NFS inode.

 (2) i_ctime from the NFS inode.

 (3) i_size from the NFS inode.

 (4) change_attr from the NFSv4 attribute data.

As the cache is a persistent cache, the auxiliary data is checked when a new
NFS in-memory inode is set up that matches an already existing data storage
object in the cache.  If the coherency data is the same, the on-disk object is
retained and used; if not, it is scrapped and a new one created.

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 agoNFS: Define and create superblock-level objects
David Howells [Fri, 3 Apr 2009 15:42:42 +0000 (16:42 +0100)]
NFS: Define and create superblock-level objects

Define and create superblock-level cache index objects (as managed by
nfs_server structs).

Each superblock object is created in a server level index object and is itself
an index into which inode-level objects are inserted.

Ideally there would be one superblock-level object per server, and the former
would be folded into the latter; however, since the "nosharecache" option
exists this isn't possible.

The superblock object key is a sequence consisting of:

 (1) Certain superblock s_flags.

 (2) Various connection parameters that serve to distinguish superblocks for
     sget().

 (3) The volume FSID.

 (4) The security flavour.

 (5) The uniquifier length.

 (6) The uniquifier text.  This is normally an empty string, unless the fsc=xyz
     mount option was used to explicitly specify a uniquifier.

The key blob is of variable length, depending on the length of (6).

The superblock object is given no coherency data to carry in the auxiliary data
permitted by the cache.  It is assumed that the superblock is always coherent.

This patch also adds uniquification handling such that two otherwise identical
superblocks, at least one of which is marked "nosharecache", won't end up
trying to share the on-disk cache.  It will be possible to manually provide a
uniquifier through a mount option with a later patch to avoid the error
otherwise produced.

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 agoNFS: Define and create server-level objects
David Howells [Fri, 3 Apr 2009 15:42:42 +0000 (16:42 +0100)]
NFS: Define and create server-level objects

Define and create server-level cache index objects (as managed by nfs_client
structs).

Each server object is created in the NFS top-level index object and is itself
an index into which superblock-level objects are inserted.

Ideally there would be one superblock-level object per server, and the former
would be folded into the latter; however, since the "nosharecache" option
exists this isn't possible.

The server object key is a sequence consisting of:

 (1) NFS version

 (2) Server address family (eg: AF_INET or AF_INET6)

 (3) Server port.

 (4) Server IP address.

The key blob is of variable length, depending on the length of (4).

The server object is given no coherency data to carry in the auxiliary data
permitted by the cache.

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 agoNFS: Register NFS for caching and retrieve the top-level index
David Howells [Fri, 3 Apr 2009 15:42:42 +0000 (16:42 +0100)]
NFS: Register NFS for caching and retrieve the top-level index

Register NFS for caching and retrieve the top-level cache index object cookie.

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 agoNFS: Permit local filesystem caching to be enabled for NFS
David Howells [Fri, 3 Apr 2009 15:42:42 +0000 (16:42 +0100)]
NFS: Permit local filesystem caching to be enabled for NFS

Permit local filesystem caching to be enabled for NFS in the kernel
configuration.

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 agoNFS: Add FS-Cache option bit and debug bit
David Howells [Fri, 3 Apr 2009 15:42:42 +0000 (16:42 +0100)]
NFS: Add FS-Cache option bit and debug bit

Add FS-Cache option bit to nfs_server struct.  This is set to indicate local
on-disk caching is enabled for a particular superblock.

Also add debug bit for local caching operations.

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 agoNFS: Add comment banners to some NFS functions
David Howells [Fri, 3 Apr 2009 15:42:41 +0000 (16:42 +0100)]
NFS: Add comment banners to some NFS functions

Add comment banners to some NFS functions so that they can be modified by the
NFS fscache patches for further information.

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: Make kAFS use FS-Cache
David Howells [Fri, 3 Apr 2009 15:42:41 +0000 (16:42 +0100)]
FS-Cache: Make kAFS use FS-Cache

The attached patch makes the kAFS filesystem in fs/afs/ use FS-Cache, and
through it any attached caches.  The kAFS filesystem will use caching
automatically if it's available.

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 agoCacheFiles: A cache that backs onto a mounted filesystem
David Howells [Fri, 3 Apr 2009 15:42:41 +0000 (16:42 +0100)]
CacheFiles: A cache that backs onto a mounted filesystem

Add an FS-Cache cache-backend that permits a mounted filesystem to be used as a
backing store for the cache.

CacheFiles uses a userspace daemon to do some of the cache management - such as
reaping stale nodes and culling.  This is called cachefilesd and lives in
/sbin.  The source for the daemon can be downloaded from:

http://people.redhat.com/~dhowells/cachefs/cachefilesd.c

And an example configuration from:

http://people.redhat.com/~dhowells/cachefs/cachefilesd.conf

The filesystem and data integrity of the cache are only as good as those of the
filesystem providing the backing services.  Note that CacheFiles does not
attempt to journal anything since the journalling interfaces of the various
filesystems are very specific in nature.

CacheFiles creates a misc character device - "/dev/cachefiles" - that is used
to communication with the daemon.  Only one thing may have this open at once,
and whilst it is open, a cache is at least partially in existence.  The daemon
opens this and sends commands down it to control the cache.

CacheFiles is currently limited to a single cache.

CacheFiles attempts to maintain at least a certain percentage of free space on
the filesystem, shrinking the cache by culling the objects it contains to make
space if necessary - see the "Cache Culling" section.  This means it can be
placed on the same medium as a live set of data, and will expand to make use of
spare space and automatically contract when the set of data requires more
space.

============
REQUIREMENTS
============

The use of CacheFiles and its daemon requires the following features to be
available in the system and in the cache filesystem:

- dnotify.

- extended attributes (xattrs).

- openat() and friends.

- bmap() support on files in the filesystem (FIBMAP ioctl).

- The use of bmap() to detect a partial page at the end of the file.

It is strongly recommended that the "dir_index" option is enabled on Ext3
filesystems being used as a cache.

=============
CONFIGURATION
=============

The cache is configured by a script in /etc/cachefilesd.conf.  These commands
set up cache ready for use.  The following script commands are available:

 (*) brun <N>%
 (*) bcull <N>%
 (*) bstop <N>%
 (*) frun <N>%
 (*) fcull <N>%
 (*) fstop <N>%

Configure the culling limits.  Optional.  See the section on culling
The defaults are 7% (run), 5% (cull) and 1% (stop) respectively.

The commands beginning with a 'b' are file space (block) limits, those
beginning with an 'f' are file count limits.

 (*) dir <path>

Specify the directory containing the root of the cache.  Mandatory.

 (*) tag <name>

Specify a tag to FS-Cache to use in distinguishing multiple caches.
Optional.  The default is "CacheFiles".

 (*) debug <mask>

Specify a numeric bitmask to control debugging in the kernel module.
Optional.  The default is zero (all off).  The following values can be
OR'd into the mask to collect various information:

1 Turn on trace of function entry (_enter() macros)
2 Turn on trace of function exit (_leave() macros)
4 Turn on trace of internal debug points (_debug())

This mask can also be set through sysfs, eg:

echo 5 >/sys/modules/cachefiles/parameters/debug

==================
STARTING THE CACHE
==================

The cache is started by running the daemon.  The daemon opens the cache device,
configures the cache and tells it to begin caching.  At that point the cache
binds to fscache and the cache becomes live.

The daemon is run as follows:

/sbin/cachefilesd [-d]* [-s] [-n] [-f <configfile>]

The flags are:

 (*) -d

Increase the debugging level.  This can be specified multiple times and
is cumulative with itself.

 (*) -s

Send messages to stderr instead of syslog.

 (*) -n

Don't daemonise and go into background.

 (*) -f <configfile>

Use an alternative configuration file rather than the default one.

===============
THINGS TO AVOID
===============

Do not mount other things within the cache as this will cause problems.  The
kernel module contains its own very cut-down path walking facility that ignores
mountpoints, but the daemon can't avoid them.

Do not create, rename or unlink files and directories in the cache whilst the
cache is active, as this may cause the state to become uncertain.

Renaming files in the cache might make objects appear to be other objects (the
filename is part of the lookup key).

Do not change or remove the extended attributes attached to cache files by the
cache as this will cause the cache state management to get confused.

Do not create files or directories in the cache, lest the cache get confused or
serve incorrect data.

Do not chmod files in the cache.  The module creates things with minimal
permissions to prevent random users being able to access them directly.

=============
CACHE CULLING
=============

The cache may need culling occasionally to make space.  This involves
discarding objects from the cache that have been used less recently than
anything else.  Culling is based on the access time of data objects.  Empty
directories are culled if not in use.

Cache culling is done on the basis of the percentage of blocks and the
percentage of files available in the underlying filesystem.  There are six
"limits":

 (*) brun
 (*) frun

     If the amount of free space and the number of available files in the cache
     rises above both these limits, then culling is turned off.

 (*) bcull
 (*) fcull

     If the amount of available space or the number of available files in the
     cache falls below either of these limits, then culling is started.

 (*) bstop
 (*) fstop

     If the amount of available space or the number of available files in the
     cache falls below either of these limits, then no further allocation of
     disk space or files is permitted until culling has raised things above
     these limits again.

These must be configured thusly:

0 <= bstop < bcull < brun < 100
0 <= fstop < fcull < frun < 100

Note that these are percentages of available space and available files, and do
_not_ appear as 100 minus the percentage displayed by the "df" program.

The userspace daemon scans the cache to build up a table of cullable objects.
These are then culled in least recently used order.  A new scan of the cache is
started as soon as space is made in the table.  Objects will be skipped if
their atimes have changed or if the kernel module says it is still using them.

===============
CACHE STRUCTURE
===============

The CacheFiles module will create two directories in the directory it was
given:

 (*) cache/

 (*) graveyard/

The active cache objects all reside in the first directory.  The CacheFiles
kernel module moves any retired or culled objects that it can't simply unlink
to the graveyard from which the daemon will actually delete them.

The daemon uses dnotify to monitor the graveyard directory, and will delete
anything that appears therein.

The module represents index objects as directories with the filename "I..." or
"J...".  Note that the "cache/" directory is itself a special index.

Data objects are represented as files if they have no children, or directories
if they do.  Their filenames all begin "D..." or "E...".  If represented as a
directory, data objects will have a file in the directory called "data" that
actually holds the data.

Special objects are similar to data objects, except their filenames begin
"S..." or "T...".

If an object has children, then it will be represented as a directory.
Immediately in the representative directory are a collection of directories
named for hash values of the child object keys with an '@' prepended.  Into
this directory, if possible, will be placed the representations of the child
objects:

INDEX     INDEX      INDEX                             DATA FILES
========= ========== ================================= ================
cache/@4a/I03nfs/@30/Ji000000000000000--fHg8hi8400
cache/@4a/I03nfs/@30/Ji000000000000000--fHg8hi8400/@75/Es0g000w...DB1ry
cache/@4a/I03nfs/@30/Ji000000000000000--fHg8hi8400/@75/Es0g000w...N22ry
cache/@4a/I03nfs/@30/Ji000000000000000--fHg8hi8400/@75/Es0g000w...FP1ry

If the key is so long that it exceeds NAME_MAX with the decorations added on to
it, then it will be cut into pieces, the first few of which will be used to
make a nest of directories, and the last one of which will be the objects
inside the last directory.  The names of the intermediate directories will have
'+' prepended:

J1223/@23/+xy...z/+kl...m/Epqr

Note that keys are raw data, and not only may they exceed NAME_MAX in size,
they may also contain things like '/' and NUL characters, and so they may not
be suitable for turning directly into a filename.

To handle this, CacheFiles will use a suitably printable filename directly and
"base-64" encode ones that aren't directly suitable.  The two versions of
object filenames indicate the encoding:

OBJECT TYPE PRINTABLE ENCODED
=============== =============== ===============
Index "I..." "J..."
Data "D..." "E..."
Special "S..." "T..."

Intermediate directories are always "@" or "+" as appropriate.

Each object in the cache has an extended attribute label that holds the object
type ID (required to distinguish special objects) and the auxiliary data from
the netfs.  The latter is used to detect stale objects in the cache and update
or retire them.

Note that CacheFiles will erase from the cache any file it doesn't recognise or
any file of an incorrect type (such as a FIFO file or a device file).

==========================
SECURITY MODEL AND SELINUX
==========================

CacheFiles is implemented to deal properly with the LSM security features of
the Linux kernel and the SELinux facility.

One of the problems that CacheFiles faces is that it is generally acting on
behalf of a process, and running in that process's context, and that includes a
security context that is not appropriate for accessing the cache - either
because the files in the cache are inaccessible to that process, or because if
the process creates a file in the cache, that file may be inaccessible to other
processes.

The way CacheFiles works is to temporarily change the security context (fsuid,
fsgid and actor security label) that the process acts as - without changing the
security context of the process when it the target of an operation performed by
some other process (so signalling and suchlike still work correctly).

When the CacheFiles module is asked to bind to its cache, it:

 (1) Finds the security label attached to the root cache directory and uses
     that as the security label with which it will create files.  By default,
     this is:

cachefiles_var_t

 (2) Finds the security label of the process which issued the bind request
     (presumed to be the cachefilesd daemon), which by default will be:

cachefilesd_t

     and asks LSM to supply a security ID as which it should act given the
     daemon's label.  By default, this will be:

cachefiles_kernel_t

     SELinux transitions the daemon's security ID to the module's security ID
     based on a rule of this form in the policy.

type_transition <daemon's-ID> kernel_t : process <module's-ID>;

     For instance:

type_transition cachefilesd_t kernel_t : process cachefiles_kernel_t;

The module's security ID gives it permission to create, move and remove files
and directories in the cache, to find and access directories and files in the
cache, to set and access extended attributes on cache objects, and to read and
write files in the cache.

The daemon's security ID gives it only a very restricted set of permissions: it
may scan directories, stat files and erase files and directories.  It may
not read or write files in the cache, and so it is precluded from accessing the
data cached therein; nor is it permitted to create new files in the cache.

There are policy source files available in:

http://people.redhat.com/~dhowells/fscache/cachefilesd-0.8.tar.bz2

and later versions.  In that tarball, see the files:

cachefilesd.te
cachefilesd.fc
cachefilesd.if

They are built and installed directly by the RPM.

If a non-RPM based system is being used, then copy the above files to their own
directory and run:

make -f /usr/share/selinux/devel/Makefile
semodule -i cachefilesd.pp

You will need checkpolicy and selinux-policy-devel installed prior to the
build.

By default, the cache is located in /var/fscache, but if it is desirable that
it should be elsewhere, than either the above policy files must be altered, or
an auxiliary policy must be installed to label the alternate location of the
cache.

For instructions on how to add an auxiliary policy to enable the cache to be
located elsewhere when SELinux is in enforcing mode, please see:

/usr/share/doc/cachefilesd-*/move-cache.txt

When the cachefilesd rpm is installed; alternatively, the document can be found
in the sources.

==================
A NOTE ON SECURITY
==================

CacheFiles makes use of the split security in the task_struct.  It allocates
its own task_security structure, and redirects current->act_as to point to it
when it acts on behalf of another process, in that process's context.

The reason it does this is that it calls vfs_mkdir() and suchlike rather than
bypassing security and calling inode ops directly.  Therefore the VFS and LSM
may deny the CacheFiles access to the cache data because under some
circumstances the caching code is running in the security context of whatever
process issued the original syscall on the netfs.

Furthermore, should CacheFiles create a file or directory, the security
parameters with that object is created (UID, GID, security label) would be
derived from that process that issued the system call, thus potentially
preventing other processes from accessing the cache - including CacheFiles's
cache management daemon (cachefilesd).

What is required is to temporarily override the security of the process that
issued the system call.  We can't, however, just do an in-place change of the
security data as that affects the process as an object, not just as a subject.
This means it may lose signals or ptrace events for example, and affects what
the process looks like in /proc.

So CacheFiles makes use of a logical split in the security between the
objective security (task->sec) and the subjective security (task->act_as).  The
objective security holds the intrinsic security properties of a process and is
never overridden.  This is what appears in /proc, and is what is used when a
process is the target of an operation by some other process (SIGKILL for
example).

The subjective security holds the active security properties of a process, and
may be overridden.  This is not seen externally, and is used whan a process
acts upon another object, for example SIGKILLing another process or opening a
file.

LSM hooks exist that allow SELinux (or Smack or whatever) to reject a request
for CacheFiles to run in a context of a specific security label, or to create
files and directories with another security label.

This documentation is added by the patch to:

Documentation/filesystems/caching/cachefiles.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 agoCacheFiles: Export things for CacheFiles
David Howells [Fri, 3 Apr 2009 15:42:40 +0000 (16:42 +0100)]
CacheFiles: Export things for CacheFiles

Export a number of functions for CacheFiles's use.

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 agoCacheFiles: Permit the page lock state to be monitored
David Howells [Fri, 3 Apr 2009 15:42:39 +0000 (16:42 +0100)]
CacheFiles: Permit the page lock state to be monitored

Add a function to install a monitor on the page lock waitqueue for a particular
page, thus allowing the page being unlocked to be detected.

This is used by CacheFiles to detect read completion on a page in the backing
filesystem so that it can then copy the data to the waiting netfs page.

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: Implement data I/O part of netfs API
David Howells [Fri, 3 Apr 2009 15:42:39 +0000 (16:42 +0100)]
FS-Cache: Implement data I/O part of netfs API

Implement the data I/O part of the FS-Cache netfs API.  The documentation and
API header file were added in a previous patch.

This patch implements the following functions for the netfs to call:

 (*) fscache_attr_changed().

     Indicate that the object has changed its attributes.  The only attribute
     currently recorded is the file size.  Only pages within the set file size
     will be stored in the cache.

     This operation is submitted for asynchronous processing, and will return
     immediately.  It will return -ENOMEM if an out of memory error is
     encountered, -ENOBUFS if the object is not actually cached, or 0 if the
     operation is successfully queued.

 (*) fscache_read_or_alloc_page().
 (*) fscache_read_or_alloc_pages().

     Request data be fetched from the disk, and allocate internal metadata to
     track the netfs pages and reserve disk space for unknown pages.

     These operations perform semi-asynchronous data reads.  Upon returning
     they will indicate which pages they think can be retrieved from disk, and
     will have set in progress attempts to retrieve those pages.

     These will return, in order of preference, -ENOMEM on memory allocation
     error, -ERESTARTSYS if a signal interrupted proceedings, -ENODATA if one
     or more requested pages are not yet cached, -ENOBUFS if the object is not
     actually cached or if there isn't space for future pages to be cached on
     this object, or 0 if successful.

     In the case of the multipage function, the pages for which reads are set
     in progress will be removed from the list and the page count decreased
     appropriately.

     If any read operations should fail, the completion function will be given
     an error, and will also be passed contextual information to allow the
     netfs to fall back to querying the server for the absent pages.

     For each successful read, the page completion function will also be
     called.

     Any pages subsequently tracked by the cache will have PG_fscache set upon
     them on return.  fscache_uncache_page() must be called for such pages.

     If supplied by the netfs, the mark_pages_cached() cookie op will be
     invoked for any pages now tracked.

 (*) fscache_alloc_page().

     Allocate internal metadata to track a netfs page and reserve disk space.

     This will return -ENOMEM on memory allocation error, -ERESTARTSYS on
     signal, -ENOBUFS if the object isn't cached, or there isn't enough space
     in the cache, or 0 if successful.

     Any pages subsequently tracked by the cache will have PG_fscache set upon
     them on return.  fscache_uncache_page() must be called for such pages.

     If supplied by the netfs, the mark_pages_cached() cookie op will be
     invoked for any pages now tracked.

 (*) fscache_write_page().

     Request data be stored to disk.  This may only be called on pages that
     have been read or alloc'd by the above three functions and have not yet
     been uncached.

     This will return -ENOMEM on memory allocation error, -ERESTARTSYS on
     signal, -ENOBUFS if the object isn't cached, or there isn't immediately
     enough space in the cache, or 0 if successful.

     On a successful return, this operation will have queued the page for
     asynchronous writing to the cache.  The page will be returned with
     PG_fscache_write set until the write completes one way or another.  The
     caller will not be notified if the write fails due to an I/O error.  If
     that happens, the object will become available and all pending writes will
     be aborted.

     Note that the cache may batch up page writes, and so it may take a while
     to get around to writing them out.

     The caller must assume that until PG_fscache_write is cleared the page is
     use by the cache.  Any changes made to the page may be reflected on disk.
     The page may even be under DMA.

 (*) fscache_uncache_page().

     Indicate that the cache should stop tracking a page previously read or
     alloc'd from the cache.  If the page was alloc'd only, but unwritten, it
     will not appear on disk.

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 and document asynchronous operation handling
David Howells [Fri, 3 Apr 2009 15:42:39 +0000 (16:42 +0100)]
FS-Cache: Add and document asynchronous operation handling

Add and document asynchronous operation handling for use by FS-Cache's data
storage and retrieval routines.

The following documentation is added to:

Documentation/filesystems/caching/operations.txt

       ================================
       ASYNCHRONOUS OPERATIONS HANDLING
       ================================

========
OVERVIEW
========

FS-Cache has an asynchronous operations handling facility that it uses for its
data storage and retrieval routines.  Its operations are represented by
fscache_operation structs, though these are usually embedded into some other
structure.

This facility is available to and expected to be be used by the cache backends,
and FS-Cache will create operations and pass them off to the appropriate cache
backend for completion.

To make use of this facility, <linux/fscache-cache.h> should be #included.

===============================
OPERATION RECORD INITIALISATION
===============================

An operation is recorded in an fscache_operation struct:

struct fscache_operation {
union {
struct work_struct fast_work;
struct slow_work slow_work;
};
unsigned long flags;
fscache_operation_processor_t processor;
...
};

Someone wanting to issue an operation should allocate something with this
struct embedded in it.  They should initialise it by calling:

void fscache_operation_init(struct fscache_operation *op,
    fscache_operation_release_t release);

with the operation to be initialised and the release function to use.

The op->flags parameter should be set to indicate the CPU time provision and
the exclusivity (see the Parameters section).

The op->fast_work, op->slow_work and op->processor flags should be set as
appropriate for the CPU time provision (see the Parameters section).

FSCACHE_OP_WAITING may be set in op->flags prior to each submission of the
operation and waited for afterwards.

==========
PARAMETERS
==========

There are a number of parameters that can be set in the operation record's flag
parameter.  There are three options for the provision of CPU time in these
operations:

 (1) The operation may be done synchronously (FSCACHE_OP_MYTHREAD).  A thread
     may decide it wants to handle an operation itself without deferring it to
     another thread.

     This is, for example, used in read operations for calling readpages() on
     the backing filesystem in CacheFiles.  Although readpages() does an
     asynchronous data fetch, the determination of whether pages exist is done
     synchronously - and the netfs does not proceed until this has been
     determined.

     If this option is to be used, FSCACHE_OP_WAITING must be set in op->flags
     before submitting the operation, and the operating thread must wait for it
     to be cleared before proceeding:

wait_on_bit(&op->flags, FSCACHE_OP_WAITING,
    fscache_wait_bit, TASK_UNINTERRUPTIBLE);

 (2) The operation may be fast asynchronous (FSCACHE_OP_FAST), in which case it
     will be given to keventd to process.  Such an operation is not permitted
     to sleep on I/O.

     This is, for example, used by CacheFiles to copy data from a backing fs
     page to a netfs page after the backing fs has read the page in.

     If this option is used, op->fast_work and op->processor must be
     initialised before submitting the operation:

INIT_WORK(&op->fast_work, do_some_work);

 (3) The operation may be slow asynchronous (FSCACHE_OP_SLOW), in which case it
     will be given to the slow work facility to process.  Such an operation is
     permitted to sleep on I/O.

     This is, for example, used by FS-Cache to handle background writes of
     pages that have just been fetched from a remote server.

     If this option is used, op->slow_work and op->processor must be
     initialised before submitting the operation:

fscache_operation_init_slow(op, processor)

Furthermore, operations may be one of two types:

 (1) Exclusive (FSCACHE_OP_EXCLUSIVE).  Operations of this type may not run in
     conjunction with any other operation on the object being operated upon.

     An example of this is the attribute change operation, in which the file
     being written to may need truncation.

 (2) Shareable.  Operations of this type may be running simultaneously.  It's
     up to the operation implementation to prevent interference between other
     operations running at the same time.

=========
PROCEDURE
=========

Operations are used through the following procedure:

 (1) The submitting thread must allocate the operation and initialise it
     itself.  Normally this would be part of a more specific structure with the
     generic op embedded within.

 (2) The submitting thread must then submit the operation for processing using
     one of the following two functions:

int fscache_submit_op(struct fscache_object *object,
      struct fscache_operation *op);

int fscache_submit_exclusive_op(struct fscache_object *object,
struct fscache_operation *op);

     The first function should be used to submit non-exclusive ops and the
     second to submit exclusive ones.  The caller must still set the
     FSCACHE_OP_EXCLUSIVE flag.

     If successful, both functions will assign the operation to the specified
     object and return 0.  -ENOBUFS will be returned if the object specified is
     permanently unavailable.

     The operation manager will defer operations on an object that is still
     undergoing lookup or creation.  The operation will also be deferred if an
     operation of conflicting exclusivity is in progress on the object.

     If the operation is asynchronous, the manager will retain a reference to
     it, so the caller should put their reference to it by passing it to:

void fscache_put_operation(struct fscache_operation *op);

 (3) If the submitting thread wants to do the work itself, and has marked the
     operation with FSCACHE_OP_MYTHREAD, then it should monitor
     FSCACHE_OP_WAITING as described above and check the state of the object if
     necessary (the object might have died whilst the thread was waiting).

     When it has finished doing its processing, it should call
     fscache_put_operation() on it.

 (4) The operation holds an effective lock upon the object, preventing other
     exclusive ops conflicting until it is released.  The operation can be
     enqueued for further immediate asynchronous processing by adjusting the
     CPU time provisioning option if necessary, eg:

op->flags &= ~FSCACHE_OP_TYPE;
op->flags |= ~FSCACHE_OP_FAST;

     and calling:

void fscache_enqueue_operation(struct fscache_operation *op)

     This can be used to allow other things to have use of the worker thread
     pools.

=====================
ASYNCHRONOUS CALLBACK
=====================

When used in asynchronous mode, the worker thread pool will invoke the
processor method with a pointer to the operation.  This should then get at the
container struct by using container_of():

static void fscache_write_op(struct fscache_operation *_op)
{
struct fscache_storage *op =
container_of(_op, struct fscache_storage, op);
...
}

The caller holds a reference on the operation, and will invoke
fscache_put_operation() when the processor function returns.  The processor
function is at liberty to call fscache_enqueue_operation() or to take extra
references.

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>