diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/bio.h | 10 | ||||
| -rw-r--r-- | include/linux/blkdev.h | 2 | ||||
| -rw-r--r-- | include/linux/module.h | 25 | ||||
| -rw-r--r-- | include/linux/pci_ids.h | 1 | ||||
| -rw-r--r-- | include/linux/slab_def.h | 10 | ||||
| -rw-r--r-- | include/media/v4l2-device.h | 8 |
6 files changed, 30 insertions, 26 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h index 0942765cf8c0..2aa283ab062b 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
| @@ -451,12 +451,13 @@ extern struct biovec_slab bvec_slabs[BIOVEC_NR_POOLS] __read_mostly; | |||
| 451 | 451 | ||
| 452 | #ifdef CONFIG_HIGHMEM | 452 | #ifdef CONFIG_HIGHMEM |
| 453 | /* | 453 | /* |
| 454 | * remember to add offset! and never ever reenable interrupts between a | 454 | * remember never ever reenable interrupts between a bvec_kmap_irq and |
| 455 | * bvec_kmap_irq and bvec_kunmap_irq!! | 455 | * bvec_kunmap_irq! |
| 456 | * | 456 | * |
| 457 | * This function MUST be inlined - it plays with the CPU interrupt flags. | 457 | * This function MUST be inlined - it plays with the CPU interrupt flags. |
| 458 | */ | 458 | */ |
| 459 | static inline char *bvec_kmap_irq(struct bio_vec *bvec, unsigned long *flags) | 459 | static __always_inline char *bvec_kmap_irq(struct bio_vec *bvec, |
| 460 | unsigned long *flags) | ||
| 460 | { | 461 | { |
| 461 | unsigned long addr; | 462 | unsigned long addr; |
| 462 | 463 | ||
| @@ -472,7 +473,8 @@ static inline char *bvec_kmap_irq(struct bio_vec *bvec, unsigned long *flags) | |||
| 472 | return (char *) addr + bvec->bv_offset; | 473 | return (char *) addr + bvec->bv_offset; |
| 473 | } | 474 | } |
| 474 | 475 | ||
| 475 | static inline void bvec_kunmap_irq(char *buffer, unsigned long *flags) | 476 | static __always_inline void bvec_kunmap_irq(char *buffer, |
| 477 | unsigned long *flags) | ||
| 476 | { | 478 | { |
| 477 | unsigned long ptr = (unsigned long) buffer & PAGE_MASK; | 479 | unsigned long ptr = (unsigned long) buffer & PAGE_MASK; |
| 478 | 480 | ||
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index d08c4b8219a6..dcaa0fd84b02 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
| @@ -455,7 +455,7 @@ struct request_queue | |||
| 455 | 455 | ||
| 456 | #define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \ | 456 | #define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \ |
| 457 | (1 << QUEUE_FLAG_CLUSTER) | \ | 457 | (1 << QUEUE_FLAG_CLUSTER) | \ |
| 458 | 1 << QUEUE_FLAG_STACKABLE) | 458 | (1 << QUEUE_FLAG_STACKABLE)) |
| 459 | 459 | ||
| 460 | static inline int queue_is_locked(struct request_queue *q) | 460 | static inline int queue_is_locked(struct request_queue *q) |
| 461 | { | 461 | { |
diff --git a/include/linux/module.h b/include/linux/module.h index 4f7ea12463d3..f3b8329eb5b8 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
| @@ -219,11 +219,6 @@ void *__symbol_get_gpl(const char *symbol); | |||
| 219 | 219 | ||
| 220 | #endif | 220 | #endif |
| 221 | 221 | ||
| 222 | struct module_ref | ||
| 223 | { | ||
| 224 | local_t count; | ||
| 225 | } ____cacheline_aligned; | ||
| 226 | |||
| 227 | enum module_state | 222 | enum module_state |
| 228 | { | 223 | { |
| 229 | MODULE_STATE_LIVE, | 224 | MODULE_STATE_LIVE, |
| @@ -344,8 +339,11 @@ struct module | |||
| 344 | /* Destruction function. */ | 339 | /* Destruction function. */ |
| 345 | void (*exit)(void); | 340 | void (*exit)(void); |
| 346 | 341 | ||
| 347 | /* Reference counts */ | 342 | #ifdef CONFIG_SMP |
| 348 | struct module_ref ref[NR_CPUS]; | 343 | char *refptr; |
| 344 | #else | ||
| 345 | local_t ref; | ||
| 346 | #endif | ||
| 349 | #endif | 347 | #endif |
| 350 | }; | 348 | }; |
| 351 | #ifndef MODULE_ARCH_INIT | 349 | #ifndef MODULE_ARCH_INIT |
| @@ -395,13 +393,22 @@ void __symbol_put(const char *symbol); | |||
| 395 | #define symbol_put(x) __symbol_put(MODULE_SYMBOL_PREFIX #x) | 393 | #define symbol_put(x) __symbol_put(MODULE_SYMBOL_PREFIX #x) |
| 396 | void symbol_put_addr(void *addr); | 394 | void symbol_put_addr(void *addr); |
| 397 | 395 | ||
| 396 | static inline local_t *__module_ref_addr(struct module *mod, int cpu) | ||
| 397 | { | ||
| 398 | #ifdef CONFIG_SMP | ||
| 399 | return (local_t *) (mod->refptr + per_cpu_offset(cpu)); | ||
| 400 | #else | ||
| 401 | return &mod->ref; | ||
| 402 | #endif | ||
| 403 | } | ||
| 404 | |||
| 398 | /* Sometimes we know we already have a refcount, and it's easier not | 405 | /* Sometimes we know we already have a refcount, and it's easier not |
| 399 | to handle the error case (which only happens with rmmod --wait). */ | 406 | to handle the error case (which only happens with rmmod --wait). */ |
| 400 | static inline void __module_get(struct module *module) | 407 | static inline void __module_get(struct module *module) |
| 401 | { | 408 | { |
| 402 | if (module) { | 409 | if (module) { |
| 403 | BUG_ON(module_refcount(module) == 0); | 410 | BUG_ON(module_refcount(module) == 0); |
| 404 | local_inc(&module->ref[get_cpu()].count); | 411 | local_inc(__module_ref_addr(module, get_cpu())); |
| 405 | put_cpu(); | 412 | put_cpu(); |
| 406 | } | 413 | } |
| 407 | } | 414 | } |
| @@ -413,7 +420,7 @@ static inline int try_module_get(struct module *module) | |||
| 413 | if (module) { | 420 | if (module) { |
| 414 | unsigned int cpu = get_cpu(); | 421 | unsigned int cpu = get_cpu(); |
| 415 | if (likely(module_is_live(module))) | 422 | if (likely(module_is_live(module))) |
| 416 | local_inc(&module->ref[cpu].count); | 423 | local_inc(__module_ref_addr(module, cpu)); |
| 417 | else | 424 | else |
| 418 | ret = 0; | 425 | ret = 0; |
| 419 | put_cpu(); | 426 | put_cpu(); |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index febc10ed3858..52a9fe08451c 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
| @@ -2425,6 +2425,7 @@ | |||
| 2425 | #define PCI_DEVICE_ID_INTEL_ICH7_0 0x27b8 | 2425 | #define PCI_DEVICE_ID_INTEL_ICH7_0 0x27b8 |
| 2426 | #define PCI_DEVICE_ID_INTEL_ICH7_1 0x27b9 | 2426 | #define PCI_DEVICE_ID_INTEL_ICH7_1 0x27b9 |
| 2427 | #define PCI_DEVICE_ID_INTEL_ICH7_30 0x27b0 | 2427 | #define PCI_DEVICE_ID_INTEL_ICH7_30 0x27b0 |
| 2428 | #define PCI_DEVICE_ID_INTEL_TGP_LPC 0x27bc | ||
| 2428 | #define PCI_DEVICE_ID_INTEL_ICH7_31 0x27bd | 2429 | #define PCI_DEVICE_ID_INTEL_ICH7_31 0x27bd |
| 2429 | #define PCI_DEVICE_ID_INTEL_ICH7_17 0x27da | 2430 | #define PCI_DEVICE_ID_INTEL_ICH7_17 0x27da |
| 2430 | #define PCI_DEVICE_ID_INTEL_ICH7_19 0x27dd | 2431 | #define PCI_DEVICE_ID_INTEL_ICH7_19 0x27dd |
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h index 39c3a5eb8ebe..6ca6a7b66d75 100644 --- a/include/linux/slab_def.h +++ b/include/linux/slab_def.h | |||
| @@ -43,10 +43,7 @@ static inline void *kmalloc(size_t size, gfp_t flags) | |||
| 43 | i++; | 43 | i++; |
| 44 | #include <linux/kmalloc_sizes.h> | 44 | #include <linux/kmalloc_sizes.h> |
| 45 | #undef CACHE | 45 | #undef CACHE |
| 46 | { | 46 | return NULL; |
| 47 | extern void __you_cannot_kmalloc_that_much(void); | ||
| 48 | __you_cannot_kmalloc_that_much(); | ||
| 49 | } | ||
| 50 | found: | 47 | found: |
| 51 | #ifdef CONFIG_ZONE_DMA | 48 | #ifdef CONFIG_ZONE_DMA |
| 52 | if (flags & GFP_DMA) | 49 | if (flags & GFP_DMA) |
| @@ -77,10 +74,7 @@ static inline void *kmalloc_node(size_t size, gfp_t flags, int node) | |||
| 77 | i++; | 74 | i++; |
| 78 | #include <linux/kmalloc_sizes.h> | 75 | #include <linux/kmalloc_sizes.h> |
| 79 | #undef CACHE | 76 | #undef CACHE |
| 80 | { | 77 | return NULL; |
| 81 | extern void __you_cannot_kmalloc_that_much(void); | ||
| 82 | __you_cannot_kmalloc_that_much(); | ||
| 83 | } | ||
| 84 | found: | 78 | found: |
| 85 | #ifdef CONFIG_ZONE_DMA | 79 | #ifdef CONFIG_ZONE_DMA |
| 86 | if (flags & GFP_DMA) | 80 | if (flags & GFP_DMA) |
diff --git a/include/media/v4l2-device.h b/include/media/v4l2-device.h index 9bf4ccc93dbf..55e41afd95ef 100644 --- a/include/media/v4l2-device.h +++ b/include/media/v4l2-device.h | |||
| @@ -94,16 +94,16 @@ void v4l2_device_unregister_subdev(struct v4l2_subdev *sd); | |||
| 94 | /* Call the specified callback for all subdevs matching grp_id (if 0, then | 94 | /* Call the specified callback for all subdevs matching grp_id (if 0, then |
| 95 | match them all). Ignore any errors. Note that you cannot add or delete | 95 | match them all). Ignore any errors. Note that you cannot add or delete |
| 96 | a subdev while walking the subdevs list. */ | 96 | a subdev while walking the subdevs list. */ |
| 97 | #define v4l2_device_call_all(dev, grp_id, o, f, args...) \ | 97 | #define v4l2_device_call_all(dev, grpid, o, f, args...) \ |
| 98 | __v4l2_device_call_subdevs(dev, \ | 98 | __v4l2_device_call_subdevs(dev, \ |
| 99 | !(grp_id) || sd->grp_id == (grp_id), o, f , ##args) | 99 | !(grpid) || sd->grp_id == (grpid), o, f , ##args) |
| 100 | 100 | ||
| 101 | /* Call the specified callback for all subdevs matching grp_id (if 0, then | 101 | /* Call the specified callback for all subdevs matching grp_id (if 0, then |
| 102 | match them all). If the callback returns an error other than 0 or | 102 | match them all). If the callback returns an error other than 0 or |
| 103 | -ENOIOCTLCMD, then return with that error code. Note that you cannot | 103 | -ENOIOCTLCMD, then return with that error code. Note that you cannot |
| 104 | add or delete a subdev while walking the subdevs list. */ | 104 | add or delete a subdev while walking the subdevs list. */ |
| 105 | #define v4l2_device_call_until_err(dev, grp_id, o, f, args...) \ | 105 | #define v4l2_device_call_until_err(dev, grpid, o, f, args...) \ |
| 106 | __v4l2_device_call_subdevs_until_err(dev, \ | 106 | __v4l2_device_call_subdevs_until_err(dev, \ |
| 107 | !(grp_id) || sd->grp_id == (grp_id), o, f , ##args) | 107 | !(grpid) || sd->grp_id == (grpid), o, f , ##args) |
| 108 | 108 | ||
| 109 | #endif | 109 | #endif |
