diff options
Diffstat (limited to 'include/linux')
40 files changed, 284 insertions, 468 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 4fce3f847..f5bfb4eac 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -82,13 +82,11 @@ typedef int acpi_dstate_t; /* PM_TMR masks */ #define ACPI_TMR_VAL_EXT 0x00000100 #define ACPI_TMR_MASK 0x00ffffff -#define ACPI_TMR_HZ 3580000 /* 3.58 MHz */ +#define ACPI_TMR_HZ 3579545 /* 3.58 MHz */ +#define ACPI_TMR_KHZ (ACPI_TMR_HZ / 1000) -/* strangess to avoid integer overflow */ #define ACPI_MICROSEC_TO_TMR_TICKS(val) \ - (((val) * (ACPI_TMR_HZ / 10000)) / 100) -#define ACPI_TMR_TICKS_TO_MICROSEC(ticks) \ - (((ticks) * 100) / (ACPI_TMR_HZ / 10000)) + (((val) * (ACPI_TMR_KHZ)) / 1000) /* PM2_CNT flags */ #define ACPI_ARB_DIS 0x01 @@ -147,6 +145,9 @@ enum ACPI_C1_TIME, ACPI_C2_TIME, ACPI_C3_TIME, + ACPI_C1_COUNT, + ACPI_C2_COUNT, + ACPI_C3_COUNT, ACPI_S0_SLP_TYP, ACPI_S1_SLP_TYP, ACPI_S5_SLP_TYP, diff --git a/include/linux/agp_backend.h b/include/linux/agp_backend.h index a9d0af58a..221be1c68 100644 --- a/include/linux/agp_backend.h +++ b/include/linux/agp_backend.h @@ -59,6 +59,12 @@ enum chipset_type { AMD_GENERIC, AMD_IRONGATE, ALI_M1541, + ALI_M1621, + ALI_M1631, + ALI_M1632, + ALI_M1641, + ALI_M1647, + ALI_M1651, ALI_GENERIC }; diff --git a/include/linux/coda_linux.h b/include/linux/coda_linux.h index f5e795919..de20ba7c3 100644 --- a/include/linux/coda_linux.h +++ b/include/linux/coda_linux.h @@ -17,7 +17,7 @@ #include <linux/sched.h> #include <linux/mm.h> #include <linux/vmalloc.h> -#include <linux/malloc.h> +#include <linux/slab.h> #include <linux/wait.h> #include <linux/types.h> #include <linux/fs.h> diff --git a/include/linux/dasd.h b/include/linux/dasd.h deleted file mode 100644 index 98c3c0424..000000000 --- a/include/linux/dasd.h +++ /dev/null @@ -1,225 +0,0 @@ - -#ifndef DASD_H -#define DASD_H - -/* First of all the external stuff */ -#include <linux/ioctl.h> -#include <linux/major.h> -#include <linux/wait.h> - -#define IOCTL_LETTER 'D' -#define BIODASDFORMAT _IO(IOCTL_LETTER,0) /* Format the volume or an extent */ -#define BIODASDDISABLE _IO(IOCTL_LETTER,1) /* Disable the volume (for Linux) */ -#define BIODASDENABLE _IO(IOCTL_LETTER,2) /* Enable the volume (for Linux) */ -/* Stuff for reading and writing the Label-Area to/from user space */ -#define BIODASDGTVLBL _IOR(IOCTL_LETTER,3,dasd_volume_label_t) -#define BIODASDSTVLBL _IOW(IOCTL_LETTER,4,dasd_volume_label_t) -#define BIODASDRWTB _IOWR(IOCTL_LETTER,5,int) -#define BIODASDRSID _IOR(IOCTL_LETTER,6,senseid_t) - -typedef -union { - char bytes[512]; - struct { - /* 80 Bytes of Label data */ - char identifier[4]; /* e.g. "LNX1", "VOL1" or "CMS1" */ - char label[6]; /* Given by user */ - char security; - char vtoc[5]; /* Null in "LNX1"-labelled partitions */ - char reserved0[5]; - long ci_size; - long blk_per_ci; - long lab_per_ci; - char reserved1[4]; - char owner[0xe]; - char no_part; - char reserved2[0x1c]; - /* 16 Byte of some information on the dasd */ - short blocksize; - char nopart; - char unused; - long unused2[3]; - /* 7*10 = 70 Bytes of partition data */ - struct { - char type; - long start; - long size; - char unused; - } part[7]; - } __attribute__ ((packed)) label; -} dasd_volume_label_t; - -typedef union { - struct { - unsigned long no; - unsigned int ct; - } __attribute__ ((packed)) input; - struct { - unsigned long noct; - } __attribute__ ((packed)) output; -} __attribute__ ((packed)) dasd_xlate_t; - -int dasd_init (void); -#ifdef MODULE -int init_module (void); -void cleanup_module (void); -#endif /* MODULE */ - -/* Definitions for blk.h */ -/* #define DASD_MAGIC 0x44415344 is ascii-"DASD" */ -/* #define dasd_MAGIC 0x64617364; is ascii-"dasd" */ -#define DASD_MAGIC 0xC4C1E2C4 /* is ebcdic-"DASD" */ -#define dasd_MAGIC 0x8481A284 /* is ebcdic-"dasd" */ -#define DASD_NAME "dasd" -#define DASD_PARTN_BITS 2 -#define DASD_MAX_DEVICES (256>>DASD_PARTN_BITS) - -#define MAJOR_NR DASD_MAJOR -#define PARTN_BITS DASD_PARTN_BITS - -#ifdef __KERNEL__ -/* Now lets turn to the internal sbtuff */ -/* - define the debug levels: - - 0 No debugging output to console or syslog - - 1 Log internal errors to syslog, ignore check conditions - - 2 Log internal errors and check conditions to syslog - - 3 Log internal errors to console, log check conditions to syslog - - 4 Log internal errors and check conditions to console - - 5 panic on internal errors, log check conditions to console - - 6 panic on both, internal errors and check conditions - */ -#define DASD_DEBUG 4 - -#define DASD_PROFILE -/* - define the level of paranoia - - 0 quite sure, that things are going right - - 1 sanity checking, only to avoid panics - - 2 normal sanity checking - - 3 extensive sanity checks - - 4 exhaustive debug messages - */ -#define DASD_PARANOIA 2 - -/* - define the depth of flow control, which is logged as a check condition - - 0 No flow control messages - - 1 Entry of functions logged like check condition - - 2 Entry and exit of functions logged like check conditions - - 3 Internal structure broken down - - 4 unrolling of loops,... - */ -#define DASD_FLOW_CONTROL 0 - -#if DASD_DEBUG > 0 -#define PRINT_DEBUG(x...) printk ( KERN_DEBUG PRINTK_HEADER x ) -#define PRINT_INFO(x...) printk ( KERN_INFO PRINTK_HEADER x ) -#define PRINT_WARN(x...) printk ( KERN_WARNING PRINTK_HEADER x ) -#define PRINT_ERR(x...) printk ( KERN_ERR PRINTK_HEADER x ) -#define PRINT_FATAL(x...) panic ( PRINTK_HEADER x ) -#else -#define PRINT_DEBUG(x...) printk ( KERN_DEBUG PRINTK_HEADER x ) -#define PRINT_INFO(x...) printk ( KERN_DEBUG PRINTK_HEADER x ) -#define PRINT_WARN(x...) printk ( KERN_DEBUG PRINTK_HEADER x ) -#define PRINT_ERR(x...) printk ( KERN_DEBUG PRINTK_HEADER x ) -#define PRINT_FATAL(x...) printk ( KERN_DEBUG PRINTK_HEADER x ) -#endif /* DASD_DEBUG */ - -#define INTERNAL_ERRMSG(x,y...) \ -"Internal error: in file " __FILE__ " line: %d: " x, __LINE__, y -#define INTERNAL_CHKMSG(x,y...) \ -"Inconsistency: in file " __FILE__ " line: %d: " x, __LINE__, y -#define INTERNAL_FLWMSG(x,y...) \ -"Flow control: file " __FILE__ " line: %d: " x, __LINE__, y - -#if DASD_DEBUG > 4 -#define INTERNAL_ERROR(x...) PRINT_FATAL ( INTERNAL_ERRMSG ( x ) ) -#elif DASD_DEBUG > 2 -#define INTERNAL_ERROR(x...) PRINT_ERR ( INTERNAL_ERRMSG ( x ) ) -#elif DASD_DEBUG > 0 -#define INTERNAL_ERROR(x...) PRINT_WARN ( INTERNAL_ERRMSG ( x ) ) -#else -#define INTERNAL_ERROR(x...) -#endif /* DASD_DEBUG */ - -#if DASD_DEBUG > 5 -#define INTERNAL_CHECK(x...) PRINT_FATAL ( INTERNAL_CHKMSG ( x ) ) -#elif DASD_DEBUG > 3 -#define INTERNAL_CHECK(x...) PRINT_ERR ( INTERNAL_CHKMSG ( x ) ) -#elif DASD_DEBUG > 1 -#define INTERNAL_CHECK(x...) PRINT_WARN ( INTERNAL_CHKMSG ( x ) ) -#else -#define INTERNAL_CHECK(x...) -#endif /* DASD_DEBUG */ - -#if DASD_DEBUG > 3 -#define INTERNAL_FLOW(x...) PRINT_ERR ( INTERNAL_FLWMSG ( x ) ) -#elif DASD_DEBUG > 2 -#define INTERNAL_FLOW(x...) PRINT_WARN ( INTERNAL_FLWMSG ( x ) ) -#else -#define INTERNAL_FLOW(x...) -#endif /* DASD_DEBUG */ - -#if DASD_FLOW_CONTROL > 0 -#define FUNCTION_ENTRY(x) INTERNAL_FLOW( x "entered %s\n","" ); -#else -#define FUNCTION_ENTRY(x) -#endif /* DASD_FLOW_CONTROL */ - -#if DASD_FLOW_CONTROL > 1 -#define FUNCTION_EXIT(x) INTERNAL_FLOW( x "exited %s\n","" ); -#else -#define FUNCTION_EXIT(x) -#endif /* DASD_FLOW_CONTROL */ - -#if DASD_FLOW_CONTROL > 2 -#define FUNCTION_CONTROL(x...) INTERNAL_FLOW( x ); -#else -#define FUNCTION_CONTROL(x...) -#endif /* DASD_FLOW_CONTROL */ - -#if DASD_FLOW_CONTROL > 3 -#define LOOP_CONTROL(x...) INTERNAL_FLOW( x ); -#else -#define LOOP_CONTROL(x...) -#endif /* DASD_FLOW_CONTROL */ - -#define DASD_DO_IO_SLEEP 0x01 -#define DASD_DO_IO_NOLOCK 0x02 -#define DASD_DO_IO_NODEC 0x04 - -#define DASD_NOT_FORMATTED 0x01 - -extern wait_queue_head_t dasd_waitq; - -#undef DEBUG_DASD_MALLOC -#ifdef DEBUG_DASD_MALLOC -void *b; -#define kmalloc(x...) (PRINT_INFO(" kmalloc %p\n",b=kmalloc(x)),b) -#define kfree(x) PRINT_INFO(" kfree %p\n",x);kfree(x) -#define get_free_page(x...) (PRINT_INFO(" gfp %p\n",b=get_free_page(x)),b) -#define __get_free_pages(x...) (PRINT_INFO(" gfps %p\n",b=__get_free_pages(x)),b) -#endif /* DEBUG_DASD_MALLOC */ - -#endif /* __KERNEL__ */ -#endif /* DASD_H */ - -/* - * Overrides for Emacs so that we follow Linus's tabbing style. - * Emacs will notice this stuff at the end of the file and automatically - * adjust the settings for this buffer only. This must remain at the end - * of the file. - * --------------------------------------------------------------------------- - * Local variables: - * c-indent-level: 4 - * c-brace-imaginary-offset: 0 - * c-brace-offset: -4 - * c-argdecl-indent: 4 - * c-label-offset: -4 - * c-continued-statement-offset: 4 - * c-continued-brace-offset: 0 - * indent-tabs-mode: nil - * tab-width: 8 - * End: - */ diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 0d6f9ac13..74f377c06 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -27,21 +27,28 @@ struct qstr { unsigned int hash; }; +struct dentry_stat_t { + int nr_dentry; + int nr_unused; + int age_limit; /* age in seconds */ + int want_pages; /* pages requested by system */ + int dummy[2]; +}; +extern struct dentry_stat_t dentry_stat; + /* Name hashing routines. Initial hash value */ +/* Hash courtesy of the R5 hash in reiserfs modulo sign bits */ #define init_name_hash() 0 /* partial hash update function. Assume roughly 4 bits per character */ static __inline__ unsigned long partial_name_hash(unsigned long c, unsigned long prevhash) { - prevhash = (prevhash << 4) | (prevhash >> (8*sizeof(unsigned long)-4)); - return prevhash ^ c; + return (prevhash + (c << 4) + (c >> 4)) * 11; } /* Finally: cut down the number of bits to a int value (and try to avoid losing bits) */ static __inline__ unsigned long end_name_hash(unsigned long hash) { - if (sizeof(hash) > sizeof(unsigned int)) - hash += hash >> 4*sizeof(hash); return (unsigned int) hash; } diff --git a/include/linux/elevator.h b/include/linux/elevator.h index 9e9b27dfa..1a8bb5c39 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h @@ -1,14 +1,12 @@ #ifndef _LINUX_ELEVATOR_H #define _LINUX_ELEVATOR_H -#define ELEVATOR_DEBUG - typedef void (elevator_fn) (struct request *, elevator_t *, struct list_head *, struct list_head *, int); typedef int (elevator_merge_fn) (request_queue_t *, struct request **, struct list_head *, - struct buffer_head *, int, int, int); + struct buffer_head *, int, int); typedef void (elevator_merge_cleanup_fn) (request_queue_t *, struct request *, int); @@ -26,11 +24,11 @@ struct elevator_s unsigned int queue_ID; }; -int elevator_noop_merge(request_queue_t *, struct request **, struct list_head *, struct buffer_head *, int, int, int); +int elevator_noop_merge(request_queue_t *, struct request **, struct list_head *, struct buffer_head *, int, int); void elevator_noop_merge_cleanup(request_queue_t *, struct request *, int); void elevator_noop_merge_req(struct request *, struct request *); -int elevator_linus_merge(request_queue_t *, struct request **, struct list_head *, struct buffer_head *, int, int, int); +int elevator_linus_merge(request_queue_t *, struct request **, struct list_head *, struct buffer_head *, int, int); void elevator_linus_merge_cleanup(request_queue_t *, struct request *, int); void elevator_linus_merge_req(struct request *, struct request *); @@ -68,8 +66,9 @@ extern void elevator_init(elevator_t *, elevator_t); (s1)->rq_dev < (s2)->rq_dev) #define BHRQ_IN_ORDER(bh, rq) \ - (((bh)->b_rdev == (rq)->rq_dev && \ - (bh)->b_rsector < (rq)->sector)) + ((((bh)->b_rdev == (rq)->rq_dev && \ + (bh)->b_rsector < (rq)->sector)) || \ + (bh)->b_rdev < (rq)->rq_dev) static inline int elevator_request_latency(elevator_t * elevator, int rw) { diff --git a/include/linux/elf.h b/include/linux/elf.h index 3fe04c45e..34d8e93ae 100644 --- a/include/linux/elf.h +++ b/include/linux/elf.h @@ -74,6 +74,8 @@ typedef __u64 Elf64_Word; #define EM_X8664 62 /* AMD x86-64 */ +#define EM_CRIS 76 /* Axis Communications 32-bit embedded processor */ + /* * This is an interim value that we will use until the committee comes * up with a final number. diff --git a/include/linux/fs.h b/include/linux/fs.h index 686aef31a..a5f4cddaf 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -53,6 +53,14 @@ struct files_stat_struct { int max_files; /* tunable */ }; extern struct files_stat_struct files_stat; + +struct inodes_stat_t { + int nr_inodes; + int nr_unused; + int dummy[5]; +}; +extern struct inodes_stat_t inodes_stat; + extern int max_super_blocks, nr_super_blocks; extern int leases_enable, dir_notify_enable, lease_break_time; diff --git a/include/linux/hfs_fs.h b/include/linux/hfs_fs.h index 0f619399e..05de50628 100644 --- a/include/linux/hfs_fs.h +++ b/include/linux/hfs_fs.h @@ -2,7 +2,7 @@ * linux/include/linux/hfs_fs.h * * Copyright (C) 1995-1997 Paul H. Hargrove - * This file may be distributed under the terms of the GNU Public License. + * This file may be distributed under the terms of the GNU General Public License. * * The source code distribution of the Columbia AppleTalk Package for * UNIX, version 6.0, (CAP) was used as a specification of the diff --git a/include/linux/hfs_fs_i.h b/include/linux/hfs_fs_i.h index 4416d7837..8ae2ef99c 100644 --- a/include/linux/hfs_fs_i.h +++ b/include/linux/hfs_fs_i.h @@ -2,7 +2,7 @@ * linux/include/linux/hfs_fs_i.h * * Copyright (C) 1995, 1996 Paul H. Hargrove - * This file may be distributed under the terms of the GNU Public License. + * This file may be distributed under the terms of the GNU General Public License. * * This file defines the type (struct hfs_inode_info) and the two * subordinate types hfs_extent and hfs_file. diff --git a/include/linux/hfs_fs_sb.h b/include/linux/hfs_fs_sb.h index 826f388c5..037ebd428 100644 --- a/include/linux/hfs_fs_sb.h +++ b/include/linux/hfs_fs_sb.h @@ -2,7 +2,7 @@ * linux/include/linux/hfs_fs_sb.h * * Copyright (C) 1995-1997 Paul H. Hargrove - * This file may be distributed under the terms of the GNU Public License. + * This file may be distributed under the terms of the GNU General Public License. * * This file defines the type (struct hfs_sb_info) which contains the * HFS-specific information in the in-core superblock. diff --git a/include/linux/hfs_sysdep.h b/include/linux/hfs_sysdep.h index cefce233d..fa98ce32a 100644 --- a/include/linux/hfs_sysdep.h +++ b/include/linux/hfs_sysdep.h @@ -2,7 +2,7 @@ * linux/include/linux/hfs_sysdep.h * * Copyright (C) 1996-1997 Paul H. Hargrove - * This file may be distributed under the terms of the GNU Public License. + * This file may be distributed under the terms of the GNU General Public License. * * This file contains constants, types and inline * functions for various system dependent things. @@ -17,7 +17,7 @@ #ifndef _HFS_SYSDEP_H #define _HFS_SYSDEP_H -#include <linux/malloc.h> +#include <linux/slab.h> #include <linux/types.h> #include <linux/locks.h> #include <linux/fs.h> diff --git a/include/linux/highmem.h b/include/linux/highmem.h index eb5405d33..de8eea018 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h @@ -38,7 +38,7 @@ static inline void *kmap(struct page *page) { return page_address(page); } #define kunmap_atomic(page,idx) kunmap(page) #define bh_kmap(bh) ((bh)->b_data) -#define bh_kunmap(bh) do { } while (0); +#define bh_kunmap(bh) do { } while (0) #endif /* CONFIG_HIGHMEM */ diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 9d214fadc..cba5d1601 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -146,7 +146,7 @@ extern struct tasklet_head tasklet_hi_vec[NR_CPUS]; #ifdef CONFIG_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_wait(t) while (test_bit(TASKLET_STATE_RUN, &(t)->state)) { barrier(); } #define tasklet_unlock(t) clear_bit(TASKLET_STATE_RUN, &(t)->state) #else #define tasklet_trylock(t) 1 diff --git a/include/linux/isdn.h b/include/linux/isdn.h index 23cf7ed73..8397578f6 100644 --- a/include/linux/isdn.h +++ b/include/linux/isdn.h @@ -1,4 +1,4 @@ -/* $Id: isdn.h,v 1.111 2000/11/25 17:01:02 kai Exp $ +/* $Id: isdn.h,v 1.111.6.1 2001/02/07 11:31:31 kai Exp $ * Main header for the Linux ISDN subsystem (linklevel). * @@ -196,7 +196,7 @@ typedef struct { #include <asm/io.h> #include <linux/kernel.h> #include <linux/signal.h> -#include <linux/malloc.h> +#include <linux/slab.h> #include <linux/timer.h> #include <linux/wait.h> #include <linux/tty.h> @@ -592,23 +592,6 @@ typedef struct { char *private; } infostruct; -typedef struct isdn_module { - struct isdn_module *prev; - struct isdn_module *next; - char *name; - int (*get_free_channel)(int, int, int, int, int); - int (*free_channel)(int, int, int); - int (*status_callback)(isdn_ctrl *); - int (*command)(isdn_ctrl *); - int (*receive_callback)(int, int, struct sk_buff *); - int (*writebuf_skb)(int, int, int, struct sk_buff *); - int (*net_start_xmit)(struct sk_buff *, struct net_device *); - int (*net_receive)(struct net_device *, struct sk_buff *); - int (*net_open)(struct net_device *); - int (*net_close)(struct net_device *); - int priority; -} isdn_module; - #define DRV_FLAG_RUNNING 1 #define DRV_FLAG_REJBUS 2 #define DRV_FLAG_LOADED 4 @@ -668,7 +651,6 @@ typedef struct isdn_devt { atomic_t v110use[ISDN_MAX_CHANNELS];/* Usage-Semaphore for stream */ isdn_v110_stream *v110[ISDN_MAX_CHANNELS]; /* V.110 private data */ struct semaphore sem; /* serialize list access*/ - isdn_module *modules; unsigned long global_features; #ifdef CONFIG_DEVFS_FS devfs_handle_t devfs_handle_isdninfo; diff --git a/include/linux/kdev_t.h b/include/linux/kdev_t.h index aeee1fbee..7ef189ef0 100644 --- a/include/linux/kdev_t.h +++ b/include/linux/kdev_t.h @@ -1,6 +1,6 @@ #ifndef _LINUX_KDEV_T_H #define _LINUX_KDEV_T_H -#ifdef __KERNEL__ +#if defined(__KERNEL__) || defined(_LVM_H_INCLUDE) /* As a preparation for the introduction of larger device numbers, we introduce a type kdev_t to hold them. No information about @@ -101,7 +101,7 @@ static inline kdev_t to_kdev_t(int dev) return MKDEV(major, minor); } -#else /* __KERNEL__ */ +#else /* __KERNEL__ || _LVM_H_INCLUDE */ /* Some programs want their definitions of MAJOR and MINOR and MKDEV @@ -110,5 +110,5 @@ from the kernel sources. These must be the externally visible ones. #define MAJOR(dev) ((dev)>>8) #define MINOR(dev) ((dev) & 0xff) #define MKDEV(ma,mi) ((ma)<<8 | (mi)) -#endif /* __KERNEL__ */ +#endif /* __KERNEL__ || _LVM_H_INCLUDE */ #endif diff --git a/include/linux/kernelcapi.h b/include/linux/kernelcapi.h index 2677f9646..5bdcd805e 100644 --- a/include/linux/kernelcapi.h +++ b/include/linux/kernelcapi.h @@ -1,5 +1,5 @@ /* - * $Id: kernelcapi.h,v 1.8.6.1 2000/11/28 09:36:56 kai Exp $ + * $Id: kernelcapi.h,v 1.8.6.2 2001/02/07 11:31:31 kai Exp $ * * Kernel CAPI 2.0 Interface for Linux * @@ -10,8 +10,8 @@ #ifndef __KERNELCAPI_H__ #define __KERNELCAPI_H__ -#define CAPI_MAXAPPL 20 /* maximum number of applications */ -#define CAPI_MAXCONTR 10 /* maximum number of controller */ +#define CAPI_MAXAPPL 128 /* maximum number of applications */ +#define CAPI_MAXCONTR 16 /* maximum number of controller */ #define CAPI_MAXDATAWINDOW 8 diff --git a/include/linux/list.h b/include/linux/list.h index ed38faa21..48fea84b4 100644 --- a/include/linux/list.h +++ b/include/linux/list.h @@ -1,7 +1,7 @@ #ifndef _LINUX_LIST_H #define _LINUX_LIST_H -#ifdef __KERNEL__ +#if defined(__KERNEL__) || defined(_LVM_H_INCLUDE) /* * Simple doubly linked list implementation. @@ -149,6 +149,6 @@ static __inline__ void list_splice(struct list_head *list, struct list_head *hea #define list_for_each(pos, head) \ for (pos = (head)->next; pos != (head); pos = pos->next) -#endif /* __KERNEL__ */ +#endif /* __KERNEL__ || _LVM_H_INCLUDE */ #endif diff --git a/include/linux/lvm.h b/include/linux/lvm.h index 4e95eb73d..e1e701a91 100644 --- a/include/linux/lvm.h +++ b/include/linux/lvm.h @@ -95,15 +95,8 @@ */ #endif /* #ifdef __KERNEL__ */ -#ifndef __KERNEL__ -#define __KERNEL__ #include <linux/kdev_t.h> #include <linux/list.h> -#undef __KERNEL__ -#else -#include <linux/kdev_t.h> -#include <linux/list.h> -#endif /* #ifndef __KERNEL__ */ #include <asm/types.h> #include <linux/major.h> diff --git a/include/linux/mm.h b/include/linux/mm.h index 713b01316..f6c7cc6e2 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -200,8 +200,8 @@ static inline void set_page_dirty(struct page * page) smp_mb__before_clear_bit(); \ if (!test_and_clear_bit(PG_locked, &(page)->flags)) BUG(); \ smp_mb__after_clear_bit(); \ - if (waitqueue_active(&page->wait)) \ - wake_up(&page->wait); \ + if (waitqueue_active(&(page)->wait)) \ + wake_up(&(page)->wait); \ } while (0) #define PageError(page) test_bit(PG_error, &(page)->flags) #define SetPageError(page) set_bit(PG_error, &(page)->flags) diff --git a/include/linux/module.h b/include/linux/module.h index 7f416d7fb..afa2e66f0 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -249,12 +249,6 @@ static const struct gtype##_id * __module_##gtype##_table \ __attribute__ ((unused)) = name #define MODULE_DEVICE_TABLE(type,name) \ MODULE_GENERIC_TABLE(type##_device,name) -/* not put to .modinfo section to avoid section type conflicts */ - -/* The attributes of a section are set the first time the section is - seen; we want .modinfo to not be allocated. */ - -__asm__(".section .modinfo\n\t.previous"); /* Define the module variable, and usage macros. */ extern struct module __this_module; diff --git a/include/linux/mtd/ftl.h b/include/linux/mtd/ftl.h index 4fc425262..2745605c0 100644 --- a/include/linux/mtd/ftl.h +++ b/include/linux/mtd/ftl.h @@ -16,7 +16,7 @@ * are Copyright (C) 1999 David A. Hinds. All Rights Reserved. * * Alternatively, the contents of this file may be used under the - * terms of the GNU Public License version 2 (the "GPL"), in which + * terms of the GNU General Public License version 2 (the "GPL"), in which * case the provisions of the GPL are applicable instead of the * above. If you wish to allow the use of your version of this file * only under the terms of the GPL and not to allow others to use diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h index f7f8ad01f..71fc46b1a 100644 --- a/include/linux/mtd/map.h +++ b/include/linux/mtd/map.h @@ -1,6 +1,6 @@ /* Overhauled routines for dealing with different mmap regions of flash */ -/* $Id: map.h,v 1.10 2000/12/04 13:18:33 dwmw2 Exp $ */ +/* $Id: map.h,v 1.10.2.2 2001/01/09 00:44:51 dwmw2 Exp $ */ #ifndef __LINUX_MTD_MAP_H__ #define __LINUX_MTD_MAP_H__ @@ -8,7 +8,7 @@ #include <linux/config.h> #include <linux/types.h> #include <linux/mtd/mtd.h> -#include <linux/malloc.h> +#include <linux/slab.h> /* The map stuff is very simple. You fill in your struct map_info with a handful of routines for accessing the device, making sure they handle @@ -44,7 +44,7 @@ struct map_info { void (*write32)(struct map_info *, __u32, unsigned long); void (*copy_to)(struct map_info *, unsigned long, const void *, ssize_t); - void (*set_vpp)(int); + void (*set_vpp)(struct map_info *, int); /* We put these two here rather than a single void *map_priv, because we want mappers to be able to have quickly-accessible cache for the 'currently-mapped page' without the _extra_ @@ -108,7 +108,7 @@ static inline void map_destroy(struct mtd_info *mtd) kfree(mtd); } -#define ENABLE_VPP(map) do { if(map->set_vpp) map->set_vpp(1); } while(0) -#define DISABLE_VPP(map) do { if(map->set_vpp) map->set_vpp(0); } while(0) +#define ENABLE_VPP(map) do { if(map->set_vpp) map->set_vpp(map, 1); } while(0) +#define DISABLE_VPP(map) do { if(map->set_vpp) map->set_vpp(map, 0); } while(0) #endif /* __LINUX_MTD_MAP_H__ */ diff --git a/include/linux/ncp_fs.h b/include/linux/ncp_fs.h index 7d67f410b..919fc654a 100644 --- a/include/linux/ncp_fs.h +++ b/include/linux/ncp_fs.h @@ -196,7 +196,7 @@ struct ncp_entry_info { #ifdef DEBUG_NCP_MALLOC -#include <linux/malloc.h> +#include <linux/slab.h> extern int ncp_malloced; extern int ncp_current_malloced; diff --git a/include/linux/nubus.h b/include/linux/nubus.h index 5f46ddd93..adf59d870 100644 --- a/include/linux/nubus.h +++ b/include/linux/nubus.h @@ -319,4 +319,4 @@ extern inline void *nubus_slot_addr(int slot) return (void *)(0xF0000000|(slot<<24)); } -#endif LINUX_NUBUS_H +#endif /* LINUX_NUBUS_H */ diff --git a/include/linux/parport.h b/include/linux/parport.h index 71fc1398b..8f0cd76ce 100644 --- a/include/linux/parport.h +++ b/include/linux/parport.h @@ -229,7 +229,7 @@ struct pardevice { unsigned long int time; unsigned long int timeslice; volatile long int timeout; - unsigned int waiting; + unsigned long waiting; /* long req'd for set_bit --RR */ struct pardevice *waitprev; struct pardevice *waitnext; void * sysctl_table; diff --git a/include/linux/pci.h b/include/linux/pci.h index a78410716..205abe61e 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -565,9 +565,9 @@ static inline int pcibios_find_class (unsigned int class_code, unsigned short in { return PCIBIOS_DEVICE_NOT_FOUND; } #define _PCI_NOP(o,s,t) \ - static inline int pcibios_##o##_config_##s## (u8 bus, u8 dfn, u8 where, t val) \ + static inline int pcibios_##o##_config_##s (u8 bus, u8 dfn, u8 where, t val) \ { return PCIBIOS_FUNC_NOT_SUPPORTED; } \ - static inline int pci_##o##_config_##s## (struct pci_dev *dev, int where, t val) \ + static inline int pci_##o##_config_##s (struct pci_dev *dev, int where, t val) \ { return PCIBIOS_FUNC_NOT_SUPPORTED; } #define _PCI_NOP_ALL(o,x) _PCI_NOP(o,byte,u8 x) \ _PCI_NOP(o,word,u16 x) \ diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 2708be9ab..664ec0d6b 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -141,6 +141,7 @@ #define PCI_DEVICE_ID_COMPAQ_NETEL100PI 0xae43 #define PCI_DEVICE_ID_COMPAQ_NETEL100I 0xb011 #define PCI_DEVICE_ID_COMPAQ_CISS 0xb060 +#define PCI_DEVICE_ID_COMPAQ_CISSB 0xb178 #define PCI_DEVICE_ID_COMPAQ_THUNDER 0xf130 #define PCI_DEVICE_ID_COMPAQ_NETFLEX3B 0xf150 @@ -689,13 +690,23 @@ #define PCI_DEVICE_ID_CERN_HIPPI_DST 0x0021 #define PCI_DEVICE_ID_CERN_HIPPI_SRC 0x0022 -#define PCI_VENDOR_ID_NVIDIA 0x10de -#define PCI_DEVICE_ID_NVIDIA_TNT 0x0020 -#define PCI_DEVICE_ID_NVIDIA_TNT2 0x0028 -#define PCI_DEVICE_ID_NVIDIA_UTNT2 0x0029 -#define PCI_DEVICE_ID_NVIDIA_VTNT2 0x002C -#define PCI_DEVICE_ID_NVIDIA_UVTNT2 0x002D -#define PCI_DEVICE_ID_NVIDIA_ITNT2 0x00A0 +#define PCI_VENDOR_ID_NVIDIA 0x10de +#define PCI_DEVICE_ID_NVIDIA_TNT 0x0020 +#define PCI_DEVICE_ID_NVIDIA_TNT2 0x0028 +#define PCI_DEVICE_ID_NVIDIA_UTNT2 0x0029 +#define PCI_DEVICE_ID_NVIDIA_VTNT2 0x002C +#define PCI_DEVICE_ID_NVIDIA_UVTNT2 0x002D +#define PCI_DEVICE_ID_NVIDIA_ITNT2 0x00A0 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_SDR 0x0100 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE_DDR 0x0101 +#define PCI_DEVICE_ID_NVIDIA_QUADRO 0x0103 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE2_MX 0x0110 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE2_MX2 0x0111 +#define PCI_DEVICE_ID_NVIDIA_QUADRO2_MXR 0x0113 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE2_GTS 0x0150 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE2_GTS2 0x0151 +#define PCI_DEVICE_ID_NVIDIA_GEFORCE2_ULTRA 0x0152 +#define PCI_DEVICE_ID_NVIDIA_QUADRO2_PRO 0x0153 #define PCI_VENDOR_ID_IMS 0x10e0 #define PCI_DEVICE_ID_IMS_8849 0x8849 diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index da8f6b3dc..e142bb812 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h @@ -2,7 +2,7 @@ #define _LINUX_PROC_FS_H #include <linux/config.h> -#include <linux/malloc.h> +#include <linux/slab.h> /* * The proc filesystem constants/structures diff --git a/include/linux/raid/raid5.h b/include/linux/raid/raid5.h index d46dbd512..93a81473e 100644 --- a/include/linux/raid/raid5.h +++ b/include/linux/raid/raid5.h @@ -57,9 +57,9 @@ * * Buffers for the md device that arrive via make_request are attached * to the appropriate stripe in one of two lists linked on b_reqnext. - * One list for read requests, one for write. There should never be - * more than one buffer on the two lists together, but we are not - * guaranteed of that so we allow for more. + * One list (bh_read) for read requests, one (bh_write) for write. + * There should never be more than one buffer on the two lists + * together, but we are not guaranteed of that so we allow for more. * * If a buffer is on the read list when the associated cache buffer is * Uptodate, the data is copied into the read buffer and it's b_end_io @@ -70,16 +70,18 @@ * that the Uptodate bit is set. Once they have checked that they may * take buffers off the read queue. * - * When a buffer on the write_list is committed for write, it is - * marked clean, copied into the cache buffer, which is then marked - * dirty, and moved onto a third list, the written list. Once both - * the parity block and the cached buffer are successfully written, - * any buffer on a written list can be returned with b_end_io. - * - * The write_list and read_list lists act as fifos. They are protected by the - * device_lock which can be claimed when a stripe_lock is held. - * The device_lock is only for list manipulations and will only be held for a very - * short time. It can be claimed from interrupts. + * When a buffer on the write list is committed for write is it copied + * into the cache buffer, which is then marked dirty, and moved onto a + * third list, the written list (bh_written). Once both the parity + * block and the cached buffer are successfully written, any buffer on + * a written list can be returned with b_end_io. + * + * The write list and read list both act as fifos. The read list is + * protected by the device_lock. The write and written lists are + * protected by the stripe lock. The device_lock, which can be + * claimed while the stipe lock is held, is only for list + * manipulations and will only be held for a very short time. It can + * be claimed from interrupts. * * * Stripes in the stripe cache can be on one of two lists (or on diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index 277281d6d..97dbc0034 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h @@ -15,7 +15,7 @@ #include <linux/types.h> #ifdef __KERNEL__ -#include <linux/malloc.h> +#include <linux/slab.h> #include <linux/tqueue.h> #endif diff --git a/include/linux/sched.h b/include/linux/sched.h index a382b6736..68c48ae0c 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -551,7 +551,7 @@ extern long FASTCALL(sleep_on_timeout(wait_queue_head_t *q, extern void FASTCALL(interruptible_sleep_on(wait_queue_head_t *q)); extern long FASTCALL(interruptible_sleep_on_timeout(wait_queue_head_t *q, signed long timeout)); -extern void FASTCALL(wake_up_process(struct task_struct * tsk)); +extern int FASTCALL(wake_up_process(struct task_struct * tsk)); #define wake_up(x) __wake_up((x),TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, 1) #define wake_up_nr(x, nr) __wake_up((x),TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, nr) diff --git a/include/linux/serial.h b/include/linux/serial.h index 7d4178a54..b5ed862a9 100644 --- a/include/linux/serial.h +++ b/include/linux/serial.h @@ -139,8 +139,9 @@ struct serial_uart_config { #define ASYNC_CHECK_CD 0x02000000 /* i.e., CLOCAL */ #define ASYNC_SHARE_IRQ 0x01000000 /* for multifunction cards --- no longer used */ +#define ASYNC_NO_FLOW 0x00800000 /* No flow control serial console */ -#define ASYNC_INTERNAL_FLAGS 0xFF000000 /* Internal flags */ +#define ASYNC_INTERNAL_FLAGS 0xFF800000 /* Internal flags */ /* * Multiport serial configuration structure --- external structure @@ -177,5 +178,7 @@ struct serial_icounter_struct { extern int register_serial(struct serial_struct *req); extern void unregister_serial(int line); +/* Allow complicated architectures to specify rs_table[] at run time */ +extern int early_serial_setup(struct serial_struct *req); #endif /* __KERNEL__ */ #endif /* _LINUX_SERIAL_H */ diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 17e48d0e9..24404cfda 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -153,7 +153,7 @@ struct sk_buff { /* * Handling routines are only of interest to the kernel */ -#include <linux/malloc.h> +#include <linux/slab.h> #include <asm/system.h> @@ -878,29 +878,48 @@ static inline void __skb_queue_purge(struct sk_buff_head *list) } /** - * dev_alloc_skb - allocate an skbuff for sending + * __dev_alloc_skb - allocate an skbuff for sending * @length: length to allocate + * @gfp_mask: get_free_pages mask, passed to alloc_skb * * Allocate a new &sk_buff and assign it a usage count of one. The * buffer has unspecified headroom built in. Users should allocate * the headroom they think they need without accounting for the * built in space. The built in space is used for optimisations. * - * %NULL is returned in there is no free memory. Although this function - * allocates memory it can be called from an interrupt. + * %NULL is returned in there is no free memory. */ -static inline struct sk_buff *dev_alloc_skb(unsigned int length) +static inline struct sk_buff *__dev_alloc_skb(unsigned int length, + int gfp_mask) { struct sk_buff *skb; - skb = alloc_skb(length+16, GFP_ATOMIC); + skb = alloc_skb(length+16, gfp_mask); if (skb) skb_reserve(skb,16); return skb; } /** + * dev_alloc_skb - allocate an skbuff for sending + * @length: length to allocate + * + * Allocate a new &sk_buff and assign it a usage count of one. The + * buffer has unspecified headroom built in. Users should allocate + * the headroom they think they need without accounting for the + * built in space. The built in space is used for optimisations. + * + * %NULL is returned in there is no free memory. Although this function + * allocates memory it can be called from an interrupt. + */ + +static inline struct sk_buff *dev_alloc_skb(unsigned int length) +{ + return __dev_alloc_skb(length, GFP_ATOMIC); +} + +/** * skb_cow - copy a buffer if need be * @skb: buffer to copy * @headroom: needed headroom diff --git a/include/linux/smb.h b/include/linux/smb.h index 1382db0dc..9f39c09d8 100644 --- a/include/linux/smb.h +++ b/include/linux/smb.h @@ -93,14 +93,6 @@ struct smb_fattr { unsigned long f_blocks; }; -struct smb_dirent { - struct smb_fattr attr; - - int f_pos; - int len; - __u8 name[SMB_MAXNAMELEN]; -}; - enum smb_conn_state { CONN_VALID, /* everything's fine */ CONN_INVALID, /* Something went wrong, but did not @@ -120,11 +112,13 @@ enum smb_conn_state { #define SMB_HEADER_LEN 37 /* includes everything up to, but not * including smb_bcc */ -#define SMB_DEF_MAX_XMIT 32768 -#define SMB_INITIAL_PACKET_SIZE 4000 -/* Allocate max. 1 page */ -#define TRANS2_MAX_TRANSFER (4096-17) +#define SMB_INITIAL_PACKET_SIZE 4000 +#define SMB_MAX_PACKET_SIZE 32768 + +/* reserve this much space for trans2 parameters. Shouldn't have to be more + than 10 or so, but OS/2 seems happier like this. */ +#define SMB_TRANS2_MAX_PARAM 64 #endif #endif diff --git a/include/linux/smb_fs.h b/include/linux/smb_fs.h index 501ea4b96..4a811a20d 100644 --- a/include/linux/smb_fs.h +++ b/include/linux/smb_fs.h @@ -20,23 +20,31 @@ /* __kernel_uid_t can never change, so we have to use __kernel_uid32_t */ #define SMB_IOC_GETMOUNTUID32 _IOR('u', 3, __kernel_uid32_t) + #ifdef __KERNEL__ +#include <linux/pagemap.h> +#include <linux/vmalloc.h> +#include <linux/smb_mount.h> #include <asm/unaligned.h> + +/* macro names are short for word, double-word, long value (?) */ #define WVAL(buf,pos) \ -(le16_to_cpu(get_unaligned((__u16 *)((__u8 *)(buf) + (pos))))) + (le16_to_cpu(get_unaligned((u16 *)((u8 *)(buf) + (pos))))) #define DVAL(buf,pos) \ -(le32_to_cpu(get_unaligned((__u32 *)((__u8 *)(buf) + (pos))))) + (le32_to_cpu(get_unaligned((u32 *)((u8 *)(buf) + (pos))))) +#define LVAL(buf,pos) \ + (le64_to_cpu(get_unaligned((u64 *)((u8 *)(buf) + (pos))))) #define WSET(buf,pos,val) \ -put_unaligned(cpu_to_le16((__u16)(val)), (__u16 *)((__u8 *)(buf) + (pos))) + put_unaligned(cpu_to_le16((u16)(val)), (u16 *)((u8 *)(buf) + (pos))) #define DSET(buf,pos,val) \ -put_unaligned(cpu_to_le32((__u32)(val)), (__u32 *)((__u8 *)(buf) + (pos))) + put_unaligned(cpu_to_le32((u32)(val)), (u32 *)((u8 *)(buf) + (pos))) +#define LSET(buf,pos,val) \ + put_unaligned(cpu_to_le64((u64)(val)), (u64 *)((u8 *)(buf) + (pos))) /* where to find the base of the SMB packet proper */ -#define smb_base(buf) ((__u8 *)(((__u8 *)(buf))+4)) - -#include <linux/vmalloc.h> +#define smb_base(buf) ((u8 *)(((u8 *)(buf))+4)) #ifdef DEBUG_SMB_MALLOC @@ -70,7 +78,6 @@ smb_vfree(void *obj) /* * Flags for the in-memory inode */ -#define SMB_F_CACHEVALID 0x01 /* directory cache valid */ #define SMB_F_LOCALWRITE 0x02 /* file modified locally */ @@ -89,8 +96,54 @@ smb_vfree(void *obj) #define SMB_CAP_LARGE_READX 0x4000 -/* linux/fs/smbfs/mmap.c */ -int smb_mmap(struct file *, struct vm_area_struct *); +/* + * This is the time we allow an inode, dentry or dir cache to live. It is bad + * for performance to have shorter ttl on an inode than on the cache. It can + * cause refresh on each inode for a dir listing ... one-by-one + */ +#define SMB_MAX_AGE(server) (((server)->mnt->ttl * HZ) / 1000) + +static inline void +smb_age_dentry(struct smb_sb_info *server, struct dentry *dentry) +{ + dentry->d_time = jiffies - SMB_MAX_AGE(server); +} + +struct smb_cache_head { + time_t mtime; /* unused */ + unsigned long time; /* cache age */ + unsigned long end; /* last valid fpos in cache */ + int eof; +}; + +#define SMB_DIRCACHE_SIZE ((int)(PAGE_CACHE_SIZE/sizeof(struct dentry *))) +union smb_dir_cache { + struct smb_cache_head head; + struct dentry *dentry[SMB_DIRCACHE_SIZE]; +}; + +#define SMB_FIRSTCACHE_SIZE ((int)((SMB_DIRCACHE_SIZE * \ + sizeof(struct dentry *) - sizeof(struct smb_cache_head)) / \ + sizeof(struct dentry *))) + +#define SMB_DIRCACHE_START (SMB_DIRCACHE_SIZE - SMB_FIRSTCACHE_SIZE) + +struct smb_cache_control { + struct smb_cache_head head; + struct page *page; + union smb_dir_cache *cache; + unsigned long fpos, ofs; + int filled, valid, idx; +}; + +static inline int +smb_is_open(struct inode *i) +{ + return (i->u.smbfs_i.open == SMB_SERVER(i)->generation); +} + + +/* FIXME! the prototype list is probably not correct. Automate? */ /* linux/fs/smbfs/file.c */ extern struct inode_operations smb_file_inode_operations; @@ -100,6 +153,7 @@ extern struct address_space_operations smb_file_aops; /* linux/fs/smbfs/dir.c */ extern struct inode_operations smb_dir_inode_operations; extern struct file_operations smb_dir_operations; +void smb_new_dentry(struct dentry *dentry); void smb_renew_times(struct dentry *); /* linux/fs/smbfs/ioctl.c */ @@ -108,16 +162,15 @@ int smb_ioctl (struct inode *, struct file *, unsigned int, unsigned long); /* linux/fs/smbfs/inode.c */ struct super_block *smb_read_super(struct super_block *, void *, int); void smb_get_inode_attr(struct inode *, struct smb_fattr *); +void smb_set_inode_attr(struct inode *, struct smb_fattr *); void smb_invalidate_inodes(struct smb_sb_info *); int smb_revalidate_inode(struct dentry *); int smb_notify_change(struct dentry *, struct iattr *); -unsigned long smb_invent_inos(unsigned long); struct inode *smb_iget(struct super_block *, struct smb_fattr *); /* linux/fs/smbfs/proc.c */ int smb_setcodepage(struct smb_sb_info *server, struct smb_nls_codepage *cp); __u32 smb_len(unsigned char *); -__u8 *smb_encode_smb_length(__u8 *, __u32); __u8 *smb_setup_header(struct smb_sb_info *, __u8, __u16, __u16); int smb_get_rsize(struct smb_sb_info *); int smb_get_wsize(struct smb_sb_info *); @@ -133,32 +186,21 @@ int smb_proc_mv(struct dentry *, struct dentry *); int smb_proc_mkdir(struct dentry *); int smb_proc_rmdir(struct dentry *); int smb_proc_unlink(struct dentry *); -int smb_proc_readdir(struct dentry *, int, void *); +int smb_proc_readdir(struct file *filp, void *dirent, filldir_t filldir, + struct smb_cache_control *ctl); int smb_proc_getattr(struct dentry *, struct smb_fattr *); int smb_proc_setattr(struct dentry *, struct smb_fattr *); int smb_proc_settime(struct dentry *, struct smb_fattr *); int smb_proc_dskattr(struct super_block *, struct statfs *); -int smb_proc_reconnect(struct smb_sb_info *); -int smb_proc_connect(struct smb_sb_info *); int smb_proc_disconnect(struct smb_sb_info *); int smb_proc_trunc(struct smb_sb_info *, __u16, __u32); void smb_init_root_dirent(struct smb_sb_info *, struct smb_fattr *); -static inline int -smb_is_open(struct inode *i) -{ - return (i->u.smbfs_i.open == SMB_SERVER(i)->generation); -} - /* linux/fs/smbfs/sock.c */ int smb_round_length(int); int smb_valid_socket(struct inode *); void smb_close_socket(struct smb_sb_info *); -int smb_release(struct smb_sb_info *server); -int smb_connect(struct smb_sb_info *server); int smb_request(struct smb_sb_info *server); -int smb_request_read_raw(struct smb_sb_info *, unsigned char *, int); -int smb_request_write_raw(struct smb_sb_info *, unsigned const char *, int); int smb_catch_keepalive(struct smb_sb_info *server); int smb_dont_catch_keepalive(struct smb_sb_info *server); int smb_trans2_request(struct smb_sb_info *server, __u16 trans2_command, @@ -169,69 +211,14 @@ int smb_trans2_request(struct smb_sb_info *server, __u16 trans2_command, /* fs/smbfs/cache.c */ -/* - * The cache index describes the pages mapped starting - * at offset PAGE_SIZE. We keep only a minimal amount - * of information here. - */ -struct cache_index { - unsigned short num_entries; - unsigned short space; - struct cache_block * block; -}; - -#define NINDEX (PAGE_SIZE-64)/sizeof(struct cache_index) -/* - * The cache head is mapped as the page at offset 0. - */ -struct cache_head { - int valid; - int status; /* error code or 0 */ - int entries; /* total entries */ - int pages; /* number of data pages */ - int idx; /* index of current data page */ - struct cache_index index[NINDEX]; -}; - -/* - * An array of cache_entry structures holds information - * for each object in the cache_block. - */ -struct cache_entry { - ino_t ino; - unsigned short namelen; - unsigned short offset; -}; - -/* - * The cache blocks hold the actual data. The entry table grows up - * while the names grow down, and we have space until they meet. - */ -struct cache_block { - union { - struct cache_entry table[1]; - char names[PAGE_SIZE]; - } cb_data; -}; - -/* - * To return an entry, we can pass a reference to the - * name instead of having to copy it. - */ -struct cache_dirent { - ino_t ino; - unsigned long pos; - int len; - char * name; -}; +void smb_invalid_dir_cache(struct inode * dir); +void smb_invalidate_dircache_entries(struct dentry *parent); +struct dentry * smb_dget_fpos(struct dentry *dentry, struct dentry *parent, + unsigned long fpos); +int smb_fill_cache(struct file *filp, void *dirent, filldir_t filldir, + struct smb_cache_control *ctrl, struct qstr *qname, + struct smb_fattr *entry); -struct cache_head * smb_get_dircache(struct dentry *); -void smb_init_dircache(struct cache_head *); -void smb_free_dircache(struct cache_head *); -int smb_refill_dircache(struct cache_head *, struct dentry *); -void smb_add_to_cache(struct cache_head *, struct cache_dirent *, off_t); -int smb_find_in_cache(struct cache_head *, off_t, struct cache_dirent *); -void smb_invalid_dir_cache(struct inode *); #endif /* __KERNEL__ */ diff --git a/include/linux/smb_fs_i.h b/include/linux/smb_fs_i.h index 8dca9066b..e0faddbb3 100644 --- a/include/linux/smb_fs_i.h +++ b/include/linux/smb_fs_i.h @@ -26,7 +26,7 @@ struct smb_inode_info { __u16 attr; /* Attribute fields, DOS value */ __u16 access; /* Access mode */ - __u16 cache_valid; /* dircache valid? */ + __u16 flags; /* status flags */ unsigned long oldmtime; /* last time refreshed */ unsigned long closed; /* timestamp when closed */ unsigned openers; /* number of fileid users */ diff --git a/include/linux/smb_mount.h b/include/linux/smb_mount.h index ea240db51..fe65cdb6c 100644 --- a/include/linux/smb_mount.h +++ b/include/linux/smb_mount.h @@ -50,6 +50,9 @@ struct smb_mount_data_kernel { u32 flags; + /* maximum age in jiffies (inode, dentry and dircache) */ + int ttl; + struct smb_nls_codepage codepage; }; diff --git a/include/linux/telephony.h b/include/linux/telephony.h index 4e38e8ccb..01a87694c 100644 --- a/include/linux/telephony.h +++ b/include/linux/telephony.h @@ -43,6 +43,11 @@ * the telephony products they support under Linux) * *****************************************************************************/ +#define QTI_PHONEJACK 100 +#define QTI_LINEJACK 300 +#define QTI_PHONEJACK_LITE 400 +#define QTI_PHONEJACK_PCI 500 +#define QTI_PHONECARD 600 /****************************************************************************** * @@ -91,7 +96,7 @@ typedef struct { int namelen; char name[80]; } PHONE_CID; - + #define PHONE_RING _IO ('q', 0x83) #define PHONE_HOOKSTATE _IO ('q', 0x84) #define PHONE_MAXRINGS _IOW ('q', 0x85, char) diff --git a/include/linux/wait.h b/include/linux/wait.h index 6b281ccad..61cd98962 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h @@ -19,30 +19,10 @@ #include <asm/processor.h> /* - * Temporary debugging help until all code is converted to the new - * waitqueue usage. + * Debug control. Slow but useful. */ #define WAITQUEUE_DEBUG 0 -#if WAITQUEUE_DEBUG -extern int printk(const char *fmt, ...); -#define WQ_BUG() do { \ - printk("wq bug, forcing oops.\n"); \ - BUG(); \ -} while (0) - -#define CHECK_MAGIC(x) if (x != (long)&(x)) \ - { printk("bad magic %lx (should be %lx), ", (long)x, (long)&(x)); WQ_BUG(); } - -#define CHECK_MAGIC_WQHEAD(x) do { \ - if (x->__magic != (long)&(x->__magic)) { \ - printk("bad magic %lx (should be %lx, creator %lx), ", \ - x->__magic, (long)&(x->__magic), x->__creator); \ - WQ_BUG(); \ - } \ -} while (0) -#endif - struct __wait_queue { unsigned int flags; #define WQ_FLAG_EXCLUSIVE 0x01 @@ -99,24 +79,70 @@ struct __wait_queue_head { }; typedef struct __wait_queue_head wait_queue_head_t; + +/* + * Debugging macros. We eschew `do { } while (0)' because gcc can generate + * spurious .aligns. + */ +#if WAITQUEUE_DEBUG +#define WQ_BUG() BUG() +#define CHECK_MAGIC(x) \ + do { \ + if ((x) != (long)&(x)) { \ + printk("bad magic %lx (should be %lx), ", \ + (long)x, (long)&(x)); \ + WQ_BUG(); \ + } \ + } while (0) +#define CHECK_MAGIC_WQHEAD(x) \ + do { \ + if ((x)->__magic != (long)&((x)->__magic)) { \ + printk("bad magic %lx (should be %lx, creator %lx), ", \ + (x)->__magic, (long)&((x)->__magic), (x)->__creator); \ + WQ_BUG(); \ + } \ + } while (0) +#define WQ_CHECK_LIST_HEAD(list) \ + do { \ + if (!list->next || !list->prev) \ + WQ_BUG(); \ + } while(0) +#define WQ_NOTE_WAKER(tsk) \ + do { \ + tsk->__waker = (long)__builtin_return_address(0); \ + } while (0) +#else +#define WQ_BUG() +#define CHECK_MAGIC(x) +#define CHECK_MAGIC_WQHEAD(x) +#define WQ_CHECK_LIST_HEAD(list) +#define WQ_NOTE_WAKER(tsk) +#endif + +/* + * Macros for declaration and initialisaton of the datatypes + */ + #if WAITQUEUE_DEBUG -# define __WAITQUEUE_DEBUG_INIT(name) \ - , (long)&(name).__magic, 0 -# define __WAITQUEUE_HEAD_DEBUG_INIT(name) \ - , (long)&(name).__magic, (long)&(name).__magic +# define __WAITQUEUE_DEBUG_INIT(name) (long)&(name).__magic, 0 +# define __WAITQUEUE_HEAD_DEBUG_INIT(name) (long)&(name).__magic, (long)&(name).__magic #else # define __WAITQUEUE_DEBUG_INIT(name) # define __WAITQUEUE_HEAD_DEBUG_INIT(name) #endif -#define __WAITQUEUE_INITIALIZER(name,task) \ - { 0x0, task, { NULL, NULL } __WAITQUEUE_DEBUG_INIT(name)} -#define DECLARE_WAITQUEUE(name,task) \ - wait_queue_t name = __WAITQUEUE_INITIALIZER(name,task) +#define __WAITQUEUE_INITIALIZER(name, tsk) { \ + task: tsk, \ + task_list: { NULL, NULL }, \ + __WAITQUEUE_DEBUG_INIT(name)} + +#define DECLARE_WAITQUEUE(name, tsk) \ + wait_queue_t name = __WAITQUEUE_INITIALIZER(name, tsk) -#define __WAIT_QUEUE_HEAD_INITIALIZER(name) \ -{ WAITQUEUE_RW_LOCK_UNLOCKED, { &(name).task_list, &(name).task_list } \ - __WAITQUEUE_HEAD_DEBUG_INIT(name)} +#define __WAIT_QUEUE_HEAD_INITIALIZER(name) { \ + lock: WAITQUEUE_RW_LOCK_UNLOCKED, \ + task_list: { &(name).task_list, &(name).task_list }, \ + __WAITQUEUE_HEAD_DEBUG_INIT(name)} #define DECLARE_WAIT_QUEUE_HEAD(name) \ wait_queue_head_t name = __WAIT_QUEUE_HEAD_INITIALIZER(name) @@ -135,8 +161,7 @@ static inline void init_waitqueue_head(wait_queue_head_t *q) #endif } -static inline void init_waitqueue_entry(wait_queue_t *q, - struct task_struct *p) +static inline void init_waitqueue_entry(wait_queue_t *q, struct task_struct *p) { #if WAITQUEUE_DEBUG if (!q || !p) |