summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@athlon.transmeta.com>2002-02-04 20:18:41 -0800
committerLinus Torvalds <torvalds@athlon.transmeta.com>2002-02-04 20:18:41 -0800
commitc37fa164f793735b32aa3f53154ff1a7659e6442 (patch)
treebfd5741e0e9b26374f2dc1668905cf6f12c18aba /include/linux
parent1d66e22e0f6b1cca563d240f90697b05860dca4d (diff)
v2.4.9.9 -> v2.4.9.10
- Alan Cox: continued merging - Mingming Cao: make msgrcv/shmat check the queue/segment ID's properly - Greg KH: USB serial init failure fix, Xircom serial converter driver - Neil Brown: nsfd/raid/md/lockd cleanups - Ingo Molnar: multipath RAID personality, raid xor update - Hugh Dickins/Marcelo Tosatti: swapin read-ahead race fix - Vojtech Pavlik: fix up some of the infrastructure for x86-64 - Robert Love: AMD 761 AGP GART support - Jens Axboe: fix SCSI-generic queue handling race - me: be sane about page reference bits
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/agp_backend.h1
-rw-r--r--include/linux/brlock.h2
-rw-r--r--include/linux/fs.h5
-rw-r--r--include/linux/genhd.h16
-rw-r--r--include/linux/i2c-algo-ite.h69
-rw-r--r--include/linux/jffs2.h164
-rw-r--r--include/linux/jffs2_fs_i.h62
-rw-r--r--include/linux/jffs2_fs_sb.h84
-rw-r--r--include/linux/mm.h12
-rw-r--r--include/linux/mtd/doc2000.h2
-rw-r--r--include/linux/nfsd/nfsd.h5
-rw-r--r--include/linux/raid/md_compatible.h4
-rw-r--r--include/linux/raid/md_k.h11
-rw-r--r--include/linux/raid/md_u.h1
-rw-r--r--include/linux/raid/multipath.h87
-rw-r--r--include/linux/swap.h4
16 files changed, 508 insertions, 21 deletions
diff --git a/include/linux/agp_backend.h b/include/linux/agp_backend.h
index fef8b4776e95..e29bba623289 100644
--- a/include/linux/agp_backend.h
+++ b/include/linux/agp_backend.h
@@ -58,6 +58,7 @@ enum chipset_type {
SIS_GENERIC,
AMD_GENERIC,
AMD_IRONGATE,
+ AMD_761,
ALI_M1541,
ALI_M1621,
ALI_M1631,
diff --git a/include/linux/brlock.h b/include/linux/brlock.h
index c805304f11e6..208c4573381a 100644
--- a/include/linux/brlock.h
+++ b/include/linux/brlock.h
@@ -45,7 +45,7 @@ enum brlock_indices {
#include <linux/cache.h>
#include <linux/spinlock.h>
-#if defined(__i386__) || defined(__ia64__)
+#if defined(__i386__) || defined(__ia64__) || defined(__x86_64__)
#define __BRLOCK_USE_ATOMICS
#else
#undef __BRLOCK_USE_ATOMICS
diff --git a/include/linux/fs.h b/include/linux/fs.h
index b73ddd8ade82..549459db59f9 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -306,6 +306,8 @@ extern void set_bh_page(struct buffer_head *bh, struct page *page, unsigned long
#include <linux/ncp_fs_i.h>
#include <linux/proc_fs_i.h>
#include <linux/usbdev_fs_i.h>
+#include <linux/jffs2_fs_i.h>
+#include <linux/cramfs_fs_sb.h>
/*
* Attribute flags. These should be or-ed together to figure out what
@@ -481,6 +483,7 @@ struct inode {
struct proc_inode_info proc_i;
struct socket socket_i;
struct usbdev_inode_info usbdev_i;
+ struct jffs2_inode_info jffs2_i;
void *generic_ip;
} u;
};
@@ -658,6 +661,7 @@ struct quota_mount_options
#include <linux/ncp_fs_sb.h>
#include <linux/usbdev_fs_sb.h>
#include <linux/cramfs_fs_sb.h>
+#include <linux/jffs2_fs_sb.h>
extern struct list_head super_blocks;
extern spinlock_t sb_lock;
@@ -713,6 +717,7 @@ struct super_block {
struct udf_sb_info udf_sb;
struct ncp_sb_info ncpfs_sb;
struct usbdev_sb_info usbdevfs_sb;
+ struct jffs2_sb_info jffs2_sb;
struct cramfs_sb_info cramfs_sb;
void *generic_sbp;
} u;
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 147e67fbdd6e..7aea8bc88b32 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -91,22 +91,22 @@ extern struct gendisk *get_gendisk(kdev_t dev);
struct solaris_x86_slice {
ushort s_tag; /* ID tag of partition */
- ushort s_flag; /* permision flags */
- daddr_t s_start; /* start sector no of partition */
- long s_size; /* # of blocks in partition */
+ ushort s_flag; /* permission flags */
+ unsigned int s_start; /* start sector no of partition */
+ unsigned int s_size; /* # of blocks in partition */
};
struct solaris_x86_vtoc {
- unsigned long v_bootinfo[3]; /* info needed by mboot (unsupported) */
- unsigned long v_sanity; /* to verify vtoc sanity */
- unsigned long v_version; /* layout version */
+ unsigned int v_bootinfo[3]; /* info needed by mboot (unsupported) */
+ unsigned int v_sanity; /* to verify vtoc sanity */
+ unsigned int v_version; /* layout version */
char v_volume[8]; /* volume name */
ushort v_sectorsz; /* sector size in bytes */
ushort v_nparts; /* number of partitions */
- unsigned long v_reserved[10]; /* free space */
+ unsigned int v_reserved[10]; /* free space */
struct solaris_x86_slice
v_slice[SOLARIS_X86_NUMSLICE]; /* slice headers */
- time_t timestamp[SOLARIS_X86_NUMSLICE]; /* timestamp (unsupported) */
+ unsigned int timestamp[SOLARIS_X86_NUMSLICE]; /* timestamp (unsupported) */
char v_asciilabel[128]; /* for compatibility */
};
diff --git a/include/linux/i2c-algo-ite.h b/include/linux/i2c-algo-ite.h
new file mode 100644
index 000000000000..26a8b89855f1
--- /dev/null
+++ b/include/linux/i2c-algo-ite.h
@@ -0,0 +1,69 @@
+/* ------------------------------------------------------------------------- */
+/* i2c-algo-ite.h i2c driver algorithms for ITE IIC adapters */
+/* ------------------------------------------------------------------------- */
+/* Copyright (C) 1995-97 Simon G. Vogl
+ 1998-99 Hans Berglund
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+/* ------------------------------------------------------------------------- */
+
+/* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and even
+ Frodo Looijaard <frodol@dds.nl> */
+
+/* Modifications by MontaVista Software, 2001
+ Changes made to support the ITE IIC peripheral */
+
+
+#ifndef I2C_ALGO_ITE_H
+#define I2C_ALGO_ITE_H 1
+
+#include <linux/i2c.h>
+
+/* Example of a sequential read request:
+ struct i2c_iic_msg s_msg;
+
+ s_msg.addr=device_address;
+ s_msg.len=length;
+ s_msg.buf=buffer;
+ s_msg.waddr=word_address;
+ ioctl(file,I2C_SREAD, &s_msg);
+ */
+#define I2C_SREAD 0x780 /* SREAD ioctl command */
+
+struct i2c_iic_msg {
+ __u16 addr; /* device address */
+ __u16 waddr; /* word address */
+ short len; /* msg length */
+ char *buf; /* pointer to msg data */
+};
+
+struct i2c_algo_iic_data {
+ void *data; /* private data for lolevel routines */
+ void (*setiic) (void *data, int ctl, int val);
+ int (*getiic) (void *data, int ctl);
+ int (*getown) (void *data);
+ int (*getclock) (void *data);
+ void (*waitforpin) (void);
+
+ /* local settings */
+ int udelay;
+ int mdelay;
+ int timeout;
+};
+
+int i2c_iic_add_bus(struct i2c_adapter *);
+int i2c_iic_del_bus(struct i2c_adapter *);
+
+#endif /* I2C_ALGO_ITE_H */
diff --git a/include/linux/jffs2.h b/include/linux/jffs2.h
new file mode 100644
index 000000000000..37d3d931e416
--- /dev/null
+++ b/include/linux/jffs2.h
@@ -0,0 +1,164 @@
+/*
+ * JFFS2 -- Journalling Flash File System, Version 2.
+ *
+ * Copyright (C) 2001 Red Hat, Inc.
+ *
+ * Created by David Woodhouse <dwmw2@cambridge.redhat.com>
+ *
+ * The original JFFS, from which the design for JFFS2 was derived,
+ * was designed and implemented by Axis Communications AB.
+ *
+ * The contents of this file are subject to the Red Hat eCos Public
+ * License Version 1.1 (the "Licence"); you may not use this file
+ * except in compliance with the Licence. You may obtain a copy of
+ * the Licence at http://www.redhat.com/
+ *
+ * Software distributed under the Licence is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing rights and
+ * limitations under the Licence.
+ *
+ * The Original Code is JFFS2 - Journalling Flash File System, version 2
+ *
+ * Alternatively, the contents of this file may be used under the
+ * terms of the GNU General Public License version 2 (the "GPL"), in
+ * which case the provisions of the GPL are applicable instead of the
+ * above. If you wish to allow the use of your version of this file
+ * only under the terms of the GPL and not to allow others to use your
+ * version of this file under the RHEPL, indicate your decision by
+ * deleting the provisions above and replace them with the notice and
+ * other provisions required by the GPL. If you do not delete the
+ * provisions above, a recipient may use your version of this file
+ * under either the RHEPL or the GPL.
+ *
+ * $Id: jffs2.h,v 1.18 2001/03/25 22:36:12 dwmw2 Exp $
+ *
+ */
+
+#ifndef __LINUX_JFFS2_H__
+#define __LINUX_JFFS2_H__
+
+#include <asm/types.h>
+#define JFFS2_SUPER_MAGIC 0x72b6
+
+/* Values we may expect to find in the 'magic' field */
+#define JFFS2_OLD_MAGIC_BITMASK 0x1984
+#define JFFS2_MAGIC_BITMASK 0x1985
+#define KSAMTIB_CIGAM_2SFFJ 0x5981 /* For detecting wrong-endian fs */
+#define JFFS2_EMPTY_BITMASK 0xffff
+#define JFFS2_DIRTY_BITMASK 0x0000
+
+/* We only allow a single char for length, and 0xFF is empty flash so
+ we don't want it confused with a real length. Hence max 254.
+*/
+#define JFFS2_MAX_NAME_LEN 254
+
+/* How small can we sensibly write nodes? */
+#define JFFS2_MIN_DATA_LEN 128
+
+#define JFFS2_COMPR_NONE 0x00
+#define JFFS2_COMPR_ZERO 0x01
+#define JFFS2_COMPR_RTIME 0x02
+#define JFFS2_COMPR_RUBINMIPS 0x03
+#define JFFS2_COMPR_COPY 0x04
+#define JFFS2_COMPR_DYNRUBIN 0x05
+#define JFFS2_COMPR_ZLIB 0x06
+/* Compatibility flags. */
+#define JFFS2_COMPAT_MASK 0xc000 /* What do to if an unknown nodetype is found */
+#define JFFS2_NODE_ACCURATE 0x2000
+/* INCOMPAT: Fail to mount the filesystem */
+#define JFFS2_FEATURE_INCOMPAT 0xc000
+/* ROCOMPAT: Mount read-only */
+#define JFFS2_FEATURE_ROCOMPAT 0x8000
+/* RWCOMPAT_COPY: Mount read/write, and copy the node when it's GC'd */
+#define JFFS2_FEATURE_RWCOMPAT_COPY 0x4000
+/* RWCOMPAT_DELETE: Mount read/write, and delete the node when it's GC'd */
+#define JFFS2_FEATURE_RWCOMPAT_DELETE 0x0000
+
+#define JFFS2_NODETYPE_DIRENT (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 1)
+#define JFFS2_NODETYPE_INODE (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 2)
+#define JFFS2_NODETYPE_CLEANMARKER (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3)
+
+// Maybe later...
+//#define JFFS2_NODETYPE_CHECKPOINT (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3)
+//#define JFFS2_NODETYPE_OPTIONS (JFFS2_FEATURE_RWCOMPAT_COPY | JFFS2_NODE_ACCURATE | 4)
+
+/* Same as the non_ECC versions, but with extra space for real
+ * ECC instead of just the checksum. For use on NAND flash
+ */
+//#define JFFS2_NODETYPE_DIRENT_ECC (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 5)
+//#define JFFS2_NODETYPE_INODE_ECC (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 6)
+
+#define JFFS2_INO_FLAG_PREREAD 1 /* Do read_inode() for this one at
+ mount time, don't wait for it to
+ happen later */
+#define JFFS2_INO_FLAG_USERCOMPR 2 /* User has requested a specific
+ compression type */
+
+
+struct jffs2_unknown_node
+{
+ /* All start like this */
+ __u16 magic;
+ __u16 nodetype;
+ __u32 totlen; /* So we can skip over nodes we don't grok */
+ __u32 hdr_crc;
+};
+
+struct jffs2_raw_dirent
+{
+ __u16 magic;
+ __u16 nodetype; /* == JFFS_NODETYPE_DIRENT */
+ __u32 totlen;
+ __u32 hdr_crc;
+ __u32 pino;
+ __u32 version;
+ __u32 ino; /* == zero for unlink */
+ __u32 mctime;
+ __u8 nsize;
+ __u8 type;
+ __u8 unused[2];
+ __u32 node_crc;
+ __u32 name_crc;
+ __u8 name[0];
+};
+
+/* The JFFS2 raw inode structure: Used for storage on physical media. */
+/* The uid, gid, atime, mtime and ctime members could be longer, but
+ are left like this for space efficiency. If and when people decide
+ they really need them extended, it's simple enough to add support for
+ a new type of raw node.
+*/
+struct jffs2_raw_inode
+{
+ __u16 magic; /* A constant magic number. */
+ __u16 nodetype; /* == JFFS_NODETYPE_INODE */
+ __u32 totlen; /* Total length of this node (inc data, etc.) */
+ __u32 hdr_crc;
+ __u32 ino; /* Inode number. */
+ __u32 version; /* Version number. */
+ __u32 mode; /* The file's type or mode. */
+ __u16 uid; /* The file's owner. */
+ __u16 gid; /* The file's group. */
+ __u32 isize; /* Total resultant size of this inode (used for truncations) */
+ __u32 atime; /* Last access time. */
+ __u32 mtime; /* Last modification time. */
+ __u32 ctime; /* Change time. */
+ __u32 offset; /* Where to begin to write. */
+ __u32 csize; /* (Compressed) data size */
+ __u32 dsize; /* Size of the node's data. (after decompression) */
+ __u8 compr; /* Compression algorithm used */
+ __u8 usercompr; /* Compression algorithm requested by the user */
+ __u16 flags; /* See JFFS2_INO_FLAG_* */
+ __u32 data_crc; /* CRC for the (compressed) data. */
+ __u32 node_crc; /* CRC for the raw inode (excluding data) */
+// __u8 data[dsize];
+};
+
+union jffs2_node_union {
+ struct jffs2_raw_inode i;
+ struct jffs2_raw_dirent d;
+ struct jffs2_unknown_node u;
+};
+
+#endif /* __LINUX_JFFS2_H__ */
diff --git a/include/linux/jffs2_fs_i.h b/include/linux/jffs2_fs_i.h
new file mode 100644
index 000000000000..6121a882fa2e
--- /dev/null
+++ b/include/linux/jffs2_fs_i.h
@@ -0,0 +1,62 @@
+/* $Id: jffs2_fs_i.h,v 1.8 2001/04/18 13:05:28 dwmw2 Exp $ */
+
+#ifndef _JFFS2_FS_I
+#define _JFFS2_FS_I
+
+/* Include the pipe_inode_info at the beginning so that we can still
+ use the storage space in the inode when we have a pipe inode.
+ This sucks.
+*/
+
+#undef THISSUCKS /* Only for 2.2 */
+#ifdef THISSUCKS
+#include <linux/pipe_fs_i.h>
+#endif
+
+struct jffs2_inode_info {
+#ifdef THISSUCKS
+ struct pipe_inode_info pipecrap;
+#endif
+ /* We need an internal semaphore similar to inode->i_sem.
+ Unfortunately, we can't used the existing one, because
+ either the GC would deadlock, or we'd have to release it
+ before letting GC proceed. Or we'd have to put ugliness
+ into the GC code so it didn't attempt to obtain the i_sem
+ for the inode(s) which are already locked */
+ struct semaphore sem;
+
+ /* The highest (datanode) version number used for this ino */
+ __u32 highest_version;
+
+ /* List of data fragments which make up the file */
+ struct jffs2_node_frag *fraglist;
+
+ /* There may be one datanode which isn't referenced by any of the
+ above fragments, if it contains a metadata update but no actual
+ data - or if this is a directory inode */
+ /* This also holds the _only_ dnode for symlinks/device nodes,
+ etc. */
+ struct jffs2_full_dnode *metadata;
+
+ /* Directory entries */
+ struct jffs2_full_dirent *dents;
+
+ /* Some stuff we just have to keep in-core at all times, for each inode. */
+ struct jffs2_inode_cache *inocache;
+
+ /* Keep a pointer to the last physical node in the list. We don't
+ use the doubly-linked lists because we don't want to increase
+ the memory usage that much. This is simpler */
+ // struct jffs2_raw_node_ref *lastnode;
+ __u16 flags;
+ __u8 usercompr;
+};
+
+#ifdef JFFS2_OUT_OF_KERNEL
+#define JFFS2_INODE_INFO(i) ((struct jffs2_inode_info *) &(i)->u)
+#else
+#define JFFS2_INODE_INFO(i) (&i->u.jffs2_i)
+#endif
+
+#endif /* _JFFS2_FS_I */
+
diff --git a/include/linux/jffs2_fs_sb.h b/include/linux/jffs2_fs_sb.h
new file mode 100644
index 000000000000..9e9235f0a058
--- /dev/null
+++ b/include/linux/jffs2_fs_sb.h
@@ -0,0 +1,84 @@
+/* $Id: jffs2_fs_sb.h,v 1.15 2001/04/18 13:05:28 dwmw2 Exp $ */
+
+#ifndef _JFFS2_FS_SB
+#define _JFFS2_FS_SB
+
+#include <linux/types.h>
+#include <linux/spinlock.h>
+#include <linux/completion.h>
+#include <asm/semaphore.h>
+#include <linux/list.h>
+
+#define INOCACHE_HASHSIZE 1
+
+#define JFFS2_SB_FLAG_RO 1
+
+/* A struct for the overall file system control. Pointers to
+ jffs2_sb_info structs are named `c' in the source code.
+ Nee jffs_control
+*/
+struct jffs2_sb_info {
+ struct mtd_info *mtd;
+
+ __u32 highest_ino;
+ unsigned int flags;
+ spinlock_t nodelist_lock;
+
+ // pid_t thread_pid; /* GC thread's PID */
+ struct task_struct *gc_task; /* GC task struct */
+ struct semaphore gc_thread_sem; /* GC thread startup mutex */
+ struct completion gc_thread_exit; /* GC thread exit completion */
+
+ // __u32 gc_minfree_threshold; /* GC trigger thresholds */
+ // __u32 gc_maxdirty_threshold;
+
+ struct semaphore alloc_sem; /* Used to protect all the following
+ fields, and also to protect against
+ out-of-order writing of nodes.
+ And GC.
+ */
+ __u32 flash_size;
+ __u32 used_size;
+ __u32 dirty_size;
+ __u32 free_size;
+ __u32 erasing_size;
+ __u32 bad_size;
+ __u32 sector_size;
+ // __u32 min_free_size;
+ // __u32 max_chunk_size;
+
+ __u32 nr_free_blocks;
+ __u32 nr_erasing_blocks;
+
+ __u32 nr_blocks;
+ struct jffs2_eraseblock *blocks; /* The whole array of blocks. Used for getting blocks
+ * from the offset (blocks[ofs / sector_size]) */
+ struct jffs2_eraseblock *nextblock; /* The block we're currently filling */
+
+ struct jffs2_eraseblock *gcblock; /* The block we're currently garbage-collecting */
+
+ struct list_head clean_list; /* Blocks 100% full of clean data */
+ struct list_head dirty_list; /* Blocks with some dirty space */
+ struct list_head erasing_list; /* Blocks which are currently erasing */
+ struct list_head erase_pending_list; /* Blocks which need erasing */
+ struct list_head erase_complete_list; /* Blocks which are erased and need the clean marker written to them */
+ struct list_head free_list; /* Blocks which are free and ready to be used */
+ struct list_head bad_list; /* Bad blocks. */
+ struct list_head bad_used_list; /* Bad blocks with valid data in. */
+
+ spinlock_t erase_completion_lock; /* Protect free_list and erasing_list
+ against erase completion handler */
+ wait_queue_head_t erase_wait; /* For waiting for erases to complete */
+ struct jffs2_inode_cache *inocache_list[INOCACHE_HASHSIZE];
+ spinlock_t inocache_lock;
+};
+
+#ifdef JFFS2_OUT_OF_KERNEL
+#define JFFS2_SB_INFO(sb) ((struct jffs2_sb_info *) &(sb)->u)
+#else
+#define JFFS2_SB_INFO(sb) (&sb->u.jffs2_sb)
+#endif
+
+#define OFNI_BS_2SFFJ(c) ((struct super_block *) ( ((char *)c) - ((char *)(&((struct super_block *)NULL)->u)) ) )
+
+#endif /* _JFFS2_FB_SB */
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 9bd982bb876b..949bb22391f7 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -187,7 +187,7 @@ typedef struct page {
* Various page->flags bits:
*
* PG_reserved is set for special pages, which can never be swapped
- * out. Some of them might not even exist (eg. empty_bad_page)...
+ * out. Some of them might not even exist (eg empty_bad_page)...
*
* Multiple processes may "see" the same page. E.g. for untouched
* mappings of /dev/null, all processes see the same page full of
@@ -210,8 +210,8 @@ typedef struct page {
* The following discussion applies only to them.
*
* A page may belong to an inode's memory mapping. In this case,
- * page->mapping is the pointer to the inode, and page->offset is the
- * file offset of the page (not necessarily a multiple of PAGE_SIZE).
+ * page->mapping is the pointer to the inode, and page->index is the
+ * file offset of the page, in units of PAGE_CACHE_SIZE.
*
* A page may have buffers allocated to it. In this case,
* page->buffers is a circular list of these buffer heads. Else,
@@ -226,7 +226,7 @@ typedef struct page {
* using the page->list list_head. These fields are also used for
* freelist managemet (when page->count==0).
*
- * There is also a hash table mapping (inode,offset) to the page
+ * There is also a hash table mapping (mapping,index) to the page
* in memory if present. The lists for this hash table use the fields
* page->next_hash and page->pprev_hash.
*
@@ -245,7 +245,7 @@ typedef struct page {
*
* For choosing which pages to swap out, inode pages carry a
* PG_referenced bit, which is set any time the system accesses
- * that page through the (inode,offset) hash table. This referenced
+ * that page through the (mapping,index) hash table. This referenced
* bit, together with the referenced bit in the page tables, is used
* to manipulate page->age and move the page across the active,
* inactive_dirty and inactive_clean lists.
@@ -260,7 +260,7 @@ typedef struct page {
* PG_error is set to indicate that an I/O error occurred on this page.
*
* PG_arch_1 is an architecture specific page state bit. The generic
- * code guarentees that this bit is cleared for a page when it first
+ * code guarantees that this bit is cleared for a page when it first
* is entered into the page cache.
*
* PG_highmem pages are not permanently mapped into the kernel virtual
diff --git a/include/linux/mtd/doc2000.h b/include/linux/mtd/doc2000.h
index c8e143a1f723..15bd7d44d134 100644
--- a/include/linux/mtd/doc2000.h
+++ b/include/linux/mtd/doc2000.h
@@ -58,7 +58,7 @@
#endif
-#if defined(__i386__)
+#if defined(__i386__) || defined(__x86_64__)
#define USE_MEMCPY
#endif
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h
index 571557de8762..53d035c7479a 100644
--- a/include/linux/nfsd/nfsd.h
+++ b/include/linux/nfsd/nfsd.h
@@ -171,6 +171,11 @@ void nfsd_lockd_unexport(struct svc_client *);
#define nfserr_badtype __constant_htonl(NFSERR_BADTYPE)
#define nfserr_jukebox __constant_htonl(NFSERR_JUKEBOX)
+/* error code for internal use - if a request fails due to
+ * kmalloc failure, it gets dropped. Client should resend eventually
+ */
+#define nfserr_dropit __constant_htonl(30000)
+
/* Check for dir entries '.' and '..' */
#define isdotent(n, l) (l < 3 && n[0] == '.' && (l == 1 || n[1] == '.'))
diff --git a/include/linux/raid/md_compatible.h b/include/linux/raid/md_compatible.h
index f693fcf58e02..74dadd4bb663 100644
--- a/include/linux/raid/md_compatible.h
+++ b/include/linux/raid/md_compatible.h
@@ -27,12 +27,14 @@
/* 000 */
#define md__get_free_pages(x,y) __get_free_pages(x,y)
-#ifdef __i386__
+#if defined(__i386__) || defined(__x86_64__)
/* 001 */
static __inline__ int md_cpu_has_mmx(void)
{
return test_bit(X86_FEATURE_MMX, &boot_cpu_data.x86_capability);
}
+#else
+#define md_cpu_has_mmx(x) (0)
#endif
/* 002 */
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h
index 3b51e92fe555..851df24f4a5a 100644
--- a/include/linux/raid/md_k.h
+++ b/include/linux/raid/md_k.h
@@ -17,17 +17,18 @@
#define MD_RESERVED 0UL
#define LINEAR 1UL
-#define STRIPED 2UL
-#define RAID0 STRIPED
+#define RAID0 2UL
#define RAID1 3UL
#define RAID5 4UL
#define TRANSLUCENT 5UL
#define HSM 6UL
-#define MAX_PERSONALITY 7UL
+#define MULTIPATH 7UL
+#define MAX_PERSONALITY 8UL
static inline int pers_to_level (int pers)
{
switch (pers) {
+ case MULTIPATH: return -4;
case HSM: return -3;
case TRANSLUCENT: return -2;
case LINEAR: return -1;
@@ -35,7 +36,7 @@ static inline int pers_to_level (int pers)
case RAID1: return 1;
case RAID5: return 5;
}
- panic("pers_to_level()");
+ BUG();
return MD_RESERVED;
}
@@ -171,6 +172,7 @@ struct mdk_rdev_s
mdp_super_t *sb;
unsigned long sb_offset;
+ int alias_device; /* device alias to the same disk */
int faulty; /* if faulty do not issue IO requests */
int desc_nr; /* descriptor index in the superblock */
};
@@ -258,6 +260,7 @@ static inline kdev_t mddev_to_kdev(mddev_t * mddev)
extern mdk_rdev_t * find_rdev(mddev_t * mddev, kdev_t dev);
extern mdk_rdev_t * find_rdev_nr(mddev_t *mddev, int nr);
+extern mdp_disk_t *get_spare(mddev_t *mddev);
/*
* iterates through some rdev ringlist. It's safe to remove the
diff --git a/include/linux/raid/md_u.h b/include/linux/raid/md_u.h
index 22a1543808c9..a2df5c2a42af 100644
--- a/include/linux/raid/md_u.h
+++ b/include/linux/raid/md_u.h
@@ -35,6 +35,7 @@
#define PROTECT_ARRAY _IO (MD_MAJOR, 0x27)
#define HOT_ADD_DISK _IO (MD_MAJOR, 0x28)
#define SET_DISK_FAULTY _IO (MD_MAJOR, 0x29)
+#define HOT_GENERATE_ERROR _IO (MD_MAJOR, 0x2a)
/* usage */
#define RUN_ARRAY _IOW (MD_MAJOR, 0x30, mdu_param_t)
diff --git a/include/linux/raid/multipath.h b/include/linux/raid/multipath.h
new file mode 100644
index 000000000000..db2f3ec99bda
--- /dev/null
+++ b/include/linux/raid/multipath.h
@@ -0,0 +1,87 @@
+#ifndef _MULTIPATH_H
+#define _MULTIPATH_H
+
+#include <linux/raid/md.h>
+
+struct multipath_info {
+ int number;
+ int raid_disk;
+ kdev_t dev;
+ int sect_limit;
+ int head_position;
+
+ /*
+ * State bits:
+ */
+ int operational;
+ int write_only;
+ int spare;
+
+ int used_slot;
+};
+
+struct multipath_private_data {
+ mddev_t *mddev;
+ struct multipath_info multipaths[MD_SB_DISKS];
+ int nr_disks;
+ int raid_disks;
+ int working_disks;
+ mdk_thread_t *thread;
+ struct multipath_info *spare;
+ md_spinlock_t device_lock;
+
+ /* buffer pool */
+ /* buffer_heads that we have pre-allocated have b_pprev -> &freebh
+ * and are linked into a stack using b_next
+ * multipath_bh that are pre-allocated have MPBH_PreAlloc set.
+ * All these variable are protected by device_lock
+ */
+ struct buffer_head *freebh;
+ int freebh_cnt; /* how many are on the list */
+ struct multipath_bh *freer1;
+ struct multipath_bh *freebuf; /* each bh_req has a page allocated */
+ md_wait_queue_head_t wait_buffer;
+
+ /* for use when syncing multipaths: */
+ unsigned long start_active, start_ready,
+ start_pending, start_future;
+ int cnt_done, cnt_active, cnt_ready,
+ cnt_pending, cnt_future;
+ int phase;
+ int window;
+ md_wait_queue_head_t wait_done;
+ md_wait_queue_head_t wait_ready;
+ md_spinlock_t segment_lock;
+};
+
+typedef struct multipath_private_data multipath_conf_t;
+
+/*
+ * this is the only point in the RAID code where we violate
+ * C type safety. mddev->private is an 'opaque' pointer.
+ */
+#define mddev_to_conf(mddev) ((multipath_conf_t *) mddev->private)
+
+/*
+ * this is our 'private' 'collective' MULTIPATH buffer head.
+ * it contains information about what kind of IO operations were started
+ * for this MULTIPATH operation, and about their status:
+ */
+
+struct multipath_bh {
+ atomic_t remaining; /* 'have we finished' count,
+ * used from IRQ handlers
+ */
+ int cmd;
+ unsigned long state;
+ mddev_t *mddev;
+ struct buffer_head *master_bh;
+ struct buffer_head *multipath_bh_list;
+ struct buffer_head bh_req;
+ struct multipath_bh *next_r1; /* next for retry or in free list */
+};
+/* bits for multipath_bh.state */
+#define MPBH_Uptodate 1
+#define MPBH_SyncPhase 2
+#define MPBH_PreAlloc 3 /* this was pre-allocated, add to free list */
+#endif
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 42d464b87ef8..d10b6277b2c3 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -179,6 +179,8 @@ extern unsigned long swap_cache_find_success;
extern spinlock_t pagemap_lru_lock;
+extern void FASTCALL(mark_page_accessed(struct page *));
+
/*
* Page aging defines.
* Since we do exponential decay of the page age, we
@@ -202,6 +204,8 @@ extern spinlock_t pagemap_lru_lock;
#define add_page_to_active_list(page) { \
DEBUG_ADD_PAGE \
ZERO_PAGE_BUG \
+ page->age = 0; \
+ ClearPageReferenced(page); \
SetPageActive(page); \
list_add(&(page)->lru, &active_list); \
nr_active_pages++; \