aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2010-05-19 22:57:38 -0400
committerPaul Mundt <lethal@linux-sh.org>2010-05-19 22:57:38 -0400
commitffee72d4681c8777918268a96aef42bdeb6c367b (patch)
tree4baf91483886d561c198ed0524ab54b783273e86 /include
parentfb54d268329846aa13b2bc44a64d90e9b7131192 (diff)
parentf72caf7e496465182eeda842ac66a5e75404ddf1 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/atomic.h2
-rw-r--r--include/asm-generic/bitops/arch_hweight.h25
-rw-r--r--include/asm-generic/bitops/const_hweight.h42
-rw-r--r--include/asm-generic/bitops/hweight.h8
-rw-r--r--include/asm-generic/dma-mapping-common.h4
-rw-r--r--include/drm/drm_pciids.h1
-rw-r--r--include/drm/ttm/ttm_bo_driver.h28
-rw-r--r--include/linux/acpi.h5
-rw-r--r--include/linux/amba/mmci.h23
-rw-r--r--include/linux/ata.h4
-rw-r--r--include/linux/backing-dev.h2
-rw-r--r--include/linux/bitops.h33
-rw-r--r--include/linux/blkdev.h35
-rw-r--r--include/linux/cgroup.h1
-rw-r--r--include/linux/clocksource.h19
-rw-r--r--include/linux/coda_psdev.h3
-rw-r--r--include/linux/cpufreq.h30
-rw-r--r--include/linux/cpuset.h16
-rw-r--r--include/linux/dcache.h14
-rw-r--r--include/linux/debugobjects.h11
-rw-r--r--include/linux/device.h4
-rw-r--r--include/linux/drbd.h2
-rw-r--r--include/linux/drbd_nl.h3
-rw-r--r--include/linux/elf.h1
-rw-r--r--include/linux/firewire-cdev.h78
-rw-r--r--include/linux/firewire-constants.h29
-rw-r--r--include/linux/fs.h6
-rw-r--r--include/linux/ftrace.h61
-rw-r--r--include/linux/ftrace_event.h1
-rw-r--r--include/linux/genhd.h2
-rw-r--r--include/linux/hrtimer.h2
-rw-r--r--include/linux/hw_breakpoint.h25
-rw-r--r--include/linux/i2c.h2
-rw-r--r--include/linux/i2o.h1
-rw-r--r--include/linux/ide.h1
-rw-r--r--include/linux/if_link.h23
-rw-r--r--include/linux/init_task.h1
-rw-r--r--include/linux/input/matrix_keypad.h2
-rw-r--r--include/linux/interrupt.h32
-rw-r--r--include/linux/iommu.h24
-rw-r--r--include/linux/irq.h1
-rw-r--r--include/linux/iscsi_ibft.h8
-rw-r--r--include/linux/kernel.h13
-rw-r--r--include/linux/kfifo.h3
-rw-r--r--include/linux/ktime.h10
-rw-r--r--include/linux/kvm_host.h7
-rw-r--r--include/linux/lcm.h8
-rw-r--r--include/linux/mm.h8
-rw-r--r--include/linux/mod_devicetable.h9
-rw-r--r--include/linux/module.h6
-rw-r--r--include/linux/ncp_fs_sb.h2
-rw-r--r--include/linux/nfs_fs.h15
-rw-r--r--include/linux/nfs_fs_sb.h2
-rw-r--r--include/linux/nfs_xdr.h7
-rw-r--r--include/linux/nfsd/nfsfh.h6
-rw-r--r--include/linux/page_cgroup.h6
-rw-r--r--include/linux/perf_event.h83
-rw-r--r--include/linux/platform_device.h6
-rw-r--r--include/linux/poison.h9
-rw-r--r--include/linux/ptrace.h12
-rw-r--r--include/linux/radix-tree.h7
-rw-r--r--include/linux/rbtree.h5
-rw-r--r--include/linux/rcupdate.h113
-rw-r--r--include/linux/rcutiny.h31
-rw-r--r--include/linux/rcutree.h7
-rw-r--r--include/linux/regulator/consumer.h8
-rw-r--r--include/linux/ring_buffer.h10
-rw-r--r--include/linux/sched.h80
-rw-r--r--include/linux/sh_clk.h150
-rw-r--r--include/linux/sh_dma.h9
-rw-r--r--include/linux/sh_intc.h20
-rw-r--r--include/linux/slab.h1
-rw-r--r--include/linux/smb_fs_sb.h3
-rw-r--r--include/linux/srcu.h6
-rw-r--r--include/linux/stop_machine.h122
-rw-r--r--include/linux/sunrpc/auth.h1
-rw-r--r--include/linux/sunrpc/auth_gss.h1
-rw-r--r--include/linux/sunrpc/gss_api.h8
-rw-r--r--include/linux/sunrpc/gss_krb5.h184
-rw-r--r--include/linux/sunrpc/metrics.h7
-rw-r--r--include/linux/sunrpc/sched.h20
-rw-r--r--include/linux/sunrpc/xdr.h8
-rw-r--r--include/linux/sunrpc/xprt.h13
-rw-r--r--include/linux/tick.h5
-rw-r--r--include/linux/time.h1
-rw-r--r--include/linux/timer.h10
-rw-r--r--include/linux/timex.h5
-rw-r--r--include/linux/tracepoint.h114
-rw-r--r--include/linux/types.h4
-rw-r--r--include/linux/usb.h18
-rw-r--r--include/linux/virtio_console.h23
-rw-r--r--include/linux/wait.h35
-rw-r--r--include/linux/writeback.h3
-rw-r--r--include/linux/zorro.h22
-rw-r--r--include/media/saa7146_vv.h1
-rw-r--r--include/net/sctp/command.h1
-rw-r--r--include/net/sctp/sctp.h1
-rw-r--r--include/net/sctp/sm.h1
-rw-r--r--include/net/sctp/structs.h4
-rw-r--r--include/net/sock.h2
-rw-r--r--include/net/tcp.h21
-rw-r--r--include/net/x25.h4
-rw-r--r--include/pcmcia/ds.h7
-rw-r--r--include/pcmcia/ss.h8
-rw-r--r--include/sound/ak4113.h2
-rw-r--r--include/sound/soc-dai.h18
-rw-r--r--include/sound/soc.h1
-rw-r--r--include/trace/define_trace.h5
-rw-r--r--include/trace/events/block.h164
-rw-r--r--include/trace/events/lock.h55
-rw-r--r--include/trace/events/module.h18
-rw-r--r--include/trace/events/napi.h10
-rw-r--r--include/trace/events/sched.h32
-rw-r--r--include/trace/events/signal.h52
-rw-r--r--include/trace/ftrace.h56
115 files changed, 1677 insertions, 667 deletions
diff --git a/include/asm-generic/atomic.h b/include/asm-generic/atomic.h
index c99c64dc5f3d..c33749f95b32 100644
--- a/include/asm-generic/atomic.h
+++ b/include/asm-generic/atomic.h
@@ -33,7 +33,7 @@
33 * Atomically reads the value of @v. Note that the guaranteed 33 * Atomically reads the value of @v. Note that the guaranteed
34 * useful range of an atomic_t is only 24 bits. 34 * useful range of an atomic_t is only 24 bits.
35 */ 35 */
36#define atomic_read(v) ((v)->counter) 36#define atomic_read(v) (*(volatile int *)&(v)->counter)
37 37
38/** 38/**
39 * atomic_set - set atomic variable 39 * atomic_set - set atomic variable
diff --git a/include/asm-generic/bitops/arch_hweight.h b/include/asm-generic/bitops/arch_hweight.h
new file mode 100644
index 000000000000..6a211f40665c
--- /dev/null
+++ b/include/asm-generic/bitops/arch_hweight.h
@@ -0,0 +1,25 @@
1#ifndef _ASM_GENERIC_BITOPS_ARCH_HWEIGHT_H_
2#define _ASM_GENERIC_BITOPS_ARCH_HWEIGHT_H_
3
4#include <asm/types.h>
5
6static inline unsigned int __arch_hweight32(unsigned int w)
7{
8 return __sw_hweight32(w);
9}
10
11static inline unsigned int __arch_hweight16(unsigned int w)
12{
13 return __sw_hweight16(w);
14}
15
16static inline unsigned int __arch_hweight8(unsigned int w)
17{
18 return __sw_hweight8(w);
19}
20
21static inline unsigned long __arch_hweight64(__u64 w)
22{
23 return __sw_hweight64(w);
24}
25#endif /* _ASM_GENERIC_BITOPS_HWEIGHT_H_ */
diff --git a/include/asm-generic/bitops/const_hweight.h b/include/asm-generic/bitops/const_hweight.h
new file mode 100644
index 000000000000..fa2a50b7ee66
--- /dev/null
+++ b/include/asm-generic/bitops/const_hweight.h
@@ -0,0 +1,42 @@
1#ifndef _ASM_GENERIC_BITOPS_CONST_HWEIGHT_H_
2#define _ASM_GENERIC_BITOPS_CONST_HWEIGHT_H_
3
4/*
5 * Compile time versions of __arch_hweightN()
6 */
7#define __const_hweight8(w) \
8 ( (!!((w) & (1ULL << 0))) + \
9 (!!((w) & (1ULL << 1))) + \
10 (!!((w) & (1ULL << 2))) + \
11 (!!((w) & (1ULL << 3))) + \
12 (!!((w) & (1ULL << 4))) + \
13 (!!((w) & (1ULL << 5))) + \
14 (!!((w) & (1ULL << 6))) + \
15 (!!((w) & (1ULL << 7))) )
16
17#define __const_hweight16(w) (__const_hweight8(w) + __const_hweight8((w) >> 8 ))
18#define __const_hweight32(w) (__const_hweight16(w) + __const_hweight16((w) >> 16))
19#define __const_hweight64(w) (__const_hweight32(w) + __const_hweight32((w) >> 32))
20
21/*
22 * Generic interface.
23 */
24#define hweight8(w) (__builtin_constant_p(w) ? __const_hweight8(w) : __arch_hweight8(w))
25#define hweight16(w) (__builtin_constant_p(w) ? __const_hweight16(w) : __arch_hweight16(w))
26#define hweight32(w) (__builtin_constant_p(w) ? __const_hweight32(w) : __arch_hweight32(w))
27#define hweight64(w) (__builtin_constant_p(w) ? __const_hweight64(w) : __arch_hweight64(w))
28
29/*
30 * Interface for known constant arguments
31 */
32#define HWEIGHT8(w) (BUILD_BUG_ON_ZERO(!__builtin_constant_p(w)) + __const_hweight8(w))
33#define HWEIGHT16(w) (BUILD_BUG_ON_ZERO(!__builtin_constant_p(w)) + __const_hweight16(w))
34#define HWEIGHT32(w) (BUILD_BUG_ON_ZERO(!__builtin_constant_p(w)) + __const_hweight32(w))
35#define HWEIGHT64(w) (BUILD_BUG_ON_ZERO(!__builtin_constant_p(w)) + __const_hweight64(w))
36
37/*
38 * Type invariant interface to the compile time constant hweight functions.
39 */
40#define HWEIGHT(w) HWEIGHT64((u64)w)
41
42#endif /* _ASM_GENERIC_BITOPS_CONST_HWEIGHT_H_ */
diff --git a/include/asm-generic/bitops/hweight.h b/include/asm-generic/bitops/hweight.h
index fbbc383771da..a94d6519c7ed 100644
--- a/include/asm-generic/bitops/hweight.h
+++ b/include/asm-generic/bitops/hweight.h
@@ -1,11 +1,7 @@
1#ifndef _ASM_GENERIC_BITOPS_HWEIGHT_H_ 1#ifndef _ASM_GENERIC_BITOPS_HWEIGHT_H_
2#define _ASM_GENERIC_BITOPS_HWEIGHT_H_ 2#define _ASM_GENERIC_BITOPS_HWEIGHT_H_
3 3
4#include <asm/types.h> 4#include <asm-generic/bitops/arch_hweight.h>
5 5#include <asm-generic/bitops/const_hweight.h>
6extern unsigned int hweight32(unsigned int w);
7extern unsigned int hweight16(unsigned int w);
8extern unsigned int hweight8(unsigned int w);
9extern unsigned long hweight64(__u64 w);
10 6
11#endif /* _ASM_GENERIC_BITOPS_HWEIGHT_H_ */ 7#endif /* _ASM_GENERIC_BITOPS_HWEIGHT_H_ */
diff --git a/include/asm-generic/dma-mapping-common.h b/include/asm-generic/dma-mapping-common.h
index e694263445f7..69206957b72c 100644
--- a/include/asm-generic/dma-mapping-common.h
+++ b/include/asm-generic/dma-mapping-common.h
@@ -131,7 +131,7 @@ static inline void dma_sync_single_range_for_cpu(struct device *dev,
131 debug_dma_sync_single_range_for_cpu(dev, addr, offset, size, dir); 131 debug_dma_sync_single_range_for_cpu(dev, addr, offset, size, dir);
132 132
133 } else 133 } else
134 dma_sync_single_for_cpu(dev, addr, size, dir); 134 dma_sync_single_for_cpu(dev, addr + offset, size, dir);
135} 135}
136 136
137static inline void dma_sync_single_range_for_device(struct device *dev, 137static inline void dma_sync_single_range_for_device(struct device *dev,
@@ -148,7 +148,7 @@ static inline void dma_sync_single_range_for_device(struct device *dev,
148 debug_dma_sync_single_range_for_device(dev, addr, offset, size, dir); 148 debug_dma_sync_single_range_for_device(dev, addr, offset, size, dir);
149 149
150 } else 150 } else
151 dma_sync_single_for_device(dev, addr, size, dir); 151 dma_sync_single_for_device(dev, addr + offset, size, dir);
152} 152}
153 153
154static inline void 154static inline void
diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h
index 04a6ebc27b96..2d428b088cc8 100644
--- a/include/drm/drm_pciids.h
+++ b/include/drm/drm_pciids.h
@@ -6,6 +6,7 @@
6 {0x1002, 0x3150, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY}, \ 6 {0x1002, 0x3150, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY}, \
7 {0x1002, 0x3152, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 7 {0x1002, 0x3152, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
8 {0x1002, 0x3154, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 8 {0x1002, 0x3154, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
9 {0x1002, 0x3155, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
9 {0x1002, 0x3E50, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \ 10 {0x1002, 0x3E50, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \
10 {0x1002, 0x3E54, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \ 11 {0x1002, 0x3E54, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \
11 {0x1002, 0x4136, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS100|RADEON_IS_IGP}, \ 12 {0x1002, 0x4136, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS100|RADEON_IS_IGP}, \
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
index e929c27ede22..6b9db917e717 100644
--- a/include/drm/ttm/ttm_bo_driver.h
+++ b/include/drm/ttm/ttm_bo_driver.h
@@ -789,34 +789,6 @@ extern void ttm_bo_unreserve(struct ttm_buffer_object *bo);
789extern int ttm_bo_wait_unreserved(struct ttm_buffer_object *bo, 789extern int ttm_bo_wait_unreserved(struct ttm_buffer_object *bo,
790 bool interruptible); 790 bool interruptible);
791 791
792/**
793 * ttm_bo_block_reservation
794 *
795 * @bo: A pointer to a struct ttm_buffer_object.
796 * @interruptible: Use interruptible sleep when waiting.
797 * @no_wait: Don't sleep, but rather return -EBUSY.
798 *
799 * Block reservation for validation by simply reserving the buffer.
800 * This is intended for single buffer use only without eviction,
801 * and thus needs no deadlock protection.
802 *
803 * Returns:
804 * -EBUSY: If no_wait == 1 and the buffer is already reserved.
805 * -ERESTARTSYS: If interruptible == 1 and the process received a signal
806 * while sleeping.
807 */
808extern int ttm_bo_block_reservation(struct ttm_buffer_object *bo,
809 bool interruptible, bool no_wait);
810
811/**
812 * ttm_bo_unblock_reservation
813 *
814 * @bo: A pointer to a struct ttm_buffer_object.
815 *
816 * Unblocks reservation leaving lru lists untouched.
817 */
818extern void ttm_bo_unblock_reservation(struct ttm_buffer_object *bo);
819
820/* 792/*
821 * ttm_bo_util.c 793 * ttm_bo_util.c
822 */ 794 */
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index b926afe8c03e..3da73f5f0ae9 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -116,11 +116,12 @@ extern unsigned long acpi_realmode_flags;
116 116
117int acpi_register_gsi (struct device *dev, u32 gsi, int triggering, int polarity); 117int acpi_register_gsi (struct device *dev, u32 gsi, int triggering, int polarity);
118int acpi_gsi_to_irq (u32 gsi, unsigned int *irq); 118int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
119int acpi_isa_irq_to_gsi (unsigned isa_irq, u32 *gsi);
119 120
120#ifdef CONFIG_X86_IO_APIC 121#ifdef CONFIG_X86_IO_APIC
121extern int acpi_get_override_irq(int bus_irq, int *trigger, int *polarity); 122extern int acpi_get_override_irq(u32 gsi, int *trigger, int *polarity);
122#else 123#else
123#define acpi_get_override_irq(bus, trigger, polarity) (-1) 124#define acpi_get_override_irq(gsi, trigger, polarity) (-1)
124#endif 125#endif
125/* 126/*
126 * This function undoes the effect of one call to acpi_register_gsi(). 127 * This function undoes the effect of one call to acpi_register_gsi().
diff --git a/include/linux/amba/mmci.h b/include/linux/amba/mmci.h
index 6b4241748dda..7e466fe72025 100644
--- a/include/linux/amba/mmci.h
+++ b/include/linux/amba/mmci.h
@@ -6,8 +6,29 @@
6 6
7#include <linux/mmc/host.h> 7#include <linux/mmc/host.h>
8 8
9/**
10 * struct mmci_platform_data - platform configuration for the MMCI
11 * (also known as PL180) block.
12 * @f_max: the maximum operational frequency for this host in this
13 * platform configuration. When this is specified it takes precedence
14 * over the module parameter for the same frequency.
15 * @ocr_mask: available voltages on the 4 pins from the block, this
16 * is ignored if a regulator is used, see the MMC_VDD_* masks in
17 * mmc/host.h
18 * @translate_vdd: a callback function to translate a MMC_VDD_*
19 * mask into a value to be binary or:ed and written into the
20 * MMCIPWR register of the block
21 * @status: if no GPIO read function was given to the block in
22 * gpio_wp (below) this function will be called to determine
23 * whether a card is present in the MMC slot or not
24 * @gpio_wp: read this GPIO pin to see if the card is write protected
25 * @gpio_cd: read this GPIO pin to detect card insertion
26 * @capabilities: the capabilities of the block as implemented in
27 * this platform, signify anything MMC_CAP_* from mmc/host.h
28 */
9struct mmci_platform_data { 29struct mmci_platform_data {
10 unsigned int ocr_mask; /* available voltages */ 30 unsigned int f_max;
31 unsigned int ocr_mask;
11 u32 (*translate_vdd)(struct device *, unsigned int); 32 u32 (*translate_vdd)(struct device *, unsigned int);
12 unsigned int (*status)(struct device *); 33 unsigned int (*status)(struct device *);
13 int gpio_wp; 34 int gpio_wp;
diff --git a/include/linux/ata.h b/include/linux/ata.h
index b4c85e2adef5..700c5b9b3583 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -1025,8 +1025,8 @@ static inline int ata_ok(u8 status)
1025 1025
1026static inline int lba_28_ok(u64 block, u32 n_block) 1026static inline int lba_28_ok(u64 block, u32 n_block)
1027{ 1027{
1028 /* check the ending block number */ 1028 /* check the ending block number: must be LESS THAN 0x0fffffff */
1029 return ((block + n_block) < ((u64)1 << 28)) && (n_block <= 256); 1029 return ((block + n_block) < ((1 << 28) - 1)) && (n_block <= 256);
1030} 1030}
1031 1031
1032static inline int lba_48_ok(u64 block, u32 n_block) 1032static inline int lba_48_ok(u64 block, u32 n_block)
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index fcbc26af00e4..bd0e3c6f323f 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -101,6 +101,7 @@ int bdi_register(struct backing_dev_info *bdi, struct device *parent,
101 const char *fmt, ...); 101 const char *fmt, ...);
102int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev); 102int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev);
103void bdi_unregister(struct backing_dev_info *bdi); 103void bdi_unregister(struct backing_dev_info *bdi);
104int bdi_setup_and_register(struct backing_dev_info *, char *, unsigned int);
104void bdi_start_writeback(struct backing_dev_info *bdi, struct super_block *sb, 105void bdi_start_writeback(struct backing_dev_info *bdi, struct super_block *sb,
105 long nr_pages); 106 long nr_pages);
106int bdi_writeback_task(struct bdi_writeback *wb); 107int bdi_writeback_task(struct bdi_writeback *wb);
@@ -246,6 +247,7 @@ int bdi_set_max_ratio(struct backing_dev_info *bdi, unsigned int max_ratio);
246#endif 247#endif
247 248
248extern struct backing_dev_info default_backing_dev_info; 249extern struct backing_dev_info default_backing_dev_info;
250extern struct backing_dev_info noop_backing_dev_info;
249void default_unplug_io_fn(struct backing_dev_info *bdi, struct page *page); 251void default_unplug_io_fn(struct backing_dev_info *bdi, struct page *page);
250 252
251int writeback_in_progress(struct backing_dev_info *bdi); 253int writeback_in_progress(struct backing_dev_info *bdi);
diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index b79389879238..fc68053378ce 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -10,6 +10,11 @@
10#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long)) 10#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long))
11#endif 11#endif
12 12
13extern unsigned int __sw_hweight8(unsigned int w);
14extern unsigned int __sw_hweight16(unsigned int w);
15extern unsigned int __sw_hweight32(unsigned int w);
16extern unsigned long __sw_hweight64(__u64 w);
17
13/* 18/*
14 * Include this here because some architectures need generic_ffs/fls in 19 * Include this here because some architectures need generic_ffs/fls in
15 * scope 20 * scope
@@ -21,9 +26,6 @@
21 (bit) < (size); \ 26 (bit) < (size); \
22 (bit) = find_next_bit((addr), (size), (bit) + 1)) 27 (bit) = find_next_bit((addr), (size), (bit) + 1))
23 28
24/* Temporary */
25#define for_each_bit(bit, addr, size) for_each_set_bit(bit, addr, size)
26
27static __inline__ int get_bitmask_order(unsigned int count) 29static __inline__ int get_bitmask_order(unsigned int count)
28{ 30{
29 int order; 31 int order;
@@ -47,31 +49,6 @@ static inline unsigned long hweight_long(unsigned long w)
47 return sizeof(w) == 4 ? hweight32(w) : hweight64(w); 49 return sizeof(w) == 4 ? hweight32(w) : hweight64(w);
48} 50}
49 51
50/*
51 * Clearly slow versions of the hweightN() functions, their benefit is
52 * of course compile time evaluation of constant arguments.
53 */
54#define HWEIGHT8(w) \
55 ( BUILD_BUG_ON_ZERO(!__builtin_constant_p(w)) + \
56 (!!((w) & (1ULL << 0))) + \
57 (!!((w) & (1ULL << 1))) + \
58 (!!((w) & (1ULL << 2))) + \
59 (!!((w) & (1ULL << 3))) + \
60 (!!((w) & (1ULL << 4))) + \
61 (!!((w) & (1ULL << 5))) + \
62 (!!((w) & (1ULL << 6))) + \
63 (!!((w) & (1ULL << 7))) )
64
65#define HWEIGHT16(w) (HWEIGHT8(w) + HWEIGHT8((w) >> 8))
66#define HWEIGHT32(w) (HWEIGHT16(w) + HWEIGHT16((w) >> 16))
67#define HWEIGHT64(w) (HWEIGHT32(w) + HWEIGHT32((w) >> 32))
68
69/*
70 * Type invariant version that simply casts things to the
71 * largest type.
72 */
73#define HWEIGHT(w) HWEIGHT64((u64)(w))
74
75/** 52/**
76 * rol32 - rotate a 32-bit value left 53 * rol32 - rotate a 32-bit value left
77 * @word: value to rotate 54 * @word: value to rotate
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index ebd22dbed861..6690e8bae7bb 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -158,7 +158,6 @@ enum rq_flag_bits {
158struct request { 158struct request {
159 struct list_head queuelist; 159 struct list_head queuelist;
160 struct call_single_data csd; 160 struct call_single_data csd;
161 int cpu;
162 161
163 struct request_queue *q; 162 struct request_queue *q;
164 163
@@ -166,9 +165,11 @@ struct request {
166 enum rq_cmd_type_bits cmd_type; 165 enum rq_cmd_type_bits cmd_type;
167 unsigned long atomic_flags; 166 unsigned long atomic_flags;
168 167
168 int cpu;
169
169 /* the following two fields are internal, NEVER access directly */ 170 /* the following two fields are internal, NEVER access directly */
170 sector_t __sector; /* sector cursor */
171 unsigned int __data_len; /* total data len */ 171 unsigned int __data_len; /* total data len */
172 sector_t __sector; /* sector cursor */
172 173
173 struct bio *bio; 174 struct bio *bio;
174 struct bio *biotail; 175 struct bio *biotail;
@@ -201,20 +202,20 @@ struct request {
201 202
202 unsigned short ioprio; 203 unsigned short ioprio;
203 204
205 int ref_count;
206
204 void *special; /* opaque pointer available for LLD use */ 207 void *special; /* opaque pointer available for LLD use */
205 char *buffer; /* kaddr of the current segment if available */ 208 char *buffer; /* kaddr of the current segment if available */
206 209
207 int tag; 210 int tag;
208 int errors; 211 int errors;
209 212
210 int ref_count;
211
212 /* 213 /*
213 * when request is used as a packet command carrier 214 * when request is used as a packet command carrier
214 */ 215 */
215 unsigned short cmd_len;
216 unsigned char __cmd[BLK_MAX_CDB]; 216 unsigned char __cmd[BLK_MAX_CDB];
217 unsigned char *cmd; 217 unsigned char *cmd;
218 unsigned short cmd_len;
218 219
219 unsigned int extra_len; /* length of alignment and padding */ 220 unsigned int extra_len; /* length of alignment and padding */
220 unsigned int sense_len; 221 unsigned int sense_len;
@@ -921,26 +922,7 @@ extern void blk_cleanup_queue(struct request_queue *);
921extern void blk_queue_make_request(struct request_queue *, make_request_fn *); 922extern void blk_queue_make_request(struct request_queue *, make_request_fn *);
922extern void blk_queue_bounce_limit(struct request_queue *, u64); 923extern void blk_queue_bounce_limit(struct request_queue *, u64);
923extern void blk_queue_max_hw_sectors(struct request_queue *, unsigned int); 924extern void blk_queue_max_hw_sectors(struct request_queue *, unsigned int);
924
925/* Temporary compatibility wrapper */
926static inline void blk_queue_max_sectors(struct request_queue *q, unsigned int max)
927{
928 blk_queue_max_hw_sectors(q, max);
929}
930
931extern void blk_queue_max_segments(struct request_queue *, unsigned short); 925extern void blk_queue_max_segments(struct request_queue *, unsigned short);
932
933static inline void blk_queue_max_phys_segments(struct request_queue *q, unsigned short max)
934{
935 blk_queue_max_segments(q, max);
936}
937
938static inline void blk_queue_max_hw_segments(struct request_queue *q, unsigned short max)
939{
940 blk_queue_max_segments(q, max);
941}
942
943
944extern void blk_queue_max_segment_size(struct request_queue *, unsigned int); 926extern void blk_queue_max_segment_size(struct request_queue *, unsigned int);
945extern void blk_queue_max_discard_sectors(struct request_queue *q, 927extern void blk_queue_max_discard_sectors(struct request_queue *q,
946 unsigned int max_discard_sectors); 928 unsigned int max_discard_sectors);
@@ -1030,11 +1012,6 @@ static inline int sb_issue_discard(struct super_block *sb,
1030 1012
1031extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm); 1013extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm);
1032 1014
1033#define MAX_PHYS_SEGMENTS 128
1034#define MAX_HW_SEGMENTS 128
1035#define SAFE_MAX_SECTORS 255
1036#define MAX_SEGMENT_SIZE 65536
1037
1038enum blk_default_limits { 1015enum blk_default_limits {
1039 BLK_MAX_SEGMENTS = 128, 1016 BLK_MAX_SEGMENTS = 128,
1040 BLK_SAFE_MAX_SECTORS = 255, 1017 BLK_SAFE_MAX_SECTORS = 255,
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index b8ad1ea99586..8f78073d7caa 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -530,6 +530,7 @@ static inline struct cgroup_subsys_state *task_subsys_state(
530{ 530{
531 return rcu_dereference_check(task->cgroups->subsys[subsys_id], 531 return rcu_dereference_check(task->cgroups->subsys[subsys_id],
532 rcu_read_lock_held() || 532 rcu_read_lock_held() ||
533 lockdep_is_held(&task->alloc_lock) ||
533 cgroup_lock_is_held()); 534 cgroup_lock_is_held());
534} 535}
535 536
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index 4bca8b60cdf7..5ea3c60c160c 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -273,7 +273,6 @@ static inline s64 clocksource_cyc2ns(cycle_t cycles, u32 mult, u32 shift)
273} 273}
274 274
275 275
276/* used to install a new clocksource */
277extern int clocksource_register(struct clocksource*); 276extern int clocksource_register(struct clocksource*);
278extern void clocksource_unregister(struct clocksource*); 277extern void clocksource_unregister(struct clocksource*);
279extern void clocksource_touch_watchdog(void); 278extern void clocksource_touch_watchdog(void);
@@ -287,6 +286,24 @@ extern void clocksource_mark_unstable(struct clocksource *cs);
287extern void 286extern void
288clocks_calc_mult_shift(u32 *mult, u32 *shift, u32 from, u32 to, u32 minsec); 287clocks_calc_mult_shift(u32 *mult, u32 *shift, u32 from, u32 to, u32 minsec);
289 288
289/*
290 * Don't call __clocksource_register_scale directly, use
291 * clocksource_register_hz/khz
292 */
293extern int
294__clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq);
295
296static inline int clocksource_register_hz(struct clocksource *cs, u32 hz)
297{
298 return __clocksource_register_scale(cs, 1, hz);
299}
300
301static inline int clocksource_register_khz(struct clocksource *cs, u32 khz)
302{
303 return __clocksource_register_scale(cs, 1000, khz);
304}
305
306
290static inline void 307static inline void
291clocksource_calc_mult_shift(struct clocksource *cs, u32 freq, u32 minsec) 308clocksource_calc_mult_shift(struct clocksource *cs, u32 freq, u32 minsec)
292{ 309{
diff --git a/include/linux/coda_psdev.h b/include/linux/coda_psdev.h
index 5b5d4731f956..8859e2ede9fe 100644
--- a/include/linux/coda_psdev.h
+++ b/include/linux/coda_psdev.h
@@ -7,6 +7,8 @@
7#define MAX_CODADEVS 5 /* how many do we allow */ 7#define MAX_CODADEVS 5 /* how many do we allow */
8 8
9#ifdef __KERNEL__ 9#ifdef __KERNEL__
10#include <linux/backing-dev.h>
11
10struct kstatfs; 12struct kstatfs;
11 13
12/* communication pending/processing queues */ 14/* communication pending/processing queues */
@@ -17,6 +19,7 @@ struct venus_comm {
17 struct list_head vc_processing; 19 struct list_head vc_processing;
18 int vc_inuse; 20 int vc_inuse;
19 struct super_block *vc_sb; 21 struct super_block *vc_sb;
22 struct backing_dev_info bdi;
20}; 23};
21 24
22 25
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 4de02b10007f..9f15150ce8d6 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -278,6 +278,27 @@ struct freq_attr {
278 ssize_t (*store)(struct cpufreq_policy *, const char *, size_t count); 278 ssize_t (*store)(struct cpufreq_policy *, const char *, size_t count);
279}; 279};
280 280
281#define cpufreq_freq_attr_ro(_name) \
282static struct freq_attr _name = \
283__ATTR(_name, 0444, show_##_name, NULL)
284
285#define cpufreq_freq_attr_ro_perm(_name, _perm) \
286static struct freq_attr _name = \
287__ATTR(_name, _perm, show_##_name, NULL)
288
289#define cpufreq_freq_attr_ro_old(_name) \
290static struct freq_attr _name##_old = \
291__ATTR(_name, 0444, show_##_name##_old, NULL)
292
293#define cpufreq_freq_attr_rw(_name) \
294static struct freq_attr _name = \
295__ATTR(_name, 0644, show_##_name, store_##_name)
296
297#define cpufreq_freq_attr_rw_old(_name) \
298static struct freq_attr _name##_old = \
299__ATTR(_name, 0644, show_##_name##_old, store_##_name##_old)
300
301
281struct global_attr { 302struct global_attr {
282 struct attribute attr; 303 struct attribute attr;
283 ssize_t (*show)(struct kobject *kobj, 304 ssize_t (*show)(struct kobject *kobj,
@@ -286,6 +307,15 @@ struct global_attr {
286 const char *c, size_t count); 307 const char *c, size_t count);
287}; 308};
288 309
310#define define_one_global_ro(_name) \
311static struct global_attr _name = \
312__ATTR(_name, 0444, show_##_name, NULL)
313
314#define define_one_global_rw(_name) \
315static struct global_attr _name = \
316__ATTR(_name, 0644, show_##_name, store_##_name)
317
318
289/********************************************************************* 319/*********************************************************************
290 * CPUFREQ 2.6. INTERFACE * 320 * CPUFREQ 2.6. INTERFACE *
291 *********************************************************************/ 321 *********************************************************************/
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h
index a5740fc4d04b..a73454aec333 100644
--- a/include/linux/cpuset.h
+++ b/include/linux/cpuset.h
@@ -21,8 +21,7 @@ extern int number_of_cpusets; /* How many cpusets are defined in system? */
21extern int cpuset_init(void); 21extern int cpuset_init(void);
22extern void cpuset_init_smp(void); 22extern void cpuset_init_smp(void);
23extern void cpuset_cpus_allowed(struct task_struct *p, struct cpumask *mask); 23extern void cpuset_cpus_allowed(struct task_struct *p, struct cpumask *mask);
24extern void cpuset_cpus_allowed_locked(struct task_struct *p, 24extern int cpuset_cpus_allowed_fallback(struct task_struct *p);
25 struct cpumask *mask);
26extern nodemask_t cpuset_mems_allowed(struct task_struct *p); 25extern nodemask_t cpuset_mems_allowed(struct task_struct *p);
27#define cpuset_current_mems_allowed (current->mems_allowed) 26#define cpuset_current_mems_allowed (current->mems_allowed)
28void cpuset_init_current_mems_allowed(void); 27void cpuset_init_current_mems_allowed(void);
@@ -69,9 +68,6 @@ struct seq_file;
69extern void cpuset_task_status_allowed(struct seq_file *m, 68extern void cpuset_task_status_allowed(struct seq_file *m,
70 struct task_struct *task); 69 struct task_struct *task);
71 70
72extern void cpuset_lock(void);
73extern void cpuset_unlock(void);
74
75extern int cpuset_mem_spread_node(void); 71extern int cpuset_mem_spread_node(void);
76 72
77static inline int cpuset_do_page_mem_spread(void) 73static inline int cpuset_do_page_mem_spread(void)
@@ -105,10 +101,11 @@ static inline void cpuset_cpus_allowed(struct task_struct *p,
105{ 101{
106 cpumask_copy(mask, cpu_possible_mask); 102 cpumask_copy(mask, cpu_possible_mask);
107} 103}
108static inline void cpuset_cpus_allowed_locked(struct task_struct *p, 104
109 struct cpumask *mask) 105static inline int cpuset_cpus_allowed_fallback(struct task_struct *p)
110{ 106{
111 cpumask_copy(mask, cpu_possible_mask); 107 cpumask_copy(&p->cpus_allowed, cpu_possible_mask);
108 return cpumask_any(cpu_active_mask);
112} 109}
113 110
114static inline nodemask_t cpuset_mems_allowed(struct task_struct *p) 111static inline nodemask_t cpuset_mems_allowed(struct task_struct *p)
@@ -157,9 +154,6 @@ static inline void cpuset_task_status_allowed(struct seq_file *m,
157{ 154{
158} 155}
159 156
160static inline void cpuset_lock(void) {}
161static inline void cpuset_unlock(void) {}
162
163static inline int cpuset_mem_spread_node(void) 157static inline int cpuset_mem_spread_node(void)
164{ 158{
165 return 0; 159 return 0;
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 30b93b2a01a4..eebb617c17d8 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -186,6 +186,8 @@ d_iput: no no no yes
186 186
187#define DCACHE_FSNOTIFY_PARENT_WATCHED 0x0080 /* Parent inode is watched by some fsnotify listener */ 187#define DCACHE_FSNOTIFY_PARENT_WATCHED 0x0080 /* Parent inode is watched by some fsnotify listener */
188 188
189#define DCACHE_CANT_MOUNT 0x0100
190
189extern spinlock_t dcache_lock; 191extern spinlock_t dcache_lock;
190extern seqlock_t rename_lock; 192extern seqlock_t rename_lock;
191 193
@@ -358,6 +360,18 @@ static inline int d_unlinked(struct dentry *dentry)
358 return d_unhashed(dentry) && !IS_ROOT(dentry); 360 return d_unhashed(dentry) && !IS_ROOT(dentry);
359} 361}
360 362
363static inline int cant_mount(struct dentry *dentry)
364{
365 return (dentry->d_flags & DCACHE_CANT_MOUNT);
366}
367
368static inline void dont_mount(struct dentry *dentry)
369{
370 spin_lock(&dentry->d_lock);
371 dentry->d_flags |= DCACHE_CANT_MOUNT;
372 spin_unlock(&dentry->d_lock);
373}
374
361static inline struct dentry *dget_parent(struct dentry *dentry) 375static inline struct dentry *dget_parent(struct dentry *dentry)
362{ 376{
363 struct dentry *ret; 377 struct dentry *ret;
diff --git a/include/linux/debugobjects.h b/include/linux/debugobjects.h
index 8c243aaa86a7..597692f1fc8d 100644
--- a/include/linux/debugobjects.h
+++ b/include/linux/debugobjects.h
@@ -20,12 +20,14 @@ struct debug_obj_descr;
20 * struct debug_obj - representaion of an tracked object 20 * struct debug_obj - representaion of an tracked object
21 * @node: hlist node to link the object into the tracker list 21 * @node: hlist node to link the object into the tracker list
22 * @state: tracked object state 22 * @state: tracked object state
23 * @astate: current active state
23 * @object: pointer to the real object 24 * @object: pointer to the real object
24 * @descr: pointer to an object type specific debug description structure 25 * @descr: pointer to an object type specific debug description structure
25 */ 26 */
26struct debug_obj { 27struct debug_obj {
27 struct hlist_node node; 28 struct hlist_node node;
28 enum debug_obj_state state; 29 enum debug_obj_state state;
30 unsigned int astate;
29 void *object; 31 void *object;
30 struct debug_obj_descr *descr; 32 struct debug_obj_descr *descr;
31}; 33};
@@ -60,6 +62,15 @@ extern void debug_object_deactivate(void *addr, struct debug_obj_descr *descr);
60extern void debug_object_destroy (void *addr, struct debug_obj_descr *descr); 62extern void debug_object_destroy (void *addr, struct debug_obj_descr *descr);
61extern void debug_object_free (void *addr, struct debug_obj_descr *descr); 63extern void debug_object_free (void *addr, struct debug_obj_descr *descr);
62 64
65/*
66 * Active state:
67 * - Set at 0 upon initialization.
68 * - Must return to 0 before deactivation.
69 */
70extern void
71debug_object_active_state(void *addr, struct debug_obj_descr *descr,
72 unsigned int expect, unsigned int next);
73
63extern void debug_objects_early_init(void); 74extern void debug_objects_early_init(void);
64extern void debug_objects_mem_init(void); 75extern void debug_objects_mem_init(void);
65#else 76#else
diff --git a/include/linux/device.h b/include/linux/device.h
index 182192892d45..241b96bcd7ad 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -451,6 +451,10 @@ struct device {
451 451
452static inline const char *dev_name(const struct device *dev) 452static inline const char *dev_name(const struct device *dev)
453{ 453{
454 /* Use the init name until the kobject becomes available */
455 if (dev->init_name)
456 return dev->init_name;
457
454 return kobject_name(&dev->kobj); 458 return kobject_name(&dev->kobj);
455} 459}
456 460
diff --git a/include/linux/drbd.h b/include/linux/drbd.h
index 78962272338a..4341b1a97a34 100644
--- a/include/linux/drbd.h
+++ b/include/linux/drbd.h
@@ -56,7 +56,7 @@ extern const char *drbd_buildtag(void);
56#define REL_VERSION "8.3.7" 56#define REL_VERSION "8.3.7"
57#define API_VERSION 88 57#define API_VERSION 88
58#define PRO_VERSION_MIN 86 58#define PRO_VERSION_MIN 86
59#define PRO_VERSION_MAX 91 59#define PRO_VERSION_MAX 92
60 60
61 61
62enum drbd_io_error_p { 62enum drbd_io_error_p {
diff --git a/include/linux/drbd_nl.h b/include/linux/drbd_nl.h
index a4d82f895994..f7431a4ca608 100644
--- a/include/linux/drbd_nl.h
+++ b/include/linux/drbd_nl.h
@@ -12,7 +12,7 @@
12#endif 12#endif
13 13
14NL_PACKET(primary, 1, 14NL_PACKET(primary, 1,
15 NL_BIT( 1, T_MAY_IGNORE, overwrite_peer) 15 NL_BIT( 1, T_MAY_IGNORE, primary_force)
16) 16)
17 17
18NL_PACKET(secondary, 2, ) 18NL_PACKET(secondary, 2, )
@@ -63,6 +63,7 @@ NL_PACKET(net_conf, 5,
63 NL_BIT( 41, T_MAY_IGNORE, always_asbp) 63 NL_BIT( 41, T_MAY_IGNORE, always_asbp)
64 NL_BIT( 61, T_MAY_IGNORE, no_cork) 64 NL_BIT( 61, T_MAY_IGNORE, no_cork)
65 NL_BIT( 62, T_MANDATORY, auto_sndbuf_size) 65 NL_BIT( 62, T_MANDATORY, auto_sndbuf_size)
66 NL_BIT( 70, T_MANDATORY, dry_run)
66) 67)
67 68
68NL_PACKET(disconnect, 6, ) 69NL_PACKET(disconnect, 6, )
diff --git a/include/linux/elf.h b/include/linux/elf.h
index 597858418051..4d608014753a 100644
--- a/include/linux/elf.h
+++ b/include/linux/elf.h
@@ -394,6 +394,7 @@ typedef struct elf64_shdr {
394#define NT_S390_TODPREG 0x303 /* s390 TOD programmable register */ 394#define NT_S390_TODPREG 0x303 /* s390 TOD programmable register */
395#define NT_S390_CTRS 0x304 /* s390 control registers */ 395#define NT_S390_CTRS 0x304 /* s390 control registers */
396#define NT_S390_PREFIX 0x305 /* s390 prefix register */ 396#define NT_S390_PREFIX 0x305 /* s390 prefix register */
397#define NT_S390_LAST_BREAK 0x306 /* s390 breaking event address */
397 398
398 399
399/* Note header in a PT_NOTE section */ 400/* Note header in a PT_NOTE section */
diff --git a/include/linux/firewire-cdev.h b/include/linux/firewire-cdev.h
index 40b11013408e..68f883b30a53 100644
--- a/include/linux/firewire-cdev.h
+++ b/include/linux/firewire-cdev.h
@@ -1,21 +1,26 @@
1/* 1/*
2 * Char device interface. 2 * Char device interface.
3 * 3 *
4 * Copyright (C) 2005-2006 Kristian Hoegsberg <krh@bitplanet.net> 4 * Copyright (C) 2005-2007 Kristian Hoegsberg <krh@bitplanet.net>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * it under the terms of the GNU General Public License as published by 7 * copy of this software and associated documentation files (the "Software"),
8 * the Free Software Foundation; either version 2 of the License, or 8 * to deal in the Software without restriction, including without limitation
9 * (at your option) any later version. 9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * 10 * and/or sell copies of the Software, and to permit persons to whom the
11 * This program is distributed in the hope that it will be useful, 11 * Software is furnished to do so, subject to the following conditions:
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * The above copyright notice and this permission notice (including the next
14 * GNU General Public License for more details. 14 * paragraph) shall be included in all copies or substantial portions of the
15 * 15 * Software.
16 * You should have received a copy of the GNU General Public License 16 *
17 * along with this program; if not, write to the Free Software Foundation, 17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23 * DEALINGS IN THE SOFTWARE.
19 */ 24 */
20 25
21#ifndef _LINUX_FIREWIRE_CDEV_H 26#ifndef _LINUX_FIREWIRE_CDEV_H
@@ -438,7 +443,7 @@ struct fw_cdev_remove_descriptor {
438 * @type: %FW_CDEV_ISO_CONTEXT_TRANSMIT or %FW_CDEV_ISO_CONTEXT_RECEIVE 443 * @type: %FW_CDEV_ISO_CONTEXT_TRANSMIT or %FW_CDEV_ISO_CONTEXT_RECEIVE
439 * @header_size: Header size to strip for receive contexts 444 * @header_size: Header size to strip for receive contexts
440 * @channel: Channel to bind to 445 * @channel: Channel to bind to
441 * @speed: Speed to transmit at 446 * @speed: Speed for transmit contexts
442 * @closure: To be returned in &fw_cdev_event_iso_interrupt 447 * @closure: To be returned in &fw_cdev_event_iso_interrupt
443 * @handle: Handle to context, written back by kernel 448 * @handle: Handle to context, written back by kernel
444 * 449 *
@@ -451,6 +456,9 @@ struct fw_cdev_remove_descriptor {
451 * If a context was successfully created, the kernel writes back a handle to the 456 * If a context was successfully created, the kernel writes back a handle to the
452 * context, which must be passed in for subsequent operations on that context. 457 * context, which must be passed in for subsequent operations on that context.
453 * 458 *
459 * For receive contexts, @header_size must be at least 4 and must be a multiple
460 * of 4.
461 *
454 * Note that the effect of a @header_size > 4 depends on 462 * Note that the effect of a @header_size > 4 depends on
455 * &fw_cdev_get_info.version, as documented at &fw_cdev_event_iso_interrupt. 463 * &fw_cdev_get_info.version, as documented at &fw_cdev_event_iso_interrupt.
456 */ 464 */
@@ -481,10 +489,34 @@ struct fw_cdev_create_iso_context {
481 * 489 *
482 * &struct fw_cdev_iso_packet is used to describe isochronous packet queues. 490 * &struct fw_cdev_iso_packet is used to describe isochronous packet queues.
483 * 491 *
484 * Use the FW_CDEV_ISO_ macros to fill in @control. The sy and tag fields are 492 * Use the FW_CDEV_ISO_ macros to fill in @control.
485 * specified by IEEE 1394a and IEC 61883. 493 *
486 * 494 * For transmit packets, the header length must be a multiple of 4 and specifies
487 * FIXME - finish this documentation 495 * the numbers of bytes in @header that will be prepended to the packet's
496 * payload; these bytes are copied into the kernel and will not be accessed
497 * after the ioctl has returned. The sy and tag fields are copied to the iso
498 * packet header (these fields are specified by IEEE 1394a and IEC 61883-1).
499 * The skip flag specifies that no packet is to be sent in a frame; when using
500 * this, all other fields except the interrupt flag must be zero.
501 *
502 * For receive packets, the header length must be a multiple of the context's
503 * header size; if the header length is larger than the context's header size,
504 * multiple packets are queued for this entry. The sy and tag fields are
505 * ignored. If the sync flag is set, the context drops all packets until
506 * a packet with a matching sy field is received (the sync value to wait for is
507 * specified in the &fw_cdev_start_iso structure). The payload length defines
508 * how many payload bytes can be received for one packet (in addition to payload
509 * quadlets that have been defined as headers and are stripped and returned in
510 * the &fw_cdev_event_iso_interrupt structure). If more bytes are received, the
511 * additional bytes are dropped. If less bytes are received, the remaining
512 * bytes in this part of the payload buffer will not be written to, not even by
513 * the next packet, i.e., packets received in consecutive frames will not
514 * necessarily be consecutive in memory. If an entry has queued multiple
515 * packets, the payload length is divided equally among them.
516 *
517 * When a packet with the interrupt flag set has been completed, the
518 * &fw_cdev_event_iso_interrupt event will be sent. An entry that has queued
519 * multiple receive packets is completed when its last packet is completed.
488 */ 520 */
489struct fw_cdev_iso_packet { 521struct fw_cdev_iso_packet {
490 __u32 control; 522 __u32 control;
@@ -501,7 +533,7 @@ struct fw_cdev_iso_packet {
501 * Queue a number of isochronous packets for reception or transmission. 533 * Queue a number of isochronous packets for reception or transmission.
502 * This ioctl takes a pointer to an array of &fw_cdev_iso_packet structs, 534 * This ioctl takes a pointer to an array of &fw_cdev_iso_packet structs,
503 * which describe how to transmit from or receive into a contiguous region 535 * which describe how to transmit from or receive into a contiguous region
504 * of a mmap()'ed payload buffer. As part of the packet descriptors, 536 * of a mmap()'ed payload buffer. As part of transmit packet descriptors,
505 * a series of headers can be supplied, which will be prepended to the 537 * a series of headers can be supplied, which will be prepended to the
506 * payload during DMA. 538 * payload during DMA.
507 * 539 *
@@ -620,8 +652,8 @@ struct fw_cdev_get_cycle_timer2 {
620 * instead of allocated. 652 * instead of allocated.
621 * An %FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED event concludes this operation. 653 * An %FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED event concludes this operation.
622 * 654 *
623 * To summarize, %FW_CDEV_IOC_DEALLOCATE_ISO_RESOURCE allocates iso resources 655 * To summarize, %FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE allocates iso resources
624 * for the lifetime of the fd or handle. 656 * for the lifetime of the fd or @handle.
625 * In contrast, %FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE_ONCE allocates iso resources 657 * In contrast, %FW_CDEV_IOC_ALLOCATE_ISO_RESOURCE_ONCE allocates iso resources
626 * for the duration of a bus generation. 658 * for the duration of a bus generation.
627 * 659 *
diff --git a/include/linux/firewire-constants.h b/include/linux/firewire-constants.h
index b316770a43fd..9b4bb5fbba4b 100644
--- a/include/linux/firewire-constants.h
+++ b/include/linux/firewire-constants.h
@@ -1,3 +1,28 @@
1/*
2 * IEEE 1394 constants.
3 *
4 * Copyright (C) 2005-2007 Kristian Hoegsberg <krh@bitplanet.net>
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice (including the next
14 * paragraph) shall be included in all copies or substantial portions of the
15 * Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23 * DEALINGS IN THE SOFTWARE.
24 */
25
1#ifndef _LINUX_FIREWIRE_CONSTANTS_H 26#ifndef _LINUX_FIREWIRE_CONSTANTS_H
2#define _LINUX_FIREWIRE_CONSTANTS_H 27#define _LINUX_FIREWIRE_CONSTANTS_H
3 28
@@ -21,7 +46,7 @@
21#define EXTCODE_WRAP_ADD 0x6 46#define EXTCODE_WRAP_ADD 0x6
22#define EXTCODE_VENDOR_DEPENDENT 0x7 47#define EXTCODE_VENDOR_DEPENDENT 0x7
23 48
24/* Juju specific tcodes */ 49/* Linux firewire-core (Juju) specific tcodes */
25#define TCODE_LOCK_MASK_SWAP (0x10 | EXTCODE_MASK_SWAP) 50#define TCODE_LOCK_MASK_SWAP (0x10 | EXTCODE_MASK_SWAP)
26#define TCODE_LOCK_COMPARE_SWAP (0x10 | EXTCODE_COMPARE_SWAP) 51#define TCODE_LOCK_COMPARE_SWAP (0x10 | EXTCODE_COMPARE_SWAP)
27#define TCODE_LOCK_FETCH_ADD (0x10 | EXTCODE_FETCH_ADD) 52#define TCODE_LOCK_FETCH_ADD (0x10 | EXTCODE_FETCH_ADD)
@@ -36,7 +61,7 @@
36#define RCODE_TYPE_ERROR 0x6 61#define RCODE_TYPE_ERROR 0x6
37#define RCODE_ADDRESS_ERROR 0x7 62#define RCODE_ADDRESS_ERROR 0x7
38 63
39/* Juju specific rcodes */ 64/* Linux firewire-core (Juju) specific rcodes */
40#define RCODE_SEND_ERROR 0x10 65#define RCODE_SEND_ERROR 0x10
41#define RCODE_CANCELLED 0x11 66#define RCODE_CANCELLED 0x11
42#define RCODE_BUSY 0x12 67#define RCODE_BUSY 0x12
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 10b8dedcd18b..44f35aea2f1f 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2212,6 +2212,7 @@ extern int generic_segment_checks(const struct iovec *iov,
2212/* fs/block_dev.c */ 2212/* fs/block_dev.c */
2213extern ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov, 2213extern ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov,
2214 unsigned long nr_segs, loff_t pos); 2214 unsigned long nr_segs, loff_t pos);
2215extern int blkdev_fsync(struct file *filp, struct dentry *dentry, int datasync);
2215 2216
2216/* fs/splice.c */ 2217/* fs/splice.c */
2217extern ssize_t generic_file_splice_read(struct file *, loff_t *, 2218extern ssize_t generic_file_splice_read(struct file *, loff_t *,
@@ -2314,8 +2315,9 @@ extern int vfs_fstatat(int , char __user *, struct kstat *, int);
2314extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, 2315extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd,
2315 unsigned long arg); 2316 unsigned long arg);
2316extern int __generic_block_fiemap(struct inode *inode, 2317extern int __generic_block_fiemap(struct inode *inode,
2317 struct fiemap_extent_info *fieinfo, u64 start, 2318 struct fiemap_extent_info *fieinfo,
2318 u64 len, get_block_t *get_block); 2319 loff_t start, loff_t len,
2320 get_block_t *get_block);
2319extern int generic_block_fiemap(struct inode *inode, 2321extern int generic_block_fiemap(struct inode *inode,
2320 struct fiemap_extent_info *fieinfo, u64 start, 2322 struct fiemap_extent_info *fieinfo, u64 start,
2321 u64 len, get_block_t *get_block); 2323 u64 len, get_block_t *get_block);
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 01e6adea07ec..41e46330d9be 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -82,9 +82,13 @@ void clear_ftrace_function(void);
82extern void ftrace_stub(unsigned long a0, unsigned long a1); 82extern void ftrace_stub(unsigned long a0, unsigned long a1);
83 83
84#else /* !CONFIG_FUNCTION_TRACER */ 84#else /* !CONFIG_FUNCTION_TRACER */
85# define register_ftrace_function(ops) do { } while (0) 85/*
86# define unregister_ftrace_function(ops) do { } while (0) 86 * (un)register_ftrace_function must be a macro since the ops parameter
87# define clear_ftrace_function(ops) do { } while (0) 87 * must not be evaluated.
88 */
89#define register_ftrace_function(ops) ({ 0; })
90#define unregister_ftrace_function(ops) ({ 0; })
91static inline void clear_ftrace_function(void) { }
88static inline void ftrace_kill(void) { } 92static inline void ftrace_kill(void) { }
89static inline void ftrace_stop(void) { } 93static inline void ftrace_stop(void) { }
90static inline void ftrace_start(void) { } 94static inline void ftrace_start(void) { }
@@ -237,11 +241,13 @@ extern int skip_trace(unsigned long ip);
237extern void ftrace_disable_daemon(void); 241extern void ftrace_disable_daemon(void);
238extern void ftrace_enable_daemon(void); 242extern void ftrace_enable_daemon(void);
239#else 243#else
240# define skip_trace(ip) ({ 0; }) 244static inline int skip_trace(unsigned long ip) { return 0; }
241# define ftrace_force_update() ({ 0; }) 245static inline int ftrace_force_update(void) { return 0; }
242# define ftrace_set_filter(buf, len, reset) do { } while (0) 246static inline void ftrace_set_filter(unsigned char *buf, int len, int reset)
243# define ftrace_disable_daemon() do { } while (0) 247{
244# define ftrace_enable_daemon() do { } while (0) 248}
249static inline void ftrace_disable_daemon(void) { }
250static inline void ftrace_enable_daemon(void) { }
245static inline void ftrace_release_mod(struct module *mod) {} 251static inline void ftrace_release_mod(struct module *mod) {}
246static inline int register_ftrace_command(struct ftrace_func_command *cmd) 252static inline int register_ftrace_command(struct ftrace_func_command *cmd)
247{ 253{
@@ -314,16 +320,16 @@ static inline void __ftrace_enabled_restore(int enabled)
314 extern void time_hardirqs_on(unsigned long a0, unsigned long a1); 320 extern void time_hardirqs_on(unsigned long a0, unsigned long a1);
315 extern void time_hardirqs_off(unsigned long a0, unsigned long a1); 321 extern void time_hardirqs_off(unsigned long a0, unsigned long a1);
316#else 322#else
317# define time_hardirqs_on(a0, a1) do { } while (0) 323 static inline void time_hardirqs_on(unsigned long a0, unsigned long a1) { }
318# define time_hardirqs_off(a0, a1) do { } while (0) 324 static inline void time_hardirqs_off(unsigned long a0, unsigned long a1) { }
319#endif 325#endif
320 326
321#ifdef CONFIG_PREEMPT_TRACER 327#ifdef CONFIG_PREEMPT_TRACER
322 extern void trace_preempt_on(unsigned long a0, unsigned long a1); 328 extern void trace_preempt_on(unsigned long a0, unsigned long a1);
323 extern void trace_preempt_off(unsigned long a0, unsigned long a1); 329 extern void trace_preempt_off(unsigned long a0, unsigned long a1);
324#else 330#else
325# define trace_preempt_on(a0, a1) do { } while (0) 331 static inline void trace_preempt_on(unsigned long a0, unsigned long a1) { }
326# define trace_preempt_off(a0, a1) do { } while (0) 332 static inline void trace_preempt_off(unsigned long a0, unsigned long a1) { }
327#endif 333#endif
328 334
329#ifdef CONFIG_FTRACE_MCOUNT_RECORD 335#ifdef CONFIG_FTRACE_MCOUNT_RECORD
@@ -352,6 +358,10 @@ struct ftrace_graph_ret {
352 int depth; 358 int depth;
353}; 359};
354 360
361/* Type of the callback handlers for tracing function graph*/
362typedef void (*trace_func_graph_ret_t)(struct ftrace_graph_ret *); /* return */
363typedef int (*trace_func_graph_ent_t)(struct ftrace_graph_ent *); /* entry */
364
355#ifdef CONFIG_FUNCTION_GRAPH_TRACER 365#ifdef CONFIG_FUNCTION_GRAPH_TRACER
356 366
357/* for init task */ 367/* for init task */
@@ -400,10 +410,6 @@ extern char __irqentry_text_end[];
400 410
401#define FTRACE_RETFUNC_DEPTH 50 411#define FTRACE_RETFUNC_DEPTH 50
402#define FTRACE_RETSTACK_ALLOC_SIZE 32 412#define FTRACE_RETSTACK_ALLOC_SIZE 32
403/* Type of the callback handlers for tracing function graph*/
404typedef void (*trace_func_graph_ret_t)(struct ftrace_graph_ret *); /* return */
405typedef int (*trace_func_graph_ent_t)(struct ftrace_graph_ent *); /* entry */
406
407extern int register_ftrace_graph(trace_func_graph_ret_t retfunc, 413extern int register_ftrace_graph(trace_func_graph_ret_t retfunc,
408 trace_func_graph_ent_t entryfunc); 414 trace_func_graph_ent_t entryfunc);
409 415
@@ -441,6 +447,13 @@ static inline void unpause_graph_tracing(void)
441static inline void ftrace_graph_init_task(struct task_struct *t) { } 447static inline void ftrace_graph_init_task(struct task_struct *t) { }
442static inline void ftrace_graph_exit_task(struct task_struct *t) { } 448static inline void ftrace_graph_exit_task(struct task_struct *t) { }
443 449
450static inline int register_ftrace_graph(trace_func_graph_ret_t retfunc,
451 trace_func_graph_ent_t entryfunc)
452{
453 return -1;
454}
455static inline void unregister_ftrace_graph(void) { }
456
444static inline int task_curr_ret_stack(struct task_struct *tsk) 457static inline int task_curr_ret_stack(struct task_struct *tsk)
445{ 458{
446 return -1; 459 return -1;
@@ -492,7 +505,9 @@ static inline int test_tsk_trace_graph(struct task_struct *tsk)
492 return tsk->trace & TSK_TRACE_FL_GRAPH; 505 return tsk->trace & TSK_TRACE_FL_GRAPH;
493} 506}
494 507
495extern int ftrace_dump_on_oops; 508enum ftrace_dump_mode;
509
510extern enum ftrace_dump_mode ftrace_dump_on_oops;
496 511
497#ifdef CONFIG_PREEMPT 512#ifdef CONFIG_PREEMPT
498#define INIT_TRACE_RECURSION .trace_recursion = 0, 513#define INIT_TRACE_RECURSION .trace_recursion = 0,
@@ -504,18 +519,6 @@ extern int ftrace_dump_on_oops;
504#define INIT_TRACE_RECURSION 519#define INIT_TRACE_RECURSION
505#endif 520#endif
506 521
507#ifdef CONFIG_HW_BRANCH_TRACER
508
509void trace_hw_branch(u64 from, u64 to);
510void trace_hw_branch_oops(void);
511
512#else /* CONFIG_HW_BRANCH_TRACER */
513
514static inline void trace_hw_branch(u64 from, u64 to) {}
515static inline void trace_hw_branch_oops(void) {}
516
517#endif /* CONFIG_HW_BRANCH_TRACER */
518
519#ifdef CONFIG_FTRACE_SYSCALLS 522#ifdef CONFIG_FTRACE_SYSCALLS
520 523
521unsigned long arch_syscall_addr(int nr); 524unsigned long arch_syscall_addr(int nr);
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index c0f4b364c711..39e71b0a3bfd 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -58,6 +58,7 @@ struct trace_iterator {
58 /* The below is zeroed out in pipe_read */ 58 /* The below is zeroed out in pipe_read */
59 struct trace_seq seq; 59 struct trace_seq seq;
60 struct trace_entry *ent; 60 struct trace_entry *ent;
61 unsigned long lost_events;
61 int leftover; 62 int leftover;
62 int cpu; 63 int cpu;
63 u64 ts; 64 u64 ts;
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 56b50514ab25..5f2f4c4d8fb0 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -109,7 +109,7 @@ struct hd_struct {
109}; 109};
110 110
111#define GENHD_FL_REMOVABLE 1 111#define GENHD_FL_REMOVABLE 1
112#define GENHD_FL_DRIVERFS 2 112/* 2 is unused */
113#define GENHD_FL_MEDIA_CHANGE_NOTIFY 4 113#define GENHD_FL_MEDIA_CHANGE_NOTIFY 4
114#define GENHD_FL_CD 8 114#define GENHD_FL_CD 8
115#define GENHD_FL_UP 16 115#define GENHD_FL_UP 16
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index 5d86fb2309d2..fd0c1b857d3d 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -422,6 +422,8 @@ extern void hrtimer_init_sleeper(struct hrtimer_sleeper *sl,
422 422
423extern int schedule_hrtimeout_range(ktime_t *expires, unsigned long delta, 423extern int schedule_hrtimeout_range(ktime_t *expires, unsigned long delta,
424 const enum hrtimer_mode mode); 424 const enum hrtimer_mode mode);
425extern int schedule_hrtimeout_range_clock(ktime_t *expires,
426 unsigned long delta, const enum hrtimer_mode mode, int clock);
425extern int schedule_hrtimeout(ktime_t *expires, const enum hrtimer_mode mode); 427extern int schedule_hrtimeout(ktime_t *expires, const enum hrtimer_mode mode);
426 428
427/* Soft interrupt function to run the hrtimer queues: */ 429/* Soft interrupt function to run the hrtimer queues: */
diff --git a/include/linux/hw_breakpoint.h b/include/linux/hw_breakpoint.h
index c70d27af03f9..a2d6ea49ec56 100644
--- a/include/linux/hw_breakpoint.h
+++ b/include/linux/hw_breakpoint.h
@@ -9,9 +9,22 @@ enum {
9}; 9};
10 10
11enum { 11enum {
12 HW_BREAKPOINT_R = 1, 12 HW_BREAKPOINT_EMPTY = 0,
13 HW_BREAKPOINT_W = 2, 13 HW_BREAKPOINT_R = 1,
14 HW_BREAKPOINT_X = 4, 14 HW_BREAKPOINT_W = 2,
15 HW_BREAKPOINT_RW = HW_BREAKPOINT_R | HW_BREAKPOINT_W,
16 HW_BREAKPOINT_X = 4,
17 HW_BREAKPOINT_INVALID = HW_BREAKPOINT_RW | HW_BREAKPOINT_X,
18};
19
20enum bp_type_idx {
21 TYPE_INST = 0,
22#ifdef CONFIG_HAVE_MIXED_BREAKPOINTS_REGS
23 TYPE_DATA = 0,
24#else
25 TYPE_DATA = 1,
26#endif
27 TYPE_MAX
15}; 28};
16 29
17#ifdef __KERNEL__ 30#ifdef __KERNEL__
@@ -34,6 +47,12 @@ static inline void hw_breakpoint_init(struct perf_event_attr *attr)
34 attr->sample_period = 1; 47 attr->sample_period = 1;
35} 48}
36 49
50static inline void ptrace_breakpoint_init(struct perf_event_attr *attr)
51{
52 hw_breakpoint_init(attr);
53 attr->exclude_kernel = 1;
54}
55
37static inline unsigned long hw_breakpoint_addr(struct perf_event *bp) 56static inline unsigned long hw_breakpoint_addr(struct perf_event *bp)
38{ 57{
39 return bp->attr.bp_addr; 58 return bp->attr.bp_addr;
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 0a5da639b327..6ed1d59bfb1e 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -355,6 +355,8 @@ struct i2c_adapter {
355 int nr; 355 int nr;
356 char name[48]; 356 char name[48];
357 struct completion dev_released; 357 struct completion dev_released;
358
359 struct list_head userspace_clients;
358}; 360};
359#define to_i2c_adapter(d) container_of(d, struct i2c_adapter, dev) 361#define to_i2c_adapter(d) container_of(d, struct i2c_adapter, dev)
360 362
diff --git a/include/linux/i2o.h b/include/linux/i2o.h
index 87018dc5527d..9e7a12d6385d 100644
--- a/include/linux/i2o.h
+++ b/include/linux/i2o.h
@@ -782,7 +782,6 @@ extern int i2o_exec_lct_get(struct i2o_controller *);
782#define to_i2o_driver(drv) container_of(drv,struct i2o_driver, driver) 782#define to_i2o_driver(drv) container_of(drv,struct i2o_driver, driver)
783#define to_i2o_device(dev) container_of(dev, struct i2o_device, device) 783#define to_i2o_device(dev) container_of(dev, struct i2o_device, device)
784#define to_i2o_controller(dev) container_of(dev, struct i2o_controller, device) 784#define to_i2o_controller(dev) container_of(dev, struct i2o_controller, device)
785#define kobj_to_i2o_device(kobj) to_i2o_device(container_of(kobj, struct device, kobj))
786 785
787/** 786/**
788 * i2o_out_to_virt - Turn an I2O message to a virtual address 787 * i2o_out_to_virt - Turn an I2O message to a virtual address
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 97e6ab435184..3239d1c10acb 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1169,6 +1169,7 @@ extern void ide_stall_queue(ide_drive_t *drive, unsigned long timeout);
1169extern void ide_timer_expiry(unsigned long); 1169extern void ide_timer_expiry(unsigned long);
1170extern irqreturn_t ide_intr(int irq, void *dev_id); 1170extern irqreturn_t ide_intr(int irq, void *dev_id);
1171extern void do_ide_request(struct request_queue *); 1171extern void do_ide_request(struct request_queue *);
1172extern void ide_requeue_and_plug(ide_drive_t *drive, struct request *rq);
1172 1173
1173void ide_init_disk(struct gendisk *, ide_drive_t *); 1174void ide_init_disk(struct gendisk *, ide_drive_t *);
1174 1175
diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index c9bf92cd7653..d94963b379d9 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -79,10 +79,7 @@ enum {
79 IFLA_NET_NS_PID, 79 IFLA_NET_NS_PID,
80 IFLA_IFALIAS, 80 IFLA_IFALIAS,
81 IFLA_NUM_VF, /* Number of VFs if device is SR-IOV PF */ 81 IFLA_NUM_VF, /* Number of VFs if device is SR-IOV PF */
82 IFLA_VF_MAC, /* Hardware queue specific attributes */ 82 IFLA_VFINFO_LIST,
83 IFLA_VF_VLAN,
84 IFLA_VF_TX_RATE, /* TX Bandwidth Allocation */
85 IFLA_VFINFO,
86 __IFLA_MAX 83 __IFLA_MAX
87}; 84};
88 85
@@ -203,6 +200,24 @@ enum macvlan_mode {
203 200
204/* SR-IOV virtual function managment section */ 201/* SR-IOV virtual function managment section */
205 202
203enum {
204 IFLA_VF_INFO_UNSPEC,
205 IFLA_VF_INFO,
206 __IFLA_VF_INFO_MAX,
207};
208
209#define IFLA_VF_INFO_MAX (__IFLA_VF_INFO_MAX - 1)
210
211enum {
212 IFLA_VF_UNSPEC,
213 IFLA_VF_MAC, /* Hardware queue specific attributes */
214 IFLA_VF_VLAN,
215 IFLA_VF_TX_RATE, /* TX Bandwidth Allocation */
216 __IFLA_VF_MAX,
217};
218
219#define IFLA_VF_MAX (__IFLA_VF_MAX - 1)
220
206struct ifla_vf_mac { 221struct ifla_vf_mac {
207 __u32 vf; 222 __u32 vf;
208 __u8 mac[32]; /* MAX_ADDR_LEN */ 223 __u8 mac[32]; /* MAX_ADDR_LEN */
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index b1ed1cd8e2a8..7996fc2c9ba9 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -49,7 +49,6 @@ extern struct group_info init_groups;
49 { .first = &init_task.pids[PIDTYPE_PGID].node }, \ 49 { .first = &init_task.pids[PIDTYPE_PGID].node }, \
50 { .first = &init_task.pids[PIDTYPE_SID].node }, \ 50 { .first = &init_task.pids[PIDTYPE_SID].node }, \
51 }, \ 51 }, \
52 .rcu = RCU_HEAD_INIT, \
53 .level = 0, \ 52 .level = 0, \
54 .numbers = { { \ 53 .numbers = { { \
55 .nr = 0, \ 54 .nr = 0, \
diff --git a/include/linux/input/matrix_keypad.h b/include/linux/input/matrix_keypad.h
index 3bd018baae20..c964cd7f436a 100644
--- a/include/linux/input/matrix_keypad.h
+++ b/include/linux/input/matrix_keypad.h
@@ -44,6 +44,7 @@ struct matrix_keymap_data {
44 * @active_low: gpio polarity 44 * @active_low: gpio polarity
45 * @wakeup: controls whether the device should be set up as wakeup 45 * @wakeup: controls whether the device should be set up as wakeup
46 * source 46 * source
47 * @no_autorepeat: disable key autorepeat
47 * 48 *
48 * This structure represents platform-specific data that use used by 49 * This structure represents platform-specific data that use used by
49 * matrix_keypad driver to perform proper initialization. 50 * matrix_keypad driver to perform proper initialization.
@@ -64,6 +65,7 @@ struct matrix_keypad_platform_data {
64 65
65 bool active_low; 66 bool active_low;
66 bool wakeup; 67 bool wakeup;
68 bool no_autorepeat;
67}; 69};
68 70
69/** 71/**
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 75f3f00ac1e5..5137db3317f9 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -39,7 +39,8 @@
39 * These flags used only by the kernel as part of the 39 * These flags used only by the kernel as part of the
40 * irq handling routines. 40 * irq handling routines.
41 * 41 *
42 * IRQF_DISABLED - keep irqs disabled when calling the action handler 42 * IRQF_DISABLED - keep irqs disabled when calling the action handler.
43 * DEPRECATED. This flag is a NOOP and scheduled to be removed
43 * IRQF_SAMPLE_RANDOM - irq is used to feed the random generator 44 * IRQF_SAMPLE_RANDOM - irq is used to feed the random generator
44 * IRQF_SHARED - allow sharing the irq among several devices 45 * IRQF_SHARED - allow sharing the irq among several devices
45 * IRQF_PROBE_SHARED - set by callers when they expect sharing mismatches to occur 46 * IRQF_PROBE_SHARED - set by callers when they expect sharing mismatches to occur
@@ -77,6 +78,18 @@ enum {
77 IRQTF_AFFINITY, 78 IRQTF_AFFINITY,
78}; 79};
79 80
81/**
82 * These values can be returned by request_any_context_irq() and
83 * describe the context the interrupt will be run in.
84 *
85 * IRQC_IS_HARDIRQ - interrupt runs in hardirq context
86 * IRQC_IS_NESTED - interrupt runs in a nested threaded context
87 */
88enum {
89 IRQC_IS_HARDIRQ = 0,
90 IRQC_IS_NESTED,
91};
92
80typedef irqreturn_t (*irq_handler_t)(int, void *); 93typedef irqreturn_t (*irq_handler_t)(int, void *);
81 94
82/** 95/**
@@ -120,6 +133,10 @@ request_irq(unsigned int irq, irq_handler_t handler, unsigned long flags,
120 return request_threaded_irq(irq, handler, NULL, flags, name, dev); 133 return request_threaded_irq(irq, handler, NULL, flags, name, dev);
121} 134}
122 135
136extern int __must_check
137request_any_context_irq(unsigned int irq, irq_handler_t handler,
138 unsigned long flags, const char *name, void *dev_id);
139
123extern void exit_irq_thread(void); 140extern void exit_irq_thread(void);
124#else 141#else
125 142
@@ -141,6 +158,13 @@ request_threaded_irq(unsigned int irq, irq_handler_t handler,
141 return request_irq(irq, handler, flags, name, dev); 158 return request_irq(irq, handler, flags, name, dev);
142} 159}
143 160
161static inline int __must_check
162request_any_context_irq(unsigned int irq, irq_handler_t handler,
163 unsigned long flags, const char *name, void *dev_id)
164{
165 return request_irq(irq, handler, flags, name, dev_id);
166}
167
144static inline void exit_irq_thread(void) { } 168static inline void exit_irq_thread(void) { }
145#endif 169#endif
146 170
@@ -209,6 +233,7 @@ extern int irq_set_affinity(unsigned int irq, const struct cpumask *cpumask);
209extern int irq_can_set_affinity(unsigned int irq); 233extern int irq_can_set_affinity(unsigned int irq);
210extern int irq_select_affinity(unsigned int irq); 234extern int irq_select_affinity(unsigned int irq);
211 235
236extern int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m);
212#else /* CONFIG_SMP */ 237#else /* CONFIG_SMP */
213 238
214static inline int irq_set_affinity(unsigned int irq, const struct cpumask *m) 239static inline int irq_set_affinity(unsigned int irq, const struct cpumask *m)
@@ -223,6 +248,11 @@ static inline int irq_can_set_affinity(unsigned int irq)
223 248
224static inline int irq_select_affinity(unsigned int irq) { return 0; } 249static inline int irq_select_affinity(unsigned int irq) { return 0; }
225 250
251static inline int irq_set_affinity_hint(unsigned int irq,
252 const struct cpumask *m)
253{
254 return -EINVAL;
255}
226#endif /* CONFIG_SMP && CONFIG_GENERIC_HARDIRQS */ 256#endif /* CONFIG_SMP && CONFIG_GENERIC_HARDIRQS */
227 257
228#ifdef CONFIG_GENERIC_HARDIRQS 258#ifdef CONFIG_GENERIC_HARDIRQS
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index 3af4ffd591b9..be22ad83689c 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -37,9 +37,9 @@ struct iommu_ops {
37 int (*attach_dev)(struct iommu_domain *domain, struct device *dev); 37 int (*attach_dev)(struct iommu_domain *domain, struct device *dev);
38 void (*detach_dev)(struct iommu_domain *domain, struct device *dev); 38 void (*detach_dev)(struct iommu_domain *domain, struct device *dev);
39 int (*map)(struct iommu_domain *domain, unsigned long iova, 39 int (*map)(struct iommu_domain *domain, unsigned long iova,
40 phys_addr_t paddr, size_t size, int prot); 40 phys_addr_t paddr, int gfp_order, int prot);
41 void (*unmap)(struct iommu_domain *domain, unsigned long iova, 41 int (*unmap)(struct iommu_domain *domain, unsigned long iova,
42 size_t size); 42 int gfp_order);
43 phys_addr_t (*iova_to_phys)(struct iommu_domain *domain, 43 phys_addr_t (*iova_to_phys)(struct iommu_domain *domain,
44 unsigned long iova); 44 unsigned long iova);
45 int (*domain_has_cap)(struct iommu_domain *domain, 45 int (*domain_has_cap)(struct iommu_domain *domain,
@@ -56,10 +56,10 @@ extern int iommu_attach_device(struct iommu_domain *domain,
56 struct device *dev); 56 struct device *dev);
57extern void iommu_detach_device(struct iommu_domain *domain, 57extern void iommu_detach_device(struct iommu_domain *domain,
58 struct device *dev); 58 struct device *dev);
59extern int iommu_map_range(struct iommu_domain *domain, unsigned long iova, 59extern int iommu_map(struct iommu_domain *domain, unsigned long iova,
60 phys_addr_t paddr, size_t size, int prot); 60 phys_addr_t paddr, int gfp_order, int prot);
61extern void iommu_unmap_range(struct iommu_domain *domain, unsigned long iova, 61extern int iommu_unmap(struct iommu_domain *domain, unsigned long iova,
62 size_t size); 62 int gfp_order);
63extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, 63extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain,
64 unsigned long iova); 64 unsigned long iova);
65extern int iommu_domain_has_cap(struct iommu_domain *domain, 65extern int iommu_domain_has_cap(struct iommu_domain *domain,
@@ -96,16 +96,16 @@ static inline void iommu_detach_device(struct iommu_domain *domain,
96{ 96{
97} 97}
98 98
99static inline int iommu_map_range(struct iommu_domain *domain, 99static inline int iommu_map(struct iommu_domain *domain, unsigned long iova,
100 unsigned long iova, phys_addr_t paddr, 100 phys_addr_t paddr, int gfp_order, int prot)
101 size_t size, int prot)
102{ 101{
103 return -ENODEV; 102 return -ENODEV;
104} 103}
105 104
106static inline void iommu_unmap_range(struct iommu_domain *domain, 105static inline int iommu_unmap(struct iommu_domain *domain, unsigned long iova,
107 unsigned long iova, size_t size) 106 int gfp_order)
108{ 107{
108 return -ENODEV;
109} 109}
110 110
111static inline phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, 111static inline phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain,
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 707ab122e2e6..c03243ad84b4 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -195,6 +195,7 @@ struct irq_desc {
195 raw_spinlock_t lock; 195 raw_spinlock_t lock;
196#ifdef CONFIG_SMP 196#ifdef CONFIG_SMP
197 cpumask_var_t affinity; 197 cpumask_var_t affinity;
198 const struct cpumask *affinity_hint;
198 unsigned int node; 199 unsigned int node;
199#ifdef CONFIG_GENERIC_PENDING_IRQ 200#ifdef CONFIG_GENERIC_PENDING_IRQ
200 cpumask_var_t pending_mask; 201 cpumask_var_t pending_mask;
diff --git a/include/linux/iscsi_ibft.h b/include/linux/iscsi_ibft.h
index 6092487e2950..d2e4042f8f5e 100644
--- a/include/linux/iscsi_ibft.h
+++ b/include/linux/iscsi_ibft.h
@@ -42,9 +42,13 @@ extern struct ibft_table_header *ibft_addr;
42 * mapped address is set in the ibft_addr variable. 42 * mapped address is set in the ibft_addr variable.
43 */ 43 */
44#ifdef CONFIG_ISCSI_IBFT_FIND 44#ifdef CONFIG_ISCSI_IBFT_FIND
45extern void __init reserve_ibft_region(void); 45unsigned long find_ibft_region(unsigned long *sizep);
46#else 46#else
47static inline void reserve_ibft_region(void) { } 47static inline unsigned long find_ibft_region(unsigned long *sizep)
48{
49 *sizep = 0;
50 return 0;
51}
48#endif 52#endif
49 53
50#endif /* ISCSI_IBFT_H */ 54#endif /* ISCSI_IBFT_H */
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 7f0707463360..9fb1c1299032 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -426,7 +426,7 @@ static inline char *pack_hex_byte(char *buf, u8 byte)
426 .burst = DEFAULT_RATELIMIT_BURST, \ 426 .burst = DEFAULT_RATELIMIT_BURST, \
427 }; \ 427 }; \
428 \ 428 \
429 if (!__ratelimit(&_rs)) \ 429 if (__ratelimit(&_rs)) \
430 printk(fmt, ##__VA_ARGS__); \ 430 printk(fmt, ##__VA_ARGS__); \
431}) 431})
432#else 432#else
@@ -490,6 +490,13 @@ static inline void tracing_off(void) { }
490static inline void tracing_off_permanent(void) { } 490static inline void tracing_off_permanent(void) { }
491static inline int tracing_is_on(void) { return 0; } 491static inline int tracing_is_on(void) { return 0; }
492#endif 492#endif
493
494enum ftrace_dump_mode {
495 DUMP_NONE,
496 DUMP_ALL,
497 DUMP_ORIG,
498};
499
493#ifdef CONFIG_TRACING 500#ifdef CONFIG_TRACING
494extern void tracing_start(void); 501extern void tracing_start(void);
495extern void tracing_stop(void); 502extern void tracing_stop(void);
@@ -571,7 +578,7 @@ __ftrace_vbprintk(unsigned long ip, const char *fmt, va_list ap);
571extern int 578extern int
572__ftrace_vprintk(unsigned long ip, const char *fmt, va_list ap); 579__ftrace_vprintk(unsigned long ip, const char *fmt, va_list ap);
573 580
574extern void ftrace_dump(void); 581extern void ftrace_dump(enum ftrace_dump_mode oops_dump_mode);
575#else 582#else
576static inline void 583static inline void
577ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3) { } 584ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3) { }
@@ -592,7 +599,7 @@ ftrace_vprintk(const char *fmt, va_list ap)
592{ 599{
593 return 0; 600 return 0;
594} 601}
595static inline void ftrace_dump(void) { } 602static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { }
596#endif /* CONFIG_TRACING */ 603#endif /* CONFIG_TRACING */
597 604
598/* 605/*
diff --git a/include/linux/kfifo.h b/include/linux/kfifo.h
index ece0b1c33816..e117b1aee69c 100644
--- a/include/linux/kfifo.h
+++ b/include/linux/kfifo.h
@@ -86,7 +86,8 @@ union { \
86 */ 86 */
87#define INIT_KFIFO(name) \ 87#define INIT_KFIFO(name) \
88 name = __kfifo_initializer(sizeof(name##kfifo_buffer) - \ 88 name = __kfifo_initializer(sizeof(name##kfifo_buffer) - \
89 sizeof(struct kfifo), name##kfifo_buffer) 89 sizeof(struct kfifo), \
90 name##kfifo_buffer + sizeof(struct kfifo))
90 91
91/** 92/**
92 * DEFINE_KFIFO - macro to define and initialize a kfifo 93 * DEFINE_KFIFO - macro to define and initialize a kfifo
diff --git a/include/linux/ktime.h b/include/linux/ktime.h
index ce5983225be4..e1ceaa9b36bb 100644
--- a/include/linux/ktime.h
+++ b/include/linux/ktime.h
@@ -130,7 +130,7 @@ static inline ktime_t timeval_to_ktime(struct timeval tv)
130/* Convert ktime_t to nanoseconds - NOP in the scalar storage format: */ 130/* Convert ktime_t to nanoseconds - NOP in the scalar storage format: */
131#define ktime_to_ns(kt) ((kt).tv64) 131#define ktime_to_ns(kt) ((kt).tv64)
132 132
133#else 133#else /* !((BITS_PER_LONG == 64) || defined(CONFIG_KTIME_SCALAR)) */
134 134
135/* 135/*
136 * Helper macros/inlines to get the ktime_t math right in the timespec 136 * Helper macros/inlines to get the ktime_t math right in the timespec
@@ -275,7 +275,7 @@ static inline s64 ktime_to_ns(const ktime_t kt)
275 return (s64) kt.tv.sec * NSEC_PER_SEC + kt.tv.nsec; 275 return (s64) kt.tv.sec * NSEC_PER_SEC + kt.tv.nsec;
276} 276}
277 277
278#endif 278#endif /* !((BITS_PER_LONG == 64) || defined(CONFIG_KTIME_SCALAR)) */
279 279
280/** 280/**
281 * ktime_equal - Compares two ktime_t variables to see if they are equal 281 * ktime_equal - Compares two ktime_t variables to see if they are equal
@@ -295,6 +295,12 @@ static inline s64 ktime_to_us(const ktime_t kt)
295 return (s64) tv.tv_sec * USEC_PER_SEC + tv.tv_usec; 295 return (s64) tv.tv_sec * USEC_PER_SEC + tv.tv_usec;
296} 296}
297 297
298static inline s64 ktime_to_ms(const ktime_t kt)
299{
300 struct timeval tv = ktime_to_timeval(kt);
301 return (s64) tv.tv_sec * MSEC_PER_SEC + tv.tv_usec / USEC_PER_MSEC;
302}
303
298static inline s64 ktime_us_delta(const ktime_t later, const ktime_t earlier) 304static inline s64 ktime_us_delta(const ktime_t later, const ktime_t earlier)
299{ 305{
300 return ktime_to_us(ktime_sub(later, earlier)); 306 return ktime_to_us(ktime_sub(later, earlier));
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index a3fd0f91d943..169d07758ee5 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -54,7 +54,7 @@ extern struct kmem_cache *kvm_vcpu_cache;
54 */ 54 */
55struct kvm_io_bus { 55struct kvm_io_bus {
56 int dev_count; 56 int dev_count;
57#define NR_IOBUS_DEVS 6 57#define NR_IOBUS_DEVS 200
58 struct kvm_io_device *devs[NR_IOBUS_DEVS]; 58 struct kvm_io_device *devs[NR_IOBUS_DEVS];
59}; 59};
60 60
@@ -119,6 +119,11 @@ struct kvm_memory_slot {
119 int user_alloc; 119 int user_alloc;
120}; 120};
121 121
122static inline unsigned long kvm_dirty_bitmap_bytes(struct kvm_memory_slot *memslot)
123{
124 return ALIGN(memslot->npages, BITS_PER_LONG) / 8;
125}
126
122struct kvm_kernel_irq_routing_entry { 127struct kvm_kernel_irq_routing_entry {
123 u32 gsi; 128 u32 gsi;
124 u32 type; 129 u32 type;
diff --git a/include/linux/lcm.h b/include/linux/lcm.h
new file mode 100644
index 000000000000..7bf01d779b45
--- /dev/null
+++ b/include/linux/lcm.h
@@ -0,0 +1,8 @@
1#ifndef _LCM_H
2#define _LCM_H
3
4#include <linux/compiler.h>
5
6unsigned long lcm(unsigned long a, unsigned long b) __attribute_const__;
7
8#endif /* _LCM_H */
diff --git a/include/linux/mm.h b/include/linux/mm.h
index e70f21beb4b4..fb19bb92b809 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -19,7 +19,6 @@ struct anon_vma;
19struct file_ra_state; 19struct file_ra_state;
20struct user_struct; 20struct user_struct;
21struct writeback_control; 21struct writeback_control;
22struct rlimit;
23 22
24#ifndef CONFIG_DISCONTIGMEM /* Don't use mapnrs, do it properly */ 23#ifndef CONFIG_DISCONTIGMEM /* Don't use mapnrs, do it properly */
25extern unsigned long max_mapnr; 24extern unsigned long max_mapnr;
@@ -783,8 +782,8 @@ struct mm_walk {
783 int (*pmd_entry)(pmd_t *, unsigned long, unsigned long, struct mm_walk *); 782 int (*pmd_entry)(pmd_t *, unsigned long, unsigned long, struct mm_walk *);
784 int (*pte_entry)(pte_t *, unsigned long, unsigned long, struct mm_walk *); 783 int (*pte_entry)(pte_t *, unsigned long, unsigned long, struct mm_walk *);
785 int (*pte_hole)(unsigned long, unsigned long, struct mm_walk *); 784 int (*pte_hole)(unsigned long, unsigned long, struct mm_walk *);
786 int (*hugetlb_entry)(pte_t *, unsigned long, unsigned long, 785 int (*hugetlb_entry)(pte_t *, unsigned long,
787 struct mm_walk *); 786 unsigned long, unsigned long, struct mm_walk *);
788 struct mm_struct *mm; 787 struct mm_struct *mm;
789 void *private; 788 void *private;
790}; 789};
@@ -1449,9 +1448,6 @@ int vmemmap_populate_basepages(struct page *start_page,
1449int vmemmap_populate(struct page *start_page, unsigned long pages, int node); 1448int vmemmap_populate(struct page *start_page, unsigned long pages, int node);
1450void vmemmap_populate_print_last(void); 1449void vmemmap_populate_print_last(void);
1451 1450
1452extern int account_locked_memory(struct mm_struct *mm, struct rlimit *rlim,
1453 size_t size);
1454extern void refund_locked_memory(struct mm_struct *mm, size_t size);
1455 1451
1456enum mf_flags { 1452enum mf_flags {
1457 MF_COUNT_INCREASED = 1 << 0, 1453 MF_COUNT_INCREASED = 1 << 0,
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index f58e9d836f32..56fde4364e4c 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -474,4 +474,13 @@ struct platform_device_id {
474 __attribute__((aligned(sizeof(kernel_ulong_t)))); 474 __attribute__((aligned(sizeof(kernel_ulong_t))));
475}; 475};
476 476
477struct zorro_device_id {
478 __u32 id; /* Device ID or ZORRO_WILDCARD */
479 kernel_ulong_t driver_data; /* Data private to the driver */
480};
481
482#define ZORRO_WILDCARD (0xffffffff) /* not official */
483
484#define ZORRO_DEVICE_MODALIAS_FMT "zorro:i%08X"
485
477#endif /* LINUX_MOD_DEVICETABLE_H */ 486#endif /* LINUX_MOD_DEVICETABLE_H */
diff --git a/include/linux/module.h b/include/linux/module.h
index 515d53ae6a79..6914fcad4673 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -465,8 +465,7 @@ static inline void __module_get(struct module *module)
465 if (module) { 465 if (module) {
466 preempt_disable(); 466 preempt_disable();
467 __this_cpu_inc(module->refptr->incs); 467 __this_cpu_inc(module->refptr->incs);
468 trace_module_get(module, _THIS_IP_, 468 trace_module_get(module, _THIS_IP_);
469 __this_cpu_read(module->refptr->incs));
470 preempt_enable(); 469 preempt_enable();
471 } 470 }
472} 471}
@@ -480,8 +479,7 @@ static inline int try_module_get(struct module *module)
480 479
481 if (likely(module_is_live(module))) { 480 if (likely(module_is_live(module))) {
482 __this_cpu_inc(module->refptr->incs); 481 __this_cpu_inc(module->refptr->incs);
483 trace_module_get(module, _THIS_IP_, 482 trace_module_get(module, _THIS_IP_);
484 __this_cpu_read(module->refptr->incs));
485 } else 483 } else
486 ret = 0; 484 ret = 0;
487 485
diff --git a/include/linux/ncp_fs_sb.h b/include/linux/ncp_fs_sb.h
index 6330fc76b00f..5ec9ca671687 100644
--- a/include/linux/ncp_fs_sb.h
+++ b/include/linux/ncp_fs_sb.h
@@ -12,6 +12,7 @@
12#include <linux/ncp_mount.h> 12#include <linux/ncp_mount.h>
13#include <linux/net.h> 13#include <linux/net.h>
14#include <linux/mutex.h> 14#include <linux/mutex.h>
15#include <linux/backing-dev.h>
15 16
16#ifdef __KERNEL__ 17#ifdef __KERNEL__
17 18
@@ -127,6 +128,7 @@ struct ncp_server {
127 size_t len; 128 size_t len;
128 __u8 data[128]; 129 __u8 data[128];
129 } unexpected_packet; 130 } unexpected_packet;
131 struct backing_dev_info bdi;
130}; 132};
131 133
132extern void ncp_tcp_rcv_proc(struct work_struct *work); 134extern void ncp_tcp_rcv_proc(struct work_struct *work);
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 1a0b85aa151e..77c2ae53431c 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -209,6 +209,7 @@ struct nfs_inode {
209#define NFS_INO_FLUSHING (4) /* inode is flushing out data */ 209#define NFS_INO_FLUSHING (4) /* inode is flushing out data */
210#define NFS_INO_FSCACHE (5) /* inode can be cached by FS-Cache */ 210#define NFS_INO_FSCACHE (5) /* inode can be cached by FS-Cache */
211#define NFS_INO_FSCACHE_LOCK (6) /* FS-Cache cookie management lock */ 211#define NFS_INO_FSCACHE_LOCK (6) /* FS-Cache cookie management lock */
212#define NFS_INO_COMMIT (7) /* inode is committing unstable writes */
212 213
213static inline struct nfs_inode *NFS_I(const struct inode *inode) 214static inline struct nfs_inode *NFS_I(const struct inode *inode)
214{ 215{
@@ -355,6 +356,20 @@ extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struc
355extern u64 nfs_compat_user_ino64(u64 fileid); 356extern u64 nfs_compat_user_ino64(u64 fileid);
356extern void nfs_fattr_init(struct nfs_fattr *fattr); 357extern void nfs_fattr_init(struct nfs_fattr *fattr);
357 358
359extern struct nfs_fattr *nfs_alloc_fattr(void);
360
361static inline void nfs_free_fattr(const struct nfs_fattr *fattr)
362{
363 kfree(fattr);
364}
365
366extern struct nfs_fh *nfs_alloc_fhandle(void);
367
368static inline void nfs_free_fhandle(const struct nfs_fh *fh)
369{
370 kfree(fh);
371}
372
358/* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */ 373/* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */
359extern __be32 root_nfs_parse_addr(char *name); /*__init*/ 374extern __be32 root_nfs_parse_addr(char *name); /*__init*/
360extern unsigned long nfs_inc_attr_generation_counter(void); 375extern unsigned long nfs_inc_attr_generation_counter(void);
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index 717a5e54eb1d..d6e10a4c06e5 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -44,7 +44,6 @@ struct nfs_client {
44 44
45#ifdef CONFIG_NFS_V4 45#ifdef CONFIG_NFS_V4
46 u64 cl_clientid; /* constant */ 46 u64 cl_clientid; /* constant */
47 nfs4_verifier cl_confirm;
48 unsigned long cl_state; 47 unsigned long cl_state;
49 48
50 struct rb_root cl_openowner_id; 49 struct rb_root cl_openowner_id;
@@ -176,6 +175,7 @@ struct nfs_server {
176#define NFS_CAP_ATIME (1U << 11) 175#define NFS_CAP_ATIME (1U << 11)
177#define NFS_CAP_CTIME (1U << 12) 176#define NFS_CAP_CTIME (1U << 12)
178#define NFS_CAP_MTIME (1U << 13) 177#define NFS_CAP_MTIME (1U << 13)
178#define NFS_CAP_POSIX_LOCK (1U << 14)
179 179
180 180
181/* maximum number of slots to use */ 181/* maximum number of slots to use */
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 89b28812ec24..51914d7d6cc4 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -386,8 +386,8 @@ struct nfs_removeargs {
386 386
387struct nfs_removeres { 387struct nfs_removeres {
388 const struct nfs_server *server; 388 const struct nfs_server *server;
389 struct nfs_fattr *dir_attr;
389 struct nfs4_change_info cinfo; 390 struct nfs4_change_info cinfo;
390 struct nfs_fattr dir_attr;
391 struct nfs4_sequence_res seq_res; 391 struct nfs4_sequence_res seq_res;
392}; 392};
393 393
@@ -824,6 +824,11 @@ struct nfs4_setclientid {
824 u32 sc_cb_ident; 824 u32 sc_cb_ident;
825}; 825};
826 826
827struct nfs4_setclientid_res {
828 u64 clientid;
829 nfs4_verifier confirm;
830};
831
827struct nfs4_statfs_arg { 832struct nfs4_statfs_arg {
828 const struct nfs_fh * fh; 833 const struct nfs_fh * fh;
829 const u32 * bitmask; 834 const u32 * bitmask;
diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h
index 65e333afaee4..80d55bbc5365 100644
--- a/include/linux/nfsd/nfsfh.h
+++ b/include/linux/nfsd/nfsfh.h
@@ -40,12 +40,12 @@ struct nfs_fhbase_old {
40 * This is the new flexible, extensible style NFSv2/v3 file handle. 40 * This is the new flexible, extensible style NFSv2/v3 file handle.
41 * by Neil Brown <neilb@cse.unsw.edu.au> - March 2000 41 * by Neil Brown <neilb@cse.unsw.edu.au> - March 2000
42 * 42 *
43 * The file handle is seens as a list of 4byte words. 43 * The file handle starts with a sequence of four-byte words.
44 * The first word contains a version number (1) and four descriptor bytes 44 * The first word contains a version number (1) and three descriptor bytes
45 * that tell how the remaining 3 variable length fields should be handled. 45 * that tell how the remaining 3 variable length fields should be handled.
46 * These three bytes are auth_type, fsid_type and fileid_type. 46 * These three bytes are auth_type, fsid_type and fileid_type.
47 * 47 *
48 * All 4byte values are in host-byte-order. 48 * All four-byte values are in host-byte-order.
49 * 49 *
50 * The auth_type field specifies how the filehandle can be authenticated 50 * The auth_type field specifies how the filehandle can be authenticated
51 * This might allow a file to be confirmed to be in a writable part of a 51 * This might allow a file to be confirmed to be in a writable part of a
diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h
index 30b08136fdf3..aef22ae2af47 100644
--- a/include/linux/page_cgroup.h
+++ b/include/linux/page_cgroup.h
@@ -39,6 +39,7 @@ enum {
39 PCG_CACHE, /* charged as cache */ 39 PCG_CACHE, /* charged as cache */
40 PCG_USED, /* this object is in use. */ 40 PCG_USED, /* this object is in use. */
41 PCG_ACCT_LRU, /* page has been accounted for */ 41 PCG_ACCT_LRU, /* page has been accounted for */
42 PCG_FILE_MAPPED, /* page is accounted as "mapped" */
42}; 43};
43 44
44#define TESTPCGFLAG(uname, lname) \ 45#define TESTPCGFLAG(uname, lname) \
@@ -73,6 +74,11 @@ CLEARPCGFLAG(AcctLRU, ACCT_LRU)
73TESTPCGFLAG(AcctLRU, ACCT_LRU) 74TESTPCGFLAG(AcctLRU, ACCT_LRU)
74TESTCLEARPCGFLAG(AcctLRU, ACCT_LRU) 75TESTCLEARPCGFLAG(AcctLRU, ACCT_LRU)
75 76
77
78SETPCGFLAG(FileMapped, FILE_MAPPED)
79CLEARPCGFLAG(FileMapped, FILE_MAPPED)
80TESTPCGFLAG(FileMapped, FILE_MAPPED)
81
76static inline int page_cgroup_nid(struct page_cgroup *pc) 82static inline int page_cgroup_nid(struct page_cgroup *pc)
77{ 83{
78 return page_to_nid(pc->page); 84 return page_to_nid(pc->page);
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index c8e375440403..3fd5c82e0e18 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -203,8 +203,19 @@ struct perf_event_attr {
203 enable_on_exec : 1, /* next exec enables */ 203 enable_on_exec : 1, /* next exec enables */
204 task : 1, /* trace fork/exit */ 204 task : 1, /* trace fork/exit */
205 watermark : 1, /* wakeup_watermark */ 205 watermark : 1, /* wakeup_watermark */
206 206 /*
207 __reserved_1 : 49; 207 * precise_ip:
208 *
209 * 0 - SAMPLE_IP can have arbitrary skid
210 * 1 - SAMPLE_IP must have constant skid
211 * 2 - SAMPLE_IP requested to have 0 skid
212 * 3 - SAMPLE_IP must have 0 skid
213 *
214 * See also PERF_RECORD_MISC_EXACT_IP
215 */
216 precise_ip : 2, /* skid constraint */
217
218 __reserved_1 : 47;
208 219
209 union { 220 union {
210 __u32 wakeup_events; /* wakeup every n events */ 221 __u32 wakeup_events; /* wakeup every n events */
@@ -287,11 +298,24 @@ struct perf_event_mmap_page {
287 __u64 data_tail; /* user-space written tail */ 298 __u64 data_tail; /* user-space written tail */
288}; 299};
289 300
290#define PERF_RECORD_MISC_CPUMODE_MASK (3 << 0) 301#define PERF_RECORD_MISC_CPUMODE_MASK (7 << 0)
291#define PERF_RECORD_MISC_CPUMODE_UNKNOWN (0 << 0) 302#define PERF_RECORD_MISC_CPUMODE_UNKNOWN (0 << 0)
292#define PERF_RECORD_MISC_KERNEL (1 << 0) 303#define PERF_RECORD_MISC_KERNEL (1 << 0)
293#define PERF_RECORD_MISC_USER (2 << 0) 304#define PERF_RECORD_MISC_USER (2 << 0)
294#define PERF_RECORD_MISC_HYPERVISOR (3 << 0) 305#define PERF_RECORD_MISC_HYPERVISOR (3 << 0)
306#define PERF_RECORD_MISC_GUEST_KERNEL (4 << 0)
307#define PERF_RECORD_MISC_GUEST_USER (5 << 0)
308
309/*
310 * Indicates that the content of PERF_SAMPLE_IP points to
311 * the actual instruction that triggered the event. See also
312 * perf_event_attr::precise_ip.
313 */
314#define PERF_RECORD_MISC_EXACT_IP (1 << 14)
315/*
316 * Reserve the last bit to indicate some extended misc field
317 */
318#define PERF_RECORD_MISC_EXT_RESERVED (1 << 15)
295 319
296struct perf_event_header { 320struct perf_event_header {
297 __u32 type; 321 __u32 type;
@@ -439,6 +463,12 @@ enum perf_callchain_context {
439# include <asm/perf_event.h> 463# include <asm/perf_event.h>
440#endif 464#endif
441 465
466struct perf_guest_info_callbacks {
467 int (*is_in_guest) (void);
468 int (*is_user_mode) (void);
469 unsigned long (*get_guest_ip) (void);
470};
471
442#ifdef CONFIG_HAVE_HW_BREAKPOINT 472#ifdef CONFIG_HAVE_HW_BREAKPOINT
443#include <asm/hw_breakpoint.h> 473#include <asm/hw_breakpoint.h>
444#endif 474#endif
@@ -468,6 +498,17 @@ struct perf_raw_record {
468 void *data; 498 void *data;
469}; 499};
470 500
501struct perf_branch_entry {
502 __u64 from;
503 __u64 to;
504 __u64 flags;
505};
506
507struct perf_branch_stack {
508 __u64 nr;
509 struct perf_branch_entry entries[0];
510};
511
471struct task_struct; 512struct task_struct;
472 513
473/** 514/**
@@ -506,6 +547,8 @@ struct hw_perf_event {
506 547
507struct perf_event; 548struct perf_event;
508 549
550#define PERF_EVENT_TXN_STARTED 1
551
509/** 552/**
510 * struct pmu - generic performance monitoring unit 553 * struct pmu - generic performance monitoring unit
511 */ 554 */
@@ -516,6 +559,16 @@ struct pmu {
516 void (*stop) (struct perf_event *event); 559 void (*stop) (struct perf_event *event);
517 void (*read) (struct perf_event *event); 560 void (*read) (struct perf_event *event);
518 void (*unthrottle) (struct perf_event *event); 561 void (*unthrottle) (struct perf_event *event);
562
563 /*
564 * group events scheduling is treated as a transaction,
565 * add group events as a whole and perform one schedulability test.
566 * If test fails, roll back the whole group
567 */
568
569 void (*start_txn) (const struct pmu *pmu);
570 void (*cancel_txn) (const struct pmu *pmu);
571 int (*commit_txn) (const struct pmu *pmu);
519}; 572};
520 573
521/** 574/**
@@ -571,6 +624,14 @@ enum perf_group_flag {
571 PERF_GROUP_SOFTWARE = 0x1, 624 PERF_GROUP_SOFTWARE = 0x1,
572}; 625};
573 626
627#define SWEVENT_HLIST_BITS 8
628#define SWEVENT_HLIST_SIZE (1 << SWEVENT_HLIST_BITS)
629
630struct swevent_hlist {
631 struct hlist_head heads[SWEVENT_HLIST_SIZE];
632 struct rcu_head rcu_head;
633};
634
574/** 635/**
575 * struct perf_event - performance event kernel representation: 636 * struct perf_event - performance event kernel representation:
576 */ 637 */
@@ -579,6 +640,7 @@ struct perf_event {
579 struct list_head group_entry; 640 struct list_head group_entry;
580 struct list_head event_entry; 641 struct list_head event_entry;
581 struct list_head sibling_list; 642 struct list_head sibling_list;
643 struct hlist_node hlist_entry;
582 int nr_siblings; 644 int nr_siblings;
583 int group_flags; 645 int group_flags;
584 struct perf_event *group_leader; 646 struct perf_event *group_leader;
@@ -726,6 +788,9 @@ struct perf_cpu_context {
726 int active_oncpu; 788 int active_oncpu;
727 int max_pertask; 789 int max_pertask;
728 int exclusive; 790 int exclusive;
791 struct swevent_hlist *swevent_hlist;
792 struct mutex hlist_mutex;
793 int hlist_refcount;
729 794
730 /* 795 /*
731 * Recursion avoidance: 796 * Recursion avoidance:
@@ -769,9 +834,6 @@ extern void perf_disable(void);
769extern void perf_enable(void); 834extern void perf_enable(void);
770extern int perf_event_task_disable(void); 835extern int perf_event_task_disable(void);
771extern int perf_event_task_enable(void); 836extern int perf_event_task_enable(void);
772extern int hw_perf_group_sched_in(struct perf_event *group_leader,
773 struct perf_cpu_context *cpuctx,
774 struct perf_event_context *ctx);
775extern void perf_event_update_userpage(struct perf_event *event); 837extern void perf_event_update_userpage(struct perf_event *event);
776extern int perf_event_release_kernel(struct perf_event *event); 838extern int perf_event_release_kernel(struct perf_event *event);
777extern struct perf_event * 839extern struct perf_event *
@@ -902,6 +964,10 @@ static inline void perf_event_mmap(struct vm_area_struct *vma)
902 __perf_event_mmap(vma); 964 __perf_event_mmap(vma);
903} 965}
904 966
967extern struct perf_guest_info_callbacks *perf_guest_cbs;
968extern int perf_register_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks);
969extern int perf_unregister_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks);
970
905extern void perf_event_comm(struct task_struct *tsk); 971extern void perf_event_comm(struct task_struct *tsk);
906extern void perf_event_fork(struct task_struct *tsk); 972extern void perf_event_fork(struct task_struct *tsk);
907 973
@@ -971,6 +1037,11 @@ perf_sw_event(u32 event_id, u64 nr, int nmi,
971static inline void 1037static inline void
972perf_bp_event(struct perf_event *event, void *data) { } 1038perf_bp_event(struct perf_event *event, void *data) { }
973 1039
1040static inline int perf_register_guest_info_callbacks
1041(struct perf_guest_info_callbacks *callbacks) { return 0; }
1042static inline int perf_unregister_guest_info_callbacks
1043(struct perf_guest_info_callbacks *callbacks) { return 0; }
1044
974static inline void perf_event_mmap(struct vm_area_struct *vma) { } 1045static inline void perf_event_mmap(struct vm_area_struct *vma) { }
975static inline void perf_event_comm(struct task_struct *tsk) { } 1046static inline void perf_event_comm(struct task_struct *tsk) { }
976static inline void perf_event_fork(struct task_struct *tsk) { } 1047static inline void perf_event_fork(struct task_struct *tsk) { }
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 212da17d06af..5417944d3687 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -44,12 +44,14 @@ extern int platform_get_irq_byname(struct platform_device *, const char *);
44extern int platform_add_devices(struct platform_device **, int); 44extern int platform_add_devices(struct platform_device **, int);
45 45
46extern struct platform_device *platform_device_register_simple(const char *, int id, 46extern struct platform_device *platform_device_register_simple(const char *, int id,
47 struct resource *, unsigned int); 47 const struct resource *, unsigned int);
48extern struct platform_device *platform_device_register_data(struct device *, 48extern struct platform_device *platform_device_register_data(struct device *,
49 const char *, int, const void *, size_t); 49 const char *, int, const void *, size_t);
50 50
51extern struct platform_device *platform_device_alloc(const char *name, int id); 51extern struct platform_device *platform_device_alloc(const char *name, int id);
52extern int platform_device_add_resources(struct platform_device *pdev, struct resource *res, unsigned int num); 52extern int platform_device_add_resources(struct platform_device *pdev,
53 const struct resource *res,
54 unsigned int num);
53extern int platform_device_add_data(struct platform_device *pdev, const void *data, size_t size); 55extern int platform_device_add_data(struct platform_device *pdev, const void *data, size_t size);
54extern int platform_device_add(struct platform_device *pdev); 56extern int platform_device_add(struct platform_device *pdev);
55extern void platform_device_del(struct platform_device *pdev); 57extern void platform_device_del(struct platform_device *pdev);
diff --git a/include/linux/poison.h b/include/linux/poison.h
index 2110a81c5e2a..34066ffd893d 100644
--- a/include/linux/poison.h
+++ b/include/linux/poison.h
@@ -48,6 +48,15 @@
48#define POISON_FREE 0x6b /* for use-after-free poisoning */ 48#define POISON_FREE 0x6b /* for use-after-free poisoning */
49#define POISON_END 0xa5 /* end-byte of poisoning */ 49#define POISON_END 0xa5 /* end-byte of poisoning */
50 50
51/********** mm/hugetlb.c **********/
52/*
53 * Private mappings of hugetlb pages use this poisoned value for
54 * page->mapping. The core VM should not be doing anything with this mapping
55 * but futex requires the existence of some page->mapping value even though it
56 * is unused if PAGE_MAPPING_ANON is set.
57 */
58#define HUGETLB_POISON ((void *)(0x00300300 + POISON_POINTER_DELTA + PAGE_MAPPING_ANON))
59
51/********** arch/$ARCH/mm/init.c **********/ 60/********** arch/$ARCH/mm/init.c **********/
52#define POISON_FREE_INITMEM 0xcc 61#define POISON_FREE_INITMEM 0xcc
53 62
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index e1fb60729979..4272521e29e9 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
@@ -345,18 +345,6 @@ static inline void user_single_step_siginfo(struct task_struct *tsk,
345#define arch_ptrace_stop(code, info) do { } while (0) 345#define arch_ptrace_stop(code, info) do { } while (0)
346#endif 346#endif
347 347
348#ifndef arch_ptrace_untrace
349/*
350 * Do machine-specific work before untracing child.
351 *
352 * This is called for a normal detach as well as from ptrace_exit()
353 * when the tracing task dies.
354 *
355 * Called with write_lock(&tasklist_lock) held.
356 */
357#define arch_ptrace_untrace(task) do { } while (0)
358#endif
359
360extern int task_current_syscall(struct task_struct *target, long *callno, 348extern int task_current_syscall(struct task_struct *target, long *callno,
361 unsigned long args[6], unsigned int maxargs, 349 unsigned long args[6], unsigned int maxargs,
362 unsigned long *sp, unsigned long *pc); 350 unsigned long *sp, unsigned long *pc);
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h
index c5da74918096..55ca73cf25e5 100644
--- a/include/linux/radix-tree.h
+++ b/include/linux/radix-tree.h
@@ -121,6 +121,13 @@ do { \
121 * (Note, rcu_assign_pointer and rcu_dereference are not needed to control 121 * (Note, rcu_assign_pointer and rcu_dereference are not needed to control
122 * access to data items when inserting into or looking up from the radix tree) 122 * access to data items when inserting into or looking up from the radix tree)
123 * 123 *
124 * Note that the value returned by radix_tree_tag_get() may not be relied upon
125 * if only the RCU read lock is held. Functions to set/clear tags and to
126 * delete nodes running concurrently with it may affect its result such that
127 * two consecutive reads in the same locked section may return different
128 * values. If reliability is required, modification functions must also be
129 * excluded from concurrency.
130 *
124 * radix_tree_tagged is able to be called without locking or RCU. 131 * radix_tree_tagged is able to be called without locking or RCU.
125 */ 132 */
126 133
diff --git a/include/linux/rbtree.h b/include/linux/rbtree.h
index 5210a5c60877..fe1872e5b37e 100644
--- a/include/linux/rbtree.h
+++ b/include/linux/rbtree.h
@@ -110,6 +110,7 @@ struct rb_node
110struct rb_root 110struct rb_root
111{ 111{
112 struct rb_node *rb_node; 112 struct rb_node *rb_node;
113 void (*augment_cb)(struct rb_node *node);
113}; 114};
114 115
115 116
@@ -129,7 +130,9 @@ static inline void rb_set_color(struct rb_node *rb, int color)
129 rb->rb_parent_color = (rb->rb_parent_color & ~1) | color; 130 rb->rb_parent_color = (rb->rb_parent_color & ~1) | color;
130} 131}
131 132
132#define RB_ROOT (struct rb_root) { NULL, } 133#define RB_ROOT (struct rb_root) { NULL, NULL, }
134#define RB_AUGMENT_ROOT(x) (struct rb_root) { NULL, x}
135
133#define rb_entry(ptr, type, member) container_of(ptr, type, member) 136#define rb_entry(ptr, type, member) container_of(ptr, type, member)
134 137
135#define RB_EMPTY_ROOT(root) ((root)->rb_node == NULL) 138#define RB_EMPTY_ROOT(root) ((root)->rb_node == NULL)
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 872a98e13d6a..b653b4aaa8a6 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -56,8 +56,6 @@ struct rcu_head {
56}; 56};
57 57
58/* Exported common interfaces */ 58/* Exported common interfaces */
59extern void synchronize_rcu_bh(void);
60extern void synchronize_sched(void);
61extern void rcu_barrier(void); 59extern void rcu_barrier(void);
62extern void rcu_barrier_bh(void); 60extern void rcu_barrier_bh(void);
63extern void rcu_barrier_sched(void); 61extern void rcu_barrier_sched(void);
@@ -66,8 +64,6 @@ extern int sched_expedited_torture_stats(char *page);
66 64
67/* Internal to kernel */ 65/* Internal to kernel */
68extern void rcu_init(void); 66extern void rcu_init(void);
69extern int rcu_scheduler_active;
70extern void rcu_scheduler_starting(void);
71 67
72#if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) 68#if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU)
73#include <linux/rcutree.h> 69#include <linux/rcutree.h>
@@ -83,6 +79,14 @@ extern void rcu_scheduler_starting(void);
83 (ptr)->next = NULL; (ptr)->func = NULL; \ 79 (ptr)->next = NULL; (ptr)->func = NULL; \
84} while (0) 80} while (0)
85 81
82static inline void init_rcu_head_on_stack(struct rcu_head *head)
83{
84}
85
86static inline void destroy_rcu_head_on_stack(struct rcu_head *head)
87{
88}
89
86#ifdef CONFIG_DEBUG_LOCK_ALLOC 90#ifdef CONFIG_DEBUG_LOCK_ALLOC
87 91
88extern struct lockdep_map rcu_lock_map; 92extern struct lockdep_map rcu_lock_map;
@@ -101,20 +105,18 @@ extern struct lockdep_map rcu_sched_lock_map;
101# define rcu_read_release_sched() \ 105# define rcu_read_release_sched() \
102 lock_release(&rcu_sched_lock_map, 1, _THIS_IP_) 106 lock_release(&rcu_sched_lock_map, 1, _THIS_IP_)
103 107
104static inline int debug_lockdep_rcu_enabled(void) 108extern int debug_lockdep_rcu_enabled(void);
105{
106 return likely(rcu_scheduler_active && debug_locks);
107}
108 109
109/** 110/**
110 * rcu_read_lock_held - might we be in RCU read-side critical section? 111 * rcu_read_lock_held - might we be in RCU read-side critical section?
111 * 112 *
112 * If CONFIG_PROVE_LOCKING is selected and enabled, returns nonzero iff in 113 * If CONFIG_DEBUG_LOCK_ALLOC is selected, returns nonzero iff in an RCU
113 * an RCU read-side critical section. In absence of CONFIG_PROVE_LOCKING, 114 * read-side critical section. In absence of CONFIG_DEBUG_LOCK_ALLOC,
114 * this assumes we are in an RCU read-side critical section unless it can 115 * this assumes we are in an RCU read-side critical section unless it can
115 * prove otherwise. 116 * prove otherwise.
116 * 117 *
117 * Check rcu_scheduler_active to prevent false positives during boot. 118 * Check debug_lockdep_rcu_enabled() to prevent false positives during boot
119 * and while lockdep is disabled.
118 */ 120 */
119static inline int rcu_read_lock_held(void) 121static inline int rcu_read_lock_held(void)
120{ 122{
@@ -132,13 +134,15 @@ extern int rcu_read_lock_bh_held(void);
132/** 134/**
133 * rcu_read_lock_sched_held - might we be in RCU-sched read-side critical section? 135 * rcu_read_lock_sched_held - might we be in RCU-sched read-side critical section?
134 * 136 *
135 * If CONFIG_PROVE_LOCKING is selected and enabled, returns nonzero iff in an 137 * If CONFIG_DEBUG_LOCK_ALLOC is selected, returns nonzero iff in an
136 * RCU-sched read-side critical section. In absence of CONFIG_PROVE_LOCKING, 138 * RCU-sched read-side critical section. In absence of
137 * this assumes we are in an RCU-sched read-side critical section unless it 139 * CONFIG_DEBUG_LOCK_ALLOC, this assumes we are in an RCU-sched read-side
138 * can prove otherwise. Note that disabling of preemption (including 140 * critical section unless it can prove otherwise. Note that disabling
139 * disabling irqs) counts as an RCU-sched read-side critical section. 141 * of preemption (including disabling irqs) counts as an RCU-sched
142 * read-side critical section.
140 * 143 *
141 * Check rcu_scheduler_active to prevent false positives during boot. 144 * Check debug_lockdep_rcu_enabled() to prevent false positives during boot
145 * and while lockdep is disabled.
142 */ 146 */
143#ifdef CONFIG_PREEMPT 147#ifdef CONFIG_PREEMPT
144static inline int rcu_read_lock_sched_held(void) 148static inline int rcu_read_lock_sched_held(void)
@@ -180,7 +184,7 @@ static inline int rcu_read_lock_bh_held(void)
180#ifdef CONFIG_PREEMPT 184#ifdef CONFIG_PREEMPT
181static inline int rcu_read_lock_sched_held(void) 185static inline int rcu_read_lock_sched_held(void)
182{ 186{
183 return !rcu_scheduler_active || preempt_count() != 0 || irqs_disabled(); 187 return preempt_count() != 0 || irqs_disabled();
184} 188}
185#else /* #ifdef CONFIG_PREEMPT */ 189#else /* #ifdef CONFIG_PREEMPT */
186static inline int rcu_read_lock_sched_held(void) 190static inline int rcu_read_lock_sched_held(void)
@@ -193,29 +197,88 @@ static inline int rcu_read_lock_sched_held(void)
193 197
194#ifdef CONFIG_PROVE_RCU 198#ifdef CONFIG_PROVE_RCU
195 199
200extern int rcu_my_thread_group_empty(void);
201
202#define __do_rcu_dereference_check(c) \
203 do { \
204 static bool __warned; \
205 if (debug_lockdep_rcu_enabled() && !__warned && !(c)) { \
206 __warned = true; \
207 lockdep_rcu_dereference(__FILE__, __LINE__); \
208 } \
209 } while (0)
210
196/** 211/**
197 * rcu_dereference_check - rcu_dereference with debug checking 212 * rcu_dereference_check - rcu_dereference with debug checking
213 * @p: The pointer to read, prior to dereferencing
214 * @c: The conditions under which the dereference will take place
215 *
216 * Do an rcu_dereference(), but check that the conditions under which the
217 * dereference will take place are correct. Typically the conditions indicate
218 * the various locking conditions that should be held at that point. The check
219 * should return true if the conditions are satisfied.
220 *
221 * For example:
222 *
223 * bar = rcu_dereference_check(foo->bar, rcu_read_lock_held() ||
224 * lockdep_is_held(&foo->lock));
198 * 225 *
199 * Do an rcu_dereference(), but check that the context is correct. 226 * could be used to indicate to lockdep that foo->bar may only be dereferenced
200 * For example, rcu_dereference_check(gp, rcu_read_lock_held()) to 227 * if either the RCU read lock is held, or that the lock required to replace
201 * ensure that the rcu_dereference_check() executes within an RCU 228 * the bar struct at foo->bar is held.
202 * read-side critical section. It is also possible to check for 229 *
203 * locks being held, for example, by using lockdep_is_held(). 230 * Note that the list of conditions may also include indications of when a lock
231 * need not be held, for example during initialisation or destruction of the
232 * target struct:
233 *
234 * bar = rcu_dereference_check(foo->bar, rcu_read_lock_held() ||
235 * lockdep_is_held(&foo->lock) ||
236 * atomic_read(&foo->usage) == 0);
204 */ 237 */
205#define rcu_dereference_check(p, c) \ 238#define rcu_dereference_check(p, c) \
206 ({ \ 239 ({ \
207 if (debug_lockdep_rcu_enabled() && !(c)) \ 240 __do_rcu_dereference_check(c); \
208 lockdep_rcu_dereference(__FILE__, __LINE__); \
209 rcu_dereference_raw(p); \ 241 rcu_dereference_raw(p); \
210 }) 242 })
211 243
244/**
245 * rcu_dereference_protected - fetch RCU pointer when updates prevented
246 *
247 * Return the value of the specified RCU-protected pointer, but omit
248 * both the smp_read_barrier_depends() and the ACCESS_ONCE(). This
249 * is useful in cases where update-side locks prevent the value of the
250 * pointer from changing. Please note that this primitive does -not-
251 * prevent the compiler from repeating this reference or combining it
252 * with other references, so it should not be used without protection
253 * of appropriate locks.
254 */
255#define rcu_dereference_protected(p, c) \
256 ({ \
257 __do_rcu_dereference_check(c); \
258 (p); \
259 })
260
212#else /* #ifdef CONFIG_PROVE_RCU */ 261#else /* #ifdef CONFIG_PROVE_RCU */
213 262
214#define rcu_dereference_check(p, c) rcu_dereference_raw(p) 263#define rcu_dereference_check(p, c) rcu_dereference_raw(p)
264#define rcu_dereference_protected(p, c) (p)
215 265
216#endif /* #else #ifdef CONFIG_PROVE_RCU */ 266#endif /* #else #ifdef CONFIG_PROVE_RCU */
217 267
218/** 268/**
269 * rcu_access_pointer - fetch RCU pointer with no dereferencing
270 *
271 * Return the value of the specified RCU-protected pointer, but omit the
272 * smp_read_barrier_depends() and keep the ACCESS_ONCE(). This is useful
273 * when the value of this pointer is accessed, but the pointer is not
274 * dereferenced, for example, when testing an RCU-protected pointer against
275 * NULL. This may also be used in cases where update-side locks prevent
276 * the value of the pointer from changing, but rcu_dereference_protected()
277 * is a lighter-weight primitive for this use case.
278 */
279#define rcu_access_pointer(p) ACCESS_ONCE(p)
280
281/**
219 * rcu_read_lock - mark the beginning of an RCU read-side critical section. 282 * rcu_read_lock - mark the beginning of an RCU read-side critical section.
220 * 283 *
221 * When synchronize_rcu() is invoked on one CPU while other CPUs 284 * When synchronize_rcu() is invoked on one CPU while other CPUs
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h
index a5195875480a..e2e893144a84 100644
--- a/include/linux/rcutiny.h
+++ b/include/linux/rcutiny.h
@@ -29,6 +29,10 @@
29 29
30void rcu_sched_qs(int cpu); 30void rcu_sched_qs(int cpu);
31void rcu_bh_qs(int cpu); 31void rcu_bh_qs(int cpu);
32static inline void rcu_note_context_switch(int cpu)
33{
34 rcu_sched_qs(cpu);
35}
32 36
33#define __rcu_read_lock() preempt_disable() 37#define __rcu_read_lock() preempt_disable()
34#define __rcu_read_unlock() preempt_enable() 38#define __rcu_read_unlock() preempt_enable()
@@ -60,8 +64,6 @@ static inline long rcu_batches_completed_bh(void)
60 return 0; 64 return 0;
61} 65}
62 66
63extern int rcu_expedited_torture_stats(char *page);
64
65static inline void rcu_force_quiescent_state(void) 67static inline void rcu_force_quiescent_state(void)
66{ 68{
67} 69}
@@ -74,7 +76,17 @@ static inline void rcu_sched_force_quiescent_state(void)
74{ 76{
75} 77}
76 78
77#define synchronize_rcu synchronize_sched 79extern void synchronize_sched(void);
80
81static inline void synchronize_rcu(void)
82{
83 synchronize_sched();
84}
85
86static inline void synchronize_rcu_bh(void)
87{
88 synchronize_sched();
89}
78 90
79static inline void synchronize_rcu_expedited(void) 91static inline void synchronize_rcu_expedited(void)
80{ 92{
@@ -114,4 +126,17 @@ static inline int rcu_preempt_depth(void)
114 return 0; 126 return 0;
115} 127}
116 128
129#ifdef CONFIG_DEBUG_LOCK_ALLOC
130
131extern int rcu_scheduler_active __read_mostly;
132extern void rcu_scheduler_starting(void);
133
134#else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */
135
136static inline void rcu_scheduler_starting(void)
137{
138}
139
140#endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */
141
117#endif /* __LINUX_RCUTINY_H */ 142#endif /* __LINUX_RCUTINY_H */
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h
index 42cc3a04779e..c0ed1c056f29 100644
--- a/include/linux/rcutree.h
+++ b/include/linux/rcutree.h
@@ -34,8 +34,8 @@ struct notifier_block;
34 34
35extern void rcu_sched_qs(int cpu); 35extern void rcu_sched_qs(int cpu);
36extern void rcu_bh_qs(int cpu); 36extern void rcu_bh_qs(int cpu);
37extern void rcu_note_context_switch(int cpu);
37extern int rcu_needs_cpu(int cpu); 38extern int rcu_needs_cpu(int cpu);
38extern int rcu_expedited_torture_stats(char *page);
39 39
40#ifdef CONFIG_TREE_PREEMPT_RCU 40#ifdef CONFIG_TREE_PREEMPT_RCU
41 41
@@ -86,6 +86,8 @@ static inline void __rcu_read_unlock_bh(void)
86 86
87extern void call_rcu_sched(struct rcu_head *head, 87extern void call_rcu_sched(struct rcu_head *head,
88 void (*func)(struct rcu_head *rcu)); 88 void (*func)(struct rcu_head *rcu));
89extern void synchronize_rcu_bh(void);
90extern void synchronize_sched(void);
89extern void synchronize_rcu_expedited(void); 91extern void synchronize_rcu_expedited(void);
90 92
91static inline void synchronize_rcu_bh_expedited(void) 93static inline void synchronize_rcu_bh_expedited(void)
@@ -120,4 +122,7 @@ static inline int rcu_blocking_is_gp(void)
120 return num_online_cpus() == 1; 122 return num_online_cpus() == 1;
121} 123}
122 124
125extern void rcu_scheduler_starting(void);
126extern int rcu_scheduler_active __read_mostly;
127
123#endif /* __LINUX_RCUTREE_H */ 128#endif /* __LINUX_RCUTREE_H */
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
index 28c9fd020d39..ebd747265294 100644
--- a/include/linux/regulator/consumer.h
+++ b/include/linux/regulator/consumer.h
@@ -183,9 +183,13 @@ static inline struct regulator *__must_check regulator_get(struct device *dev,
183{ 183{
184 /* Nothing except the stubbed out regulator API should be 184 /* Nothing except the stubbed out regulator API should be
185 * looking at the value except to check if it is an error 185 * looking at the value except to check if it is an error
186 * value so the actual return value doesn't matter. 186 * value. Drivers are free to handle NULL specifically by
187 * skipping all regulator API calls, but they don't have to.
188 * Drivers which don't, should make sure they properly handle
189 * corner cases of the API, such as regulator_get_voltage()
190 * returning 0.
187 */ 191 */
188 return (struct regulator *)id; 192 return NULL;
189} 193}
190static inline void regulator_put(struct regulator *regulator) 194static inline void regulator_put(struct regulator *regulator)
191{ 195{
diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h
index 5fcc31ed5771..25b4f686d918 100644
--- a/include/linux/ring_buffer.h
+++ b/include/linux/ring_buffer.h
@@ -120,12 +120,16 @@ int ring_buffer_write(struct ring_buffer *buffer,
120 unsigned long length, void *data); 120 unsigned long length, void *data);
121 121
122struct ring_buffer_event * 122struct ring_buffer_event *
123ring_buffer_peek(struct ring_buffer *buffer, int cpu, u64 *ts); 123ring_buffer_peek(struct ring_buffer *buffer, int cpu, u64 *ts,
124 unsigned long *lost_events);
124struct ring_buffer_event * 125struct ring_buffer_event *
125ring_buffer_consume(struct ring_buffer *buffer, int cpu, u64 *ts); 126ring_buffer_consume(struct ring_buffer *buffer, int cpu, u64 *ts,
127 unsigned long *lost_events);
126 128
127struct ring_buffer_iter * 129struct ring_buffer_iter *
128ring_buffer_read_start(struct ring_buffer *buffer, int cpu); 130ring_buffer_read_prepare(struct ring_buffer *buffer, int cpu);
131void ring_buffer_read_prepare_sync(void);
132void ring_buffer_read_start(struct ring_buffer_iter *iter);
129void ring_buffer_read_finish(struct ring_buffer_iter *iter); 133void ring_buffer_read_finish(struct ring_buffer_iter *iter);
130 134
131struct ring_buffer_event * 135struct ring_buffer_event *
diff --git a/include/linux/sched.h b/include/linux/sched.h
index dad7f668ebf7..b55e988988b5 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -99,7 +99,6 @@ struct futex_pi_state;
99struct robust_list_head; 99struct robust_list_head;
100struct bio_list; 100struct bio_list;
101struct fs_struct; 101struct fs_struct;
102struct bts_context;
103struct perf_event_context; 102struct perf_event_context;
104 103
105/* 104/*
@@ -275,11 +274,17 @@ extern cpumask_var_t nohz_cpu_mask;
275#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ) 274#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ)
276extern int select_nohz_load_balancer(int cpu); 275extern int select_nohz_load_balancer(int cpu);
277extern int get_nohz_load_balancer(void); 276extern int get_nohz_load_balancer(void);
277extern int nohz_ratelimit(int cpu);
278#else 278#else
279static inline int select_nohz_load_balancer(int cpu) 279static inline int select_nohz_load_balancer(int cpu)
280{ 280{
281 return 0; 281 return 0;
282} 282}
283
284static inline int nohz_ratelimit(int cpu)
285{
286 return 0;
287}
283#endif 288#endif
284 289
285/* 290/*
@@ -954,6 +959,7 @@ struct sched_domain {
954 char *name; 959 char *name;
955#endif 960#endif
956 961
962 unsigned int span_weight;
957 /* 963 /*
958 * Span of all CPUs in this domain. 964 * Span of all CPUs in this domain.
959 * 965 *
@@ -1026,12 +1032,17 @@ struct sched_domain;
1026#define WF_SYNC 0x01 /* waker goes to sleep after wakup */ 1032#define WF_SYNC 0x01 /* waker goes to sleep after wakup */
1027#define WF_FORK 0x02 /* child wakeup after fork */ 1033#define WF_FORK 0x02 /* child wakeup after fork */
1028 1034
1035#define ENQUEUE_WAKEUP 1
1036#define ENQUEUE_WAKING 2
1037#define ENQUEUE_HEAD 4
1038
1039#define DEQUEUE_SLEEP 1
1040
1029struct sched_class { 1041struct sched_class {
1030 const struct sched_class *next; 1042 const struct sched_class *next;
1031 1043
1032 void (*enqueue_task) (struct rq *rq, struct task_struct *p, int wakeup, 1044 void (*enqueue_task) (struct rq *rq, struct task_struct *p, int flags);
1033 bool head); 1045 void (*dequeue_task) (struct rq *rq, struct task_struct *p, int flags);
1034 void (*dequeue_task) (struct rq *rq, struct task_struct *p, int sleep);
1035 void (*yield_task) (struct rq *rq); 1046 void (*yield_task) (struct rq *rq);
1036 1047
1037 void (*check_preempt_curr) (struct rq *rq, struct task_struct *p, int flags); 1048 void (*check_preempt_curr) (struct rq *rq, struct task_struct *p, int flags);
@@ -1040,7 +1051,8 @@ struct sched_class {
1040 void (*put_prev_task) (struct rq *rq, struct task_struct *p); 1051 void (*put_prev_task) (struct rq *rq, struct task_struct *p);
1041 1052
1042#ifdef CONFIG_SMP 1053#ifdef CONFIG_SMP
1043 int (*select_task_rq)(struct task_struct *p, int sd_flag, int flags); 1054 int (*select_task_rq)(struct rq *rq, struct task_struct *p,
1055 int sd_flag, int flags);
1044 1056
1045 void (*pre_schedule) (struct rq *this_rq, struct task_struct *task); 1057 void (*pre_schedule) (struct rq *this_rq, struct task_struct *task);
1046 void (*post_schedule) (struct rq *this_rq); 1058 void (*post_schedule) (struct rq *this_rq);
@@ -1077,36 +1089,8 @@ struct load_weight {
1077 unsigned long weight, inv_weight; 1089 unsigned long weight, inv_weight;
1078}; 1090};
1079 1091
1080/*
1081 * CFS stats for a schedulable entity (task, task-group etc)
1082 *
1083 * Current field usage histogram:
1084 *
1085 * 4 se->block_start
1086 * 4 se->run_node
1087 * 4 se->sleep_start
1088 * 6 se->load.weight
1089 */
1090struct sched_entity {
1091 struct load_weight load; /* for load-balancing */
1092 struct rb_node run_node;
1093 struct list_head group_node;
1094 unsigned int on_rq;
1095
1096 u64 exec_start;
1097 u64 sum_exec_runtime;
1098 u64 vruntime;
1099 u64 prev_sum_exec_runtime;
1100
1101 u64 last_wakeup;
1102 u64 avg_overlap;
1103
1104 u64 nr_migrations;
1105
1106 u64 start_runtime;
1107 u64 avg_wakeup;
1108
1109#ifdef CONFIG_SCHEDSTATS 1092#ifdef CONFIG_SCHEDSTATS
1093struct sched_statistics {
1110 u64 wait_start; 1094 u64 wait_start;
1111 u64 wait_max; 1095 u64 wait_max;
1112 u64 wait_count; 1096 u64 wait_count;
@@ -1138,6 +1122,24 @@ struct sched_entity {
1138 u64 nr_wakeups_affine_attempts; 1122 u64 nr_wakeups_affine_attempts;
1139 u64 nr_wakeups_passive; 1123 u64 nr_wakeups_passive;
1140 u64 nr_wakeups_idle; 1124 u64 nr_wakeups_idle;
1125};
1126#endif
1127
1128struct sched_entity {
1129 struct load_weight load; /* for load-balancing */
1130 struct rb_node run_node;
1131 struct list_head group_node;
1132 unsigned int on_rq;
1133
1134 u64 exec_start;
1135 u64 sum_exec_runtime;
1136 u64 vruntime;
1137 u64 prev_sum_exec_runtime;
1138
1139 u64 nr_migrations;
1140
1141#ifdef CONFIG_SCHEDSTATS
1142 struct sched_statistics statistics;
1141#endif 1143#endif
1142 1144
1143#ifdef CONFIG_FAIR_GROUP_SCHED 1145#ifdef CONFIG_FAIR_GROUP_SCHED
@@ -1272,12 +1274,6 @@ struct task_struct {
1272 struct list_head ptraced; 1274 struct list_head ptraced;
1273 struct list_head ptrace_entry; 1275 struct list_head ptrace_entry;
1274 1276
1275 /*
1276 * This is the tracer handle for the ptrace BTS extension.
1277 * This field actually belongs to the ptracer task.
1278 */
1279 struct bts_context *bts;
1280
1281 /* PID/PID hash table linkage. */ 1277 /* PID/PID hash table linkage. */
1282 struct pid_link pids[PIDTYPE_MAX]; 1278 struct pid_link pids[PIDTYPE_MAX];
1283 struct list_head thread_group; 1279 struct list_head thread_group;
@@ -1497,7 +1493,6 @@ struct task_struct {
1497 /* bitmask of trace recursion */ 1493 /* bitmask of trace recursion */
1498 unsigned long trace_recursion; 1494 unsigned long trace_recursion;
1499#endif /* CONFIG_TRACING */ 1495#endif /* CONFIG_TRACING */
1500 unsigned long stack_start;
1501#ifdef CONFIG_CGROUP_MEM_RES_CTLR /* memcg uses this to do batch job */ 1496#ifdef CONFIG_CGROUP_MEM_RES_CTLR /* memcg uses this to do batch job */
1502 struct memcg_batch_info { 1497 struct memcg_batch_info {
1503 int do_batch; /* incremented when batch uncharge started */ 1498 int do_batch; /* incremented when batch uncharge started */
@@ -1847,6 +1842,7 @@ extern void sched_clock_idle_sleep_event(void);
1847extern void sched_clock_idle_wakeup_event(u64 delta_ns); 1842extern void sched_clock_idle_wakeup_event(u64 delta_ns);
1848 1843
1849#ifdef CONFIG_HOTPLUG_CPU 1844#ifdef CONFIG_HOTPLUG_CPU
1845extern void move_task_off_dead_cpu(int dead_cpu, struct task_struct *p);
1850extern void idle_task_exit(void); 1846extern void idle_task_exit(void);
1851#else 1847#else
1852static inline void idle_task_exit(void) {} 1848static inline void idle_task_exit(void) {}
@@ -2123,10 +2119,8 @@ extern void set_task_comm(struct task_struct *tsk, char *from);
2123extern char *get_task_comm(char *to, struct task_struct *tsk); 2119extern char *get_task_comm(char *to, struct task_struct *tsk);
2124 2120
2125#ifdef CONFIG_SMP 2121#ifdef CONFIG_SMP
2126extern void wait_task_context_switch(struct task_struct *p);
2127extern unsigned long wait_task_inactive(struct task_struct *, long match_state); 2122extern unsigned long wait_task_inactive(struct task_struct *, long match_state);
2128#else 2123#else
2129static inline void wait_task_context_switch(struct task_struct *p) {}
2130static inline unsigned long wait_task_inactive(struct task_struct *p, 2124static inline unsigned long wait_task_inactive(struct task_struct *p,
2131 long match_state) 2125 long match_state)
2132{ 2126{
diff --git a/include/linux/sh_clk.h b/include/linux/sh_clk.h
new file mode 100644
index 000000000000..1636d1e2a5f1
--- /dev/null
+++ b/include/linux/sh_clk.h
@@ -0,0 +1,150 @@
1#ifndef __SH_CLOCK_H
2#define __SH_CLOCK_H
3
4#include <linux/list.h>
5#include <linux/seq_file.h>
6#include <linux/cpufreq.h>
7#include <linux/clk.h>
8#include <linux/err.h>
9
10struct clk;
11
12struct clk_ops {
13 void (*init)(struct clk *clk);
14 int (*enable)(struct clk *clk);
15 void (*disable)(struct clk *clk);
16 unsigned long (*recalc)(struct clk *clk);
17 int (*set_rate)(struct clk *clk, unsigned long rate, int algo_id);
18 int (*set_parent)(struct clk *clk, struct clk *parent);
19 long (*round_rate)(struct clk *clk, unsigned long rate);
20};
21
22struct clk {
23 struct list_head node;
24 const char *name;
25 int id;
26
27 struct clk *parent;
28 struct clk_ops *ops;
29
30 struct list_head children;
31 struct list_head sibling; /* node for children */
32
33 int usecount;
34
35 unsigned long rate;
36 unsigned long flags;
37
38 void __iomem *enable_reg;
39 unsigned int enable_bit;
40
41 unsigned long arch_flags;
42 void *priv;
43 struct dentry *dentry;
44 struct cpufreq_frequency_table *freq_table;
45};
46
47#define CLK_ENABLE_ON_INIT (1 << 0)
48
49/* drivers/sh/clk.c */
50unsigned long followparent_recalc(struct clk *);
51void recalculate_root_clocks(void);
52void propagate_rate(struct clk *);
53int clk_reparent(struct clk *child, struct clk *parent);
54int clk_register(struct clk *);
55void clk_unregister(struct clk *);
56void clk_enable_init_clocks(void);
57
58/**
59 * clk_set_rate_ex - set the clock rate for a clock source, with additional parameter
60 * @clk: clock source
61 * @rate: desired clock rate in Hz
62 * @algo_id: algorithm id to be passed down to ops->set_rate
63 *
64 * Returns success (0) or negative errno.
65 */
66int clk_set_rate_ex(struct clk *clk, unsigned long rate, int algo_id);
67
68enum clk_sh_algo_id {
69 NO_CHANGE = 0,
70
71 IUS_N1_N1,
72 IUS_322,
73 IUS_522,
74 IUS_N11,
75
76 SB_N1,
77
78 SB3_N1,
79 SB3_32,
80 SB3_43,
81 SB3_54,
82
83 BP_N1,
84
85 IP_N1,
86};
87
88struct clk_div_mult_table {
89 unsigned int *divisors;
90 unsigned int nr_divisors;
91 unsigned int *multipliers;
92 unsigned int nr_multipliers;
93};
94
95struct cpufreq_frequency_table;
96void clk_rate_table_build(struct clk *clk,
97 struct cpufreq_frequency_table *freq_table,
98 int nr_freqs,
99 struct clk_div_mult_table *src_table,
100 unsigned long *bitmap);
101
102long clk_rate_table_round(struct clk *clk,
103 struct cpufreq_frequency_table *freq_table,
104 unsigned long rate);
105
106int clk_rate_table_find(struct clk *clk,
107 struct cpufreq_frequency_table *freq_table,
108 unsigned long rate);
109
110#define SH_CLK_MSTP32(_parent, _enable_reg, _enable_bit, _flags) \
111{ \
112 .parent = _parent, \
113 .enable_reg = (void __iomem *)_enable_reg, \
114 .enable_bit = _enable_bit, \
115 .flags = _flags, \
116}
117
118int sh_clk_mstp32_register(struct clk *clks, int nr);
119
120#define SH_CLK_DIV4(_parent, _reg, _shift, _div_bitmap, _flags) \
121{ \
122 .parent = _parent, \
123 .enable_reg = (void __iomem *)_reg, \
124 .enable_bit = _shift, \
125 .arch_flags = _div_bitmap, \
126 .flags = _flags, \
127}
128
129struct clk_div4_table {
130 struct clk_div_mult_table *div_mult_table;
131 void (*kick)(struct clk *clk);
132};
133
134int sh_clk_div4_register(struct clk *clks, int nr,
135 struct clk_div4_table *table);
136int sh_clk_div4_enable_register(struct clk *clks, int nr,
137 struct clk_div4_table *table);
138int sh_clk_div4_reparent_register(struct clk *clks, int nr,
139 struct clk_div4_table *table);
140
141#define SH_CLK_DIV6(_parent, _reg, _flags) \
142{ \
143 .parent = _parent, \
144 .enable_reg = (void __iomem *)_reg, \
145 .flags = _flags, \
146}
147
148int sh_clk_div6_register(struct clk *clks, int nr);
149
150#endif /* __SH_CLOCK_H */
diff --git a/include/linux/sh_dma.h b/include/linux/sh_dma.h
index cdaaff424211..b08cd4efa15c 100644
--- a/include/linux/sh_dma.h
+++ b/include/linux/sh_dma.h
@@ -17,7 +17,7 @@
17struct sh_dmae_slave { 17struct sh_dmae_slave {
18 unsigned int slave_id; /* Set by the platform */ 18 unsigned int slave_id; /* Set by the platform */
19 struct device *dma_dev; /* Set by the platform */ 19 struct device *dma_dev; /* Set by the platform */
20 struct sh_dmae_slave_config *config; /* Set by the driver */ 20 const struct sh_dmae_slave_config *config; /* Set by the driver */
21}; 21};
22 22
23struct sh_dmae_regs { 23struct sh_dmae_regs {
@@ -36,6 +36,7 @@ struct sh_desc {
36 int chunks; 36 int chunks;
37 int mark; 37 int mark;
38}; 38};
39
39struct sh_dmae_slave_config { 40struct sh_dmae_slave_config {
40 unsigned int slave_id; 41 unsigned int slave_id;
41 dma_addr_t addr; 42 dma_addr_t addr;
@@ -50,15 +51,15 @@ struct sh_dmae_channel {
50}; 51};
51 52
52struct sh_dmae_pdata { 53struct sh_dmae_pdata {
53 struct sh_dmae_slave_config *slave; 54 const struct sh_dmae_slave_config *slave;
54 int slave_num; 55 int slave_num;
55 struct sh_dmae_channel *channel; 56 const struct sh_dmae_channel *channel;
56 int channel_num; 57 int channel_num;
57 unsigned int ts_low_shift; 58 unsigned int ts_low_shift;
58 unsigned int ts_low_mask; 59 unsigned int ts_low_mask;
59 unsigned int ts_high_shift; 60 unsigned int ts_high_shift;
60 unsigned int ts_high_mask; 61 unsigned int ts_high_mask;
61 unsigned int *ts_shift; 62 const unsigned int *ts_shift;
62 int ts_shift_num; 63 int ts_shift_num;
63 u16 dmaor_init; 64 u16 dmaor_init;
64}; 65};
diff --git a/include/linux/sh_intc.h b/include/linux/sh_intc.h
index 01d8168c5a1b..0d6cd38e673d 100644
--- a/include/linux/sh_intc.h
+++ b/include/linux/sh_intc.h
@@ -23,6 +23,9 @@ struct intc_group {
23struct intc_mask_reg { 23struct intc_mask_reg {
24 unsigned long set_reg, clr_reg, reg_width; 24 unsigned long set_reg, clr_reg, reg_width;
25 intc_enum enum_ids[32]; 25 intc_enum enum_ids[32];
26#ifdef CONFIG_INTC_BALANCING
27 unsigned long dist_reg;
28#endif
26#ifdef CONFIG_SMP 29#ifdef CONFIG_SMP
27 unsigned long smp; 30 unsigned long smp;
28#endif 31#endif
@@ -41,8 +44,14 @@ struct intc_sense_reg {
41 intc_enum enum_ids[16]; 44 intc_enum enum_ids[16];
42}; 45};
43 46
47#ifdef CONFIG_INTC_BALANCING
48#define INTC_SMP_BALANCING(reg) .dist_reg = (reg)
49#else
50#define INTC_SMP_BALANCING(reg)
51#endif
52
44#ifdef CONFIG_SMP 53#ifdef CONFIG_SMP
45#define INTC_SMP(stride, nr) .smp = (stride) | ((nr) << 8) 54#define INTC_SMP(stride, nr) .smp = (stride) | ((nr) << 8)
46#else 55#else
47#define INTC_SMP(stride, nr) 56#define INTC_SMP(stride, nr)
48#endif 57#endif
@@ -99,6 +108,15 @@ struct intc_desc symbol __initdata = { \
99int __init register_intc_controller(struct intc_desc *desc); 108int __init register_intc_controller(struct intc_desc *desc);
100int intc_set_priority(unsigned int irq, unsigned int prio); 109int intc_set_priority(unsigned int irq, unsigned int prio);
101 110
111#ifdef CONFIG_INTC_USERIMASK
112int register_intc_userimask(unsigned long addr);
113#else
114static inline int register_intc_userimask(unsigned long addr)
115{
116 return 0;
117}
118#endif
119
102int reserve_irq_vector(unsigned int irq); 120int reserve_irq_vector(unsigned int irq);
103void reserve_irq_legacy(void); 121void reserve_irq_legacy(void);
104 122
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 488446289cab..49d1247cd6d9 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -106,6 +106,7 @@ int kmem_cache_shrink(struct kmem_cache *);
106void kmem_cache_free(struct kmem_cache *, void *); 106void kmem_cache_free(struct kmem_cache *, void *);
107unsigned int kmem_cache_size(struct kmem_cache *); 107unsigned int kmem_cache_size(struct kmem_cache *);
108const char *kmem_cache_name(struct kmem_cache *); 108const char *kmem_cache_name(struct kmem_cache *);
109int kern_ptr_validate(const void *ptr, unsigned long size);
109int kmem_ptr_validate(struct kmem_cache *cachep, const void *ptr); 110int kmem_ptr_validate(struct kmem_cache *cachep, const void *ptr);
110 111
111/* 112/*
diff --git a/include/linux/smb_fs_sb.h b/include/linux/smb_fs_sb.h
index 8a060a7040d8..bb947dd1fba9 100644
--- a/include/linux/smb_fs_sb.h
+++ b/include/linux/smb_fs_sb.h
@@ -10,6 +10,7 @@
10#define _SMB_FS_SB 10#define _SMB_FS_SB
11 11
12#include <linux/types.h> 12#include <linux/types.h>
13#include <linux/backing-dev.h>
13#include <linux/smb.h> 14#include <linux/smb.h>
14 15
15/* 16/*
@@ -74,6 +75,8 @@ struct smb_sb_info {
74 struct smb_ops *ops; 75 struct smb_ops *ops;
75 76
76 struct super_block *super_block; 77 struct super_block *super_block;
78
79 struct backing_dev_info bdi;
77}; 80};
78 81
79static inline int 82static inline int
diff --git a/include/linux/srcu.h b/include/linux/srcu.h
index 4d5ecb222af9..4d5d2f546dbf 100644
--- a/include/linux/srcu.h
+++ b/include/linux/srcu.h
@@ -27,6 +27,8 @@
27#ifndef _LINUX_SRCU_H 27#ifndef _LINUX_SRCU_H
28#define _LINUX_SRCU_H 28#define _LINUX_SRCU_H
29 29
30#include <linux/mutex.h>
31
30struct srcu_struct_array { 32struct srcu_struct_array {
31 int c[2]; 33 int c[2];
32}; 34};
@@ -84,8 +86,8 @@ long srcu_batches_completed(struct srcu_struct *sp);
84/** 86/**
85 * srcu_read_lock_held - might we be in SRCU read-side critical section? 87 * srcu_read_lock_held - might we be in SRCU read-side critical section?
86 * 88 *
87 * If CONFIG_PROVE_LOCKING is selected and enabled, returns nonzero iff in 89 * If CONFIG_DEBUG_LOCK_ALLOC is selected, returns nonzero iff in an SRCU
88 * an SRCU read-side critical section. In absence of CONFIG_PROVE_LOCKING, 90 * read-side critical section. In absence of CONFIG_DEBUG_LOCK_ALLOC,
89 * this assumes we are in an SRCU read-side critical section unless it can 91 * this assumes we are in an SRCU read-side critical section unless it can
90 * prove otherwise. 92 * prove otherwise.
91 */ 93 */
diff --git a/include/linux/stop_machine.h b/include/linux/stop_machine.h
index baba3a23a814..6b524a0d02e4 100644
--- a/include/linux/stop_machine.h
+++ b/include/linux/stop_machine.h
@@ -1,13 +1,101 @@
1#ifndef _LINUX_STOP_MACHINE 1#ifndef _LINUX_STOP_MACHINE
2#define _LINUX_STOP_MACHINE 2#define _LINUX_STOP_MACHINE
3/* "Bogolock": stop the entire machine, disable interrupts. This is a 3
4 very heavy lock, which is equivalent to grabbing every spinlock
5 (and more). So the "read" side to such a lock is anything which
6 disables preeempt. */
7#include <linux/cpu.h> 4#include <linux/cpu.h>
8#include <linux/cpumask.h> 5#include <linux/cpumask.h>
6#include <linux/list.h>
9#include <asm/system.h> 7#include <asm/system.h>
10 8
9/*
10 * stop_cpu[s]() is simplistic per-cpu maximum priority cpu
11 * monopolization mechanism. The caller can specify a non-sleeping
12 * function to be executed on a single or multiple cpus preempting all
13 * other processes and monopolizing those cpus until it finishes.
14 *
15 * Resources for this mechanism are preallocated when a cpu is brought
16 * up and requests are guaranteed to be served as long as the target
17 * cpus are online.
18 */
19typedef int (*cpu_stop_fn_t)(void *arg);
20
21#ifdef CONFIG_SMP
22
23struct cpu_stop_work {
24 struct list_head list; /* cpu_stopper->works */
25 cpu_stop_fn_t fn;
26 void *arg;
27 struct cpu_stop_done *done;
28};
29
30int stop_one_cpu(unsigned int cpu, cpu_stop_fn_t fn, void *arg);
31void stop_one_cpu_nowait(unsigned int cpu, cpu_stop_fn_t fn, void *arg,
32 struct cpu_stop_work *work_buf);
33int stop_cpus(const struct cpumask *cpumask, cpu_stop_fn_t fn, void *arg);
34int try_stop_cpus(const struct cpumask *cpumask, cpu_stop_fn_t fn, void *arg);
35
36#else /* CONFIG_SMP */
37
38#include <linux/workqueue.h>
39
40struct cpu_stop_work {
41 struct work_struct work;
42 cpu_stop_fn_t fn;
43 void *arg;
44};
45
46static inline int stop_one_cpu(unsigned int cpu, cpu_stop_fn_t fn, void *arg)
47{
48 int ret = -ENOENT;
49 preempt_disable();
50 if (cpu == smp_processor_id())
51 ret = fn(arg);
52 preempt_enable();
53 return ret;
54}
55
56static void stop_one_cpu_nowait_workfn(struct work_struct *work)
57{
58 struct cpu_stop_work *stwork =
59 container_of(work, struct cpu_stop_work, work);
60 preempt_disable();
61 stwork->fn(stwork->arg);
62 preempt_enable();
63}
64
65static inline void stop_one_cpu_nowait(unsigned int cpu,
66 cpu_stop_fn_t fn, void *arg,
67 struct cpu_stop_work *work_buf)
68{
69 if (cpu == smp_processor_id()) {
70 INIT_WORK(&work_buf->work, stop_one_cpu_nowait_workfn);
71 work_buf->fn = fn;
72 work_buf->arg = arg;
73 schedule_work(&work_buf->work);
74 }
75}
76
77static inline int stop_cpus(const struct cpumask *cpumask,
78 cpu_stop_fn_t fn, void *arg)
79{
80 if (cpumask_test_cpu(raw_smp_processor_id(), cpumask))
81 return stop_one_cpu(raw_smp_processor_id(), fn, arg);
82 return -ENOENT;
83}
84
85static inline int try_stop_cpus(const struct cpumask *cpumask,
86 cpu_stop_fn_t fn, void *arg)
87{
88 return stop_cpus(cpumask, fn, arg);
89}
90
91#endif /* CONFIG_SMP */
92
93/*
94 * stop_machine "Bogolock": stop the entire machine, disable
95 * interrupts. This is a very heavy lock, which is equivalent to
96 * grabbing every spinlock (and more). So the "read" side to such a
97 * lock is anything which disables preeempt.
98 */
11#if defined(CONFIG_STOP_MACHINE) && defined(CONFIG_SMP) 99#if defined(CONFIG_STOP_MACHINE) && defined(CONFIG_SMP)
12 100
13/** 101/**
@@ -36,24 +124,7 @@ int stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus);
36 */ 124 */
37int __stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus); 125int __stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus);
38 126
39/** 127#else /* CONFIG_STOP_MACHINE && CONFIG_SMP */
40 * stop_machine_create: create all stop_machine threads
41 *
42 * Description: This causes all stop_machine threads to be created before
43 * stop_machine actually gets called. This can be used by subsystems that
44 * need a non failing stop_machine infrastructure.
45 */
46int stop_machine_create(void);
47
48/**
49 * stop_machine_destroy: destroy all stop_machine threads
50 *
51 * Description: This causes all stop_machine threads which were created with
52 * stop_machine_create to be destroyed again.
53 */
54void stop_machine_destroy(void);
55
56#else
57 128
58static inline int stop_machine(int (*fn)(void *), void *data, 129static inline int stop_machine(int (*fn)(void *), void *data,
59 const struct cpumask *cpus) 130 const struct cpumask *cpus)
@@ -65,8 +136,5 @@ static inline int stop_machine(int (*fn)(void *), void *data,
65 return ret; 136 return ret;
66} 137}
67 138
68static inline int stop_machine_create(void) { return 0; } 139#endif /* CONFIG_STOP_MACHINE && CONFIG_SMP */
69static inline void stop_machine_destroy(void) { } 140#endif /* _LINUX_STOP_MACHINE */
70
71#endif /* CONFIG_SMP */
72#endif /* _LINUX_STOP_MACHINE */
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h
index 996df4dac7d4..87d7ec0bf779 100644
--- a/include/linux/sunrpc/auth.h
+++ b/include/linux/sunrpc/auth.h
@@ -54,6 +54,7 @@ struct rpc_cred {
54#define RPCAUTH_CRED_NEW 0 54#define RPCAUTH_CRED_NEW 0
55#define RPCAUTH_CRED_UPTODATE 1 55#define RPCAUTH_CRED_UPTODATE 1
56#define RPCAUTH_CRED_HASHED 2 56#define RPCAUTH_CRED_HASHED 2
57#define RPCAUTH_CRED_NEGATIVE 3
57 58
58#define RPCAUTH_CRED_MAGIC 0x0f4aa4f0 59#define RPCAUTH_CRED_MAGIC 0x0f4aa4f0
59 60
diff --git a/include/linux/sunrpc/auth_gss.h b/include/linux/sunrpc/auth_gss.h
index d48d4e605f74..671538d25bc1 100644
--- a/include/linux/sunrpc/auth_gss.h
+++ b/include/linux/sunrpc/auth_gss.h
@@ -82,6 +82,7 @@ struct gss_cred {
82 enum rpc_gss_svc gc_service; 82 enum rpc_gss_svc gc_service;
83 struct gss_cl_ctx *gc_ctx; 83 struct gss_cl_ctx *gc_ctx;
84 struct gss_upcall_msg *gc_upcall; 84 struct gss_upcall_msg *gc_upcall;
85 unsigned long gc_upcall_timestamp;
85 unsigned char gc_machine_cred : 1; 86 unsigned char gc_machine_cred : 1;
86}; 87};
87 88
diff --git a/include/linux/sunrpc/gss_api.h b/include/linux/sunrpc/gss_api.h
index 03f33330ece2..5d8048beb051 100644
--- a/include/linux/sunrpc/gss_api.h
+++ b/include/linux/sunrpc/gss_api.h
@@ -35,7 +35,8 @@ int gss_import_sec_context(
35 const void* input_token, 35 const void* input_token,
36 size_t bufsize, 36 size_t bufsize,
37 struct gss_api_mech *mech, 37 struct gss_api_mech *mech,
38 struct gss_ctx **ctx_id); 38 struct gss_ctx **ctx_id,
39 gfp_t gfp_mask);
39u32 gss_get_mic( 40u32 gss_get_mic(
40 struct gss_ctx *ctx_id, 41 struct gss_ctx *ctx_id,
41 struct xdr_buf *message, 42 struct xdr_buf *message,
@@ -80,6 +81,8 @@ struct gss_api_mech {
80 /* pseudoflavors supported by this mechanism: */ 81 /* pseudoflavors supported by this mechanism: */
81 int gm_pf_num; 82 int gm_pf_num;
82 struct pf_desc * gm_pfs; 83 struct pf_desc * gm_pfs;
84 /* Should the following be a callback operation instead? */
85 const char *gm_upcall_enctypes;
83}; 86};
84 87
85/* and must provide the following operations: */ 88/* and must provide the following operations: */
@@ -87,7 +90,8 @@ struct gss_api_ops {
87 int (*gss_import_sec_context)( 90 int (*gss_import_sec_context)(
88 const void *input_token, 91 const void *input_token,
89 size_t bufsize, 92 size_t bufsize,
90 struct gss_ctx *ctx_id); 93 struct gss_ctx *ctx_id,
94 gfp_t gfp_mask);
91 u32 (*gss_get_mic)( 95 u32 (*gss_get_mic)(
92 struct gss_ctx *ctx_id, 96 struct gss_ctx *ctx_id,
93 struct xdr_buf *message, 97 struct xdr_buf *message,
diff --git a/include/linux/sunrpc/gss_krb5.h b/include/linux/sunrpc/gss_krb5.h
index e7bbdba474d5..5af2931cf58d 100644
--- a/include/linux/sunrpc/gss_krb5.h
+++ b/include/linux/sunrpc/gss_krb5.h
@@ -4,7 +4,7 @@
4 * Adapted from MIT Kerberos 5-1.2.1 lib/include/krb5.h, 4 * Adapted from MIT Kerberos 5-1.2.1 lib/include/krb5.h,
5 * lib/gssapi/krb5/gssapiP_krb5.h, and others 5 * lib/gssapi/krb5/gssapiP_krb5.h, and others
6 * 6 *
7 * Copyright (c) 2000 The Regents of the University of Michigan. 7 * Copyright (c) 2000-2008 The Regents of the University of Michigan.
8 * All rights reserved. 8 * All rights reserved.
9 * 9 *
10 * Andy Adamson <andros@umich.edu> 10 * Andy Adamson <andros@umich.edu>
@@ -36,17 +36,86 @@
36 * 36 *
37 */ 37 */
38 38
39#include <linux/crypto.h>
39#include <linux/sunrpc/auth_gss.h> 40#include <linux/sunrpc/auth_gss.h>
40#include <linux/sunrpc/gss_err.h> 41#include <linux/sunrpc/gss_err.h>
41#include <linux/sunrpc/gss_asn1.h> 42#include <linux/sunrpc/gss_asn1.h>
42 43
44/* Length of constant used in key derivation */
45#define GSS_KRB5_K5CLENGTH (5)
46
47/* Maximum key length (in bytes) for the supported crypto algorithms*/
48#define GSS_KRB5_MAX_KEYLEN (32)
49
50/* Maximum checksum function output for the supported crypto algorithms */
51#define GSS_KRB5_MAX_CKSUM_LEN (20)
52
53/* Maximum blocksize for the supported crypto algorithms */
54#define GSS_KRB5_MAX_BLOCKSIZE (16)
55
56struct krb5_ctx;
57
58struct gss_krb5_enctype {
59 const u32 etype; /* encryption (key) type */
60 const u32 ctype; /* checksum type */
61 const char *name; /* "friendly" name */
62 const char *encrypt_name; /* crypto encrypt name */
63 const char *cksum_name; /* crypto checksum name */
64 const u16 signalg; /* signing algorithm */
65 const u16 sealalg; /* sealing algorithm */
66 const u32 blocksize; /* encryption blocksize */
67 const u32 conflen; /* confounder length
68 (normally the same as
69 the blocksize) */
70 const u32 cksumlength; /* checksum length */
71 const u32 keyed_cksum; /* is it a keyed cksum? */
72 const u32 keybytes; /* raw key len, in bytes */
73 const u32 keylength; /* final key len, in bytes */
74 u32 (*encrypt) (struct crypto_blkcipher *tfm,
75 void *iv, void *in, void *out,
76 int length); /* encryption function */
77 u32 (*decrypt) (struct crypto_blkcipher *tfm,
78 void *iv, void *in, void *out,
79 int length); /* decryption function */
80 u32 (*mk_key) (const struct gss_krb5_enctype *gk5e,
81 struct xdr_netobj *in,
82 struct xdr_netobj *out); /* complete key generation */
83 u32 (*encrypt_v2) (struct krb5_ctx *kctx, u32 offset,
84 struct xdr_buf *buf, int ec,
85 struct page **pages); /* v2 encryption function */
86 u32 (*decrypt_v2) (struct krb5_ctx *kctx, u32 offset,
87 struct xdr_buf *buf, u32 *headskip,
88 u32 *tailskip); /* v2 decryption function */
89};
90
91/* krb5_ctx flags definitions */
92#define KRB5_CTX_FLAG_INITIATOR 0x00000001
93#define KRB5_CTX_FLAG_CFX 0x00000002
94#define KRB5_CTX_FLAG_ACCEPTOR_SUBKEY 0x00000004
95
43struct krb5_ctx { 96struct krb5_ctx {
44 int initiate; /* 1 = initiating, 0 = accepting */ 97 int initiate; /* 1 = initiating, 0 = accepting */
98 u32 enctype;
99 u32 flags;
100 const struct gss_krb5_enctype *gk5e; /* enctype-specific info */
45 struct crypto_blkcipher *enc; 101 struct crypto_blkcipher *enc;
46 struct crypto_blkcipher *seq; 102 struct crypto_blkcipher *seq;
103 struct crypto_blkcipher *acceptor_enc;
104 struct crypto_blkcipher *initiator_enc;
105 struct crypto_blkcipher *acceptor_enc_aux;
106 struct crypto_blkcipher *initiator_enc_aux;
107 u8 Ksess[GSS_KRB5_MAX_KEYLEN]; /* session key */
108 u8 cksum[GSS_KRB5_MAX_KEYLEN];
47 s32 endtime; 109 s32 endtime;
48 u32 seq_send; 110 u32 seq_send;
111 u64 seq_send64;
49 struct xdr_netobj mech_used; 112 struct xdr_netobj mech_used;
113 u8 initiator_sign[GSS_KRB5_MAX_KEYLEN];
114 u8 acceptor_sign[GSS_KRB5_MAX_KEYLEN];
115 u8 initiator_seal[GSS_KRB5_MAX_KEYLEN];
116 u8 acceptor_seal[GSS_KRB5_MAX_KEYLEN];
117 u8 initiator_integ[GSS_KRB5_MAX_KEYLEN];
118 u8 acceptor_integ[GSS_KRB5_MAX_KEYLEN];
50}; 119};
51 120
52extern spinlock_t krb5_seq_lock; 121extern spinlock_t krb5_seq_lock;
@@ -57,6 +126,18 @@ extern spinlock_t krb5_seq_lock;
57#define KG_TOK_MIC_MSG 0x0101 126#define KG_TOK_MIC_MSG 0x0101
58#define KG_TOK_WRAP_MSG 0x0201 127#define KG_TOK_WRAP_MSG 0x0201
59 128
129#define KG2_TOK_INITIAL 0x0101
130#define KG2_TOK_RESPONSE 0x0202
131#define KG2_TOK_MIC 0x0404
132#define KG2_TOK_WRAP 0x0504
133
134#define KG2_TOKEN_FLAG_SENTBYACCEPTOR 0x01
135#define KG2_TOKEN_FLAG_SEALED 0x02
136#define KG2_TOKEN_FLAG_ACCEPTORSUBKEY 0x04
137
138#define KG2_RESP_FLAG_ERROR 0x0001
139#define KG2_RESP_FLAG_DELEG_OK 0x0002
140
60enum sgn_alg { 141enum sgn_alg {
61 SGN_ALG_DES_MAC_MD5 = 0x0000, 142 SGN_ALG_DES_MAC_MD5 = 0x0000,
62 SGN_ALG_MD2_5 = 0x0001, 143 SGN_ALG_MD2_5 = 0x0001,
@@ -81,6 +162,9 @@ enum seal_alg {
81#define CKSUMTYPE_RSA_MD5_DES 0x0008 162#define CKSUMTYPE_RSA_MD5_DES 0x0008
82#define CKSUMTYPE_NIST_SHA 0x0009 163#define CKSUMTYPE_NIST_SHA 0x0009
83#define CKSUMTYPE_HMAC_SHA1_DES3 0x000c 164#define CKSUMTYPE_HMAC_SHA1_DES3 0x000c
165#define CKSUMTYPE_HMAC_SHA1_96_AES128 0x000f
166#define CKSUMTYPE_HMAC_SHA1_96_AES256 0x0010
167#define CKSUMTYPE_HMAC_MD5_ARCFOUR -138 /* Microsoft md5 hmac cksumtype */
84 168
85/* from gssapi_err_krb5.h */ 169/* from gssapi_err_krb5.h */
86#define KG_CCACHE_NOMATCH (39756032L) 170#define KG_CCACHE_NOMATCH (39756032L)
@@ -111,11 +195,56 @@ enum seal_alg {
111#define ENCTYPE_DES3_CBC_RAW 0x0006 /* DES-3 cbc mode raw */ 195#define ENCTYPE_DES3_CBC_RAW 0x0006 /* DES-3 cbc mode raw */
112#define ENCTYPE_DES_HMAC_SHA1 0x0008 196#define ENCTYPE_DES_HMAC_SHA1 0x0008
113#define ENCTYPE_DES3_CBC_SHA1 0x0010 197#define ENCTYPE_DES3_CBC_SHA1 0x0010
198#define ENCTYPE_AES128_CTS_HMAC_SHA1_96 0x0011
199#define ENCTYPE_AES256_CTS_HMAC_SHA1_96 0x0012
200#define ENCTYPE_ARCFOUR_HMAC 0x0017
201#define ENCTYPE_ARCFOUR_HMAC_EXP 0x0018
114#define ENCTYPE_UNKNOWN 0x01ff 202#define ENCTYPE_UNKNOWN 0x01ff
115 203
116s32 204/*
117make_checksum(char *, char *header, int hdrlen, struct xdr_buf *body, 205 * Constants used for key derivation
118 int body_offset, struct xdr_netobj *cksum); 206 */
207/* for 3DES */
208#define KG_USAGE_SEAL (22)
209#define KG_USAGE_SIGN (23)
210#define KG_USAGE_SEQ (24)
211
212/* from rfc3961 */
213#define KEY_USAGE_SEED_CHECKSUM (0x99)
214#define KEY_USAGE_SEED_ENCRYPTION (0xAA)
215#define KEY_USAGE_SEED_INTEGRITY (0x55)
216
217/* from rfc4121 */
218#define KG_USAGE_ACCEPTOR_SEAL (22)
219#define KG_USAGE_ACCEPTOR_SIGN (23)
220#define KG_USAGE_INITIATOR_SEAL (24)
221#define KG_USAGE_INITIATOR_SIGN (25)
222
223/*
224 * This compile-time check verifies that we will not exceed the
225 * slack space allotted by the client and server auth_gss code
226 * before they call gss_wrap().
227 */
228#define GSS_KRB5_MAX_SLACK_NEEDED \
229 (GSS_KRB5_TOK_HDR_LEN /* gss token header */ \
230 + GSS_KRB5_MAX_CKSUM_LEN /* gss token checksum */ \
231 + GSS_KRB5_MAX_BLOCKSIZE /* confounder */ \
232 + GSS_KRB5_MAX_BLOCKSIZE /* possible padding */ \
233 + GSS_KRB5_TOK_HDR_LEN /* encrypted hdr in v2 token */\
234 + GSS_KRB5_MAX_CKSUM_LEN /* encryption hmac */ \
235 + 4 + 4 /* RPC verifier */ \
236 + GSS_KRB5_TOK_HDR_LEN \
237 + GSS_KRB5_MAX_CKSUM_LEN)
238
239u32
240make_checksum(struct krb5_ctx *kctx, char *header, int hdrlen,
241 struct xdr_buf *body, int body_offset, u8 *cksumkey,
242 unsigned int usage, struct xdr_netobj *cksumout);
243
244u32
245make_checksum_v2(struct krb5_ctx *, char *header, int hdrlen,
246 struct xdr_buf *body, int body_offset, u8 *key,
247 unsigned int usage, struct xdr_netobj *cksum);
119 248
120u32 gss_get_mic_kerberos(struct gss_ctx *, struct xdr_buf *, 249u32 gss_get_mic_kerberos(struct gss_ctx *, struct xdr_buf *,
121 struct xdr_netobj *); 250 struct xdr_netobj *);
@@ -149,11 +278,54 @@ gss_decrypt_xdr_buf(struct crypto_blkcipher *tfm, struct xdr_buf *inbuf,
149 int offset); 278 int offset);
150 279
151s32 280s32
152krb5_make_seq_num(struct crypto_blkcipher *key, 281krb5_make_seq_num(struct krb5_ctx *kctx,
282 struct crypto_blkcipher *key,
153 int direction, 283 int direction,
154 u32 seqnum, unsigned char *cksum, unsigned char *buf); 284 u32 seqnum, unsigned char *cksum, unsigned char *buf);
155 285
156s32 286s32
157krb5_get_seq_num(struct crypto_blkcipher *key, 287krb5_get_seq_num(struct krb5_ctx *kctx,
158 unsigned char *cksum, 288 unsigned char *cksum,
159 unsigned char *buf, int *direction, u32 *seqnum); 289 unsigned char *buf, int *direction, u32 *seqnum);
290
291int
292xdr_extend_head(struct xdr_buf *buf, unsigned int base, unsigned int shiftlen);
293
294u32
295krb5_derive_key(const struct gss_krb5_enctype *gk5e,
296 const struct xdr_netobj *inkey,
297 struct xdr_netobj *outkey,
298 const struct xdr_netobj *in_constant,
299 gfp_t gfp_mask);
300
301u32
302gss_krb5_des3_make_key(const struct gss_krb5_enctype *gk5e,
303 struct xdr_netobj *randombits,
304 struct xdr_netobj *key);
305
306u32
307gss_krb5_aes_make_key(const struct gss_krb5_enctype *gk5e,
308 struct xdr_netobj *randombits,
309 struct xdr_netobj *key);
310
311u32
312gss_krb5_aes_encrypt(struct krb5_ctx *kctx, u32 offset,
313 struct xdr_buf *buf, int ec,
314 struct page **pages);
315
316u32
317gss_krb5_aes_decrypt(struct krb5_ctx *kctx, u32 offset,
318 struct xdr_buf *buf, u32 *plainoffset,
319 u32 *plainlen);
320
321int
322krb5_rc4_setup_seq_key(struct krb5_ctx *kctx,
323 struct crypto_blkcipher *cipher,
324 unsigned char *cksum);
325
326int
327krb5_rc4_setup_enc_key(struct krb5_ctx *kctx,
328 struct crypto_blkcipher *cipher,
329 s32 seqnum);
330void
331gss_krb5_make_confounder(char *p, u32 conflen);
diff --git a/include/linux/sunrpc/metrics.h b/include/linux/sunrpc/metrics.h
index 77f78e56c481..b6edbc0ea83d 100644
--- a/include/linux/sunrpc/metrics.h
+++ b/include/linux/sunrpc/metrics.h
@@ -26,6 +26,7 @@
26#define _LINUX_SUNRPC_METRICS_H 26#define _LINUX_SUNRPC_METRICS_H
27 27
28#include <linux/seq_file.h> 28#include <linux/seq_file.h>
29#include <linux/ktime.h>
29 30
30#define RPC_IOSTATS_VERS "1.0" 31#define RPC_IOSTATS_VERS "1.0"
31 32
@@ -58,9 +59,9 @@ struct rpc_iostats {
58 * and the total time the request spent from init to release 59 * and the total time the request spent from init to release
59 * are measured. 60 * are measured.
60 */ 61 */
61 unsigned long long om_queue, /* jiffies queued for xmit */ 62 ktime_t om_queue, /* queued for xmit */
62 om_rtt, /* jiffies for RPC RTT */ 63 om_rtt, /* RPC RTT */
63 om_execute; /* jiffies for RPC execution */ 64 om_execute; /* RPC execution */
64} ____cacheline_aligned; 65} ____cacheline_aligned;
65 66
66struct rpc_task; 67struct rpc_task;
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
index 7bc7fd5291ce..7be4f3a6d246 100644
--- a/include/linux/sunrpc/sched.h
+++ b/include/linux/sunrpc/sched.h
@@ -10,6 +10,7 @@
10#define _LINUX_SUNRPC_SCHED_H_ 10#define _LINUX_SUNRPC_SCHED_H_
11 11
12#include <linux/timer.h> 12#include <linux/timer.h>
13#include <linux/ktime.h>
13#include <linux/sunrpc/types.h> 14#include <linux/sunrpc/types.h>
14#include <linux/spinlock.h> 15#include <linux/spinlock.h>
15#include <linux/wait.h> 16#include <linux/wait.h>
@@ -40,21 +41,15 @@ struct rpc_wait {
40 * This is the RPC task struct 41 * This is the RPC task struct
41 */ 42 */
42struct rpc_task { 43struct rpc_task {
43#ifdef RPC_DEBUG
44 unsigned long tk_magic; /* 0xf00baa */
45#endif
46 atomic_t tk_count; /* Reference count */ 44 atomic_t tk_count; /* Reference count */
47 struct list_head tk_task; /* global list of tasks */ 45 struct list_head tk_task; /* global list of tasks */
48 struct rpc_clnt * tk_client; /* RPC client */ 46 struct rpc_clnt * tk_client; /* RPC client */
49 struct rpc_rqst * tk_rqstp; /* RPC request */ 47 struct rpc_rqst * tk_rqstp; /* RPC request */
50 int tk_status; /* result of last operation */
51 48
52 /* 49 /*
53 * RPC call state 50 * RPC call state
54 */ 51 */
55 struct rpc_message tk_msg; /* RPC call info */ 52 struct rpc_message tk_msg; /* RPC call info */
56 __u8 tk_garb_retry;
57 __u8 tk_cred_retry;
58 53
59 /* 54 /*
60 * callback to be executed after waking up 55 * callback to be executed after waking up
@@ -67,7 +62,6 @@ struct rpc_task {
67 void * tk_calldata; 62 void * tk_calldata;
68 63
69 unsigned long tk_timeout; /* timeout for rpc_sleep() */ 64 unsigned long tk_timeout; /* timeout for rpc_sleep() */
70 unsigned short tk_flags; /* misc flags */
71 unsigned long tk_runstate; /* Task run status */ 65 unsigned long tk_runstate; /* Task run status */
72 struct workqueue_struct *tk_workqueue; /* Normally rpciod, but could 66 struct workqueue_struct *tk_workqueue; /* Normally rpciod, but could
73 * be any workqueue 67 * be any workqueue
@@ -78,17 +72,19 @@ struct rpc_task {
78 struct rpc_wait tk_wait; /* RPC wait */ 72 struct rpc_wait tk_wait; /* RPC wait */
79 } u; 73 } u;
80 74
81 unsigned short tk_timeouts; /* maj timeouts */ 75 ktime_t tk_start; /* RPC task init timestamp */
82 size_t tk_bytes_sent; /* total bytes sent */
83 unsigned long tk_start; /* RPC task init timestamp */
84 long tk_rtt; /* round-trip time (jiffies) */
85 76
86 pid_t tk_owner; /* Process id for batching tasks */ 77 pid_t tk_owner; /* Process id for batching tasks */
87 unsigned char tk_priority : 2;/* Task priority */ 78 int tk_status; /* result of last operation */
79 unsigned short tk_flags; /* misc flags */
80 unsigned short tk_timeouts; /* maj timeouts */
88 81
89#ifdef RPC_DEBUG 82#ifdef RPC_DEBUG
90 unsigned short tk_pid; /* debugging aid */ 83 unsigned short tk_pid; /* debugging aid */
91#endif 84#endif
85 unsigned char tk_priority : 2,/* Task priority */
86 tk_garb_retry : 2,
87 tk_cred_retry : 2;
92}; 88};
93#define tk_xprt tk_client->cl_xprt 89#define tk_xprt tk_client->cl_xprt
94 90
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h
index f5cc0898bc53..35cf2e8cd7c6 100644
--- a/include/linux/sunrpc/xdr.h
+++ b/include/linux/sunrpc/xdr.h
@@ -1,7 +1,10 @@
1/* 1/*
2 * include/linux/sunrpc/xdr.h 2 * XDR standard data types and function declarations
3 * 3 *
4 * Copyright (C) 1995-1997 Olaf Kirch <okir@monad.swb.de> 4 * Copyright (C) 1995-1997 Olaf Kirch <okir@monad.swb.de>
5 *
6 * Based on:
7 * RFC 4506 "XDR: External Data Representation Standard", May 2006
5 */ 8 */
6 9
7#ifndef _SUNRPC_XDR_H_ 10#ifndef _SUNRPC_XDR_H_
@@ -62,7 +65,6 @@ struct xdr_buf {
62 65
63 unsigned int buflen, /* Total length of storage buffer */ 66 unsigned int buflen, /* Total length of storage buffer */
64 len; /* Length of XDR encoded message */ 67 len; /* Length of XDR encoded message */
65
66}; 68};
67 69
68/* 70/*
@@ -178,7 +180,7 @@ struct xdr_array2_desc {
178}; 180};
179 181
180extern int xdr_decode_array2(struct xdr_buf *buf, unsigned int base, 182extern int xdr_decode_array2(struct xdr_buf *buf, unsigned int base,
181 struct xdr_array2_desc *desc); 183 struct xdr_array2_desc *desc);
182extern int xdr_encode_array2(struct xdr_buf *buf, unsigned int base, 184extern int xdr_encode_array2(struct xdr_buf *buf, unsigned int base,
183 struct xdr_array2_desc *desc); 185 struct xdr_array2_desc *desc);
184 186
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index 6f9457a75b8f..b51470302399 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -13,6 +13,7 @@
13#include <linux/socket.h> 13#include <linux/socket.h>
14#include <linux/in.h> 14#include <linux/in.h>
15#include <linux/kref.h> 15#include <linux/kref.h>
16#include <linux/ktime.h>
16#include <linux/sunrpc/sched.h> 17#include <linux/sunrpc/sched.h>
17#include <linux/sunrpc/xdr.h> 18#include <linux/sunrpc/xdr.h>
18#include <linux/sunrpc/msg_prot.h> 19#include <linux/sunrpc/msg_prot.h>
@@ -65,8 +66,6 @@ struct rpc_rqst {
65 struct rpc_task * rq_task; /* RPC task data */ 66 struct rpc_task * rq_task; /* RPC task data */
66 __be32 rq_xid; /* request XID */ 67 __be32 rq_xid; /* request XID */
67 int rq_cong; /* has incremented xprt->cong */ 68 int rq_cong; /* has incremented xprt->cong */
68 int rq_reply_bytes_recvd; /* number of reply */
69 /* bytes received */
70 u32 rq_seqno; /* gss seq no. used on req. */ 69 u32 rq_seqno; /* gss seq no. used on req. */
71 int rq_enc_pages_num; 70 int rq_enc_pages_num;
72 struct page **rq_enc_pages; /* scratch pages for use by 71 struct page **rq_enc_pages; /* scratch pages for use by
@@ -77,12 +76,16 @@ struct rpc_rqst {
77 __u32 * rq_buffer; /* XDR encode buffer */ 76 __u32 * rq_buffer; /* XDR encode buffer */
78 size_t rq_callsize, 77 size_t rq_callsize,
79 rq_rcvsize; 78 rq_rcvsize;
79 size_t rq_xmit_bytes_sent; /* total bytes sent */
80 size_t rq_reply_bytes_recvd; /* total reply bytes */
81 /* received */
80 82
81 struct xdr_buf rq_private_buf; /* The receive buffer 83 struct xdr_buf rq_private_buf; /* The receive buffer
82 * used in the softirq. 84 * used in the softirq.
83 */ 85 */
84 unsigned long rq_majortimeo; /* major timeout alarm */ 86 unsigned long rq_majortimeo; /* major timeout alarm */
85 unsigned long rq_timeout; /* Current timeout value */ 87 unsigned long rq_timeout; /* Current timeout value */
88 ktime_t rq_rtt; /* round-trip time */
86 unsigned int rq_retries; /* # of retries */ 89 unsigned int rq_retries; /* # of retries */
87 unsigned int rq_connect_cookie; 90 unsigned int rq_connect_cookie;
88 /* A cookie used to track the 91 /* A cookie used to track the
@@ -94,7 +97,7 @@ struct rpc_rqst {
94 */ 97 */
95 u32 rq_bytes_sent; /* Bytes we have sent */ 98 u32 rq_bytes_sent; /* Bytes we have sent */
96 99
97 unsigned long rq_xtime; /* when transmitted */ 100 ktime_t rq_xtime; /* transmit time stamp */
98 int rq_ntrans; 101 int rq_ntrans;
99 102
100#if defined(CONFIG_NFS_V4_1) 103#if defined(CONFIG_NFS_V4_1)
@@ -174,8 +177,7 @@ struct rpc_xprt {
174 /* 177 /*
175 * Connection of transports 178 * Connection of transports
176 */ 179 */
177 unsigned long connect_timeout, 180 unsigned long bind_timeout,
178 bind_timeout,
179 reestablish_timeout; 181 reestablish_timeout;
180 unsigned int connect_cookie; /* A cookie that gets bumped 182 unsigned int connect_cookie; /* A cookie that gets bumped
181 every time the transport 183 every time the transport
@@ -294,7 +296,6 @@ void xprt_set_retrans_timeout_rtt(struct rpc_task *task);
294void xprt_wake_pending_tasks(struct rpc_xprt *xprt, int status); 296void xprt_wake_pending_tasks(struct rpc_xprt *xprt, int status);
295void xprt_wait_for_buffer_space(struct rpc_task *task, rpc_action action); 297void xprt_wait_for_buffer_space(struct rpc_task *task, rpc_action action);
296void xprt_write_space(struct rpc_xprt *xprt); 298void xprt_write_space(struct rpc_xprt *xprt);
297void xprt_update_rtt(struct rpc_task *task);
298void xprt_adjust_cwnd(struct rpc_task *task, int result); 299void xprt_adjust_cwnd(struct rpc_task *task, int result);
299struct rpc_rqst * xprt_lookup_rqst(struct rpc_xprt *xprt, __be32 xid); 300struct rpc_rqst * xprt_lookup_rqst(struct rpc_xprt *xprt, __be32 xid);
300void xprt_complete_rqst(struct rpc_task *task, int copied); 301void xprt_complete_rqst(struct rpc_task *task, int copied);
diff --git a/include/linux/tick.h b/include/linux/tick.h
index d2ae79e21be3..b232ccc0ee29 100644
--- a/include/linux/tick.h
+++ b/include/linux/tick.h
@@ -42,6 +42,7 @@ enum tick_nohz_mode {
42 * @idle_waketime: Time when the idle was interrupted 42 * @idle_waketime: Time when the idle was interrupted
43 * @idle_exittime: Time when the idle state was left 43 * @idle_exittime: Time when the idle state was left
44 * @idle_sleeptime: Sum of the time slept in idle with sched tick stopped 44 * @idle_sleeptime: Sum of the time slept in idle with sched tick stopped
45 * @iowait_sleeptime: Sum of the time slept in idle with sched tick stopped, with IO outstanding
45 * @sleep_length: Duration of the current idle sleep 46 * @sleep_length: Duration of the current idle sleep
46 * @do_timer_lst: CPU was the last one doing do_timer before going idle 47 * @do_timer_lst: CPU was the last one doing do_timer before going idle
47 */ 48 */
@@ -60,7 +61,7 @@ struct tick_sched {
60 ktime_t idle_waketime; 61 ktime_t idle_waketime;
61 ktime_t idle_exittime; 62 ktime_t idle_exittime;
62 ktime_t idle_sleeptime; 63 ktime_t idle_sleeptime;
63 ktime_t idle_lastupdate; 64 ktime_t iowait_sleeptime;
64 ktime_t sleep_length; 65 ktime_t sleep_length;
65 unsigned long last_jiffies; 66 unsigned long last_jiffies;
66 unsigned long next_jiffies; 67 unsigned long next_jiffies;
@@ -124,6 +125,7 @@ extern void tick_nohz_stop_sched_tick(int inidle);
124extern void tick_nohz_restart_sched_tick(void); 125extern void tick_nohz_restart_sched_tick(void);
125extern ktime_t tick_nohz_get_sleep_length(void); 126extern ktime_t tick_nohz_get_sleep_length(void);
126extern u64 get_cpu_idle_time_us(int cpu, u64 *last_update_time); 127extern u64 get_cpu_idle_time_us(int cpu, u64 *last_update_time);
128extern u64 get_cpu_iowait_time_us(int cpu, u64 *last_update_time);
127# else 129# else
128static inline void tick_nohz_stop_sched_tick(int inidle) { } 130static inline void tick_nohz_stop_sched_tick(int inidle) { }
129static inline void tick_nohz_restart_sched_tick(void) { } 131static inline void tick_nohz_restart_sched_tick(void) { }
@@ -134,6 +136,7 @@ static inline ktime_t tick_nohz_get_sleep_length(void)
134 return len; 136 return len;
135} 137}
136static inline u64 get_cpu_idle_time_us(int cpu, u64 *unused) { return -1; } 138static inline u64 get_cpu_idle_time_us(int cpu, u64 *unused) { return -1; }
139static inline u64 get_cpu_iowait_time_us(int cpu, u64 *unused) { return -1; }
137# endif /* !NO_HZ */ 140# endif /* !NO_HZ */
138 141
139#endif 142#endif
diff --git a/include/linux/time.h b/include/linux/time.h
index 6e026e45a179..ea3559f0b3f2 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -150,7 +150,6 @@ extern struct timespec timespec_trunc(struct timespec t, unsigned gran);
150extern int timekeeping_valid_for_hres(void); 150extern int timekeeping_valid_for_hres(void);
151extern u64 timekeeping_max_deferment(void); 151extern u64 timekeeping_max_deferment(void);
152extern void update_wall_time(void); 152extern void update_wall_time(void);
153extern void update_xtime_cache(u64 nsec);
154extern void timekeeping_leap_insert(int leapsecond); 153extern void timekeeping_leap_insert(int leapsecond);
155 154
156struct tms; 155struct tms;
diff --git a/include/linux/timer.h b/include/linux/timer.h
index a2d1eb6cb3f0..ea965b857a50 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -10,13 +10,19 @@
10struct tvec_base; 10struct tvec_base;
11 11
12struct timer_list { 12struct timer_list {
13 /*
14 * All fields that change during normal runtime grouped to the
15 * same cacheline
16 */
13 struct list_head entry; 17 struct list_head entry;
14 unsigned long expires; 18 unsigned long expires;
19 struct tvec_base *base;
15 20
16 void (*function)(unsigned long); 21 void (*function)(unsigned long);
17 unsigned long data; 22 unsigned long data;
18 23
19 struct tvec_base *base; 24 int slack;
25
20#ifdef CONFIG_TIMER_STATS 26#ifdef CONFIG_TIMER_STATS
21 void *start_site; 27 void *start_site;
22 char start_comm[16]; 28 char start_comm[16];
@@ -165,6 +171,8 @@ extern int mod_timer(struct timer_list *timer, unsigned long expires);
165extern int mod_timer_pending(struct timer_list *timer, unsigned long expires); 171extern int mod_timer_pending(struct timer_list *timer, unsigned long expires);
166extern int mod_timer_pinned(struct timer_list *timer, unsigned long expires); 172extern int mod_timer_pinned(struct timer_list *timer, unsigned long expires);
167 173
174extern void set_timer_slack(struct timer_list *time, int slack_hz);
175
168#define TIMER_NOT_PINNED 0 176#define TIMER_NOT_PINNED 0
169#define TIMER_PINNED 1 177#define TIMER_PINNED 1
170/* 178/*
diff --git a/include/linux/timex.h b/include/linux/timex.h
index 7a082b32d8e1..32d852f8cbe4 100644
--- a/include/linux/timex.h
+++ b/include/linux/timex.h
@@ -232,13 +232,11 @@ struct timex {
232 */ 232 */
233extern unsigned long tick_usec; /* USER_HZ period (usec) */ 233extern unsigned long tick_usec; /* USER_HZ period (usec) */
234extern unsigned long tick_nsec; /* ACTHZ period (nsec) */ 234extern unsigned long tick_nsec; /* ACTHZ period (nsec) */
235extern int tickadj; /* amount of adjustment per tick */
236 235
237/* 236/*
238 * phase-lock loop variables 237 * phase-lock loop variables
239 */ 238 */
240extern int time_status; /* clock synchronization status bits */ 239extern int time_status; /* clock synchronization status bits */
241extern long time_adjust; /* The amount of adjtime left */
242 240
243extern void ntp_init(void); 241extern void ntp_init(void);
244extern void ntp_clear(void); 242extern void ntp_clear(void);
@@ -271,9 +269,6 @@ extern void second_overflow(void);
271extern void update_ntp_one_tick(void); 269extern void update_ntp_one_tick(void);
272extern int do_adjtimex(struct timex *); 270extern int do_adjtimex(struct timex *);
273 271
274/* Don't use! Compatibility define for existing users. */
275#define tickadj (500/HZ ? : 1)
276
277int read_current_timer(unsigned long *timer_val); 272int read_current_timer(unsigned long *timer_val);
278 273
279/* The clock frequency of the i8253/i8254 PIT */ 274/* The clock frequency of the i8253/i8254 PIT */
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
index 78b4bd3be496..1d85f9a6a199 100644
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -33,6 +33,65 @@ struct tracepoint {
33 * Keep in sync with vmlinux.lds.h. 33 * Keep in sync with vmlinux.lds.h.
34 */ 34 */
35 35
36/*
37 * Connect a probe to a tracepoint.
38 * Internal API, should not be used directly.
39 */
40extern int tracepoint_probe_register(const char *name, void *probe);
41
42/*
43 * Disconnect a probe from a tracepoint.
44 * Internal API, should not be used directly.
45 */
46extern int tracepoint_probe_unregister(const char *name, void *probe);
47
48extern int tracepoint_probe_register_noupdate(const char *name, void *probe);
49extern int tracepoint_probe_unregister_noupdate(const char *name, void *probe);
50extern void tracepoint_probe_update_all(void);
51
52struct tracepoint_iter {
53 struct module *module;
54 struct tracepoint *tracepoint;
55};
56
57extern void tracepoint_iter_start(struct tracepoint_iter *iter);
58extern void tracepoint_iter_next(struct tracepoint_iter *iter);
59extern void tracepoint_iter_stop(struct tracepoint_iter *iter);
60extern void tracepoint_iter_reset(struct tracepoint_iter *iter);
61extern int tracepoint_get_iter_range(struct tracepoint **tracepoint,
62 struct tracepoint *begin, struct tracepoint *end);
63
64/*
65 * tracepoint_synchronize_unregister must be called between the last tracepoint
66 * probe unregistration and the end of module exit to make sure there is no
67 * caller executing a probe when it is freed.
68 */
69static inline void tracepoint_synchronize_unregister(void)
70{
71 synchronize_sched();
72}
73
74#define PARAMS(args...) args
75
76#ifdef CONFIG_TRACEPOINTS
77extern void tracepoint_update_probe_range(struct tracepoint *begin,
78 struct tracepoint *end);
79#else
80static inline void tracepoint_update_probe_range(struct tracepoint *begin,
81 struct tracepoint *end)
82{ }
83#endif /* CONFIG_TRACEPOINTS */
84
85#endif /* _LINUX_TRACEPOINT_H */
86
87/*
88 * Note: we keep the TRACE_EVENT and DECLARE_TRACE outside the include
89 * file ifdef protection.
90 * This is due to the way trace events work. If a file includes two
91 * trace event headers under one "CREATE_TRACE_POINTS" the first include
92 * will override the TRACE_EVENT and break the second include.
93 */
94
36#ifndef DECLARE_TRACE 95#ifndef DECLARE_TRACE
37 96
38#define TP_PROTO(args...) args 97#define TP_PROTO(args...) args
@@ -96,9 +155,6 @@ struct tracepoint {
96#define EXPORT_TRACEPOINT_SYMBOL(name) \ 155#define EXPORT_TRACEPOINT_SYMBOL(name) \
97 EXPORT_SYMBOL(__tracepoint_##name) 156 EXPORT_SYMBOL(__tracepoint_##name)
98 157
99extern void tracepoint_update_probe_range(struct tracepoint *begin,
100 struct tracepoint *end);
101
102#else /* !CONFIG_TRACEPOINTS */ 158#else /* !CONFIG_TRACEPOINTS */
103#define DECLARE_TRACE(name, proto, args) \ 159#define DECLARE_TRACE(name, proto, args) \
104 static inline void _do_trace_##name(struct tracepoint *tp, proto) \ 160 static inline void _do_trace_##name(struct tracepoint *tp, proto) \
@@ -119,61 +175,9 @@ extern void tracepoint_update_probe_range(struct tracepoint *begin,
119#define EXPORT_TRACEPOINT_SYMBOL_GPL(name) 175#define EXPORT_TRACEPOINT_SYMBOL_GPL(name)
120#define EXPORT_TRACEPOINT_SYMBOL(name) 176#define EXPORT_TRACEPOINT_SYMBOL(name)
121 177
122static inline void tracepoint_update_probe_range(struct tracepoint *begin,
123 struct tracepoint *end)
124{ }
125#endif /* CONFIG_TRACEPOINTS */ 178#endif /* CONFIG_TRACEPOINTS */
126#endif /* DECLARE_TRACE */ 179#endif /* DECLARE_TRACE */
127 180
128/*
129 * Connect a probe to a tracepoint.
130 * Internal API, should not be used directly.
131 */
132extern int tracepoint_probe_register(const char *name, void *probe);
133
134/*
135 * Disconnect a probe from a tracepoint.
136 * Internal API, should not be used directly.
137 */
138extern int tracepoint_probe_unregister(const char *name, void *probe);
139
140extern int tracepoint_probe_register_noupdate(const char *name, void *probe);
141extern int tracepoint_probe_unregister_noupdate(const char *name, void *probe);
142extern void tracepoint_probe_update_all(void);
143
144struct tracepoint_iter {
145 struct module *module;
146 struct tracepoint *tracepoint;
147};
148
149extern void tracepoint_iter_start(struct tracepoint_iter *iter);
150extern void tracepoint_iter_next(struct tracepoint_iter *iter);
151extern void tracepoint_iter_stop(struct tracepoint_iter *iter);
152extern void tracepoint_iter_reset(struct tracepoint_iter *iter);
153extern int tracepoint_get_iter_range(struct tracepoint **tracepoint,
154 struct tracepoint *begin, struct tracepoint *end);
155
156/*
157 * tracepoint_synchronize_unregister must be called between the last tracepoint
158 * probe unregistration and the end of module exit to make sure there is no
159 * caller executing a probe when it is freed.
160 */
161static inline void tracepoint_synchronize_unregister(void)
162{
163 synchronize_sched();
164}
165
166#define PARAMS(args...) args
167
168#endif /* _LINUX_TRACEPOINT_H */
169
170/*
171 * Note: we keep the TRACE_EVENT outside the include file ifdef protection.
172 * This is due to the way trace events work. If a file includes two
173 * trace event headers under one "CREATE_TRACE_POINTS" the first include
174 * will override the TRACE_EVENT and break the second include.
175 */
176
177#ifndef TRACE_EVENT 181#ifndef TRACE_EVENT
178/* 182/*
179 * For use with the TRACE_EVENT macro: 183 * For use with the TRACE_EVENT macro:
diff --git a/include/linux/types.h b/include/linux/types.h
index c42724f8c802..23d237a075e2 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -188,12 +188,12 @@ typedef u32 phys_addr_t;
188typedef phys_addr_t resource_size_t; 188typedef phys_addr_t resource_size_t;
189 189
190typedef struct { 190typedef struct {
191 volatile int counter; 191 int counter;
192} atomic_t; 192} atomic_t;
193 193
194#ifdef CONFIG_64BIT 194#ifdef CONFIG_64BIT
195typedef struct { 195typedef struct {
196 volatile long counter; 196 long counter;
197} atomic64_t; 197} atomic64_t;
198#endif 198#endif
199 199
diff --git a/include/linux/usb.h b/include/linux/usb.h
index ce1323c4e47c..739f1fd1cc15 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -1085,7 +1085,7 @@ typedef void (*usb_complete_t)(struct urb *);
1085 * Alternatively, drivers may pass the URB_NO_xxx_DMA_MAP transfer flags, 1085 * Alternatively, drivers may pass the URB_NO_xxx_DMA_MAP transfer flags,
1086 * which tell the host controller driver that no such mapping is needed since 1086 * which tell the host controller driver that no such mapping is needed since
1087 * the device driver is DMA-aware. For example, a device driver might 1087 * the device driver is DMA-aware. For example, a device driver might
1088 * allocate a DMA buffer with usb_buffer_alloc() or call usb_buffer_map(). 1088 * allocate a DMA buffer with usb_alloc_coherent() or call usb_buffer_map().
1089 * When these transfer flags are provided, host controller drivers will 1089 * When these transfer flags are provided, host controller drivers will
1090 * attempt to use the dma addresses found in the transfer_dma and/or 1090 * attempt to use the dma addresses found in the transfer_dma and/or
1091 * setup_dma fields rather than determining a dma address themselves. 1091 * setup_dma fields rather than determining a dma address themselves.
@@ -1366,11 +1366,23 @@ static inline int usb_urb_dir_out(struct urb *urb)
1366 return (urb->transfer_flags & URB_DIR_MASK) == URB_DIR_OUT; 1366 return (urb->transfer_flags & URB_DIR_MASK) == URB_DIR_OUT;
1367} 1367}
1368 1368
1369void *usb_buffer_alloc(struct usb_device *dev, size_t size, 1369void *usb_alloc_coherent(struct usb_device *dev, size_t size,
1370 gfp_t mem_flags, dma_addr_t *dma); 1370 gfp_t mem_flags, dma_addr_t *dma);
1371void usb_buffer_free(struct usb_device *dev, size_t size, 1371void usb_free_coherent(struct usb_device *dev, size_t size,
1372 void *addr, dma_addr_t dma); 1372 void *addr, dma_addr_t dma);
1373 1373
1374/* Compatible macros while we switch over */
1375static inline void *usb_buffer_alloc(struct usb_device *dev, size_t size,
1376 gfp_t mem_flags, dma_addr_t *dma)
1377{
1378 return usb_alloc_coherent(dev, size, mem_flags, dma);
1379}
1380static inline void usb_buffer_free(struct usb_device *dev, size_t size,
1381 void *addr, dma_addr_t dma)
1382{
1383 return usb_free_coherent(dev, size, addr, dma);
1384}
1385
1374#if 0 1386#if 0
1375struct urb *usb_buffer_map(struct urb *urb); 1387struct urb *usb_buffer_map(struct urb *urb);
1376void usb_buffer_dmasync(struct urb *urb); 1388void usb_buffer_dmasync(struct urb *urb);
diff --git a/include/linux/virtio_console.h b/include/linux/virtio_console.h
index ae4f039515b4..92228a8fbcbc 100644
--- a/include/linux/virtio_console.h
+++ b/include/linux/virtio_console.h
@@ -12,37 +12,14 @@
12 12
13/* Feature bits */ 13/* Feature bits */
14#define VIRTIO_CONSOLE_F_SIZE 0 /* Does host provide console size? */ 14#define VIRTIO_CONSOLE_F_SIZE 0 /* Does host provide console size? */
15#define VIRTIO_CONSOLE_F_MULTIPORT 1 /* Does host provide multiple ports? */
16 15
17struct virtio_console_config { 16struct virtio_console_config {
18 /* colums of the screens */ 17 /* colums of the screens */
19 __u16 cols; 18 __u16 cols;
20 /* rows of the screens */ 19 /* rows of the screens */
21 __u16 rows; 20 __u16 rows;
22 /* max. number of ports this device can hold */
23 __u32 max_nr_ports;
24 /* number of ports added so far */
25 __u32 nr_ports;
26} __attribute__((packed)); 21} __attribute__((packed));
27 22
28/*
29 * A message that's passed between the Host and the Guest for a
30 * particular port.
31 */
32struct virtio_console_control {
33 __u32 id; /* Port number */
34 __u16 event; /* The kind of control event (see below) */
35 __u16 value; /* Extra information for the key */
36};
37
38/* Some events for control messages */
39#define VIRTIO_CONSOLE_PORT_READY 0
40#define VIRTIO_CONSOLE_CONSOLE_PORT 1
41#define VIRTIO_CONSOLE_RESIZE 2
42#define VIRTIO_CONSOLE_PORT_OPEN 3
43#define VIRTIO_CONSOLE_PORT_NAME 4
44#define VIRTIO_CONSOLE_PORT_REMOVE 5
45
46#ifdef __KERNEL__ 23#ifdef __KERNEL__
47int __init virtio_cons_early_init(int (*put_chars)(u32, const char *, int)); 24int __init virtio_cons_early_init(int (*put_chars)(u32, const char *, int));
48#endif /* __KERNEL__ */ 25#endif /* __KERNEL__ */
diff --git a/include/linux/wait.h b/include/linux/wait.h
index a48e16b77d5e..76d96d035ea0 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -127,12 +127,26 @@ static inline void __add_wait_queue(wait_queue_head_t *head, wait_queue_t *new)
127/* 127/*
128 * Used for wake-one threads: 128 * Used for wake-one threads:
129 */ 129 */
130static inline void __add_wait_queue_exclusive(wait_queue_head_t *q,
131 wait_queue_t *wait)
132{
133 wait->flags |= WQ_FLAG_EXCLUSIVE;
134 __add_wait_queue(q, wait);
135}
136
130static inline void __add_wait_queue_tail(wait_queue_head_t *head, 137static inline void __add_wait_queue_tail(wait_queue_head_t *head,
131 wait_queue_t *new) 138 wait_queue_t *new)
132{ 139{
133 list_add_tail(&new->task_list, &head->task_list); 140 list_add_tail(&new->task_list, &head->task_list);
134} 141}
135 142
143static inline void __add_wait_queue_tail_exclusive(wait_queue_head_t *q,
144 wait_queue_t *wait)
145{
146 wait->flags |= WQ_FLAG_EXCLUSIVE;
147 __add_wait_queue_tail(q, wait);
148}
149
136static inline void __remove_wait_queue(wait_queue_head_t *head, 150static inline void __remove_wait_queue(wait_queue_head_t *head,
137 wait_queue_t *old) 151 wait_queue_t *old)
138{ 152{
@@ -404,25 +418,6 @@ do { \
404}) 418})
405 419
406/* 420/*
407 * Must be called with the spinlock in the wait_queue_head_t held.
408 */
409static inline void add_wait_queue_exclusive_locked(wait_queue_head_t *q,
410 wait_queue_t * wait)
411{
412 wait->flags |= WQ_FLAG_EXCLUSIVE;
413 __add_wait_queue_tail(q, wait);
414}
415
416/*
417 * Must be called with the spinlock in the wait_queue_head_t held.
418 */
419static inline void remove_wait_queue_locked(wait_queue_head_t *q,
420 wait_queue_t * wait)
421{
422 __remove_wait_queue(q, wait);
423}
424
425/*
426 * These are the old interfaces to sleep waiting for an event. 421 * These are the old interfaces to sleep waiting for an event.
427 * They are racy. DO NOT use them, use the wait_event* interfaces above. 422 * They are racy. DO NOT use them, use the wait_event* interfaces above.
428 * We plan to remove these interfaces. 423 * We plan to remove these interfaces.
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 76e8903cd204..36520ded3e06 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -34,6 +34,9 @@ struct writeback_control {
34 enum writeback_sync_modes sync_mode; 34 enum writeback_sync_modes sync_mode;
35 unsigned long *older_than_this; /* If !NULL, only write back inodes 35 unsigned long *older_than_this; /* If !NULL, only write back inodes
36 older than this */ 36 older than this */
37 unsigned long wb_start; /* Time writeback_inodes_wb was
38 called. This is needed to avoid
39 extra jobs and livelock */
37 long nr_to_write; /* Write this many pages, and decrement 40 long nr_to_write; /* Write this many pages, and decrement
38 this for each page written */ 41 this for each page written */
39 long pages_skipped; /* Pages which were not written */ 42 long pages_skipped; /* Pages which were not written */
diff --git a/include/linux/zorro.h b/include/linux/zorro.h
index 913bfc226dda..7bf9db525e9e 100644
--- a/include/linux/zorro.h
+++ b/include/linux/zorro.h
@@ -38,8 +38,6 @@
38typedef __u32 zorro_id; 38typedef __u32 zorro_id;
39 39
40 40
41#define ZORRO_WILDCARD (0xffffffff) /* not official */
42
43/* Include the ID list */ 41/* Include the ID list */
44#include <linux/zorro_ids.h> 42#include <linux/zorro_ids.h>
45 43
@@ -116,6 +114,7 @@ struct ConfigDev {
116 114
117#include <linux/init.h> 115#include <linux/init.h>
118#include <linux/ioport.h> 116#include <linux/ioport.h>
117#include <linux/mod_devicetable.h>
119 118
120#include <asm/zorro.h> 119#include <asm/zorro.h>
121 120
@@ -142,29 +141,10 @@ struct zorro_dev {
142 * Zorro bus 141 * Zorro bus
143 */ 142 */
144 143
145struct zorro_bus {
146 struct list_head devices; /* list of devices on this bus */
147 unsigned int num_resources; /* number of resources */
148 struct resource resources[4]; /* address space routed to this bus */
149 struct device dev;
150 char name[10];
151};
152
153extern struct zorro_bus zorro_bus; /* single Zorro bus */
154extern struct bus_type zorro_bus_type; 144extern struct bus_type zorro_bus_type;
155 145
156 146
157 /* 147 /*
158 * Zorro device IDs
159 */
160
161struct zorro_device_id {
162 zorro_id id; /* Device ID or ZORRO_WILDCARD */
163 unsigned long driver_data; /* Data private to the driver */
164};
165
166
167 /*
168 * Zorro device drivers 148 * Zorro device drivers
169 */ 149 */
170 150
diff --git a/include/media/saa7146_vv.h b/include/media/saa7146_vv.h
index b9da1f5591e7..4aeff96ff7d8 100644
--- a/include/media/saa7146_vv.h
+++ b/include/media/saa7146_vv.h
@@ -188,7 +188,6 @@ void saa7146_buffer_timeout(unsigned long data);
188void saa7146_dma_free(struct saa7146_dev* dev,struct videobuf_queue *q, 188void saa7146_dma_free(struct saa7146_dev* dev,struct videobuf_queue *q,
189 struct saa7146_buf *buf); 189 struct saa7146_buf *buf);
190 190
191int saa7146_vv_devinit(struct saa7146_dev *dev);
192int saa7146_vv_init(struct saa7146_dev* dev, struct saa7146_ext_vv *ext_vv); 191int saa7146_vv_init(struct saa7146_dev* dev, struct saa7146_ext_vv *ext_vv);
193int saa7146_vv_release(struct saa7146_dev* dev); 192int saa7146_vv_release(struct saa7146_dev* dev);
194 193
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h
index 8be5135ff7aa..2c55a7ea20af 100644
--- a/include/net/sctp/command.h
+++ b/include/net/sctp/command.h
@@ -107,6 +107,7 @@ typedef enum {
107 SCTP_CMD_T1_RETRAN, /* Mark for retransmission after T1 timeout */ 107 SCTP_CMD_T1_RETRAN, /* Mark for retransmission after T1 timeout */
108 SCTP_CMD_UPDATE_INITTAG, /* Update peer inittag */ 108 SCTP_CMD_UPDATE_INITTAG, /* Update peer inittag */
109 SCTP_CMD_SEND_MSG, /* Send the whole use message */ 109 SCTP_CMD_SEND_MSG, /* Send the whole use message */
110 SCTP_CMD_SEND_NEXT_ASCONF, /* Send the next ASCONF after ACK */
110 SCTP_CMD_LAST 111 SCTP_CMD_LAST
111} sctp_verb_t; 112} sctp_verb_t;
112 113
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index 78740ec57d5d..fa6cde578a1d 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -128,6 +128,7 @@ extern int sctp_register_pf(struct sctp_pf *, sa_family_t);
128int sctp_backlog_rcv(struct sock *sk, struct sk_buff *skb); 128int sctp_backlog_rcv(struct sock *sk, struct sk_buff *skb);
129int sctp_inet_listen(struct socket *sock, int backlog); 129int sctp_inet_listen(struct socket *sock, int backlog);
130void sctp_write_space(struct sock *sk); 130void sctp_write_space(struct sock *sk);
131void sctp_data_ready(struct sock *sk, int len);
131unsigned int sctp_poll(struct file *file, struct socket *sock, 132unsigned int sctp_poll(struct file *file, struct socket *sock,
132 poll_table *wait); 133 poll_table *wait);
133void sctp_sock_rfree(struct sk_buff *skb); 134void sctp_sock_rfree(struct sk_buff *skb);
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h
index 851c813adb3a..61d73e37d543 100644
--- a/include/net/sctp/sm.h
+++ b/include/net/sctp/sm.h
@@ -279,6 +279,7 @@ int sctp_do_sm(sctp_event_t event_type, sctp_subtype_t subtype,
279/* 2nd level prototypes */ 279/* 2nd level prototypes */
280void sctp_generate_t3_rtx_event(unsigned long peer); 280void sctp_generate_t3_rtx_event(unsigned long peer);
281void sctp_generate_heartbeat_event(unsigned long peer); 281void sctp_generate_heartbeat_event(unsigned long peer);
282void sctp_generate_proto_unreach_event(unsigned long peer);
282 283
283void sctp_ootb_pkt_free(struct sctp_packet *); 284void sctp_ootb_pkt_free(struct sctp_packet *);
284 285
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index ff3017744711..219043a67bf7 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -778,6 +778,7 @@ int sctp_user_addto_chunk(struct sctp_chunk *chunk, int off, int len,
778 struct iovec *data); 778 struct iovec *data);
779void sctp_chunk_free(struct sctp_chunk *); 779void sctp_chunk_free(struct sctp_chunk *);
780void *sctp_addto_chunk(struct sctp_chunk *, int len, const void *data); 780void *sctp_addto_chunk(struct sctp_chunk *, int len, const void *data);
781void *sctp_addto_chunk_fixed(struct sctp_chunk *, int len, const void *data);
781struct sctp_chunk *sctp_chunkify(struct sk_buff *, 782struct sctp_chunk *sctp_chunkify(struct sk_buff *,
782 const struct sctp_association *, 783 const struct sctp_association *,
783 struct sock *); 784 struct sock *);
@@ -1009,6 +1010,9 @@ struct sctp_transport {
1009 /* Heartbeat timer is per destination. */ 1010 /* Heartbeat timer is per destination. */
1010 struct timer_list hb_timer; 1011 struct timer_list hb_timer;
1011 1012
1013 /* Timer to handle ICMP proto unreachable envets */
1014 struct timer_list proto_unreach_timer;
1015
1012 /* Since we're using per-destination retransmission timers 1016 /* Since we're using per-destination retransmission timers
1013 * (see above), we're also using per-destination "transmitted" 1017 * (see above), we're also using per-destination "transmitted"
1014 * queues. This probably ought to be a private struct 1018 * queues. This probably ought to be a private struct
diff --git a/include/net/sock.h b/include/net/sock.h
index b4603cd54fcd..1ad6435f252e 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -74,7 +74,7 @@
74 printk(KERN_DEBUG msg); } while (0) 74 printk(KERN_DEBUG msg); } while (0)
75#else 75#else
76/* Validate arguments and do nothing */ 76/* Validate arguments and do nothing */
77static void inline int __attribute__ ((format (printf, 2, 3))) 77static inline void __attribute__ ((format (printf, 2, 3)))
78SOCK_DEBUG(struct sock *sk, const char *msg, ...) 78SOCK_DEBUG(struct sock *sk, const char *msg, ...)
79{ 79{
80} 80}
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 75be5a28815d..aa04b9a5093b 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1197,30 +1197,15 @@ extern int tcp_v4_md5_do_del(struct sock *sk,
1197extern struct tcp_md5sig_pool * __percpu *tcp_alloc_md5sig_pool(struct sock *); 1197extern struct tcp_md5sig_pool * __percpu *tcp_alloc_md5sig_pool(struct sock *);
1198extern void tcp_free_md5sig_pool(void); 1198extern void tcp_free_md5sig_pool(void);
1199 1199
1200extern struct tcp_md5sig_pool *__tcp_get_md5sig_pool(int cpu); 1200extern struct tcp_md5sig_pool *tcp_get_md5sig_pool(void);
1201extern void __tcp_put_md5sig_pool(void); 1201extern void tcp_put_md5sig_pool(void);
1202
1202extern int tcp_md5_hash_header(struct tcp_md5sig_pool *, struct tcphdr *); 1203extern int tcp_md5_hash_header(struct tcp_md5sig_pool *, struct tcphdr *);
1203extern int tcp_md5_hash_skb_data(struct tcp_md5sig_pool *, struct sk_buff *, 1204extern int tcp_md5_hash_skb_data(struct tcp_md5sig_pool *, struct sk_buff *,
1204 unsigned header_len); 1205 unsigned header_len);
1205extern int tcp_md5_hash_key(struct tcp_md5sig_pool *hp, 1206extern int tcp_md5_hash_key(struct tcp_md5sig_pool *hp,
1206 struct tcp_md5sig_key *key); 1207 struct tcp_md5sig_key *key);
1207 1208
1208static inline
1209struct tcp_md5sig_pool *tcp_get_md5sig_pool(void)
1210{
1211 int cpu = get_cpu();
1212 struct tcp_md5sig_pool *ret = __tcp_get_md5sig_pool(cpu);
1213 if (!ret)
1214 put_cpu();
1215 return ret;
1216}
1217
1218static inline void tcp_put_md5sig_pool(void)
1219{
1220 __tcp_put_md5sig_pool();
1221 put_cpu();
1222}
1223
1224/* write queue abstraction */ 1209/* write queue abstraction */
1225static inline void tcp_write_queue_purge(struct sock *sk) 1210static inline void tcp_write_queue_purge(struct sock *sk)
1226{ 1211{
diff --git a/include/net/x25.h b/include/net/x25.h
index 15ef9624ab75..468551ea4f1d 100644
--- a/include/net/x25.h
+++ b/include/net/x25.h
@@ -183,6 +183,10 @@ extern int sysctl_x25_clear_request_timeout;
183extern int sysctl_x25_ack_holdback_timeout; 183extern int sysctl_x25_ack_holdback_timeout;
184extern int sysctl_x25_forward; 184extern int sysctl_x25_forward;
185 185
186extern int x25_parse_address_block(struct sk_buff *skb,
187 struct x25_address *called_addr,
188 struct x25_address *calling_addr);
189
186extern int x25_addr_ntoa(unsigned char *, struct x25_address *, 190extern int x25_addr_ntoa(unsigned char *, struct x25_address *,
187 struct x25_address *); 191 struct x25_address *);
188extern int x25_addr_aton(unsigned char *, struct x25_address *, 192extern int x25_addr_aton(unsigned char *, struct x25_address *,
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h
index d57847f2f6c1..aab3c13dc310 100644
--- a/include/pcmcia/ds.h
+++ b/include/pcmcia/ds.h
@@ -26,6 +26,7 @@
26#ifdef __KERNEL__ 26#ifdef __KERNEL__
27#include <linux/device.h> 27#include <linux/device.h>
28#include <pcmcia/ss.h> 28#include <pcmcia/ss.h>
29#include <asm/atomic.h>
29 30
30/* 31/*
31 * PCMCIA device drivers (16-bit cards only; 32-bit cards require CardBus 32 * PCMCIA device drivers (16-bit cards only; 32-bit cards require CardBus
@@ -94,10 +95,8 @@ struct pcmcia_device {
94 config_req_t conf; 95 config_req_t conf;
95 window_handle_t win; 96 window_handle_t win;
96 97
97 /* Is the device suspended, or in the process of 98 /* Is the device suspended? */
98 * being removed? */
99 u16 suspended:1; 99 u16 suspended:1;
100 u16 _removed:1;
101 100
102 /* Flags whether io, irq, win configurations were 101 /* Flags whether io, irq, win configurations were
103 * requested, and whether the configuration is "locked" */ 102 * requested, and whether the configuration is "locked" */
@@ -115,7 +114,7 @@ struct pcmcia_device {
115 u16 has_card_id:1; 114 u16 has_card_id:1;
116 u16 has_func_id:1; 115 u16 has_func_id:1;
117 116
118 u16 reserved:3; 117 u16 reserved:4;
119 118
120 u8 func_id; 119 u8 func_id;
121 u16 manf_id; 120 u16 manf_id;
diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h
index 2e488b60bc76..344705cb42f4 100644
--- a/include/pcmcia/ss.h
+++ b/include/pcmcia/ss.h
@@ -224,18 +224,16 @@ struct pcmcia_socket {
224 224
225 /* 16-bit state: */ 225 /* 16-bit state: */
226 struct { 226 struct {
227 /* PCMCIA card is present in socket */
228 u8 present:1;
229 /* "master" ioctl is used */ 227 /* "master" ioctl is used */
230 u8 busy:1; 228 u8 busy:1;
231 /* pcmcia module is being unloaded */
232 u8 dead:1;
233 /* the PCMCIA card consists of two pseudo devices */ 229 /* the PCMCIA card consists of two pseudo devices */
234 u8 has_pfc:1; 230 u8 has_pfc:1;
235 231
236 u8 reserved:4; 232 u8 reserved:6;
237 } pcmcia_state; 233 } pcmcia_state;
238 234
235 /* non-zero if PCMCIA card is present */
236 atomic_t present;
239 237
240#ifdef CONFIG_PCMCIA_IOCTL 238#ifdef CONFIG_PCMCIA_IOCTL
241 struct user_info_t *user; 239 struct user_info_t *user;
diff --git a/include/sound/ak4113.h b/include/sound/ak4113.h
index 8988edae1609..2609048c1d44 100644
--- a/include/sound/ak4113.h
+++ b/include/sound/ak4113.h
@@ -307,7 +307,7 @@ struct ak4113 {
307 307
308int snd_ak4113_create(struct snd_card *card, ak4113_read_t *read, 308int snd_ak4113_create(struct snd_card *card, ak4113_read_t *read,
309 ak4113_write_t *write, 309 ak4113_write_t *write,
310 const unsigned char pgm[AK4113_WRITABLE_REGS], 310 const unsigned char *pgm,
311 void *private_data, struct ak4113 **r_ak4113); 311 void *private_data, struct ak4113 **r_ak4113);
312void snd_ak4113_reg_write(struct ak4113 *ak4113, unsigned char reg, 312void snd_ak4113_reg_write(struct ak4113 *ak4113, unsigned char reg,
313 unsigned char mask, unsigned char val); 313 unsigned char mask, unsigned char val);
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index 061f16d4c878..0a0b019d41ad 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -219,7 +219,6 @@ struct snd_soc_dai {
219 struct snd_soc_codec *codec; 219 struct snd_soc_codec *codec;
220 unsigned int active; 220 unsigned int active;
221 unsigned char pop_wait:1; 221 unsigned char pop_wait:1;
222 void *dma_data;
223 222
224 /* DAI private data */ 223 /* DAI private data */
225 void *private_data; 224 void *private_data;
@@ -230,4 +229,21 @@ struct snd_soc_dai {
230 struct list_head list; 229 struct list_head list;
231}; 230};
232 231
232static inline void *snd_soc_dai_get_dma_data(const struct snd_soc_dai *dai,
233 const struct snd_pcm_substream *ss)
234{
235 return (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) ?
236 dai->playback.dma_data : dai->capture.dma_data;
237}
238
239static inline void snd_soc_dai_set_dma_data(struct snd_soc_dai *dai,
240 const struct snd_pcm_substream *ss,
241 void *data)
242{
243 if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK)
244 dai->playback.dma_data = data;
245 else
246 dai->capture.dma_data = data;
247}
248
233#endif 249#endif
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 5d234a8c2506..a57fbfcd4c8f 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -375,6 +375,7 @@ struct snd_soc_pcm_stream {
375 unsigned int channels_min; /* min channels */ 375 unsigned int channels_min; /* min channels */
376 unsigned int channels_max; /* max channels */ 376 unsigned int channels_max; /* max channels */
377 unsigned int active:1; /* stream is in use */ 377 unsigned int active:1; /* stream is in use */
378 void *dma_data; /* used by platform code */
378}; 379};
379 380
380/* SoC audio ops */ 381/* SoC audio ops */
diff --git a/include/trace/define_trace.h b/include/trace/define_trace.h
index 5acfb1eb4df9..1dfab5401511 100644
--- a/include/trace/define_trace.h
+++ b/include/trace/define_trace.h
@@ -65,6 +65,10 @@
65 65
66#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) 66#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
67 67
68/* Make all open coded DECLARE_TRACE nops */
69#undef DECLARE_TRACE
70#define DECLARE_TRACE(name, proto, args)
71
68#ifdef CONFIG_EVENT_TRACING 72#ifdef CONFIG_EVENT_TRACING
69#include <trace/ftrace.h> 73#include <trace/ftrace.h>
70#endif 74#endif
@@ -75,6 +79,7 @@
75#undef DEFINE_EVENT 79#undef DEFINE_EVENT
76#undef DEFINE_EVENT_PRINT 80#undef DEFINE_EVENT_PRINT
77#undef TRACE_HEADER_MULTI_READ 81#undef TRACE_HEADER_MULTI_READ
82#undef DECLARE_TRACE
78 83
79/* Only undef what we defined in this file */ 84/* Only undef what we defined in this file */
80#ifdef UNDEF_TRACE_INCLUDE_FILE 85#ifdef UNDEF_TRACE_INCLUDE_FILE
diff --git a/include/trace/events/block.h b/include/trace/events/block.h
index 5fb72733331e..d870a918559c 100644
--- a/include/trace/events/block.h
+++ b/include/trace/events/block.h
@@ -40,6 +40,16 @@ DECLARE_EVENT_CLASS(block_rq_with_error,
40 __entry->nr_sector, __entry->errors) 40 __entry->nr_sector, __entry->errors)
41); 41);
42 42
43/**
44 * block_rq_abort - abort block operation request
45 * @q: queue containing the block operation request
46 * @rq: block IO operation request
47 *
48 * Called immediately after pending block IO operation request @rq in
49 * queue @q is aborted. The fields in the operation request @rq
50 * can be examined to determine which device and sectors the pending
51 * operation would access.
52 */
43DEFINE_EVENT(block_rq_with_error, block_rq_abort, 53DEFINE_EVENT(block_rq_with_error, block_rq_abort,
44 54
45 TP_PROTO(struct request_queue *q, struct request *rq), 55 TP_PROTO(struct request_queue *q, struct request *rq),
@@ -47,6 +57,15 @@ DEFINE_EVENT(block_rq_with_error, block_rq_abort,
47 TP_ARGS(q, rq) 57 TP_ARGS(q, rq)
48); 58);
49 59
60/**
61 * block_rq_requeue - place block IO request back on a queue
62 * @q: queue holding operation
63 * @rq: block IO operation request
64 *
65 * The block operation request @rq is being placed back into queue
66 * @q. For some reason the request was not completed and needs to be
67 * put back in the queue.
68 */
50DEFINE_EVENT(block_rq_with_error, block_rq_requeue, 69DEFINE_EVENT(block_rq_with_error, block_rq_requeue,
51 70
52 TP_PROTO(struct request_queue *q, struct request *rq), 71 TP_PROTO(struct request_queue *q, struct request *rq),
@@ -54,6 +73,17 @@ DEFINE_EVENT(block_rq_with_error, block_rq_requeue,
54 TP_ARGS(q, rq) 73 TP_ARGS(q, rq)
55); 74);
56 75
76/**
77 * block_rq_complete - block IO operation completed by device driver
78 * @q: queue containing the block operation request
79 * @rq: block operations request
80 *
81 * The block_rq_complete tracepoint event indicates that some portion
82 * of operation request has been completed by the device driver. If
83 * the @rq->bio is %NULL, then there is absolutely no additional work to
84 * do for the request. If @rq->bio is non-NULL then there is
85 * additional work required to complete the request.
86 */
57DEFINE_EVENT(block_rq_with_error, block_rq_complete, 87DEFINE_EVENT(block_rq_with_error, block_rq_complete,
58 88
59 TP_PROTO(struct request_queue *q, struct request *rq), 89 TP_PROTO(struct request_queue *q, struct request *rq),
@@ -95,6 +125,16 @@ DECLARE_EVENT_CLASS(block_rq,
95 __entry->nr_sector, __entry->comm) 125 __entry->nr_sector, __entry->comm)
96); 126);
97 127
128/**
129 * block_rq_insert - insert block operation request into queue
130 * @q: target queue
131 * @rq: block IO operation request
132 *
133 * Called immediately before block operation request @rq is inserted
134 * into queue @q. The fields in the operation request @rq struct can
135 * be examined to determine which device and sectors the pending
136 * operation would access.
137 */
98DEFINE_EVENT(block_rq, block_rq_insert, 138DEFINE_EVENT(block_rq, block_rq_insert,
99 139
100 TP_PROTO(struct request_queue *q, struct request *rq), 140 TP_PROTO(struct request_queue *q, struct request *rq),
@@ -102,6 +142,14 @@ DEFINE_EVENT(block_rq, block_rq_insert,
102 TP_ARGS(q, rq) 142 TP_ARGS(q, rq)
103); 143);
104 144
145/**
146 * block_rq_issue - issue pending block IO request operation to device driver
147 * @q: queue holding operation
148 * @rq: block IO operation operation request
149 *
150 * Called when block operation request @rq from queue @q is sent to a
151 * device driver for processing.
152 */
105DEFINE_EVENT(block_rq, block_rq_issue, 153DEFINE_EVENT(block_rq, block_rq_issue,
106 154
107 TP_PROTO(struct request_queue *q, struct request *rq), 155 TP_PROTO(struct request_queue *q, struct request *rq),
@@ -109,6 +157,17 @@ DEFINE_EVENT(block_rq, block_rq_issue,
109 TP_ARGS(q, rq) 157 TP_ARGS(q, rq)
110); 158);
111 159
160/**
161 * block_bio_bounce - used bounce buffer when processing block operation
162 * @q: queue holding the block operation
163 * @bio: block operation
164 *
165 * A bounce buffer was used to handle the block operation @bio in @q.
166 * This occurs when hardware limitations prevent a direct transfer of
167 * data between the @bio data memory area and the IO device. Use of a
168 * bounce buffer requires extra copying of data and decreases
169 * performance.
170 */
112TRACE_EVENT(block_bio_bounce, 171TRACE_EVENT(block_bio_bounce,
113 172
114 TP_PROTO(struct request_queue *q, struct bio *bio), 173 TP_PROTO(struct request_queue *q, struct bio *bio),
@@ -138,6 +197,14 @@ TRACE_EVENT(block_bio_bounce,
138 __entry->nr_sector, __entry->comm) 197 __entry->nr_sector, __entry->comm)
139); 198);
140 199
200/**
201 * block_bio_complete - completed all work on the block operation
202 * @q: queue holding the block operation
203 * @bio: block operation completed
204 *
205 * This tracepoint indicates there is no further work to do on this
206 * block IO operation @bio.
207 */
141TRACE_EVENT(block_bio_complete, 208TRACE_EVENT(block_bio_complete,
142 209
143 TP_PROTO(struct request_queue *q, struct bio *bio), 210 TP_PROTO(struct request_queue *q, struct bio *bio),
@@ -193,6 +260,14 @@ DECLARE_EVENT_CLASS(block_bio,
193 __entry->nr_sector, __entry->comm) 260 __entry->nr_sector, __entry->comm)
194); 261);
195 262
263/**
264 * block_bio_backmerge - merging block operation to the end of an existing operation
265 * @q: queue holding operation
266 * @bio: new block operation to merge
267 *
268 * Merging block request @bio to the end of an existing block request
269 * in queue @q.
270 */
196DEFINE_EVENT(block_bio, block_bio_backmerge, 271DEFINE_EVENT(block_bio, block_bio_backmerge,
197 272
198 TP_PROTO(struct request_queue *q, struct bio *bio), 273 TP_PROTO(struct request_queue *q, struct bio *bio),
@@ -200,6 +275,14 @@ DEFINE_EVENT(block_bio, block_bio_backmerge,
200 TP_ARGS(q, bio) 275 TP_ARGS(q, bio)
201); 276);
202 277
278/**
279 * block_bio_frontmerge - merging block operation to the beginning of an existing operation
280 * @q: queue holding operation
281 * @bio: new block operation to merge
282 *
283 * Merging block IO operation @bio to the beginning of an existing block
284 * operation in queue @q.
285 */
203DEFINE_EVENT(block_bio, block_bio_frontmerge, 286DEFINE_EVENT(block_bio, block_bio_frontmerge,
204 287
205 TP_PROTO(struct request_queue *q, struct bio *bio), 288 TP_PROTO(struct request_queue *q, struct bio *bio),
@@ -207,6 +290,13 @@ DEFINE_EVENT(block_bio, block_bio_frontmerge,
207 TP_ARGS(q, bio) 290 TP_ARGS(q, bio)
208); 291);
209 292
293/**
294 * block_bio_queue - putting new block IO operation in queue
295 * @q: queue holding operation
296 * @bio: new block operation
297 *
298 * About to place the block IO operation @bio into queue @q.
299 */
210DEFINE_EVENT(block_bio, block_bio_queue, 300DEFINE_EVENT(block_bio, block_bio_queue,
211 301
212 TP_PROTO(struct request_queue *q, struct bio *bio), 302 TP_PROTO(struct request_queue *q, struct bio *bio),
@@ -243,6 +333,15 @@ DECLARE_EVENT_CLASS(block_get_rq,
243 __entry->nr_sector, __entry->comm) 333 __entry->nr_sector, __entry->comm)
244); 334);
245 335
336/**
337 * block_getrq - get a free request entry in queue for block IO operations
338 * @q: queue for operations
339 * @bio: pending block IO operation
340 * @rw: low bit indicates a read (%0) or a write (%1)
341 *
342 * A request struct for queue @q has been allocated to handle the
343 * block IO operation @bio.
344 */
246DEFINE_EVENT(block_get_rq, block_getrq, 345DEFINE_EVENT(block_get_rq, block_getrq,
247 346
248 TP_PROTO(struct request_queue *q, struct bio *bio, int rw), 347 TP_PROTO(struct request_queue *q, struct bio *bio, int rw),
@@ -250,6 +349,17 @@ DEFINE_EVENT(block_get_rq, block_getrq,
250 TP_ARGS(q, bio, rw) 349 TP_ARGS(q, bio, rw)
251); 350);
252 351
352/**
353 * block_sleeprq - waiting to get a free request entry in queue for block IO operation
354 * @q: queue for operation
355 * @bio: pending block IO operation
356 * @rw: low bit indicates a read (%0) or a write (%1)
357 *
358 * In the case where a request struct cannot be provided for queue @q
359 * the process needs to wait for an request struct to become
360 * available. This tracepoint event is generated each time the
361 * process goes to sleep waiting for request struct become available.
362 */
253DEFINE_EVENT(block_get_rq, block_sleeprq, 363DEFINE_EVENT(block_get_rq, block_sleeprq,
254 364
255 TP_PROTO(struct request_queue *q, struct bio *bio, int rw), 365 TP_PROTO(struct request_queue *q, struct bio *bio, int rw),
@@ -257,6 +367,14 @@ DEFINE_EVENT(block_get_rq, block_sleeprq,
257 TP_ARGS(q, bio, rw) 367 TP_ARGS(q, bio, rw)
258); 368);
259 369
370/**
371 * block_plug - keep operations requests in request queue
372 * @q: request queue to plug
373 *
374 * Plug the request queue @q. Do not allow block operation requests
375 * to be sent to the device driver. Instead, accumulate requests in
376 * the queue to improve throughput performance of the block device.
377 */
260TRACE_EVENT(block_plug, 378TRACE_EVENT(block_plug,
261 379
262 TP_PROTO(struct request_queue *q), 380 TP_PROTO(struct request_queue *q),
@@ -293,6 +411,13 @@ DECLARE_EVENT_CLASS(block_unplug,
293 TP_printk("[%s] %d", __entry->comm, __entry->nr_rq) 411 TP_printk("[%s] %d", __entry->comm, __entry->nr_rq)
294); 412);
295 413
414/**
415 * block_unplug_timer - timed release of operations requests in queue to device driver
416 * @q: request queue to unplug
417 *
418 * Unplug the request queue @q because a timer expired and allow block
419 * operation requests to be sent to the device driver.
420 */
296DEFINE_EVENT(block_unplug, block_unplug_timer, 421DEFINE_EVENT(block_unplug, block_unplug_timer,
297 422
298 TP_PROTO(struct request_queue *q), 423 TP_PROTO(struct request_queue *q),
@@ -300,6 +425,13 @@ DEFINE_EVENT(block_unplug, block_unplug_timer,
300 TP_ARGS(q) 425 TP_ARGS(q)
301); 426);
302 427
428/**
429 * block_unplug_io - release of operations requests in request queue
430 * @q: request queue to unplug
431 *
432 * Unplug request queue @q because device driver is scheduled to work
433 * on elements in the request queue.
434 */
303DEFINE_EVENT(block_unplug, block_unplug_io, 435DEFINE_EVENT(block_unplug, block_unplug_io,
304 436
305 TP_PROTO(struct request_queue *q), 437 TP_PROTO(struct request_queue *q),
@@ -307,6 +439,17 @@ DEFINE_EVENT(block_unplug, block_unplug_io,
307 TP_ARGS(q) 439 TP_ARGS(q)
308); 440);
309 441
442/**
443 * block_split - split a single bio struct into two bio structs
444 * @q: queue containing the bio
445 * @bio: block operation being split
446 * @new_sector: The starting sector for the new bio
447 *
448 * The bio request @bio in request queue @q needs to be split into two
449 * bio requests. The newly created @bio request starts at
450 * @new_sector. This split may be required due to hardware limitation
451 * such as operation crossing device boundaries in a RAID system.
452 */
310TRACE_EVENT(block_split, 453TRACE_EVENT(block_split,
311 454
312 TP_PROTO(struct request_queue *q, struct bio *bio, 455 TP_PROTO(struct request_queue *q, struct bio *bio,
@@ -337,6 +480,16 @@ TRACE_EVENT(block_split,
337 __entry->comm) 480 __entry->comm)
338); 481);
339 482
483/**
484 * block_remap - map request for a partition to the raw device
485 * @q: queue holding the operation
486 * @bio: revised operation
487 * @dev: device for the operation
488 * @from: original sector for the operation
489 *
490 * An operation for a partition on a block device has been mapped to the
491 * raw block device.
492 */
340TRACE_EVENT(block_remap, 493TRACE_EVENT(block_remap,
341 494
342 TP_PROTO(struct request_queue *q, struct bio *bio, dev_t dev, 495 TP_PROTO(struct request_queue *q, struct bio *bio, dev_t dev,
@@ -370,6 +523,17 @@ TRACE_EVENT(block_remap,
370 (unsigned long long)__entry->old_sector) 523 (unsigned long long)__entry->old_sector)
371); 524);
372 525
526/**
527 * block_rq_remap - map request for a block operation request
528 * @q: queue holding the operation
529 * @rq: block IO operation request
530 * @dev: device for the operation
531 * @from: original sector for the operation
532 *
533 * The block operation request @rq in @q has been remapped. The block
534 * operation request @rq holds the current information and @from hold
535 * the original sector.
536 */
373TRACE_EVENT(block_rq_remap, 537TRACE_EVENT(block_rq_remap,
374 538
375 TP_PROTO(struct request_queue *q, struct request *rq, dev_t dev, 539 TP_PROTO(struct request_queue *q, struct request *rq, dev_t dev,
diff --git a/include/trace/events/lock.h b/include/trace/events/lock.h
index 5c1dcfc16c60..2821b86de63b 100644
--- a/include/trace/events/lock.h
+++ b/include/trace/events/lock.h
@@ -35,15 +35,15 @@ TRACE_EVENT(lock_acquire,
35 __get_str(name)) 35 __get_str(name))
36); 36);
37 37
38TRACE_EVENT(lock_release, 38DECLARE_EVENT_CLASS(lock,
39 39
40 TP_PROTO(struct lockdep_map *lock, int nested, unsigned long ip), 40 TP_PROTO(struct lockdep_map *lock, unsigned long ip),
41 41
42 TP_ARGS(lock, nested, ip), 42 TP_ARGS(lock, ip),
43 43
44 TP_STRUCT__entry( 44 TP_STRUCT__entry(
45 __string(name, lock->name) 45 __string( name, lock->name )
46 __field(void *, lockdep_addr) 46 __field( void *, lockdep_addr )
47 ), 47 ),
48 48
49 TP_fast_assign( 49 TP_fast_assign(
@@ -51,51 +51,30 @@ TRACE_EVENT(lock_release,
51 __entry->lockdep_addr = lock; 51 __entry->lockdep_addr = lock;
52 ), 52 ),
53 53
54 TP_printk("%p %s", 54 TP_printk("%p %s", __entry->lockdep_addr, __get_str(name))
55 __entry->lockdep_addr, __get_str(name))
56); 55);
57 56
58#ifdef CONFIG_LOCK_STAT 57DEFINE_EVENT(lock, lock_release,
59
60TRACE_EVENT(lock_contended,
61 58
62 TP_PROTO(struct lockdep_map *lock, unsigned long ip), 59 TP_PROTO(struct lockdep_map *lock, unsigned long ip),
63 60
64 TP_ARGS(lock, ip), 61 TP_ARGS(lock, ip)
62);
65 63
66 TP_STRUCT__entry( 64#ifdef CONFIG_LOCK_STAT
67 __string(name, lock->name)
68 __field(void *, lockdep_addr)
69 ),
70 65
71 TP_fast_assign( 66DEFINE_EVENT(lock, lock_contended,
72 __assign_str(name, lock->name);
73 __entry->lockdep_addr = lock;
74 ),
75 67
76 TP_printk("%p %s", 68 TP_PROTO(struct lockdep_map *lock, unsigned long ip),
77 __entry->lockdep_addr, __get_str(name))
78);
79 69
80TRACE_EVENT(lock_acquired, 70 TP_ARGS(lock, ip)
81 TP_PROTO(struct lockdep_map *lock, unsigned long ip, s64 waittime), 71);
82 72
83 TP_ARGS(lock, ip, waittime), 73DEFINE_EVENT(lock, lock_acquired,
84 74
85 TP_STRUCT__entry( 75 TP_PROTO(struct lockdep_map *lock, unsigned long ip),
86 __string(name, lock->name)
87 __field(s64, wait_nsec)
88 __field(void *, lockdep_addr)
89 ),
90 76
91 TP_fast_assign( 77 TP_ARGS(lock, ip)
92 __assign_str(name, lock->name);
93 __entry->wait_nsec = waittime;
94 __entry->lockdep_addr = lock;
95 ),
96 TP_printk("%p %s (%llu ns)", __entry->lockdep_addr,
97 __get_str(name),
98 __entry->wait_nsec)
99); 78);
100 79
101#endif 80#endif
diff --git a/include/trace/events/module.h b/include/trace/events/module.h
index 4b0f48ba16a6..c7bb2f0482fe 100644
--- a/include/trace/events/module.h
+++ b/include/trace/events/module.h
@@ -51,11 +51,14 @@ TRACE_EVENT(module_free,
51 TP_printk("%s", __get_str(name)) 51 TP_printk("%s", __get_str(name))
52); 52);
53 53
54#ifdef CONFIG_MODULE_UNLOAD
55/* trace_module_get/put are only used if CONFIG_MODULE_UNLOAD is defined */
56
54DECLARE_EVENT_CLASS(module_refcnt, 57DECLARE_EVENT_CLASS(module_refcnt,
55 58
56 TP_PROTO(struct module *mod, unsigned long ip, int refcnt), 59 TP_PROTO(struct module *mod, unsigned long ip),
57 60
58 TP_ARGS(mod, ip, refcnt), 61 TP_ARGS(mod, ip),
59 62
60 TP_STRUCT__entry( 63 TP_STRUCT__entry(
61 __field( unsigned long, ip ) 64 __field( unsigned long, ip )
@@ -65,7 +68,7 @@ DECLARE_EVENT_CLASS(module_refcnt,
65 68
66 TP_fast_assign( 69 TP_fast_assign(
67 __entry->ip = ip; 70 __entry->ip = ip;
68 __entry->refcnt = refcnt; 71 __entry->refcnt = __this_cpu_read(mod->refptr->incs) + __this_cpu_read(mod->refptr->decs);
69 __assign_str(name, mod->name); 72 __assign_str(name, mod->name);
70 ), 73 ),
71 74
@@ -75,17 +78,18 @@ DECLARE_EVENT_CLASS(module_refcnt,
75 78
76DEFINE_EVENT(module_refcnt, module_get, 79DEFINE_EVENT(module_refcnt, module_get,
77 80
78 TP_PROTO(struct module *mod, unsigned long ip, int refcnt), 81 TP_PROTO(struct module *mod, unsigned long ip),
79 82
80 TP_ARGS(mod, ip, refcnt) 83 TP_ARGS(mod, ip)
81); 84);
82 85
83DEFINE_EVENT(module_refcnt, module_put, 86DEFINE_EVENT(module_refcnt, module_put,
84 87
85 TP_PROTO(struct module *mod, unsigned long ip, int refcnt), 88 TP_PROTO(struct module *mod, unsigned long ip),
86 89
87 TP_ARGS(mod, ip, refcnt) 90 TP_ARGS(mod, ip)
88); 91);
92#endif /* CONFIG_MODULE_UNLOAD */
89 93
90TRACE_EVENT(module_request, 94TRACE_EVENT(module_request,
91 95
diff --git a/include/trace/events/napi.h b/include/trace/events/napi.h
index a8989c4547e7..188deca2f3c7 100644
--- a/include/trace/events/napi.h
+++ b/include/trace/events/napi.h
@@ -1,4 +1,7 @@
1#ifndef _TRACE_NAPI_H_ 1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM napi
3
4#if !defined(_TRACE_NAPI_H) || defined(TRACE_HEADER_MULTI_READ)
2#define _TRACE_NAPI_H_ 5#define _TRACE_NAPI_H_
3 6
4#include <linux/netdevice.h> 7#include <linux/netdevice.h>
@@ -8,4 +11,7 @@ DECLARE_TRACE(napi_poll,
8 TP_PROTO(struct napi_struct *napi), 11 TP_PROTO(struct napi_struct *napi),
9 TP_ARGS(napi)); 12 TP_ARGS(napi));
10 13
11#endif 14#endif /* _TRACE_NAPI_H_ */
15
16/* This part must be outside protection */
17#include <trace/define_trace.h>
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
index cfceb0b73e20..4f733ecea46e 100644
--- a/include/trace/events/sched.h
+++ b/include/trace/events/sched.h
@@ -51,15 +51,12 @@ TRACE_EVENT(sched_kthread_stop_ret,
51 51
52/* 52/*
53 * Tracepoint for waiting on task to unschedule: 53 * Tracepoint for waiting on task to unschedule:
54 *
55 * (NOTE: the 'rq' argument is not used by generic trace events,
56 * but used by the latency tracer plugin. )
57 */ 54 */
58TRACE_EVENT(sched_wait_task, 55TRACE_EVENT(sched_wait_task,
59 56
60 TP_PROTO(struct rq *rq, struct task_struct *p), 57 TP_PROTO(struct task_struct *p),
61 58
62 TP_ARGS(rq, p), 59 TP_ARGS(p),
63 60
64 TP_STRUCT__entry( 61 TP_STRUCT__entry(
65 __array( char, comm, TASK_COMM_LEN ) 62 __array( char, comm, TASK_COMM_LEN )
@@ -79,15 +76,12 @@ TRACE_EVENT(sched_wait_task,
79 76
80/* 77/*
81 * Tracepoint for waking up a task: 78 * Tracepoint for waking up a task:
82 *
83 * (NOTE: the 'rq' argument is not used by generic trace events,
84 * but used by the latency tracer plugin. )
85 */ 79 */
86DECLARE_EVENT_CLASS(sched_wakeup_template, 80DECLARE_EVENT_CLASS(sched_wakeup_template,
87 81
88 TP_PROTO(struct rq *rq, struct task_struct *p, int success), 82 TP_PROTO(struct task_struct *p, int success),
89 83
90 TP_ARGS(rq, p, success), 84 TP_ARGS(p, success),
91 85
92 TP_STRUCT__entry( 86 TP_STRUCT__entry(
93 __array( char, comm, TASK_COMM_LEN ) 87 __array( char, comm, TASK_COMM_LEN )
@@ -111,31 +105,25 @@ DECLARE_EVENT_CLASS(sched_wakeup_template,
111); 105);
112 106
113DEFINE_EVENT(sched_wakeup_template, sched_wakeup, 107DEFINE_EVENT(sched_wakeup_template, sched_wakeup,
114 TP_PROTO(struct rq *rq, struct task_struct *p, int success), 108 TP_PROTO(struct task_struct *p, int success),
115 TP_ARGS(rq, p, success)); 109 TP_ARGS(p, success));
116 110
117/* 111/*
118 * Tracepoint for waking up a new task: 112 * Tracepoint for waking up a new task:
119 *
120 * (NOTE: the 'rq' argument is not used by generic trace events,
121 * but used by the latency tracer plugin. )
122 */ 113 */
123DEFINE_EVENT(sched_wakeup_template, sched_wakeup_new, 114DEFINE_EVENT(sched_wakeup_template, sched_wakeup_new,
124 TP_PROTO(struct rq *rq, struct task_struct *p, int success), 115 TP_PROTO(struct task_struct *p, int success),
125 TP_ARGS(rq, p, success)); 116 TP_ARGS(p, success));
126 117
127/* 118/*
128 * Tracepoint for task switches, performed by the scheduler: 119 * Tracepoint for task switches, performed by the scheduler:
129 *
130 * (NOTE: the 'rq' argument is not used by generic trace events,
131 * but used by the latency tracer plugin. )
132 */ 120 */
133TRACE_EVENT(sched_switch, 121TRACE_EVENT(sched_switch,
134 122
135 TP_PROTO(struct rq *rq, struct task_struct *prev, 123 TP_PROTO(struct task_struct *prev,
136 struct task_struct *next), 124 struct task_struct *next),
137 125
138 TP_ARGS(rq, prev, next), 126 TP_ARGS(prev, next),
139 127
140 TP_STRUCT__entry( 128 TP_STRUCT__entry(
141 __array( char, prev_comm, TASK_COMM_LEN ) 129 __array( char, prev_comm, TASK_COMM_LEN )
diff --git a/include/trace/events/signal.h b/include/trace/events/signal.h
index a510b75ac304..814566c99d29 100644
--- a/include/trace/events/signal.h
+++ b/include/trace/events/signal.h
@@ -100,18 +100,7 @@ TRACE_EVENT(signal_deliver,
100 __entry->sa_handler, __entry->sa_flags) 100 __entry->sa_handler, __entry->sa_flags)
101); 101);
102 102
103/** 103DECLARE_EVENT_CLASS(signal_queue_overflow,
104 * signal_overflow_fail - called when signal queue is overflow
105 * @sig: signal number
106 * @group: signal to process group or not (bool)
107 * @info: pointer to struct siginfo
108 *
109 * Kernel fails to generate 'sig' signal with 'info' siginfo, because
110 * siginfo queue is overflow, and the signal is dropped.
111 * 'group' is not 0 if the signal will be sent to a process group.
112 * 'sig' is always one of RT signals.
113 */
114TRACE_EVENT(signal_overflow_fail,
115 104
116 TP_PROTO(int sig, int group, struct siginfo *info), 105 TP_PROTO(int sig, int group, struct siginfo *info),
117 106
@@ -135,6 +124,24 @@ TRACE_EVENT(signal_overflow_fail,
135); 124);
136 125
137/** 126/**
127 * signal_overflow_fail - called when signal queue is overflow
128 * @sig: signal number
129 * @group: signal to process group or not (bool)
130 * @info: pointer to struct siginfo
131 *
132 * Kernel fails to generate 'sig' signal with 'info' siginfo, because
133 * siginfo queue is overflow, and the signal is dropped.
134 * 'group' is not 0 if the signal will be sent to a process group.
135 * 'sig' is always one of RT signals.
136 */
137DEFINE_EVENT(signal_queue_overflow, signal_overflow_fail,
138
139 TP_PROTO(int sig, int group, struct siginfo *info),
140
141 TP_ARGS(sig, group, info)
142);
143
144/**
138 * signal_lose_info - called when siginfo is lost 145 * signal_lose_info - called when siginfo is lost
139 * @sig: signal number 146 * @sig: signal number
140 * @group: signal to process group or not (bool) 147 * @group: signal to process group or not (bool)
@@ -145,28 +152,13 @@ TRACE_EVENT(signal_overflow_fail,
145 * 'group' is not 0 if the signal will be sent to a process group. 152 * 'group' is not 0 if the signal will be sent to a process group.
146 * 'sig' is always one of non-RT signals. 153 * 'sig' is always one of non-RT signals.
147 */ 154 */
148TRACE_EVENT(signal_lose_info, 155DEFINE_EVENT(signal_queue_overflow, signal_lose_info,
149 156
150 TP_PROTO(int sig, int group, struct siginfo *info), 157 TP_PROTO(int sig, int group, struct siginfo *info),
151 158
152 TP_ARGS(sig, group, info), 159 TP_ARGS(sig, group, info)
153
154 TP_STRUCT__entry(
155 __field( int, sig )
156 __field( int, group )
157 __field( int, errno )
158 __field( int, code )
159 ),
160
161 TP_fast_assign(
162 __entry->sig = sig;
163 __entry->group = group;
164 TP_STORE_SIGINFO(__entry, info);
165 ),
166
167 TP_printk("sig=%d group=%d errno=%d code=%d",
168 __entry->sig, __entry->group, __entry->errno, __entry->code)
169); 160);
161
170#endif /* _TRACE_SIGNAL_H */ 162#endif /* _TRACE_SIGNAL_H */
171 163
172/* This part must be outside protection */ 164/* This part must be outside protection */
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index ea6f9d4a20e9..16253db38d73 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -154,9 +154,11 @@
154 * 154 *
155 * field = (typeof(field))entry; 155 * field = (typeof(field))entry;
156 * 156 *
157 * p = get_cpu_var(ftrace_event_seq); 157 * p = &get_cpu_var(ftrace_event_seq);
158 * trace_seq_init(p); 158 * trace_seq_init(p);
159 * ret = trace_seq_printf(s, <TP_printk> "\n"); 159 * ret = trace_seq_printf(s, "%s: ", <call>);
160 * if (ret)
161 * ret = trace_seq_printf(s, <TP_printk> "\n");
160 * put_cpu(); 162 * put_cpu();
161 * if (!ret) 163 * if (!ret)
162 * return TRACE_TYPE_PARTIAL_LINE; 164 * return TRACE_TYPE_PARTIAL_LINE;
@@ -450,38 +452,38 @@ perf_trace_disable_##name(struct ftrace_event_call *unused) \
450 * 452 *
451 * static void ftrace_raw_event_<call>(proto) 453 * static void ftrace_raw_event_<call>(proto)
452 * { 454 * {
455 * struct ftrace_data_offsets_<call> __maybe_unused __data_offsets;
453 * struct ring_buffer_event *event; 456 * struct ring_buffer_event *event;
454 * struct ftrace_raw_<call> *entry; <-- defined in stage 1 457 * struct ftrace_raw_<call> *entry; <-- defined in stage 1
455 * struct ring_buffer *buffer; 458 * struct ring_buffer *buffer;
456 * unsigned long irq_flags; 459 * unsigned long irq_flags;
460 * int __data_size;
457 * int pc; 461 * int pc;
458 * 462 *
459 * local_save_flags(irq_flags); 463 * local_save_flags(irq_flags);
460 * pc = preempt_count(); 464 * pc = preempt_count();
461 * 465 *
466 * __data_size = ftrace_get_offsets_<call>(&__data_offsets, args);
467 *
462 * event = trace_current_buffer_lock_reserve(&buffer, 468 * event = trace_current_buffer_lock_reserve(&buffer,
463 * event_<call>.id, 469 * event_<call>.id,
464 * sizeof(struct ftrace_raw_<call>), 470 * sizeof(*entry) + __data_size,
465 * irq_flags, pc); 471 * irq_flags, pc);
466 * if (!event) 472 * if (!event)
467 * return; 473 * return;
468 * entry = ring_buffer_event_data(event); 474 * entry = ring_buffer_event_data(event);
469 * 475 *
470 * <assign>; <-- Here we assign the entries by the __field and 476 * { <assign>; } <-- Here we assign the entries by the __field and
471 * __array macros. 477 * __array macros.
472 * 478 *
473 * trace_current_buffer_unlock_commit(buffer, event, irq_flags, pc); 479 * if (!filter_current_check_discard(buffer, event_call, entry, event))
480 * trace_current_buffer_unlock_commit(buffer,
481 * event, irq_flags, pc);
474 * } 482 * }
475 * 483 *
476 * static int ftrace_raw_reg_event_<call>(struct ftrace_event_call *unused) 484 * static int ftrace_raw_reg_event_<call>(struct ftrace_event_call *unused)
477 * { 485 * {
478 * int ret; 486 * return register_trace_<call>(ftrace_raw_event_<call>);
479 *
480 * ret = register_trace_<call>(ftrace_raw_event_<call>);
481 * if (!ret)
482 * pr_info("event trace: Could not activate trace point "
483 * "probe to <call>");
484 * return ret;
485 * } 487 * }
486 * 488 *
487 * static void ftrace_unreg_event_<call>(struct ftrace_event_call *unused) 489 * static void ftrace_unreg_event_<call>(struct ftrace_event_call *unused)
@@ -493,6 +495,8 @@ perf_trace_disable_##name(struct ftrace_event_call *unused) \
493 * .trace = ftrace_raw_output_<call>, <-- stage 2 495 * .trace = ftrace_raw_output_<call>, <-- stage 2
494 * }; 496 * };
495 * 497 *
498 * static const char print_fmt_<call>[] = <TP_printk>;
499 *
496 * static struct ftrace_event_call __used 500 * static struct ftrace_event_call __used
497 * __attribute__((__aligned__(4))) 501 * __attribute__((__aligned__(4)))
498 * __attribute__((section("_ftrace_events"))) event_<call> = { 502 * __attribute__((section("_ftrace_events"))) event_<call> = {
@@ -501,6 +505,8 @@ perf_trace_disable_##name(struct ftrace_event_call *unused) \
501 * .raw_init = trace_event_raw_init, 505 * .raw_init = trace_event_raw_init,
502 * .regfunc = ftrace_reg_event_<call>, 506 * .regfunc = ftrace_reg_event_<call>,
503 * .unregfunc = ftrace_unreg_event_<call>, 507 * .unregfunc = ftrace_unreg_event_<call>,
508 * .print_fmt = print_fmt_<call>,
509 * .define_fields = ftrace_define_fields_<call>,
504 * } 510 * }
505 * 511 *
506 */ 512 */
@@ -569,7 +575,6 @@ ftrace_raw_event_id_##call(struct ftrace_event_call *event_call, \
569 return; \ 575 return; \
570 entry = ring_buffer_event_data(event); \ 576 entry = ring_buffer_event_data(event); \
571 \ 577 \
572 \
573 tstruct \ 578 tstruct \
574 \ 579 \
575 { assign; } \ 580 { assign; } \
@@ -758,13 +763,12 @@ __attribute__((section("_ftrace_events"))) event_##call = { \
758#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ 763#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \
759static notrace void \ 764static notrace void \
760perf_trace_templ_##call(struct ftrace_event_call *event_call, \ 765perf_trace_templ_##call(struct ftrace_event_call *event_call, \
761 proto) \ 766 struct pt_regs *__regs, proto) \
762{ \ 767{ \
763 struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ 768 struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\
764 struct ftrace_raw_##call *entry; \ 769 struct ftrace_raw_##call *entry; \
765 u64 __addr = 0, __count = 1; \ 770 u64 __addr = 0, __count = 1; \
766 unsigned long irq_flags; \ 771 unsigned long irq_flags; \
767 struct pt_regs *__regs; \
768 int __entry_size; \ 772 int __entry_size; \
769 int __data_size; \ 773 int __data_size; \
770 int rctx; \ 774 int rctx; \
@@ -785,20 +789,22 @@ perf_trace_templ_##call(struct ftrace_event_call *event_call, \
785 \ 789 \
786 { assign; } \ 790 { assign; } \
787 \ 791 \
788 __regs = &__get_cpu_var(perf_trace_regs); \
789 perf_fetch_caller_regs(__regs, 2); \
790 \
791 perf_trace_buf_submit(entry, __entry_size, rctx, __addr, \ 792 perf_trace_buf_submit(entry, __entry_size, rctx, __addr, \
792 __count, irq_flags, __regs); \ 793 __count, irq_flags, __regs); \
793} 794}
794 795
795#undef DEFINE_EVENT 796#undef DEFINE_EVENT
796#define DEFINE_EVENT(template, call, proto, args) \ 797#define DEFINE_EVENT(template, call, proto, args) \
797static notrace void perf_trace_##call(proto) \ 798static notrace void perf_trace_##call(proto) \
798{ \ 799{ \
799 struct ftrace_event_call *event_call = &event_##call; \ 800 struct ftrace_event_call *event_call = &event_##call; \
800 \ 801 struct pt_regs *__regs = &get_cpu_var(perf_trace_regs); \
801 perf_trace_templ_##template(event_call, args); \ 802 \
803 perf_fetch_caller_regs(__regs, 1); \
804 \
805 perf_trace_templ_##template(event_call, __regs, args); \
806 \
807 put_cpu_var(perf_trace_regs); \
802} 808}
803 809
804#undef DEFINE_EVENT_PRINT 810#undef DEFINE_EVENT_PRINT