diff options
| author | Greg Kroah-Hartman <greg@kroah.com> | 2003-09-05 03:23:21 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <greg@kroah.com> | 2003-09-05 03:23:21 -0700 |
| commit | 3ddbe676c7542666023f9e420241d7f9fb47d60e (patch) | |
| tree | 7db32899fc6a915908f8d0a2771236bf6d1c593a /include/linux | |
| parent | 211bb44dcb604487dd2c38407ce8f32faf4a2a88 (diff) | |
| parent | 7c2dd86b82e5d4e44a41c871b9d8cdad5317645f (diff) | |
Merge kroah.com:/home/linux/BK/bleed-2.5
into kroah.com:/home/linux/BK/gregkh-2.6
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/cpufreq.h | 22 | ||||
| -rw-r--r-- | include/linux/fs.h | 10 | ||||
| -rw-r--r-- | include/linux/kdev_t.h | 109 | ||||
| -rw-r--r-- | include/linux/mman.h | 29 | ||||
| -rw-r--r-- | include/linux/nfs_xdr.h | 2 |
5 files changed, 55 insertions, 117 deletions
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/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/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 { |
