diff options
| author | Patrick Mochel <mochel@osdl.org> | 2003-09-05 00:17:55 -0700 |
|---|---|---|
| committer | Patrick Mochel <mochel@osdl.org> | 2003-09-05 00:17:55 -0700 |
| commit | da141de2145c66007e16b076070bcba58f236312 (patch) | |
| tree | c1ce1e84723647cd300d85f3b3b1cbad45f9b44c /include/linux | |
| parent | d3b644dddc859f4ac81ddbe2c6f358a29177e6a4 (diff) | |
| parent | 7c2dd86b82e5d4e44a41c871b9d8cdad5317645f (diff) | |
Merge osdl.org:/home/mochel/src/kernel/linux-2.5-virgin
into osdl.org:/home/mochel/src/kernel/linux-2.5-core
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/blkdev.h | 2 | ||||
| -rw-r--r-- | include/linux/cpufreq.h | 22 | ||||
| -rw-r--r-- | include/linux/elevator.h | 16 | ||||
| -rw-r--r-- | include/linux/fs.h | 10 | ||||
| -rw-r--r-- | include/linux/kdev_t.h | 109 | ||||
| -rw-r--r-- | include/linux/kmod.h | 2 | ||||
| -rw-r--r-- | include/linux/mm.h | 1 | ||||
| -rw-r--r-- | include/linux/mman.h | 29 | ||||
| -rw-r--r-- | include/linux/nfs_xdr.h | 2 | ||||
| -rw-r--r-- | include/linux/rtnetlink.h | 3 | ||||
| -rw-r--r-- | include/linux/sctp.h | 9 | ||||
| -rw-r--r-- | include/linux/tty_ldisc.h | 3 | ||||
| -rw-r--r-- | include/linux/vcache.h | 26 |
13 files changed, 79 insertions, 155 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 9c7e6d86e810..285fd86e2b48 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -270,7 +270,7 @@ struct request_queue * Together with queue_head for cacheline sharing */ struct list_head queue_head; - struct list_head *last_merge; + struct request *last_merge; elevator_t elevator; /* diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 3d466f6680cb..f747117285f4 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -36,11 +36,13 @@ int cpufreq_unregister_notifier(struct notifier_block *nb, unsigned int list); #define CPUFREQ_POLICY_NOTIFIER (1) -/********************** cpufreq policy notifiers *********************/ +/* if (cpufreq_driver->target) exists, the ->governor decides what frequency + * within the limits is used. If (cpufreq_driver->setpolicy> exists, these + * two generic policies are available: + */ #define CPUFREQ_POLICY_POWERSAVE (1) #define CPUFREQ_POLICY_PERFORMANCE (2) -#define CPUFREQ_POLICY_GOVERNOR (3) /* Frequency values here are CPU kHz so that hardware which doesn't run * with some frequencies can complain without having to guess what per @@ -151,6 +153,7 @@ int cpufreq_governor(unsigned int cpu, unsigned int event); int cpufreq_register_governor(struct cpufreq_governor *governor); void cpufreq_unregister_governor(struct cpufreq_governor *governor); + /********************************************************************* * CPUFREQ DRIVER INTERFACE * *********************************************************************/ @@ -176,6 +179,7 @@ struct cpufreq_driver { /* optional */ int (*exit) (struct cpufreq_policy *policy); + int (*resume) (struct cpufreq_policy *policy); struct freq_attr **attr; }; @@ -221,7 +225,6 @@ int cpufreq_parse_governor (char *str_governor, unsigned int *policy, struct cpu /********************************************************************* * CPUFREQ USERSPACE GOVERNOR * *********************************************************************/ -extern struct cpufreq_governor cpufreq_gov_userspace; int cpufreq_gov_userspace_init(void); int cpufreq_setmax(unsigned int cpu); @@ -280,6 +283,19 @@ enum { /********************************************************************* + * CPUFREQ DEFAULT GOVERNOR * + *********************************************************************/ + + +#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE +extern struct cpufreq_governor cpufreq_gov_performance; +#define CPUFREQ_DEFAULT_GOVERNOR &cpufreq_gov_performance +#elif CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE +extern struct cpufreq_governor cpufreq_gov_userspace; +#define CPUFREQ_DEFAULT_GOVERNOR &cpufreq_gov_userspace +#endif + +/********************************************************************* * FREQUENCY TABLE HELPERS * *********************************************************************/ diff --git a/include/linux/elevator.h b/include/linux/elevator.h index ac30ae089069..e43d670c1371 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h @@ -1,7 +1,7 @@ #ifndef _LINUX_ELEVATOR_H #define _LINUX_ELEVATOR_H -typedef int (elevator_merge_fn) (request_queue_t *, struct list_head **, +typedef int (elevator_merge_fn) (request_queue_t *, struct request **, struct bio *); typedef void (elevator_merge_req_fn) (request_queue_t *, struct request *, struct request *); @@ -10,7 +10,7 @@ typedef void (elevator_merged_fn) (request_queue_t *, struct request *); typedef struct request *(elevator_next_req_fn) (request_queue_t *); -typedef void (elevator_add_req_fn) (request_queue_t *, struct request *, struct list_head *); +typedef void (elevator_add_req_fn) (request_queue_t *, struct request *, int); typedef int (elevator_queue_empty_fn) (request_queue_t *); typedef void (elevator_remove_req_fn) (request_queue_t *, struct request *); typedef void (elevator_requeue_req_fn) (request_queue_t *, struct request *); @@ -62,7 +62,7 @@ struct elevator_s */ extern void elv_add_request(request_queue_t *, struct request *, int, int); extern void __elv_add_request(request_queue_t *, struct request *, int, int); -extern int elv_merge(request_queue_t *, struct list_head **, struct bio *); +extern int elv_merge(request_queue_t *, struct request **, struct bio *); extern void elv_merge_requests(request_queue_t *, struct request *, struct request *); extern void elv_merged_request(request_queue_t *, struct request *); @@ -79,9 +79,6 @@ extern void elv_completed_request(request_queue_t *, struct request *); extern int elv_set_request(request_queue_t *, struct request *, int); extern void elv_put_request(request_queue_t *, struct request *); -#define __elv_add_request_pos(q, rq, pos) \ - (q)->elevator.elevator_add_req_fn((q), (rq), (pos)) - /* * noop I/O scheduler. always merges, always inserts new request at tail */ @@ -111,4 +108,11 @@ extern inline int elv_try_last_merge(request_queue_t *, struct bio *); #define ELEVATOR_FRONT_MERGE 1 #define ELEVATOR_BACK_MERGE 2 +/* + * Insertion selection + */ +#define ELEVATOR_INSERT_FRONT 1 +#define ELEVATOR_INSERT_BACK 2 +#define ELEVATOR_INSERT_SORT 3 + #endif diff --git a/include/linux/fs.h b/include/linux/fs.h index 87ae270bf96c..d10db09f6164 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -373,7 +373,7 @@ struct inode { unsigned int i_nlink; uid_t i_uid; gid_t i_gid; - kdev_t i_rdev; + dev_t i_rdev; loff_t i_size; struct timespec i_atime; struct timespec i_mtime; @@ -469,12 +469,12 @@ static inline void i_size_write(struct inode *inode, loff_t i_size) static inline unsigned iminor(struct inode *inode) { - return minor(inode->i_rdev); + return MINOR(inode->i_rdev); } static inline unsigned imajor(struct inode *inode) { - return major(inode->i_rdev); + return MAJOR(inode->i_rdev); } struct fown_struct { @@ -1156,7 +1156,6 @@ extern struct block_device *lookup_bdev(const char *); extern struct block_device *open_bdev_excl(const char *, int, int, void *); extern void close_bdev_excl(struct block_device *, int); -extern const char * cdevname(kdev_t); extern void init_special_inode(struct inode *, umode_t, dev_t); /* Invalid inode operations -- fs/bad_inode.c */ @@ -1390,6 +1389,9 @@ struct tree_descr { char *name; struct file_operations *ops; int mode; }; extern int simple_fill_super(struct super_block *, int, struct tree_descr *); extern int simple_pin_fs(char *name, struct vfsmount **mount, int *count); extern void simple_release_fs(struct vfsmount **mount, int *count); +extern int old_valid_dev(dev_t); +extern u16 old_encode_dev(dev_t); +extern dev_t old_decode_dev(u16); extern int inode_change_ok(struct inode *, struct iattr *); extern int inode_setattr(struct inode *, struct iattr *); diff --git a/include/linux/kdev_t.h b/include/linux/kdev_t.h index 900a4a1e1282..f60508da024d 100644 --- a/include/linux/kdev_t.h +++ b/include/linux/kdev_t.h @@ -1,101 +1,6 @@ #ifndef _LINUX_KDEV_T_H #define _LINUX_KDEV_T_H #ifdef __KERNEL__ -/* -As a preparation for the introduction of larger device numbers, -we introduce a type kdev_t to hold them. No information about -this type is known outside of this include file. - -Objects of type kdev_t designate a device. Outside of the kernel -the corresponding things are objects of type dev_t - usually an -integral type with the device major and minor in the high and low -bits, respectively. Conversion is done by - -extern kdev_t to_kdev_t(int); - -It is up to the various file systems to decide how objects of type -dev_t are stored on disk. -The only other point of contact between kernel and outside world -are the system calls stat and mknod, new versions of which will -eventually have to be used in libc. - -[Unfortunately, the floppy control ioctls fail to hide the internal -kernel structures, and the fd_device field of a struct floppy_drive_struct -is user-visible. So, it remains a dev_t for the moment, with some ugly -conversions in floppy.c.] - -Inside the kernel, we aim for a kdev_t type that is a pointer -to a structure with information about the device (like major, -minor, size, blocksize, sectorsize, name, read-only flag, -struct file_operations etc.). - -However, for the time being we let kdev_t be almost the same as dev_t: - -typedef struct { unsigned short major, minor; } kdev_t; - -Admissible operations on an object of type kdev_t: -- passing it along -- comparing it for equality with another such object -- storing it in inode->i_rdev or tty->device -- using its bit pattern as argument in a hash function -- finding its major and minor -- complaining about it - -An object of type kdev_t is created only by the function MKDEV(), -with the single exception of the constant 0 (no device). - -Right now the other information mentioned above is usually found -in static arrays indexed by major or major,minor. - -An obstacle to immediately using - typedef struct { ... (* lots of information *) } *kdev_t -is the case of mknod used to create a block device that the -kernel doesn't know about at present (but first learns about -when some module is inserted). - -aeb - 950811 -*/ - - -/* - * NOTE NOTE NOTE! - * - * The kernel-internal "kdev_t" will eventually have - * 20 bits for minor numbers, and 12 bits for majors. - * - * HOWEVER, the external representation is still 8+8 - * bits, and there is no way to generate the extended - * "kdev_t" format yet. Which is just as well, since - * we still use "minor" as an index into various - * static arrays, and they are sized for a 8-bit index. - */ -typedef struct { - unsigned short value; -} kdev_t; - -#define KDEV_MINOR_BITS 8 -#define KDEV_MAJOR_BITS 8 - -#define __mkdev(major,minor) (((major) << KDEV_MINOR_BITS) + (minor)) - -#define mk_kdev(major, minor) ((kdev_t) { __mkdev(major,minor) } ) - -/* - * The "values" are just _cookies_, usable for - * internal equality comparisons and for things - * like NFS filehandle conversion. - */ -static inline unsigned int kdev_val(kdev_t dev) -{ - return dev.value; -} - -#define NODEV (mk_kdev(0,0)) - -/* Mask off the high bits for now.. */ -#define minor(dev) ((dev).value & 0xff) -#define major(dev) (((dev).value >> KDEV_MINOR_BITS) & 0xff) - /* These are for user-level "dev_t" */ #define MINORBITS 8 #define MINORMASK ((1U << MINORBITS) - 1) @@ -104,20 +9,6 @@ static inline unsigned int kdev_val(kdev_t dev) #define MINOR(dev) ((unsigned int) ((dev) & MINORMASK)) #define MKDEV(ma,mi) (((ma) << MINORBITS) | (mi)) -/* - * Conversion functions - */ - -static inline int kdev_t_to_nr(kdev_t dev) -{ - return MKDEV(major(dev), minor(dev)); -} - -static inline kdev_t to_kdev_t(int dev) -{ - return mk_kdev(MAJOR(dev),MINOR(dev)); -} - #define print_dev_t(buffer, dev) \ sprintf((buffer), "%u:%u\n", MAJOR(dev), MINOR(dev)) diff --git a/include/linux/kmod.h b/include/linux/kmod.h index 7fa02a737518..8412faeea0f7 100644 --- a/include/linux/kmod.h +++ b/include/linux/kmod.h @@ -29,7 +29,7 @@ extern int request_module(const char * name, ...) __attribute__ ((format (printf static inline int request_module(const char * name, ...) { return -ENOSYS; } #endif -#define try_then_request_module(x, mod...) ((x) ?: request_module(mod), (x)) +#define try_then_request_module(x, mod...) ((x) ?: (request_module(mod), (x))) extern int call_usermodehelper(char *path, char *argv[], char *envp[], int wait); #ifdef CONFIG_HOTPLUG diff --git a/include/linux/mm.h b/include/linux/mm.h index 445fc58751c7..9f9743146b54 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -110,6 +110,7 @@ struct vm_area_struct { #define VM_RESERVED 0x00080000 /* Don't unmap it from swap_out */ #define VM_ACCOUNT 0x00100000 /* Is a VM accounted object */ #define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */ +#define VM_NONLINEAR 0x00800000 /* Is non-linear (remap_file_pages) */ #ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */ #define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS diff --git a/include/linux/mman.h b/include/linux/mman.h index a8956f6588ad..cfb6ac61bbde 100644 --- a/include/linux/mman.h +++ b/include/linux/mman.h @@ -2,6 +2,7 @@ #define _LINUX_MMAN_H #include <linux/config.h> +#include <linux/mm.h> #include <asm/atomic.h> #include <asm/mman.h> @@ -27,4 +28,32 @@ static inline void vm_unacct_memory(long pages) vm_acct_memory(-pages); } +/* Optimisation macro. */ +#define _calc_vm_trans(x,bit1,bit2) \ + ((bit1) <= (bit2) ? ((x) & (bit1)) * ((bit2) / (bit1)) \ + : ((x) & (bit1)) / ((bit1) / (bit2))) + +/* + * Combine the mmap "prot" argument into "vm_flags" used internally. + */ +static inline unsigned long +calc_vm_prot_bits(unsigned long prot) +{ + return _calc_vm_trans(prot, PROT_READ, VM_READ ) | + _calc_vm_trans(prot, PROT_WRITE, VM_WRITE) | + _calc_vm_trans(prot, PROT_EXEC, VM_EXEC ); +} + +/* + * Combine the mmap "flags" argument into "vm_flags" used internally. + */ +static inline unsigned long +calc_vm_flag_bits(unsigned long flags) +{ + return _calc_vm_trans(flags, MAP_GROWSDOWN, VM_GROWSDOWN ) | + _calc_vm_trans(flags, MAP_DENYWRITE, VM_DENYWRITE ) | + _calc_vm_trans(flags, MAP_EXECUTABLE, VM_EXECUTABLE) | + _calc_vm_trans(flags, MAP_LOCKED, VM_LOCKED ); +} + #endif /* _LINUX_MMAN_H */ diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 3d46a2caaade..88b705d8cefe 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h @@ -23,7 +23,7 @@ struct nfs_fattr { __u64 used; } nfs3; } du; - __u32 rdev; + dev_t rdev; union { __u64 nfs3; /* also nfs2 */ struct { diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 3e3a26916a12..fd8b35209ccc 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h @@ -3,9 +3,6 @@ #include <linux/netlink.h> -#define RTNL_DEBUG 1 - - /**** * Routing/neighbour discovery messages. ****/ diff --git a/include/linux/sctp.h b/include/linux/sctp.h index 6ebaff34570c..6131e3c9aa45 100644 --- a/include/linux/sctp.h +++ b/include/linux/sctp.h @@ -1,7 +1,7 @@ /* SCTP kernel reference Implementation + * (C) Copyright IBM Corp. 2001, 2003 * Copyright (c) 1999-2000 Cisco, Inc. * Copyright (c) 1999-2001 Motorola, Inc. - * Copyright (c) 2001-2002 International Business Machines, Corp. * Copyright (c) 2001 Intel Corp. * Copyright (c) 2001 Nokia, Inc. * Copyright (c) 2001 La Monte H.P. Yarroll @@ -42,6 +42,8 @@ * randall@sctp.chicago.il.us * kmorneau@cisco.com * qxie1@email.mot.com + * Sridhar Samudrala <sri@us.ibm.com> + * Kevin Gao <kevin.gao@intel.com> * * Any bugs reported given to us we will try to fix... any fixes shared will * be incorporated into the next SCTP release. @@ -507,6 +509,11 @@ typedef struct sctp_cwr_chunk { * The ASCONF Parameter Response is used in the ASCONF-ACK to * report status of ASCONF processing. */ +typedef struct sctp_addip_param { + sctp_paramhdr_t param_hdr; + __u32 crr_id; +}sctp_addip_param_t __attribute__((packed)); + typedef struct sctp_addiphdr { __u32 serial; __u8 params[0]; diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h index ac8ac46845ba..c851b7dc997e 100644 --- a/include/linux/tty_ldisc.h +++ b/include/linux/tty_ldisc.h @@ -138,4 +138,7 @@ struct tty_ldisc { #define LDISC_FLAG_DEFINED 0x00000001 +#define MODULE_ALIAS_LDISC(ldisc) \ + MODULE_ALIAS("tty-ldisc-" __stringify(ldisc)) + #endif /* _LINUX_TTY_LDISC_H */ diff --git a/include/linux/vcache.h b/include/linux/vcache.h deleted file mode 100644 index 5708fe6a908a..000000000000 --- a/include/linux/vcache.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * virtual => physical mapping cache support. - */ -#ifndef _LINUX_VCACHE_H -#define _LINUX_VCACHE_H - -typedef struct vcache_s { - unsigned long address; - struct mm_struct *mm; - struct list_head hash_entry; - void (*callback)(struct vcache_s *data, struct page *new_page); -} vcache_t; - -extern spinlock_t vcache_lock; - -extern void __attach_vcache(vcache_t *vcache, - unsigned long address, - struct mm_struct *mm, - void (*callback)(struct vcache_s *data, struct page *new_page)); - -extern void __detach_vcache(vcache_t *vcache); - -extern void invalidate_vcache(unsigned long address, struct mm_struct *mm, - struct page *new_page); - -#endif |
