summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/blk.h9
-rw-r--r--include/linux/ext2_fs.h1
-rw-r--r--include/linux/fd1772.h80
-rw-r--r--include/linux/fs.h124
-rw-r--r--include/linux/hpfs_fs_i.h10
-rw-r--r--include/linux/ioport.h59
-rw-r--r--include/linux/minix_fs.h1
-rw-r--r--include/linux/mm.h60
-rw-r--r--include/linux/msdos_fs_i.h19
-rw-r--r--include/linux/nfs_fs.h3
-rw-r--r--include/linux/nfs_fs_i.h7
-rw-r--r--include/linux/pagemap.h79
-rw-r--r--include/linux/pci.h4
-rw-r--r--include/linux/pipe_fs_i.h16
-rw-r--r--include/linux/proc_fs.h1
-rw-r--r--include/linux/sched.h4
-rw-r--r--include/linux/smb.h2
-rw-r--r--include/linux/smb_fs.h16
-rw-r--r--include/linux/swap.h5
-rw-r--r--include/linux/synclink.h16
-rw-r--r--include/linux/sysv_fs.h1
-rw-r--r--include/linux/ufs_fs.h1
-rw-r--r--include/linux/umsdos_fs_i.h11
23 files changed, 312 insertions, 217 deletions
diff --git a/include/linux/blk.h b/include/linux/blk.h
index 3974bc23b..dcb407c61 100644
--- a/include/linux/blk.h
+++ b/include/linux/blk.h
@@ -342,6 +342,15 @@ static void floppy_off(unsigned int nr);
#define DEVICE_ON(device)
#define DEVICE_OFF(device)
+#elif (MAJOR_NR == MFM_ACORN_MAJOR)
+
+#define DEVICE_NAME "mfm disk"
+#define DEVICE_INTR do_mfm
+#define DEVICE_REQUEST do_mfm_request
+#define DEVICE_NR(device) (MINOR(device) >> 6)
+#define DEVICE_ON(device)
+#define DEVICE_OFF(device)
+
#elif (MAJOR_NR == NBD_MAJOR)
#define DEVICE_NAME "nbd"
diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h
index dcd36e63c..f0eba99c1 100644
--- a/include/linux/ext2_fs.h
+++ b/include/linux/ext2_fs.h
@@ -556,6 +556,7 @@ extern void ext2_check_inodes_bitmap (struct super_block *);
extern int ext2_bmap (struct inode *, int);
extern struct buffer_head * ext2_getblk (struct inode *, long, int, int *);
+extern int ext2_getblk_block (struct inode *, long, int, int *, int *);
extern struct buffer_head * ext2_bread (struct inode *, int, int, int *);
extern int ext2_getcluster (struct inode * inode, long block);
diff --git a/include/linux/fd1772.h b/include/linux/fd1772.h
new file mode 100644
index 000000000..871d6e4c6
--- /dev/null
+++ b/include/linux/fd1772.h
@@ -0,0 +1,80 @@
+#ifndef _LINUX_FD1772REG_H
+#define _LINUX_FD1772REG_H
+
+/*
+** WD1772 stuff - originally from the M68K Linux
+ * Modified for Archimedes by Dave Gilbert (gilbertd@cs.man.ac.uk)
+ */
+
+/* register codes */
+
+#define FDC1772SELREG_STP (0x80) /* command/status register */
+#define FDC1772SELREG_TRA (0x82) /* track register */
+#define FDC1772SELREG_SEC (0x84) /* sector register */
+#define FDC1772SELREG_DTA (0x86) /* data register */
+
+/* register names for FDC1772_READ/WRITE macros */
+
+#define FDC1772REG_CMD 0
+#define FDC1772REG_STATUS 0
+#define FDC1772REG_TRACK 2
+#define FDC1772REG_SECTOR 4
+#define FDC1772REG_DATA 6
+
+/* command opcodes */
+
+#define FDC1772CMD_RESTORE (0x00) /* - */
+#define FDC1772CMD_SEEK (0x10) /* | */
+#define FDC1772CMD_STEP (0x20) /* | TYP 1 Commands */
+#define FDC1772CMD_STIN (0x40) /* | */
+#define FDC1772CMD_STOT (0x60) /* - */
+#define FDC1772CMD_RDSEC (0x80) /* - TYP 2 Commands */
+#define FDC1772CMD_WRSEC (0xa0) /* - " */
+#define FDC1772CMD_RDADR (0xc0) /* - */
+#define FDC1772CMD_RDTRA (0xe0) /* | TYP 3 Commands */
+#define FDC1772CMD_WRTRA (0xf0) /* - */
+#define FDC1772CMD_FORCI (0xd0) /* - TYP 4 Command */
+
+/* command modifier bits */
+
+#define FDC1772CMDADD_SR6 (0x00) /* step rate settings */
+#define FDC1772CMDADD_SR12 (0x01)
+#define FDC1772CMDADD_SR2 (0x02)
+#define FDC1772CMDADD_SR3 (0x03)
+#define FDC1772CMDADD_V (0x04) /* verify */
+#define FDC1772CMDADD_H (0x08) /* wait for spin-up */
+#define FDC1772CMDADD_U (0x10) /* update track register */
+#define FDC1772CMDADD_M (0x10) /* multiple sector access */
+#define FDC1772CMDADD_E (0x04) /* head settling flag */
+#define FDC1772CMDADD_P (0x02) /* precompensation */
+#define FDC1772CMDADD_A0 (0x01) /* DAM flag */
+
+/* status register bits */
+
+#define FDC1772STAT_MOTORON (0x80) /* motor on */
+#define FDC1772STAT_WPROT (0x40) /* write protected (FDC1772CMD_WR*) */
+#define FDC1772STAT_SPINUP (0x20) /* motor speed stable (Type I) */
+#define FDC1772STAT_DELDAM (0x20) /* sector has deleted DAM (Type II+III) */
+#define FDC1772STAT_RECNF (0x10) /* record not found */
+#define FDC1772STAT_CRC (0x08) /* CRC error */
+#define FDC1772STAT_TR00 (0x04) /* Track 00 flag (Type I) */
+#define FDC1772STAT_LOST (0x04) /* Lost Data (Type II+III) */
+#define FDC1772STAT_IDX (0x02) /* Index status (Type I) */
+#define FDC1772STAT_DRQ (0x02) /* DRQ status (Type II+III) */
+#define FDC1772STAT_BUSY (0x01) /* FDC1772 is busy */
+
+
+/* PSG Port A Bit Nr 0 .. Side Sel .. 0 -> Side 1 1 -> Side 2 */
+#define DSKSIDE (0x01)
+
+#define DSKDRVNONE (0x06)
+#define DSKDRV0 (0x02)
+#define DSKDRV1 (0x04)
+
+/* step rates */
+#define FDC1772STEP_6 0x00
+#define FDC1772STEP_12 0x01
+#define FDC1772STEP_2 0x02
+#define FDC1772STEP_3 0x03
+
+#endif
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 55b07ba48..792df9495 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -74,11 +74,11 @@ extern int max_super_blocks, nr_super_blocks;
/* public flags for file_system_type */
#define FS_REQUIRES_DEV 1
-#define FS_NO_DCACHE 2 /* Only dcache the necessary things. */
-#define FS_NO_PRELIM 4 /* prevent preloading of dentries, even if
+#define FS_NO_DCACHE 2 /* Only dcache the necessary things. */
+#define FS_NO_PRELIM 4 /* prevent preloading of dentries, even if
* FS_NO_DCACHE is not set.
*/
-#define FS_IBASKET 8 /* FS does callback to free_ibasket() if space gets low. */
+#define FS_IBASKET 8 /* FS does callback to free_ibasket() if space gets low. */
/*
* These are the fs-independent mount-flags: up to 16 flags are supported
@@ -94,9 +94,9 @@ extern int max_super_blocks, nr_super_blocks;
#define S_APPEND 256 /* Append-only file */
#define S_IMMUTABLE 512 /* Immutable file */
#define MS_NOATIME 1024 /* Do not update access times. */
-#define MS_NODIRATIME 2048 /* Do not update directory access times */
+#define MS_NODIRATIME 2048 /* Do not update directory access times */
-#define MS_ODD_RENAME 32768 /* Temporary stuff; will go away as soon
+#define MS_ODD_RENAME 32768 /* Temporary stuff; will go away as soon
* as nfs_rename() will be cleaned up
*/
@@ -189,7 +189,6 @@ typedef char buffer_block[BLOCK_SIZE];
#define BH_Lock 2 /* 1 if the buffer is locked */
#define BH_Req 3 /* 0 if the buffer has been invalidated */
#define BH_Protected 6 /* 1 if the buffer is protected */
-
/*
* Try to keep the most commonly used fields in single cache lines (16
* bytes) to improve performance. This ordering should be
@@ -218,7 +217,7 @@ struct buffer_head {
/* Non-performance-critical data follows. */
char * b_data; /* pointer to data block (1024 bytes) */
unsigned int b_list; /* List that this buffer appears */
- unsigned long b_flushtime; /* Time when this (dirty) buffer
+ unsigned long b_flushtime; /* Time when this (dirty) buffer
* should be written */
wait_queue_head_t b_wait;
struct buffer_head ** b_pprev; /* doubly linked list of hash-queue */
@@ -235,30 +234,13 @@ struct buffer_head {
typedef void (bh_end_io_t)(struct buffer_head *bh, int uptodate);
void init_buffer(struct buffer_head *, kdev_t, int, bh_end_io_t *, void *);
-static inline int buffer_uptodate(struct buffer_head * bh)
-{
- return test_bit(BH_Uptodate, &bh->b_state);
-}
-
-static inline int buffer_dirty(struct buffer_head * bh)
-{
- return test_bit(BH_Dirty, &bh->b_state);
-}
+#define __buffer_state(bh, state) (((bh)->b_state & (1UL << BH_##state)) != 0)
-static inline int buffer_locked(struct buffer_head * bh)
-{
- return test_bit(BH_Lock, &bh->b_state);
-}
-
-static inline int buffer_req(struct buffer_head * bh)
-{
- return test_bit(BH_Req, &bh->b_state);
-}
-
-static inline int buffer_protected(struct buffer_head * bh)
-{
- return test_bit(BH_Protected, &bh->b_state);
-}
+#define buffer_uptodate(bh) __buffer_state(bh,Uptodate)
+#define buffer_dirty(bh) __buffer_state(bh,Dirty)
+#define buffer_locked(bh) __buffer_state(bh,Lock)
+#define buffer_req(bh) __buffer_state(bh,Req)
+#define buffer_protected(bh) __buffer_state(bh,Protected)
#define buffer_page(bh) (mem_map + MAP_NR((bh)->b_data))
#define touch_buffer(bh) set_bit(PG_referenced, &buffer_page(bh)->flags)
@@ -357,7 +339,6 @@ struct inode {
unsigned long i_version;
unsigned long i_nrpages;
struct semaphore i_sem;
- struct semaphore i_atomic_write;
struct inode_operations *i_op;
struct super_block *i_sb;
wait_queue_head_t i_wait;
@@ -365,22 +346,21 @@ struct inode {
struct vm_area_struct *i_mmap;
struct page *i_pages;
struct dquot *i_dquot[MAXQUOTAS];
+ struct pipe_inode_info *i_pipe;
unsigned long i_state;
unsigned int i_flags;
- unsigned char i_pipe;
unsigned char i_sock;
int i_writecount;
unsigned int i_attr_flags;
__u32 i_generation;
union {
- struct pipe_inode_info pipe_i;
struct minix_inode_info minix_i;
struct ext2_inode_info ext2_i;
struct hpfs_inode_info hpfs_i;
- struct ntfs_inode_info ntfs_i;
+ struct ntfs_inode_info ntfs_i;
struct msdos_inode_info msdos_i;
struct umsdos_inode_info umsdos_i;
struct iso_inode_info isofs_i;
@@ -388,7 +368,7 @@ struct inode {
struct sysv_inode_info sysv_i;
struct affs_inode_info affs_i;
struct ufs_inode_info ufs_i;
- struct efs_inode_info efs_i;
+ struct efs_inode_info efs_i;
struct romfs_inode_info romfs_i;
struct coda_inode_info coda_i;
struct smb_inode_info smbfs_i;
@@ -491,10 +471,10 @@ extern void posix_block_lock(struct file_lock *, struct file_lock *);
extern void posix_unblock_lock(struct file_lock *);
struct fasync_struct {
- int magic;
- int fa_fd;
- struct fasync_struct *fa_next; /* singly linked list */
- struct file *fa_file;
+ int magic;
+ int fa_fd;
+ struct fasync_struct *fa_next; /* singly linked list */
+ struct file *fa_file;
};
#define FASYNC_MAGIC 0x4601
@@ -547,19 +527,19 @@ struct super_block {
struct minix_sb_info minix_sb;
struct ext2_sb_info ext2_sb;
struct hpfs_sb_info hpfs_sb;
- struct ntfs_sb_info ntfs_sb;
+ struct ntfs_sb_info ntfs_sb;
struct msdos_sb_info msdos_sb;
struct isofs_sb_info isofs_sb;
struct nfs_sb_info nfs_sb;
struct sysv_sb_info sysv_sb;
struct affs_sb_info affs_sb;
struct ufs_sb_info ufs_sb;
- struct efs_sb_info efs_sb;
+ struct efs_sb_info efs_sb;
struct romfs_sb_info romfs_sb;
struct smb_sb_info smbfs_sb;
struct hfs_sb_info hfs_sb;
struct adfs_sb_info adfs_sb;
- struct qnx4_sb_info qnx4_sb;
+ struct qnx4_sb_info qnx4_sb;
void *generic_sbp;
} u;
/*
@@ -616,13 +596,22 @@ struct inode_operations {
struct inode *, struct dentry *);
int (*readlink) (struct dentry *, char *,int);
struct dentry * (*follow_link) (struct dentry *, struct dentry *, unsigned int);
+ /*
+ * the order of these functions within the VFS template has been
+ * changed because SMP locking has changed: from now on all bmap,
+ * readpage, writepage and flushpage functions are supposed to do
+ * whatever locking they need to get proper SMP operation - for
+ * now in most cases this means a lock/unlock_kernel at entry/exit.
+ * [The new order is also slightly more logical :)]
+ */
+ int (*bmap) (struct inode *,int);
int (*readpage) (struct file *, struct page *);
int (*writepage) (struct file *, struct page *);
- int (*bmap) (struct inode *,int);
+ int (*flushpage) (struct inode *, struct page *, unsigned long);
+
void (*truncate) (struct inode *);
int (*permission) (struct inode *, int);
int (*smap) (struct inode *,int);
- int (*updatepage) (struct file *, struct page *, unsigned long, unsigned int);
int (*revalidate) (struct dentry *);
};
@@ -749,13 +738,11 @@ extern int fs_may_mount(kdev_t);
extern struct file *inuse_filps;
-extern void refile_buffer(struct buffer_head *);
extern void set_writetime(struct buffer_head *, int);
extern int try_to_free_buffers(struct page *);
+extern void refile_buffer(struct buffer_head * buf);
-extern int nr_buffers;
extern int buffermem;
-extern int nr_buffer_heads;
#define BUF_CLEAN 0
#define BUF_LOCKED 1 /* Buffers scheduled for write */
@@ -766,21 +753,36 @@ void mark_buffer_uptodate(struct buffer_head *, int);
extern inline void mark_buffer_clean(struct buffer_head * bh)
{
- if (test_and_clear_bit(BH_Dirty, &bh->b_state)) {
- if (bh->b_list == BUF_DIRTY)
- refile_buffer(bh);
- }
+ if (test_and_clear_bit(BH_Dirty, &bh->b_state))
+ refile_buffer(bh);
}
+extern void FASTCALL(__mark_buffer_dirty(struct buffer_head *bh, int flag));
+extern void FASTCALL(__atomic_mark_buffer_dirty(struct buffer_head *bh, int flag));
+
+#define atomic_set_buffer_dirty(bh) test_and_set_bit(BH_Dirty, &(bh)->b_state)
+
extern inline void mark_buffer_dirty(struct buffer_head * bh, int flag)
{
- if (!test_and_set_bit(BH_Dirty, &bh->b_state)) {
- set_writetime(bh, flag);
- if (bh->b_list != BUF_DIRTY)
- refile_buffer(bh);
- }
+ if (!atomic_set_buffer_dirty(bh))
+ __mark_buffer_dirty(bh, flag);
+}
+
+/*
+ * SMP-safe version of the above - does synchronization with
+ * other users of buffer-cache data structures.
+ *
+ * since we test-set the dirty bit in a CPU-atomic way we also
+ * have optimized the common 'redirtying' case away completely.
+ */
+extern inline void atomic_mark_buffer_dirty(struct buffer_head * bh, int flag)
+{
+ if (!atomic_set_buffer_dirty(bh))
+ __atomic_mark_buffer_dirty(bh, flag);
}
+
+extern void balance_dirty(kdev_t);
extern int check_disk_change(kdev_t);
extern int invalidate_inodes(struct super_block *);
extern void invalidate_inode_pages(struct inode *);
@@ -869,12 +871,19 @@ extern struct buffer_head * breada(kdev_t, int, int, unsigned int, unsigned int)
extern int brw_page(int, struct page *, kdev_t, int [], int, int);
typedef long (*writepage_t)(struct file *, struct page *, unsigned long, unsigned long, const char *);
+typedef int (*fs_getblock_t)(struct inode *, long, int, int *, int *);
+
+/* Generic buffer handling for block filesystems.. */
+extern int block_read_full_page(struct file *, struct page *);
+extern int block_write_full_page (struct file *, struct page *, fs_getblock_t);
+extern int block_write_partial_page (struct file *, struct page *, unsigned long, unsigned long, const char *, fs_getblock_t);
+extern int block_flushpage(struct inode *, struct page *, unsigned long);
-extern int generic_readpage(struct file *, struct page *);
extern int generic_file_mmap(struct file *, struct vm_area_struct *);
extern ssize_t generic_file_read(struct file *, char *, size_t, loff_t *);
extern ssize_t generic_file_write(struct file *, const char *, size_t, loff_t *, writepage_t);
+
extern struct super_block *get_super(kdev_t);
extern void put_super(kdev_t);
unsigned long generate_cluster(kdev_t, int b[], int);
@@ -898,6 +907,7 @@ extern ssize_t block_write(struct file *, const char *, size_t, loff_t *);
extern int block_fsync(struct file *, struct dentry *);
extern int file_fsync(struct file *, struct dentry *);
+extern int generic_buffer_fdatasync(struct inode *inode, unsigned long start, unsigned long end);
extern int inode_change_ok(struct inode *, struct iattr *);
extern void inode_setattr(struct inode *, struct iattr *);
diff --git a/include/linux/hpfs_fs_i.h b/include/linux/hpfs_fs_i.h
index 7dea10b41..8263bf2d7 100644
--- a/include/linux/hpfs_fs_i.h
+++ b/include/linux/hpfs_fs_i.h
@@ -1,17 +1,7 @@
#ifndef _HPFS_FS_I
#define _HPFS_FS_I
-#if ANALWARNINGS
-#warning Fix the FIFO stuff!
-#warning Fix the FIFO stuff!
-#warning Fix the FIFO stuff!
-#endif
-
struct hpfs_inode_info {
- union { /* Linux sometimes destroys this structure */
- struct pipe_inode_info bla; /* due to a bug. Linus doesn't want to fix */
- struct socket ble; /* it so I had to write this workaround :-) */
- } dummy;
ino_t i_parent_dir; /* (directories) gives fnode of parent dir */
unsigned i_dno; /* (directories) root dnode */
unsigned i_dpos; /* (directories) temp for readdir */
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index b5eef44dd..2f729f96b 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -1,14 +1,38 @@
/*
- * portio.h Definitions of routines for detecting, reserving and
+ * ioport.h Definitions of routines for detecting, reserving and
* allocating system resources.
*
- * Version: 0.01 8/30/93
- *
- * Author: Donald Becker (becker@super.org)
+ * Authors: Donald Becker (becker@cesdis.gsfc.nasa.gov)
+ * David Hinds (dhinds@zen.stanford.edu)
*/
-#ifndef _LINUX_PORTIO_H
-#define _LINUX_PORTIO_H
+#ifndef _LINUX_IOPORT_H
+#define _LINUX_IOPORT_H
+
+#define RES_IO 0
+#define RES_MEM 1
+
+extern void reserve_setup(char *str, int *ints);
+
+extern struct resource_entry *iolist, *memlist;
+
+extern int get_resource_list(int class, char *buf);
+extern int check_resource(int class,
+ unsigned long from, unsigned long extent);
+extern void request_resource(int class,
+ unsigned long from, unsigned long extent,
+ const char *name);
+extern void release_resource(int class,
+ unsigned long from, unsigned long extent);
+extern unsigned long occupy_resource(int class,
+ unsigned long base, unsigned long end,
+ unsigned long num, unsigned long align,
+ const char *name);
+extern void vacate_resource(int class,
+ unsigned long from, unsigned long extent);
+
+#define get_ioport_list(buf) get_resource_list(RES_IO, buf)
+#define get_mem_list(buf) get_resource_list(RES_MEM, buf)
#define HAVE_PORTRESERVE
/*
@@ -16,20 +40,21 @@
* Once you have found you hardware, register it with request_region().
* If you unload the driver, use release_region to free ports.
*/
-extern void reserve_setup(char *str, int *ints);
-extern int check_region(unsigned long from, unsigned long extent);
-extern void request_region(unsigned long from, unsigned long extent,const char *name);
-extern void release_region(unsigned long from, unsigned long extent);
-extern int get_ioport_list(char *);
+#define check_region(f,e) check_resource(RES_IO,f,e)
+#define request_region(f,e,n) request_resource(RES_IO,f,e,n)
+#define release_region(f,e) release_resource(RES_IO,f,e)
+#define occupy_region(b,e,n,a,s) occupy_resource(RES_IO,b,e,n,a,s)
+#define vacate_region(f,e) vacate_resource(RES_IO,f,e)
-#ifdef __sparc__
-extern unsigned long occupy_region(unsigned long base, unsigned long end,
- unsigned long num, unsigned int align,
- const char *name);
-#endif
+#define HAVE_MEMRESERVE
+#define check_mem_region(f,e) check_resource(RES_MEM,f,e)
+#define request_mem_region(f,e,n) request_resource(RES_MEM,f,e,n)
+#define release_mem_region(f,e) release_resource(RES_MEM,f,e)
+#define occupy_mem_region(b,e,n,a,s) occupy_resource(RES_MEM,b,e,n,a,s)
+#define vacate_mem_region(f,e) vacate_resource(RES_MEM,f,e)
#define HAVE_AUTOIRQ
extern void autoirq_setup(int waittime);
extern int autoirq_report(int waittime);
-#endif /* _LINUX_PORTIO_H */
+#endif /* _LINUX_IOPORT_H */
diff --git a/include/linux/minix_fs.h b/include/linux/minix_fs.h
index 4682ee56e..0b41889bd 100644
--- a/include/linux/minix_fs.h
+++ b/include/linux/minix_fs.h
@@ -110,6 +110,7 @@ extern unsigned long minix_count_free_blocks(struct super_block *sb);
extern int minix_bmap(struct inode *,int);
extern struct buffer_head * minix_getblk(struct inode *, int, int);
+extern int minix_getblk_block (struct inode *, long, int, int *, int *);
extern struct buffer_head * minix_bread(struct inode *, int, int);
extern void minix_truncate(struct inode *);
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 3a1963887..b41ff492c 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -129,29 +129,57 @@ typedef struct page {
wait_queue_head_t wait;
struct page **pprev_hash;
struct buffer_head * buffers;
+ int owner; /* temporary debugging check */
} mem_map_t;
+#define get_page(p) do { atomic_inc(&(p)->count); \
+ } while (0)
+#define put_page(p) __free_page(p)
+#define put_page_testzero(p) ({ int __ret = atomic_dec_and_test(&(p)->count);\
+ __ret; })
+#define page_count(p) atomic_read(&(p)->count)
+#define set_page_count(p,v) do { atomic_set(&(p)->count, v); \
+ } while (0)
+
/* Page flag bit values */
#define PG_locked 0
#define PG_error 1
#define PG_referenced 2
-#define PG_dirty 3
-#define PG_uptodate 4
-#define PG_free_after 5
-#define PG_decr_after 6
-#define PG_swap_unlock_after 7
-#define PG_DMA 8
-#define PG_Slab 9
-#define PG_swap_cache 10
-#define PG_skip 11
+#define PG_uptodate 3
+#define PG_free_after 4
+#define PG_decr_after 5
+#define PG_swap_unlock_after 6
+#define PG_DMA 7
+#define PG_Slab 8
+#define PG_swap_cache 9
+#define PG_skip 10
+ /* bits 21-30 unused */
#define PG_reserved 31
+
/* Make it prettier to test the above... */
+#define Page_Uptodate(page) (test_bit(PG_uptodate, &(page)->flags))
+#define SetPageUptodate(page) do { set_bit(PG_uptodate, &(page)->flags); \
+ } while (0)
+#define ClearPageUptodate(page) do { clear_bit(PG_uptodate, &(page)->flags); \
+ } while (0)
#define PageLocked(page) (test_bit(PG_locked, &(page)->flags))
+#define LockPage(page) \
+ do { int _ret = test_and_set_bit(PG_locked, &(page)->flags); \
+ if (_ret) PAGE_BUG(page); \
+ if (page->owner) PAGE_BUG(page); \
+ page->owner = (int)current; } while (0)
+#define TryLockPage(page) ({ int _ret = test_and_set_bit(PG_locked, &(page)->flags); \
+ if (!_ret) page->owner = (int)current; _ret; })
+#define UnlockPage(page) do { \
+ if (page->owner != (int)current) { \
+BUG(); } page->owner = 0; \
+if (!test_and_clear_bit(PG_locked, &(page)->flags)) { \
+ PAGE_BUG(page); } wake_up(&page->wait); } while (0)
#define PageError(page) (test_bit(PG_error, &(page)->flags))
+#define SetPageError(page) ({ int _ret = test_and_set_bit(PG_error, &(page)->flags); _ret; })
+#define ClearPageError(page) do { if (!test_and_clear_bit(PG_error, &(page)->flags)) BUG(); } while (0)
#define PageReferenced(page) (test_bit(PG_referenced, &(page)->flags))
-#define PageDirty(page) (test_bit(PG_dirty, &(page)->flags))
-#define PageUptodate(page) (test_bit(PG_uptodate, &(page)->flags))
#define PageFreeAfter(page) (test_bit(PG_free_after, &(page)->flags))
#define PageDecrAfter(page) (test_bit(PG_decr_after, &(page)->flags))
#define PageSwapUnlockAfter(page) (test_bit(PG_swap_unlock_after, &(page)->flags))
@@ -163,16 +191,12 @@ typedef struct page {
#define PageSetSlab(page) (set_bit(PG_Slab, &(page)->flags))
#define PageSetSwapCache(page) (set_bit(PG_swap_cache, &(page)->flags))
-#define PageTestandSetDirty(page) \
- (test_and_set_bit(PG_dirty, &(page)->flags))
#define PageTestandSetSwapCache(page) \
(test_and_set_bit(PG_swap_cache, &(page)->flags))
#define PageClearSlab(page) (clear_bit(PG_Slab, &(page)->flags))
#define PageClearSwapCache(page)(clear_bit(PG_swap_cache, &(page)->flags))
-#define PageTestandClearDirty(page) \
- (test_and_clear_bit(PG_dirty, &(page)->flags))
#define PageTestandClearSwapCache(page) \
(test_and_clear_bit(PG_swap_cache, &(page)->flags))
@@ -274,8 +298,8 @@ extern int low_on_memory;
/* memory.c & swap.c*/
#define free_page(addr) free_pages((addr),0)
-extern void FASTCALL(free_pages(unsigned long addr, unsigned long order));
-extern void FASTCALL(__free_page(struct page *));
+extern int FASTCALL(free_pages(unsigned long addr, unsigned long order));
+extern int FASTCALL(__free_page(struct page *));
extern void show_free_areas(void);
extern unsigned long put_dirty_page(struct task_struct * tsk,unsigned long page,
@@ -398,7 +422,7 @@ extern struct vm_area_struct *find_extend_vma(struct task_struct *tsk, unsigned
#define buffer_under_min() ((buffermem >> PAGE_SHIFT) * 100 < \
buffer_mem.min_percent * num_physpages)
-#define pgcache_under_min() (page_cache_size * 100 < \
+#define pgcache_under_min() (atomic_read(&page_cache_size) * 100 < \
page_cache.min_percent * num_physpages)
#endif /* __KERNEL__ */
diff --git a/include/linux/msdos_fs_i.h b/include/linux/msdos_fs_i.h
index fcb746552..b2381f6d4 100644
--- a/include/linux/msdos_fs_i.h
+++ b/include/linux/msdos_fs_i.h
@@ -1,30 +1,11 @@
#ifndef _MSDOS_FS_I
#define _MSDOS_FS_I
-#ifndef _LINUX_PIPE_FS_I_H
-#include <linux/pipe_fs_i.h>
-#endif
-
/*
* MS-DOS file system inode data in memory
*/
struct msdos_inode_info {
- /*
- UMSDOS manage special file and fifo as normal empty
- msdos file. fifo inode processing conflict with msdos
- processing. So I insert the pipe_inode_info so the
- information does not overlap. This increases the size of
- the msdos_inode_info, but the clear winner here is
- the ext2_inode_info. So it does not change anything to
- the total size of a struct inode.
-
- I have not put it conditional. With the advent of loadable
- file system drivers, it would be very easy to compile
- a MS-DOS FS driver unaware of UMSDOS and then later to
- load a (then incompatible) UMSDOS FS driver.
- */
- struct pipe_inode_info reserved;
int i_start; /* first cluster or 0 */
int i_logstart; /* logical first cluster */
int i_attrs; /* unused attribute bits */
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 613eb6872..d91a0b641 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -192,7 +192,8 @@ extern struct inode_operations nfs_file_inode_operations;
*/
extern struct inode_operations nfs_dir_inode_operations;
extern struct dentry_operations nfs_dentry_operations;
-extern void nfs_invalidate_dircache(struct inode *);
+extern void nfs_flush_dircache(struct inode *);
+extern void nfs_free_dircache(struct inode *);
/*
* linux/fs/nfs/symlink.c
diff --git a/include/linux/nfs_fs_i.h b/include/linux/nfs_fs_i.h
index d21f0078f..13bf610b6 100644
--- a/include/linux/nfs_fs_i.h
+++ b/include/linux/nfs_fs_i.h
@@ -9,13 +9,6 @@
*/
struct nfs_inode_info {
/*
- * This is a place holder so named pipes on NFS filesystems
- * work (more or less correctly). This must be first in the
- * struct because the data is really accessed via inode->u.pipe_i.
- */
- struct pipe_inode_info pipeinfo;
-
- /*
* Various flags
*/
unsigned short flags;
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 218098416..c5a8af7c7 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -39,10 +39,10 @@ static inline unsigned long page_address(struct page * page)
*/
#define page_cache_entry(x) (mem_map + MAP_NR(x))
-#define PAGE_HASH_BITS 12
+#define PAGE_HASH_BITS 16
#define PAGE_HASH_SIZE (1 << PAGE_HASH_BITS)
-extern unsigned long page_cache_size; /* # of pages currently in the hash table */
+extern atomic_t page_cache_size; /* # of pages currently in the hash table */
extern struct page * page_hash_table[PAGE_HASH_SIZE];
/*
@@ -64,72 +64,25 @@ static inline unsigned long _page_hashfn(struct inode * inode, unsigned long off
#define page_hash(inode,offset) (page_hash_table+_page_hashfn(inode,offset))
-static inline struct page * __find_page(struct inode * inode, unsigned long offset, struct page *page)
-{
- goto inside;
- for (;;) {
- page = page->next_hash;
-inside:
- if (!page)
- goto not_found;
- if (page->inode != inode)
- continue;
- if (page->offset == offset)
- break;
- }
- /* Found the page. */
- atomic_inc(&page->count);
- set_bit(PG_referenced, &page->flags);
-not_found:
- return page;
-}
-
-static inline struct page *find_page(struct inode * inode, unsigned long offset)
-{
- return __find_page(inode, offset, *page_hash(inode, offset));
-}
+extern struct page * __find_get_page (struct inode * inode,
+ unsigned long offset, struct page **hash);
+#define find_get_page(inode, offset) \
+ __find_get_page(inode, offset, page_hash(inode, offset))
+extern struct page * __find_lock_page (struct inode * inode,
+ unsigned long offset, struct page **hash);
+extern void lock_page(struct page *page);
+#define find_lock_page(inode, offset) \
+ __find_lock_page(inode, offset, page_hash(inode, offset))
-static inline void remove_page_from_hash_queue(struct page * page)
-{
- if(page->pprev_hash) {
- if(page->next_hash)
- page->next_hash->pprev_hash = page->pprev_hash;
- *page->pprev_hash = page->next_hash;
- page->pprev_hash = NULL;
- }
- page_cache_size--;
-}
+extern void __add_page_to_hash_queue(struct page * page, struct page **p);
-static inline void __add_page_to_hash_queue(struct page * page, struct page **p)
-{
- page_cache_size++;
- if((page->next_hash = *p) != NULL)
- (*p)->pprev_hash = &page->next_hash;
- *p = page;
- page->pprev_hash = p;
-}
+extern int add_to_page_cache_unique(struct page * page, struct inode * inode, unsigned long offset, struct page **hash);
static inline void add_page_to_hash_queue(struct page * page, struct inode * inode, unsigned long offset)
{
__add_page_to_hash_queue(page, page_hash(inode,offset));
}
-static inline void remove_page_from_inode_queue(struct page * page)
-{
- struct inode * inode = page->inode;
-
- page->inode = NULL;
- inode->i_nrpages--;
- if (inode->i_pages == page)
- inode->i_pages = page->next;
- if (page->next)
- page->next->prev = page->prev;
- if (page->prev)
- page->prev->next = page->next;
- page->next = NULL;
- page->prev = NULL;
-}
-
static inline void add_page_to_inode_queue(struct inode * inode, struct page * page)
{
struct page **p = &inode->i_pages;
@@ -142,11 +95,13 @@ static inline void add_page_to_inode_queue(struct inode * inode, struct page * p
*p = page;
}
-extern void __wait_on_page(struct page *);
+extern void ___wait_on_page(struct page *);
+
static inline void wait_on_page(struct page * page)
{
+
if (PageLocked(page))
- __wait_on_page(page);
+ ___wait_on_page(page);
}
extern void update_vm_cache(struct inode *, unsigned long, const char *, int);
diff --git a/include/linux/pci.h b/include/linux/pci.h
index bd7f320e3..2a9932148 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -280,7 +280,7 @@
/*
* Vendor and card ID's: sort these numerically according to vendor
* (and according to card ID within vendor). Send all updates to
- * <linux-pcisupport@cck.uni-kl.de>.
+ * <pci-ids@ucw.cz>.
*/
#define PCI_VENDOR_ID_COMPAQ 0x0e11
#define PCI_DEVICE_ID_COMPAQ_1280 0x3033
@@ -1260,6 +1260,8 @@ struct pci_dev *pci_find_device (unsigned int vendor, unsigned int device, struc
struct pci_dev *pci_find_class (unsigned int class, struct pci_dev *from);
struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn);
+#define PCI_ANY_ID (~0)
+
#define pci_present pcibios_present
int pci_read_config_byte(struct pci_dev *dev, u8 where, u8 *val);
int pci_read_config_word(struct pci_dev *dev, u8 where, u16 *val);
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h
index 7d44e8293..c00d37845 100644
--- a/include/linux/pipe_fs_i.h
+++ b/include/linux/pipe_fs_i.h
@@ -12,15 +12,15 @@ struct pipe_inode_info {
unsigned int writers;
};
-#define PIPE_WAIT(inode) ((inode).u.pipe_i.wait)
-#define PIPE_BASE(inode) ((inode).u.pipe_i.base)
-#define PIPE_START(inode) ((inode).u.pipe_i.start)
+#define PIPE_WAIT(inode) ((inode).i_pipe->wait)
+#define PIPE_BASE(inode) ((inode).i_pipe->base)
+#define PIPE_START(inode) ((inode).i_pipe->start)
#define PIPE_LEN(inode) ((inode).i_size)
-#define PIPE_RD_OPENERS(inode) ((inode).u.pipe_i.rd_openers)
-#define PIPE_WR_OPENERS(inode) ((inode).u.pipe_i.wr_openers)
-#define PIPE_READERS(inode) ((inode).u.pipe_i.readers)
-#define PIPE_WRITERS(inode) ((inode).u.pipe_i.writers)
-#define PIPE_LOCK(inode) ((inode).u.pipe_i.lock)
+#define PIPE_RD_OPENERS(inode) ((inode).i_pipe->rd_openers)
+#define PIPE_WR_OPENERS(inode) ((inode).i_pipe->wr_openers)
+#define PIPE_READERS(inode) ((inode).i_pipe->readers)
+#define PIPE_WRITERS(inode) ((inode).i_pipe->writers)
+#define PIPE_LOCK(inode) ((inode).i_pipe->lock)
#define PIPE_SIZE(inode) PIPE_LEN(inode)
#define PIPE_EMPTY(inode) (PIPE_SIZE(inode)==0)
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index e9a284573..be5c2c666 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -37,6 +37,7 @@ enum root_directory_inos {
PROC_KSYMS,
PROC_DMA,
PROC_IOPORTS,
+ PROC_MEMORY,
PROC_PROFILE, /* whether enabled or not */
PROC_CMDLINE,
PROC_SYS,
diff --git a/include/linux/sched.h b/include/linux/sched.h
index bfa9e633e..10a074449 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -286,7 +286,7 @@ struct task_struct {
gid_t gid,egid,sgid,fsgid;
int ngroups;
gid_t groups[NGROUPS];
- kernel_cap_t cap_effective, cap_inheritable, cap_permitted;
+ kernel_cap_t cap_effective, cap_inheritable, cap_permitted;
struct user_struct *user;
/* limits */
struct rlimit rlim[RLIM_NLIMITS];
@@ -603,7 +603,7 @@ extern inline int capable(int cap)
#else
if (cap_is_fs_cap(cap) ? current->fsuid == 0 : current->euid == 0)
#endif
- {
+ {
current->flags |= PF_SUPERPRIV;
return 1;
}
diff --git a/include/linux/smb.h b/include/linux/smb.h
index 8953686b0..852d5b0dd 100644
--- a/include/linux/smb.h
+++ b/include/linux/smb.h
@@ -57,7 +57,7 @@ struct smb_conn_opt {
/* The following are NT LM 0.12 options */
__u32 maxraw;
__u32 capabilities;
- __u16 serverzone;
+ __s16 serverzone;
};
#ifdef __KERNEL__
diff --git a/include/linux/smb_fs.h b/include/linux/smb_fs.h
index a151a75e6..11dfce7dd 100644
--- a/include/linux/smb_fs.h
+++ b/include/linux/smb_fs.h
@@ -77,6 +77,22 @@ smb_vfree(void *obj)
#define SMB_FIX_OLDATTR 0x0002 /* Use core getattr (Win 95 speedup) */
#define SMB_FIX_DIRATTR 0x0004 /* Use find_first for getattr */
+
+/* NT1 protocol capability bits */
+#define SMB_CAP_RAW_MODE 0x0001
+#define SMB_CAP_MPX_MODE 0x0002
+#define SMB_CAP_UNICODE 0x0004
+#define SMB_CAP_LARGE_FILES 0x0008
+#define SMB_CAP_NT_SMBS 0x0010
+#define SMB_CAP_RPC_REMOTE_APIS 0x0020
+#define SMB_CAP_STATUS32 0x0040
+#define SMB_CAP_LEVEL_II_OPLOCKS 0x0080
+#define SMB_CAP_LOCK_AND_READ 0x0100
+#define SMB_CAP_NT_FIND 0x0200
+#define SMB_CAP_DFS 0x1000
+#define SMB_CAP_LARGE_READX 0x4000
+
+
/* linux/fs/smbfs/mmap.c */
int smb_mmap(struct file *, struct vm_area_struct *);
diff --git a/include/linux/swap.h b/include/linux/swap.h
index bc9fb4e48..c06ddba63 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -67,7 +67,7 @@ extern int nr_swap_pages;
extern int nr_free_pages;
extern atomic_t nr_async_pages;
extern struct inode swapper_inode;
-extern unsigned long page_cache_size;
+extern atomic_t page_cache_size;
extern int buffermem;
/* Incomplete types for prototype declarations: */
@@ -107,6 +107,7 @@ extern int FASTCALL(swap_count(unsigned long));
/*
* Make these inline later once they are working properly.
*/
+extern void __delete_from_swap_cache(struct page *page);
extern void delete_from_swap_cache(struct page *page);
extern void free_page_and_swap_cache(unsigned long addr);
@@ -163,7 +164,7 @@ static inline int is_page_shared(struct page *page)
unsigned int count;
if (PageReserved(page))
return 1;
- count = atomic_read(&page->count);
+ count = page_count(page);
if (PageSwapCache(page))
count += swap_count(page->offset) - 2;
if (PageFreeAfter(page))
diff --git a/include/linux/synclink.h b/include/linux/synclink.h
index 69dc86725..70ce90e10 100644
--- a/include/linux/synclink.h
+++ b/include/linux/synclink.h
@@ -1,6 +1,8 @@
/*
* SyncLink Multiprotocol Serial Adapter Driver
*
+ * ==FILEDATE 19990523==
+ *
* Copyright (C) 1998 by Microgate Corporation
*
* Redistribution of this file is permitted under
@@ -66,11 +68,16 @@
#define HDLC_FLAG_AUTO_RTS 0x0080
#define HDLC_FLAG_RXC_DPLL 0x0100
#define HDLC_FLAG_RXC_BRG 0x0200
+#define HDLC_FLAG_RXC_TXCPIN 0x8000
+#define HDLC_FLAG_RXC_RXCPIN 0x0000
#define HDLC_FLAG_TXC_DPLL 0x0400
#define HDLC_FLAG_TXC_BRG 0x0800
+#define HDLC_FLAG_TXC_TXCPIN 0x0000
+#define HDLC_FLAG_TXC_RXCPIN 0x0008
#define HDLC_FLAG_DPLL_DIV8 0x1000
#define HDLC_FLAG_DPLL_DIV16 0x2000
#define HDLC_FLAG_DPLL_DIV32 0x0000
+#define HDLC_FLAG_HDLC_LOOPMODE 0x4000
#define HDLC_CRC_NONE 0
#define HDLC_CRC_16_CCITT 1
@@ -87,6 +94,7 @@
#define HDLC_ENCODING_NRZB 1
#define HDLC_ENCODING_NRZI_MARK 2
#define HDLC_ENCODING_NRZI_SPACE 3
+#define HDLC_ENCODING_NRZI HDLC_ENCODING_NRZI_SPACE
#define HDLC_ENCODING_BIPHASE_MARK 4
#define HDLC_ENCODING_BIPHASE_SPACE 5
#define HDLC_ENCODING_BIPHASE_LEVEL 6
@@ -227,17 +235,19 @@ struct mgsl_icount {
* MGSL_IOCTXABORT abort transmitting frame (HDLC)
* MGSL_IOCGSTATS return current statistics
* MGSL_IOCWAITEVENT wait for specified event to occur
+ * MGSL_LOOPTXDONE transmit in HDLC LoopMode done
*/
#define MGSL_MAGIC_IOC 'm'
-#define MGSL_IOCSPARAMS _IOW(MGSL_MAGIC_IOC,0,sizeof(MGSL_PARAMS))
-#define MGSL_IOCGPARAMS _IOR(MGSL_MAGIC_IOC,1,sizeof(MGSL_PARAMS))
+#define MGSL_IOCSPARAMS _IOW(MGSL_MAGIC_IOC,0,struct _MGSL_PARAMS)
+#define MGSL_IOCGPARAMS _IOR(MGSL_MAGIC_IOC,1,struct _MGSL_PARAMS)
#define MGSL_IOCSTXIDLE _IO(MGSL_MAGIC_IOC,2)
#define MGSL_IOCGTXIDLE _IO(MGSL_MAGIC_IOC,3)
#define MGSL_IOCTXENABLE _IO(MGSL_MAGIC_IOC,4)
#define MGSL_IOCRXENABLE _IO(MGSL_MAGIC_IOC,5)
#define MGSL_IOCTXABORT _IO(MGSL_MAGIC_IOC,6)
#define MGSL_IOCGSTATS _IO(MGSL_MAGIC_IOC,7)
-#define MGSL_IOCWAITEVENT _IO(MGSL_MAGIC_IOC,8)
+#define MGSL_IOCWAITEVENT _IOWR(MGSL_MAGIC_IOC,8,int)
#define MGSL_IOCCLRMODCOUNT _IO(MGSL_MAGIC_IOC,15)
+#define MGSL_IOCLOOPTXDONE _IO(MGSL_MAGIC_IOC,9)
#endif /* _SYNCLINK_H_ */
diff --git a/include/linux/sysv_fs.h b/include/linux/sysv_fs.h
index 49d9d24f1..d8c6eef5c 100644
--- a/include/linux/sysv_fs.h
+++ b/include/linux/sysv_fs.h
@@ -387,6 +387,7 @@ extern unsigned long sysv_count_free_blocks(struct super_block *sb);
extern int sysv_bmap(struct inode *,int);
extern struct buffer_head * sysv_getblk(struct inode *, unsigned int, int);
+extern int sysv_getblk_block(struct inode *, long, int, int *, int *);
extern struct buffer_head * sysv_file_bread(struct inode *, int, int);
extern ssize_t sysv_file_read(struct file *, char *, size_t, loff_t *);
diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h
index e36ceba9e..2124c7e57 100644
--- a/include/linux/ufs_fs.h
+++ b/include/linux/ufs_fs.h
@@ -537,6 +537,7 @@ extern int ufs_sync_inode (struct inode *);
extern void ufs_write_inode (struct inode *);
extern void ufs_delete_inode (struct inode *);
extern struct buffer_head * ufs_getfrag (struct inode *, unsigned, int, int *);
+extern int ufs_getfrag_block (struct inode *, long, int, int *, int *);
extern struct buffer_head * ufs_bread (struct inode *, unsigned, int, int *);
/* namei.c */
diff --git a/include/linux/umsdos_fs_i.h b/include/linux/umsdos_fs_i.h
index e3af5e921..96135ec0f 100644
--- a/include/linux/umsdos_fs_i.h
+++ b/include/linux/umsdos_fs_i.h
@@ -28,9 +28,8 @@
*
* For directory, we also have a reference to the inode of its
* own EMD file. Also, we have dir_locking_info to help synchronise
- * file creation and file lookup. This data is sharing space with
- * the pipe_inode_info not used by directory. See also msdos_fs_i.h
- * for more information about pipe_inode_info and msdos_inode_info.
+ * file creation and file lookup. See also msdos_fs_i.h for more
+ * information about msdos_inode_info.
*
* Special file and fifo do have an inode which correspond to an
* empty MSDOS file.
@@ -38,11 +37,6 @@
* symlink are processed mostly like regular file. The content is the
* link.
*
- * fifos add there own extension to the inode. I have reserved some
- * space for fifos side by side with msdos_inode_info. This is just
- * to for the show, because msdos_inode_info already include the
- * pipe_inode_info.
- *
* The UMSDOS specific extension is placed after the union.
*/
@@ -60,7 +54,6 @@ struct dir_locking_info {
struct umsdos_inode_info {
union {
struct msdos_inode_info msdos_info;
- struct pipe_inode_info pipe_info;
struct dir_locking_info dir_info;
} u;
int i_patched; /* Inode has been patched */