diff options
| author | Ben Collins <bcollins@debian.org> | 2004-01-23 00:17:15 -0500 |
|---|---|---|
| committer | Ben Collins <bcollins@debian.org> | 2004-01-23 00:17:15 -0500 |
| commit | 7a272c66115f213c86f101716ecfdc8acb8d7470 (patch) | |
| tree | 0bc2853e64a2d343dbefd95913ff0091f93b9eb3 /include/linux | |
| parent | ddcb7c122488e3f2869d7fd9a76239ff98c92a1b (diff) | |
| parent | c8609416f38fb3d89ca554a4c436c71cbd398681 (diff) | |
Merge http://linux.bkbits.net/linux-2.5
into debian.org:/usr/src/kernel/linux-2.6
Diffstat (limited to 'include/linux')
34 files changed, 211 insertions, 204 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h index 4f090059372e..d3b4e9ed4052 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -266,8 +266,7 @@ extern inline char *bvec_kmap_irq(struct bio_vec *bvec, unsigned long *flags) local_irq_save(*flags); addr = (unsigned long) kmap_atomic(bvec->bv_page, KM_BIO_SRC_IRQ); - if (addr & ~PAGE_MASK) - BUG(); + BUG_ON(addr & ~PAGE_MASK); return (char *) addr + bvec->bv_offset; } diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h index 74b89ea0aae5..b84caaebed87 100644 --- a/include/linux/bitmap.h +++ b/include/linux/bitmap.h @@ -10,57 +10,11 @@ #include <linux/bitops.h> #include <linux/string.h> -static inline int bitmap_empty(const unsigned long *bitmap, int bits) -{ - int k, lim = bits/BITS_PER_LONG; - for (k = 0; k < lim; ++k) - if (bitmap[k]) - return 0; - - if (bits % BITS_PER_LONG) - if (bitmap[k] & ((1UL << (bits % BITS_PER_LONG)) - 1)) - return 0; - - return 1; -} - -static inline int bitmap_full(const unsigned long *bitmap, int bits) -{ - int k, lim = bits/BITS_PER_LONG; - for (k = 0; k < lim; ++k) - if (~bitmap[k]) - return 0; - - if (bits % BITS_PER_LONG) - if (~bitmap[k] & ((1UL << (bits % BITS_PER_LONG)) - 1)) - return 0; - - return 1; -} - -static inline int bitmap_equal(const unsigned long *bitmap1, - unsigned long *bitmap2, int bits) -{ - int k, lim = bits/BITS_PER_LONG;; - for (k = 0; k < lim; ++k) - if (bitmap1[k] != bitmap2[k]) - return 0; - - if (bits % BITS_PER_LONG) - if ((bitmap1[k] ^ bitmap2[k]) & - ((1UL << (bits % BITS_PER_LONG)) - 1)) - return 0; - - return 1; -} - -static inline void bitmap_complement(unsigned long *bitmap, int bits) -{ - int k; - - for (k = 0; k < BITS_TO_LONGS(bits); ++k) - bitmap[k] = ~bitmap[k]; -} +int bitmap_empty(const unsigned long *bitmap, int bits); +int bitmap_full(const unsigned long *bitmap, int bits); +int bitmap_equal(const unsigned long *bitmap1, + unsigned long *bitmap2, int bits); +void bitmap_complement(unsigned long *bitmap, int bits); static inline void bitmap_clear(unsigned long *bitmap, int bits) { @@ -78,81 +32,15 @@ static inline void bitmap_copy(unsigned long *dst, memcpy(dst, src, BITS_TO_LONGS(bits)*sizeof(unsigned long)); } -static inline void bitmap_shift_right(unsigned long *dst, - const unsigned long *src, int shift, int bits) -{ - int k; - DECLARE_BITMAP(__shr_tmp, bits); - - bitmap_clear(__shr_tmp, bits); - for (k = 0; k < bits - shift; ++k) - if (test_bit(k + shift, src)) - set_bit(k, __shr_tmp); - bitmap_copy(dst, __shr_tmp, bits); -} - -static inline void bitmap_shift_left(unsigned long *dst, - const unsigned long *src, int shift, int bits) -{ - int k; - DECLARE_BITMAP(__shl_tmp, bits); - - bitmap_clear(__shl_tmp, bits); - for (k = bits; k >= shift; --k) - if (test_bit(k - shift, src)) - set_bit(k, __shl_tmp); - bitmap_copy(dst, __shl_tmp, bits); -} - -static inline void bitmap_and(unsigned long *dst, const unsigned long *bitmap1, - const unsigned long *bitmap2, int bits) -{ - int k; - int nr = BITS_TO_LONGS(bits); - - for (k = 0; k < nr; k++) - dst[k] = bitmap1[k] & bitmap2[k]; -} - -static inline void bitmap_or(unsigned long *dst, const unsigned long *bitmap1, - const unsigned long *bitmap2, int bits) -{ - int k; - int nr = BITS_TO_LONGS(bits); - - for (k = 0; k < nr; k++) - dst[k] = bitmap1[k] | bitmap2[k]; -} - -#if BITS_PER_LONG == 32 -static inline int bitmap_weight(const unsigned long *bitmap, int bits) -{ - int k, w = 0, lim = bits/BITS_PER_LONG; - - for (k = 0; k < lim; k++) - w += hweight32(bitmap[k]); - - if (bits % BITS_PER_LONG) - w += hweight32(bitmap[k] & - ((1UL << (bits % BITS_PER_LONG)) - 1)); - - return w; -} -#else -static inline int bitmap_weight(const unsigned long *bitmap, int bits) -{ - int k, w = 0, lim = bits/BITS_PER_LONG; - - for (k = 0; k < lim; k++) - w += hweight64(bitmap[k]); - - if (bits % BITS_PER_LONG) - w += hweight64(bitmap[k] & - ((1UL << (bits % BITS_PER_LONG)) - 1)); - - return w; -} -#endif +void bitmap_shift_right(unsigned long *dst, + const unsigned long *src, int shift, int bits); +void bitmap_shift_left(unsigned long *dst, + const unsigned long *src, int shift, int bits); +void bitmap_and(unsigned long *dst, const unsigned long *bitmap1, + const unsigned long *bitmap2, int bits); +void bitmap_or(unsigned long *dst, const unsigned long *bitmap1, + const unsigned long *bitmap2, int bits); +int bitmap_weight(const unsigned long *bitmap, int bits); #endif /* __ASSEMBLY__ */ diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index a1c5cd076331..80b4c47842b8 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -483,9 +483,9 @@ static inline void blk_queue_bounce(request_queue_t *q, struct bio **bio) } #endif /* CONFIG_MMU */ -#define rq_for_each_bio(bio, rq) \ +#define rq_for_each_bio(_bio, rq) \ if ((rq->bio)) \ - for (bio = (rq)->bio; bio; bio = bio->bi_next) + for (_bio = (rq)->bio; _bio; _bio = bio->bi_next) struct sec_size { unsigned block_size; diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 5f4b675a7bb4..110584f07883 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h @@ -125,8 +125,7 @@ BUFFER_FNS(Write_EIO,write_io_error) /* If we *know* page->private refers to buffer_heads */ #define page_buffers(page) \ ({ \ - if (!PagePrivate(page)) \ - BUG(); \ + BUG_ON(!PagePrivate(page)); \ ((struct buffer_head *)(page)->private); \ }) #define page_has_buffers(page) PagePrivate(page) diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 6bd0570d3a1c..6b2ea8fecf06 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -270,8 +270,7 @@ extern char * d_path(struct dentry *, struct vfsmount *, char *, int); static inline struct dentry *dget(struct dentry *dentry) { if (dentry) { - if (!atomic_read(&dentry->d_count)) - BUG(); + BUG_ON(!atomic_read(&dentry->d_count)); atomic_inc(&dentry->d_count); } return dentry; diff --git a/include/linux/device.h b/include/linux/device.h index 8f008e19b83f..367b21888ad4 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -46,6 +46,7 @@ struct device; struct device_driver; struct class; struct class_device; +struct class_simple; struct bus_type { char * name; @@ -155,6 +156,7 @@ struct class { int num_envp, char *buffer, int buffer_size); void (*release)(struct class_device *dev); + void (*class_release)(struct class *class); }; extern int class_register(struct class *); @@ -246,6 +248,13 @@ struct class_interface { extern int class_interface_register(struct class_interface *); extern void class_interface_unregister(struct class_interface *); +/* interface for class simple stuff */ +extern struct class_simple *class_simple_create(struct module *owner, char *name); +extern void class_simple_destroy(struct class_simple *cs); +extern struct class_device *class_simple_device_add(struct class_simple *cs, dev_t dev, struct device *device, const char *fmt, ...) + __attribute__((format(printf,4,5))); +extern void class_simple_device_remove(dev_t dev); + struct device { struct list_head node; /* node in sibling list */ @@ -354,6 +363,7 @@ extern int (*platform_notify_remove)(struct device * dev); */ extern struct device * get_device(struct device * dev); extern void put_device(struct device * dev); +extern struct device *device_find(const char *name, struct bus_type *bus); /* drivers/base/platform.c */ diff --git a/include/linux/efi.h b/include/linux/efi.h index 86e9d2ebb5eb..a1764b1fb106 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h @@ -297,14 +297,22 @@ extern u64 efi_mem_attributes (unsigned long phys_addr); extern void efi_initialize_iomem_resources(struct resource *code_resource, struct resource *data_resource); extern efi_status_t phys_efi_get_time(efi_time_t *tm, efi_time_cap_t *tc); -extern unsigned long inline __init efi_get_time(void); -extern int inline __init efi_set_rtc_mmss(unsigned long nowtime); +extern inline unsigned long __init efi_get_time(void); +extern inline int __init efi_set_rtc_mmss(unsigned long nowtime); extern struct efi_memory_map memmap; +/* + * We play games with efi_enabled so that the compiler will, if possible, remove + * EFI-related code altogether. + */ #ifdef CONFIG_EFI -extern int efi_enabled; +# ifdef CONFIG_X86 + extern int efi_enabled; +# else +# define efi_enabled 1 +# endif #else -#define efi_enabled 0 +# define efi_enabled 0 #endif /* diff --git a/include/linux/eventpoll.h b/include/linux/eventpoll.h index 1ece9f119220..136c6315e6af 100644 --- a/include/linux/eventpoll.h +++ b/include/linux/eventpoll.h @@ -22,6 +22,9 @@ #define EPOLL_CTL_DEL 2 #define EPOLL_CTL_MOD 3 +/* Set the One Shot behaviour for the target file descriptor */ +#define EPOLLONESHOT (1 << 30) + /* Set the Edge Triggered behaviour for the target file descriptor */ #define EPOLLET (1 << 31) diff --git a/include/linux/ext2_fs_sb.h b/include/linux/ext2_fs_sb.h index 13178c16c7ea..4eda0ed76a48 100644 --- a/include/linux/ext2_fs_sb.h +++ b/include/linux/ext2_fs_sb.h @@ -45,6 +45,7 @@ struct ext2_sb_info { int s_desc_per_block_bits; int s_inode_size; int s_first_ino; + spinlock_t s_next_gen_lock; u32 s_next_generation; unsigned long s_dir_count; u8 *s_debts; diff --git a/include/linux/ext3_fs_sb.h b/include/linux/ext3_fs_sb.h index e9b4012cc776..590fd69ec045 100644 --- a/include/linux/ext3_fs_sb.h +++ b/include/linux/ext3_fs_sb.h @@ -49,6 +49,7 @@ struct ext3_sb_info { int s_desc_per_block_bits; int s_inode_size; int s_first_ino; + spinlock_t s_next_gen_lock; u32 s_next_generation; u32 s_hash_seed[4]; int s_def_hash_version; diff --git a/include/linux/ext3_jbd.h b/include/linux/ext3_jbd.h index 50caf6875ba4..a3555b48cccb 100644 --- a/include/linux/ext3_jbd.h +++ b/include/linux/ext3_jbd.h @@ -221,13 +221,24 @@ static inline int ext3_should_journal_data(struct inode *inode) static inline int ext3_should_order_data(struct inode *inode) { - return (test_opt(inode->i_sb, DATA_FLAGS) == EXT3_MOUNT_ORDERED_DATA); + if (!S_ISREG(inode->i_mode)) + return 0; + if (EXT3_I(inode)->i_flags & EXT3_JOURNAL_DATA_FL) + return 0; + if (test_opt(inode->i_sb, DATA_FLAGS) == EXT3_MOUNT_ORDERED_DATA) + return 1; + return 0; } static inline int ext3_should_writeback_data(struct inode *inode) { - return !ext3_should_journal_data(inode) && - !ext3_should_order_data(inode); + if (!S_ISREG(inode->i_mode)) + return 0; + if (EXT3_I(inode)->i_flags & EXT3_JOURNAL_DATA_FL) + return 0; + if (test_opt(inode->i_sb, DATA_FLAGS) == EXT3_MOUNT_WRITEBACK_DATA) + return 1; + return 0; } #endif /* _LINUX_EXT3_JBD_H */ diff --git a/include/linux/fs.h b/include/linux/fs.h index fd3c87c86d6f..7d9154665d9b 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -353,6 +353,13 @@ struct block_device { int bd_invalidated; struct gendisk * bd_disk; struct list_head bd_list; + /* + * Private data. You must have bd_claim'ed the block_device + * to use this. NOTE: bd_claim allows an owner to claim + * the same device multiple times, the owner must take special + * care to not mess up bd_private for that case. + */ + unsigned long bd_private; }; /* diff --git a/include/linux/highmem.h b/include/linux/highmem.h index 2c9139a94f8f..232d8fdb557c 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h @@ -56,8 +56,7 @@ static inline void memclear_highpage_flush(struct page *page, unsigned int offse { void *kaddr; - if (offset + size > PAGE_SIZE) - BUG(); + BUG_ON(offset + size > PAGE_SIZE); kaddr = kmap_atomic(page, KM_USER0); memset((char *)kaddr + offset, 0, size); diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index 74a7286240ba..d4dcd2126ce1 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h @@ -154,6 +154,9 @@ #define I2C_DRIVERID_W83627HF 1038 #define I2C_DRIVERID_LM85 1039 #define I2C_DRIVERID_LM83 1040 +#define I2C_DRIVERID_LM90 1042 +#define I2C_DRIVERID_ASB100 1043 +#define I2C_DRIVERID_W83L785TS 1047 /* * ---- Adapter types ---------------------------------------------------- diff --git a/include/linux/input.h b/include/linux/input.h index eff36f445c25..3beb4078a2da 100644 --- a/include/linux/input.h +++ b/include/linux/input.h @@ -189,18 +189,18 @@ struct input_absinfo { #define KEY_KP3 81 #define KEY_KP0 82 #define KEY_KPDOT 83 -#define KEY_103RD 84 -#define KEY_F13 85 + +#define KEY_ZENKAKUHANKAKU 85 #define KEY_102ND 86 #define KEY_F11 87 #define KEY_F12 88 -#define KEY_F14 89 -#define KEY_F15 90 -#define KEY_F16 91 -#define KEY_F17 92 -#define KEY_F18 93 -#define KEY_F19 94 -#define KEY_F20 95 +#define KEY_RO 89 +#define KEY_KATAKANA 90 +#define KEY_HIRAGANA 91 +#define KEY_HENKAN 92 +#define KEY_KATAKANAHIRAGANA 93 +#define KEY_MUHENKAN 94 +#define KEY_KPJPCOMMA 95 #define KEY_KPENTER 96 #define KEY_RIGHTCTRL 97 #define KEY_KPSLASH 98 @@ -225,11 +225,11 @@ struct input_absinfo { #define KEY_KPEQUAL 117 #define KEY_KPPLUSMINUS 118 #define KEY_PAUSE 119 -#define KEY_F21 120 -#define KEY_F22 121 -#define KEY_F23 122 -#define KEY_F24 123 -#define KEY_KPCOMMA 124 + +#define KEY_KPCOMMA 121 +#define KEY_HANGUEL 122 +#define KEY_HANJA 123 +#define KEY_YEN 124 #define KEY_LEFTMETA 125 #define KEY_RIGHTMETA 126 #define KEY_COMPOSE 127 @@ -288,24 +288,18 @@ struct input_absinfo { #define KEY_KPLEFTPAREN 179 #define KEY_KPRIGHTPAREN 180 -#define KEY_INTL1 181 -#define KEY_INTL2 182 -#define KEY_INTL3 183 -#define KEY_INTL4 184 -#define KEY_INTL5 185 -#define KEY_INTL6 186 -#define KEY_INTL7 187 -#define KEY_INTL8 188 -#define KEY_INTL9 189 -#define KEY_LANG1 190 -#define KEY_LANG2 191 -#define KEY_LANG3 192 -#define KEY_LANG4 193 -#define KEY_LANG5 194 -#define KEY_LANG6 195 -#define KEY_LANG7 196 -#define KEY_LANG8 197 -#define KEY_LANG9 198 +#define KEY_F13 183 +#define KEY_F14 184 +#define KEY_F15 185 +#define KEY_F16 186 +#define KEY_F17 187 +#define KEY_F18 188 +#define KEY_F19 189 +#define KEY_F20 190 +#define KEY_F21 191 +#define KEY_F22 192 +#define KEY_F23 193 +#define KEY_F24 194 #define KEY_PLAYCD 200 #define KEY_PAUSECD 201 @@ -580,6 +574,7 @@ struct input_absinfo { #define BUS_ISAPNP 0x02 #define BUS_USB 0x03 #define BUS_HIL 0x04 +#define BUS_BLUETOOTH 0x05 #define BUS_ISA 0x10 #define BUS_I8042 0x11 @@ -809,6 +804,7 @@ struct input_dev { int (*erase_effect)(struct input_dev *dev, int effect_id); struct input_handle *grab; + struct device *dev; struct list_head h_list; struct list_head node; @@ -921,7 +917,7 @@ void input_event(struct input_dev *dev, unsigned int type, unsigned int code, in #define input_regs(a,b) do { (a)->regs = (b); } while (0) #define input_sync(a) do { input_event(a, EV_SYN, SYN_REPORT, 0); (a)->regs = NULL; } while (0) -extern struct class input_class; +extern struct class_simple *input_class; #endif #endif diff --git a/include/linux/kobject.h b/include/linux/kobject.h index 42174b623637..2b127488d33e 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h @@ -56,6 +56,7 @@ extern void kobject_unregister(struct kobject *); extern struct kobject * kobject_get(struct kobject *); extern void kobject_put(struct kobject *); +extern void kobject_hotplug(const char *action, struct kobject *); struct kobj_type { void (*release)(struct kobject *); diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h index 6b7f9c1fa5cd..98f61665d4c2 100644 --- a/include/linux/miscdevice.h +++ b/include/linux/miscdevice.h @@ -36,12 +36,15 @@ #define TUN_MINOR 200 +struct device; + struct miscdevice { int minor; const char *name; struct file_operations *fops; struct list_head list; + struct device *dev; char devfs_name[64]; }; diff --git a/include/linux/mm.h b/include/linux/mm.h index 881091514f01..3ecd3d633c5f 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -223,7 +223,6 @@ struct page { atomic_dec_and_test(&(p)->count); \ }) -#define page_count(p) atomic_read(&(p)->count) #define set_page_count(p,v) atomic_set(&(p)->count, v) #define __put_page(p) atomic_dec(&(p)->count) @@ -231,6 +230,13 @@ extern void FASTCALL(__page_cache_release(struct page *)); #ifdef CONFIG_HUGETLB_PAGE +static inline int page_count(struct page *p) +{ + if (PageCompound(p)) + p = (struct page *)p->lru.next; + return atomic_read(&(p)->count); +} + static inline void get_page(struct page *page) { if (PageCompound(page)) @@ -257,6 +263,8 @@ static inline void put_page(struct page *page) #else /* CONFIG_HUGETLB_PAGE */ +#define page_count(p) atomic_read(&(p)->count) + static inline void get_page(struct page *page) { atomic_inc(&page->count); @@ -322,23 +330,33 @@ static inline void put_page(struct page *page) /* * The zone field is never updated after free_area_init_core() * sets it, so none of the operations on it need to be atomic. - * We'll have up to log2(MAX_NUMNODES * MAX_NR_ZONES) zones - * total, so we use NODES_SHIFT here to get enough bits. + * We'll have up to (MAX_NUMNODES * MAX_NR_ZONES) zones total, + * so we use (MAX_NODES_SHIFT + MAX_ZONES_SHIFT) here to get enough bits. */ -#define ZONE_SHIFT (BITS_PER_LONG - NODES_SHIFT - MAX_NR_ZONES_SHIFT) +#define NODEZONE_SHIFT (BITS_PER_LONG - MAX_NODES_SHIFT - MAX_ZONES_SHIFT) +#define NODEZONE(node, zone) ((node << ZONES_SHIFT) | zone) + +static inline unsigned long page_zonenum(struct page *page) +{ + return (page->flags >> NODEZONE_SHIFT) & (~(~0UL << ZONES_SHIFT)); +} +static inline unsigned long page_nodenum(struct page *page) +{ + return (page->flags >> (NODEZONE_SHIFT + ZONES_SHIFT)); +} struct zone; extern struct zone *zone_table[]; static inline struct zone *page_zone(struct page *page) { - return zone_table[page->flags >> ZONE_SHIFT]; + return zone_table[page->flags >> NODEZONE_SHIFT]; } -static inline void set_page_zone(struct page *page, unsigned long zone_num) +static inline void set_page_zone(struct page *page, unsigned long nodezone_num) { - page->flags &= ~(~0UL << ZONE_SHIFT); - page->flags |= zone_num << ZONE_SHIFT; + page->flags &= ~(~0UL << NODEZONE_SHIFT); + page->flags |= nodezone_num << NODEZONE_SHIFT; } #ifndef CONFIG_DISCONTIGMEM @@ -624,5 +642,33 @@ kernel_map_pages(struct page *page, int numpages, int enable) } #endif +#ifndef CONFIG_ARCH_GATE_AREA +#ifdef AT_SYSINFO_EHDR +static inline int in_gate_area(struct task_struct *task, unsigned long addr) +{ + if ((addr >= FIXADDR_USER_START) && (addr < FIXADDR_USER_END)) + return 1; + else + return 0; +} + +extern struct vm_area_struct gate_vma; +static inline struct vm_area_struct *get_gate_vma(struct task_struct *tsk) +{ + return &gate_vma; +} +#else +static inline int in_gate_area(struct task_struct *task, unsigned long addr) +{ + return 0; +} + +static inline struct vm_area_struct *get_gate_vma(struct task_struct *tsk) +{ + return NULL; +} +#endif +#endif + #endif /* __KERNEL__ */ #endif /* _LINUX_MM_H */ diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index a089e01dad03..66cbaa36d878 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -160,12 +160,19 @@ struct zone { #define ZONE_NORMAL 1 #define ZONE_HIGHMEM 2 -#define MAX_NR_ZONES 3 /* Sync this with MAX_NR_ZONES_SHIFT */ -#define MAX_NR_ZONES_SHIFT 2 /* ceil(log2(MAX_NR_ZONES)) */ +#define MAX_NR_ZONES 3 /* Sync this with ZONES_SHIFT */ +#define ZONES_SHIFT 2 /* ceil(log2(MAX_NR_ZONES)) */ #define GFP_ZONEMASK 0x03 /* + * The "priority" of VM scanning is how much of the queues we will scan in one + * go. A value of 12 for DEF_PRIORITY implies that we will scan 1/4096th of the + * queues ("queue_length >> 12") during an aging round. + */ +#define DEF_PRIORITY 12 + +/* * One allocation request operates on a zonelist. A zonelist * is a list of zones, the first one is the 'goal' of the * allocation, the other zones are fallback zones, in decreasing @@ -303,7 +310,7 @@ int min_free_kbytes_sysctl_handler(struct ctl_table *, int, struct file *, extern struct pglist_data contig_page_data; #define NODE_DATA(nid) (&contig_page_data) #define NODE_MEM_MAP(nid) mem_map -#define MAX_NODES_SHIFT 0 +#define MAX_NODES_SHIFT 1 #else /* CONFIG_DISCONTIGMEM */ @@ -311,7 +318,7 @@ extern struct pglist_data contig_page_data; #if BITS_PER_LONG == 32 /* - * with 32 bit flags field, page->zone is currently 8 bits. + * with 32 bit page->flags field, we reserve 8 bits for node/zone info. * there are 3 zones (2 bits) and this leaves 8-2=6 bits for nodes. */ #define MAX_NODES_SHIFT 6 @@ -328,6 +335,13 @@ extern struct pglist_data contig_page_data; #error NODES_SHIFT > MAX_NODES_SHIFT #endif +/* There are currently 3 zones: DMA, Normal & Highmem, thus we need 2 bits */ +#define MAX_ZONES_SHIFT 2 + +#if ZONES_SHIFT > MAX_ZONES_SHIFT +#error ZONES_SHIFT > MAX_ZONES_SHIFT +#endif + extern DECLARE_BITMAP(node_online_map, MAX_NUMNODES); extern DECLARE_BITMAP(memblk_online_map, MAX_NR_MEMBLKS); diff --git a/include/linux/module.h b/include/linux/module.h index 13ff244afdbf..95cbc9b4936f 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -54,12 +54,16 @@ const struct exception_table_entry * search_extable(const struct exception_table_entry *first, const struct exception_table_entry *last, unsigned long value); +void sort_extable(struct exception_table_entry *start, + struct exception_table_entry *finish); +void sort_main_extable(void); #ifdef MODULE #define ___module_cat(a,b) __mod_ ## a ## b #define __module_cat(a,b) ___module_cat(a,b) #define __MODULE_INFO(tag, name, info) \ static const char __module_cat(name,__LINE__)[] \ + __attribute_used__ \ __attribute__((section(".modinfo"),unused)) = __stringify(tag) "=" info #define MODULE_GENERIC_TABLE(gtype,name) \ @@ -142,6 +146,7 @@ void *__symbol_get_gpl(const char *symbol); #define __CRC_SYMBOL(sym, sec) \ extern void *__crc_##sym __attribute__((weak)); \ static const unsigned long __kcrctab_##sym \ + __attribute_used__ \ __attribute__((section("__kcrctab" sec), unused)) \ = (unsigned long) &__crc_##sym; #else @@ -155,6 +160,7 @@ void *__symbol_get_gpl(const char *symbol); __attribute__((section("__ksymtab_strings"))) \ = MODULE_SYMBOL_PREFIX #sym; \ static const struct kernel_symbol __ksymtab_##sym \ + __attribute_used__ \ __attribute__((section("__ksymtab" sec), unused)) \ = { (unsigned long)&sym, __kstrtab_##sym } diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h index 0a5becbed774..cbca00722b5c 100644 --- a/include/linux/moduleparam.h +++ b/include/linux/moduleparam.h @@ -52,6 +52,7 @@ struct kparam_array #define __module_param_call(prefix, name, set, get, arg, perm) \ static char __param_str_##name[] __initdata = prefix #name; \ static struct kernel_param const __param_##name \ + __attribute_used__ \ __attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) \ = { __param_str_##name, perm, set, get, arg } diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 666d89f875f5..cfdeaaad2b7e 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -831,7 +831,7 @@ static inline void netif_rx_complete(struct net_device *dev) unsigned long flags; local_irq_save(flags); - if (!test_bit(__LINK_STATE_RX_SCHED, &dev->state)) BUG(); + BUG_ON(!test_bit(__LINK_STATE_RX_SCHED, &dev->state)); list_del(&dev->poll_list); smp_mb__before_clear_bit(); clear_bit(__LINK_STATE_RX_SCHED, &dev->state); @@ -857,7 +857,7 @@ static inline void netif_poll_enable(struct net_device *dev) */ static inline void __netif_rx_complete(struct net_device *dev) { - if (!test_bit(__LINK_STATE_RX_SCHED, &dev->state)) BUG(); + BUG_ON(!test_bit(__LINK_STATE_RX_SCHED, &dev->state)); list_del(&dev->poll_list); smp_mb__before_clear_bit(); clear_bit(__LINK_STATE_RX_SCHED, &dev->state); diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 93edc5a5ad98..5ae592b26d63 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h @@ -255,8 +255,7 @@ nfs_file_cred(struct file *file) if (file) cred = (struct rpc_cred *)file->private_data; #ifdef RPC_DEBUG - if (cred && cred->cr_magic != RPCAUTH_CRED_MAGIC) - BUG(); + BUG_ON(cred && cred->cr_magic != RPCAUTH_CRED_MAGIC); #endif return cred; } diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 86d2bbccd9ea..4dba6ec06e3a 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -291,6 +291,7 @@ #define PCI_DEVICE_ID_ATI_RADEON_Ig 0x4967 /* Radeon RV280 (9200) */ #define PCI_DEVICE_ID_ATI_RADEON_Y_ 0x5960 +#define PCI_DEVICE_ID_ATI_RADEON_Yd 0x5964 /* Radeon R300 (9500) */ #define PCI_DEVICE_ID_ATI_RADEON_AD 0x4144 /* Radeon R300 (9700) */ diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h index ad88acfd7b70..155c9a2af016 100644 --- a/include/linux/quotaops.h +++ b/include/linux/quotaops.h @@ -44,8 +44,7 @@ extern struct quotactl_ops vfs_quotactl_ops; static __inline__ void DQUOT_INIT(struct inode *inode) { - if (!inode->i_sb) - BUG(); + BUG_ON(!inode->i_sb); if (sb_any_quota_enabled(inode->i_sb) && !IS_NOQUOTA(inode)) inode->i_sb->dq_op->initialize(inode, -1); } @@ -53,8 +52,7 @@ static __inline__ void DQUOT_INIT(struct inode *inode) static __inline__ void DQUOT_DROP(struct inode *inode) { if (IS_QUOTAINIT(inode)) { - if (!inode->i_sb) - BUG(); + BUG_ON(!inode->i_sb); inode->i_sb->dq_op->drop(inode); /* Ops must be set when there's any quota... */ } } diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index c9466321a2b2..7b6e12c45dc9 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h @@ -23,7 +23,8 @@ #define TRANSLUCENT 5UL #define HSM 6UL #define MULTIPATH 7UL -#define MAX_PERSONALITY 8UL +#define RAID6 8UL +#define MAX_PERSONALITY 9UL #define LEVEL_MULTIPATH (-4) #define LEVEL_LINEAR (-1) @@ -41,6 +42,7 @@ static inline int pers_to_level (int pers) case RAID0: return 0; case RAID1: return 1; case RAID5: return 5; + case RAID6: return 6; } BUG(); return MD_RESERVED; @@ -57,6 +59,7 @@ static inline int level_to_pers (int level) case 1: return RAID1; case 4: case 5: return RAID5; + case 6: return RAID6; } return MD_RESERVED; } @@ -188,6 +191,8 @@ struct mddev_s int sb_dirty; int ro; + struct gendisk *gendisk; + /* Superblock information */ int major_version, minor_version, diff --git a/include/linux/raid/raid5.h b/include/linux/raid/raid5.h index fb61a8967408..1cabc4d80e6a 100644 --- a/include/linux/raid/raid5.h +++ b/include/linux/raid/raid5.h @@ -70,7 +70,7 @@ * 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 is it copied + * When a buffer on the write list is committed for write it is 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 diff --git a/include/linux/sched.h b/include/linux/sched.h index dba09fa98441..f5f84aedbaec 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -50,7 +50,7 @@ struct exec_domain; #define CLONE_SETTLS 0x00080000 /* create a new TLS for the child */ #define CLONE_PARENT_SETTID 0x00100000 /* set the TID in the parent */ #define CLONE_CHILD_CLEARTID 0x00200000 /* clear the TID in the child */ -#define CLONE_DETACHED 0x00400000 /* Not used - CLONE_THREAD implies detached uniquely */ +#define CLONE_DETACHED 0x00400000 /* Unused, ignored */ #define CLONE_UNTRACED 0x00800000 /* set if the tracing process can't force CLONE_PTRACE on this clone */ #define CLONE_CHILD_SETTID 0x01000000 /* set the TID in the child */ #define CLONE_STOPPED 0x02000000 /* Start in stopped state */ diff --git a/include/linux/sctp.h b/include/linux/sctp.h index a022f9f629f6..9ddc3bd5cd81 100644 --- a/include/linux/sctp.h +++ b/include/linux/sctp.h @@ -439,12 +439,13 @@ typedef enum { * 0x0101 Operation Refused Due to Resource Shortage. * 0x0102 Request to Delete Source IP Address. * 0x0103 Association Aborted due to illegal ASCONF-ACK + * 0x0104 Request refused - no authorization. */ SCTP_ERROR_DEL_LAST_IP = __constant_htons(0x0100), SCTP_ERROR_RSRC_LOW = __constant_htons(0x0101), SCTP_ERROR_DEL_SRC_IP = __constant_htons(0x0102), SCTP_ERROR_ASCONF_ACK = __constant_htons(0x0103), - + SCTP_ERROR_REQ_REFUSED = __constant_htons(0x0104) } sctp_error_t; diff --git a/include/linux/security.h b/include/linux/security.h index 06b2c60a48f8..92786e0700c3 100644 --- a/include/linux/security.h +++ b/include/linux/security.h @@ -46,6 +46,8 @@ extern void cap_capset_set (struct task_struct *target, kernel_cap_t *effective, extern int cap_bprm_set_security (struct linux_binprm *bprm); extern void cap_bprm_compute_creds (struct linux_binprm *bprm); extern int cap_bprm_secureexec(struct linux_binprm *bprm); +extern int cap_inode_setxattr(struct dentry *dentry, char *name, void *value, size_t size, int flags); +extern int cap_inode_removexattr(struct dentry *dentry, char *name); extern int cap_task_post_setuid (uid_t old_ruid, uid_t old_euid, uid_t old_suid, int flags); extern void cap_task_reparent_to_init (struct task_struct *p); extern int cap_syslog (int type); @@ -2155,7 +2157,7 @@ static inline void security_inode_delete (struct inode *inode) static inline int security_inode_setxattr (struct dentry *dentry, char *name, void *value, size_t size, int flags) { - return 0; + return cap_inode_setxattr(dentry, name, value, size, flags); } static inline void security_inode_post_setxattr (struct dentry *dentry, char *name, @@ -2174,7 +2176,7 @@ static inline int security_inode_listxattr (struct dentry *dentry) static inline int security_inode_removexattr (struct dentry *dentry, char *name) { - return 0; + return cap_inode_removexattr(dentry, name); } static inline int security_inode_getsecurity(struct dentry *dentry, const char *name, void *buffer, size_t size) diff --git a/include/linux/smp_lock.h b/include/linux/smp_lock.h index 80fbd56eb3e4..9a20995c531a 100644 --- a/include/linux/smp_lock.h +++ b/include/linux/smp_lock.h @@ -49,8 +49,7 @@ static inline void lock_kernel(void) static inline void unlock_kernel(void) { - if (unlikely(current->lock_depth < 0)) - BUG(); + BUG_ON(current->lock_depth < 0); if (likely(--current->lock_depth < 0)) put_kernel_lock(); } diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h index a9575c349cfe..299b31438ffc 100644 --- a/include/linux/sunrpc/cache.h +++ b/include/linux/sunrpc/cache.h @@ -94,6 +94,8 @@ struct cache_detail { /* fields for communication over channel */ struct list_head queue; struct proc_dir_entry *proc_ent; + struct proc_dir_entry *flush_ent, *channel_ent, *content_ent; + atomic_t readers; /* how many time is /chennel open */ time_t last_close; /* it no readers, when did last close */ }; diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index b8be51acff95..0d5b121f54a0 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -580,6 +580,7 @@ enum { NET_SCTP_HB_INTERVAL = 10, NET_SCTP_PRESERVE_ENABLE = 11, NET_SCTP_MAX_BURST = 12, + NET_SCTP_ADDIP_ENABLE = 13, }; /* /proc/sys/net/bridge */ @@ -737,6 +738,8 @@ extern int proc_dointvec_minmax(ctl_table *, int, struct file *, void __user *, size_t *); extern int proc_dointvec_jiffies(ctl_table *, int, struct file *, void __user *, size_t *); +extern int proc_dointvec_userhz_jiffies(ctl_table *, int, struct file *, + void __user *, size_t *); extern int proc_doulongvec_minmax(ctl_table *, int, struct file *, void __user *, size_t *); extern int proc_doulongvec_ms_jiffies_minmax(ctl_table *table, int, diff --git a/include/linux/xattr.h b/include/linux/xattr.h index 9e967b58ee2e..d9c5d5c83d49 100644 --- a/include/linux/xattr.h +++ b/include/linux/xattr.h @@ -12,4 +12,6 @@ #define XATTR_CREATE 0x1 /* set value, fail if attr already exists */ #define XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */ +#define XATTR_SECURITY_PREFIX "security." + #endif /* _LINUX_XATTR_H */ |
