diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-02-23 00:40:54 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-02-23 00:40:54 +0000 |
commit | 529c593ece216e4aaffd36bd940cb94f1fa63129 (patch) | |
tree | 78f1c0b805f5656aa7b0417a043c5346f700a2cf /include/linux | |
parent | 0bd079751d25808d1972baee5c4eaa1db2227257 (diff) |
Merge with 2.3.43. I did ignore all modifications to the qlogicisp.c
driver due to the Origin A64 hacks.
Diffstat (limited to 'include/linux')
91 files changed, 1910 insertions, 894 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 5b1ad645c..6a9894bb0 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -56,15 +56,6 @@ enum typedef int acpi_dstate_t; -#ifdef __KERNEL__ - -extern int acpi_active; - -extern void (*acpi_idle)(void); -extern void (*acpi_power_off)(void); - -#endif /* __KERNEL__ */ - /* RSDP location */ #define ACPI_BIOS_ROM_BASE (0x0e0000) #define ACPI_BIOS_ROM_END (0x100000) diff --git a/include/linux/adfs_fs.h b/include/linux/adfs_fs.h index f6ed2d3b1..ae1e69173 100644 --- a/include/linux/adfs_fs.h +++ b/include/linux/adfs_fs.h @@ -2,113 +2,43 @@ #define _ADFS_FS_H #include <linux/types.h> -/* - * Structures of data on the disk - */ /* * Disc Record at disc address 0xc00 */ struct adfs_discrecord { - unsigned char log2secsize; - unsigned char secspertrack; - unsigned char heads; - unsigned char density; - unsigned char idlen; - unsigned char log2bpmb; - unsigned char skew; - unsigned char bootoption; - unsigned char lowsector; - unsigned char nzones; - unsigned short zone_spare; - unsigned long root; - unsigned long disc_size; - unsigned short disc_id; - unsigned char disc_name[10]; - unsigned long disc_type; - unsigned long disc_size_high; - unsigned char log2sharesize:4; - unsigned char unused:4; - unsigned char big_flag:1; + __u8 log2secsize; + __u8 secspertrack; + __u8 heads; + __u8 density; + __u8 idlen; + __u8 log2bpmb; + __u8 skew; + __u8 bootoption; + __u8 lowsector; + __u8 nzones; + __u16 zone_spare; + __u32 root; + __u32 disc_size; + __u16 disc_id; + __u8 disc_name[10]; + __u32 disc_type; + __u32 disc_size_high; + __u8 log2sharesize:4; + __u8 unused40:4; + __u8 big_flag:1; + __u8 unused41:1; + __u8 nzones_high; + __u32 format_version; + __u32 root_size; + __u8 unused52[60 - 52]; }; #define ADFS_DISCRECORD (0xc00) #define ADFS_DR_OFFSET (0x1c0) #define ADFS_DR_SIZE 60 +#define ADFS_DR_SIZE_BITS (ADFS_DR_SIZE << 3) #define ADFS_SUPER_MAGIC 0xadf5 -#define ADFS_FREE_FRAG 0 -#define ADFS_BAD_FRAG 1 -#define ADFS_ROOT_FRAG 2 - -/* - * Directory header - */ -struct adfs_dirheader { - unsigned char startmasseq; - unsigned char startname[4]; -}; - -#define ADFS_NEWDIR_SIZE 2048 -#define ADFS_OLDDIR_SIZE 1024 -#define ADFS_NUM_DIR_ENTRIES 77 - -/* - * Directory entries - */ -struct adfs_direntry { - char dirobname[10]; -#define ADFS_NAME_LEN 10 - __u8 dirload[4]; - __u8 direxec[4]; - __u8 dirlen[4]; - __u8 dirinddiscadd[3]; - __u8 newdiratts; -#define ADFS_NDA_OWNER_READ (1 << 0) -#define ADFS_NDA_OWNER_WRITE (1 << 1) -#define ADFS_NDA_LOCKED (1 << 2) -#define ADFS_NDA_DIRECTORY (1 << 3) -#define ADFS_NDA_EXECUTE (1 << 4) -#define ADFS_NDA_PUBLIC_READ (1 << 5) -#define ADFS_NDA_PUBLIC_WRITE (1 << 6) -}; - -#define ADFS_MAX_NAME_LEN 255 -struct adfs_idir_entry { - __u32 inode_no; /* Address */ - __u32 file_id; /* file id */ - __u32 name_len; /* name length */ - __u32 size; /* size */ - __u32 mtime; /* modification time */ - __u32 filetype; /* RiscOS file type */ - __u8 mode; /* internal mode */ - char name[ADFS_MAX_NAME_LEN]; /* file name */ -}; - -/* - * Directory tail - */ -union adfs_dirtail { - struct { - unsigned char dirlastmask; - char dirname[10]; - unsigned char dirparent[3]; - char dirtitle[19]; - unsigned char reserved[14]; - unsigned char endmasseq; - unsigned char endname[4]; - unsigned char dircheckbyte; - } old; - struct { - unsigned char dirlastmask; - unsigned char reserved[2]; - unsigned char dirparent[3]; - char dirtitle[19]; - char dirname[10]; - unsigned char endmasseq; - unsigned char endname[4]; - unsigned char dircheckbyte; - } new; -}; #ifdef __KERNEL__ /* @@ -129,47 +59,8 @@ extern inline int adfs_checkbblk(unsigned char *ptr) return (result & 0xff) != ptr[511]; } -/* dir.c */ -extern unsigned int adfs_val (unsigned char *p, int len); -extern int adfs_dir_read_parent (struct inode *inode, struct buffer_head **bhp); -extern int adfs_dir_read (struct inode *inode, struct buffer_head **bhp); -extern int adfs_dir_check (struct inode *inode, struct buffer_head **bhp, - int buffers, union adfs_dirtail *dtp); -extern void adfs_dir_free (struct buffer_head **bhp, int buffers); -extern int adfs_dir_get (struct super_block *sb, struct buffer_head **bhp, - int buffers, int pos, unsigned long parent_object_id, - struct adfs_idir_entry *ide); -extern int adfs_dir_find_entry (struct super_block *sb, struct buffer_head **bhp, - int buffers, unsigned int index, - struct adfs_idir_entry *ide); - -/* inode.c */ -extern int adfs_inode_validate (struct inode *inode); -extern unsigned long adfs_inode_generate (unsigned long parent_id, int diridx); -extern unsigned long adfs_inode_objid (struct inode *inode); -extern unsigned int adfs_parent_bmap (struct inode *inode, int block); -extern int adfs_bmap (struct inode *inode, int block); -extern void adfs_read_inode (struct inode *inode); - -/* map.c */ -extern int adfs_map_lookup (struct super_block *sb, int frag_id, int offset); - -/* namei.c */ -extern struct dentry *adfs_lookup (struct inode *dir, struct dentry *dentry); +#endif -/* super.c */ extern int init_adfs_fs (void); -extern void adfs_error (struct super_block *, const char *, const char *, ...); - -/* - * Inodes and file operations - */ - -/* dir.c */ -extern struct inode_operations adfs_dir_inode_operations; - -/* file.c */ -extern struct inode_operations adfs_file_inode_operations; -#endif #endif diff --git a/include/linux/adfs_fs_i.h b/include/linux/adfs_fs_i.h index 831575165..94d5607bf 100644 --- a/include/linux/adfs_fs_i.h +++ b/include/linux/adfs_fs_i.h @@ -11,7 +11,13 @@ * adfs file system inode data in memory */ struct adfs_inode_info { - unsigned long file_id; /* id of fragments containing actual data */ + unsigned long mmu_private; + unsigned long parent_id; /* object id of parent */ + __u32 loadaddr; /* RISC OS load address */ + __u32 execaddr; /* RISC OS exec address */ + unsigned int filetype; /* RISC OS file type */ + unsigned int attr; /* RISC OS permissions */ + int stamped:1; /* RISC OS file has date/time */ }; #endif diff --git a/include/linux/adfs_fs_sb.h b/include/linux/adfs_fs_sb.h index 649b61e45..30082c823 100644 --- a/include/linux/adfs_fs_sb.h +++ b/include/linux/adfs_fs_sb.h @@ -1,33 +1,38 @@ /* * linux/include/linux/adfs_fs_sb.h * - * Copyright (C) 1997 Russell King + * Copyright (C) 1997-1999 Russell King */ #ifndef _ADFS_FS_SB #define _ADFS_FS_SB -#include <linux/adfs_fs.h> +/* + * Forward-declare this + */ +struct adfs_discmap; +struct adfs_dir_ops; /* - * adfs file system superblock data in memory + * ADFS file system superblock data in memory */ struct adfs_sb_info { - struct buffer_head *s_sbh; /* buffer head containing disc record */ - struct adfs_discrecord *s_dr; /* pointer to disc record in s_sbh */ - uid_t s_uid; /* owner uid */ - gid_t s_gid; /* owner gid */ - int s_owner_mask; /* ADFS Owner perm -> unix perm */ - int s_other_mask; /* ADFS Other perm -> unix perm */ - __u16 s_zone_size; /* size of a map zone in bits */ - __u16 s_ids_per_zone; /* max. no ids in one zone */ - __u32 s_idlen; /* length of ID in map */ - __u32 s_map_size; /* size of a map */ - __u32 s_zonesize; /* zone size (in map bits) */ - __u32 s_map_block; /* block address of map */ - struct buffer_head **s_map; /* bh list containing map */ - __u32 s_root; /* root disc address */ - __s8 s_map2blk; /* shift left by this for map->sector */ + struct adfs_discmap *s_map; /* bh list containing map */ + struct adfs_dir_ops *s_dir; /* directory operations */ + + uid_t s_uid; /* owner uid */ + gid_t s_gid; /* owner gid */ + umode_t s_owner_mask; /* ADFS owner perm -> unix perm */ + umode_t s_other_mask; /* ADFS other perm -> unix perm */ + + __u32 s_ids_per_zone; /* max. no ids in one zone */ + __u32 s_idlen; /* length of ID in map */ + __u32 s_map_size; /* sector size of a map */ + unsigned long s_size; /* total size (in blocks) of this fs */ + signed int s_map2blk; /* shift left by this for map->sector */ + unsigned int s_log2sharesize;/* log2 share size */ + unsigned int s_version; /* disc format version */ + unsigned int s_namelen; /* maximum number of characters in name */ }; #endif diff --git a/include/linux/affs_fs.h b/include/linux/affs_fs.h index 342ac2648..90e5a3dd2 100644 --- a/include/linux/affs_fs.h +++ b/include/linux/affs_fs.h @@ -105,11 +105,11 @@ extern void affs_dir_truncate(struct inode *); extern struct inode_operations affs_file_inode_operations; extern struct inode_operations affs_file_inode_operations_ofs; extern struct inode_operations affs_dir_inode_operations; -extern struct inode_operations affs_symlink_inode_operations; -extern struct inode_operations affs_chrdev_inode_operations; -extern struct inode_operations affs_blkdev_inode_operations; +extern struct address_space_operations affs_symlink_aops; +extern struct address_space_operations affs_aops; extern struct dentry_operations affs_dentry_operations; extern struct dentry_operations affs_dentry_operations_intl; +extern int affs_bmap(struct inode *, int); #endif diff --git a/include/linux/affs_fs_i.h b/include/linux/affs_fs_i.h index beeabb0de..a55951fbf 100644 --- a/include/linux/affs_fs_i.h +++ b/include/linux/affs_fs_i.h @@ -29,6 +29,7 @@ struct ext_cache { * affs fs inode data in memory */ struct affs_inode_info { + unsigned long mmu_private; u32 i_protect; /* unused attribute bits */ s32 i_parent; /* parent ino */ s32 i_original; /* if != 0, this is the key of the original */ diff --git a/include/linux/agp_backend.h b/include/linux/agp_backend.h index eaa8bd1be..3c8c7e01f 100644 --- a/include/linux/agp_backend.h +++ b/include/linux/agp_backend.h @@ -48,6 +48,7 @@ enum chipset_type { VIA_GENERIC, VIA_VP3, VIA_MVP3, + VIA_MVP4, VIA_APOLLO_PRO, SIS_GENERIC, AMD_GENERIC, diff --git a/include/linux/atm.h b/include/linux/atm.h index 67a8f3465..ed917611f 100644 --- a/include/linux/atm.h +++ b/include/linux/atm.h @@ -1,6 +1,6 @@ /* atm.h - general ATM declarations */ -/* Written 1995-1999 by Werner Almesberger, EPFL LRC/ICA */ +/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */ /* @@ -20,6 +20,7 @@ #include <linux/socket.h> #include <linux/types.h> #endif +#include <linux/atmapi.h> #include <linux/atmsap.h> #include <linux/atmioc.h> @@ -84,23 +85,6 @@ * please speak up ... */ -/* socket layer */ -#define SO_BCTXOPT __SO_ENCODE(SOL_SOCKET,16,struct atm_buffconst) - /* not ATM specific - should go somewhere else */ -#define SO_BCRXOPT __SO_ENCODE(SOL_SOCKET,17,struct atm_buffconst) - - -/* for SO_BCTXOPT and SO_BCRXOPT */ - -struct atm_buffconst { - unsigned long buf_fac; /* buffer alignment factor */ - unsigned long buf_off; /* buffer alignment offset */ - unsigned long size_fac; /* buffer size factor */ - unsigned long size_off; /* buffer size offset */ - unsigned long min_size; /* minimum size */ - unsigned long max_size; /* maximum size, 0 = unlimited */ -}; - /* ATM cell header (for AAL0) */ @@ -154,12 +138,28 @@ struct atm_trafprm { int min_pcr; /* minimum PCR in cells per second */ int max_cdv; /* maximum CDV in microseconds */ int max_sdu; /* maximum SDU in bytes */ + /* extra params for ABR */ + unsigned int icr; /* Initial Cell Rate (24-bit) */ + unsigned int tbe; /* Transient Buffer Exposure (24-bit) */ + unsigned int frtt : 24; /* Fixed Round Trip Time (24-bit) */ + unsigned int rif : 4; /* Rate Increment Factor (4-bit) */ + unsigned int rdf : 4; /* Rate Decrease Factor (4-bit) */ + unsigned int nrm_pres :1; /* nrm present bit */ + unsigned int trm_pres :1; /* rm present bit */ + unsigned int adtf_pres :1; /* adtf present bit */ + unsigned int cdf_pres :1; /* cdf present bit*/ + unsigned int nrm :3; /* Max # of Cells for each forward RM cell (3-bit) */ + unsigned int trm :3; /* Time between forward RM cells (3-bit) */ + unsigned int adtf :10; /* ACR Decrease Time Factor (10-bit) */ + unsigned int cdf :3; /* Cutoff Decrease Factor (3-bit) */ + unsigned int spare :9; /* spare bits */ }; struct atm_qos { struct atm_trafprm txtp; /* parameters in TX direction */ - struct atm_trafprm rxtp; /* parameters in RX direction */ - unsigned char aal; + struct atm_trafprm rxtp __ATM_API_ALIGN; + /* parameters in RX direction */ + unsigned char aal __ATM_API_ALIGN; }; /* PVC addressing */ @@ -177,7 +177,7 @@ struct sockaddr_atmpvc { short itf; /* ATM interface */ short vpi; /* VPI (only 8 bits at UNI) */ int vci; /* VCI (only 16 bits at UNI) */ - } sap_addr; /* PVC address */ + } sap_addr __ATM_API_ALIGN; /* PVC address */ }; /* SVC addressing */ @@ -209,7 +209,7 @@ struct sockaddr_atmsvc { /* unused addresses must be bzero'ed */ char lij_type; /* role in LIJ call; one of ATM_LIJ* */ uint32_t lij_id; /* LIJ call identifier */ - } sas_addr; /* SVC address */ + } sas_addr __ATM_API_ALIGN; /* SVC address */ }; @@ -236,10 +236,6 @@ struct atmif_sioc { }; -#define ATM_CREATE_LEAF _IO('a',ATMIOC_SPECIAL+2) - /* create a point-to-multipoint leaf socket */ - - #ifdef __KERNEL__ #include <linux/net.h> /* struct net_proto */ diff --git a/include/linux/atm_eni.h b/include/linux/atm_eni.h index 7ed89d105..34f317972 100644 --- a/include/linux/atm_eni.h +++ b/include/linux/atm_eni.h @@ -1,7 +1,7 @@ /* atm_eni.h - Driver-specific declarations of the ENI driver (for use by driver-specific utilities) */ -/* Written 1995-1997 by Werner Almesberger, EPFL LRC */ +/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */ #ifndef LINUX_ATM_ENI_H @@ -9,7 +9,15 @@ #include <linux/atmioc.h> + +struct eni_multipliers { + int tx,rx; /* values are in percent and must be > 100 */ +}; + + #define ENI_MEMDUMP _IOW('a',ATMIOC_SARPRV,struct atmif_sioc) /* printk memory map */ +#define ENI_SETMULT _IOW('a',ATMIOC_SARPRV+7,struct atmif_sioc) + /* set buffer multipliers */ #endif diff --git a/include/linux/atm_idt77105.h b/include/linux/atm_idt77105.h new file mode 100644 index 000000000..70e9e6e59 --- /dev/null +++ b/include/linux/atm_idt77105.h @@ -0,0 +1,40 @@ +/* atm_idt77105.h - Driver-specific declarations of the IDT77105 driver (for + * use by driver-specific utilities) */ + +/* Written 1999 by Greg Banks <gnb@linuxfan.com>. Copied from atm_suni.h. */ + + +#ifndef LINUX_ATM_IDT77105_H +#define LINUX_ATM_IDT77105_H + +#include <asm/types.h> +#include <linux/atmioc.h> + +/* + * Structure for IDT77105_GETSTAT and IDT77105_GETSTATZ ioctls. + * Pointed to by `arg' in atmif_sioc. + */ +struct idt77105_stats { + __u32 symbol_errors; /* wire symbol errors */ + __u32 tx_cells; /* cells transmitted */ + __u32 rx_cells; /* cells received */ + __u32 rx_hec_errors; /* Header Error Check errors on receive */ +}; + +#define IDT77105_GETLOOP _IOW('a',ATMIOC_PHYPRV,struct atmif_sioc) /* get loopback mode */ +#define IDT77105_SETLOOP _IOW('a',ATMIOC_PHYPRV+1,struct atmif_sioc) /* set loopback mode */ +#define IDT77105_GETSTAT _IOW('a',ATMIOC_PHYPRV+2,struct atmif_sioc) /* get stats */ +#define IDT77105_GETSTATZ _IOW('a',ATMIOC_PHYPRV+3,struct atmif_sioc) /* get stats and zero */ + + +/* + * TODO: what we need is a global loopback mode get/set ioctl for + * all devices, not these device-specific hacks -- Greg Banks + */ +#define IDT77105_LM_NONE 0 /* no loopback */ +#define IDT77105_LM_DIAG 1 /* diagnostic (i.e. loop TX to RX) + * (a.k.a. local loopback) */ +#define IDT77105_LM_LOOP 2 /* line (i.e. loop RX to TX) + * (a.k.a. remote loopback) */ + +#endif diff --git a/include/linux/atm_nicstar.h b/include/linux/atm_nicstar.h index 3b564d227..577b79f33 100644 --- a/include/linux/atm_nicstar.h +++ b/include/linux/atm_nicstar.h @@ -18,6 +18,7 @@ * sys/types.h for struct timeval */ +#include <linux/atmapi.h> #include <linux/atmioc.h> #define NS_GETPSTAT _IOWR('a',ATMIOC_SARPRV+1,struct atmif_sioc) @@ -32,7 +33,7 @@ typedef struct buf_nr unsigned min; unsigned init; unsigned max; -} buf_nr; +}buf_nr; typedef struct pool_levels diff --git a/include/linux/atm_tcp.h b/include/linux/atm_tcp.h index 7e8eb77d6..a79f45bc3 100644 --- a/include/linux/atm_tcp.h +++ b/include/linux/atm_tcp.h @@ -1,12 +1,14 @@ /* atm_tcp.h - Driver-specific declarations of the ATMTCP driver (for use by driver-specific utilities) */ -/* Written 1997-1999 by Werner Almesberger, EPFL LRC/ICA */ +/* Written 1997-2000 by Werner Almesberger, EPFL LRC/ICA */ #ifndef LINUX_ATM_TCP_H #define LINUX_ATM_TCP_H +#include <linux/atmapi.h> + #ifdef __KERNEL__ #include <linux/types.h> #endif @@ -33,12 +35,12 @@ struct atmtcp_hdr { struct atmtcp_control { struct atmtcp_hdr hdr; /* must be first */ - int type; /* message type; both directions */ - unsigned long vcc; /* both directions */ + int type; /* message type; both directions */ + atm_kptr_t vcc; /* both directions */ struct sockaddr_atmpvc addr; /* suggested value from kernel */ struct atm_qos qos; /* both directions */ int result; /* to kernel only */ -}; +} __ATM_API_ALIGN; /* * Field usage: diff --git a/include/linux/atm_zatm.h b/include/linux/atm_zatm.h index d8d85cb76..5ca80691c 100644 --- a/include/linux/atm_zatm.h +++ b/include/linux/atm_zatm.h @@ -1,7 +1,7 @@ /* atm_zatm.h - Driver-specific declarations of the ZATM driver (for use by driver-specific utilities) */ -/* Written 1995-1997 by Werner Almesberger, EPFL LRC */ +/* Written 1995-1999 by Werner Almesberger, EPFL LRC/ICA */ #ifndef LINUX_ATM_ZATM_H @@ -12,6 +12,7 @@ * sys/types.h for struct timeval */ +#include <linux/atmapi.h> #include <linux/atmioc.h> #define ZATM_GETPOOL _IOW('a',ATMIOC_SARPRV+1,struct atmif_sioc) diff --git a/include/linux/atmapi.h b/include/linux/atmapi.h new file mode 100644 index 000000000..bdf01ef9c --- /dev/null +++ b/include/linux/atmapi.h @@ -0,0 +1,29 @@ +/* atmapi.h - ATM API user space/kernel compatibility */ + +/* Written 1999,2000 by Werner Almesberger, EPFL ICA */ + + +#ifndef _LINUX_ATMAPI_H +#define _LINUX_ATMAPI_H + +#ifdef __sparc__ +/* such alignment is not required on 32 bit sparcs, but we can't + figure that we are on a sparc64 while compiling user-space programs. */ +#define __ATM_API_ALIGN __attribute__((aligned(8))) +#else +#define __ATM_API_ALIGN +#endif + + +/* + * Opaque type for kernel pointers. Note that _ is never accessed. We need + * the struct in order hide the array, so that we can make simple assignments + * instead of being forced to use memcpy. It also improves error reporting for + * code that still assumes that we're passing unsigned longs. + * + * Convention: NULL pointers are passed as a field of all zeroes. + */ + +typedef struct { unsigned char _[8]; } atm_kptr_t; + +#endif diff --git a/include/linux/atmarp.h b/include/linux/atmarp.h index 057300fd5..24f82338f 100644 --- a/include/linux/atmarp.h +++ b/include/linux/atmarp.h @@ -1,6 +1,6 @@ /* atmarp.h - ATM ARP protocol and kernel-demon interface definitions */ -/* Written 1995-1998 by Werner Almesberger, EPFL LRC/ICA */ +/* Written 1995-1999 by Werner Almesberger, EPFL LRC/ICA */ #ifndef _LINUX_ATMARP_H @@ -9,6 +9,7 @@ #ifdef __KERNEL__ #include <linux/types.h> #endif +#include <linux/atmapi.h> #include <linux/atmioc.h> diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h index 0287d1661..95e97de35 100644 --- a/include/linux/atmdev.h +++ b/include/linux/atmdev.h @@ -8,6 +8,8 @@ #include <linux/config.h> +#include <linux/atmapi.h> +#include <linux/atm.h> #include <linux/atmioc.h> @@ -26,9 +28,9 @@ struct atm_aal_stats { - long tx,tx_err; /* TX okay and errors */ - long rx,rx_err; /* RX okay and errors */ - long rx_drop; /* RX out of memory */ + int tx,tx_err; /* TX okay and errors */ + int rx,rx_err; /* RX okay and errors */ + int rx_drop; /* RX out of memory */ }; @@ -36,7 +38,7 @@ struct atm_dev_stats { struct atm_aal_stats aal0; struct atm_aal_stats aal34; struct atm_aal_stats aal5; -}; +} __ATM_API_ALIGN; #define ATM_GETLINKRATE _IOW('a',ATMIOC_ITF+1,struct atmif_sioc) @@ -123,6 +125,12 @@ struct atm_cirange { #define ATM_VS2TXT_MAP \ "IDLE", "CONNECTED", "CLOSING", "LISTEN", "INUSE", "BOUND" +#define ATM_VF2TXT_MAP \ + "ADDR", "READY", "PARTIAL", "REGIS", \ + "RELEASED", "HASQOS", "LISTEN", "META", \ + "256", "512", "1024", "2048", \ + "SESSION", "HASSAP", "BOUND", "CLOSE" + #ifdef __KERNEL__ @@ -130,8 +138,8 @@ struct atm_cirange { #include <linux/time.h> /* struct timeval */ #include <linux/net.h> #include <linux/skbuff.h> /* struct sk_buff */ -#include <linux/atm.h> #include <linux/uio.h> +#include <net/sock.h> #include <asm/atomic.h> #ifdef CONFIG_PROC_FS @@ -156,10 +164,10 @@ struct atm_cirange { #define ATM_VF_META 128 /* SVC socket isn't used for normal data traffic and doesn't depend on signaling to be available */ -#define ATM_VF_AQREL 256 /* Arequipa VC is being released */ -#define ATM_VF_AQDANG 512 /* VC is in Arequipa's dangling list */ -#define ATM_VF_SCRX ATM_SC_RX /* 1024; allow single-copy in the RX dir. */ -#define ATM_VF_SCTX ATM_SC_TX /* 2048; allow single-copy in the TX dir. */ + /* 256; unused */ + /* 512; unused */ + /* 1024; unused */ + /* 2048; unused */ #define ATM_VF_SESSION 4096 /* VCC is p2mp session control descriptor */ #define ATM_VF_HASSAP 8192 /* SAP has been set */ #define ATM_VF_CLOSE 32768 /* asynchronous close - treat like VF_RELEASED*/ @@ -191,7 +199,6 @@ struct atm_vcc { struct atm_dev *dev; /* device back pointer */ struct atm_qos qos; /* QOS */ struct atm_sap sap; /* SAP */ - unsigned long tx_quota,rx_quota; /* buffer quotas */ atomic_t tx_inuse,rx_inuse; /* buffer space in use */ void (*push)(struct atm_vcc *vcc,struct sk_buff *skb); void (*pop)(struct atm_vcc *vcc,struct sk_buff *skb); /* optional */ @@ -207,6 +214,7 @@ struct atm_vcc { struct atm_aal_stats *stats; /* pointer to AAL stats group */ wait_queue_head_t sleep; /* if socket is busy */ wait_queue_head_t wsleep; /* if waiting for write buffer space */ + struct sock *sk; /* socket backpointer */ struct atm_vcc *prev,*next; /* SVC part --- may move later ------------------------------------- */ short itf; /* interface number */ @@ -220,7 +228,9 @@ struct atm_vcc { /* Multipoint part ------------------------------------------------- */ struct atm_vcc *session; /* session VCC descriptor */ /* Other stuff ----------------------------------------------------- */ - void *user_back; /* user backlink - not touched */ + void *user_back; /* user backlink - not touched by */ + /* native ATM stack. Currently used */ + /* by CLIP and sch_atm. */ }; @@ -338,6 +348,12 @@ static __inline__ void atm_return(struct atm_vcc *vcc,int truesize) } +static __inline__ int atm_may_send(struct atm_vcc *vcc,unsigned int size) +{ + return size+atomic_read(&vcc->tx_inuse)+ATM_PDU_OVHD < vcc->sk->sndbuf; +} + + int atm_charge(struct atm_vcc *vcc,int truesize); struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc,int pdu_size, int gfp_flags); diff --git a/include/linux/atmioc.h b/include/linux/atmioc.h index 17a5f4ca3..920ac56c5 100644 --- a/include/linux/atmioc.h +++ b/include/linux/atmioc.h @@ -1,10 +1,10 @@ /* atmioc.h - ranges for ATM-related ioctl numbers */ -/* Written 1995-1998 by Werner Almesberger, EPFL LRC */ +/* Written 1995-1999 by Werner Almesberger, EPFL LRC/ICA */ /* - * See http://lrcwww.epfl.ch/linux-atm/magic.html for the complete list of + * See http://icawww1.epfl.ch/linux-atm/magic.html for the complete list of * "magic" ioctl numbers. */ diff --git a/include/linux/atmlec.h b/include/linux/atmlec.h index 6b1be5adf..dd6b349a0 100644 --- a/include/linux/atmlec.h +++ b/include/linux/atmlec.h @@ -9,6 +9,7 @@ #ifndef _ATMLEC_H_ #define _ATMLEC_H_ +#include <linux/atmapi.h> #include <linux/atmioc.h> #include <linux/atm.h> #include <linux/if_ether.h> @@ -43,15 +44,16 @@ typedef enum { struct atmlec_config_msg { unsigned int maximum_unknown_frame_count; - unsigned long max_unknown_frame_time; + unsigned int max_unknown_frame_time; unsigned short max_retry_count; - unsigned long aging_time; - unsigned long forward_delay_time; - unsigned long arp_response_time; - unsigned long flush_timeout; - unsigned long path_switching_delay; + unsigned int aging_time; + unsigned int forward_delay_time; + unsigned int arp_response_time; + unsigned int flush_timeout; + unsigned int path_switching_delay; unsigned int lane_version; /* LANE2: 1 for LANEv1, 2 for LANEv2 */ int mtu; + int is_proxy; }; struct atmlec_msg { @@ -61,7 +63,7 @@ struct atmlec_msg { struct { unsigned char mac_addr[ETH_ALEN]; unsigned char atm_addr[ATM_ESA_LEN]; - unsigned long flag;/* Topology_change flag, + unsigned int flag;/* Topology_change flag, remoteflag, permanent flag, lecid, transaction id */ unsigned int targetless_le_arp; /* LANE2 */ @@ -73,9 +75,10 @@ struct atmlec_msg { uint32_t tran_id; /* transaction id */ unsigned char mac_addr[ETH_ALEN]; /* dst mac addr */ unsigned char atm_addr[ATM_ESA_LEN]; /* reqestor ATM addr */ - } proxy; /* For mapping LE_ARP requests to responses. Filled by */ + } proxy; + /* For mapping LE_ARP requests to responses. Filled by */ } content; /* zeppelin, returned by kernel. Used only when proxying */ -}; +} __ATM_API_ALIGN; struct atmlec_ioc { int dev_num; diff --git a/include/linux/atmmpc.h b/include/linux/atmmpc.h index e9c2ace8c..5fbfa6813 100644 --- a/include/linux/atmmpc.h +++ b/include/linux/atmmpc.h @@ -1,6 +1,7 @@ #ifndef _ATMMPC_H_ #define _ATMMPC_H_ +#include <linux/atmapi.h> #include <linux/atmioc.h> #include <linux/atm.h> @@ -37,16 +38,16 @@ typedef struct eg_ctrl_info { uint16_t holding_time; } eg_ctrl_info; -struct mpc_parameters{ +struct mpc_parameters { uint16_t mpc_p1; /* Shortcut-Setup Frame Count */ uint16_t mpc_p2; /* Shortcut-Setup Frame Time */ uint8_t mpc_p3[8]; /* Flow-detection Protocols */ uint16_t mpc_p4; /* MPC Initial Retry Time */ uint16_t mpc_p5; /* MPC Retry Time Maximum */ uint16_t mpc_p6; /* Hold Down Time */ -}; +} ; -struct k_message{ +struct k_message { uint16_t type; uint32_t ip_mask; uint8_t MPS_ctrl[ATM_ESA_LEN]; @@ -56,9 +57,10 @@ struct k_message{ struct mpc_parameters params; } content; struct atm_qos qos; -}; +} __ATM_API_ALIGN; -struct llc_snap_hdr { /* RFC 1483 LLC/SNAP encapsulation for routed IP PDUs */ +struct llc_snap_hdr { + /* RFC 1483 LLC/SNAP encapsulation for routed IP PDUs */ uint8_t dsap; /* Destination Service Access Point (0xAA) */ uint8_t ssap; /* Source Service Access Point (0xAA) */ uint8_t ui; /* Unnumbered Information (0x03) */ @@ -121,4 +123,3 @@ struct llc_snap_hdr { /* RFC 1483 LLC/SNAP encapsulation for routed IP PDUs */ #define RELOAD 301 /* kill -HUP the daemon for reload */ #endif /* _ATMMPC_H_ */ - diff --git a/include/linux/atmsap.h b/include/linux/atmsap.h index f49418862..799b10451 100644 --- a/include/linux/atmsap.h +++ b/include/linux/atmsap.h @@ -1,11 +1,13 @@ /* atmsap.h - ATM Service Access Point addressing definitions */ -/* Written 1995-1998 by Werner Almesberger, EPFL LRC/ICA */ +/* Written 1995-1999 by Werner Almesberger, EPFL LRC/ICA */ #ifndef _LINUX_ATMSAP_H #define _LINUX_ATMSAP_H +#include <linux/atmapi.h> + /* * BEGIN_xx and END_xx markers are used for automatic generation of * documentation. Do not change them. @@ -116,24 +118,22 @@ struct atm_blli { unsigned char def_size; /* default packet size (log2), 4-12 (0 to */ /* omit) */ unsigned char window;/* packet window size, 1-127 (0 to omit) */ - } itu; /* ITU-T ecoding */ + } itu; /* ITU-T encoding */ unsigned char user; /* user specified l3 information */ - struct { /* if l3_proto = ATM_L3_H310 */ - unsigned char term_type; /* terminal type */ + struct { /* if l3_proto = ATM_L3_H310 */ + unsigned char term_type; /* terminal type */ unsigned char fw_mpx_cap; /* forward multiplexing capability */ /* only if term_type != ATM_TT_NONE */ unsigned char bw_mpx_cap; /* backward multiplexing capability */ /* only if term_type != ATM_TT_NONE */ } h310; - struct { /* if l3_proto = ATM_L3_TR9577 */ - unsigned char ipi; /* initial protocol id */ + struct { /* if l3_proto = ATM_L3_TR9577 */ + unsigned char ipi; /* initial protocol id */ unsigned char snap[5];/* IEEE 802.1 SNAP identifier */ /* (only if ipi == NLPID_IEEE802_1_SNAP) */ } tr9577; } l3; - struct atm_blli *next; /* next BLLI or NULL (undefined when used in */ - /* atmsvc_msg) ONLY USED IN OLD-STYLE API */ -}; +} __ATM_API_ALIGN; struct atm_bhli { @@ -149,7 +149,8 @@ struct atm_bhli { struct atm_sap { struct atm_bhli bhli; /* local SAP, high-layer information */ - struct atm_blli blli[ATM_MAX_BLLI]; /* local SAP, low-layer info */ + struct atm_blli blli[ATM_MAX_BLLI] __ATM_API_ALIGN; + /* local SAP, low-layer info */ }; diff --git a/include/linux/atmsvc.h b/include/linux/atmsvc.h index 8b93f5644..4df1c5481 100644 --- a/include/linux/atmsvc.h +++ b/include/linux/atmsvc.h @@ -1,11 +1,12 @@ /* atmsvc.h - ATM signaling kernel-demon interface definitions */ -/* Written 1995-1999 by Werner Almesberger, EPFL LRC/ICA */ +/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */ #ifndef _LINUX_ATMSVC_H #define _LINUX_ATMSVC_H +#include <linux/atmapi.h> #include <linux/atm.h> #include <linux/atmioc.h> @@ -19,8 +20,8 @@ enum atmsvc_msg_type { as_catch_null,as_bind,as_connect,as_accept,as_reject, struct atmsvc_msg { enum atmsvc_msg_type type; - unsigned long vcc; - unsigned long listen_vcc; /* indicate */ + atm_kptr_t vcc; + atm_kptr_t listen_vcc; /* indicate */ int reply; /* for okay and close: */ /* < 0: error before active */ /* (sigd has discarded ctx) */ @@ -31,12 +32,12 @@ struct atmsvc_msg { struct sockaddr_atmsvc local; /* local SVC address */ struct atm_qos qos; /* QOS parameters */ struct atm_sap sap; /* SAP */ - unsigned long session; /* for p2pm */ + unsigned int session; /* for p2pm */ struct sockaddr_atmsvc svc; /* SVC address */ -}; +} __ATM_API_ALIGN; /* - * Message contents: see ftp://lrcftp.epfl.ch/pub/linux/atm/docs/isp-*.tar.gz + * Message contents: see ftp://icaftp.epfl.ch/pub/linux/atm/docs/isp-*.tar.gz */ /* diff --git a/include/linux/auto_fs.h b/include/linux/auto_fs.h index 99f9784d3..962593cc8 100644 --- a/include/linux/auto_fs.h +++ b/include/linux/auto_fs.h @@ -14,20 +14,21 @@ #ifndef _LINUX_AUTO_FS_H #define _LINUX_AUTO_FS_H +#ifdef __KERNEL__ #include <linux/version.h> #include <linux/fs.h> #include <linux/limits.h> -#include <linux/ioctl.h> #include <asm/types.h> +#endif /* __KERNEL__ */ + +#include <linux/ioctl.h> -/* This header file describes a range of autofs interface versions; - the new implementation ("autofs4") supports them all, but the old - implementation only supports v3. */ -#define AUTOFS_MIN_PROTO_VERSION 3 /* Min version we support */ -#define AUTOFS_MAX_PROTO_VERSION 4 /* Max (current) version */ +/* This file describes autofs v3 */ +#define AUTOFS_PROTO_VERSION 3 -/* Backwards compat for autofs v3; it just implements a version */ -#define AUTOFS_PROTO_VERSION 3 /* v3 version */ +/* Range of protocol versions defined */ +#define AUTOFS_MAX_PROTO_VERSION AUTOFS_PROTO_VERSION +#define AUTOFS_MIN_PROTO_VERSION AUTOFS_PROTO_VERSION /* * Architectures where both 32- and 64-bit binaries can be executed @@ -50,15 +51,13 @@ typedef unsigned int autofs_wqt_t; typedef unsigned long autofs_wqt_t; #endif -enum autofs_packet_type { - autofs_ptype_missing, /* Missing entry (mount request) */ - autofs_ptype_expire, /* Expire entry (umount request) */ - autofs_ptype_expire_multi, /* Expire entry (umount request) */ -}; +/* Packet types */ +#define autofs_ptype_missing 0 /* Missing entry (mount request) */ +#define autofs_ptype_expire 1 /* Expire entry (umount request) */ struct autofs_packet_hdr { - int proto_version; /* Protocol version */ - enum autofs_packet_type type; /* Type of packet */ + int proto_version; /* Protocol version */ + int type; /* Type of packet */ }; struct autofs_packet_missing { @@ -75,28 +74,12 @@ struct autofs_packet_expire { char name[NAME_MAX+1]; }; -/* v4 multi expire (via pipe) */ -struct autofs_packet_expire_multi { - struct autofs_packet_hdr hdr; - autofs_wqt_t wait_queue_token; - int len; - char name[NAME_MAX+1]; -}; - -union autofs_packet_union { - struct autofs_packet_hdr hdr; - struct autofs_packet_missing missing; - struct autofs_packet_expire expire; - struct autofs_packet_expire_multi expire_multi; -}; - #define AUTOFS_IOC_READY _IO(0x93,0x60) #define AUTOFS_IOC_FAIL _IO(0x93,0x61) #define AUTOFS_IOC_CATATONIC _IO(0x93,0x62) #define AUTOFS_IOC_PROTOVER _IOR(0x93,0x63,int) #define AUTOFS_IOC_SETTIMEOUT _IOWR(0x93,0x64,unsigned long) #define AUTOFS_IOC_EXPIRE _IOR(0x93,0x65,struct autofs_packet_expire) -#define AUTOFS_IOC_EXPIRE_MULTI _IOW(0x93,0x66,int) #ifdef __KERNEL__ diff --git a/include/linux/auto_fs4.h b/include/linux/auto_fs4.h new file mode 100644 index 000000000..52ff6d8a3 --- /dev/null +++ b/include/linux/auto_fs4.h @@ -0,0 +1,47 @@ +/* -*- c-mode -*- + * linux/include/linux/auto_fs4.h + * + * Copyright 1999-2000 Jeremy Fitzhardinge <jeremy@goop.org> + * + * This file is part of the Linux kernel and is made available under + * the terms of the GNU General Public License, version 2, or at your + * option, any later version, incorporated herein by reference. + */ + +#ifndef _LINUX_AUTO_FS4_H +#define _LINUX_AUTO_FS4_H + +/* Include common v3 definitions */ +#include <linux/auto_fs.h> + +/* autofs v4 definitions */ +#undef AUTOFS_PROTO_VERSION +#undef AUTOFS_MIN_PROTO_VERSION +#undef AUTOFS_MAX_PROTO_VERSION + +#define AUTOFS_PROTO_VERSION 4 +#define AUTOFS_MIN_PROTO_VERSION 3 +#define AUTOFS_MAX_PROTO_VERSION 4 + +/* New message type */ +#define autofs_ptype_expire_multi 2 /* Expire entry (umount request) */ + +/* v4 multi expire (via pipe) */ +struct autofs_packet_expire_multi { + struct autofs_packet_hdr hdr; + autofs_wqt_t wait_queue_token; + int len; + char name[NAME_MAX+1]; +}; + +union autofs_packet_union { + struct autofs_packet_hdr hdr; + struct autofs_packet_missing missing; + struct autofs_packet_expire expire; + struct autofs_packet_expire_multi expire_multi; +}; + +#define AUTOFS_IOC_EXPIRE_MULTI _IOW(0x93,0x66,int) + + +#endif /* _LINUX_AUTO_FS4_H */ diff --git a/include/linux/bfs_fs.h b/include/linux/bfs_fs.h index 880ac7f0b..7e7de106a 100644 --- a/include/linux/bfs_fs.h +++ b/include/linux/bfs_fs.h @@ -83,6 +83,7 @@ extern int init_bfs_fs(void); /* file.c */ extern struct inode_operations bfs_file_inops; +extern struct address_space_operations bfs_aops; /* dir.c */ extern struct inode_operations bfs_dir_inops; diff --git a/include/linux/bfs_fs_sb.h b/include/linux/bfs_fs_sb.h index f0f54d606..5f927f35b 100644 --- a/include/linux/bfs_fs_sb.h +++ b/include/linux/bfs_fs_sb.h @@ -7,13 +7,6 @@ #define _LINUX_BFS_FS_SB /* - * BFS block map entry, an array of these is kept in bfs_sb_info. - */ - struct bfs_bmap { - unsigned long start, end; - }; - -/* * BFS file system in-core superblock info */ struct bfs_sb_info { @@ -24,7 +17,6 @@ struct bfs_sb_info { unsigned long si_lf_sblk; unsigned long si_lf_eblk; unsigned long si_lasti; - struct bfs_bmap * si_bmap; char * si_imap; struct buffer_head * si_sbh; /* buffer header w/superblock */ struct bfs_super_block * si_bfs_sb; /* superblock in si_sbh->b_data */ diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index c86eecc9b..6eed225b6 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -37,14 +37,17 @@ struct request { }; typedef struct request_queue request_queue_t; -typedef int (merge_request_fn) (request_queue_t *, - struct request * req, - struct buffer_head *); -typedef int (merge_requests_fn) (request_queue_t *, - struct request * req, - struct request * req2); -typedef void (request_fn_proc) (request_queue_t *); +typedef int (merge_request_fn) (request_queue_t *q, + struct request *req, + struct buffer_head *bh); +typedef int (merge_requests_fn) (request_queue_t *q, + struct request *req, + struct request *req2); +typedef void (request_fn_proc) (request_queue_t *q); typedef request_queue_t * (queue_proc) (kdev_t dev); +typedef void (make_request_fn) (int rw, struct buffer_head *bh); +typedef void (plug_device_fn) (request_queue_t *q, kdev_t device); +typedef void (unplug_device_fn) (void *q); struct request_queue { @@ -52,6 +55,8 @@ struct request_queue request_fn_proc * request_fn; merge_request_fn * merge_fn; merge_requests_fn * merge_requests_fn; + make_request_fn * make_request_fn; + plug_device_fn * plug_device_fn; /* * The queue owner gets to use this for whatever they like. * ll_rw_blk doesn't touch it. @@ -72,12 +77,6 @@ struct request_queue * not. */ char head_active; - - /* - * Boolean that indicates whether we should use plugging on - * this queue or not. - */ - char use_plug; }; struct blk_dev_struct { @@ -107,8 +106,10 @@ extern struct blk_dev_struct blk_dev[MAX_BLKDEV]; extern wait_queue_head_t wait_for_request; extern void grok_partitions(struct gendisk *dev, int drive, unsigned minors, long size); extern void register_disk(struct gendisk *dev, kdev_t first, unsigned minors, struct block_device_operations *ops, long size); -extern void unplug_device(void * data); -extern void make_request(int major,int rw, struct buffer_head * bh); +extern void generic_unplug_device(void * data); +extern void generic_plug_device (request_queue_t *q, kdev_t dev); +extern void generic_make_request(int rw, struct buffer_head * bh); +extern request_queue_t * blk_get_queue(kdev_t dev); /* * Access functions for manipulating queue properties @@ -116,12 +117,8 @@ extern void make_request(int major,int rw, struct buffer_head * bh); extern void blk_init_queue(request_queue_t *, request_fn_proc *); extern void blk_cleanup_queue(request_queue_t *); extern void blk_queue_headactive(request_queue_t *, int); -extern void blk_queue_pluggable(request_queue_t *, int); - -/* md needs this function to remap requests */ -extern int md_map (int minor, kdev_t *rdev, unsigned long *rsector, unsigned long size); -extern int md_make_request (int minor, int rw, struct buffer_head * bh); -extern int md_error (kdev_t mddev, kdev_t rdev); +extern void blk_queue_pluggable(request_queue_t *, plug_device_fn *); +extern void blk_queue_make_request(request_queue_t *, make_request_fn *); extern int * blk_size[MAX_BLKDEV]; diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index 7b51fcb54..75d9fb540 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h @@ -55,6 +55,3 @@ extern void * __init __alloc_bootmem_node (int nid, unsigned long size, unsigned __alloc_bootmem_node((nid), (x), PAGE_SIZE, 0) #endif /* _LINUX_BOOTMEM_H */ - - - diff --git a/include/linux/coda.h b/include/linux/coda.h index 8cb3ff46b..6e1a939be 100644 --- a/include/linux/coda.h +++ b/include/linux/coda.h @@ -305,33 +305,35 @@ struct coda_statfs { #define CODA_INACTIVE 21 #define CODA_VGET 22 #define CODA_SIGNAL 23 -#define CODA_REPLACE 24 -#define CODA_FLUSH 25 -#define CODA_PURGEUSER 26 -#define CODA_ZAPFILE 27 -#define CODA_ZAPDIR 28 -#define CODA_PURGEFID 30 +#define CODA_REPLACE 24 /* DOWNCALL */ +#define CODA_FLUSH 25 /* DOWNCALL */ +#define CODA_PURGEUSER 26 /* DOWNCALL */ +#define CODA_ZAPFILE 27 /* DOWNCALL */ +#define CODA_ZAPDIR 28 /* DOWNCALL */ +#define CODA_PURGEFID 30 /* DOWNCALL */ #define CODA_OPEN_BY_PATH 31 #define CODA_RESOLVE 32 #define CODA_REINTEGRATE 33 #define CODA_STATFS 34 -#define CODA_NCALLS 35 +#define CODA_MAKE_CINODE 35 /* DOWNCALL */ +#define CODA_NCALLS 36 -#define DOWNCALL(opcode) (opcode >= CODA_REPLACE && opcode <= CODA_PURGEFID) +#define DOWNCALL(opcode) \ + ((opcode >= CODA_REPLACE && opcode <= CODA_PURGEFID) || \ + opcode == CODA_MAKE_CINODE) #define VC_MAXDATASIZE 8192 #define VC_MAXMSGSIZE sizeof(union inputArgs)+sizeof(union outputArgs) +\ VC_MAXDATASIZE #define CIOC_KERNEL_VERSION _IOWR('c', 10, sizeof (int)) + #if 0 - /* don't care about kernel version number */ -#define CODA_KERNEL_VERSION 0 - /* The old venus 4.6 compatible interface */ -#define CODA_KERNEL_VERSION 1 +#define CODA_KERNEL_VERSION 0 /* don't care about kernel version number */ +#define CODA_KERNEL_VERSION 1 /* The old venus 4.6 compatible interface */ +#define CODA_KERNEL_VERSION 2 /* venus_lookup gets an extra parameter */ #endif - /* venus_lookup gets an extra parameter to aid windows.*/ -#define CODA_KERNEL_VERSION 2 +#define CODA_KERNEL_VERSION 3 /* added CODA_MAKE_CINODE downcall */ /* * Venus <-> Coda RPC arguments @@ -650,6 +652,13 @@ struct coda_purgefid_out { ViceFid CodaFid; }; +struct coda_make_cinode_out { + struct coda_out_hdr oh; + ViceFid CodaFid; + struct coda_vattr attr; + int fd; +}; + /* coda_rdwr: */ struct coda_rdwr_in { struct coda_in_hdr ih; @@ -751,6 +760,7 @@ union outputArgs { struct coda_purgefid_out coda_purgefid; struct coda_rdwr_out coda_rdwr; struct coda_replace_out coda_replace; + struct coda_make_cinode_out coda_make_cinode; struct coda_open_by_path_out coda_open_by_path; struct coda_statfs_out coda_statfs; }; diff --git a/include/linux/coda_fs_i.h b/include/linux/coda_fs_i.h index baa136b97..302a715b9 100644 --- a/include/linux/coda_fs_i.h +++ b/include/linux/coda_fs_i.h @@ -40,6 +40,8 @@ struct coda_inode_info { #define C_INITED 0x20 #define C_FLUSH 0x2 /* used after a flush */ +struct inode *coda_iget(struct super_block * sb, ViceFid * fid, + struct coda_vattr * attr); int coda_cnode_make(struct inode **, struct ViceFid *, struct super_block *); int coda_cnode_makectl(struct inode **inode, struct super_block *sb); struct inode *coda_fid_to_inode(ViceFid *fid, struct super_block *sb); diff --git a/include/linux/coda_linux.h b/include/linux/coda_linux.h index cd0e46cea..59cd5da3c 100644 --- a/include/linux/coda_linux.h +++ b/include/linux/coda_linux.h @@ -26,7 +26,9 @@ extern struct inode_operations coda_dir_inode_operations; extern struct inode_operations coda_file_inode_operations; extern struct inode_operations coda_ioctl_inode_operations; -extern struct inode_operations coda_symlink_inode_operations; + +extern struct address_space_operations coda_file_aops; +extern struct address_space_operations coda_symlink_aops; extern struct file_operations coda_dir_operations; extern struct file_operations coda_file_operations; diff --git a/include/linux/coda_psdev.h b/include/linux/coda_psdev.h index f23a8e9b9..2b6bbadd7 100644 --- a/include/linux/coda_psdev.h +++ b/include/linux/coda_psdev.h @@ -101,6 +101,7 @@ struct upc_req { #define REQ_ASYNC 0x1 #define REQ_READ 0x2 #define REQ_WRITE 0x4 +#define REQ_ABORT 0x8 /* diff --git a/include/linux/console.h b/include/linux/console.h index efb0003ea..1f4188a78 100644 --- a/include/linux/console.h +++ b/include/linux/console.h @@ -14,6 +14,9 @@ #ifndef _LINUX_CONSOLE_H_ #define _LINUX_CONSOLE_H_ 1 +#include <linux/types.h> +#include <linux/kdev_t.h> + struct vc_data; struct console_font_op; diff --git a/include/linux/efs_fs.h b/include/linux/efs_fs.h index a36f9d6fd..f422f4e51 100644 --- a/include/linux/efs_fs.h +++ b/include/linux/efs_fs.h @@ -47,7 +47,7 @@ static const char cprt[] = "EFS: "EFS_VERSION" - (c) 1999 Al Smith <Al.Smith@aes extern struct inode_operations efs_dir_inode_operations; extern struct inode_operations efs_file_inode_operations; -extern struct inode_operations efs_symlink_inode_operations; +extern struct address_space_operations efs_symlink_aops; extern int init_module(void); extern void cleanup_module(void); diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h index d2300c599..5bb7d8154 100644 --- a/include/linux/ext2_fs.h +++ b/include/linux/ext2_fs.h @@ -560,14 +560,10 @@ extern unsigned long ext2_count_free_inodes (struct super_block *); extern void ext2_check_inodes_bitmap (struct super_block *); /* inode.c */ -extern long ext2_bmap (struct inode *, long); -extern int ext2_get_block (struct inode *, long, struct buffer_head *, 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); extern void ext2_read_inode (struct inode *); extern void ext2_write_inode (struct inode *); extern void ext2_put_inode (struct inode *); @@ -620,9 +616,10 @@ extern struct inode_operations ext2_dir_inode_operations; extern struct inode_operations ext2_file_inode_operations; /* symlink.c */ -extern struct inode_operations ext2_symlink_inode_operations; extern struct inode_operations ext2_fast_symlink_inode_operations; +extern struct address_space_operations ext2_aops; + #endif /* __KERNEL__ */ #endif /* _LINUX_EXT2_FS_H */ diff --git a/include/linux/fs.h b/include/linux/fs.h index 35530b777..c10d1793b 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -251,6 +251,7 @@ extern void set_bh_page(struct buffer_head *bh, struct page *page, unsigned long #define touch_buffer(bh) set_bit(PG_referenced, &bh->b_page->flags) + #include <linux/pipe_fs_i.h> #include <linux/minix_fs_i.h> #include <linux/ext2_fs_i.h> @@ -332,10 +333,23 @@ struct iattr { * oh the beauties of C type declarations. */ struct page; +struct address_space; + +struct address_space_operations { + int (*writepage) (struct dentry *, struct page *); + int (*readpage)(struct dentry *, struct page *); + int (*prepare_write)(struct page *, unsigned, unsigned); + int (*commit_write)(struct file *, struct page *, unsigned, unsigned); + /* Unfortunately this kludge is needed for FIBMAP. Don't use it */ + int (*bmap)(struct address_space *, long); +}; struct address_space { - struct list_head pages; - unsigned long nrpages; + struct list_head pages; /* list of pages */ + unsigned long nrpages; /* number of pages */ + struct address_space_operations *a_ops; /* methods */ + void *host; /* owner: inode, block_device */ + void *private; /* private data */ }; struct block_device { @@ -374,6 +388,7 @@ struct inode { wait_queue_head_t i_wait; struct file_lock *i_flock; struct vm_area_struct *i_mmap; + struct address_space *i_mapping; struct address_space i_data; spinlock_t i_shared_lock; struct dquot *i_dquot[MAXQUOTAS]; @@ -655,24 +670,6 @@ 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 get_block, - * readpage and writepage 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 :)] - */ - /* - * Generic block allocator exported by the lowlevel fs. All metadata - * details are handled by the lowlevel fs, all 'logical data content' - * details are handled by the highlevel block layer. - */ - int (*get_block) (struct inode *, long, struct buffer_head *, int); - - int (*readpage) (struct dentry *, struct page *); - int (*writepage) (struct dentry *, struct page *); - void (*truncate) (struct inode *); int (*permission) (struct inode *, int); int (*revalidate) (struct dentry *); @@ -779,7 +776,6 @@ extern int blkdev_put(struct block_device *, int); extern int register_chrdev(unsigned int, const char *, struct file_operations *); extern int unregister_chrdev(unsigned int, const char *); extern int chrdev_open(struct inode *, struct file *); -extern struct file_operations def_chr_fops; extern const char * bdevname(kdev_t); extern const char * cdevname(kdev_t); extern const char * kdevname(kdev_t); @@ -852,20 +848,17 @@ extern inline void mark_buffer_protected(struct buffer_head * bh) } extern void FASTCALL(__mark_buffer_dirty(struct buffer_head *bh, int flag)); +extern void FASTCALL(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 (!atomic_set_buffer_dirty(bh)) - __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 *); -extern void invalidate_buffers(kdev_t); +#define invalidate_buffers(dev) __invalidate_buffers((dev), 0) +#define destroy_buffers(dev) __invalidate_buffers((dev), 1) +extern void __invalidate_buffers(kdev_t dev, int); extern int floppy_is_wp(int); extern void sync_inodes(kdev_t); extern void write_inode_now(struct inode *); @@ -978,30 +971,29 @@ extern void wakeup_bdflush(int wait); extern int brw_page(int, struct page *, kdev_t, int [], int); typedef int (*writepage_t)(struct file *, struct page *, unsigned long, unsigned long, const char *); +typedef int (get_block_t)(struct inode*,long,struct buffer_head*,int); /* Generic buffer handling for block filesystems.. */ -extern int block_read_full_page(struct dentry *, struct page *); -extern int block_write_full_page (struct dentry *, struct page *); -extern int block_write_partial_page (struct file *, struct page *, unsigned long, unsigned long, const char *); -extern int block_write_cont_page (struct file *, struct page *, unsigned long, unsigned long, const char *); -extern int block_write_zero_range(struct inode *, struct page *, unsigned, unsigned, unsigned, const char *); -extern inline int block_write_range(struct inode *inode, struct page *page, - unsigned from, unsigned len,const char *buf) -{ - return block_write_zero_range(inode, page, from, from, from+len, buf); -} extern int block_flushpage(struct page *, unsigned long); extern int block_symlink(struct inode *, const char *, int); +extern int block_write_full_page(struct page*, get_block_t*); +extern int block_read_full_page(struct page*, get_block_t*); +extern int block_prepare_write(struct page*, unsigned, unsigned, get_block_t*); +extern int cont_prepare_write(struct page*, unsigned, unsigned, get_block_t*, + unsigned long *); +int generic_block_bmap(struct address_space *, long, get_block_t *); +int generic_commit_write(struct file *, struct page *, unsigned, unsigned); 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 ssize_t generic_file_write(struct file *, const char *, size_t, loff_t *); extern void do_generic_file_read(struct file *, loff_t *, read_descriptor_t *, read_actor_t); extern int vfs_readlink(struct dentry *, char *, int, const char *); extern struct dentry *vfs_follow_link(struct dentry *, struct dentry *, unsigned, const char *); extern int page_readlink(struct dentry *, char *, int); extern struct dentry *page_follow_link(struct dentry *, struct dentry *, unsigned); +struct inode_operations page_symlink_inode_operations; extern struct super_block *get_super(kdev_t); struct super_block *get_empty_super(void); diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 8b743b450..9e228d0d7 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h @@ -19,6 +19,7 @@ #define WIN98_EXTENDED_PARTITION 0x0f #define LINUX_SWAP_PARTITION 0x82 +#define LINUX_RAID_PARTITION 0xfd /* autodetect RAID partition */ #ifdef CONFIG_SOLARIS_X86_PARTITION #define SOLARIS_X86_PARTITION LINUX_SWAP_PARTITION @@ -45,6 +46,7 @@ struct partition { struct hd_struct { long start_sect; long nr_sects; + int type; /* currently RAID or normal */ }; struct gendisk { diff --git a/include/linux/hfs_fs_i.h b/include/linux/hfs_fs_i.h index 03585a086..4416d7837 100644 --- a/include/linux/hfs_fs_i.h +++ b/include/linux/hfs_fs_i.h @@ -19,6 +19,7 @@ struct hfs_inode_info { int magic; /* A magic number */ + unsigned long mmu_private; struct hfs_cat_entry *entry; /* For a regular or header file */ diff --git a/include/linux/hpfs_fs_i.h b/include/linux/hpfs_fs_i.h index 8263bf2d7..56a758b16 100644 --- a/include/linux/hpfs_fs_i.h +++ b/include/linux/hpfs_fs_i.h @@ -2,6 +2,7 @@ #define _HPFS_FS_I struct hpfs_inode_info { + unsigned long mmu_private; 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/i2c-id.h b/include/linux/i2c-id.h index d0d2ce2f9..55e103dd5 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h @@ -20,7 +20,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* ------------------------------------------------------------------------- */ -/* $Id: i2c-id.h,v 1.6 1999/12/21 23:45:58 frodo Exp $ */ +/* $Id: i2c-id.h,v 1.10 2000/02/04 02:47:41 mds Exp $ */ #ifndef I2C_ID_H #define I2C_ID_H @@ -44,35 +44,36 @@ * never be used in official drivers */ -#define I2C_DRIVERID_MSP3400 1 -#define I2C_DRIVERID_TUNER 2 -#define I2C_DRIVERID_VIDEOTEXT 3 /* please rename */ +#define I2C_DRIVERID_MSP3400 1 +#define I2C_DRIVERID_TUNER 2 +#define I2C_DRIVERID_VIDEOTEX 3 /* please rename */ #define I2C_DRIVERID_TDA8425 4 /* stereo sound processor */ #define I2C_DRIVERID_TEA6420 5 /* audio matrix switch */ #define I2C_DRIVERID_TEA6415C 6 /* video matrix switch */ #define I2C_DRIVERID_TDA9840 7 /* stereo sound processor */ #define I2C_DRIVERID_SAA7111A 8 /* video input processor */ #define I2C_DRIVERID_SAA5281 9 /* videotext decoder */ -#define I2C_DRIVERID_SAA7112 10 /* video decoder, image scaler */ -#define I2C_DRIVERID_SAA7120 11 /* video encoder */ -#define I2C_DRIVERID_SAA7121 12 /* video encoder */ -#define I2C_DRIVERID_SAA7185B 13 /* video encoder */ -#define I2C_DRIVERID_CH7003 14 /* digital pc to tv encoder */ -#define I2C_DRIVERID_PCF8574A 15 /* i2c expander - 8 bit in/out */ -#define I2C_DRIVERID_PCF8582C 16 /* eeprom */ -#define I2C_DRIVERID_AT24Cxx 17 /* eeprom 1/2/4/8/16 K */ +#define I2C_DRIVERID_SAA7112 10 /* video decoder, image scaler */ +#define I2C_DRIVERID_SAA7120 11 /* video encoder */ +#define I2C_DRIVERID_SAA7121 12 /* video encoder */ +#define I2C_DRIVERID_SAA7185B 13 /* video encoder */ +#define I2C_DRIVERID_CH7003 14 /* digital pc to tv encoder */ +#define I2C_DRIVERID_PCF8574A 15 /* i2c expander - 8 bit in/out */ +#define I2C_DRIVERID_PCF8582C 16 /* eeprom */ +#define I2C_DRIVERID_AT24Cxx 17 /* eeprom 1/2/4/8/16 K */ #define I2C_DRIVERID_TEA6300 18 /* audio mixer */ -#define I2C_DRIVERID_BT829 19 /* pc to tv encoder */ +#define I2C_DRIVERID_BT829 19 /* pc to tv encoder */ #define I2C_DRIVERID_TDA9850 20 /* audio mixer */ #define I2C_DRIVERID_TDA9855 21 /* audio mixer */ +#define I2C_DRIVERID_SAA7110 22 /* */ +#define I2C_DRIVERID_MGATVO 23 /* Matrox TVOut */ +#define I2C_DRIVERID_SAA5249 24 /* SAA5249 and compatibles */ #define I2C_DRIVERID_EXP0 0xF0 /* experimental use id's */ #define I2C_DRIVERID_EXP1 0xF1 #define I2C_DRIVERID_EXP2 0xF2 #define I2C_DRIVERID_EXP3 0xF3 -#define I2C_DRIVERID_MGATVO 0x0101 /* Matrox TVOut */ - #define I2C_DRIVERID_I2CDEV 900 #define I2C_DRIVERID_I2CPROC 901 @@ -88,8 +89,8 @@ #define I2C_ALGO_PCF 0x020000 /* PCF 8584 style adapters */ #define I2C_ALGO_ATI 0x030000 /* ATI video card */ #define I2C_ALGO_SMBUS 0x040000 -#define I2C_ALGO_ISA 0x050000 /* lm_sensors ISA pseudo-adapter */ -#define I2C_ALGO_SAA7146 0x060000 /* SAA 7146 video decoder bus */ +#define I2C_ALGO_ISA 0x050000 /* lm_sensors ISA pseudo-adapter */ +#define I2C_ALGO_SAA714 0x060000 /* SAA 7146 video decoder bus */ #define I2C_ALGO_SAA7146A 0x060001 /* SAA 7146A - enhanced version */ @@ -113,9 +114,11 @@ #define I2C_HW_B_VELLE 0x04 /* Vellemann K8000 */ #define I2C_HW_B_BT848 0x05 /* BT848 video boards */ #define I2C_HW_B_WNV 0x06 /* Winnov Videums */ -#define I2C_HW_B_VIA 0x07 /* Via vt82c586b */ -#define I2C_HW_B_HYDRA 0x08 /* Apple Hydra Mac I/O */ +#define I2C_HW_B_VIA 0x07 /* Via vt82c586b */ +#define I2C_HW_B_HYDRA 0x08 /* Apple Hydra Mac I/O */ #define I2C_HW_B_G400 0x09 /* Matrox G400 */ +#define I2C_HW_B_I810 0x0a /* Intel I810 */ +#define I2C_HW_B_RIVA 0x10 /* Riva based graphics cards */ /* --- PCF 8584 based algorithms */ #define I2C_HW_P_LP 0x00 /* Parallel port interface */ @@ -127,11 +130,11 @@ #define I2C_HW_SMBUS_ALI15X3 0x01 #define I2C_HW_SMBUS_VIA2 0x02 #define I2C_HW_SMBUS_VOODOO3 0x03 -#define I2C_HW_SMBUS_I801 0x04 +#define I2C_HW_SMBUS_I801 0x04 #define I2C_HW_SMBUS_AMD756 0x05 #define I2C_HW_SMBUS_SIS5595 0x06 -/* --- ISA pseudo-adapter */ +/* --- ISA pseudo-adapter */ #define I2C_HW_ISA 0x00 #endif /* I2C_ID_H */ diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 9dcc57d49..3aa308bc2 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -3,7 +3,7 @@ /* i2c.h - definitions for the i2c-bus interface */ /* */ /* ------------------------------------------------------------------------- */ -/* Copyright (C) 1995-1999 Simon G. Vogl +/* Copyright (C) 1995-2000 Simon G. Vogl 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 @@ -23,7 +23,7 @@ /* With some changes from Kyösti Mälkki <kmalkki@cc.hut.fi> and Frodo Looijaard <frodol@dds.nl> */ -/* $Id: i2c.h,v 1.32 1999/12/21 23:45:58 frodo Exp $ */ +/* $Id: i2c.h,v 1.36 2000/01/18 23:54:07 frodo Exp $ */ #ifndef I2C_H #define I2C_H @@ -94,6 +94,8 @@ struct i2c_msg { unsigned short flags; #define I2C_M_TEN 0x10 /* we have a ten bit chip address */ #define I2C_M_RD 0x01 +#define I2C_M_NOSTART 0x4000 +#define I2C_M_REV_DIR_ADDR 0x2000 #if 0 #define I2C_M_PROBE 0x20 #endif @@ -171,8 +173,8 @@ struct i2c_driver { * dec_use is the inverse operation. * NB: Make sure you have no circular dependencies, or else you get a * deadlock when trying to unload the modules. - * You should use the i2c_{inc,dec}_use_client functions instead of - * calling this function directly. + * You should use the i2c_{inc,dec}_use_client functions instead of + * calling this function directly. */ void (*inc_use)(struct i2c_client *client); void (*dec_use)(struct i2c_client *client); @@ -190,9 +192,9 @@ struct i2c_client { unsigned int addr; /* chip address - NOTE: 7bit */ /* addresses are stored in the */ /* _LOWER_ 7 bits of this char */ - /* addr: unsigned int to make lm_sensors i2c-isa adapter work - more cleanly. It does not take any more memory space, due to - alignment considerations */ + /* addr: unsigned int to make lm_sensors i2c-isa adapter work + more cleanly. It does not take any more memory space, due to + alignment considerations */ struct i2c_adapter *adapter; /* the adapter we sit on */ struct i2c_driver *driver; /* and our access routines */ void *data; /* for the clients */ @@ -207,17 +209,17 @@ struct i2c_client { */ struct i2c_algorithm { char name[32]; /* textual description */ - unsigned int id; + unsigned int id; /* If a adapter algorithm can't to I2C-level access, set master_xfer - to NULL. If an adapter algorithm can do SMBus access, set - smbus_xfer. If set to NULL, the SMBus protocol is simulated - using common I2C messages */ + to NULL. If an adapter algorithm can do SMBus access, set + smbus_xfer. If set to NULL, the SMBus protocol is simulated + using common I2C messages */ int (*master_xfer)(struct i2c_adapter *adap,struct i2c_msg msgs[], - int num); + int num); int (*smbus_xfer) (struct i2c_adapter *adap, u16 addr, - unsigned short flags, char read_write, - u8 command, int size, union i2c_smbus_data * data); + unsigned short flags, char read_write, + u8 command, int size, union i2c_smbus_data * data); /* --- these optional/future use for some adapter types.*/ int (*slave_send)(struct i2c_adapter *,char*,int); @@ -245,7 +247,7 @@ struct i2c_adapter { struct i2c_algorithm *algo;/* the algorithm to access the bus */ void *algo_data; - /* --- These may be NULL, but should increase the module use count */ + /* --- These may be NULL, but should increase the module use count */ void (*inc_use)(struct i2c_adapter *); void (*dec_use)(struct i2c_adapter *); @@ -279,20 +281,20 @@ struct i2c_adapter { /*flags for the driver struct: */ #define I2C_DF_NOTIFY 0x01 /* notify on bus (de/a)ttaches */ -#define I2C_DF_DUMMY 0x02 /* do not connect any clients */ +#define I2C_DF_DUMMY 0x02 /* do not connect any clients */ /* i2c_client_address_data is the struct for holding default client * addresses for a driver and for the parameters supplied on the * command line */ struct i2c_client_address_data { - unsigned short *normal_i2c; - unsigned short *normal_i2c_range; - unsigned short *probe; - unsigned short *probe_range; - unsigned short *ignore; - unsigned short *ignore_range; - unsigned short *force; + unsigned short *normal_i2c; + unsigned short *normal_i2c_range; + unsigned short *probe; + unsigned short *probe_range; + unsigned short *ignore; + unsigned short *ignore_range; + unsigned short *force; }; /* Internal numbers to terminate lists */ @@ -361,20 +363,21 @@ extern int i2c_check_functionality (struct i2c_adapter *adap, u32 func); /* To determine what functionality is present */ -#define I2C_FUNC_I2C 0x00000001 -#define I2C_FUNC_10BIT_ADDR 0x00000002 -#define I2C_FUNC_SMBUS_QUICK 0x00010000 -#define I2C_FUNC_SMBUS_READ_BYTE 0x00020000 -#define I2C_FUNC_SMBUS_WRITE_BYTE 0x00040000 -#define I2C_FUNC_SMBUS_READ_BYTE_DATA 0x00080000 -#define I2C_FUNC_SMBUS_WRITE_BYTE_DATA 0x00100000 -#define I2C_FUNC_SMBUS_READ_WORD_DATA 0x00200000 -#define I2C_FUNC_SMBUS_WRITE_WORD_DATA 0x00400000 -#define I2C_FUNC_SMBUS_PROC_CALL 0x00800000 -#define I2C_FUNC_SMBUS_READ_BLOCK_DATA 0x01000000 +#define I2C_FUNC_I2C 0x00000001 +#define I2C_FUNC_10BIT_ADDR 0x00000002 +#define I2C_FUNC_PROTOCOL_MANGLING 0x00000004 /* I2C_M_{REV_DIR_ADDR,NOSTART} */ +#define I2C_FUNC_SMBUS_QUICK 0x00010000 +#define I2C_FUNC_SMBUS_READ_BYTE 0x00020000 +#define I2C_FUNC_SMBUS_WRITE_BYTE 0x00040000 +#define I2C_FUNC_SMBUS_READ_BYTE_DATA 0x00080000 +#define I2C_FUNC_SMBUS_WRITE_BYTE_DATA 0x00100000 +#define I2C_FUNC_SMBUS_READ_WORD_DATA 0x00200000 +#define I2C_FUNC_SMBUS_WRITE_WORD_DATA 0x00400000 +#define I2C_FUNC_SMBUS_PROC_CALL 0x00800000 +#define I2C_FUNC_SMBUS_READ_BLOCK_DATA 0x01000000 #define I2C_FUNC_SMBUS_WRITE_BLOCK_DATA 0x02000000 -#define I2C_FUNC_SMBUS_READ_I2C_BLOCK 0x04000000 /* New I2C-like block */ -#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 /* transfers */ +#define I2C_FUNC_SMBUS_READ_I2C_BLOCK 0x04000000 /* New I2C-like block */ +#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 /* transfer */ #define I2C_FUNC_SMBUS_BYTE I2C_FUNC_SMBUS_READ_BYTE | \ I2C_FUNC_SMBUS_WRITE_BYTE @@ -398,23 +401,23 @@ extern int i2c_check_functionality (struct i2c_adapter *adap, u32 func); * Data for SMBus Messages */ union i2c_smbus_data { - __u8 byte; - __u16 word; - __u8 block[33]; /* block[0] is used for length */ + __u8 byte; + __u16 word; + __u8 block[33]; /* block[0] is used for length */ }; /* smbus_access read or write markers */ -#define I2C_SMBUS_READ 1 -#define I2C_SMBUS_WRITE 0 +#define I2C_SMBUS_READ 1 +#define I2C_SMBUS_WRITE 0 /* SMBus transaction types (size parameter in the above functions) Note: these no longer correspond to the (arbitrary) PIIX4 internal codes! */ -#define I2C_SMBUS_QUICK 0 -#define I2C_SMBUS_BYTE 1 -#define I2C_SMBUS_BYTE_DATA 2 -#define I2C_SMBUS_WORD_DATA 3 -#define I2C_SMBUS_PROC_CALL 4 -#define I2C_SMBUS_BLOCK_DATA 5 +#define I2C_SMBUS_QUICK 0 +#define I2C_SMBUS_BYTE 1 +#define I2C_SMBUS_BYTE_DATA 2 +#define I2C_SMBUS_WORD_DATA 3 +#define I2C_SMBUS_PROC_CALL 4 +#define I2C_SMBUS_BLOCK_DATA 5 /* ----- commands for the ioctl like i2c_command call: @@ -423,7 +426,7 @@ union i2c_smbus_data { * corresponding header files. */ /* -> bit-adapter specific ioctls */ -#define I2C_RETRIES 0x0701 /* number times a device adress should */ +#define I2C_RETRIES 0x0701 /* number times a device adress should */ /* be polled when not acknowledging */ #define I2C_TIMEOUT 0x0702 /* set timeout - call with int */ @@ -433,11 +436,11 @@ union i2c_smbus_data { /* Attn.: Slave address is 7 or 10 bits */ #define I2C_SLAVE_FORCE 0x0706 /* Change slave address */ /* Attn.: Slave address is 7 or 10 bits */ - /* This changes the address, even if it */ - /* is already taken! */ -#define I2C_TENBIT 0x0704 /* 0 for 7 bit addrs, != 0 for 10 bit */ + /* This changes the address, even if it */ + /* is already taken! */ +#define I2C_TENBIT 0x0704 /* 0 for 7 bit addrs, != 0 for 10 bit */ -#define I2C_FUNCS 0x0705 /* Get the adapter functionality */ +#define I2C_FUNCS 0x0705 /* Get the adapter functionality */ #if 0 #define I2C_ACK_TEST 0x0710 /* See if a slave is at a specific adress */ #endif @@ -445,7 +448,7 @@ union i2c_smbus_data { #define I2C_SMBUS 0x0720 /* SMBus-level access */ /* ... algo-bit.c recognizes */ -#define I2C_UDELAY 0x0705 /* set delay in microsecs between each */ +#define I2C_UDELAY 0x0705 /* set delay in microsecs between each */ /* written byte (except address) */ #define I2C_MDELAY 0x0706 /* millisec delay between written bytes */ diff --git a/include/linux/input.h b/include/linux/input.h index fefc77b51..3fdfa7e92 100644 --- a/include/linux/input.h +++ b/include/linux/input.h @@ -234,7 +234,7 @@ struct input_event { #define KEY_RECORD 167 #define KEY_REWIND 168 -#define KEY_UNKNOWN 192 +#define KEY_UNKNOWN 180 #define BTN_MISC 0x100 #define BTN_0 0x100 diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 8bc1f9ee6..29a42aef8 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -3,6 +3,7 @@ #define _LINUX_INTERRUPT_H #include <linux/kernel.h> +#include <linux/smp.h> #include <asm/bitops.h> #include <asm/atomic.h> @@ -15,17 +16,9 @@ struct irqaction { struct irqaction *next; }; -extern volatile unsigned char bh_running; - -extern atomic_t bh_mask_count[32]; -extern unsigned long bh_active; -extern unsigned long bh_mask; -extern void (*bh_base[32])(void); - -asmlinkage void do_bottom_half(void); /* Who gets which entry in bh_base. Things which will occur most often - should come first - in which case NET should be up the top with SERIAL/TQUEUE! */ + should come first */ enum { TIMER_BH = 0, @@ -37,10 +30,8 @@ enum { SPECIALIX_BH, AURORA_BH, ESP_BH, - NET_BH, SCSI_BH, IMMEDIATE_BH, - KEYBOARD_BH, CYCLADES_BH, CM206_BH, JS_BH, @@ -51,6 +42,228 @@ enum { #include <asm/hardirq.h> #include <asm/softirq.h> + + +/* PLEASE, avoid to allocate new softirqs, if you need not _really_ high + frequency threaded job scheduling. For almost all the purposes + tasklets are more than enough. F.e. KEYBOARD_BH, CONSOLE_BH, all serial + device BHs et al. are converted to tasklets, not to softirqs. + */ + +enum +{ + HI_SOFTIRQ=0, + NET_TX_SOFTIRQ, + NET_RX_SOFTIRQ, + TASKLET_SOFTIRQ +}; + +#if SMP_CACHE_BYTES <= 32 +/* It is trick to make assembly easier. */ +#define SOFTIRQ_STATE_PAD 32 +#else +#define SOFTIRQ_STATE_PAD SMP_CACHE_BYTES +#endif + +struct softirq_state +{ + __u32 active; + __u32 mask; +} __attribute__ ((__aligned__(SOFTIRQ_STATE_PAD))); + +extern struct softirq_state softirq_state[NR_CPUS]; + +struct softirq_action +{ + void (*action)(struct softirq_action *); + void *data; +}; + +asmlinkage void do_softirq(void); +extern void open_softirq(int nr, void (*action)(struct softirq_action*), void *data); + +extern __inline__ void __cpu_raise_softirq(int cpu, int nr) +{ + softirq_state[cpu].active |= (1<<nr); +} + + +/* I do not want to use atomic variables now, so that cli/sti */ +extern __inline__ void raise_softirq(int nr) +{ + unsigned long flags; + + local_irq_save(flags); + __cpu_raise_softirq(smp_processor_id(), nr); + local_irq_restore(flags); +} + +extern void softirq_init(void); + + + +/* Tasklets --- multithreaded analogue of BHs. + + Main feature differing them of generic softirqs: tasklet + is running only on one CPU simultaneously. + + Main feature differing them of BHs: different tasklets + may be run simultaneously on different CPUs. + + Properties: + * If tasklet_schedule() is called, then tasklet is guaranteed + to be executed on some cpu at least once after this. + * If the tasklet is already scheduled, but its excecution is still not + started, it will be executed only once. + * If this tasklet is already running on another CPU (or schedule is called + from tasklet itself), it is rescheduled for later. + * Tasklet is strictly serialized wrt itself, but not + wrt another tasklets. If client needs some intertask synchronization, + he makes it with spinlocks. + */ + +struct tasklet_struct +{ + struct tasklet_struct *next; + unsigned long state; + atomic_t count; + void (*func)(unsigned long); + unsigned long data; +}; + +#define DECLARE_TASKLET(name, func, data) \ +struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(0), func, data } + +#define DECLARE_TASKLET_DISABLED(name, func, data) \ +struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(1), func, data } + + +enum +{ + TASKLET_STATE_SCHED, /* Tasklet is scheduled for execution */ + TASKLET_STATE_RUN /* Tasklet is running (SMP only) */ +}; + +struct tasklet_head +{ + struct tasklet_struct *list; +} __attribute__ ((__aligned__(SMP_CACHE_BYTES))); + +extern struct tasklet_head tasklet_vec[NR_CPUS]; +extern struct tasklet_head tasklet_hi_vec[NR_CPUS]; + +#ifdef __SMP__ +#define tasklet_trylock(t) (!test_and_set_bit(TASKLET_STATE_RUN, &(t)->state)) +#define tasklet_unlock_wait(t) while (test_bit(TASKLET_STATE_RUN, &(t)->state)) { /* NOTHING */ } +#define tasklet_unlock(t) clear_bit(TASKLET_STATE_RUN, &(t)->state) +#else +#define tasklet_trylock(t) 1 +#define tasklet_unlock_wait(t) do { } while (0) +#define tasklet_unlock(t) do { } while (0) +#endif + +extern __inline__ void tasklet_schedule(struct tasklet_struct *t) +{ + if (!test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) { + int cpu = smp_processor_id(); + unsigned long flags; + + local_irq_save(flags); + t->next = tasklet_vec[cpu].list; + tasklet_vec[cpu].list = t; + __cpu_raise_softirq(cpu, TASKLET_SOFTIRQ); + local_irq_restore(flags); + } +} + +extern __inline__ void tasklet_hi_schedule(struct tasklet_struct *t) +{ + if (!test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) { + int cpu = smp_processor_id(); + unsigned long flags; + + local_irq_save(flags); + t->next = tasklet_hi_vec[cpu].list; + tasklet_hi_vec[cpu].list = t; + __cpu_raise_softirq(cpu, HI_SOFTIRQ); + local_irq_restore(flags); + } +} + + +extern __inline__ void tasklet_disable_nosync(struct tasklet_struct *t) +{ + atomic_inc(&t->count); +} + +extern __inline__ void tasklet_disable(struct tasklet_struct *t) +{ + tasklet_disable_nosync(t); + tasklet_unlock_wait(t); +} + +extern __inline__ void tasklet_enable(struct tasklet_struct *t) +{ + atomic_dec(&t->count); +} + +extern void tasklet_kill(struct tasklet_struct *t); +extern void tasklet_init(struct tasklet_struct *t, + void (*func)(unsigned long), unsigned long data); + +#ifdef __SMP__ + +#define SMP_TIMER_NAME(name) name##__thr + +#define SMP_TIMER_DEFINE(name, task) \ +DECLARE_TASKLET(task, name##__thr, 0); \ +static void name (unsigned long dummy) \ +{ \ + tasklet_schedule(&(task)); \ +} + +#else /* __SMP__ */ + +#define SMP_TIMER_NAME(name) name +#define SMP_TIMER_DEFINE(name, task) + +#endif /* __SMP__ */ + + +/* Old BH definitions */ + +extern struct tasklet_struct bh_task_vec[]; + +/* It is exported _ONLY_ for wait_on_irq(). */ +extern spinlock_t global_bh_lock; + +extern __inline__ void mark_bh(int nr) +{ + tasklet_hi_schedule(bh_task_vec+nr); +} + +extern __inline__ void disable_bh_nosync(int nr) +{ + tasklet_disable_nosync(bh_task_vec+nr); +} + +extern __inline__ void disable_bh(int nr) +{ + tasklet_disable_nosync(bh_task_vec+nr); + if (!in_interrupt()) + tasklet_unlock_wait(bh_task_vec+nr); +} + +extern __inline__ void enable_bh(int nr) +{ + tasklet_enable(bh_task_vec+nr); +} + + +extern void init_bh(int nr, void (*routine)(void)); +extern void remove_bh(int nr); + + /* * Autoprobing for irqs: * diff --git a/include/linux/iso_fs.h b/include/linux/iso_fs.h index 80a8b27f4..59da5b123 100644 --- a/include/linux/iso_fs.h +++ b/include/linux/iso_fs.h @@ -178,7 +178,6 @@ extern int iso_date(char *, int); extern int parse_rock_ridge_inode(struct iso_directory_record *, struct inode *); extern int get_rock_ridge_filename(struct iso_directory_record *, char *, struct inode *); -extern int rock_ridge_symlink_readpage(struct dentry *, struct page *); extern int find_rock_ridge_relocation(struct iso_directory_record *, struct inode *); int get_joliet_filename(struct iso_directory_record *, struct inode *, unsigned char *); @@ -192,10 +191,7 @@ extern int isofs_lookup_grandparent(struct inode *, int); extern struct inode_operations isofs_file_inode_operations; extern struct inode_operations isofs_dir_inode_operations; -extern struct inode_operations isofs_symlink_inode_operations; -extern struct inode_operations isofs_chrdev_inode_operations; -extern struct inode_operations isofs_blkdev_inode_operations; -extern struct inode_operations isofs_fifo_inode_operations; +extern struct address_space_operations isofs_symlink_aops; /* The following macros are used to check for memory leaks. */ #ifdef LEAK_CHECK diff --git a/include/linux/kbd_kern.h b/include/linux/kbd_kern.h index 9b215fb14..56dd41fac 100644 --- a/include/linux/kbd_kern.h +++ b/include/linux/kbd_kern.h @@ -4,6 +4,8 @@ #include <linux/interrupt.h> #include <linux/keyboard.h> +extern struct tasklet_struct keyboard_tasklet; + extern int shift_state; extern char *func_table[MAX_NR_FUNC]; @@ -85,7 +87,7 @@ extern inline void set_console(int nr) extern inline void set_leds(void) { - mark_bh(KEYBOARD_BH); + tasklet_schedule(&keyboard_tasklet); } extern inline int vc_kbd_mode(struct kbd_struct * kbd, int flag) diff --git a/include/linux/linkage.h b/include/linux/linkage.h index b7657dd8a..c5c834d97 100644 --- a/include/linux/linkage.h +++ b/include/linux/linkage.h @@ -9,6 +9,8 @@ #if defined __i386__ && (__GNUC__ > 2 || __GNUC_MINOR__ > 7) #define asmlinkage CPP_ASMLINKAGE __attribute__((regparm(0))) +#elif defined __ia64__ +#define asmlinkage CPP_ASMLINKAGE __attribute__((syscall_linkage)) #else #define asmlinkage CPP_ASMLINKAGE #endif diff --git a/include/linux/lp.h b/include/linux/lp.h index a02c3fff1..4bc121a30 100644 --- a/include/linux/lp.h +++ b/include/linux/lp.h @@ -89,6 +89,7 @@ #define LPGETSTATS 0x060d /* get statistics (struct lp_stats) */ #endif #define LPGETFLAGS 0x060e /* get status flags */ +#define LPSETTIMEOUT 0x060f /* set parport timeout */ /* timeout for printk'ing a timeout, in jiffies (100ths of a second). This is also used for re-checking error conditions if LP_ABORT is @@ -145,6 +146,7 @@ struct lp_struct { unsigned int last_error; struct semaphore port_mutex; wait_queue_head_t dataq; + long timeout; }; /* diff --git a/include/linux/mc146818rtc.h b/include/linux/mc146818rtc.h index f0f86bca1..cab50dd9e 100644 --- a/include/linux/mc146818rtc.h +++ b/include/linux/mc146818rtc.h @@ -1,6 +1,4 @@ -/* $Id$ - * - * mc146818rtc.h - register definitions for the Real-Time-Clock / CMOS RAM +/* mc146818rtc.h - register definitions for the Real-Time-Clock / CMOS RAM * Copyright Torsten Duwe <duwe@informatik.uni-erlangen.de> 1993 * derived from Data Sheet, Copyright Motorola 1984 (!). * It was written to be part of the Linux operating system. @@ -9,10 +7,13 @@ * in terms of the GNU Library General Public License, Version 2 or later, * at your option. */ -#ifndef _LINUX_MC146818RTC_H -#define _LINUX_MC146818RTC_H -#include <asm/mc146818rtc.h> +#ifndef _MC146818RTC_H +#define _MC146818RTC_H + +#include <asm/io.h> +#include <linux/rtc.h> /* get the user-level API */ +#include <asm/mc146818rtc.h> /* register access macros */ /********************************************************************** * register summary @@ -94,4 +95,4 @@ #define BIN_TO_BCD(val) ((val)=(((val)/10)<<4) + (val)%10) #endif -#endif /* _LINUX_MC146818RTC_H */ +#endif /* _MC146818RTC_H */ diff --git a/include/linux/md.h b/include/linux/md.h deleted file mode 100644 index 654b67717..000000000 --- a/include/linux/md.h +++ /dev/null @@ -1,300 +0,0 @@ -/* - md.h : Multiple Devices driver for Linux - Copyright (C) 1994-96 Marc ZYNGIER - <zyngier@ufr-info-p7.ibp.fr> or - <maz@gloups.fdn.fr> - - 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, or (at your option) - any later version. - - You should have received a copy of the GNU General Public License - (for example /usr/src/linux/COPYING); if not, write to the Free - Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -#ifndef _MD_H -#define _MD_H - -#include <linux/major.h> -#include <linux/ioctl.h> -#include <linux/types.h> - -/* - * Different major versions are not compatible. - * Different minor versions are only downward compatible. - * Different patchlevel versions are downward and upward compatible. - */ -#define MD_MAJOR_VERSION 0 -#define MD_MINOR_VERSION 36 -#define MD_PATCHLEVEL_VERSION 6 - -#define MD_DEFAULT_DISK_READAHEAD (256 * 1024) - -/* ioctls */ -#define REGISTER_DEV _IO (MD_MAJOR, 1) -#define START_MD _IO (MD_MAJOR, 2) -#define STOP_MD _IO (MD_MAJOR, 3) -#define REGISTER_DEV_NEW _IO (MD_MAJOR, 4) - -/* - personalities : - Byte 0 : Chunk size factor - Byte 1 : Fault tolerance count for each physical device - ( 0 means no fault tolerance, - 0xFF means always tolerate faults), not used by now. - Byte 2 : Personality - Byte 3 : Reserved. - */ - -#define FAULT_SHIFT 8 -#define PERSONALITY_SHIFT 16 - -#define FACTOR_MASK 0x000000FFUL -#define FAULT_MASK 0x0000FF00UL -#define PERSONALITY_MASK 0x00FF0000UL - -#define MD_RESERVED 0 /* Not used by now */ -#define LINEAR (1UL << PERSONALITY_SHIFT) -#define STRIPED (2UL << PERSONALITY_SHIFT) -#define RAID0 STRIPED -#define RAID1 (3UL << PERSONALITY_SHIFT) -#define RAID5 (4UL << PERSONALITY_SHIFT) -#define MAX_PERSONALITY 5 - -/* - * MD superblock. - * - * The MD superblock maintains some statistics on each MD configuration. - * Each real device in the MD set contains it near the end of the device. - * Some of the ideas are copied from the ext2fs implementation. - * - * We currently use 4096 bytes as follows: - * - * word offset function - * - * 0 - 31 Constant generic MD device information. - * 32 - 63 Generic state information. - * 64 - 127 Personality specific information. - * 128 - 511 12 32-words descriptors of the disks in the raid set. - * 512 - 911 Reserved. - * 912 - 1023 Disk specific descriptor. - */ - -/* - * If x is the real device size in bytes, we return an apparent size of: - * - * y = (x & ~(MD_RESERVED_BYTES - 1)) - MD_RESERVED_BYTES - * - * and place the 4kB superblock at offset y. - */ -#define MD_RESERVED_BYTES (64 * 1024) -#define MD_RESERVED_SECTORS (MD_RESERVED_BYTES / 512) -#define MD_RESERVED_BLOCKS (MD_RESERVED_BYTES / BLOCK_SIZE) - -#define MD_NEW_SIZE_SECTORS(x) ((x & ~(MD_RESERVED_SECTORS - 1)) - MD_RESERVED_SECTORS) -#define MD_NEW_SIZE_BLOCKS(x) ((x & ~(MD_RESERVED_BLOCKS - 1)) - MD_RESERVED_BLOCKS) - -#define MD_SB_BYTES 4096 -#define MD_SB_WORDS (MD_SB_BYTES / 4) -#define MD_SB_BLOCKS (MD_SB_BYTES / BLOCK_SIZE) -#define MD_SB_SECTORS (MD_SB_BYTES / 512) - -/* - * The following are counted in 32-bit words - */ -#define MD_SB_GENERIC_OFFSET 0 -#define MD_SB_PERSONALITY_OFFSET 64 -#define MD_SB_DISKS_OFFSET 128 -#define MD_SB_DESCRIPTOR_OFFSET 992 - -#define MD_SB_GENERIC_CONSTANT_WORDS 32 -#define MD_SB_GENERIC_STATE_WORDS 32 -#define MD_SB_GENERIC_WORDS (MD_SB_GENERIC_CONSTANT_WORDS + MD_SB_GENERIC_STATE_WORDS) -#define MD_SB_PERSONALITY_WORDS 64 -#define MD_SB_DISKS_WORDS 384 -#define MD_SB_DESCRIPTOR_WORDS 32 -#define MD_SB_RESERVED_WORDS (1024 - MD_SB_GENERIC_WORDS - MD_SB_PERSONALITY_WORDS - MD_SB_DISKS_WORDS - MD_SB_DESCRIPTOR_WORDS) -#define MD_SB_EQUAL_WORDS (MD_SB_GENERIC_WORDS + MD_SB_PERSONALITY_WORDS + MD_SB_DISKS_WORDS) -#define MD_SB_DISKS (MD_SB_DISKS_WORDS / MD_SB_DESCRIPTOR_WORDS) - -/* - * Device "operational" state bits - */ -#define MD_FAULTY_DEVICE 0 /* Device is faulty / operational */ -#define MD_ACTIVE_DEVICE 1 /* Device is a part or the raid set / spare disk */ -#define MD_SYNC_DEVICE 2 /* Device is in sync with the raid set */ - -typedef struct md_device_descriptor_s { - __u32 number; /* 0 Device number in the entire set */ - __u32 major; /* 1 Device major number */ - __u32 minor; /* 2 Device minor number */ - __u32 raid_disk; /* 3 The role of the device in the raid set */ - __u32 state; /* 4 Operational state */ - __u32 reserved[MD_SB_DESCRIPTOR_WORDS - 5]; -} md_descriptor_t; - -#define MD_SB_MAGIC 0xa92b4efc - -/* - * Superblock state bits - */ -#define MD_SB_CLEAN 0 -#define MD_SB_ERRORS 1 - -typedef struct md_superblock_s { - - /* - * Constant generic information - */ - __u32 md_magic; /* 0 MD identifier */ - __u32 major_version; /* 1 major version to which the set conforms */ - __u32 minor_version; /* 2 minor version to which the set conforms */ - __u32 patch_version; /* 3 patchlevel version to which the set conforms */ - __u32 gvalid_words; /* 4 Number of non-reserved words in this section */ - __u32 set_magic; /* 5 Raid set identifier */ - __u32 ctime; /* 6 Creation time */ - __u32 level; /* 7 Raid personality (mirroring, raid5, ...) */ - __u32 size; /* 8 Apparent size of each individual disk, in kB */ - __u32 nr_disks; /* 9 Number of total disks in the raid set */ - __u32 raid_disks; /* 10 Number of disks in a fully functional raid set */ - __u32 gstate_creserved[MD_SB_GENERIC_CONSTANT_WORDS - 11]; - - /* - * Generic state information - */ - __u32 utime; /* 0 Superblock update time */ - __u32 state; /* 1 State bits (clean, ...) */ - __u32 active_disks; /* 2 Number of currently active disks (some non-faulty disks might not be in sync) */ - __u32 working_disks; /* 3 Number of working disks */ - __u32 failed_disks; /* 4 Number of failed disks */ - __u32 spare_disks; /* 5 Number of spare disks */ - __u32 gstate_sreserved[MD_SB_GENERIC_STATE_WORDS - 6]; - - /* - * Personality information - */ - __u32 parity_algorithm; - __u32 chunk_size; - __u32 pstate_reserved[MD_SB_PERSONALITY_WORDS - 2]; - - /* - * Disks information - */ - md_descriptor_t disks[MD_SB_DISKS]; - - /* - * Reserved - */ - __u32 reserved[MD_SB_RESERVED_WORDS]; - - /* - * Active descriptor - */ - md_descriptor_t descriptor; -} md_superblock_t; - -#ifdef __KERNEL__ - -#include <linux/mm.h> -#include <linux/fs.h> -#include <linux/blkdev.h> -#include <asm/semaphore.h> - -/* - * Kernel-based reconstruction is mostly working, but still requires - * some additional work. - */ -#define SUPPORT_RECONSTRUCTION 0 - -#define MAX_REAL 8 /* Max number of physical dev per md dev */ -#define MAX_MD_DEV 4 /* Max number of md dev */ - -#define FACTOR(a) ((a)->repartition & FACTOR_MASK) -#define MAX_FAULT(a) (((a)->repartition & FAULT_MASK)>>8) -#define PERSONALITY(a) ((a)->repartition & PERSONALITY_MASK) - -#define FACTOR_SHIFT(a) (PAGE_SHIFT + (a) - 10) - -struct real_dev -{ - kdev_t dev; /* Device number */ - int size; /* Device size (in blocks) */ - int offset; /* Real device offset (in blocks) in md dev - (only used in linear mode) */ - struct inode *inode; /* Lock inode */ - md_superblock_t *sb; - u32 sb_offset; -}; - -struct md_dev; - -#define SPARE_INACTIVE 0 -#define SPARE_WRITE 1 -#define SPARE_ACTIVE 2 - -struct md_personality -{ - char *name; - int (*map)(struct md_dev *mddev, kdev_t *rdev, - unsigned long *rsector, unsigned long size); - int (*make_request)(struct md_dev *mddev, int rw, struct buffer_head * bh); - void (*end_request)(struct buffer_head * bh, int uptodate); - int (*run)(int minor, struct md_dev *mddev); - int (*stop)(int minor, struct md_dev *mddev); - int (*status)(char *page, int minor, struct md_dev *mddev); - int (*ioctl)(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg); - int max_invalid_dev; - int (*error_handler)(struct md_dev *mddev, kdev_t dev); - -/* - * Some personalities (RAID-1, RAID-5) can get disks hot-added and - * hot-removed. Hot removal is different from failure. (failure marks - * a disk inactive, but the disk is still part of the array) - */ - int (*hot_add_disk) (struct md_dev *mddev, kdev_t dev); - int (*hot_remove_disk) (struct md_dev *mddev, kdev_t dev); - int (*mark_spare) (struct md_dev *mddev, md_descriptor_t *descriptor, int state); -}; - -struct md_dev -{ - struct real_dev devices[MAX_REAL]; - struct md_personality *pers; - md_superblock_t *sb; - int sb_dirty; - int repartition; - int busy; - int nb_dev; - void *private; -}; - -struct md_thread { - void (*run) (void *data); - void *data; - wait_queue_head_t wqueue; - unsigned long flags; - struct semaphore *sem; - struct task_struct *tsk; -}; - -#define THREAD_WAKEUP 0 - -extern struct md_dev md_dev[MAX_MD_DEV]; -extern int md_size[MAX_MD_DEV]; -extern int md_maxreadahead[MAX_MD_DEV]; - -extern char *partition_name (kdev_t dev); - -extern int register_md_personality (int p_num, struct md_personality *p); -extern int unregister_md_personality (int p_num); -extern struct md_thread *md_register_thread (void (*run) (void *data), void *data); -extern void md_unregister_thread (struct md_thread *thread); -extern void md_wakeup_thread(struct md_thread *thread); -extern int md_update_sb (int minor); -extern int md_do_sync(struct md_dev *mddev); - -#endif __KERNEL__ -#endif _MD_H diff --git a/include/linux/minix_fs.h b/include/linux/minix_fs.h index dcfbca271..c1d661460 100644 --- a/include/linux/minix_fs.h +++ b/include/linux/minix_fs.h @@ -107,10 +107,7 @@ extern int minix_new_block(struct inode * inode); extern void minix_free_block(struct inode * inode, int block); 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_get_block(struct inode *, long, struct buffer_head *, int); extern struct buffer_head * minix_bread(struct inode *, int, int); extern void minix_truncate(struct inode *); @@ -118,9 +115,9 @@ extern int init_minix_fs(void); extern int minix_sync_inode(struct inode *); extern int minix_sync_file(struct file *, struct dentry *); +extern struct address_space_operations minix_aops; extern struct inode_operations minix_file_inode_operations; extern struct inode_operations minix_dir_inode_operations; -extern struct inode_operations minix_symlink_inode_operations; extern struct dentry_operations minix_dentry_operations; #endif /* __KERNEL__ */ diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h index edf0f0768..9e2a1e4ff 100644 --- a/include/linux/miscdevice.h +++ b/include/linux/miscdevice.h @@ -14,6 +14,7 @@ #define WATCHDOG_MINOR 130 /* Watchdog timer */ #define TEMP_MINOR 131 /* Temperature Sensor */ #define RTC_MINOR 135 +#define EFI_RTC_MINOR 136 /* EFI Time services */ #define SUN_OPENPROM_MINOR 139 #define NVRAM_MINOR 144 #define I2O_MINOR 166 diff --git a/include/linux/mm.h b/include/linux/mm.h index 0d7609741..1b4cee348 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -394,7 +394,7 @@ extern int pgt_cache_water[2]; extern int check_pgt_cache(void); extern void paging_init(void); -extern void free_area_init(unsigned int * zones_size); +extern void free_area_init(unsigned long * zones_size); extern void free_area_init_node(int nid, pg_data_t *pgdat, unsigned int * zones_size, unsigned long zone_start_paddr); extern void mem_init(void); @@ -463,7 +463,7 @@ extern struct page *filemap_nopage(struct vm_area_struct * area, #define __GFP_DMA 0x20 #define __GFP_UNCACHED 0x40 -#define GFP_BUFFER (__GFP_WAIT) +#define GFP_BUFFER (__GFP_HIGH | __GFP_WAIT) #define GFP_ATOMIC (__GFP_HIGH) #define GFP_USER (__GFP_WAIT | __GFP_IO) #define GFP_HIGHUSER (GFP_USER | __GFP_HIGHMEM) @@ -510,6 +510,8 @@ static inline int expand_stack(struct vm_area_struct * vma, unsigned long addres /* Look up the first VMA which satisfies addr < vm_end, NULL if none. */ extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long addr); +extern struct vm_area_struct * find_vma_prev(struct mm_struct * mm, unsigned long addr, + struct vm_area_struct **pprev); /* Look up the first VMA which intersects the interval start_addr..end_addr-1, NULL if none. Assume start_addr < end_addr. */ diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index e3d688acf..d2b1d5a6a 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -29,7 +29,7 @@ typedef struct zone_struct { unsigned long offset; unsigned long free_pages; int low_on_memory; - unsigned long pages_low, pages_high; + unsigned long pages_min, pages_low, pages_high; struct pglist_data *zone_pgdat; /* diff --git a/include/linux/msdos_fs.h b/include/linux/msdos_fs.h index 3a7f28622..54c1cbd55 100644 --- a/include/linux/msdos_fs.h +++ b/include/linux/msdos_fs.h @@ -271,11 +271,6 @@ extern ssize_t fat_file_read(struct file *, char *, size_t, loff_t *); extern ssize_t fat_file_write(struct file *, const char *, size_t, loff_t *); extern void fat_truncate(struct inode *inode); -/* mmap.c */ -extern int fat_mmap(struct file *, struct vm_area_struct *); -extern int fat_readpage(struct file *, struct page *); - - /* vfat.c */ extern int init_vfat_fs(void); diff --git a/include/linux/msdos_fs_i.h b/include/linux/msdos_fs_i.h index bcb37bb80..8d66550d2 100644 --- a/include/linux/msdos_fs_i.h +++ b/include/linux/msdos_fs_i.h @@ -6,6 +6,7 @@ */ struct msdos_inode_info { + unsigned long mmu_private; int i_start; /* first cluster or 0 */ int i_logstart; /* logical first cluster */ int i_attrs; /* unused attribute bits */ @@ -13,7 +14,6 @@ struct msdos_inode_info { int i_location; /* on-disk position of directory entry or 0 */ struct inode *i_fat_inode; /* struct inode of this one */ struct list_head i_fat_hash; /* hash by i_location */ - int i_realsize; }; #endif diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 323458ca4..3905728e4 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -29,6 +29,8 @@ #include <linux/if_packet.h> #include <asm/atomic.h> +#include <asm/cache.h> +#include <asm/byteorder.h> #ifdef __KERNEL__ #include <linux/config.h> @@ -107,15 +109,6 @@ struct net_device_stats unsigned long tx_compressed; }; -#ifdef CONFIG_NET_FASTROUTE -struct net_fastroute_stats -{ - int hits; - int succeed; - int deferred; - int latency_reduction; -}; -#endif /* Media selection options. */ enum { @@ -138,6 +131,23 @@ struct neighbour; struct neigh_parms; struct sk_buff; +struct netif_rx_stats +{ + unsigned total; + unsigned dropped; + unsigned time_squeeze; + unsigned throttled; + unsigned fastroute_hit; + unsigned fastroute_success; + unsigned fastroute_defer; + unsigned fastroute_deferred_out; + unsigned fastroute_latency_reduction; + unsigned cpu_collision; +} __attribute__ ((__aligned__(SMP_CACHE_BYTES))); + +extern struct netif_rx_stats netdev_rx_stat[]; + + /* * We tag multicasts with these structures. */ @@ -163,6 +173,16 @@ struct hh_cache unsigned long hh_data[16/sizeof(unsigned long)]; }; +enum netdev_state_t +{ + LINK_STATE_XOFF=0, + LINK_STATE_DOWN, + LINK_STATE_START, + LINK_STATE_RXSEM, + LINK_STATE_TXSEM, + LINK_STATE_SCHED +}; + /* * The DEVICE structure. @@ -194,34 +214,30 @@ struct net_device unsigned long mem_start; /* shared mem start */ unsigned long base_addr; /* device I/O address */ unsigned int irq; /* device IRQ number */ - - /* Low-level status flags. */ - volatile unsigned char start; /* start an operation */ + /* - * These two are just single-bit flags, but due to atomicity - * reasons they have to be inside a "unsigned long". However, - * they should be inside the SAME unsigned long instead of - * this wasteful use of memory.. + * Some hardware also needs these fields, but they are not + * part of the usual set specified in Space.c. */ - unsigned long interrupt; /* bitops.. */ - unsigned long tbusy; /* transmitter busy */ - - struct net_device *next; + + unsigned char if_port; /* Selectable AUI, TP,..*/ + unsigned char dma; /* DMA channel */ + + unsigned long state; + + struct net_device *next; /* The device initialization function. Called only once. */ int (*init)(struct net_device *dev); + /* ------- Fields preinitialized in Space.c finish here ------- */ + + struct net_device *next_sched; + /* Interface index. Unique device identifier */ int ifindex; int iflink; - /* - * Some hardware also needs these fields, but they are not - * part of the usual set specified in Space.c. - */ - - unsigned char if_port; /* Selectable AUI, TP,..*/ - unsigned char dma; /* DMA channel */ struct net_device_stats* (*get_stats)(struct net_device *dev); struct iw_statistics* (*get_wireless_stats)(struct net_device *dev); @@ -235,14 +251,18 @@ struct net_device /* These may be needed for future network-power-down code. */ unsigned long trans_start; /* Time (in jiffies) of last Tx */ unsigned long last_rx; /* Time of last Rx */ - + unsigned short flags; /* interface flags (a la BSD) */ unsigned short gflags; unsigned mtu; /* interface MTU value */ unsigned short type; /* interface hardware type */ unsigned short hard_header_len; /* hardware hdr length */ void *priv; /* pointer to private data */ - + + struct net_device *master; /* Pointer to master device of a group, + * which this device is member of. + */ + /* Interface address info. */ unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */ unsigned char pad; /* make dev_addr aligned to 8 bytes */ @@ -253,11 +273,9 @@ struct net_device int mc_count; /* Number of installed mcasts */ int promiscuity; int allmulti; - - /* For load balancing driver pair support */ - - unsigned long pkt_queue; /* Packets queued */ - struct net_device *slave; /* Slave device */ + + int watchdog_timeo; + struct timer_list watchdog_timer; /* Protocol specific pointers */ @@ -329,13 +347,15 @@ struct net_device #define HAVE_CHANGE_MTU int (*change_mtu)(struct net_device *dev, int new_mtu); +#define HAVE_TX_TIMOUT + void (*tx_timeout) (struct net_device *dev); + int (*hard_header_parse)(struct sk_buff *skb, unsigned char *haddr); int (*neigh_setup)(struct net_device *dev, struct neigh_parms *); int (*accept_fastpath)(struct net_device *, struct dst_entry*); #ifdef CONFIG_NET_FASTROUTE - unsigned long tx_semaphore; #define NETDEV_FASTROUTE_HMASK 0xF /* Semi-private data. Keep it at the end of device struct. */ rwlock_t fastpath_lock; @@ -361,8 +381,6 @@ struct packet_type extern struct net_device loopback_dev; /* The loopback */ extern struct net_device *dev_base; /* All devices */ extern rwlock_t dev_base_lock; /* Device list lock */ -extern int netdev_dropping; -extern int net_cpu_congestion; extern struct net_device *dev_getbyhwaddr(unsigned short type, char *hwaddr); extern void dev_add_pack(struct packet_type *pt); @@ -392,9 +410,77 @@ extern __inline__ int unregister_gifconf(unsigned int family) return register_gifconf(family, 0); } +/* + * Incoming packets are placed on per-cpu queues so that + * no locking is needed. + */ + +struct softnet_data +{ + int throttle; + struct sk_buff_head input_pkt_queue; + struct net_device *output_queue; + struct sk_buff *completion_queue; +} __attribute__((__aligned__(SMP_CACHE_BYTES))); + + +extern struct softnet_data softnet_data[NR_CPUS]; + +#define HAS_NETIF_QUEUE + +extern __inline__ void __netif_schedule(struct net_device *dev) +{ + if (!test_and_set_bit(LINK_STATE_SCHED, &dev->state)) { + unsigned long flags; + int cpu = smp_processor_id(); + + local_irq_save(flags); + dev->next_sched = softnet_data[cpu].output_queue; + softnet_data[cpu].output_queue = dev; + __cpu_raise_softirq(cpu, NET_TX_SOFTIRQ); + local_irq_restore(flags); + } +} + +extern __inline__ void netif_schedule(struct net_device *dev) +{ + if (!test_bit(LINK_STATE_XOFF, &dev->state)) + __netif_schedule(dev); +} + +extern __inline__ void netif_start_queue(struct net_device *dev) +{ + clear_bit(LINK_STATE_XOFF, &dev->state); +} + +extern __inline__ void netif_wake_queue(struct net_device *dev) +{ + if (test_and_clear_bit(LINK_STATE_XOFF, &dev->state)) + __netif_schedule(dev); +} + +extern __inline__ void netif_stop_queue(struct net_device *dev) +{ + set_bit(LINK_STATE_XOFF, &dev->state); +} + +extern __inline__ void dev_kfree_skb_irq(struct sk_buff *skb) +{ + if (atomic_dec_and_test(&skb->users)) { + int cpu =smp_processor_id(); + unsigned long flags; + + local_irq_save(flags); + skb->next = softnet_data[cpu].completion_queue; + softnet_data[cpu].completion_queue = skb; + __cpu_raise_softirq(cpu, NET_TX_SOFTIRQ); + local_irq_restore(flags); + } +} + + #define HAVE_NETIF_RX 1 extern void netif_rx(struct sk_buff *skb); -extern void net_bh(void); extern int dev_ioctl(unsigned int cmd, void *); extern int dev_change_flags(struct net_device *, unsigned); extern void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev); @@ -448,15 +534,13 @@ extern void dev_load(const char *name); extern void dev_mcast_init(void); extern int netdev_register_fc(struct net_device *dev, void (*stimul)(struct net_device *dev)); extern void netdev_unregister_fc(int bit); -extern int netdev_dropping; extern int netdev_max_backlog; -extern atomic_t netdev_rx_dropped; extern unsigned long netdev_fc_xoff; +extern int netdev_set_master(struct net_device *dev, struct net_device *master); #ifdef CONFIG_NET_FASTROUTE extern int netdev_fastroute; extern int netdev_fastroute_obstacles; extern void dev_clear_fastroute(struct net_device *dev); -extern struct net_fastroute_stats dev_fastroute_stat; #endif diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index f2a114a58..26fb2de7f 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h @@ -190,6 +190,7 @@ extern int __nfs_revalidate_inode(struct nfs_server *, struct dentry *); * linux/fs/nfs/file.c */ extern struct inode_operations nfs_file_inode_operations; +extern struct address_space_operations nfs_file_aops; /* * linux/fs/nfs/dir.c diff --git a/include/linux/ntfs_fs_i.h b/include/linux/ntfs_fs_i.h index 0bc8d7806..3ac18ea47 100644 --- a/include/linux/ntfs_fs_i.h +++ b/include/linux/ntfs_fs_i.h @@ -62,6 +62,7 @@ typedef unsigned int ntfs_cluster_t; /* Definition of NTFS in-memory inode structure */ struct ntfs_inode_info{ + unsigned long mmu_private; struct ntfs_sb_info *vol; int i_number; /* should be really 48 bits */ unsigned sequence_number; diff --git a/include/linux/openpic.h b/include/linux/openpic.h index ce7ffdf89..b4a9ecab1 100644 --- a/include/linux/openpic.h +++ b/include/linux/openpic.h @@ -263,8 +263,12 @@ extern u_char *OpenPIC_InitSenses; * Interrupt Source Registers */ -#define OPENPIC_SENSE_POLARITY 0x00800000 /* Undoc'd */ +#define OPENPIC_POLARITY_POSITIVE 0x00800000 +#define OPENPIC_POLARITY_NEGATIVE 0x00000000 +#define OPENPIC_POLARITY_MASK 0x00800000 #define OPENPIC_SENSE_LEVEL 0x00400000 +#define OPENPIC_SENSE_EDGE 0x00000000 +#define OPENPIC_SENSE_MASK 0x00400000 /* diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 53bc365d2..813dd78ea 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -83,7 +83,7 @@ extern void add_to_page_cache(struct page * page, struct address_space *mapping, extern inline void add_page_to_hash_queue(struct page * page, struct inode * inode, unsigned long index) { - __add_page_to_hash_queue(page, page_hash(&inode->i_data,index)); + __add_page_to_hash_queue(page, page_hash(inode->i_mapping,index)); } extern inline void add_page_to_inode_queue(struct address_space *mapping, struct page * page) diff --git a/include/linux/pci.h b/include/linux/pci.h index 6472c3b59..8fae97e9b 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -149,7 +149,8 @@ #define PCI_BRIDGE_CTL_FAST_BACK 0x80 /* Fast Back2Back enabled on secondary interface */ /* Header type 2 (CardBus bridges) */ -/* 0x14-0x15 reserved */ +#define PCI_CB_CAPABILITY_LIST 0x14 +/* 0x15 reserved */ #define PCI_CB_SEC_STATUS 0x16 /* Secondary status */ #define PCI_CB_PRIMARY_BUS 0x18 /* PCI bus number */ #define PCI_CB_CARD_BUS 0x19 /* CardBus bus number */ @@ -571,6 +572,19 @@ extern inline int pci_enable_device(struct pci_dev *dev) { return 0; } #endif /* !CONFIG_PCI */ +/* these helpers provide future and backwards compatibility + * for accessing popular PCI BAR info */ +#define pci_resource_start(dev,bar) ((dev)->resource[(bar)].start) +#define pci_resource_end(dev,bar) ((dev)->resource[(bar)].end) +#define pci_resource_flags(dev,bar) ((dev)->resource[(bar)].flags) +#define pci_resource_len(dev,bar) \ + ((pci_resource_start((dev),(bar)) == 0 && \ + pci_resource_end((dev),(bar)) == \ + pci_resource_start((dev),(bar))) ? 0 : \ + \ + (pci_resource_end((dev),(bar)) - \ + pci_resource_start((dev),(bar)) + 1)) + /* * The world is not perfect and supplies us with broken PCI devices. * For at least a part of these bugs we need a work-around, so both diff --git a/include/linux/pm.h b/include/linux/pm.h index 8108f3764..aaafe127f 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h @@ -21,6 +21,8 @@ #ifndef _LINUX_PM_H #define _LINUX_PM_H +#ifdef __KERNEL__ + #include <linux/config.h> #include <linux/list.h> @@ -69,8 +71,10 @@ enum PM_SYS_UNKNOWN = 0x00000000, /* generic */ PM_SYS_KBC = 0x41d00303, /* keyboard controller */ PM_SYS_COM = 0x41d00500, /* serial port */ + PM_SYS_IRDA = 0x41d00510, /* IRDA controller */ PM_SYS_FDC = 0x41d00700, /* floppy controller */ PM_SYS_VGA = 0x41d00900, /* VGA controller */ + PM_SYS_PCMCIA = 0x41d00e00, /* PCMCIA controller */ }; /* @@ -96,13 +100,17 @@ struct pm_dev void *data; unsigned long flags; - unsigned long status; + int state; struct list_head entry; }; #if defined(CONFIG_ACPI) || defined(CONFIG_APM) +extern int pm_active; + +#define PM_IS_ACTIVE() (pm_active != 0) + /* * Register a device with power management */ @@ -116,6 +124,11 @@ struct pm_dev *pm_register(pm_dev_t type, void pm_unregister(struct pm_dev *dev); /* + * Unregister all devices with matching callback + */ +void pm_unregister_all(pm_callback callback); + +/* * Send a request to all devices */ int pm_send_request(pm_request_t rqst, void *data); @@ -130,6 +143,8 @@ extern inline void pm_dev_idle(struct pm_dev *dev) {} #else // CONFIG_ACPI || CONFIG_APM +#define PM_IS_ACTIVE() 0 + extern inline struct pm_dev *pm_register(pm_dev_t type, unsigned long id, pm_callback callback) @@ -139,6 +154,8 @@ extern inline struct pm_dev *pm_register(pm_dev_t type, extern inline void pm_unregister(struct pm_dev *dev) {} +extern inline void pm_unregister_all(pm_callback callback) {} + extern inline int pm_send_request(pm_request_t rqst, void *data) { return 0; @@ -154,4 +171,9 @@ extern inline void pm_dev_idle(struct pm_dev *dev) {} #endif // CONFIG_ACPI || CONFIG_APM +extern void (*pm_idle)(void); +extern void (*pm_power_off)(void); + +#endif // __KERNEL__ + #endif /* _LINUX_PM_H */ diff --git a/include/linux/pmu.h b/include/linux/pmu.h index 907b58c2d..ad4d12b67 100644 --- a/include/linux/pmu.h +++ b/include/linux/pmu.h @@ -51,6 +51,7 @@ enum { PMU_OHARE_BASED, /* 2400, 3400, 3500 (old G3 powerbook) */ PMU_HEATHROW_BASED, /* PowerBook G3 series */ PMU_PADDINGTON_BASED, /* 1999 PowerBook G3 */ + PMU_KEYLARGO_BASED, /* Core99 motherboard (PMU99) */ }; /* @@ -66,6 +67,8 @@ enum { #define PMU_IOC_SET_BACKLIGHT _IOW('B', 2, sizeof(__u32)) /* out param: u32* backlight value: 0 to 31 */ #define PMU_IOC_GET_MODEL _IOR('B', 3, sizeof(__u32*)) +/* out param: u32* has_adb: 0 or 1 */ +#define PMU_IOC_HAS_ADB _IOR('B', 4, sizeof(__u32*)) #ifdef __KERNEL__ diff --git a/include/linux/ppp_channel.h b/include/linux/ppp_channel.h index c68290358..d1f9dd66c 100644 --- a/include/linux/ppp_channel.h +++ b/include/linux/ppp_channel.h @@ -1,3 +1,5 @@ +#ifndef _PPP_CHANNEL_H_ +#define _PPP_CHANNEL_H_ /* * Definitions for the interface between the generic PPP code * and a PPP channel. @@ -17,7 +19,7 @@ * ==FILEVERSION 990909== */ -/* $Id: ppp_channel.h,v 1.2 1999/09/15 11:21:53 paulus Exp $ */ +/* $Id: ppp_channel.h,v 1.3 2000/01/31 01:42:48 davem Exp $ */ #include <linux/list.h> #include <linux/skbuff.h> @@ -61,3 +63,4 @@ extern int ppp_register_channel(struct ppp_channel *, int unit); extern void ppp_unregister_channel(struct ppp_channel *); #endif /* __KERNEL__ */ +#endif diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index 30f86f49f..21349eb40 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h @@ -115,7 +115,6 @@ extern struct dentry *proc_lookup(struct inode *, struct dentry *); extern struct inode_operations proc_sys_inode_operations; extern struct inode_operations proc_kcore_inode_operations; extern struct inode_operations proc_kmsg_inode_operations; -extern struct inode_operations proc_omirr_inode_operations; extern struct inode_operations proc_ppc_htab_inode_operations; /* diff --git a/include/linux/qnx4_fs.h b/include/linux/qnx4_fs.h index e340e3dfe..d831875bb 100644 --- a/include/linux/qnx4_fs.h +++ b/include/linux/qnx4_fs.h @@ -108,7 +108,6 @@ extern int init_qnx4_fs(void); extern int qnx4_create(struct inode *dir, struct dentry *dentry, int mode); extern struct inode_operations qnx4_file_inode_operations; extern struct inode_operations qnx4_dir_inode_operations; -extern struct inode_operations qnx4_symlink_inode_operations; extern int qnx4_is_free(struct super_block *sb, long block); extern int qnx4_set_bitmap(struct super_block *sb, long block, int busy); extern int qnx4_create(struct inode *inode, struct dentry *dentry, int mode); diff --git a/include/linux/qnx4_fs_i.h b/include/linux/qnx4_fs_i.h index 57439fe57..b0fe8463e 100644 --- a/include/linux/qnx4_fs_i.h +++ b/include/linux/qnx4_fs_i.h @@ -33,6 +33,7 @@ struct qnx4_inode_info { __u8 i_zero[4]; /* 4 */ qnx4_ftype_t i_type; /* 1 */ __u8 i_status; /* 1 */ + unsigned long mmu_private; }; #endif diff --git a/include/linux/raid/linear.h b/include/linux/raid/linear.h new file mode 100644 index 000000000..55cfab78f --- /dev/null +++ b/include/linux/raid/linear.h @@ -0,0 +1,32 @@ +#ifndef _LINEAR_H +#define _LINEAR_H + +#include <linux/raid/md.h> + +struct dev_info { + kdev_t dev; + int size; + unsigned int offset; +}; + +typedef struct dev_info dev_info_t; + +struct linear_hash +{ + dev_info_t *dev0, *dev1; +}; + +struct linear_private_data +{ + struct linear_hash *hash_table; + dev_info_t disks[MD_SB_DISKS]; + dev_info_t *smallest; + int nr_zones; +}; + + +typedef struct linear_private_data linear_conf_t; + +#define mddev_to_conf(mddev) ((linear_conf_t *) mddev->private) + +#endif diff --git a/include/linux/raid/md.h b/include/linux/raid/md.h new file mode 100644 index 000000000..cabc0a8be --- /dev/null +++ b/include/linux/raid/md.h @@ -0,0 +1,94 @@ +/* + md.h : Multiple Devices driver for Linux + Copyright (C) 1996-98 Ingo Molnar, Gadi Oxman + Copyright (C) 1994-96 Marc ZYNGIER + <zyngier@ufr-info-p7.ibp.fr> or + <maz@gloups.fdn.fr> + + 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, or (at your option) + any later version. + + You should have received a copy of the GNU General Public License + (for example /usr/src/linux/COPYING); if not, write to the Free + Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef _MD_H +#define _MD_H + +#include <linux/mm.h> +#include <linux/config.h> +#include <linux/fs.h> +#include <linux/blkdev.h> +#include <asm/semaphore.h> +#include <linux/major.h> +#include <linux/ioctl.h> +#include <linux/types.h> +#include <asm/bitops.h> +#include <linux/module.h> +#include <linux/hdreg.h> +#include <linux/sysctl.h> +#include <linux/proc_fs.h> +#include <linux/smp_lock.h> +#include <linux/delay.h> +#include <net/checksum.h> +#include <linux/random.h> +#include <linux/locks.h> +#include <asm/io.h> + +#include <linux/raid/md_compatible.h> +/* + * 'md_p.h' holds the 'physical' layout of RAID devices + * 'md_u.h' holds the user <=> kernel API + * + * 'md_k.h' holds kernel internal definitions + */ + +#include <linux/raid/md_p.h> +#include <linux/raid/md_u.h> +#include <linux/raid/md_k.h> + +/* + * Different major versions are not compatible. + * Different minor versions are only downward compatible. + * Different patchlevel versions are downward and upward compatible. + */ +#define MD_MAJOR_VERSION 0 +#define MD_MINOR_VERSION 90 +#define MD_PATCHLEVEL_VERSION 0 + +extern int md_size[MAX_MD_DEVS]; +extern struct hd_struct md_hd_struct[MAX_MD_DEVS]; + +extern void add_mddev_mapping (mddev_t *mddev, kdev_t dev, void *data); +extern void del_mddev_mapping (mddev_t *mddev, kdev_t dev); +extern char * partition_name (kdev_t dev); +extern int register_md_personality (int p_num, mdk_personality_t *p); +extern int unregister_md_personality (int p_num); +extern mdk_thread_t * md_register_thread (void (*run) (void *data), + void *data, const char *name); +extern void md_unregister_thread (mdk_thread_t *thread); +extern void md_wakeup_thread(mdk_thread_t *thread); +extern void md_interrupt_thread (mdk_thread_t *thread); +extern int md_update_sb (mddev_t *mddev); +extern int md_do_sync(mddev_t *mddev, mdp_disk_t *spare); +extern void md_recover_arrays (void); +extern int md_check_ordering (mddev_t *mddev); +extern void autodetect_raid(void); +extern struct gendisk * find_gendisk (kdev_t dev); +extern int md_notify_reboot(struct notifier_block *this, + unsigned long code, void *x); +extern int md_error (kdev_t mddev, kdev_t rdev); + +#if CONFIG_BLK_DEV_MD +extern void raid_setup(char *str,int *ints) md__init; +#endif + +extern void md_print_devices (void); + +#define MD_BUG(x...) { printk("md: bug in file %s, line %d\n", __FILE__, __LINE__); md_print_devices(); } + +#endif _MD_H + diff --git a/include/linux/raid/md_compatible.h b/include/linux/raid/md_compatible.h new file mode 100644 index 000000000..fbeac31a1 --- /dev/null +++ b/include/linux/raid/md_compatible.h @@ -0,0 +1,160 @@ + +/* + md.h : Multiple Devices driver compatibility layer for Linux 2.0/2.2 + Copyright (C) 1998 Ingo Molnar + + 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, or (at your option) + any later version. + + You should have received a copy of the GNU General Public License + (for example /usr/src/linux/COPYING); if not, write to the Free + Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include <linux/version.h> + +#ifndef _MD_COMPATIBLE_H +#define _MD_COMPATIBLE_H + +/** 2.3/2.4 stuff: **/ + +#include <linux/reboot.h> +#include <linux/vmalloc.h> +#include <linux/blkpg.h> + +/* 000 */ +#define md__get_free_pages(x,y) __get_free_pages(x,y) + +#ifdef __i386__ +/* 001 */ +extern __inline__ int md_cpu_has_mmx(void) +{ + return boot_cpu_data.x86_capability & X86_FEATURE_MMX; +} +#endif + +/* 002 */ +#define md_clear_page(page) clear_page(page) + +/* 003 */ +#define MD_EXPORT_SYMBOL(x) EXPORT_SYMBOL(x) + +/* 004 */ +#define md_copy_to_user(x,y,z) copy_to_user(x,y,z) + +/* 005 */ +#define md_copy_from_user(x,y,z) copy_from_user(x,y,z) + +/* 006 */ +#define md_put_user put_user + +/* 007 */ +extern inline int md_capable_admin(void) +{ + return capable(CAP_SYS_ADMIN); +} + +/* 008 */ +#define MD_FILE_TO_INODE(file) ((file)->f_dentry->d_inode) + +/* 009 */ +extern inline void md_flush_signals (void) +{ + spin_lock(¤t->sigmask_lock); + flush_signals(current); + spin_unlock(¤t->sigmask_lock); +} + +/* 010 */ +extern inline void md_init_signals (void) +{ + current->exit_signal = SIGCHLD; + siginitsetinv(¤t->blocked, sigmask(SIGKILL)); +} + +/* 011 */ +#define md_signal_pending signal_pending + +/* 012 */ +extern inline void md_set_global_readahead(int * table) +{ + max_readahead[MD_MAJOR] = table; +} + +/* 013 */ +#define md_mdelay(x) mdelay(x) + +/* 014 */ +#define MD_SYS_DOWN SYS_DOWN +#define MD_SYS_HALT SYS_HALT +#define MD_SYS_POWER_OFF SYS_POWER_OFF + +/* 015 */ +#define md_register_reboot_notifier register_reboot_notifier + +/* 016 */ +#define md_test_and_set_bit test_and_set_bit + +/* 017 */ +#define md_test_and_clear_bit test_and_clear_bit + +/* 018 */ +#define md_atomic_read atomic_read +#define md_atomic_set atomic_set + +/* 019 */ +#define md_lock_kernel lock_kernel +#define md_unlock_kernel unlock_kernel + +/* 020 */ + +#include <linux/init.h> + +#define md__init __init +#define md__initdata __initdata +#define md__initfunc(__arginit) __initfunc(__arginit) + +/* 021 */ + + +/* 022 */ + +#define md_list_head list_head +#define MD_LIST_HEAD(name) LIST_HEAD(name) +#define MD_INIT_LIST_HEAD(ptr) INIT_LIST_HEAD(ptr) +#define md_list_add list_add +#define md_list_del list_del +#define md_list_empty list_empty + +#define md_list_entry(ptr, type, member) list_entry(ptr, type, member) + +/* 023 */ + +#define md_schedule_timeout schedule_timeout + +/* 024 */ +#define md_need_resched(tsk) ((tsk)->need_resched) + +/* 025 */ +#define md_spinlock_t spinlock_t +#define MD_SPIN_LOCK_UNLOCKED SPIN_LOCK_UNLOCKED + +#define md_spin_lock spin_lock +#define md_spin_unlock spin_unlock +#define md_spin_lock_irq spin_lock_irq +#define md_spin_unlock_irq spin_unlock_irq +#define md_spin_unlock_irqrestore spin_unlock_irqrestore +#define md_spin_lock_irqsave spin_lock_irqsave + +/* 026 */ +typedef wait_queue_head_t md_wait_queue_head_t; +#define MD_DECLARE_WAITQUEUE(w,t) DECLARE_WAITQUEUE((w),(t)) +#define MD_DECLARE_WAIT_QUEUE_HEAD(x) DECLARE_WAIT_QUEUE_HEAD(x) +#define md_init_waitqueue_head init_waitqueue_head + +/* END */ + +#endif _MD_COMPATIBLE_H + diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h new file mode 100644 index 000000000..d00563357 --- /dev/null +++ b/include/linux/raid/md_k.h @@ -0,0 +1,341 @@ +/* + md_k.h : kernel internal structure of the Linux MD driver + Copyright (C) 1996-98 Ingo Molnar, Gadi Oxman + + 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, or (at your option) + any later version. + + You should have received a copy of the GNU General Public License + (for example /usr/src/linux/COPYING); if not, write to the Free + Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef _MD_K_H +#define _MD_K_H + +#define MD_RESERVED 0UL +#define LINEAR 1UL +#define STRIPED 2UL +#define RAID0 STRIPED +#define RAID1 3UL +#define RAID5 4UL +#define TRANSLUCENT 5UL +#define HSM 6UL +#define MAX_PERSONALITY 7UL + +extern inline int pers_to_level (int pers) +{ + switch (pers) { + case HSM: return -3; + case TRANSLUCENT: return -2; + case LINEAR: return -1; + case RAID0: return 0; + case RAID1: return 1; + case RAID5: return 5; + } + panic("pers_to_level()"); +} + +extern inline int level_to_pers (int level) +{ + switch (level) { + case -3: return HSM; + case -2: return TRANSLUCENT; + case -1: return LINEAR; + case 0: return RAID0; + case 1: return RAID1; + case 4: + case 5: return RAID5; + } + return MD_RESERVED; +} + +typedef struct mddev_s mddev_t; +typedef struct mdk_rdev_s mdk_rdev_t; + +#if (MINORBITS != 8) +#error MD doesnt handle bigger kdev yet +#endif + +#define MAX_REAL 12 /* Max number of disks per md dev */ +#define MAX_MD_DEVS (1<<MINORBITS) /* Max number of md dev */ + +/* + * Maps a kdev to an mddev/subdev. How 'data' is handled is up to + * the personality. (eg. HSM uses this to identify individual LVs) + */ +typedef struct dev_mapping_s { + mddev_t *mddev; + void *data; +} dev_mapping_t; + +extern dev_mapping_t mddev_map [MAX_MD_DEVS]; + +extern inline mddev_t * kdev_to_mddev (kdev_t dev) +{ + return mddev_map[MINOR(dev)].mddev; +} + +/* + * options passed in raidrun: + */ + +#define MAX_CHUNK_SIZE (4096*1024) + +/* + * default readahead + */ +#define MD_READAHEAD (256 * 512) + +extern inline int disk_faulty(mdp_disk_t * d) +{ + return d->state & (1 << MD_DISK_FAULTY); +} + +extern inline int disk_active(mdp_disk_t * d) +{ + return d->state & (1 << MD_DISK_ACTIVE); +} + +extern inline int disk_sync(mdp_disk_t * d) +{ + return d->state & (1 << MD_DISK_SYNC); +} + +extern inline int disk_spare(mdp_disk_t * d) +{ + return !disk_sync(d) && !disk_active(d) && !disk_faulty(d); +} + +extern inline int disk_removed(mdp_disk_t * d) +{ + return d->state & (1 << MD_DISK_REMOVED); +} + +extern inline void mark_disk_faulty(mdp_disk_t * d) +{ + d->state |= (1 << MD_DISK_FAULTY); +} + +extern inline void mark_disk_active(mdp_disk_t * d) +{ + d->state |= (1 << MD_DISK_ACTIVE); +} + +extern inline void mark_disk_sync(mdp_disk_t * d) +{ + d->state |= (1 << MD_DISK_SYNC); +} + +extern inline void mark_disk_spare(mdp_disk_t * d) +{ + d->state = 0; +} + +extern inline void mark_disk_removed(mdp_disk_t * d) +{ + d->state = (1 << MD_DISK_FAULTY) | (1 << MD_DISK_REMOVED); +} + +extern inline void mark_disk_inactive(mdp_disk_t * d) +{ + d->state &= ~(1 << MD_DISK_ACTIVE); +} + +extern inline void mark_disk_nonsync(mdp_disk_t * d) +{ + d->state &= ~(1 << MD_DISK_SYNC); +} + +/* + * MD's 'extended' device + */ +struct mdk_rdev_s +{ + struct md_list_head same_set; /* RAID devices within the same set */ + struct md_list_head all; /* all RAID devices */ + struct md_list_head pending; /* undetected RAID devices */ + + kdev_t dev; /* Device number */ + kdev_t old_dev; /* "" when it was last imported */ + int size; /* Device size (in blocks) */ + mddev_t *mddev; /* RAID array if running */ + unsigned long last_events; /* IO event timestamp */ + + struct inode *inode; /* Lock inode */ + struct file filp; /* Lock file */ + + mdp_super_t *sb; + int sb_offset; + + int faulty; /* if faulty do not issue IO requests */ + int desc_nr; /* descriptor index in the superblock */ +}; + + +/* + * disk operations in a working array: + */ +#define DISKOP_SPARE_INACTIVE 0 +#define DISKOP_SPARE_WRITE 1 +#define DISKOP_SPARE_ACTIVE 2 +#define DISKOP_HOT_REMOVE_DISK 3 +#define DISKOP_HOT_ADD_DISK 4 + +typedef struct mdk_personality_s mdk_personality_t; + +struct mddev_s +{ + void *private; + mdk_personality_t *pers; + int __minor; + mdp_super_t *sb; + int nb_dev; + struct md_list_head disks; + int sb_dirty; + mdu_param_t param; + int ro; + unsigned int curr_resync; + unsigned long resync_start; + char *name; + int recovery_running; + struct semaphore reconfig_sem; + struct semaphore recovery_sem; + struct semaphore resync_sem; + struct md_list_head all_mddevs; + request_queue_t queue; +}; + +struct mdk_personality_s +{ + char *name; + int (*map)(mddev_t *mddev, kdev_t dev, kdev_t *rdev, + unsigned long *rsector, unsigned long size); + int (*make_request)(mddev_t *mddev, int rw, struct buffer_head * bh); + void (*end_request)(struct buffer_head * bh, int uptodate); + int (*run)(mddev_t *mddev); + int (*stop)(mddev_t *mddev); + int (*status)(char *page, mddev_t *mddev); + int (*ioctl)(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg); + int max_invalid_dev; + int (*error_handler)(mddev_t *mddev, kdev_t dev); + +/* + * Some personalities (RAID-1, RAID-5) can have disks hot-added and + * hot-removed. Hot removal is different from failure. (failure marks + * a disk inactive, but the disk is still part of the array) The interface + * to such operations is the 'pers->diskop()' function, can be NULL. + * + * the diskop function can change the pointer pointing to the incoming + * descriptor, but must do so very carefully. (currently only + * SPARE_ACTIVE expects such a change) + */ + int (*diskop) (mddev_t *mddev, mdp_disk_t **descriptor, int state); + + int (*stop_resync)(mddev_t *mddev); + int (*restart_resync)(mddev_t *mddev); +}; + + +/* + * Currently we index md_array directly, based on the minor + * number. This will have to change to dynamic allocation + * once we start supporting partitioning of md devices. + */ +extern inline int mdidx (mddev_t * mddev) +{ + return mddev->__minor; +} + +extern inline kdev_t mddev_to_kdev(mddev_t * mddev) +{ + return MKDEV(MD_MAJOR, mdidx(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); + +/* + * iterates through some rdev ringlist. It's safe to remove the + * current 'rdev'. Dont touch 'tmp' though. + */ +#define ITERATE_RDEV_GENERIC(head,field,rdev,tmp) \ + \ + for (tmp = head.next; \ + rdev = md_list_entry(tmp, mdk_rdev_t, field), \ + tmp = tmp->next, tmp->prev != &head \ + ; ) +/* + * iterates through the 'same array disks' ringlist + */ +#define ITERATE_RDEV(mddev,rdev,tmp) \ + ITERATE_RDEV_GENERIC((mddev)->disks,same_set,rdev,tmp) + +/* + * Same as above, but assumes that the device has rdev->desc_nr numbered + * from 0 to mddev->nb_dev, and iterates through rdevs in ascending order. + */ +#define ITERATE_RDEV_ORDERED(mddev,rdev,i) \ + for (i = 0; rdev = find_rdev_nr(mddev, i), i < mddev->nb_dev; i++) + + +/* + * Iterates through all 'RAID managed disks' + */ +#define ITERATE_RDEV_ALL(rdev,tmp) \ + ITERATE_RDEV_GENERIC(all_raid_disks,all,rdev,tmp) + +/* + * Iterates through 'pending RAID disks' + */ +#define ITERATE_RDEV_PENDING(rdev,tmp) \ + ITERATE_RDEV_GENERIC(pending_raid_disks,pending,rdev,tmp) + +/* + * iterates through all used mddevs in the system. + */ +#define ITERATE_MDDEV(mddev,tmp) \ + \ + for (tmp = all_mddevs.next; \ + mddev = md_list_entry(tmp, mddev_t, all_mddevs), \ + tmp = tmp->next, tmp->prev != &all_mddevs \ + ; ) + +extern inline int lock_mddev (mddev_t * mddev) +{ + return down_interruptible(&mddev->reconfig_sem); +} + +extern inline void unlock_mddev (mddev_t * mddev) +{ + up(&mddev->reconfig_sem); +} + +#define xchg_values(x,y) do { __typeof__(x) __tmp = x; \ + x = y; y = __tmp; } while (0) + +typedef struct mdk_thread_s { + void (*run) (void *data); + void *data; + md_wait_queue_head_t wqueue; + unsigned long flags; + struct semaphore *sem; + struct task_struct *tsk; + const char *name; +} mdk_thread_t; + +#define THREAD_WAKEUP 0 + +#define MAX_DISKNAME_LEN 32 + +typedef struct dev_name_s { + struct md_list_head list; + kdev_t dev; + char name [MAX_DISKNAME_LEN]; +} dev_name_t; + +#endif _MD_K_H + diff --git a/include/linux/raid/md_p.h b/include/linux/raid/md_p.h new file mode 100644 index 000000000..1b9632c14 --- /dev/null +++ b/include/linux/raid/md_p.h @@ -0,0 +1,161 @@ +/* + md_p.h : physical layout of Linux RAID devices + Copyright (C) 1996-98 Ingo Molnar, Gadi Oxman + + 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, or (at your option) + any later version. + + You should have received a copy of the GNU General Public License + (for example /usr/src/linux/COPYING); if not, write to the Free + Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef _MD_P_H +#define _MD_P_H + +/* + * RAID superblock. + * + * The RAID superblock maintains some statistics on each RAID configuration. + * Each real device in the RAID set contains it near the end of the device. + * Some of the ideas are copied from the ext2fs implementation. + * + * We currently use 4096 bytes as follows: + * + * word offset function + * + * 0 - 31 Constant generic RAID device information. + * 32 - 63 Generic state information. + * 64 - 127 Personality specific information. + * 128 - 511 12 32-words descriptors of the disks in the raid set. + * 512 - 911 Reserved. + * 912 - 1023 Disk specific descriptor. + */ + +/* + * If x is the real device size in bytes, we return an apparent size of: + * + * y = (x & ~(MD_RESERVED_BYTES - 1)) - MD_RESERVED_BYTES + * + * and place the 4kB superblock at offset y. + */ +#define MD_RESERVED_BYTES (64 * 1024) +#define MD_RESERVED_SECTORS (MD_RESERVED_BYTES / 512) +#define MD_RESERVED_BLOCKS (MD_RESERVED_BYTES / BLOCK_SIZE) + +#define MD_NEW_SIZE_SECTORS(x) ((x & ~(MD_RESERVED_SECTORS - 1)) - MD_RESERVED_SECTORS) +#define MD_NEW_SIZE_BLOCKS(x) ((x & ~(MD_RESERVED_BLOCKS - 1)) - MD_RESERVED_BLOCKS) + +#define MD_SB_BYTES 4096 +#define MD_SB_WORDS (MD_SB_BYTES / 4) +#define MD_SB_BLOCKS (MD_SB_BYTES / BLOCK_SIZE) +#define MD_SB_SECTORS (MD_SB_BYTES / 512) + +/* + * The following are counted in 32-bit words + */ +#define MD_SB_GENERIC_OFFSET 0 +#define MD_SB_PERSONALITY_OFFSET 64 +#define MD_SB_DISKS_OFFSET 128 +#define MD_SB_DESCRIPTOR_OFFSET 992 + +#define MD_SB_GENERIC_CONSTANT_WORDS 32 +#define MD_SB_GENERIC_STATE_WORDS 32 +#define MD_SB_GENERIC_WORDS (MD_SB_GENERIC_CONSTANT_WORDS + MD_SB_GENERIC_STATE_WORDS) +#define MD_SB_PERSONALITY_WORDS 64 +#define MD_SB_DESCRIPTOR_WORDS 32 +#define MD_SB_DISKS 27 +#define MD_SB_DISKS_WORDS (MD_SB_DISKS*MD_SB_DESCRIPTOR_WORDS) +#define MD_SB_RESERVED_WORDS (1024 - MD_SB_GENERIC_WORDS - MD_SB_PERSONALITY_WORDS - MD_SB_DISKS_WORDS - MD_SB_DESCRIPTOR_WORDS) +#define MD_SB_EQUAL_WORDS (MD_SB_GENERIC_WORDS + MD_SB_PERSONALITY_WORDS + MD_SB_DISKS_WORDS) + +/* + * Device "operational" state bits + */ +#define MD_DISK_FAULTY 0 /* disk is faulty / operational */ +#define MD_DISK_ACTIVE 1 /* disk is running or spare disk */ +#define MD_DISK_SYNC 2 /* disk is in sync with the raid set */ +#define MD_DISK_REMOVED 3 /* disk is in sync with the raid set */ + +typedef struct mdp_device_descriptor_s { + __u32 number; /* 0 Device number in the entire set */ + __u32 major; /* 1 Device major number */ + __u32 minor; /* 2 Device minor number */ + __u32 raid_disk; /* 3 The role of the device in the raid set */ + __u32 state; /* 4 Operational state */ + __u32 reserved[MD_SB_DESCRIPTOR_WORDS - 5]; +} mdp_disk_t; + +#define MD_SB_MAGIC 0xa92b4efc + +/* + * Superblock state bits + */ +#define MD_SB_CLEAN 0 +#define MD_SB_ERRORS 1 + +typedef struct mdp_superblock_s { + /* + * Constant generic information + */ + __u32 md_magic; /* 0 MD identifier */ + __u32 major_version; /* 1 major version to which the set conforms */ + __u32 minor_version; /* 2 minor version ... */ + __u32 patch_version; /* 3 patchlevel version ... */ + __u32 gvalid_words; /* 4 Number of used words in this section */ + __u32 set_uuid0; /* 5 Raid set identifier */ + __u32 ctime; /* 6 Creation time */ + __u32 level; /* 7 Raid personality */ + __u32 size; /* 8 Apparent size of each individual disk */ + __u32 nr_disks; /* 9 total disks in the raid set */ + __u32 raid_disks; /* 10 disks in a fully functional raid set */ + __u32 md_minor; /* 11 preferred MD minor device number */ + __u32 not_persistent; /* 12 does it have a persistent superblock */ + __u32 set_uuid1; /* 13 Raid set identifier #2 */ + __u32 set_uuid2; /* 14 Raid set identifier #3 */ + __u32 set_uuid3; /* 14 Raid set identifier #4 */ + __u32 gstate_creserved[MD_SB_GENERIC_CONSTANT_WORDS - 16]; + + /* + * Generic state information + */ + __u32 utime; /* 0 Superblock update time */ + __u32 state; /* 1 State bits (clean, ...) */ + __u32 active_disks; /* 2 Number of currently active disks */ + __u32 working_disks; /* 3 Number of working disks */ + __u32 failed_disks; /* 4 Number of failed disks */ + __u32 spare_disks; /* 5 Number of spare disks */ + __u32 sb_csum; /* 6 checksum of the whole superblock */ + __u64 events; /* 7 number of superblock updates (64-bit!) */ + __u32 gstate_sreserved[MD_SB_GENERIC_STATE_WORDS - 9]; + + /* + * Personality information + */ + __u32 layout; /* 0 the array's physical layout */ + __u32 chunk_size; /* 1 chunk size in bytes */ + __u32 root_pv; /* 2 LV root PV */ + __u32 root_block; /* 3 LV root block */ + __u32 pstate_reserved[MD_SB_PERSONALITY_WORDS - 4]; + + /* + * Disks information + */ + mdp_disk_t disks[MD_SB_DISKS]; + + /* + * Reserved + */ + __u32 reserved[MD_SB_RESERVED_WORDS]; + + /* + * Active descriptor + */ + mdp_disk_t this_disk; + +} mdp_super_t; + +#endif _MD_P_H + diff --git a/include/linux/raid/md_u.h b/include/linux/raid/md_u.h new file mode 100644 index 000000000..9478513f9 --- /dev/null +++ b/include/linux/raid/md_u.h @@ -0,0 +1,115 @@ +/* + md_u.h : user <=> kernel API between Linux raidtools and RAID drivers + Copyright (C) 1998 Ingo Molnar + + 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, or (at your option) + any later version. + + You should have received a copy of the GNU General Public License + (for example /usr/src/linux/COPYING); if not, write to the Free + Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef _MD_U_H +#define _MD_U_H + +/* ioctls */ + +/* status */ +#define RAID_VERSION _IOR (MD_MAJOR, 0x10, mdu_version_t) +#define GET_ARRAY_INFO _IOR (MD_MAJOR, 0x11, mdu_array_info_t) +#define GET_DISK_INFO _IOR (MD_MAJOR, 0x12, mdu_disk_info_t) +#define PRINT_RAID_DEBUG _IO (MD_MAJOR, 0x13) + +/* configuration */ +#define CLEAR_ARRAY _IO (MD_MAJOR, 0x20) +#define ADD_NEW_DISK _IOW (MD_MAJOR, 0x21, mdu_disk_info_t) +#define HOT_REMOVE_DISK _IO (MD_MAJOR, 0x22) +#define SET_ARRAY_INFO _IOW (MD_MAJOR, 0x23, mdu_array_info_t) +#define SET_DISK_INFO _IO (MD_MAJOR, 0x24) +#define WRITE_RAID_INFO _IO (MD_MAJOR, 0x25) +#define UNPROTECT_ARRAY _IO (MD_MAJOR, 0x26) +#define PROTECT_ARRAY _IO (MD_MAJOR, 0x27) +#define HOT_ADD_DISK _IO (MD_MAJOR, 0x28) +#define SET_DISK_FAULTY _IO (MD_MAJOR, 0x29) + +/* usage */ +#define RUN_ARRAY _IOW (MD_MAJOR, 0x30, mdu_param_t) +#define START_ARRAY _IO (MD_MAJOR, 0x31) +#define STOP_ARRAY _IO (MD_MAJOR, 0x32) +#define STOP_ARRAY_RO _IO (MD_MAJOR, 0x33) +#define RESTART_ARRAY_RW _IO (MD_MAJOR, 0x34) + +typedef struct mdu_version_s { + int major; + int minor; + int patchlevel; +} mdu_version_t; + +typedef struct mdu_array_info_s { + /* + * Generic constant information + */ + int major_version; + int minor_version; + int patch_version; + int ctime; + int level; + int size; + int nr_disks; + int raid_disks; + int md_minor; + int not_persistent; + + /* + * Generic state information + */ + int utime; /* 0 Superblock update time */ + int state; /* 1 State bits (clean, ...) */ + int active_disks; /* 2 Number of currently active disks */ + int working_disks; /* 3 Number of working disks */ + int failed_disks; /* 4 Number of failed disks */ + int spare_disks; /* 5 Number of spare disks */ + + /* + * Personality information + */ + int layout; /* 0 the array's physical layout */ + int chunk_size; /* 1 chunk size in bytes */ + +} mdu_array_info_t; + +typedef struct mdu_disk_info_s { + /* + * configuration/status of one particular disk + */ + int number; + int major; + int minor; + int raid_disk; + int state; + +} mdu_disk_info_t; + +typedef struct mdu_start_info_s { + /* + * configuration/status of one particular disk + */ + int major; + int minor; + int raid_disk; + int state; + +} mdu_start_info_t; + +typedef struct mdu_param_s +{ + int personality; /* 1,2,3,4 */ + int chunk_size; /* in bytes */ + int max_fault; /* unused for now */ +} mdu_param_t; + +#endif _MD_U_H + diff --git a/include/linux/raid/raid0.h b/include/linux/raid/raid0.h new file mode 100644 index 000000000..3ea74db60 --- /dev/null +++ b/include/linux/raid/raid0.h @@ -0,0 +1,33 @@ +#ifndef _RAID0_H +#define _RAID0_H + +#include <linux/raid/md.h> + +struct strip_zone +{ + int zone_offset; /* Zone offset in md_dev */ + int dev_offset; /* Zone offset in real dev */ + int size; /* Zone size */ + int nb_dev; /* # of devices attached to the zone */ + mdk_rdev_t *dev[MAX_REAL]; /* Devices attached to the zone */ +}; + +struct raid0_hash +{ + struct strip_zone *zone0, *zone1; +}; + +struct raid0_private_data +{ + struct raid0_hash *hash_table; /* Dynamically allocated */ + struct strip_zone *strip_zone; /* This one too */ + int nr_strip_zones; + struct strip_zone *smallest; + int nr_zones; +}; + +typedef struct raid0_private_data raid0_conf_t; + +#define mddev_to_conf(mddev) ((raid0_conf_t *) mddev->private) + +#endif diff --git a/include/linux/raid0.h b/include/linux/raid0.h deleted file mode 100644 index e1ae51c02..000000000 --- a/include/linux/raid0.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef _RAID0_H -#define _RAID0_H - -struct strip_zone -{ - int zone_offset; /* Zone offset in md_dev */ - int dev_offset; /* Zone offset in real dev */ - int size; /* Zone size */ - int nb_dev; /* Number of devices attached to the zone */ - struct real_dev *dev[MAX_REAL]; /* Devices attached to the zone */ -}; - -struct raid0_hash -{ - struct strip_zone *zone0, *zone1; -}; - -struct raid0_data -{ - struct raid0_hash *hash_table; /* Dynamically allocated */ - struct strip_zone *strip_zone; /* This one too */ - int nr_strip_zones; - struct strip_zone *smallest; - int nr_zones; -}; - -#endif diff --git a/include/linux/rtc.h b/include/linux/rtc.h index 21c5a0198..55510558c 100644 --- a/include/linux/rtc.h +++ b/include/linux/rtc.h @@ -1,13 +1,13 @@ -/* $Id: rtc.h,v 1.1 1998/07/09 20:01:31 ralf Exp $ - * - * Interface definitions for the /dev/rtc realtime clock interface. - * - * permission is hereby granted to copy, modify and redistribute this code - * in terms of the GNU Library General Public License, Version 2 or later, - * at your option. +/* + * Generic RTC interface. + * This version contains the part of the user interface to the Real Time Clock + * service. It is used with both the legacy mc146818 and also EFI + * + * Copyright (C) 1999 Hewlett-Packard Co. + * Copyright (C) 1999 Stephane Eranian <eranian@hpl.hp.com> */ #ifndef _LINUX_RTC_H -#define _LINUX_RTC_H +#define _LINUX_RTC_H_ /* * The struct used to pass data via the following ioctl. Similar to the @@ -29,18 +29,17 @@ struct rtc_time { /* * ioctl calls that are permitted to the /dev/rtc interface, if - * CONFIG_RTC or CONFIG_SGI_DS1286 are enabled. The interface definitions - * in this file are a superset from the features provided by actual - * RTC driver and chip implementations. + * CONFIG_RTC/CONFIG_EFI_RTC was enabled. */ + #define RTC_AIE_ON _IO('p', 0x01) /* Alarm int. enable on */ #define RTC_AIE_OFF _IO('p', 0x02) /* ... off */ #define RTC_UIE_ON _IO('p', 0x03) /* Update int. enable on */ #define RTC_UIE_OFF _IO('p', 0x04) /* ... off */ #define RTC_PIE_ON _IO('p', 0x05) /* Periodic int. enable on */ #define RTC_PIE_OFF _IO('p', 0x06) /* ... off */ -#define RTC_WIE_ON _IO('p', 0x0f) /* Watchdog int. enable on */ -#define RTC_WIE_OFF _IO('p', 0x10) /* ... off */ +#define RTC_WIE_ON _IO('p', 0x0f) /* Watchdog int. enable on */ +#define RTC_WIE_OFF _IO('p', 0x10) /* ... off */ #define RTC_ALM_SET _IOW('p', 0x07, struct rtc_time) /* Set alarm time */ #define RTC_ALM_READ _IOR('p', 0x08, struct rtc_time) /* Read alarm time */ @@ -51,4 +50,4 @@ struct rtc_time { #define RTC_EPOCH_READ _IOR('p', 0x0d, unsigned long) /* Read epoch */ #define RTC_EPOCH_SET _IOW('p', 0x0e, unsigned long) /* Set epoch */ -#endif /* _LINUX_RTC_H */ +#endif /* _LINUX_RTC_H_ */ diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index e8f6c7328..f27ad591f 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h @@ -434,11 +434,15 @@ enum IFLA_QDISC, IFLA_STATS, IFLA_COST, - IFLA_PRIORITY +#define IFLA_COST IFLA_COST + IFLA_PRIORITY, +#define IFLA_PRIORITY IFLA_PRIORITY + IFLA_MASTER +#define IFLA_MASTER IFLA_MASTER }; -#define IFLA_MAX IFLA_STATS +#define IFLA_MAX IFLA_MASTER #define IFLA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg)))) #define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg)) @@ -464,7 +468,7 @@ enum IFF_BROADCAST devices are able to use multicasts too. */ -/* ifi_link. +/* IFLA_LINK. For usual devices it is equal ifi_index. If it is a "virtual interface" (f.e. tunnel), ifi_link can point to real physical interface (f.e. for bandwidth calculations), @@ -558,6 +562,13 @@ extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const voi #define RTA_PUT(skb, attrtype, attrlen, data) \ ({ if (skb_tailroom(skb) < (int)RTA_SPACE(attrlen)) goto rtattr_failure; \ __rta_fill(skb, attrtype, attrlen, data); }) + +extern void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change); + +#else + +#define rtmsg_ifinfo(a,b,c) do { } while (0) + #endif extern struct semaphore rtnl_sem; diff --git a/include/linux/sched.h b/include/linux/sched.h index 615eba6c5..6ec45eeff 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -80,7 +80,6 @@ extern int last_pid; #define TASK_UNINTERRUPTIBLE 2 #define TASK_ZOMBIE 4 #define TASK_STOPPED 8 -#define TASK_SWAPPING 16 #define TASK_EXCLUSIVE 32 #define __set_task_state(tsk, state_value) \ diff --git a/include/linux/shm.h b/include/linux/shm.h index 2f24729f6..e8b7d1f7c 100644 --- a/include/linux/shm.h +++ b/include/linux/shm.h @@ -2,6 +2,7 @@ #define _LINUX_SHM_H_ #include <linux/ipc.h> +#include <linux/mm.h> /* * SHMMAX, SHMMNI and SHMALL are upper limits are defaults which can diff --git a/include/linux/smb_fs.h b/include/linux/smb_fs.h index 451ff761a..52c3d7f33 100644 --- a/include/linux/smb_fs.h +++ b/include/linux/smb_fs.h @@ -101,6 +101,7 @@ int smb_mmap(struct file *, struct vm_area_struct *); /* linux/fs/smbfs/file.c */ extern struct inode_operations smb_file_inode_operations; +extern struct address_space_operations smb_file_aops; /* linux/fs/smbfs/dir.c */ extern struct inode_operations smb_dir_inode_operations; diff --git a/include/linux/sonet.h b/include/linux/sonet.h index d4e12b8f1..c2307389c 100644 --- a/include/linux/sonet.h +++ b/include/linux/sonet.h @@ -1,22 +1,22 @@ /* sonet.h - SONET/SHD physical layer control */ -/* Written 1995 by Werner Almesberger, EPFL LRC */ +/* Written 1995-1999 by Werner Almesberger, EPFL LRC/ICA */ #ifndef LINUX_SONET_H #define LINUX_SONET_H struct sonet_stats { - long section_bip; /* section parity errors (B1) */ - long line_bip; /* line parity errors (B2) */ - long path_bip; /* path parity errors (B3) */ - long line_febe; /* line parity errors at remote */ - long path_febe; /* path parity errors at remote */ - long corr_hcs; /* correctable header errors */ - long uncorr_hcs; /* uncorrectable header errors */ - long tx_cells; /* cells sent */ - long rx_cells; /* cells received */ -}; + int section_bip; /* section parity errors (B1) */ + int line_bip; /* line parity errors (B2) */ + int path_bip; /* path parity errors (B3) */ + int line_febe; /* line parity errors at remote */ + int path_febe; /* path parity errors at remote */ + int corr_hcs; /* correctable header errors */ + int uncorr_hcs; /* uncorrectable header errors */ + int tx_cells; /* cells sent */ + int rx_cells; /* cells received */ +} __attribute__ ((packed)); #define SONET_GETSTAT _IOR('a',ATMIOC_PHYTYP,struct sonet_stats) /* get statistics */ diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index 6c1d060d0..a84ae422c 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h @@ -53,6 +53,7 @@ #define spin_lock_init(lock) do { } while(0) #define spin_lock(lock) (void)(lock) /* Not "unused variable". */ +#define spin_is_locked(lock) (0) #define spin_trylock(lock) ({1; }) #define spin_unlock_wait(lock) do { } while(0) #define spin_unlock(lock) do { } while(0) @@ -65,6 +66,7 @@ typedef struct { #define SPIN_LOCK_UNLOCKED (spinlock_t) { 0 } #define spin_lock_init(x) do { (x)->lock = 0; } while (0) +#define spin_is_locked(lock) (test_bit(0,(lock))) #define spin_trylock(lock) (!test_and_set_bit(0,(lock))) #define spin_lock(x) do { (x)->lock = 1; } while (0) @@ -83,6 +85,7 @@ typedef struct { #include <linux/kernel.h> #define spin_lock_init(x) do { (x)->lock = 0; } while (0) +#define spin_is_locked(lock) (test_bit(0,(lock))) #define spin_trylock(lock) (!test_and_set_bit(0,(lock))) #define spin_lock(x) do {unsigned long __spinflags; save_flags(__spinflags); cli(); if ((x)->lock&&(x)->babble) {printk("%s:%d: spin_lock(%s:%p) already locked\n", __BASE_FILE__,__LINE__, (x)->module, (x));(x)->babble--;} (x)->lock = 1; restore_flags(__spinflags);} while (0) diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index db1cb7c41..1e17e52bb 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h @@ -29,6 +29,7 @@ struct svc_serv { struct svc_sock * sv_sockets; /* pending sockets */ struct svc_program * sv_program; /* RPC program */ struct svc_stat * sv_stats; /* RPC statistics */ + spinlock_t sv_lock; unsigned int sv_nrthreads; /* # of server threads */ unsigned int sv_bufsz; /* datagram buffer size */ unsigned int sv_xdrsize; /* XDR buffer size */ diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h index 5f8dc8768..82d9678d4 100644 --- a/include/linux/sunrpc/svcsock.h +++ b/include/linux/sunrpc/svcsock.h @@ -21,6 +21,7 @@ struct svc_sock { struct svc_sock * sk_list; /* list of all sockets */ struct socket * sk_sock; /* berkeley socket layer */ struct sock * sk_sk; /* INET layer */ + spinlock_t sk_lock; struct svc_serv * sk_server; /* service for this socket */ unsigned char sk_inuse; /* use count */ diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 03148253d..e7c710646 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -183,7 +183,8 @@ enum NET_CORE_FASTROUTE=7, NET_CORE_MSG_COST=8, NET_CORE_MSG_BURST=9, - NET_CORE_OPTMEM_MAX=10 + NET_CORE_OPTMEM_MAX=10, + NET_CORE_HOT_LIST_LENGTH=11 }; /* /proc/sys/net/ethernet */ diff --git a/include/linux/sysv_fs.h b/include/linux/sysv_fs.h index 5168218e0..4f65ba7dd 100644 --- a/include/linux/sysv_fs.h +++ b/include/linux/sysv_fs.h @@ -384,7 +384,6 @@ extern int sysv_new_block(struct super_block * sb); extern void sysv_free_block(struct super_block * sb, unsigned int block); extern unsigned long sysv_count_free_blocks(struct super_block *sb); -extern int sysv_get_block(struct inode *, long, struct buffer_head *, int); extern struct buffer_head * sysv_file_bread(struct inode *, int, int); extern void sysv_truncate(struct inode *); @@ -394,9 +393,8 @@ extern int sysv_sync_inode(struct inode *); extern int sysv_sync_file(struct file *, struct dentry *); extern struct inode_operations sysv_file_inode_operations; -extern struct inode_operations sysv_file_inode_operations_with_bmap; extern struct inode_operations sysv_dir_inode_operations; -extern struct inode_operations sysv_symlink_inode_operations; +extern struct address_space_operations sysv_aops; #endif /* __KERNEL__ */ diff --git a/include/linux/timer.h b/include/linux/timer.h index 796749fdb..d159222b7 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h @@ -51,6 +51,7 @@ struct timer_list { unsigned long expires; unsigned long data; void (*function)(unsigned long); + volatile int running; }; extern void add_timer(struct timer_list * timer); @@ -61,7 +62,7 @@ extern int del_timer(struct timer_list * timer); * active timer (if the timer is inactive it will be activated) * mod_timer(a,b) is equivalent to del_timer(a); a->expires = b; add_timer(a) */ -void mod_timer(struct timer_list *timer, unsigned long expires); +int mod_timer(struct timer_list *timer, unsigned long expires); extern void it_real_fn(unsigned long); @@ -69,6 +70,9 @@ extern inline void init_timer(struct timer_list * timer) { timer->next = NULL; timer->prev = NULL; +#ifdef __SMP__ + timer->running = 0; +#endif } extern inline int timer_pending(const struct timer_list * timer) @@ -76,6 +80,20 @@ extern inline int timer_pending(const struct timer_list * timer) return timer->prev != NULL; } +#ifdef __SMP__ +#define timer_exit(t) do { (t)->running = 0; mb(); } while (0) +#define timer_set_running(t) do { (t)->running = 1; mb(); } while (0) +#define timer_is_running(t) ((t)->running != 0) +#define timer_synchronize(t) while (timer_is_running(t)) barrier() +extern int del_timer_sync(struct timer_list * timer); +#else +#define timer_exit(t) do { } while (0) +#define timer_set_running(t) do { } while (0) +#define timer_is_running(t) (0) +#define timer_synchronize(t) barrier() +#define del_timer_sync(t) del_timer(t) +#endif + /* * These inlines deal with timer wrapping correctly. You are * strongly encouraged to use them diff --git a/include/linux/tqueue.h b/include/linux/tqueue.h index b02f07665..934850f26 100644 --- a/include/linux/tqueue.h +++ b/include/linux/tqueue.h @@ -116,7 +116,8 @@ extern __inline__ void run_task_queue(task_queue *list) p = p -> next; mb(); save_p -> sync = 0; - (*f)(arg); + if (f) + (*f)(arg); } } } diff --git a/include/linux/udf_167.h b/include/linux/udf_167.h index ee09bd9ad..19b3aa8e2 100644 --- a/include/linux/udf_167.h +++ b/include/linux/udf_167.h @@ -390,10 +390,13 @@ struct LogicalVolIntegrityDesc { #define INTEGRITY_TYPE_CLOSE 1 /* Recorded Address (ECMA 167 4/7.1) */ +#ifndef _LINUX_UDF_FS_I_H +/* Declared in udf_fs_i.h */ typedef struct { Uint32 logicalBlockNum; Uint16 partitionReferenceNum; } lb_addr; +#endif /* Extent interpretation (ECMA 167 4/14.14.1.1) */ #define EXTENT_RECORDED_ALLOCATED 0x00 diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h index b650d7897..83a6a69e7 100644 --- a/include/linux/ufs_fs.h +++ b/include/linux/ufs_fs.h @@ -525,6 +525,8 @@ extern int ufs_check_dir_entry (const char *, struct inode *, struct ufs_dir_ent extern struct inode_operations ufs_file_inode_operations; extern struct file_operations ufs_file_operations; +extern struct address_space_operations ufs_aops; + /* ialloc.c */ extern void ufs_free_inode (struct inode *inode); extern struct inode * ufs_new_inode (const struct inode *, int, int *); @@ -538,7 +540,6 @@ 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, struct buffer_head *, int); extern struct buffer_head * ufs_bread (struct inode *, unsigned, int, int *); /* namei.c */ @@ -562,7 +563,6 @@ extern int init_ufs_fs(void); extern void ufs_write_super (struct super_block *); /* symlink.c */ -extern struct inode_operations ufs_symlink_inode_operations; extern struct inode_operations ufs_fast_symlink_inode_operations; /* truncate.c */ diff --git a/include/linux/umsdos_fs.h b/include/linux/umsdos_fs.h index 56ebe78aa..1e7a0bead 100644 --- a/include/linux/umsdos_fs.h +++ b/include/linux/umsdos_fs.h @@ -174,7 +174,6 @@ struct umsdos_ioctl { #endif extern struct inode_operations umsdos_dir_inode_operations; -extern struct inode_operations umsdos_symlink_inode_operations; extern int init_umsdos_fs (void); #include <linux/umsdos_fs.p> diff --git a/include/linux/vt_buffer.h b/include/linux/vt_buffer.h index ca1ec519d..626b2524d 100644 --- a/include/linux/vt_buffer.h +++ b/include/linux/vt_buffer.h @@ -15,7 +15,7 @@ #include <linux/config.h> -#ifdef CONFIG_VGA_CONSOLE +#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_MDA_CONSOLE) #include <asm/vga.h> #endif |