diff options
Diffstat (limited to 'include')
265 files changed, 5011 insertions, 1575 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index c34b11022908..c65e4ce6c3af 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
@@ -114,10 +114,13 @@ struct acpi_device_ops { | |||
114 | acpi_op_notify notify; | 114 | acpi_op_notify notify; |
115 | }; | 115 | }; |
116 | 116 | ||
117 | #define ACPI_DRIVER_ALL_NOTIFY_EVENTS 0x1 /* system AND device events */ | ||
118 | |||
117 | struct acpi_driver { | 119 | struct acpi_driver { |
118 | char name[80]; | 120 | char name[80]; |
119 | char class[80]; | 121 | char class[80]; |
120 | const struct acpi_device_id *ids; /* Supported Hardware IDs */ | 122 | const struct acpi_device_id *ids; /* Supported Hardware IDs */ |
123 | unsigned int flags; | ||
121 | struct acpi_device_ops ops; | 124 | struct acpi_device_ops ops; |
122 | struct device_driver drv; | 125 | struct device_driver drv; |
123 | struct module *owner; | 126 | struct module *owner; |
@@ -168,7 +171,7 @@ struct acpi_device_dir { | |||
168 | 171 | ||
169 | /* Plug and Play */ | 172 | /* Plug and Play */ |
170 | 173 | ||
171 | typedef char acpi_bus_id[5]; | 174 | typedef char acpi_bus_id[8]; |
172 | typedef unsigned long acpi_bus_address; | 175 | typedef unsigned long acpi_bus_address; |
173 | typedef char acpi_hardware_id[15]; | 176 | typedef char acpi_hardware_id[15]; |
174 | typedef char acpi_unique_id[9]; | 177 | typedef char acpi_unique_id[9]; |
@@ -365,10 +368,10 @@ struct acpi_bus_type { | |||
365 | int register_acpi_bus_type(struct acpi_bus_type *); | 368 | int register_acpi_bus_type(struct acpi_bus_type *); |
366 | int unregister_acpi_bus_type(struct acpi_bus_type *); | 369 | int unregister_acpi_bus_type(struct acpi_bus_type *); |
367 | struct device *acpi_get_physical_device(acpi_handle); | 370 | struct device *acpi_get_physical_device(acpi_handle); |
368 | struct device *acpi_get_physical_pci_device(acpi_handle); | ||
369 | 371 | ||
370 | /* helper */ | 372 | /* helper */ |
371 | acpi_handle acpi_get_child(acpi_handle, acpi_integer); | 373 | acpi_handle acpi_get_child(acpi_handle, acpi_integer); |
374 | int acpi_is_root_bridge(acpi_handle); | ||
372 | acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int); | 375 | acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int); |
373 | #define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->archdata.acpi_handle)) | 376 | #define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->archdata.acpi_handle)) |
374 | 377 | ||
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h index 0352c8f0b05b..f4906f6568d4 100644 --- a/include/acpi/acpi_drivers.h +++ b/include/acpi/acpi_drivers.h | |||
@@ -57,8 +57,7 @@ | |||
57 | */ | 57 | */ |
58 | 58 | ||
59 | #define ACPI_POWER_HID "LNXPOWER" | 59 | #define ACPI_POWER_HID "LNXPOWER" |
60 | #define ACPI_PROCESSOR_OBJECT_HID "ACPI_CPU" | 60 | #define ACPI_PROCESSOR_OBJECT_HID "LNXCPU" |
61 | #define ACPI_PROCESSOR_HID "ACPI0007" | ||
62 | #define ACPI_SYSTEM_HID "LNXSYSTM" | 61 | #define ACPI_SYSTEM_HID "LNXSYSTM" |
63 | #define ACPI_THERMAL_HID "LNXTHERM" | 62 | #define ACPI_THERMAL_HID "LNXTHERM" |
64 | #define ACPI_BUTTON_HID_POWERF "LNXPWRBN" | 63 | #define ACPI_BUTTON_HID_POWERF "LNXPWRBN" |
@@ -91,17 +90,15 @@ int acpi_pci_link_free_irq(acpi_handle handle); | |||
91 | 90 | ||
92 | /* ACPI PCI Interrupt Routing (pci_irq.c) */ | 91 | /* ACPI PCI Interrupt Routing (pci_irq.c) */ |
93 | 92 | ||
94 | int acpi_pci_irq_add_prt(acpi_handle handle, int segment, int bus); | 93 | int acpi_pci_irq_add_prt(acpi_handle handle, struct pci_bus *bus); |
95 | void acpi_pci_irq_del_prt(int segment, int bus); | 94 | void acpi_pci_irq_del_prt(struct pci_bus *bus); |
96 | 95 | ||
97 | /* ACPI PCI Device Binding (pci_bind.c) */ | 96 | /* ACPI PCI Device Binding (pci_bind.c) */ |
98 | 97 | ||
99 | struct pci_bus; | 98 | struct pci_bus; |
100 | 99 | ||
101 | acpi_status acpi_get_pci_id(acpi_handle handle, struct acpi_pci_id *id); | 100 | struct pci_dev *acpi_get_pci_dev(acpi_handle); |
102 | int acpi_pci_bind(struct acpi_device *device); | 101 | int acpi_pci_bind_root(struct acpi_device *device); |
103 | int acpi_pci_bind_root(struct acpi_device *device, struct acpi_pci_id *id, | ||
104 | struct pci_bus *bus); | ||
105 | 102 | ||
106 | /* Arch-defined function to add a bus to the system */ | 103 | /* Arch-defined function to add a bus to the system */ |
107 | 104 | ||
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index 3e798593b17b..ab0b85cf21f3 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h | |||
@@ -242,6 +242,10 @@ acpi_os_derive_pci_id(acpi_handle rhandle, | |||
242 | acpi_status acpi_os_validate_interface(char *interface); | 242 | acpi_status acpi_os_validate_interface(char *interface); |
243 | acpi_status acpi_osi_invalidate(char* interface); | 243 | acpi_status acpi_osi_invalidate(char* interface); |
244 | 244 | ||
245 | acpi_status | ||
246 | acpi_os_validate_address(u8 space_id, acpi_physical_address address, | ||
247 | acpi_size length, char *name); | ||
248 | |||
245 | u64 acpi_os_get_timer(void); | 249 | u64 acpi_os_get_timer(void); |
246 | 250 | ||
247 | acpi_status acpi_os_signal(u32 function, void *info); | 251 | acpi_status acpi_os_signal(u32 function, void *info); |
diff --git a/include/acpi/processor.h b/include/acpi/processor.h index 4927c063347c..740ac3ad8fd0 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h | |||
@@ -174,7 +174,7 @@ struct acpi_processor_throttling { | |||
174 | cpumask_var_t shared_cpu_map; | 174 | cpumask_var_t shared_cpu_map; |
175 | int (*acpi_processor_get_throttling) (struct acpi_processor * pr); | 175 | int (*acpi_processor_get_throttling) (struct acpi_processor * pr); |
176 | int (*acpi_processor_set_throttling) (struct acpi_processor * pr, | 176 | int (*acpi_processor_set_throttling) (struct acpi_processor * pr, |
177 | int state); | 177 | int state, bool force); |
178 | 178 | ||
179 | u32 address; | 179 | u32 address; |
180 | u8 duty_offset; | 180 | u8 duty_offset; |
@@ -258,6 +258,7 @@ DECLARE_PER_CPU(struct acpi_processor *, processors); | |||
258 | extern struct acpi_processor_errata errata; | 258 | extern struct acpi_processor_errata errata; |
259 | 259 | ||
260 | void arch_acpi_processor_init_pdc(struct acpi_processor *pr); | 260 | void arch_acpi_processor_init_pdc(struct acpi_processor *pr); |
261 | void arch_acpi_processor_cleanup_pdc(struct acpi_processor *pr); | ||
261 | 262 | ||
262 | #ifdef ARCH_HAS_POWER_INIT | 263 | #ifdef ARCH_HAS_POWER_INIT |
263 | void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags, | 264 | void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags, |
@@ -320,7 +321,8 @@ static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr) | |||
320 | /* in processor_throttling.c */ | 321 | /* in processor_throttling.c */ |
321 | int acpi_processor_tstate_has_changed(struct acpi_processor *pr); | 322 | int acpi_processor_tstate_has_changed(struct acpi_processor *pr); |
322 | int acpi_processor_get_throttling_info(struct acpi_processor *pr); | 323 | int acpi_processor_get_throttling_info(struct acpi_processor *pr); |
323 | extern int acpi_processor_set_throttling(struct acpi_processor *pr, int state); | 324 | extern int acpi_processor_set_throttling(struct acpi_processor *pr, |
325 | int state, bool force); | ||
324 | extern const struct file_operations acpi_processor_throttling_fops; | 326 | extern const struct file_operations acpi_processor_throttling_fops; |
325 | extern void acpi_processor_throttling_init(void); | 327 | extern void acpi_processor_throttling_init(void); |
326 | /* in processor_idle.c */ | 328 | /* in processor_idle.c */ |
diff --git a/include/acpi/video.h b/include/acpi/video.h index af6fe95fd3d0..cf7be3dd157b 100644 --- a/include/acpi/video.h +++ b/include/acpi/video.h | |||
@@ -3,10 +3,10 @@ | |||
3 | 3 | ||
4 | #if (defined CONFIG_ACPI_VIDEO || defined CONFIG_ACPI_VIDEO_MODULE) | 4 | #if (defined CONFIG_ACPI_VIDEO || defined CONFIG_ACPI_VIDEO_MODULE) |
5 | extern int acpi_video_register(void); | 5 | extern int acpi_video_register(void); |
6 | extern int acpi_video_exit(void); | 6 | extern void acpi_video_unregister(void); |
7 | #else | 7 | #else |
8 | static inline int acpi_video_register(void) { return 0; } | 8 | static inline int acpi_video_register(void) { return 0; } |
9 | static inline void acpi_video_exit(void) { return; } | 9 | static inline void acpi_video_unregister(void) { return; } |
10 | #endif | 10 | #endif |
11 | 11 | ||
12 | #endif | 12 | #endif |
diff --git a/include/asm-generic/4level-fixup.h b/include/asm-generic/4level-fixup.h index 9d40e879f99e..77ff547730af 100644 --- a/include/asm-generic/4level-fixup.h +++ b/include/asm-generic/4level-fixup.h | |||
@@ -27,9 +27,9 @@ | |||
27 | #define pud_page_vaddr(pud) pgd_page_vaddr(pud) | 27 | #define pud_page_vaddr(pud) pgd_page_vaddr(pud) |
28 | 28 | ||
29 | #undef pud_free_tlb | 29 | #undef pud_free_tlb |
30 | #define pud_free_tlb(tlb, x) do { } while (0) | 30 | #define pud_free_tlb(tlb, x, addr) do { } while (0) |
31 | #define pud_free(mm, x) do { } while (0) | 31 | #define pud_free(mm, x) do { } while (0) |
32 | #define __pud_free_tlb(tlb, x) do { } while (0) | 32 | #define __pud_free_tlb(tlb, x, addr) do { } while (0) |
33 | 33 | ||
34 | #undef pud_addr_end | 34 | #undef pud_addr_end |
35 | #define pud_addr_end(addr, end) (end) | 35 | #define pud_addr_end(addr, end) (end) |
diff --git a/include/asm-generic/dma-mapping-common.h b/include/asm-generic/dma-mapping-common.h new file mode 100644 index 000000000000..5406a601185c --- /dev/null +++ b/include/asm-generic/dma-mapping-common.h | |||
@@ -0,0 +1,190 @@ | |||
1 | #ifndef _ASM_GENERIC_DMA_MAPPING_H | ||
2 | #define _ASM_GENERIC_DMA_MAPPING_H | ||
3 | |||
4 | #include <linux/kmemcheck.h> | ||
5 | #include <linux/scatterlist.h> | ||
6 | #include <linux/dma-debug.h> | ||
7 | #include <linux/dma-attrs.h> | ||
8 | |||
9 | static inline dma_addr_t dma_map_single_attrs(struct device *dev, void *ptr, | ||
10 | size_t size, | ||
11 | enum dma_data_direction dir, | ||
12 | struct dma_attrs *attrs) | ||
13 | { | ||
14 | struct dma_map_ops *ops = get_dma_ops(dev); | ||
15 | dma_addr_t addr; | ||
16 | |||
17 | kmemcheck_mark_initialized(ptr, size); | ||
18 | BUG_ON(!valid_dma_direction(dir)); | ||
19 | addr = ops->map_page(dev, virt_to_page(ptr), | ||
20 | (unsigned long)ptr & ~PAGE_MASK, size, | ||
21 | dir, attrs); | ||
22 | debug_dma_map_page(dev, virt_to_page(ptr), | ||
23 | (unsigned long)ptr & ~PAGE_MASK, size, | ||
24 | dir, addr, true); | ||
25 | return addr; | ||
26 | } | ||
27 | |||
28 | static inline void dma_unmap_single_attrs(struct device *dev, dma_addr_t addr, | ||
29 | size_t size, | ||
30 | enum dma_data_direction dir, | ||
31 | struct dma_attrs *attrs) | ||
32 | { | ||
33 | struct dma_map_ops *ops = get_dma_ops(dev); | ||
34 | |||
35 | BUG_ON(!valid_dma_direction(dir)); | ||
36 | if (ops->unmap_page) | ||
37 | ops->unmap_page(dev, addr, size, dir, attrs); | ||
38 | debug_dma_unmap_page(dev, addr, size, dir, true); | ||
39 | } | ||
40 | |||
41 | static inline int dma_map_sg_attrs(struct device *dev, struct scatterlist *sg, | ||
42 | int nents, enum dma_data_direction dir, | ||
43 | struct dma_attrs *attrs) | ||
44 | { | ||
45 | struct dma_map_ops *ops = get_dma_ops(dev); | ||
46 | int i, ents; | ||
47 | struct scatterlist *s; | ||
48 | |||
49 | for_each_sg(sg, s, nents, i) | ||
50 | kmemcheck_mark_initialized(sg_virt(s), s->length); | ||
51 | BUG_ON(!valid_dma_direction(dir)); | ||
52 | ents = ops->map_sg(dev, sg, nents, dir, attrs); | ||
53 | debug_dma_map_sg(dev, sg, nents, ents, dir); | ||
54 | |||
55 | return ents; | ||
56 | } | ||
57 | |||
58 | static inline void dma_unmap_sg_attrs(struct device *dev, struct scatterlist *sg, | ||
59 | int nents, enum dma_data_direction dir, | ||
60 | struct dma_attrs *attrs) | ||
61 | { | ||
62 | struct dma_map_ops *ops = get_dma_ops(dev); | ||
63 | |||
64 | BUG_ON(!valid_dma_direction(dir)); | ||
65 | debug_dma_unmap_sg(dev, sg, nents, dir); | ||
66 | if (ops->unmap_sg) | ||
67 | ops->unmap_sg(dev, sg, nents, dir, attrs); | ||
68 | } | ||
69 | |||
70 | static inline dma_addr_t dma_map_page(struct device *dev, struct page *page, | ||
71 | size_t offset, size_t size, | ||
72 | enum dma_data_direction dir) | ||
73 | { | ||
74 | struct dma_map_ops *ops = get_dma_ops(dev); | ||
75 | dma_addr_t addr; | ||
76 | |||
77 | kmemcheck_mark_initialized(page_address(page) + offset, size); | ||
78 | BUG_ON(!valid_dma_direction(dir)); | ||
79 | addr = ops->map_page(dev, page, offset, size, dir, NULL); | ||
80 | debug_dma_map_page(dev, page, offset, size, dir, addr, false); | ||
81 | |||
82 | return addr; | ||
83 | } | ||
84 | |||
85 | static inline void dma_unmap_page(struct device *dev, dma_addr_t addr, | ||
86 | size_t size, enum dma_data_direction dir) | ||
87 | { | ||
88 | struct dma_map_ops *ops = get_dma_ops(dev); | ||
89 | |||
90 | BUG_ON(!valid_dma_direction(dir)); | ||
91 | if (ops->unmap_page) | ||
92 | ops->unmap_page(dev, addr, size, dir, NULL); | ||
93 | debug_dma_unmap_page(dev, addr, size, dir, false); | ||
94 | } | ||
95 | |||
96 | static inline void dma_sync_single_for_cpu(struct device *dev, dma_addr_t addr, | ||
97 | size_t size, | ||
98 | enum dma_data_direction dir) | ||
99 | { | ||
100 | struct dma_map_ops *ops = get_dma_ops(dev); | ||
101 | |||
102 | BUG_ON(!valid_dma_direction(dir)); | ||
103 | if (ops->sync_single_for_cpu) | ||
104 | ops->sync_single_for_cpu(dev, addr, size, dir); | ||
105 | debug_dma_sync_single_for_cpu(dev, addr, size, dir); | ||
106 | flush_write_buffers(); | ||
107 | } | ||
108 | |||
109 | static inline void dma_sync_single_for_device(struct device *dev, | ||
110 | dma_addr_t addr, size_t size, | ||
111 | enum dma_data_direction dir) | ||
112 | { | ||
113 | struct dma_map_ops *ops = get_dma_ops(dev); | ||
114 | |||
115 | BUG_ON(!valid_dma_direction(dir)); | ||
116 | if (ops->sync_single_for_device) | ||
117 | ops->sync_single_for_device(dev, addr, size, dir); | ||
118 | debug_dma_sync_single_for_device(dev, addr, size, dir); | ||
119 | flush_write_buffers(); | ||
120 | } | ||
121 | |||
122 | static inline void dma_sync_single_range_for_cpu(struct device *dev, | ||
123 | dma_addr_t addr, | ||
124 | unsigned long offset, | ||
125 | size_t size, | ||
126 | enum dma_data_direction dir) | ||
127 | { | ||
128 | struct dma_map_ops *ops = get_dma_ops(dev); | ||
129 | |||
130 | BUG_ON(!valid_dma_direction(dir)); | ||
131 | if (ops->sync_single_range_for_cpu) { | ||
132 | ops->sync_single_range_for_cpu(dev, addr, offset, size, dir); | ||
133 | debug_dma_sync_single_range_for_cpu(dev, addr, offset, size, dir); | ||
134 | |||
135 | flush_write_buffers(); | ||
136 | } else | ||
137 | dma_sync_single_for_cpu(dev, addr, size, dir); | ||
138 | } | ||
139 | |||
140 | static inline void dma_sync_single_range_for_device(struct device *dev, | ||
141 | dma_addr_t addr, | ||
142 | unsigned long offset, | ||
143 | size_t size, | ||
144 | enum dma_data_direction dir) | ||
145 | { | ||
146 | struct dma_map_ops *ops = get_dma_ops(dev); | ||
147 | |||
148 | BUG_ON(!valid_dma_direction(dir)); | ||
149 | if (ops->sync_single_range_for_device) { | ||
150 | ops->sync_single_range_for_device(dev, addr, offset, size, dir); | ||
151 | debug_dma_sync_single_range_for_device(dev, addr, offset, size, dir); | ||
152 | |||
153 | flush_write_buffers(); | ||
154 | } else | ||
155 | dma_sync_single_for_device(dev, addr, size, dir); | ||
156 | } | ||
157 | |||
158 | static inline void | ||
159 | dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, | ||
160 | int nelems, enum dma_data_direction dir) | ||
161 | { | ||
162 | struct dma_map_ops *ops = get_dma_ops(dev); | ||
163 | |||
164 | BUG_ON(!valid_dma_direction(dir)); | ||
165 | if (ops->sync_sg_for_cpu) | ||
166 | ops->sync_sg_for_cpu(dev, sg, nelems, dir); | ||
167 | debug_dma_sync_sg_for_cpu(dev, sg, nelems, dir); | ||
168 | flush_write_buffers(); | ||
169 | } | ||
170 | |||
171 | static inline void | ||
172 | dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, | ||
173 | int nelems, enum dma_data_direction dir) | ||
174 | { | ||
175 | struct dma_map_ops *ops = get_dma_ops(dev); | ||
176 | |||
177 | BUG_ON(!valid_dma_direction(dir)); | ||
178 | if (ops->sync_sg_for_device) | ||
179 | ops->sync_sg_for_device(dev, sg, nelems, dir); | ||
180 | debug_dma_sync_sg_for_device(dev, sg, nelems, dir); | ||
181 | |||
182 | flush_write_buffers(); | ||
183 | } | ||
184 | |||
185 | #define dma_map_single(d, a, s, r) dma_map_single_attrs(d, a, s, r, NULL) | ||
186 | #define dma_unmap_single(d, a, s, r) dma_unmap_single_attrs(d, a, s, r, NULL) | ||
187 | #define dma_map_sg(d, s, n, r) dma_map_sg_attrs(d, s, n, r, NULL) | ||
188 | #define dma_unmap_sg(d, s, n, r) dma_unmap_sg_attrs(d, s, n, r, NULL) | ||
189 | |||
190 | #endif | ||
diff --git a/include/asm-generic/hardirq.h b/include/asm-generic/hardirq.h index 3d5d2c906ab3..23bb4dad4962 100644 --- a/include/asm-generic/hardirq.h +++ b/include/asm-generic/hardirq.h | |||
@@ -11,19 +11,6 @@ typedef struct { | |||
11 | 11 | ||
12 | #include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */ | 12 | #include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */ |
13 | 13 | ||
14 | #ifndef HARDIRQ_BITS | ||
15 | #define HARDIRQ_BITS 8 | ||
16 | #endif | ||
17 | |||
18 | /* | ||
19 | * The hardirq mask has to be large enough to have | ||
20 | * space for potentially all IRQ sources in the system | ||
21 | * nesting on a single CPU: | ||
22 | */ | ||
23 | #if (1 << HARDIRQ_BITS) < NR_IRQS | ||
24 | # error HARDIRQ_BITS is too low! | ||
25 | #endif | ||
26 | |||
27 | #ifndef ack_bad_irq | 14 | #ifndef ack_bad_irq |
28 | static inline void ack_bad_irq(unsigned int irq) | 15 | static inline void ack_bad_irq(unsigned int irq) |
29 | { | 16 | { |
diff --git a/include/asm-generic/kmap_types.h b/include/asm-generic/kmap_types.h index 54e8b3d956b7..eddbce0f9fb9 100644 --- a/include/asm-generic/kmap_types.h +++ b/include/asm-generic/kmap_types.h | |||
@@ -24,7 +24,10 @@ D(12) KM_SOFTIRQ1, | |||
24 | D(13) KM_SYNC_ICACHE, | 24 | D(13) KM_SYNC_ICACHE, |
25 | D(14) KM_SYNC_DCACHE, | 25 | D(14) KM_SYNC_DCACHE, |
26 | D(15) KM_UML_USERCOPY, /* UML specific, for copy_*_user - used in do_op_one_page */ | 26 | D(15) KM_UML_USERCOPY, /* UML specific, for copy_*_user - used in do_op_one_page */ |
27 | D(16) KM_TYPE_NR | 27 | D(16) KM_IRQ_PTE, |
28 | D(17) KM_NMI, | ||
29 | D(18) KM_NMI_PTE, | ||
30 | D(19) KM_TYPE_NR | ||
28 | }; | 31 | }; |
29 | 32 | ||
30 | #undef D | 33 | #undef D |
diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h index d7d50d7ee51e..aa00800adacc 100644 --- a/include/asm-generic/percpu.h +++ b/include/asm-generic/percpu.h | |||
@@ -97,4 +97,8 @@ extern void setup_per_cpu_areas(void); | |||
97 | #define PER_CPU_ATTRIBUTES | 97 | #define PER_CPU_ATTRIBUTES |
98 | #endif | 98 | #endif |
99 | 99 | ||
100 | #ifndef PER_CPU_DEF_ATTRIBUTES | ||
101 | #define PER_CPU_DEF_ATTRIBUTES | ||
102 | #endif | ||
103 | |||
100 | #endif /* _ASM_GENERIC_PERCPU_H_ */ | 104 | #endif /* _ASM_GENERIC_PERCPU_H_ */ |
diff --git a/include/asm-generic/pgtable-nopmd.h b/include/asm-generic/pgtable-nopmd.h index a7cdc48e8b78..725612b793ce 100644 --- a/include/asm-generic/pgtable-nopmd.h +++ b/include/asm-generic/pgtable-nopmd.h | |||
@@ -59,7 +59,7 @@ static inline pmd_t * pmd_offset(pud_t * pud, unsigned long address) | |||
59 | static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) | 59 | static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) |
60 | { | 60 | { |
61 | } | 61 | } |
62 | #define __pmd_free_tlb(tlb, x) do { } while (0) | 62 | #define __pmd_free_tlb(tlb, x, a) do { } while (0) |
63 | 63 | ||
64 | #undef pmd_addr_end | 64 | #undef pmd_addr_end |
65 | #define pmd_addr_end(addr, end) (end) | 65 | #define pmd_addr_end(addr, end) (end) |
diff --git a/include/asm-generic/pgtable-nopud.h b/include/asm-generic/pgtable-nopud.h index 87cf449a6df3..810431d8351b 100644 --- a/include/asm-generic/pgtable-nopud.h +++ b/include/asm-generic/pgtable-nopud.h | |||
@@ -52,7 +52,7 @@ static inline pud_t * pud_offset(pgd_t * pgd, unsigned long address) | |||
52 | */ | 52 | */ |
53 | #define pud_alloc_one(mm, address) NULL | 53 | #define pud_alloc_one(mm, address) NULL |
54 | #define pud_free(mm, x) do { } while (0) | 54 | #define pud_free(mm, x) do { } while (0) |
55 | #define __pud_free_tlb(tlb, x) do { } while (0) | 55 | #define __pud_free_tlb(tlb, x, a) do { } while (0) |
56 | 56 | ||
57 | #undef pud_addr_end | 57 | #undef pud_addr_end |
58 | #define pud_addr_end(addr, end) (end) | 58 | #define pud_addr_end(addr, end) (end) |
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index e410f602cab1..e2bd73e8f9c0 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h | |||
@@ -129,6 +129,10 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addres | |||
129 | #define move_pte(pte, prot, old_addr, new_addr) (pte) | 129 | #define move_pte(pte, prot, old_addr, new_addr) (pte) |
130 | #endif | 130 | #endif |
131 | 131 | ||
132 | #ifndef pgprot_noncached | ||
133 | #define pgprot_noncached(prot) (prot) | ||
134 | #endif | ||
135 | |||
132 | #ifndef pgprot_writecombine | 136 | #ifndef pgprot_writecombine |
133 | #define pgprot_writecombine pgprot_noncached | 137 | #define pgprot_writecombine pgprot_noncached |
134 | #endif | 138 | #endif |
diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h index 4ce48e878530..d083561337f2 100644 --- a/include/asm-generic/sections.h +++ b/include/asm-generic/sections.h | |||
@@ -14,6 +14,9 @@ extern char __kprobes_text_start[], __kprobes_text_end[]; | |||
14 | extern char __initdata_begin[], __initdata_end[]; | 14 | extern char __initdata_begin[], __initdata_end[]; |
15 | extern char __start_rodata[], __end_rodata[]; | 15 | extern char __start_rodata[], __end_rodata[]; |
16 | 16 | ||
17 | /* Start and end of .ctors section - used for constructor calls. */ | ||
18 | extern char __ctors_start[], __ctors_end[]; | ||
19 | |||
17 | /* function descriptor handling (if any). Override | 20 | /* function descriptor handling (if any). Override |
18 | * in asm/sections.h */ | 21 | * in asm/sections.h */ |
19 | #ifndef dereference_function_descriptor | 22 | #ifndef dereference_function_descriptor |
diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h index f490e43a90b9..e43f9766259f 100644 --- a/include/asm-generic/tlb.h +++ b/include/asm-generic/tlb.h | |||
@@ -123,24 +123,24 @@ static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page) | |||
123 | __tlb_remove_tlb_entry(tlb, ptep, address); \ | 123 | __tlb_remove_tlb_entry(tlb, ptep, address); \ |
124 | } while (0) | 124 | } while (0) |
125 | 125 | ||
126 | #define pte_free_tlb(tlb, ptep) \ | 126 | #define pte_free_tlb(tlb, ptep, address) \ |
127 | do { \ | 127 | do { \ |
128 | tlb->need_flush = 1; \ | 128 | tlb->need_flush = 1; \ |
129 | __pte_free_tlb(tlb, ptep); \ | 129 | __pte_free_tlb(tlb, ptep, address); \ |
130 | } while (0) | 130 | } while (0) |
131 | 131 | ||
132 | #ifndef __ARCH_HAS_4LEVEL_HACK | 132 | #ifndef __ARCH_HAS_4LEVEL_HACK |
133 | #define pud_free_tlb(tlb, pudp) \ | 133 | #define pud_free_tlb(tlb, pudp, address) \ |
134 | do { \ | 134 | do { \ |
135 | tlb->need_flush = 1; \ | 135 | tlb->need_flush = 1; \ |
136 | __pud_free_tlb(tlb, pudp); \ | 136 | __pud_free_tlb(tlb, pudp, address); \ |
137 | } while (0) | 137 | } while (0) |
138 | #endif | 138 | #endif |
139 | 139 | ||
140 | #define pmd_free_tlb(tlb, pmdp) \ | 140 | #define pmd_free_tlb(tlb, pmdp, address) \ |
141 | do { \ | 141 | do { \ |
142 | tlb->need_flush = 1; \ | 142 | tlb->need_flush = 1; \ |
143 | __pmd_free_tlb(tlb, pmdp); \ | 143 | __pmd_free_tlb(tlb, pmdp, address); \ |
144 | } while (0) | 144 | } while (0) |
145 | 145 | ||
146 | #define tlb_migrate_finish(mm) do {} while (0) | 146 | #define tlb_migrate_finish(mm) do {} while (0) |
diff --git a/include/asm-generic/uaccess.h b/include/asm-generic/uaccess.h index 6d8cab22e294..b218b8513d04 100644 --- a/include/asm-generic/uaccess.h +++ b/include/asm-generic/uaccess.h | |||
@@ -163,7 +163,7 @@ static inline __must_check long __copy_to_user(void __user *to, | |||
163 | #define put_user(x, ptr) \ | 163 | #define put_user(x, ptr) \ |
164 | ({ \ | 164 | ({ \ |
165 | might_sleep(); \ | 165 | might_sleep(); \ |
166 | __access_ok(ptr, sizeof (*ptr)) ? \ | 166 | access_ok(VERIFY_WRITE, ptr, sizeof(*ptr)) ? \ |
167 | __put_user(x, ptr) : \ | 167 | __put_user(x, ptr) : \ |
168 | -EFAULT; \ | 168 | -EFAULT; \ |
169 | }) | 169 | }) |
@@ -219,7 +219,7 @@ extern int __put_user_bad(void) __attribute__((noreturn)); | |||
219 | #define get_user(x, ptr) \ | 219 | #define get_user(x, ptr) \ |
220 | ({ \ | 220 | ({ \ |
221 | might_sleep(); \ | 221 | might_sleep(); \ |
222 | __access_ok(ptr, sizeof (*ptr)) ? \ | 222 | access_ok(VERIFY_READ, ptr, sizeof(*ptr)) ? \ |
223 | __get_user(x, ptr) : \ | 223 | __get_user(x, ptr) : \ |
224 | -EFAULT; \ | 224 | -EFAULT; \ |
225 | }) | 225 | }) |
@@ -244,7 +244,7 @@ static inline long copy_from_user(void *to, | |||
244 | const void __user * from, unsigned long n) | 244 | const void __user * from, unsigned long n) |
245 | { | 245 | { |
246 | might_sleep(); | 246 | might_sleep(); |
247 | if (__access_ok(from, n)) | 247 | if (access_ok(VERIFY_READ, from, n)) |
248 | return __copy_from_user(to, from, n); | 248 | return __copy_from_user(to, from, n); |
249 | else | 249 | else |
250 | return n; | 250 | return n; |
@@ -254,7 +254,7 @@ static inline long copy_to_user(void __user *to, | |||
254 | const void *from, unsigned long n) | 254 | const void *from, unsigned long n) |
255 | { | 255 | { |
256 | might_sleep(); | 256 | might_sleep(); |
257 | if (__access_ok(to, n)) | 257 | if (access_ok(VERIFY_WRITE, to, n)) |
258 | return __copy_to_user(to, from, n); | 258 | return __copy_to_user(to, from, n); |
259 | else | 259 | else |
260 | return n; | 260 | return n; |
@@ -278,7 +278,7 @@ __strncpy_from_user(char *dst, const char __user *src, long count) | |||
278 | static inline long | 278 | static inline long |
279 | strncpy_from_user(char *dst, const char __user *src, long count) | 279 | strncpy_from_user(char *dst, const char __user *src, long count) |
280 | { | 280 | { |
281 | if (!__access_ok(src, 1)) | 281 | if (!access_ok(VERIFY_READ, src, 1)) |
282 | return -EFAULT; | 282 | return -EFAULT; |
283 | return __strncpy_from_user(dst, src, count); | 283 | return __strncpy_from_user(dst, src, count); |
284 | } | 284 | } |
@@ -291,6 +291,8 @@ strncpy_from_user(char *dst, const char __user *src, long count) | |||
291 | #ifndef strnlen_user | 291 | #ifndef strnlen_user |
292 | static inline long strnlen_user(const char __user *src, long n) | 292 | static inline long strnlen_user(const char __user *src, long n) |
293 | { | 293 | { |
294 | if (!access_ok(VERIFY_READ, src, 1)) | ||
295 | return 0; | ||
294 | return strlen((void * __force)src) + 1; | 296 | return strlen((void * __force)src) + 1; |
295 | } | 297 | } |
296 | #endif | 298 | #endif |
@@ -316,7 +318,7 @@ static inline __must_check unsigned long | |||
316 | clear_user(void __user *to, unsigned long n) | 318 | clear_user(void __user *to, unsigned long n) |
317 | { | 319 | { |
318 | might_sleep(); | 320 | might_sleep(); |
319 | if (!__access_ok(to, n)) | 321 | if (!access_ok(VERIFY_WRITE, to, n)) |
320 | return n; | 322 | return n; |
321 | 323 | ||
322 | return __clear_user(to, n); | 324 | return __clear_user(to, n); |
diff --git a/include/asm-generic/unistd.h b/include/asm-generic/unistd.h index 5b34b6233d6d..1125e5a1ee5d 100644 --- a/include/asm-generic/unistd.h +++ b/include/asm-generic/unistd.h | |||
@@ -618,8 +618,13 @@ __SYSCALL(__NR_migrate_pages, sys_migrate_pages) | |||
618 | __SYSCALL(__NR_move_pages, sys_move_pages) | 618 | __SYSCALL(__NR_move_pages, sys_move_pages) |
619 | #endif | 619 | #endif |
620 | 620 | ||
621 | #define __NR_rt_tgsigqueueinfo 240 | ||
622 | __SYSCALL(__NR_rt_tgsigqueueinfo, sys_rt_tgsigqueueinfo) | ||
623 | #define __NR_perf_counter_open 241 | ||
624 | __SYSCALL(__NR_perf_counter_open, sys_perf_counter_open) | ||
625 | |||
621 | #undef __NR_syscalls | 626 | #undef __NR_syscalls |
622 | #define __NR_syscalls 240 | 627 | #define __NR_syscalls 242 |
623 | 628 | ||
624 | /* | 629 | /* |
625 | * All syscalls below here should go away really, | 630 | * All syscalls below here should go away really, |
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 6bdba10fef4a..6ad76bf5fb40 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
@@ -30,9 +30,7 @@ | |||
30 | * EXCEPTION_TABLE(...) | 30 | * EXCEPTION_TABLE(...) |
31 | * NOTES | 31 | * NOTES |
32 | * | 32 | * |
33 | * __bss_start = .; | 33 | * BSS_SECTION(0, 0, 0) |
34 | * BSS_SECTION(0, 0) | ||
35 | * __bss_stop = .; | ||
36 | * _end = .; | 34 | * _end = .; |
37 | * | 35 | * |
38 | * /DISCARD/ : { | 36 | * /DISCARD/ : { |
@@ -191,7 +189,7 @@ | |||
191 | . = ALIGN(align); \ | 189 | . = ALIGN(align); \ |
192 | *(.data.cacheline_aligned) | 190 | *(.data.cacheline_aligned) |
193 | 191 | ||
194 | #define INIT_TASK(align) \ | 192 | #define INIT_TASK_DATA(align) \ |
195 | . = ALIGN(align); \ | 193 | . = ALIGN(align); \ |
196 | *(.data.init_task) | 194 | *(.data.init_task) |
197 | 195 | ||
@@ -434,18 +432,28 @@ | |||
434 | /* | 432 | /* |
435 | * Init task | 433 | * Init task |
436 | */ | 434 | */ |
437 | #define INIT_TASK_DATA(align) \ | 435 | #define INIT_TASK_DATA_SECTION(align) \ |
438 | . = ALIGN(align); \ | 436 | . = ALIGN(align); \ |
439 | .data.init_task : { \ | 437 | .data.init_task : { \ |
440 | INIT_TASK \ | 438 | INIT_TASK_DATA(align) \ |
441 | } | 439 | } |
442 | 440 | ||
441 | #ifdef CONFIG_CONSTRUCTORS | ||
442 | #define KERNEL_CTORS() . = ALIGN(8); \ | ||
443 | VMLINUX_SYMBOL(__ctors_start) = .; \ | ||
444 | *(.ctors) \ | ||
445 | VMLINUX_SYMBOL(__ctors_end) = .; | ||
446 | #else | ||
447 | #define KERNEL_CTORS() | ||
448 | #endif | ||
449 | |||
443 | /* init and exit section handling */ | 450 | /* init and exit section handling */ |
444 | #define INIT_DATA \ | 451 | #define INIT_DATA \ |
445 | *(.init.data) \ | 452 | *(.init.data) \ |
446 | DEV_DISCARD(init.data) \ | 453 | DEV_DISCARD(init.data) \ |
447 | CPU_DISCARD(init.data) \ | 454 | CPU_DISCARD(init.data) \ |
448 | MEM_DISCARD(init.data) \ | 455 | MEM_DISCARD(init.data) \ |
456 | KERNEL_CTORS() \ | ||
449 | *(.init.rodata) \ | 457 | *(.init.rodata) \ |
450 | DEV_DISCARD(init.rodata) \ | 458 | DEV_DISCARD(init.rodata) \ |
451 | CPU_DISCARD(init.rodata) \ | 459 | CPU_DISCARD(init.rodata) \ |
@@ -479,7 +487,8 @@ | |||
479 | * bss (Block Started by Symbol) - uninitialized data | 487 | * bss (Block Started by Symbol) - uninitialized data |
480 | * zeroed during startup | 488 | * zeroed during startup |
481 | */ | 489 | */ |
482 | #define SBSS \ | 490 | #define SBSS(sbss_align) \ |
491 | . = ALIGN(sbss_align); \ | ||
483 | .sbss : AT(ADDR(.sbss) - LOAD_OFFSET) { \ | 492 | .sbss : AT(ADDR(.sbss) - LOAD_OFFSET) { \ |
484 | *(.sbss) \ | 493 | *(.sbss) \ |
485 | *(.scommon) \ | 494 | *(.scommon) \ |
@@ -488,12 +497,10 @@ | |||
488 | #define BSS(bss_align) \ | 497 | #define BSS(bss_align) \ |
489 | . = ALIGN(bss_align); \ | 498 | . = ALIGN(bss_align); \ |
490 | .bss : AT(ADDR(.bss) - LOAD_OFFSET) { \ | 499 | .bss : AT(ADDR(.bss) - LOAD_OFFSET) { \ |
491 | VMLINUX_SYMBOL(__bss_start) = .; \ | ||
492 | *(.bss.page_aligned) \ | 500 | *(.bss.page_aligned) \ |
493 | *(.dynbss) \ | 501 | *(.dynbss) \ |
494 | *(.bss) \ | 502 | *(.bss) \ |
495 | *(COMMON) \ | 503 | *(COMMON) \ |
496 | VMLINUX_SYMBOL(__bss_stop) = .; \ | ||
497 | } | 504 | } |
498 | 505 | ||
499 | /* | 506 | /* |
@@ -616,7 +623,7 @@ | |||
616 | *(.init.ramfs) \ | 623 | *(.init.ramfs) \ |
617 | VMLINUX_SYMBOL(__initramfs_end) = .; | 624 | VMLINUX_SYMBOL(__initramfs_end) = .; |
618 | #else | 625 | #else |
619 | #define INITRAMFS | 626 | #define INIT_RAM_FS |
620 | #endif | 627 | #endif |
621 | 628 | ||
622 | /** | 629 | /** |
@@ -695,15 +702,15 @@ | |||
695 | * matches the requirment of PAGE_ALIGNED_DATA. | 702 | * matches the requirment of PAGE_ALIGNED_DATA. |
696 | * | 703 | * |
697 | * use 0 as page_align if page_aligned data is not used */ | 704 | * use 0 as page_align if page_aligned data is not used */ |
698 | #define RW_DATA_SECTION(cacheline, nosave, pagealigned, inittask) \ | 705 | #define RW_DATA_SECTION(cacheline, pagealigned, inittask) \ |
699 | . = ALIGN(PAGE_SIZE); \ | 706 | . = ALIGN(PAGE_SIZE); \ |
700 | .data : AT(ADDR(.data) - LOAD_OFFSET) { \ | 707 | .data : AT(ADDR(.data) - LOAD_OFFSET) { \ |
701 | INIT_TASK(inittask) \ | 708 | INIT_TASK_DATA(inittask) \ |
702 | CACHELINE_ALIGNED_DATA(cacheline) \ | 709 | CACHELINE_ALIGNED_DATA(cacheline) \ |
703 | READ_MOSTLY_DATA(cacheline) \ | 710 | READ_MOSTLY_DATA(cacheline) \ |
704 | DATA_DATA \ | 711 | DATA_DATA \ |
705 | CONSTRUCTORS \ | 712 | CONSTRUCTORS \ |
706 | NOSAVE_DATA(nosave) \ | 713 | NOSAVE_DATA \ |
707 | PAGE_ALIGNED_DATA(pagealigned) \ | 714 | PAGE_ALIGNED_DATA(pagealigned) \ |
708 | } | 715 | } |
709 | 716 | ||
@@ -725,8 +732,10 @@ | |||
725 | INIT_RAM_FS \ | 732 | INIT_RAM_FS \ |
726 | } | 733 | } |
727 | 734 | ||
728 | #define BSS_SECTION(sbss_align, bss_align) \ | 735 | #define BSS_SECTION(sbss_align, bss_align, stop_align) \ |
729 | SBSS \ | 736 | . = ALIGN(sbss_align); \ |
737 | VMLINUX_SYMBOL(__bss_start) = .; \ | ||
738 | SBSS(sbss_align) \ | ||
730 | BSS(bss_align) \ | 739 | BSS(bss_align) \ |
731 | . = ALIGN(4); | 740 | . = ALIGN(stop_align); \ |
732 | 741 | VMLINUX_SYMBOL(__bss_stop) = .; | |
diff --git a/include/crypto/algapi.h b/include/crypto/algapi.h index 3f388146a914..1ffb53f74d37 100644 --- a/include/crypto/algapi.h +++ b/include/crypto/algapi.h | |||
@@ -156,6 +156,7 @@ struct crypto_instance *crypto_alloc_instance(const char *name, | |||
156 | void crypto_init_queue(struct crypto_queue *queue, unsigned int max_qlen); | 156 | void crypto_init_queue(struct crypto_queue *queue, unsigned int max_qlen); |
157 | int crypto_enqueue_request(struct crypto_queue *queue, | 157 | int crypto_enqueue_request(struct crypto_queue *queue, |
158 | struct crypto_async_request *request); | 158 | struct crypto_async_request *request); |
159 | void *__crypto_dequeue_request(struct crypto_queue *queue, unsigned int offset); | ||
159 | struct crypto_async_request *crypto_dequeue_request(struct crypto_queue *queue); | 160 | struct crypto_async_request *crypto_dequeue_request(struct crypto_queue *queue); |
160 | int crypto_tfm_in_queue(struct crypto_queue *queue, struct crypto_tfm *tfm); | 161 | int crypto_tfm_in_queue(struct crypto_queue *queue, struct crypto_tfm *tfm); |
161 | 162 | ||
diff --git a/include/crypto/internal/skcipher.h b/include/crypto/internal/skcipher.h index 2ba42cd7d6aa..3a748a6bf772 100644 --- a/include/crypto/internal/skcipher.h +++ b/include/crypto/internal/skcipher.h | |||
@@ -79,8 +79,8 @@ static inline int skcipher_enqueue_givcrypt( | |||
79 | static inline struct skcipher_givcrypt_request *skcipher_dequeue_givcrypt( | 79 | static inline struct skcipher_givcrypt_request *skcipher_dequeue_givcrypt( |
80 | struct crypto_queue *queue) | 80 | struct crypto_queue *queue) |
81 | { | 81 | { |
82 | return container_of(ablkcipher_dequeue_request(queue), | 82 | return __crypto_dequeue_request( |
83 | struct skcipher_givcrypt_request, creq); | 83 | queue, offsetof(struct skcipher_givcrypt_request, creq.base)); |
84 | } | 84 | } |
85 | 85 | ||
86 | static inline void *skcipher_givcrypt_reqctx( | 86 | static inline void *skcipher_givcrypt_reqctx( |
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index d4ddc22e46bb..45b67d9c39c1 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
@@ -34,9 +34,6 @@ | |||
34 | #ifndef _DRM_P_H_ | 34 | #ifndef _DRM_P_H_ |
35 | #define _DRM_P_H_ | 35 | #define _DRM_P_H_ |
36 | 36 | ||
37 | /* If you want the memory alloc debug functionality, change define below */ | ||
38 | /* #define DEBUG_MEMORY */ | ||
39 | |||
40 | #ifdef __KERNEL__ | 37 | #ifdef __KERNEL__ |
41 | #ifdef __alpha__ | 38 | #ifdef __alpha__ |
42 | /* add include of current.h so that "current" is defined | 39 | /* add include of current.h so that "current" is defined |
@@ -133,31 +130,6 @@ extern void drm_ut_debug_printk(unsigned int request_level, | |||
133 | 130 | ||
134 | #define DRM_FLAG_DEBUG 0x01 | 131 | #define DRM_FLAG_DEBUG 0x01 |
135 | 132 | ||
136 | #define DRM_MEM_DMA 0 | ||
137 | #define DRM_MEM_SAREA 1 | ||
138 | #define DRM_MEM_DRIVER 2 | ||
139 | #define DRM_MEM_MAGIC 3 | ||
140 | #define DRM_MEM_IOCTLS 4 | ||
141 | #define DRM_MEM_MAPS 5 | ||
142 | #define DRM_MEM_VMAS 6 | ||
143 | #define DRM_MEM_BUFS 7 | ||
144 | #define DRM_MEM_SEGS 8 | ||
145 | #define DRM_MEM_PAGES 9 | ||
146 | #define DRM_MEM_FILES 10 | ||
147 | #define DRM_MEM_QUEUES 11 | ||
148 | #define DRM_MEM_CMDS 12 | ||
149 | #define DRM_MEM_MAPPINGS 13 | ||
150 | #define DRM_MEM_BUFLISTS 14 | ||
151 | #define DRM_MEM_AGPLISTS 15 | ||
152 | #define DRM_MEM_TOTALAGP 16 | ||
153 | #define DRM_MEM_BOUNDAGP 17 | ||
154 | #define DRM_MEM_CTXBITMAP 18 | ||
155 | #define DRM_MEM_STUB 19 | ||
156 | #define DRM_MEM_SGLISTS 20 | ||
157 | #define DRM_MEM_CTXLIST 21 | ||
158 | #define DRM_MEM_MM 22 | ||
159 | #define DRM_MEM_HASHTAB 23 | ||
160 | |||
161 | #define DRM_MAX_CTXBITMAP (PAGE_SIZE * 8) | 133 | #define DRM_MAX_CTXBITMAP (PAGE_SIZE * 8) |
162 | #define DRM_MAP_HASH_OFFSET 0x10000000 | 134 | #define DRM_MAP_HASH_OFFSET 0x10000000 |
163 | 135 | ||
@@ -1517,24 +1489,6 @@ static __inline__ void drm_core_dropmap(struct drm_local_map *map) | |||
1517 | { | 1489 | { |
1518 | } | 1490 | } |
1519 | 1491 | ||
1520 | #ifndef DEBUG_MEMORY | ||
1521 | /** Wrapper around kmalloc() */ | ||
1522 | static __inline__ void *drm_alloc(size_t size, int area) | ||
1523 | { | ||
1524 | return kmalloc(size, GFP_KERNEL); | ||
1525 | } | ||
1526 | |||
1527 | /** Wrapper around kfree() */ | ||
1528 | static __inline__ void drm_free(void *pt, size_t size, int area) | ||
1529 | { | ||
1530 | kfree(pt); | ||
1531 | } | ||
1532 | |||
1533 | /** Wrapper around kcalloc() */ | ||
1534 | static __inline__ void *drm_calloc(size_t nmemb, size_t size, int area) | ||
1535 | { | ||
1536 | return kcalloc(nmemb, size, GFP_KERNEL); | ||
1537 | } | ||
1538 | 1492 | ||
1539 | static __inline__ void *drm_calloc_large(size_t nmemb, size_t size) | 1493 | static __inline__ void *drm_calloc_large(size_t nmemb, size_t size) |
1540 | { | 1494 | { |
@@ -1555,12 +1509,6 @@ static __inline void drm_free_large(void *ptr) | |||
1555 | 1509 | ||
1556 | vfree(ptr); | 1510 | vfree(ptr); |
1557 | } | 1511 | } |
1558 | #else | ||
1559 | extern void *drm_alloc(size_t size, int area); | ||
1560 | extern void drm_free(void *pt, size_t size, int area); | ||
1561 | extern void *drm_calloc(size_t nmemb, size_t size, int area); | ||
1562 | #endif | ||
1563 | |||
1564 | /*@}*/ | 1512 | /*@}*/ |
1565 | 1513 | ||
1566 | #endif /* __KERNEL__ */ | 1514 | #endif /* __KERNEL__ */ |
diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h index a11cc9d32591..7d6c9a2dfcbb 100644 --- a/include/drm/drm_edid.h +++ b/include/drm/drm_edid.h | |||
@@ -28,53 +28,49 @@ | |||
28 | #define EDID_LENGTH 128 | 28 | #define EDID_LENGTH 128 |
29 | #define DDC_ADDR 0x50 | 29 | #define DDC_ADDR 0x50 |
30 | 30 | ||
31 | #ifdef BIG_ENDIAN | ||
32 | #error "EDID structure is little endian, need big endian versions" | ||
33 | #else | ||
34 | |||
35 | struct est_timings { | 31 | struct est_timings { |
36 | u8 t1; | 32 | u8 t1; |
37 | u8 t2; | 33 | u8 t2; |
38 | u8 mfg_rsvd; | 34 | u8 mfg_rsvd; |
39 | } __attribute__((packed)); | 35 | } __attribute__((packed)); |
40 | 36 | ||
37 | /* 00=16:10, 01=4:3, 10=5:4, 11=16:9 */ | ||
38 | #define EDID_TIMING_ASPECT_SHIFT 6 | ||
39 | #define EDID_TIMING_ASPECT_MASK (0x3 << EDID_TIMING_ASPECT_SHIFT) | ||
40 | |||
41 | /* need to add 60 */ | ||
42 | #define EDID_TIMING_VFREQ_SHIFT 0 | ||
43 | #define EDID_TIMING_VFREQ_MASK (0x3f << EDID_TIMING_VFREQ_SHIFT) | ||
44 | |||
41 | struct std_timing { | 45 | struct std_timing { |
42 | u8 hsize; /* need to multiply by 8 then add 248 */ | 46 | u8 hsize; /* need to multiply by 8 then add 248 */ |
43 | u8 vfreq:6; /* need to add 60 */ | 47 | u8 vfreq_aspect; |
44 | u8 aspect_ratio:2; /* 00=16:10, 01=4:3, 10=5:4, 11=16:9 */ | ||
45 | } __attribute__((packed)); | 48 | } __attribute__((packed)); |
46 | 49 | ||
50 | #define DRM_EDID_PT_HSYNC_POSITIVE (1 << 1) | ||
51 | #define DRM_EDID_PT_VSYNC_POSITIVE (1 << 2) | ||
52 | #define DRM_EDID_PT_SEPARATE_SYNC (3 << 3) | ||
53 | #define DRM_EDID_PT_STEREO (1 << 5) | ||
54 | #define DRM_EDID_PT_INTERLACED (1 << 7) | ||
55 | |||
47 | /* If detailed data is pixel timing */ | 56 | /* If detailed data is pixel timing */ |
48 | struct detailed_pixel_timing { | 57 | struct detailed_pixel_timing { |
49 | u8 hactive_lo; | 58 | u8 hactive_lo; |
50 | u8 hblank_lo; | 59 | u8 hblank_lo; |
51 | u8 hblank_hi:4; | 60 | u8 hactive_hblank_hi; |
52 | u8 hactive_hi:4; | ||
53 | u8 vactive_lo; | 61 | u8 vactive_lo; |
54 | u8 vblank_lo; | 62 | u8 vblank_lo; |
55 | u8 vblank_hi:4; | 63 | u8 vactive_vblank_hi; |
56 | u8 vactive_hi:4; | ||
57 | u8 hsync_offset_lo; | 64 | u8 hsync_offset_lo; |
58 | u8 hsync_pulse_width_lo; | 65 | u8 hsync_pulse_width_lo; |
59 | u8 vsync_pulse_width_lo:4; | 66 | u8 vsync_offset_pulse_width_lo; |
60 | u8 vsync_offset_lo:4; | 67 | u8 hsync_vsync_offset_pulse_width_hi; |
61 | u8 vsync_pulse_width_hi:2; | ||
62 | u8 vsync_offset_hi:2; | ||
63 | u8 hsync_pulse_width_hi:2; | ||
64 | u8 hsync_offset_hi:2; | ||
65 | u8 width_mm_lo; | 68 | u8 width_mm_lo; |
66 | u8 height_mm_lo; | 69 | u8 height_mm_lo; |
67 | u8 height_mm_hi:4; | 70 | u8 width_height_mm_hi; |
68 | u8 width_mm_hi:4; | ||
69 | u8 hborder; | 71 | u8 hborder; |
70 | u8 vborder; | 72 | u8 vborder; |
71 | u8 unknown0:1; | 73 | u8 misc; |
72 | u8 hsync_positive:1; | ||
73 | u8 vsync_positive:1; | ||
74 | u8 separate_sync:2; | ||
75 | u8 stereo:1; | ||
76 | u8 unknown6:1; | ||
77 | u8 interlaced:1; | ||
78 | } __attribute__((packed)); | 74 | } __attribute__((packed)); |
79 | 75 | ||
80 | /* If it's not pixel timing, it'll be one of the below */ | 76 | /* If it's not pixel timing, it'll be one of the below */ |
@@ -88,18 +84,16 @@ struct detailed_data_monitor_range { | |||
88 | u8 min_hfreq_khz; | 84 | u8 min_hfreq_khz; |
89 | u8 max_hfreq_khz; | 85 | u8 max_hfreq_khz; |
90 | u8 pixel_clock_mhz; /* need to multiply by 10 */ | 86 | u8 pixel_clock_mhz; /* need to multiply by 10 */ |
91 | u16 sec_gtf_toggle; /* A000=use above, 20=use below */ /* FIXME: byte order */ | 87 | __le16 sec_gtf_toggle; /* A000=use above, 20=use below */ |
92 | u8 hfreq_start_khz; /* need to multiply by 2 */ | 88 | u8 hfreq_start_khz; /* need to multiply by 2 */ |
93 | u8 c; /* need to divide by 2 */ | 89 | u8 c; /* need to divide by 2 */ |
94 | u16 m; /* FIXME: byte order */ | 90 | __le16 m; |
95 | u8 k; | 91 | u8 k; |
96 | u8 j; /* need to divide by 2 */ | 92 | u8 j; /* need to divide by 2 */ |
97 | } __attribute__((packed)); | 93 | } __attribute__((packed)); |
98 | 94 | ||
99 | struct detailed_data_wpindex { | 95 | struct detailed_data_wpindex { |
100 | u8 white_y_lo:2; | 96 | u8 white_yx_lo; /* Lower 2 bits each */ |
101 | u8 white_x_lo:2; | ||
102 | u8 pad:4; | ||
103 | u8 white_x_hi; | 97 | u8 white_x_hi; |
104 | u8 white_y_hi; | 98 | u8 white_y_hi; |
105 | u8 gamma; /* need to divide by 100 then add 1 */ | 99 | u8 gamma; /* need to divide by 100 then add 1 */ |
@@ -134,13 +128,29 @@ struct detailed_non_pixel { | |||
134 | #define EDID_DETAIL_MONITOR_SERIAL 0xff | 128 | #define EDID_DETAIL_MONITOR_SERIAL 0xff |
135 | 129 | ||
136 | struct detailed_timing { | 130 | struct detailed_timing { |
137 | u16 pixel_clock; /* need to multiply by 10 KHz */ /* FIXME: byte order */ | 131 | __le16 pixel_clock; /* need to multiply by 10 KHz */ |
138 | union { | 132 | union { |
139 | struct detailed_pixel_timing pixel_data; | 133 | struct detailed_pixel_timing pixel_data; |
140 | struct detailed_non_pixel other_data; | 134 | struct detailed_non_pixel other_data; |
141 | } data; | 135 | } data; |
142 | } __attribute__((packed)); | 136 | } __attribute__((packed)); |
143 | 137 | ||
138 | #define DRM_EDID_INPUT_SERRATION_VSYNC (1 << 0) | ||
139 | #define DRM_EDID_INPUT_SYNC_ON_GREEN (1 << 1) | ||
140 | #define DRM_EDID_INPUT_COMPOSITE_SYNC (1 << 2) | ||
141 | #define DRM_EDID_INPUT_SEPARATE_SYNCS (1 << 3) | ||
142 | #define DRM_EDID_INPUT_BLANK_TO_BLACK (1 << 4) | ||
143 | #define DRM_EDID_INPUT_VIDEO_LEVEL (3 << 5) | ||
144 | #define DRM_EDID_INPUT_DIGITAL (1 << 7) /* bits below must be zero if set */ | ||
145 | |||
146 | #define DRM_EDID_FEATURE_DEFAULT_GTF (1 << 0) | ||
147 | #define DRM_EDID_FEATURE_PREFERRED_TIMING (1 << 1) | ||
148 | #define DRM_EDID_FEATURE_STANDARD_COLOR (1 << 2) | ||
149 | #define DRM_EDID_FEATURE_DISPLAY_TYPE (3 << 3) /* 00=mono, 01=rgb, 10=non-rgb, 11=unknown */ | ||
150 | #define DRM_EDID_FEATURE_PM_ACTIVE_OFF (1 << 5) | ||
151 | #define DRM_EDID_FEATURE_PM_SUSPEND (1 << 6) | ||
152 | #define DRM_EDID_FEATURE_PM_STANDBY (1 << 7) | ||
153 | |||
144 | struct edid { | 154 | struct edid { |
145 | u8 header[8]; | 155 | u8 header[8]; |
146 | /* Vendor & product info */ | 156 | /* Vendor & product info */ |
@@ -153,25 +163,11 @@ struct edid { | |||
153 | u8 version; | 163 | u8 version; |
154 | u8 revision; | 164 | u8 revision; |
155 | /* Display info: */ | 165 | /* Display info: */ |
156 | /* input definition */ | 166 | u8 input; |
157 | u8 serration_vsync:1; | ||
158 | u8 sync_on_green:1; | ||
159 | u8 composite_sync:1; | ||
160 | u8 separate_syncs:1; | ||
161 | u8 blank_to_black:1; | ||
162 | u8 video_level:2; | ||
163 | u8 digital:1; /* bits below must be zero if set */ | ||
164 | u8 width_cm; | 167 | u8 width_cm; |
165 | u8 height_cm; | 168 | u8 height_cm; |
166 | u8 gamma; | 169 | u8 gamma; |
167 | /* feature support */ | 170 | u8 features; |
168 | u8 default_gtf:1; | ||
169 | u8 preferred_timing:1; | ||
170 | u8 standard_color:1; | ||
171 | u8 display_type:2; /* 00=mono, 01=rgb, 10=non-rgb, 11=unknown */ | ||
172 | u8 pm_active_off:1; | ||
173 | u8 pm_suspend:1; | ||
174 | u8 pm_standby:1; | ||
175 | /* Color characteristics */ | 171 | /* Color characteristics */ |
176 | u8 red_green_lo; | 172 | u8 red_green_lo; |
177 | u8 black_white_lo; | 173 | u8 black_white_lo; |
@@ -195,8 +191,6 @@ struct edid { | |||
195 | u8 checksum; | 191 | u8 checksum; |
196 | } __attribute__((packed)); | 192 | } __attribute__((packed)); |
197 | 193 | ||
198 | #endif /* little endian structs */ | ||
199 | |||
200 | #define EDID_PRODUCT_ID(e) ((e)->prod_code[0] | ((e)->prod_code[1] << 8)) | 194 | #define EDID_PRODUCT_ID(e) ((e)->prod_code[0] | ((e)->prod_code[1] << 8)) |
201 | 195 | ||
202 | #endif /* __DRM_EDID_H__ */ | 196 | #endif /* __DRM_EDID_H__ */ |
diff --git a/include/drm/drm_memory_debug.h b/include/drm/drm_memory_debug.h deleted file mode 100644 index 6463271deea8..000000000000 --- a/include/drm/drm_memory_debug.h +++ /dev/null | |||
@@ -1,309 +0,0 @@ | |||
1 | /** | ||
2 | * \file drm_memory_debug.h | ||
3 | * Memory management wrappers for DRM. | ||
4 | * | ||
5 | * \author Rickard E. (Rik) Faith <faith@valinux.com> | ||
6 | * \author Gareth Hughes <gareth@valinux.com> | ||
7 | */ | ||
8 | |||
9 | /* | ||
10 | * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. | ||
11 | * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. | ||
12 | * All Rights Reserved. | ||
13 | * | ||
14 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
15 | * copy of this software and associated documentation files (the "Software"), | ||
16 | * to deal in the Software without restriction, including without limitation | ||
17 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
18 | * and/or sell copies of the Software, and to permit persons to whom the | ||
19 | * Software is furnished to do so, subject to the following conditions: | ||
20 | * | ||
21 | * The above copyright notice and this permission notice (including the next | ||
22 | * paragraph) shall be included in all copies or substantial portions of the | ||
23 | * Software. | ||
24 | * | ||
25 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
26 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
27 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
28 | * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
29 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
30 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
31 | * OTHER DEALINGS IN THE SOFTWARE. | ||
32 | */ | ||
33 | |||
34 | #include "drmP.h" | ||
35 | |||
36 | typedef struct drm_mem_stats { | ||
37 | const char *name; | ||
38 | int succeed_count; | ||
39 | int free_count; | ||
40 | int fail_count; | ||
41 | unsigned long bytes_allocated; | ||
42 | unsigned long bytes_freed; | ||
43 | } drm_mem_stats_t; | ||
44 | |||
45 | static DEFINE_SPINLOCK(drm_mem_lock); | ||
46 | static unsigned long drm_ram_available = 0; /* In pages */ | ||
47 | static unsigned long drm_ram_used = 0; | ||
48 | static drm_mem_stats_t drm_mem_stats[] = | ||
49 | { | ||
50 | [DRM_MEM_DMA] = {"dmabufs"}, | ||
51 | [DRM_MEM_SAREA] = {"sareas"}, | ||
52 | [DRM_MEM_DRIVER] = {"driver"}, | ||
53 | [DRM_MEM_MAGIC] = {"magic"}, | ||
54 | [DRM_MEM_IOCTLS] = {"ioctltab"}, | ||
55 | [DRM_MEM_MAPS] = {"maplist"}, | ||
56 | [DRM_MEM_VMAS] = {"vmalist"}, | ||
57 | [DRM_MEM_BUFS] = {"buflist"}, | ||
58 | [DRM_MEM_SEGS] = {"seglist"}, | ||
59 | [DRM_MEM_PAGES] = {"pagelist"}, | ||
60 | [DRM_MEM_FILES] = {"files"}, | ||
61 | [DRM_MEM_QUEUES] = {"queues"}, | ||
62 | [DRM_MEM_CMDS] = {"commands"}, | ||
63 | [DRM_MEM_MAPPINGS] = {"mappings"}, | ||
64 | [DRM_MEM_BUFLISTS] = {"buflists"}, | ||
65 | [DRM_MEM_AGPLISTS] = {"agplist"}, | ||
66 | [DRM_MEM_SGLISTS] = {"sglist"}, | ||
67 | [DRM_MEM_TOTALAGP] = {"totalagp"}, | ||
68 | [DRM_MEM_BOUNDAGP] = {"boundagp"}, | ||
69 | [DRM_MEM_CTXBITMAP] = {"ctxbitmap"}, | ||
70 | [DRM_MEM_CTXLIST] = {"ctxlist"}, | ||
71 | [DRM_MEM_STUB] = {"stub"}, | ||
72 | {NULL, 0,} /* Last entry must be null */ | ||
73 | }; | ||
74 | |||
75 | void drm_mem_init (void) { | ||
76 | drm_mem_stats_t *mem; | ||
77 | struct sysinfo si; | ||
78 | |||
79 | for (mem = drm_mem_stats; mem->name; ++mem) { | ||
80 | mem->succeed_count = 0; | ||
81 | mem->free_count = 0; | ||
82 | mem->fail_count = 0; | ||
83 | mem->bytes_allocated = 0; | ||
84 | mem->bytes_freed = 0; | ||
85 | } | ||
86 | |||
87 | si_meminfo(&si); | ||
88 | drm_ram_available = si.totalram; | ||
89 | drm_ram_used = 0; | ||
90 | } | ||
91 | |||
92 | /* drm_mem_info is called whenever a process reads /dev/drm/mem. */ | ||
93 | |||
94 | static int drm__mem_info (char *buf, char **start, off_t offset, | ||
95 | int request, int *eof, void *data) { | ||
96 | drm_mem_stats_t *pt; | ||
97 | int len = 0; | ||
98 | |||
99 | if (offset > DRM_PROC_LIMIT) { | ||
100 | *eof = 1; | ||
101 | return 0; | ||
102 | } | ||
103 | |||
104 | *eof = 0; | ||
105 | *start = &buf[offset]; | ||
106 | |||
107 | DRM_PROC_PRINT(" total counts " | ||
108 | " | outstanding \n"); | ||
109 | DRM_PROC_PRINT("type alloc freed fail bytes freed" | ||
110 | " | allocs bytes\n\n"); | ||
111 | DRM_PROC_PRINT("%-9.9s %5d %5d %4d %10lu kB |\n", | ||
112 | "system", 0, 0, 0, | ||
113 | drm_ram_available << (PAGE_SHIFT - 10)); | ||
114 | DRM_PROC_PRINT("%-9.9s %5d %5d %4d %10lu kB |\n", | ||
115 | "locked", 0, 0, 0, drm_ram_used >> 10); | ||
116 | DRM_PROC_PRINT("\n"); | ||
117 | for (pt = drm_mem_stats; pt->name; pt++) { | ||
118 | DRM_PROC_PRINT("%-9.9s %5d %5d %4d %10lu %10lu | %6d %10ld\n", | ||
119 | pt->name, | ||
120 | pt->succeed_count, | ||
121 | pt->free_count, | ||
122 | pt->fail_count, | ||
123 | pt->bytes_allocated, | ||
124 | pt->bytes_freed, | ||
125 | pt->succeed_count - pt->free_count, | ||
126 | (long)pt->bytes_allocated | ||
127 | - (long)pt->bytes_freed); | ||
128 | } | ||
129 | |||
130 | if (len > request + offset) | ||
131 | return request; | ||
132 | *eof = 1; | ||
133 | return len - offset; | ||
134 | } | ||
135 | |||
136 | int drm_mem_info (char *buf, char **start, off_t offset, | ||
137 | int len, int *eof, void *data) { | ||
138 | int ret; | ||
139 | |||
140 | spin_lock(&drm_mem_lock); | ||
141 | ret = drm__mem_info (buf, start, offset, len, eof, data); | ||
142 | spin_unlock(&drm_mem_lock); | ||
143 | return ret; | ||
144 | } | ||
145 | |||
146 | void *drm_alloc (size_t size, int area) { | ||
147 | void *pt; | ||
148 | |||
149 | if (!size) { | ||
150 | DRM_MEM_ERROR(area, "Allocating 0 bytes\n"); | ||
151 | return NULL; | ||
152 | } | ||
153 | |||
154 | if (!(pt = kmalloc(size, GFP_KERNEL))) { | ||
155 | spin_lock(&drm_mem_lock); | ||
156 | ++drm_mem_stats[area].fail_count; | ||
157 | spin_unlock(&drm_mem_lock); | ||
158 | return NULL; | ||
159 | } | ||
160 | spin_lock(&drm_mem_lock); | ||
161 | ++drm_mem_stats[area].succeed_count; | ||
162 | drm_mem_stats[area].bytes_allocated += size; | ||
163 | spin_unlock(&drm_mem_lock); | ||
164 | return pt; | ||
165 | } | ||
166 | |||
167 | void *drm_calloc (size_t nmemb, size_t size, int area) { | ||
168 | void *addr; | ||
169 | |||
170 | addr = drm_alloc (nmemb * size, area); | ||
171 | if (addr != NULL) | ||
172 | memset((void *)addr, 0, size * nmemb); | ||
173 | |||
174 | return addr; | ||
175 | } | ||
176 | |||
177 | void *drm_realloc (void *oldpt, size_t oldsize, size_t size, int area) { | ||
178 | void *pt; | ||
179 | |||
180 | if (!(pt = drm_alloc (size, area))) | ||
181 | return NULL; | ||
182 | if (oldpt && oldsize) { | ||
183 | memcpy(pt, oldpt, oldsize); | ||
184 | drm_free (oldpt, oldsize, area); | ||
185 | } | ||
186 | return pt; | ||
187 | } | ||
188 | |||
189 | void drm_free (void *pt, size_t size, int area) { | ||
190 | int alloc_count; | ||
191 | int free_count; | ||
192 | |||
193 | if (!pt) | ||
194 | DRM_MEM_ERROR(area, "Attempt to free NULL pointer\n"); | ||
195 | else | ||
196 | kfree(pt); | ||
197 | spin_lock(&drm_mem_lock); | ||
198 | drm_mem_stats[area].bytes_freed += size; | ||
199 | free_count = ++drm_mem_stats[area].free_count; | ||
200 | alloc_count = drm_mem_stats[area].succeed_count; | ||
201 | spin_unlock(&drm_mem_lock); | ||
202 | if (free_count > alloc_count) { | ||
203 | DRM_MEM_ERROR(area, "Excess frees: %d frees, %d allocs\n", | ||
204 | free_count, alloc_count); | ||
205 | } | ||
206 | } | ||
207 | |||
208 | #if __OS_HAS_AGP | ||
209 | |||
210 | DRM_AGP_MEM *drm_alloc_agp (drm_device_t *dev, int pages, u32 type) { | ||
211 | DRM_AGP_MEM *handle; | ||
212 | |||
213 | if (!pages) { | ||
214 | DRM_MEM_ERROR(DRM_MEM_TOTALAGP, "Allocating 0 pages\n"); | ||
215 | return NULL; | ||
216 | } | ||
217 | |||
218 | if ((handle = drm_agp_allocate_memory (pages, type))) { | ||
219 | spin_lock(&drm_mem_lock); | ||
220 | ++drm_mem_stats[DRM_MEM_TOTALAGP].succeed_count; | ||
221 | drm_mem_stats[DRM_MEM_TOTALAGP].bytes_allocated | ||
222 | += pages << PAGE_SHIFT; | ||
223 | spin_unlock(&drm_mem_lock); | ||
224 | return handle; | ||
225 | } | ||
226 | spin_lock(&drm_mem_lock); | ||
227 | ++drm_mem_stats[DRM_MEM_TOTALAGP].fail_count; | ||
228 | spin_unlock(&drm_mem_lock); | ||
229 | return NULL; | ||
230 | } | ||
231 | |||
232 | int drm_free_agp (DRM_AGP_MEM * handle, int pages) { | ||
233 | int alloc_count; | ||
234 | int free_count; | ||
235 | int retval = -EINVAL; | ||
236 | |||
237 | if (!handle) { | ||
238 | DRM_MEM_ERROR(DRM_MEM_TOTALAGP, | ||
239 | "Attempt to free NULL AGP handle\n"); | ||
240 | return retval; | ||
241 | } | ||
242 | |||
243 | if (drm_agp_free_memory (handle)) { | ||
244 | spin_lock(&drm_mem_lock); | ||
245 | free_count = ++drm_mem_stats[DRM_MEM_TOTALAGP].free_count; | ||
246 | alloc_count = drm_mem_stats[DRM_MEM_TOTALAGP].succeed_count; | ||
247 | drm_mem_stats[DRM_MEM_TOTALAGP].bytes_freed | ||
248 | += pages << PAGE_SHIFT; | ||
249 | spin_unlock(&drm_mem_lock); | ||
250 | if (free_count > alloc_count) { | ||
251 | DRM_MEM_ERROR(DRM_MEM_TOTALAGP, | ||
252 | "Excess frees: %d frees, %d allocs\n", | ||
253 | free_count, alloc_count); | ||
254 | } | ||
255 | return 0; | ||
256 | } | ||
257 | return retval; | ||
258 | } | ||
259 | |||
260 | int drm_bind_agp (DRM_AGP_MEM * handle, unsigned int start) { | ||
261 | int retcode = -EINVAL; | ||
262 | |||
263 | if (!handle) { | ||
264 | DRM_MEM_ERROR(DRM_MEM_BOUNDAGP, | ||
265 | "Attempt to bind NULL AGP handle\n"); | ||
266 | return retcode; | ||
267 | } | ||
268 | |||
269 | if (!(retcode = drm_agp_bind_memory (handle, start))) { | ||
270 | spin_lock(&drm_mem_lock); | ||
271 | ++drm_mem_stats[DRM_MEM_BOUNDAGP].succeed_count; | ||
272 | drm_mem_stats[DRM_MEM_BOUNDAGP].bytes_allocated | ||
273 | += handle->page_count << PAGE_SHIFT; | ||
274 | spin_unlock(&drm_mem_lock); | ||
275 | return retcode; | ||
276 | } | ||
277 | spin_lock(&drm_mem_lock); | ||
278 | ++drm_mem_stats[DRM_MEM_BOUNDAGP].fail_count; | ||
279 | spin_unlock(&drm_mem_lock); | ||
280 | return retcode; | ||
281 | } | ||
282 | |||
283 | int drm_unbind_agp (DRM_AGP_MEM * handle) { | ||
284 | int alloc_count; | ||
285 | int free_count; | ||
286 | int retcode = -EINVAL; | ||
287 | |||
288 | if (!handle) { | ||
289 | DRM_MEM_ERROR(DRM_MEM_BOUNDAGP, | ||
290 | "Attempt to unbind NULL AGP handle\n"); | ||
291 | return retcode; | ||
292 | } | ||
293 | |||
294 | if ((retcode = drm_agp_unbind_memory (handle))) | ||
295 | return retcode; | ||
296 | spin_lock(&drm_mem_lock); | ||
297 | free_count = ++drm_mem_stats[DRM_MEM_BOUNDAGP].free_count; | ||
298 | alloc_count = drm_mem_stats[DRM_MEM_BOUNDAGP].succeed_count; | ||
299 | drm_mem_stats[DRM_MEM_BOUNDAGP].bytes_freed | ||
300 | += handle->page_count << PAGE_SHIFT; | ||
301 | spin_unlock(&drm_mem_lock); | ||
302 | if (free_count > alloc_count) { | ||
303 | DRM_MEM_ERROR(DRM_MEM_BOUNDAGP, | ||
304 | "Excess frees: %d frees, %d allocs\n", | ||
305 | free_count, alloc_count); | ||
306 | } | ||
307 | return retcode; | ||
308 | } | ||
309 | #endif | ||
diff --git a/include/drm/drm_mm.h b/include/drm/drm_mm.h index 5662f4278ef3..f8332073d277 100644 --- a/include/drm/drm_mm.h +++ b/include/drm/drm_mm.h | |||
@@ -59,13 +59,22 @@ struct drm_mm { | |||
59 | /* | 59 | /* |
60 | * Basic range manager support (drm_mm.c) | 60 | * Basic range manager support (drm_mm.c) |
61 | */ | 61 | */ |
62 | 62 | extern struct drm_mm_node *drm_mm_get_block_generic(struct drm_mm_node *node, | |
63 | extern struct drm_mm_node *drm_mm_get_block(struct drm_mm_node *parent, | 63 | unsigned long size, |
64 | unsigned long size, | 64 | unsigned alignment, |
65 | unsigned alignment); | 65 | int atomic); |
66 | extern struct drm_mm_node *drm_mm_get_block_atomic(struct drm_mm_node *parent, | 66 | static inline struct drm_mm_node *drm_mm_get_block(struct drm_mm_node *parent, |
67 | unsigned long size, | 67 | unsigned long size, |
68 | unsigned alignment); | 68 | unsigned alignment) |
69 | { | ||
70 | return drm_mm_get_block_generic(parent, size, alignment, 0); | ||
71 | } | ||
72 | static inline struct drm_mm_node *drm_mm_get_block_atomic(struct drm_mm_node *parent, | ||
73 | unsigned long size, | ||
74 | unsigned alignment) | ||
75 | { | ||
76 | return drm_mm_get_block_generic(parent, size, alignment, 1); | ||
77 | } | ||
69 | extern void drm_mm_put_block(struct drm_mm_node *cur); | 78 | extern void drm_mm_put_block(struct drm_mm_node *cur); |
70 | extern struct drm_mm_node *drm_mm_search_free(const struct drm_mm *mm, | 79 | extern struct drm_mm_node *drm_mm_search_free(const struct drm_mm *mm, |
71 | unsigned long size, | 80 | unsigned long size, |
diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h index 45c18672b093..853508499d20 100644 --- a/include/drm/drm_pciids.h +++ b/include/drm/drm_pciids.h | |||
@@ -43,6 +43,7 @@ | |||
43 | {0x1002, 0x4A4F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ | 43 | {0x1002, 0x4A4F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ |
44 | {0x1002, 0x4A50, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ | 44 | {0x1002, 0x4A50, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ |
45 | {0x1002, 0x4A54, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ | 45 | {0x1002, 0x4A54, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ |
46 | {0x1002, 0x4B48, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ | ||
46 | {0x1002, 0x4B49, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ | 47 | {0x1002, 0x4B49, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ |
47 | {0x1002, 0x4B4A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ | 48 | {0x1002, 0x4B4A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ |
48 | {0x1002, 0x4B4B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ | 49 | {0x1002, 0x4B4B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R420|RADEON_NEW_MEMMAP}, \ |
@@ -256,12 +257,16 @@ | |||
256 | {0x1002, 0x940F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R600|RADEON_NEW_MEMMAP}, \ | 257 | {0x1002, 0x940F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R600|RADEON_NEW_MEMMAP}, \ |
257 | {0x1002, 0x94A0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | 258 | {0x1002, 0x94A0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ |
258 | {0x1002, 0x94A1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | 259 | {0x1002, 0x94A1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ |
260 | {0x1002, 0x94A3, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
259 | {0x1002, 0x94B1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_NEW_MEMMAP}, \ | 261 | {0x1002, 0x94B1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_NEW_MEMMAP}, \ |
260 | {0x1002, 0x94B3, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_NEW_MEMMAP}, \ | 262 | {0x1002, 0x94B3, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_NEW_MEMMAP}, \ |
263 | {0x1002, 0x94B4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_NEW_MEMMAP}, \ | ||
261 | {0x1002, 0x94B5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_NEW_MEMMAP}, \ | 264 | {0x1002, 0x94B5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_NEW_MEMMAP}, \ |
265 | {0x1002, 0x94B9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
262 | {0x1002, 0x9440, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \ | 266 | {0x1002, 0x9440, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \ |
263 | {0x1002, 0x9441, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \ | 267 | {0x1002, 0x9441, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \ |
264 | {0x1002, 0x9442, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \ | 268 | {0x1002, 0x9442, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \ |
269 | {0x1002, 0x9443, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \ | ||
265 | {0x1002, 0x9444, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \ | 270 | {0x1002, 0x9444, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \ |
266 | {0x1002, 0x9446, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \ | 271 | {0x1002, 0x9446, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \ |
267 | {0x1002, 0x944A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | 272 | {0x1002, 0x944A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ |
@@ -286,6 +291,7 @@ | |||
286 | {0x1002, 0x948F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \ | 291 | {0x1002, 0x948F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \ |
287 | {0x1002, 0x9490, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \ | 292 | {0x1002, 0x9490, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \ |
288 | {0x1002, 0x9491, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | 293 | {0x1002, 0x9491, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ |
294 | {0x1002, 0x9495, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \ | ||
289 | {0x1002, 0x9498, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \ | 295 | {0x1002, 0x9498, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \ |
290 | {0x1002, 0x949C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \ | 296 | {0x1002, 0x949C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \ |
291 | {0x1002, 0x949E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \ | 297 | {0x1002, 0x949E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \ |
@@ -323,6 +329,7 @@ | |||
323 | {0x1002, 0x9552, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | 329 | {0x1002, 0x9552, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ |
324 | {0x1002, 0x9553, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | 330 | {0x1002, 0x9553, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ |
325 | {0x1002, 0x9555, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | 331 | {0x1002, 0x9555, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ |
332 | {0x1002, 0x9557, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
326 | {0x1002, 0x9580, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV630|RADEON_NEW_MEMMAP}, \ | 333 | {0x1002, 0x9580, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV630|RADEON_NEW_MEMMAP}, \ |
327 | {0x1002, 0x9581, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV630|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | 334 | {0x1002, 0x9581, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV630|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ |
328 | {0x1002, 0x9583, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV630|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | 335 | {0x1002, 0x9583, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV630|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ |
@@ -346,12 +353,12 @@ | |||
346 | {0x1002, 0x9599, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV635|RADEON_NEW_MEMMAP}, \ | 353 | {0x1002, 0x9599, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV635|RADEON_NEW_MEMMAP}, \ |
347 | {0x1002, 0x959B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV635|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | 354 | {0x1002, 0x959B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV635|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ |
348 | {0x1002, 0x95C0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \ | 355 | {0x1002, 0x95C0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \ |
356 | {0x1002, 0x95C2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
357 | {0x1002, 0x95C4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
349 | {0x1002, 0x95C5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \ | 358 | {0x1002, 0x95C5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \ |
350 | {0x1002, 0x95C6, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \ | 359 | {0x1002, 0x95C6, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \ |
351 | {0x1002, 0x95C7, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \ | 360 | {0x1002, 0x95C7, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \ |
352 | {0x1002, 0x95C9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \ | 361 | {0x1002, 0x95C9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \ |
353 | {0x1002, 0x95C2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
354 | {0x1002, 0x95C4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
355 | {0x1002, 0x95CC, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \ | 362 | {0x1002, 0x95CC, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \ |
356 | {0x1002, 0x95CD, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \ | 363 | {0x1002, 0x95CD, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \ |
357 | {0x1002, 0x95CE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \ | 364 | {0x1002, 0x95CE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV620|RADEON_NEW_MEMMAP}, \ |
@@ -363,6 +370,11 @@ | |||
363 | {0x1002, 0x9614, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | 370 | {0x1002, 0x9614, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ |
364 | {0x1002, 0x9615, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | 371 | {0x1002, 0x9615, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ |
365 | {0x1002, 0x9616, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | 372 | {0x1002, 0x9616, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ |
373 | {0x1002, 0x9710, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | ||
374 | {0x1002, 0x9711, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | ||
375 | {0x1002, 0x9712, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | ||
376 | {0x1002, 0x9713, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | ||
377 | {0x1002, 0x9714, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | ||
366 | {0, 0, 0} | 378 | {0, 0, 0} |
367 | 379 | ||
368 | #define r128_PCI_IDS \ | 380 | #define r128_PCI_IDS \ |
diff --git a/include/drm/radeon_drm.h b/include/drm/radeon_drm.h index 41862e9a4c20..2ba61e18fc8b 100644 --- a/include/drm/radeon_drm.h +++ b/include/drm/radeon_drm.h | |||
@@ -506,6 +506,9 @@ typedef struct { | |||
506 | #define DRM_RADEON_GEM_WAIT_IDLE 0x24 | 506 | #define DRM_RADEON_GEM_WAIT_IDLE 0x24 |
507 | #define DRM_RADEON_CS 0x26 | 507 | #define DRM_RADEON_CS 0x26 |
508 | #define DRM_RADEON_INFO 0x27 | 508 | #define DRM_RADEON_INFO 0x27 |
509 | #define DRM_RADEON_GEM_SET_TILING 0x28 | ||
510 | #define DRM_RADEON_GEM_GET_TILING 0x29 | ||
511 | #define DRM_RADEON_GEM_BUSY 0x2a | ||
509 | 512 | ||
510 | #define DRM_IOCTL_RADEON_CP_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CP_INIT, drm_radeon_init_t) | 513 | #define DRM_IOCTL_RADEON_CP_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CP_INIT, drm_radeon_init_t) |
511 | #define DRM_IOCTL_RADEON_CP_START DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_CP_START) | 514 | #define DRM_IOCTL_RADEON_CP_START DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_CP_START) |
@@ -544,7 +547,9 @@ typedef struct { | |||
544 | #define DRM_IOCTL_RADEON_GEM_WAIT_IDLE DRM_IOW(DRM_COMMAND_BASE + DRM_RADEON_GEM_WAIT_IDLE, struct drm_radeon_gem_wait_idle) | 547 | #define DRM_IOCTL_RADEON_GEM_WAIT_IDLE DRM_IOW(DRM_COMMAND_BASE + DRM_RADEON_GEM_WAIT_IDLE, struct drm_radeon_gem_wait_idle) |
545 | #define DRM_IOCTL_RADEON_CS DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_CS, struct drm_radeon_cs) | 548 | #define DRM_IOCTL_RADEON_CS DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_CS, struct drm_radeon_cs) |
546 | #define DRM_IOCTL_RADEON_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_INFO, struct drm_radeon_info) | 549 | #define DRM_IOCTL_RADEON_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_INFO, struct drm_radeon_info) |
547 | 550 | #define DRM_IOCTL_RADEON_SET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_SET_TILING, struct drm_radeon_gem_set_tiling) | |
551 | #define DRM_IOCTL_RADEON_GET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_GET_TILING, struct drm_radeon_gem_get_tiling) | ||
552 | #define DRM_IOCTL_RADEON_GEM_BUSY DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_BUSY, struct drm_radeon_gem_busy) | ||
548 | 553 | ||
549 | typedef struct drm_radeon_init { | 554 | typedef struct drm_radeon_init { |
550 | enum { | 555 | enum { |
@@ -704,6 +709,7 @@ typedef struct drm_radeon_indirect { | |||
704 | #define RADEON_PARAM_FB_LOCATION 14 /* FB location */ | 709 | #define RADEON_PARAM_FB_LOCATION 14 /* FB location */ |
705 | #define RADEON_PARAM_NUM_GB_PIPES 15 /* num GB pipes */ | 710 | #define RADEON_PARAM_NUM_GB_PIPES 15 /* num GB pipes */ |
706 | #define RADEON_PARAM_DEVICE_ID 16 | 711 | #define RADEON_PARAM_DEVICE_ID 16 |
712 | #define RADEON_PARAM_NUM_Z_PIPES 17 /* num Z pipes */ | ||
707 | 713 | ||
708 | typedef struct drm_radeon_getparam { | 714 | typedef struct drm_radeon_getparam { |
709 | int param; | 715 | int param; |
@@ -796,6 +802,24 @@ struct drm_radeon_gem_create { | |||
796 | uint32_t flags; | 802 | uint32_t flags; |
797 | }; | 803 | }; |
798 | 804 | ||
805 | #define RADEON_TILING_MACRO 0x1 | ||
806 | #define RADEON_TILING_MICRO 0x2 | ||
807 | #define RADEON_TILING_SWAP 0x4 | ||
808 | #define RADEON_TILING_SURFACE 0x8 /* this object requires a surface | ||
809 | * when mapped - i.e. front buffer */ | ||
810 | |||
811 | struct drm_radeon_gem_set_tiling { | ||
812 | uint32_t handle; | ||
813 | uint32_t tiling_flags; | ||
814 | uint32_t pitch; | ||
815 | }; | ||
816 | |||
817 | struct drm_radeon_gem_get_tiling { | ||
818 | uint32_t handle; | ||
819 | uint32_t tiling_flags; | ||
820 | uint32_t pitch; | ||
821 | }; | ||
822 | |||
799 | struct drm_radeon_gem_mmap { | 823 | struct drm_radeon_gem_mmap { |
800 | uint32_t handle; | 824 | uint32_t handle; |
801 | uint32_t pad; | 825 | uint32_t pad; |
@@ -817,7 +841,7 @@ struct drm_radeon_gem_wait_idle { | |||
817 | 841 | ||
818 | struct drm_radeon_gem_busy { | 842 | struct drm_radeon_gem_busy { |
819 | uint32_t handle; | 843 | uint32_t handle; |
820 | uint32_t busy; | 844 | uint32_t domain; |
821 | }; | 845 | }; |
822 | 846 | ||
823 | struct drm_radeon_gem_pread { | 847 | struct drm_radeon_gem_pread { |
@@ -874,6 +898,7 @@ struct drm_radeon_cs { | |||
874 | 898 | ||
875 | #define RADEON_INFO_DEVICE_ID 0x00 | 899 | #define RADEON_INFO_DEVICE_ID 0x00 |
876 | #define RADEON_INFO_NUM_GB_PIPES 0x01 | 900 | #define RADEON_INFO_NUM_GB_PIPES 0x01 |
901 | #define RADEON_INFO_NUM_Z_PIPES 0x02 | ||
877 | 902 | ||
878 | struct drm_radeon_info { | 903 | struct drm_radeon_info { |
879 | uint32_t request; | 904 | uint32_t request; |
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index 62ed733c52a2..a68829db381a 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h | |||
@@ -121,6 +121,7 @@ struct ttm_backend { | |||
121 | #define TTM_PAGE_FLAG_SWAPPED (1 << 4) | 121 | #define TTM_PAGE_FLAG_SWAPPED (1 << 4) |
122 | #define TTM_PAGE_FLAG_PERSISTANT_SWAP (1 << 5) | 122 | #define TTM_PAGE_FLAG_PERSISTANT_SWAP (1 << 5) |
123 | #define TTM_PAGE_FLAG_ZERO_ALLOC (1 << 6) | 123 | #define TTM_PAGE_FLAG_ZERO_ALLOC (1 << 6) |
124 | #define TTM_PAGE_FLAG_DMA32 (1 << 7) | ||
124 | 125 | ||
125 | enum ttm_caching_state { | 126 | enum ttm_caching_state { |
126 | tt_uncached, | 127 | tt_uncached, |
@@ -353,6 +354,14 @@ struct ttm_bo_driver { | |||
353 | int (*sync_obj_flush) (void *sync_obj, void *sync_arg); | 354 | int (*sync_obj_flush) (void *sync_obj, void *sync_arg); |
354 | void (*sync_obj_unref) (void **sync_obj); | 355 | void (*sync_obj_unref) (void **sync_obj); |
355 | void *(*sync_obj_ref) (void *sync_obj); | 356 | void *(*sync_obj_ref) (void *sync_obj); |
357 | |||
358 | /* hook to notify driver about a driver move so it | ||
359 | * can do tiling things */ | ||
360 | void (*move_notify)(struct ttm_buffer_object *bo, | ||
361 | struct ttm_mem_reg *new_mem); | ||
362 | /* notify the driver we are taking a fault on this BO | ||
363 | * and have reserved it */ | ||
364 | void (*fault_reserve_notify)(struct ttm_buffer_object *bo); | ||
356 | }; | 365 | }; |
357 | 366 | ||
358 | #define TTM_NUM_MEM_TYPES 8 | 367 | #define TTM_NUM_MEM_TYPES 8 |
@@ -429,6 +438,8 @@ struct ttm_bo_device { | |||
429 | */ | 438 | */ |
430 | 439 | ||
431 | struct delayed_work wq; | 440 | struct delayed_work wq; |
441 | |||
442 | bool need_dma32; | ||
432 | }; | 443 | }; |
433 | 444 | ||
434 | /** | 445 | /** |
@@ -648,7 +659,14 @@ extern int ttm_bo_device_release(struct ttm_bo_device *bdev); | |||
648 | extern int ttm_bo_device_init(struct ttm_bo_device *bdev, | 659 | extern int ttm_bo_device_init(struct ttm_bo_device *bdev, |
649 | struct ttm_mem_global *mem_glob, | 660 | struct ttm_mem_global *mem_glob, |
650 | struct ttm_bo_driver *driver, | 661 | struct ttm_bo_driver *driver, |
651 | uint64_t file_page_offset); | 662 | uint64_t file_page_offset, bool need_dma32); |
663 | |||
664 | /** | ||
665 | * ttm_bo_unmap_virtual | ||
666 | * | ||
667 | * @bo: tear down the virtual mappings for this BO | ||
668 | */ | ||
669 | extern void ttm_bo_unmap_virtual(struct ttm_buffer_object *bo); | ||
652 | 670 | ||
653 | /** | 671 | /** |
654 | * ttm_bo_reserve: | 672 | * ttm_bo_reserve: |
diff --git a/include/drm/ttm/ttm_module.h b/include/drm/ttm/ttm_module.h index 889a4c7958ae..d1d433834e4f 100644 --- a/include/drm/ttm/ttm_module.h +++ b/include/drm/ttm/ttm_module.h | |||
@@ -33,7 +33,7 @@ | |||
33 | 33 | ||
34 | #include <linux/kernel.h> | 34 | #include <linux/kernel.h> |
35 | 35 | ||
36 | #define TTM_PFX "[TTM]" | 36 | #define TTM_PFX "[TTM] " |
37 | 37 | ||
38 | enum ttm_global_types { | 38 | enum ttm_global_types { |
39 | TTM_GLOBAL_TTM_MEM = 0, | 39 | TTM_GLOBAL_TTM_MEM = 0, |
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index a2df7030d49d..334a3593cdfd 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -57,6 +57,7 @@ header-y += dlmconstants.h | |||
57 | header-y += dlm_device.h | 57 | header-y += dlm_device.h |
58 | header-y += dlm_netlink.h | 58 | header-y += dlm_netlink.h |
59 | header-y += dm-ioctl.h | 59 | header-y += dm-ioctl.h |
60 | header-y += dm-log-userspace.h | ||
60 | header-y += dn.h | 61 | header-y += dn.h |
61 | header-y += dqblk_xfs.h | 62 | header-y += dqblk_xfs.h |
62 | header-y += efs_fs_sb.h | 63 | header-y += efs_fs_sb.h |
@@ -308,6 +309,7 @@ unifdef-y += pmu.h | |||
308 | unifdef-y += poll.h | 309 | unifdef-y += poll.h |
309 | unifdef-y += ppp_defs.h | 310 | unifdef-y += ppp_defs.h |
310 | unifdef-y += ppp-comp.h | 311 | unifdef-y += ppp-comp.h |
312 | unifdef-y += pps.h | ||
311 | unifdef-y += ptrace.h | 313 | unifdef-y += ptrace.h |
312 | unifdef-y += quota.h | 314 | unifdef-y += quota.h |
313 | unifdef-y += random.h | 315 | unifdef-y += random.h |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 51b4b0a5ce8c..34321cfffeab 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -113,9 +113,6 @@ void acpi_irq_stats_init(void); | |||
113 | extern u32 acpi_irq_handled; | 113 | extern u32 acpi_irq_handled; |
114 | extern u32 acpi_irq_not_handled; | 114 | extern u32 acpi_irq_not_handled; |
115 | 115 | ||
116 | extern struct acpi_mcfg_allocation *pci_mmcfg_config; | ||
117 | extern int pci_mmcfg_config_num; | ||
118 | |||
119 | extern int sbf_port; | 116 | extern int sbf_port; |
120 | extern unsigned long acpi_realmode_flags; | 117 | extern unsigned long acpi_realmode_flags; |
121 | 118 | ||
@@ -293,7 +290,10 @@ void __init acpi_s4_no_nvs(void); | |||
293 | OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL) | 290 | OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL) |
294 | 291 | ||
295 | extern acpi_status acpi_pci_osc_control_set(acpi_handle handle, u32 flags); | 292 | extern acpi_status acpi_pci_osc_control_set(acpi_handle handle, u32 flags); |
293 | extern void acpi_early_init(void); | ||
294 | |||
296 | #else /* CONFIG_ACPI */ | 295 | #else /* CONFIG_ACPI */ |
296 | static inline void acpi_early_init(void) { } | ||
297 | 297 | ||
298 | static inline int early_acpi_boot_init(void) | 298 | static inline int early_acpi_boot_init(void) |
299 | { | 299 | { |
diff --git a/include/linux/agp_backend.h b/include/linux/agp_backend.h index 2b8df8b420fd..76fa794fdac0 100644 --- a/include/linux/agp_backend.h +++ b/include/linux/agp_backend.h | |||
@@ -70,7 +70,7 @@ struct agp_memory { | |||
70 | struct agp_memory *next; | 70 | struct agp_memory *next; |
71 | struct agp_memory *prev; | 71 | struct agp_memory *prev; |
72 | struct agp_bridge_data *bridge; | 72 | struct agp_bridge_data *bridge; |
73 | unsigned long *memory; | 73 | struct page **pages; |
74 | size_t page_count; | 74 | size_t page_count; |
75 | int key; | 75 | int key; |
76 | int num_scratch_pages; | 76 | int num_scratch_pages; |
diff --git a/include/linux/aio.h b/include/linux/aio.h index b16a957030f8..47f7d932a01d 100644 --- a/include/linux/aio.h +++ b/include/linux/aio.h | |||
@@ -121,9 +121,9 @@ struct kiocb { | |||
121 | 121 | ||
122 | /* | 122 | /* |
123 | * If the aio_resfd field of the userspace iocb is not zero, | 123 | * If the aio_resfd field of the userspace iocb is not zero, |
124 | * this is the underlying file* to deliver event to. | 124 | * this is the underlying eventfd context to deliver events to. |
125 | */ | 125 | */ |
126 | struct file *ki_eventfd; | 126 | struct eventfd_ctx *ki_eventfd; |
127 | }; | 127 | }; |
128 | 128 | ||
129 | #define is_sync_kiocb(iocb) ((iocb)->ki_key == KIOCB_SYNC_KEY) | 129 | #define is_sync_kiocb(iocb) ((iocb)->ki_key == KIOCB_SYNC_KEY) |
diff --git a/include/linux/amba/pl061.h b/include/linux/amba/pl061.h new file mode 100644 index 000000000000..b4fbd9862606 --- /dev/null +++ b/include/linux/amba/pl061.h | |||
@@ -0,0 +1,15 @@ | |||
1 | /* platform data for the PL061 GPIO driver */ | ||
2 | |||
3 | struct pl061_platform_data { | ||
4 | /* number of the first GPIO */ | ||
5 | unsigned gpio_base; | ||
6 | |||
7 | /* number of the first IRQ. | ||
8 | * If the IRQ functionality in not desired this must be set to | ||
9 | * (unsigned) -1. | ||
10 | */ | ||
11 | unsigned irq_base; | ||
12 | |||
13 | u8 directions; /* startup directions, 1: out, 0: in */ | ||
14 | u8 values; /* startup values */ | ||
15 | }; | ||
diff --git a/include/linux/ata.h b/include/linux/ata.h index 915da43edee1..9c75921f0c16 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
@@ -800,6 +800,20 @@ static inline int ata_id_is_ssd(const u16 *id) | |||
800 | return id[ATA_ID_ROT_SPEED] == 0x01; | 800 | return id[ATA_ID_ROT_SPEED] == 0x01; |
801 | } | 801 | } |
802 | 802 | ||
803 | static inline int ata_id_pio_need_iordy(const u16 *id, const u8 pio) | ||
804 | { | ||
805 | /* CF spec. r4.1 Table 22 says no IORDY on PIO5 and PIO6. */ | ||
806 | if (pio > 4 && ata_id_is_cfa(id)) | ||
807 | return 0; | ||
808 | /* For PIO3 and higher it is mandatory. */ | ||
809 | if (pio > 2) | ||
810 | return 1; | ||
811 | /* Turn it on when possible. */ | ||
812 | if (ata_id_has_iordy(id)) | ||
813 | return 1; | ||
814 | return 0; | ||
815 | } | ||
816 | |||
803 | static inline int ata_drive_40wire(const u16 *dev_id) | 817 | static inline int ata_drive_40wire(const u16 *dev_id) |
804 | { | 818 | { |
805 | if (ata_id_is_sata(dev_id)) | 819 | if (ata_id_is_sata(dev_id)) |
diff --git a/include/linux/audit.h b/include/linux/audit.h index 4fa2810b675e..3c7a358241a7 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
@@ -599,6 +599,8 @@ extern void audit_log_untrustedstring(struct audit_buffer *ab, | |||
599 | extern void audit_log_d_path(struct audit_buffer *ab, | 599 | extern void audit_log_d_path(struct audit_buffer *ab, |
600 | const char *prefix, | 600 | const char *prefix, |
601 | struct path *path); | 601 | struct path *path); |
602 | extern void audit_log_key(struct audit_buffer *ab, | ||
603 | char *key); | ||
602 | extern void audit_log_lost(const char *message); | 604 | extern void audit_log_lost(const char *message); |
603 | extern int audit_update_lsm_rules(void); | 605 | extern int audit_update_lsm_rules(void); |
604 | 606 | ||
@@ -621,6 +623,7 @@ extern int audit_enabled; | |||
621 | #define audit_log_n_untrustedstring(a,n,s) do { ; } while (0) | 623 | #define audit_log_n_untrustedstring(a,n,s) do { ; } while (0) |
622 | #define audit_log_untrustedstring(a,s) do { ; } while (0) | 624 | #define audit_log_untrustedstring(a,s) do { ; } while (0) |
623 | #define audit_log_d_path(b, p, d) do { ; } while (0) | 625 | #define audit_log_d_path(b, p, d) do { ; } while (0) |
626 | #define audit_log_key(b, k) do { ; } while (0) | ||
624 | #define audit_enabled 0 | 627 | #define audit_enabled 0 |
625 | #endif | 628 | #endif |
626 | #endif | 629 | #endif |
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h index 0ec2c594868e..f169bcb90b58 100644 --- a/include/linux/backing-dev.h +++ b/include/linux/backing-dev.h | |||
@@ -13,6 +13,8 @@ | |||
13 | #include <linux/proportions.h> | 13 | #include <linux/proportions.h> |
14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
15 | #include <linux/fs.h> | 15 | #include <linux/fs.h> |
16 | #include <linux/sched.h> | ||
17 | #include <linux/writeback.h> | ||
16 | #include <asm/atomic.h> | 18 | #include <asm/atomic.h> |
17 | 19 | ||
18 | struct page; | 20 | struct page; |
@@ -23,9 +25,11 @@ struct dentry; | |||
23 | * Bits in backing_dev_info.state | 25 | * Bits in backing_dev_info.state |
24 | */ | 26 | */ |
25 | enum bdi_state { | 27 | enum bdi_state { |
26 | BDI_pdflush, /* A pdflush thread is working this device */ | 28 | BDI_pending, /* On its way to being activated */ |
29 | BDI_wb_alloc, /* Default embedded wb allocated */ | ||
27 | BDI_async_congested, /* The async (write) queue is getting full */ | 30 | BDI_async_congested, /* The async (write) queue is getting full */ |
28 | BDI_sync_congested, /* The sync queue is getting full */ | 31 | BDI_sync_congested, /* The sync queue is getting full */ |
32 | BDI_registered, /* bdi_register() was done */ | ||
29 | BDI_unused, /* Available bits start here */ | 33 | BDI_unused, /* Available bits start here */ |
30 | }; | 34 | }; |
31 | 35 | ||
@@ -39,7 +43,22 @@ enum bdi_stat_item { | |||
39 | 43 | ||
40 | #define BDI_STAT_BATCH (8*(1+ilog2(nr_cpu_ids))) | 44 | #define BDI_STAT_BATCH (8*(1+ilog2(nr_cpu_ids))) |
41 | 45 | ||
46 | struct bdi_writeback { | ||
47 | struct list_head list; /* hangs off the bdi */ | ||
48 | |||
49 | struct backing_dev_info *bdi; /* our parent bdi */ | ||
50 | unsigned int nr; | ||
51 | |||
52 | unsigned long last_old_flush; /* last old data flush */ | ||
53 | |||
54 | struct task_struct *task; /* writeback task */ | ||
55 | struct list_head b_dirty; /* dirty inodes */ | ||
56 | struct list_head b_io; /* parked for writeback */ | ||
57 | struct list_head b_more_io; /* parked for more writeback */ | ||
58 | }; | ||
59 | |||
42 | struct backing_dev_info { | 60 | struct backing_dev_info { |
61 | struct list_head bdi_list; | ||
43 | unsigned long ra_pages; /* max readahead in PAGE_CACHE_SIZE units */ | 62 | unsigned long ra_pages; /* max readahead in PAGE_CACHE_SIZE units */ |
44 | unsigned long state; /* Always use atomic bitops on this */ | 63 | unsigned long state; /* Always use atomic bitops on this */ |
45 | unsigned int capabilities; /* Device capabilities */ | 64 | unsigned int capabilities; /* Device capabilities */ |
@@ -48,6 +67,8 @@ struct backing_dev_info { | |||
48 | void (*unplug_io_fn)(struct backing_dev_info *, struct page *); | 67 | void (*unplug_io_fn)(struct backing_dev_info *, struct page *); |
49 | void *unplug_io_data; | 68 | void *unplug_io_data; |
50 | 69 | ||
70 | char *name; | ||
71 | |||
51 | struct percpu_counter bdi_stat[NR_BDI_STAT_ITEMS]; | 72 | struct percpu_counter bdi_stat[NR_BDI_STAT_ITEMS]; |
52 | 73 | ||
53 | struct prop_local_percpu completions; | 74 | struct prop_local_percpu completions; |
@@ -56,6 +77,14 @@ struct backing_dev_info { | |||
56 | unsigned int min_ratio; | 77 | unsigned int min_ratio; |
57 | unsigned int max_ratio, max_prop_frac; | 78 | unsigned int max_ratio, max_prop_frac; |
58 | 79 | ||
80 | struct bdi_writeback wb; /* default writeback info for this bdi */ | ||
81 | spinlock_t wb_lock; /* protects update side of wb_list */ | ||
82 | struct list_head wb_list; /* the flusher threads hanging off this bdi */ | ||
83 | unsigned long wb_mask; /* bitmask of registered tasks */ | ||
84 | unsigned int wb_cnt; /* number of registered tasks */ | ||
85 | |||
86 | struct list_head work_list; | ||
87 | |||
59 | struct device *dev; | 88 | struct device *dev; |
60 | 89 | ||
61 | #ifdef CONFIG_DEBUG_FS | 90 | #ifdef CONFIG_DEBUG_FS |
@@ -71,6 +100,19 @@ int bdi_register(struct backing_dev_info *bdi, struct device *parent, | |||
71 | const char *fmt, ...); | 100 | const char *fmt, ...); |
72 | int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev); | 101 | int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev); |
73 | void bdi_unregister(struct backing_dev_info *bdi); | 102 | void bdi_unregister(struct backing_dev_info *bdi); |
103 | void bdi_start_writeback(struct writeback_control *wbc); | ||
104 | int bdi_writeback_task(struct bdi_writeback *wb); | ||
105 | int bdi_has_dirty_io(struct backing_dev_info *bdi); | ||
106 | |||
107 | extern spinlock_t bdi_lock; | ||
108 | extern struct list_head bdi_list; | ||
109 | |||
110 | static inline int wb_has_dirty_io(struct bdi_writeback *wb) | ||
111 | { | ||
112 | return !list_empty(&wb->b_dirty) || | ||
113 | !list_empty(&wb->b_io) || | ||
114 | !list_empty(&wb->b_more_io); | ||
115 | } | ||
74 | 116 | ||
75 | static inline void __add_bdi_stat(struct backing_dev_info *bdi, | 117 | static inline void __add_bdi_stat(struct backing_dev_info *bdi, |
76 | enum bdi_stat_item item, s64 amount) | 118 | enum bdi_stat_item item, s64 amount) |
@@ -229,9 +271,14 @@ static inline int bdi_rw_congested(struct backing_dev_info *bdi) | |||
229 | (1 << BDI_async_congested)); | 271 | (1 << BDI_async_congested)); |
230 | } | 272 | } |
231 | 273 | ||
232 | void clear_bdi_congested(struct backing_dev_info *bdi, int rw); | 274 | enum { |
233 | void set_bdi_congested(struct backing_dev_info *bdi, int rw); | 275 | BLK_RW_ASYNC = 0, |
234 | long congestion_wait(int rw, long timeout); | 276 | BLK_RW_SYNC = 1, |
277 | }; | ||
278 | |||
279 | void clear_bdi_congested(struct backing_dev_info *bdi, int sync); | ||
280 | void set_bdi_congested(struct backing_dev_info *bdi, int sync); | ||
281 | long congestion_wait(int sync, long timeout); | ||
235 | 282 | ||
236 | 283 | ||
237 | static inline bool bdi_cap_writeback_dirty(struct backing_dev_info *bdi) | 284 | static inline bool bdi_cap_writeback_dirty(struct backing_dev_info *bdi) |
@@ -256,6 +303,11 @@ static inline bool bdi_cap_swap_backed(struct backing_dev_info *bdi) | |||
256 | return bdi->capabilities & BDI_CAP_SWAP_BACKED; | 303 | return bdi->capabilities & BDI_CAP_SWAP_BACKED; |
257 | } | 304 | } |
258 | 305 | ||
306 | static inline bool bdi_cap_flush_forker(struct backing_dev_info *bdi) | ||
307 | { | ||
308 | return bdi == &default_backing_dev_info; | ||
309 | } | ||
310 | |||
259 | static inline bool mapping_cap_writeback_dirty(struct address_space *mapping) | 311 | static inline bool mapping_cap_writeback_dirty(struct address_space *mapping) |
260 | { | 312 | { |
261 | return bdi_cap_writeback_dirty(mapping->backing_dev_info); | 313 | return bdi_cap_writeback_dirty(mapping->backing_dev_info); |
@@ -271,4 +323,10 @@ static inline bool mapping_cap_swap_backed(struct address_space *mapping) | |||
271 | return bdi_cap_swap_backed(mapping->backing_dev_info); | 323 | return bdi_cap_swap_backed(mapping->backing_dev_info); |
272 | } | 324 | } |
273 | 325 | ||
326 | static inline int bdi_sched_wait(void *word) | ||
327 | { | ||
328 | schedule(); | ||
329 | return 0; | ||
330 | } | ||
331 | |||
274 | #endif /* _LINUX_BACKING_DEV_H */ | 332 | #endif /* _LINUX_BACKING_DEV_H */ |
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h index 61ee18c1bdb4..2046b5b8af48 100644 --- a/include/linux/binfmts.h +++ b/include/linux/binfmts.h | |||
@@ -117,6 +117,7 @@ extern int setup_arg_pages(struct linux_binprm * bprm, | |||
117 | int executable_stack); | 117 | int executable_stack); |
118 | extern int bprm_mm_init(struct linux_binprm *bprm); | 118 | extern int bprm_mm_init(struct linux_binprm *bprm); |
119 | extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm); | 119 | extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm); |
120 | extern int prepare_bprm_creds(struct linux_binprm *bprm); | ||
120 | extern void install_exec_creds(struct linux_binprm *bprm); | 121 | extern void install_exec_creds(struct linux_binprm *bprm); |
121 | extern void do_coredump(long signr, int exit_code, struct pt_regs *regs); | 122 | extern void do_coredump(long signr, int exit_code, struct pt_regs *regs); |
122 | extern int set_binfmt(struct linux_binfmt *new); | 123 | extern int set_binfmt(struct linux_binfmt *new); |
diff --git a/include/linux/bio.h b/include/linux/bio.h index 2a04eb54c0dd..2892b710771c 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
@@ -319,7 +319,6 @@ static inline int bio_has_allocated_vec(struct bio *bio) | |||
319 | */ | 319 | */ |
320 | struct bio_integrity_payload { | 320 | struct bio_integrity_payload { |
321 | struct bio *bip_bio; /* parent bio */ | 321 | struct bio *bip_bio; /* parent bio */ |
322 | struct bio_vec *bip_vec; /* integrity data vector */ | ||
323 | 322 | ||
324 | sector_t bip_sector; /* virtual start sector */ | 323 | sector_t bip_sector; /* virtual start sector */ |
325 | 324 | ||
@@ -328,11 +327,12 @@ struct bio_integrity_payload { | |||
328 | 327 | ||
329 | unsigned int bip_size; | 328 | unsigned int bip_size; |
330 | 329 | ||
331 | unsigned short bip_pool; /* pool the ivec came from */ | 330 | unsigned short bip_slab; /* slab the bip came from */ |
332 | unsigned short bip_vcnt; /* # of integrity bio_vecs */ | 331 | unsigned short bip_vcnt; /* # of integrity bio_vecs */ |
333 | unsigned short bip_idx; /* current bip_vec index */ | 332 | unsigned short bip_idx; /* current bip_vec index */ |
334 | 333 | ||
335 | struct work_struct bip_work; /* I/O completion */ | 334 | struct work_struct bip_work; /* I/O completion */ |
335 | struct bio_vec bip_vec[0]; /* embedded bvec array */ | ||
336 | }; | 336 | }; |
337 | #endif /* CONFIG_BLK_DEV_INTEGRITY */ | 337 | #endif /* CONFIG_BLK_DEV_INTEGRITY */ |
338 | 338 | ||
@@ -430,6 +430,9 @@ struct bio_set { | |||
430 | unsigned int front_pad; | 430 | unsigned int front_pad; |
431 | 431 | ||
432 | mempool_t *bio_pool; | 432 | mempool_t *bio_pool; |
433 | #if defined(CONFIG_BLK_DEV_INTEGRITY) | ||
434 | mempool_t *bio_integrity_pool; | ||
435 | #endif | ||
433 | mempool_t *bvec_pool; | 436 | mempool_t *bvec_pool; |
434 | }; | 437 | }; |
435 | 438 | ||
@@ -634,8 +637,9 @@ static inline struct bio *bio_list_get(struct bio_list *bl) | |||
634 | 637 | ||
635 | #define bio_integrity(bio) (bio->bi_integrity != NULL) | 638 | #define bio_integrity(bio) (bio->bi_integrity != NULL) |
636 | 639 | ||
640 | extern struct bio_integrity_payload *bio_integrity_alloc_bioset(struct bio *, gfp_t, unsigned int, struct bio_set *); | ||
637 | extern struct bio_integrity_payload *bio_integrity_alloc(struct bio *, gfp_t, unsigned int); | 641 | extern struct bio_integrity_payload *bio_integrity_alloc(struct bio *, gfp_t, unsigned int); |
638 | extern void bio_integrity_free(struct bio *); | 642 | extern void bio_integrity_free(struct bio *, struct bio_set *); |
639 | extern int bio_integrity_add_page(struct bio *, struct page *, unsigned int, unsigned int); | 643 | extern int bio_integrity_add_page(struct bio *, struct page *, unsigned int, unsigned int); |
640 | extern int bio_integrity_enabled(struct bio *bio); | 644 | extern int bio_integrity_enabled(struct bio *bio); |
641 | extern int bio_integrity_set_tag(struct bio *, void *, unsigned int); | 645 | extern int bio_integrity_set_tag(struct bio *, void *, unsigned int); |
@@ -645,21 +649,27 @@ extern void bio_integrity_endio(struct bio *, int); | |||
645 | extern void bio_integrity_advance(struct bio *, unsigned int); | 649 | extern void bio_integrity_advance(struct bio *, unsigned int); |
646 | extern void bio_integrity_trim(struct bio *, unsigned int, unsigned int); | 650 | extern void bio_integrity_trim(struct bio *, unsigned int, unsigned int); |
647 | extern void bio_integrity_split(struct bio *, struct bio_pair *, int); | 651 | extern void bio_integrity_split(struct bio *, struct bio_pair *, int); |
648 | extern int bio_integrity_clone(struct bio *, struct bio *, gfp_t); | 652 | extern int bio_integrity_clone(struct bio *, struct bio *, gfp_t, struct bio_set *); |
653 | extern int bioset_integrity_create(struct bio_set *, int); | ||
654 | extern void bioset_integrity_free(struct bio_set *); | ||
655 | extern void bio_integrity_init(void); | ||
649 | 656 | ||
650 | #else /* CONFIG_BLK_DEV_INTEGRITY */ | 657 | #else /* CONFIG_BLK_DEV_INTEGRITY */ |
651 | 658 | ||
652 | #define bio_integrity(a) (0) | 659 | #define bio_integrity(a) (0) |
660 | #define bioset_integrity_create(a, b) (0) | ||
653 | #define bio_integrity_prep(a) (0) | 661 | #define bio_integrity_prep(a) (0) |
654 | #define bio_integrity_enabled(a) (0) | 662 | #define bio_integrity_enabled(a) (0) |
655 | #define bio_integrity_clone(a, b, c) (0) | 663 | #define bio_integrity_clone(a, b, c, d) (0) |
656 | #define bio_integrity_free(a) do { } while (0) | 664 | #define bioset_integrity_free(a) do { } while (0) |
665 | #define bio_integrity_free(a, b) do { } while (0) | ||
657 | #define bio_integrity_endio(a, b) do { } while (0) | 666 | #define bio_integrity_endio(a, b) do { } while (0) |
658 | #define bio_integrity_advance(a, b) do { } while (0) | 667 | #define bio_integrity_advance(a, b) do { } while (0) |
659 | #define bio_integrity_trim(a, b, c) do { } while (0) | 668 | #define bio_integrity_trim(a, b, c) do { } while (0) |
660 | #define bio_integrity_split(a, b, c) do { } while (0) | 669 | #define bio_integrity_split(a, b, c) do { } while (0) |
661 | #define bio_integrity_set_tag(a, b, c) do { } while (0) | 670 | #define bio_integrity_set_tag(a, b, c) do { } while (0) |
662 | #define bio_integrity_get_tag(a, b, c) do { } while (0) | 671 | #define bio_integrity_get_tag(a, b, c) do { } while (0) |
672 | #define bio_integrity_init(a) do { } while (0) | ||
663 | 673 | ||
664 | #endif /* CONFIG_BLK_DEV_INTEGRITY */ | 674 | #endif /* CONFIG_BLK_DEV_INTEGRITY */ |
665 | 675 | ||
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h index 2878811c6134..756d78b8c1c5 100644 --- a/include/linux/bitmap.h +++ b/include/linux/bitmap.h | |||
@@ -94,13 +94,13 @@ extern void __bitmap_shift_right(unsigned long *dst, | |||
94 | const unsigned long *src, int shift, int bits); | 94 | const unsigned long *src, int shift, int bits); |
95 | extern void __bitmap_shift_left(unsigned long *dst, | 95 | extern void __bitmap_shift_left(unsigned long *dst, |
96 | const unsigned long *src, int shift, int bits); | 96 | const unsigned long *src, int shift, int bits); |
97 | extern void __bitmap_and(unsigned long *dst, const unsigned long *bitmap1, | 97 | extern int __bitmap_and(unsigned long *dst, const unsigned long *bitmap1, |
98 | const unsigned long *bitmap2, int bits); | 98 | const unsigned long *bitmap2, int bits); |
99 | extern void __bitmap_or(unsigned long *dst, const unsigned long *bitmap1, | 99 | extern void __bitmap_or(unsigned long *dst, const unsigned long *bitmap1, |
100 | const unsigned long *bitmap2, int bits); | 100 | const unsigned long *bitmap2, int bits); |
101 | extern void __bitmap_xor(unsigned long *dst, const unsigned long *bitmap1, | 101 | extern void __bitmap_xor(unsigned long *dst, const unsigned long *bitmap1, |
102 | const unsigned long *bitmap2, int bits); | 102 | const unsigned long *bitmap2, int bits); |
103 | extern void __bitmap_andnot(unsigned long *dst, const unsigned long *bitmap1, | 103 | extern int __bitmap_andnot(unsigned long *dst, const unsigned long *bitmap1, |
104 | const unsigned long *bitmap2, int bits); | 104 | const unsigned long *bitmap2, int bits); |
105 | extern int __bitmap_intersects(const unsigned long *bitmap1, | 105 | extern int __bitmap_intersects(const unsigned long *bitmap1, |
106 | const unsigned long *bitmap2, int bits); | 106 | const unsigned long *bitmap2, int bits); |
@@ -171,13 +171,12 @@ static inline void bitmap_copy(unsigned long *dst, const unsigned long *src, | |||
171 | } | 171 | } |
172 | } | 172 | } |
173 | 173 | ||
174 | static inline void bitmap_and(unsigned long *dst, const unsigned long *src1, | 174 | static inline int bitmap_and(unsigned long *dst, const unsigned long *src1, |
175 | const unsigned long *src2, int nbits) | 175 | const unsigned long *src2, int nbits) |
176 | { | 176 | { |
177 | if (small_const_nbits(nbits)) | 177 | if (small_const_nbits(nbits)) |
178 | *dst = *src1 & *src2; | 178 | return (*dst = *src1 & *src2) != 0; |
179 | else | 179 | return __bitmap_and(dst, src1, src2, nbits); |
180 | __bitmap_and(dst, src1, src2, nbits); | ||
181 | } | 180 | } |
182 | 181 | ||
183 | static inline void bitmap_or(unsigned long *dst, const unsigned long *src1, | 182 | static inline void bitmap_or(unsigned long *dst, const unsigned long *src1, |
@@ -198,13 +197,12 @@ static inline void bitmap_xor(unsigned long *dst, const unsigned long *src1, | |||
198 | __bitmap_xor(dst, src1, src2, nbits); | 197 | __bitmap_xor(dst, src1, src2, nbits); |
199 | } | 198 | } |
200 | 199 | ||
201 | static inline void bitmap_andnot(unsigned long *dst, const unsigned long *src1, | 200 | static inline int bitmap_andnot(unsigned long *dst, const unsigned long *src1, |
202 | const unsigned long *src2, int nbits) | 201 | const unsigned long *src2, int nbits) |
203 | { | 202 | { |
204 | if (small_const_nbits(nbits)) | 203 | if (small_const_nbits(nbits)) |
205 | *dst = *src1 & ~(*src2); | 204 | return (*dst = *src1 & ~(*src2)) != 0; |
206 | else | 205 | return __bitmap_andnot(dst, src1, src2, nbits); |
207 | __bitmap_andnot(dst, src1, src2, nbits); | ||
208 | } | 206 | } |
209 | 207 | ||
210 | static inline void bitmap_complement(unsigned long *dst, const unsigned long *src, | 208 | static inline void bitmap_complement(unsigned long *dst, const unsigned long *src, |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 8963d9149b5f..69103e053c92 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -70,11 +70,6 @@ enum rq_cmd_type_bits { | |||
70 | REQ_TYPE_ATA_PC, | 70 | REQ_TYPE_ATA_PC, |
71 | }; | 71 | }; |
72 | 72 | ||
73 | enum { | ||
74 | BLK_RW_ASYNC = 0, | ||
75 | BLK_RW_SYNC = 1, | ||
76 | }; | ||
77 | |||
78 | /* | 73 | /* |
79 | * For request of type REQ_TYPE_LINUX_BLOCK, rq->cmd[0] is the opcode being | 74 | * For request of type REQ_TYPE_LINUX_BLOCK, rq->cmd[0] is the opcode being |
80 | * sent down (similar to how REQ_TYPE_BLOCK_PC means that ->cmd[] holds a | 75 | * sent down (similar to how REQ_TYPE_BLOCK_PC means that ->cmd[] holds a |
@@ -301,12 +296,6 @@ struct blk_queue_tag { | |||
301 | #define BLK_SCSI_MAX_CMDS (256) | 296 | #define BLK_SCSI_MAX_CMDS (256) |
302 | #define BLK_SCSI_CMD_PER_LONG (BLK_SCSI_MAX_CMDS / (sizeof(long) * 8)) | 297 | #define BLK_SCSI_CMD_PER_LONG (BLK_SCSI_MAX_CMDS / (sizeof(long) * 8)) |
303 | 298 | ||
304 | struct blk_cmd_filter { | ||
305 | unsigned long read_ok[BLK_SCSI_CMD_PER_LONG]; | ||
306 | unsigned long write_ok[BLK_SCSI_CMD_PER_LONG]; | ||
307 | struct kobject kobj; | ||
308 | }; | ||
309 | |||
310 | struct queue_limits { | 299 | struct queue_limits { |
311 | unsigned long bounce_pfn; | 300 | unsigned long bounce_pfn; |
312 | unsigned long seg_boundary_mask; | 301 | unsigned long seg_boundary_mask; |
@@ -445,7 +434,6 @@ struct request_queue | |||
445 | #if defined(CONFIG_BLK_DEV_BSG) | 434 | #if defined(CONFIG_BLK_DEV_BSG) |
446 | struct bsg_class_device bsg_dev; | 435 | struct bsg_class_device bsg_dev; |
447 | #endif | 436 | #endif |
448 | struct blk_cmd_filter cmd_filter; | ||
449 | }; | 437 | }; |
450 | 438 | ||
451 | #define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */ | 439 | #define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */ |
@@ -730,6 +718,7 @@ struct rq_map_data { | |||
730 | int nr_entries; | 718 | int nr_entries; |
731 | unsigned long offset; | 719 | unsigned long offset; |
732 | int null_mapped; | 720 | int null_mapped; |
721 | int from_user; | ||
733 | }; | 722 | }; |
734 | 723 | ||
735 | struct req_iterator { | 724 | struct req_iterator { |
@@ -786,18 +775,18 @@ extern int sg_scsi_ioctl(struct request_queue *, struct gendisk *, fmode_t, | |||
786 | * congested queues, and wake up anyone who was waiting for requests to be | 775 | * congested queues, and wake up anyone who was waiting for requests to be |
787 | * put back. | 776 | * put back. |
788 | */ | 777 | */ |
789 | static inline void blk_clear_queue_congested(struct request_queue *q, int rw) | 778 | static inline void blk_clear_queue_congested(struct request_queue *q, int sync) |
790 | { | 779 | { |
791 | clear_bdi_congested(&q->backing_dev_info, rw); | 780 | clear_bdi_congested(&q->backing_dev_info, sync); |
792 | } | 781 | } |
793 | 782 | ||
794 | /* | 783 | /* |
795 | * A queue has just entered congestion. Flag that in the queue's VM-visible | 784 | * A queue has just entered congestion. Flag that in the queue's VM-visible |
796 | * state flags and increment the global gounter of congested queues. | 785 | * state flags and increment the global gounter of congested queues. |
797 | */ | 786 | */ |
798 | static inline void blk_set_queue_congested(struct request_queue *q, int rw) | 787 | static inline void blk_set_queue_congested(struct request_queue *q, int sync) |
799 | { | 788 | { |
800 | set_bdi_congested(&q->backing_dev_info, rw); | 789 | set_bdi_congested(&q->backing_dev_info, sync); |
801 | } | 790 | } |
802 | 791 | ||
803 | extern void blk_start_queue(struct request_queue *q); | 792 | extern void blk_start_queue(struct request_queue *q); |
@@ -924,6 +913,7 @@ extern void blk_queue_logical_block_size(struct request_queue *, unsigned short) | |||
924 | extern void blk_queue_physical_block_size(struct request_queue *, unsigned short); | 913 | extern void blk_queue_physical_block_size(struct request_queue *, unsigned short); |
925 | extern void blk_queue_alignment_offset(struct request_queue *q, | 914 | extern void blk_queue_alignment_offset(struct request_queue *q, |
926 | unsigned int alignment); | 915 | unsigned int alignment); |
916 | extern void blk_limits_io_min(struct queue_limits *limits, unsigned int min); | ||
927 | extern void blk_queue_io_min(struct request_queue *q, unsigned int min); | 917 | extern void blk_queue_io_min(struct request_queue *q, unsigned int min); |
928 | extern void blk_queue_io_opt(struct request_queue *q, unsigned int opt); | 918 | extern void blk_queue_io_opt(struct request_queue *q, unsigned int opt); |
929 | extern void blk_set_default_limits(struct queue_limits *lim); | 919 | extern void blk_set_default_limits(struct queue_limits *lim); |
@@ -998,13 +988,7 @@ static inline int sb_issue_discard(struct super_block *sb, | |||
998 | return blkdev_issue_discard(sb->s_bdev, block, nr_blocks, GFP_KERNEL); | 988 | return blkdev_issue_discard(sb->s_bdev, block, nr_blocks, GFP_KERNEL); |
999 | } | 989 | } |
1000 | 990 | ||
1001 | /* | 991 | extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm); |
1002 | * command filter functions | ||
1003 | */ | ||
1004 | extern int blk_verify_command(struct blk_cmd_filter *filter, | ||
1005 | unsigned char *cmd, fmode_t has_write_perm); | ||
1006 | extern void blk_unregister_filter(struct gendisk *disk); | ||
1007 | extern void blk_set_cmd_filter_defaults(struct blk_cmd_filter *filter); | ||
1008 | 992 | ||
1009 | #define MAX_PHYS_SEGMENTS 128 | 993 | #define MAX_PHYS_SEGMENTS 128 |
1010 | #define MAX_HW_SEGMENTS 128 | 994 | #define MAX_HW_SEGMENTS 128 |
diff --git a/include/linux/cb710.h b/include/linux/cb710.h index 63bc9a4d2926..8cc10411bab2 100644 --- a/include/linux/cb710.h +++ b/include/linux/cb710.h | |||
@@ -140,29 +140,6 @@ void cb710_dump_regs(struct cb710_chip *chip, unsigned dump); | |||
140 | #include <linux/highmem.h> | 140 | #include <linux/highmem.h> |
141 | #include <linux/scatterlist.h> | 141 | #include <linux/scatterlist.h> |
142 | 142 | ||
143 | /** | ||
144 | * cb710_sg_miter_stop_writing - stop mapping iteration after writing | ||
145 | * @miter: sg mapping iter to be stopped | ||
146 | * | ||
147 | * Description: | ||
148 | * Stops mapping iterator @miter. @miter should have been started | ||
149 | * started using sg_miter_start(). A stopped iteration can be | ||
150 | * resumed by calling sg_miter_next() on it. This is useful when | ||
151 | * resources (kmap) need to be released during iteration. | ||
152 | * | ||
153 | * This is a convenience wrapper that will be optimized out for arches | ||
154 | * that don't need flush_kernel_dcache_page(). | ||
155 | * | ||
156 | * Context: | ||
157 | * IRQ disabled if the SG_MITER_ATOMIC is set. Don't care otherwise. | ||
158 | */ | ||
159 | static inline void cb710_sg_miter_stop_writing(struct sg_mapping_iter *miter) | ||
160 | { | ||
161 | if (miter->page) | ||
162 | flush_kernel_dcache_page(miter->page); | ||
163 | sg_miter_stop(miter); | ||
164 | } | ||
165 | |||
166 | /* | 143 | /* |
167 | * 32-bit PIO mapping sg iterator | 144 | * 32-bit PIO mapping sg iterator |
168 | * | 145 | * |
@@ -171,12 +148,12 @@ static inline void cb710_sg_miter_stop_writing(struct sg_mapping_iter *miter) | |||
171 | * without DMA support). | 148 | * without DMA support). |
172 | * | 149 | * |
173 | * Best-case reading (transfer from device): | 150 | * Best-case reading (transfer from device): |
174 | * sg_miter_start(); | 151 | * sg_miter_start(, SG_MITER_TO_SG); |
175 | * cb710_sg_dwiter_write_from_io(); | 152 | * cb710_sg_dwiter_write_from_io(); |
176 | * cb710_sg_miter_stop_writing(); | 153 | * sg_miter_stop(); |
177 | * | 154 | * |
178 | * Best-case writing (transfer to device): | 155 | * Best-case writing (transfer to device): |
179 | * sg_miter_start(); | 156 | * sg_miter_start(, SG_MITER_FROM_SG); |
180 | * cb710_sg_dwiter_read_to_io(); | 157 | * cb710_sg_dwiter_read_to_io(); |
181 | * sg_miter_stop(); | 158 | * sg_miter_stop(); |
182 | */ | 159 | */ |
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 665fa70e4094..90bba9e62286 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -179,14 +179,11 @@ struct cgroup { | |||
179 | */ | 179 | */ |
180 | struct list_head release_list; | 180 | struct list_head release_list; |
181 | 181 | ||
182 | /* pids_mutex protects the fields below */ | 182 | /* pids_mutex protects pids_list and cached pid arrays. */ |
183 | struct rw_semaphore pids_mutex; | 183 | struct rw_semaphore pids_mutex; |
184 | /* Array of process ids in the cgroup */ | 184 | |
185 | pid_t *tasks_pids; | 185 | /* Linked list of struct cgroup_pids */ |
186 | /* How many files are using the current tasks_pids array */ | 186 | struct list_head pids_list; |
187 | int pids_use_count; | ||
188 | /* Length of the current tasks_pids array */ | ||
189 | int pids_length; | ||
190 | 187 | ||
191 | /* For RCU-protected deletion */ | 188 | /* For RCU-protected deletion */ |
192 | struct rcu_head rcu_head; | 189 | struct rcu_head rcu_head; |
@@ -366,6 +363,23 @@ int cgroup_task_count(const struct cgroup *cgrp); | |||
366 | int cgroup_is_descendant(const struct cgroup *cgrp, struct task_struct *task); | 363 | int cgroup_is_descendant(const struct cgroup *cgrp, struct task_struct *task); |
367 | 364 | ||
368 | /* | 365 | /* |
366 | * When the subsys has to access css and may add permanent refcnt to css, | ||
367 | * it should take care of racy conditions with rmdir(). Following set of | ||
368 | * functions, is for stop/restart rmdir if necessary. | ||
369 | * Because these will call css_get/put, "css" should be alive css. | ||
370 | * | ||
371 | * cgroup_exclude_rmdir(); | ||
372 | * ...do some jobs which may access arbitrary empty cgroup | ||
373 | * cgroup_release_and_wakeup_rmdir(); | ||
374 | * | ||
375 | * When someone removes a cgroup while cgroup_exclude_rmdir() holds it, | ||
376 | * it sleeps and cgroup_release_and_wakeup_rmdir() will wake him up. | ||
377 | */ | ||
378 | |||
379 | void cgroup_exclude_rmdir(struct cgroup_subsys_state *css); | ||
380 | void cgroup_release_and_wakeup_rmdir(struct cgroup_subsys_state *css); | ||
381 | |||
382 | /* | ||
369 | * Control Group subsystem type. | 383 | * Control Group subsystem type. |
370 | * See Documentation/cgroups/cgroups.txt for details | 384 | * See Documentation/cgroups/cgroups.txt for details |
371 | */ | 385 | */ |
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h index 20a100fe2b4f..3a1dbba4d3ae 100644 --- a/include/linux/clockchips.h +++ b/include/linux/clockchips.h | |||
@@ -143,12 +143,3 @@ extern void clockevents_notify(unsigned long reason, void *arg); | |||
143 | #endif | 143 | #endif |
144 | 144 | ||
145 | #endif | 145 | #endif |
146 | |||
147 | #ifdef CONFIG_GENERIC_CLOCKEVENTS | ||
148 | extern ktime_t clockevents_get_next_event(int cpu); | ||
149 | #else | ||
150 | static inline ktime_t clockevents_get_next_event(int cpu) | ||
151 | { | ||
152 | return (ktime_t) { .tv64 = KTIME_MAX }; | ||
153 | } | ||
154 | #endif | ||
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index c56457c8334e..1219be4fb42e 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h | |||
@@ -293,7 +293,12 @@ static inline int clocksource_enable(struct clocksource *cs) | |||
293 | if (cs->enable) | 293 | if (cs->enable) |
294 | ret = cs->enable(cs); | 294 | ret = cs->enable(cs); |
295 | 295 | ||
296 | /* save mult_orig on enable */ | 296 | /* |
297 | * The frequency may have changed while the clocksource | ||
298 | * was disabled. If so the code in ->enable() must update | ||
299 | * the mult value to reflect the new frequency. Make sure | ||
300 | * mult_orig follows this change. | ||
301 | */ | ||
297 | cs->mult_orig = cs->mult; | 302 | cs->mult_orig = cs->mult; |
298 | 303 | ||
299 | return ret; | 304 | return ret; |
@@ -309,6 +314,13 @@ static inline int clocksource_enable(struct clocksource *cs) | |||
309 | */ | 314 | */ |
310 | static inline void clocksource_disable(struct clocksource *cs) | 315 | static inline void clocksource_disable(struct clocksource *cs) |
311 | { | 316 | { |
317 | /* | ||
318 | * Save mult_orig in mult so clocksource_enable() can | ||
319 | * restore the value regardless if ->enable() updates | ||
320 | * the value of mult or not. | ||
321 | */ | ||
322 | cs->mult = cs->mult_orig; | ||
323 | |||
312 | if (cs->disable) | 324 | if (cs->disable) |
313 | cs->disable(cs); | 325 | cs->disable(cs); |
314 | } | 326 | } |
diff --git a/include/linux/compiler-gcc3.h b/include/linux/compiler-gcc3.h index 8005effc04f1..b721129e0469 100644 --- a/include/linux/compiler-gcc3.h +++ b/include/linux/compiler-gcc3.h | |||
@@ -16,6 +16,12 @@ | |||
16 | #define __must_check __attribute__((warn_unused_result)) | 16 | #define __must_check __attribute__((warn_unused_result)) |
17 | #endif | 17 | #endif |
18 | 18 | ||
19 | #ifdef CONFIG_GCOV_KERNEL | ||
20 | # if __GNUC_MINOR__ < 4 | ||
21 | # error "GCOV profiling support for gcc versions below 3.4 not included" | ||
22 | # endif /* __GNUC_MINOR__ */ | ||
23 | #endif /* CONFIG_GCOV_KERNEL */ | ||
24 | |||
19 | /* | 25 | /* |
20 | * A trick to suppress uninitialized variable warning without generating any | 26 | * A trick to suppress uninitialized variable warning without generating any |
21 | * code | 27 | * code |
diff --git a/include/linux/connector.h b/include/linux/connector.h index b9966e64604e..b68d27850d51 100644 --- a/include/linux/connector.h +++ b/include/linux/connector.h | |||
@@ -41,8 +41,10 @@ | |||
41 | #define CN_IDX_BB 0x5 /* BlackBoard, from the TSP GPL sampling framework */ | 41 | #define CN_IDX_BB 0x5 /* BlackBoard, from the TSP GPL sampling framework */ |
42 | #define CN_DST_IDX 0x6 | 42 | #define CN_DST_IDX 0x6 |
43 | #define CN_DST_VAL 0x1 | 43 | #define CN_DST_VAL 0x1 |
44 | #define CN_IDX_DM 0x7 /* Device Mapper */ | ||
45 | #define CN_VAL_DM_USERSPACE_LOG 0x1 | ||
44 | 46 | ||
45 | #define CN_NETLINK_USERS 7 | 47 | #define CN_NETLINK_USERS 8 |
46 | 48 | ||
47 | /* | 49 | /* |
48 | * Maximum connector's message size. | 50 | * Maximum connector's message size. |
diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h index d71f7c0f931b..38fe59dc89ae 100644 --- a/include/linux/console_struct.h +++ b/include/linux/console_struct.h | |||
@@ -89,7 +89,6 @@ struct vc_data { | |||
89 | unsigned int vc_need_wrap : 1; | 89 | unsigned int vc_need_wrap : 1; |
90 | unsigned int vc_can_do_color : 1; | 90 | unsigned int vc_can_do_color : 1; |
91 | unsigned int vc_report_mouse : 2; | 91 | unsigned int vc_report_mouse : 2; |
92 | unsigned int vc_kmalloced : 1; | ||
93 | unsigned char vc_utf : 1; /* Unicode UTF-8 encoding */ | 92 | unsigned char vc_utf : 1; /* Unicode UTF-8 encoding */ |
94 | unsigned char vc_utf_count; | 93 | unsigned char vc_utf_count; |
95 | int vc_utf_char; | 94 | int vc_utf_char; |
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 2643d848df90..4d668e05d458 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h | |||
@@ -69,7 +69,6 @@ static inline void unregister_cpu_notifier(struct notifier_block *nb) | |||
69 | 69 | ||
70 | int cpu_up(unsigned int cpu); | 70 | int cpu_up(unsigned int cpu); |
71 | void notify_cpu_starting(unsigned int cpu); | 71 | void notify_cpu_starting(unsigned int cpu); |
72 | extern void cpu_hotplug_init(void); | ||
73 | extern void cpu_maps_update_begin(void); | 72 | extern void cpu_maps_update_begin(void); |
74 | extern void cpu_maps_update_done(void); | 73 | extern void cpu_maps_update_done(void); |
75 | 74 | ||
@@ -84,10 +83,6 @@ static inline void unregister_cpu_notifier(struct notifier_block *nb) | |||
84 | { | 83 | { |
85 | } | 84 | } |
86 | 85 | ||
87 | static inline void cpu_hotplug_init(void) | ||
88 | { | ||
89 | } | ||
90 | |||
91 | static inline void cpu_maps_update_begin(void) | 86 | static inline void cpu_maps_update_begin(void) |
92 | { | 87 | { |
93 | } | 88 | } |
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index c5ac87ca7bc6..796df12091b7 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
@@ -43,10 +43,10 @@ | |||
43 | * int cpu_isset(cpu, mask) true iff bit 'cpu' set in mask | 43 | * int cpu_isset(cpu, mask) true iff bit 'cpu' set in mask |
44 | * int cpu_test_and_set(cpu, mask) test and set bit 'cpu' in mask | 44 | * int cpu_test_and_set(cpu, mask) test and set bit 'cpu' in mask |
45 | * | 45 | * |
46 | * void cpus_and(dst, src1, src2) dst = src1 & src2 [intersection] | 46 | * int cpus_and(dst, src1, src2) dst = src1 & src2 [intersection] |
47 | * void cpus_or(dst, src1, src2) dst = src1 | src2 [union] | 47 | * void cpus_or(dst, src1, src2) dst = src1 | src2 [union] |
48 | * void cpus_xor(dst, src1, src2) dst = src1 ^ src2 | 48 | * void cpus_xor(dst, src1, src2) dst = src1 ^ src2 |
49 | * void cpus_andnot(dst, src1, src2) dst = src1 & ~src2 | 49 | * int cpus_andnot(dst, src1, src2) dst = src1 & ~src2 |
50 | * void cpus_complement(dst, src) dst = ~src | 50 | * void cpus_complement(dst, src) dst = ~src |
51 | * | 51 | * |
52 | * int cpus_equal(mask1, mask2) Does mask1 == mask2? | 52 | * int cpus_equal(mask1, mask2) Does mask1 == mask2? |
@@ -179,10 +179,10 @@ static inline int __cpu_test_and_set(int cpu, cpumask_t *addr) | |||
179 | } | 179 | } |
180 | 180 | ||
181 | #define cpus_and(dst, src1, src2) __cpus_and(&(dst), &(src1), &(src2), NR_CPUS) | 181 | #define cpus_and(dst, src1, src2) __cpus_and(&(dst), &(src1), &(src2), NR_CPUS) |
182 | static inline void __cpus_and(cpumask_t *dstp, const cpumask_t *src1p, | 182 | static inline int __cpus_and(cpumask_t *dstp, const cpumask_t *src1p, |
183 | const cpumask_t *src2p, int nbits) | 183 | const cpumask_t *src2p, int nbits) |
184 | { | 184 | { |
185 | bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits); | 185 | return bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits); |
186 | } | 186 | } |
187 | 187 | ||
188 | #define cpus_or(dst, src1, src2) __cpus_or(&(dst), &(src1), &(src2), NR_CPUS) | 188 | #define cpus_or(dst, src1, src2) __cpus_or(&(dst), &(src1), &(src2), NR_CPUS) |
@@ -201,10 +201,10 @@ static inline void __cpus_xor(cpumask_t *dstp, const cpumask_t *src1p, | |||
201 | 201 | ||
202 | #define cpus_andnot(dst, src1, src2) \ | 202 | #define cpus_andnot(dst, src1, src2) \ |
203 | __cpus_andnot(&(dst), &(src1), &(src2), NR_CPUS) | 203 | __cpus_andnot(&(dst), &(src1), &(src2), NR_CPUS) |
204 | static inline void __cpus_andnot(cpumask_t *dstp, const cpumask_t *src1p, | 204 | static inline int __cpus_andnot(cpumask_t *dstp, const cpumask_t *src1p, |
205 | const cpumask_t *src2p, int nbits) | 205 | const cpumask_t *src2p, int nbits) |
206 | { | 206 | { |
207 | bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits); | 207 | return bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits); |
208 | } | 208 | } |
209 | 209 | ||
210 | #define cpus_complement(dst, src) __cpus_complement(&(dst), &(src), NR_CPUS) | 210 | #define cpus_complement(dst, src) __cpus_complement(&(dst), &(src), NR_CPUS) |
@@ -738,11 +738,11 @@ static inline void cpumask_clear(struct cpumask *dstp) | |||
738 | * @src1p: the first input | 738 | * @src1p: the first input |
739 | * @src2p: the second input | 739 | * @src2p: the second input |
740 | */ | 740 | */ |
741 | static inline void cpumask_and(struct cpumask *dstp, | 741 | static inline int cpumask_and(struct cpumask *dstp, |
742 | const struct cpumask *src1p, | 742 | const struct cpumask *src1p, |
743 | const struct cpumask *src2p) | 743 | const struct cpumask *src2p) |
744 | { | 744 | { |
745 | bitmap_and(cpumask_bits(dstp), cpumask_bits(src1p), | 745 | return bitmap_and(cpumask_bits(dstp), cpumask_bits(src1p), |
746 | cpumask_bits(src2p), nr_cpumask_bits); | 746 | cpumask_bits(src2p), nr_cpumask_bits); |
747 | } | 747 | } |
748 | 748 | ||
@@ -779,11 +779,11 @@ static inline void cpumask_xor(struct cpumask *dstp, | |||
779 | * @src1p: the first input | 779 | * @src1p: the first input |
780 | * @src2p: the second input | 780 | * @src2p: the second input |
781 | */ | 781 | */ |
782 | static inline void cpumask_andnot(struct cpumask *dstp, | 782 | static inline int cpumask_andnot(struct cpumask *dstp, |
783 | const struct cpumask *src1p, | 783 | const struct cpumask *src1p, |
784 | const struct cpumask *src2p) | 784 | const struct cpumask *src2p) |
785 | { | 785 | { |
786 | bitmap_andnot(cpumask_bits(dstp), cpumask_bits(src1p), | 786 | return bitmap_andnot(cpumask_bits(dstp), cpumask_bits(src1p), |
787 | cpumask_bits(src2p), nr_cpumask_bits); | 787 | cpumask_bits(src2p), nr_cpumask_bits); |
788 | } | 788 | } |
789 | 789 | ||
diff --git a/include/linux/crash_dump.h b/include/linux/crash_dump.h index 2dac064d8359..0026f267da20 100644 --- a/include/linux/crash_dump.h +++ b/include/linux/crash_dump.h | |||
@@ -3,7 +3,6 @@ | |||
3 | 3 | ||
4 | #ifdef CONFIG_CRASH_DUMP | 4 | #ifdef CONFIG_CRASH_DUMP |
5 | #include <linux/kexec.h> | 5 | #include <linux/kexec.h> |
6 | #include <linux/smp_lock.h> | ||
7 | #include <linux/device.h> | 6 | #include <linux/device.h> |
8 | #include <linux/proc_fs.h> | 7 | #include <linux/proc_fs.h> |
9 | 8 | ||
diff --git a/include/linux/cred.h b/include/linux/cred.h index 4fa999696310..24520a539c6f 100644 --- a/include/linux/cred.h +++ b/include/linux/cred.h | |||
@@ -114,6 +114,13 @@ struct thread_group_cred { | |||
114 | */ | 114 | */ |
115 | struct cred { | 115 | struct cred { |
116 | atomic_t usage; | 116 | atomic_t usage; |
117 | #ifdef CONFIG_DEBUG_CREDENTIALS | ||
118 | atomic_t subscribers; /* number of processes subscribed */ | ||
119 | void *put_addr; | ||
120 | unsigned magic; | ||
121 | #define CRED_MAGIC 0x43736564 | ||
122 | #define CRED_MAGIC_DEAD 0x44656144 | ||
123 | #endif | ||
117 | uid_t uid; /* real UID of the task */ | 124 | uid_t uid; /* real UID of the task */ |
118 | gid_t gid; /* real GID of the task */ | 125 | gid_t gid; /* real GID of the task */ |
119 | uid_t suid; /* saved UID of the task */ | 126 | uid_t suid; /* saved UID of the task */ |
@@ -143,7 +150,9 @@ struct cred { | |||
143 | }; | 150 | }; |
144 | 151 | ||
145 | extern void __put_cred(struct cred *); | 152 | extern void __put_cred(struct cred *); |
153 | extern void exit_creds(struct task_struct *); | ||
146 | extern int copy_creds(struct task_struct *, unsigned long); | 154 | extern int copy_creds(struct task_struct *, unsigned long); |
155 | extern struct cred *cred_alloc_blank(void); | ||
147 | extern struct cred *prepare_creds(void); | 156 | extern struct cred *prepare_creds(void); |
148 | extern struct cred *prepare_exec_creds(void); | 157 | extern struct cred *prepare_exec_creds(void); |
149 | extern struct cred *prepare_usermodehelper_creds(void); | 158 | extern struct cred *prepare_usermodehelper_creds(void); |
@@ -158,6 +167,60 @@ extern int set_security_override_from_ctx(struct cred *, const char *); | |||
158 | extern int set_create_files_as(struct cred *, struct inode *); | 167 | extern int set_create_files_as(struct cred *, struct inode *); |
159 | extern void __init cred_init(void); | 168 | extern void __init cred_init(void); |
160 | 169 | ||
170 | /* | ||
171 | * check for validity of credentials | ||
172 | */ | ||
173 | #ifdef CONFIG_DEBUG_CREDENTIALS | ||
174 | extern void __invalid_creds(const struct cred *, const char *, unsigned); | ||
175 | extern void __validate_process_creds(struct task_struct *, | ||
176 | const char *, unsigned); | ||
177 | |||
178 | static inline bool creds_are_invalid(const struct cred *cred) | ||
179 | { | ||
180 | if (cred->magic != CRED_MAGIC) | ||
181 | return true; | ||
182 | if (atomic_read(&cred->usage) < atomic_read(&cred->subscribers)) | ||
183 | return true; | ||
184 | #ifdef CONFIG_SECURITY_SELINUX | ||
185 | if ((unsigned long) cred->security < PAGE_SIZE) | ||
186 | return true; | ||
187 | if ((*(u32*)cred->security & 0xffffff00) == | ||
188 | (POISON_FREE << 24 | POISON_FREE << 16 | POISON_FREE << 8)) | ||
189 | return true; | ||
190 | #endif | ||
191 | return false; | ||
192 | } | ||
193 | |||
194 | static inline void __validate_creds(const struct cred *cred, | ||
195 | const char *file, unsigned line) | ||
196 | { | ||
197 | if (unlikely(creds_are_invalid(cred))) | ||
198 | __invalid_creds(cred, file, line); | ||
199 | } | ||
200 | |||
201 | #define validate_creds(cred) \ | ||
202 | do { \ | ||
203 | __validate_creds((cred), __FILE__, __LINE__); \ | ||
204 | } while(0) | ||
205 | |||
206 | #define validate_process_creds() \ | ||
207 | do { \ | ||
208 | __validate_process_creds(current, __FILE__, __LINE__); \ | ||
209 | } while(0) | ||
210 | |||
211 | extern void validate_creds_for_do_exit(struct task_struct *); | ||
212 | #else | ||
213 | static inline void validate_creds(const struct cred *cred) | ||
214 | { | ||
215 | } | ||
216 | static inline void validate_creds_for_do_exit(struct task_struct *tsk) | ||
217 | { | ||
218 | } | ||
219 | static inline void validate_process_creds(void) | ||
220 | { | ||
221 | } | ||
222 | #endif | ||
223 | |||
161 | /** | 224 | /** |
162 | * get_new_cred - Get a reference on a new set of credentials | 225 | * get_new_cred - Get a reference on a new set of credentials |
163 | * @cred: The new credentials to reference | 226 | * @cred: The new credentials to reference |
@@ -186,7 +249,9 @@ static inline struct cred *get_new_cred(struct cred *cred) | |||
186 | */ | 249 | */ |
187 | static inline const struct cred *get_cred(const struct cred *cred) | 250 | static inline const struct cred *get_cred(const struct cred *cred) |
188 | { | 251 | { |
189 | return get_new_cred((struct cred *) cred); | 252 | struct cred *nonconst_cred = (struct cred *) cred; |
253 | validate_creds(cred); | ||
254 | return get_new_cred(nonconst_cred); | ||
190 | } | 255 | } |
191 | 256 | ||
192 | /** | 257 | /** |
@@ -204,7 +269,7 @@ static inline void put_cred(const struct cred *_cred) | |||
204 | { | 269 | { |
205 | struct cred *cred = (struct cred *) _cred; | 270 | struct cred *cred = (struct cred *) _cred; |
206 | 271 | ||
207 | BUG_ON(atomic_read(&(cred)->usage) <= 0); | 272 | validate_creds(cred); |
208 | if (atomic_dec_and_test(&(cred)->usage)) | 273 | if (atomic_dec_and_test(&(cred)->usage)) |
209 | __put_cred(cred); | 274 | __put_cred(cred); |
210 | } | 275 | } |
diff --git a/include/linux/decompress/generic.h b/include/linux/decompress/generic.h index 6dfb856327bb..0c7111a55a1a 100644 --- a/include/linux/decompress/generic.h +++ b/include/linux/decompress/generic.h | |||
@@ -1,31 +1,37 @@ | |||
1 | #ifndef DECOMPRESS_GENERIC_H | 1 | #ifndef DECOMPRESS_GENERIC_H |
2 | #define DECOMPRESS_GENERIC_H | 2 | #define DECOMPRESS_GENERIC_H |
3 | 3 | ||
4 | /* Minimal chunksize to be read. | ||
5 | *Bzip2 prefers at least 4096 | ||
6 | *Lzma prefers 0x10000 */ | ||
7 | #define COMPR_IOBUF_SIZE 4096 | ||
8 | |||
9 | typedef int (*decompress_fn) (unsigned char *inbuf, int len, | 4 | typedef int (*decompress_fn) (unsigned char *inbuf, int len, |
10 | int(*fill)(void*, unsigned int), | 5 | int(*fill)(void*, unsigned int), |
11 | int(*writebb)(void*, unsigned int), | 6 | int(*flush)(void*, unsigned int), |
12 | unsigned char *output, | 7 | unsigned char *outbuf, |
13 | int *posp, | 8 | int *posp, |
14 | void(*error)(char *x)); | 9 | void(*error)(char *x)); |
15 | 10 | ||
16 | /* inbuf - input buffer | 11 | /* inbuf - input buffer |
17 | *len - len of pre-read data in inbuf | 12 | *len - len of pre-read data in inbuf |
18 | *fill - function to fill inbuf if empty | 13 | *fill - function to fill inbuf when empty |
19 | *writebb - function to write out outbug | 14 | *flush - function to write out outbuf |
15 | *outbuf - output buffer | ||
20 | *posp - if non-null, input position (number of bytes read) will be | 16 | *posp - if non-null, input position (number of bytes read) will be |
21 | * returned here | 17 | * returned here |
22 | * | 18 | * |
23 | *If len != 0, the inbuf is initialized (with as much data), and fill | 19 | *If len != 0, inbuf should contain all the necessary input data, and fill |
24 | *should not be called | 20 | *should be NULL |
25 | *If len = 0, the inbuf is allocated, but empty. Its size is IOBUF_SIZE | 21 | *If len = 0, inbuf can be NULL, in which case the decompressor will allocate |
26 | *fill should be called (repeatedly...) to read data, at most IOBUF_SIZE | 22 | *the input buffer. If inbuf != NULL it must be at least XXX_IOBUF_SIZE bytes. |
23 | *fill will be called (repeatedly...) to read data, at most XXX_IOBUF_SIZE | ||
24 | *bytes should be read per call. Replace XXX with the appropriate decompressor | ||
25 | *name, i.e. LZMA_IOBUF_SIZE. | ||
26 | * | ||
27 | *If flush = NULL, outbuf must be large enough to buffer all the expected | ||
28 | *output. If flush != NULL, the output buffer will be allocated by the | ||
29 | *decompressor (outbuf = NULL), and the flush function will be called to | ||
30 | *flush the output buffer at the appropriate time (decompressor and stream | ||
31 | *dependent). | ||
27 | */ | 32 | */ |
28 | 33 | ||
34 | |||
29 | /* Utility routine to detect the decompression method */ | 35 | /* Utility routine to detect the decompression method */ |
30 | decompress_fn decompress_method(const unsigned char *inbuf, int len, | 36 | decompress_fn decompress_method(const unsigned char *inbuf, int len, |
31 | const char **name); | 37 | const char **name); |
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index 49c2362977fd..df7607e6dce8 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/bio.h> | 11 | #include <linux/bio.h> |
12 | #include <linux/blkdev.h> | 12 | #include <linux/blkdev.h> |
13 | 13 | ||
14 | struct dm_dev; | ||
14 | struct dm_target; | 15 | struct dm_target; |
15 | struct dm_table; | 16 | struct dm_table; |
16 | struct mapped_device; | 17 | struct mapped_device; |
@@ -21,6 +22,7 @@ typedef enum { STATUSTYPE_INFO, STATUSTYPE_TABLE } status_type_t; | |||
21 | union map_info { | 22 | union map_info { |
22 | void *ptr; | 23 | void *ptr; |
23 | unsigned long long ll; | 24 | unsigned long long ll; |
25 | unsigned flush_request; | ||
24 | }; | 26 | }; |
25 | 27 | ||
26 | /* | 28 | /* |
@@ -80,6 +82,18 @@ typedef int (*dm_ioctl_fn) (struct dm_target *ti, unsigned int cmd, | |||
80 | typedef int (*dm_merge_fn) (struct dm_target *ti, struct bvec_merge_data *bvm, | 82 | typedef int (*dm_merge_fn) (struct dm_target *ti, struct bvec_merge_data *bvm, |
81 | struct bio_vec *biovec, int max_size); | 83 | struct bio_vec *biovec, int max_size); |
82 | 84 | ||
85 | typedef int (*iterate_devices_callout_fn) (struct dm_target *ti, | ||
86 | struct dm_dev *dev, | ||
87 | sector_t start, sector_t len, | ||
88 | void *data); | ||
89 | |||
90 | typedef int (*dm_iterate_devices_fn) (struct dm_target *ti, | ||
91 | iterate_devices_callout_fn fn, | ||
92 | void *data); | ||
93 | |||
94 | typedef void (*dm_io_hints_fn) (struct dm_target *ti, | ||
95 | struct queue_limits *limits); | ||
96 | |||
83 | /* | 97 | /* |
84 | * Returns: | 98 | * Returns: |
85 | * 0: The target can handle the next I/O immediately. | 99 | * 0: The target can handle the next I/O immediately. |
@@ -92,7 +106,8 @@ void dm_error(const char *message); | |||
92 | /* | 106 | /* |
93 | * Combine device limits. | 107 | * Combine device limits. |
94 | */ | 108 | */ |
95 | void dm_set_device_limits(struct dm_target *ti, struct block_device *bdev); | 109 | int dm_set_device_limits(struct dm_target *ti, struct dm_dev *dev, |
110 | sector_t start, sector_t len, void *data); | ||
96 | 111 | ||
97 | struct dm_dev { | 112 | struct dm_dev { |
98 | struct block_device *bdev; | 113 | struct block_device *bdev; |
@@ -138,23 +153,13 @@ struct target_type { | |||
138 | dm_ioctl_fn ioctl; | 153 | dm_ioctl_fn ioctl; |
139 | dm_merge_fn merge; | 154 | dm_merge_fn merge; |
140 | dm_busy_fn busy; | 155 | dm_busy_fn busy; |
156 | dm_iterate_devices_fn iterate_devices; | ||
157 | dm_io_hints_fn io_hints; | ||
141 | 158 | ||
142 | /* For internal device-mapper use. */ | 159 | /* For internal device-mapper use. */ |
143 | struct list_head list; | 160 | struct list_head list; |
144 | }; | 161 | }; |
145 | 162 | ||
146 | struct io_restrictions { | ||
147 | unsigned long bounce_pfn; | ||
148 | unsigned long seg_boundary_mask; | ||
149 | unsigned max_hw_sectors; | ||
150 | unsigned max_sectors; | ||
151 | unsigned max_segment_size; | ||
152 | unsigned short logical_block_size; | ||
153 | unsigned short max_hw_segments; | ||
154 | unsigned short max_phys_segments; | ||
155 | unsigned char no_cluster; /* inverted so that 0 is default */ | ||
156 | }; | ||
157 | |||
158 | struct dm_target { | 163 | struct dm_target { |
159 | struct dm_table *table; | 164 | struct dm_table *table; |
160 | struct target_type *type; | 165 | struct target_type *type; |
@@ -163,15 +168,18 @@ struct dm_target { | |||
163 | sector_t begin; | 168 | sector_t begin; |
164 | sector_t len; | 169 | sector_t len; |
165 | 170 | ||
166 | /* FIXME: turn this into a mask, and merge with io_restrictions */ | ||
167 | /* Always a power of 2 */ | 171 | /* Always a power of 2 */ |
168 | sector_t split_io; | 172 | sector_t split_io; |
169 | 173 | ||
170 | /* | 174 | /* |
171 | * These are automatically filled in by | 175 | * A number of zero-length barrier requests that will be submitted |
172 | * dm_table_get_device. | 176 | * to the target for the purpose of flushing cache. |
177 | * | ||
178 | * The request number will be placed in union map_info->flush_request. | ||
179 | * It is a responsibility of the target driver to remap these requests | ||
180 | * to the real underlying devices. | ||
173 | */ | 181 | */ |
174 | struct io_restrictions limits; | 182 | unsigned num_flush_requests; |
175 | 183 | ||
176 | /* target specific data */ | 184 | /* target specific data */ |
177 | void *private; | 185 | void *private; |
@@ -230,6 +238,7 @@ struct gendisk *dm_disk(struct mapped_device *md); | |||
230 | int dm_suspended(struct mapped_device *md); | 238 | int dm_suspended(struct mapped_device *md); |
231 | int dm_noflush_suspending(struct dm_target *ti); | 239 | int dm_noflush_suspending(struct dm_target *ti); |
232 | union map_info *dm_get_mapinfo(struct bio *bio); | 240 | union map_info *dm_get_mapinfo(struct bio *bio); |
241 | union map_info *dm_get_rq_mapinfo(struct request *rq); | ||
233 | 242 | ||
234 | /* | 243 | /* |
235 | * Geometry functions. | 244 | * Geometry functions. |
@@ -392,4 +401,12 @@ static inline unsigned long to_bytes(sector_t n) | |||
392 | return (n << SECTOR_SHIFT); | 401 | return (n << SECTOR_SHIFT); |
393 | } | 402 | } |
394 | 403 | ||
404 | /*----------------------------------------------------------------- | ||
405 | * Helper for block layer and dm core operations | ||
406 | *---------------------------------------------------------------*/ | ||
407 | void dm_dispatch_request(struct request *rq); | ||
408 | void dm_requeue_unmapped_request(struct request *rq); | ||
409 | void dm_kill_unmapped_request(struct request *rq, int error); | ||
410 | int dm_underlying_device_busy(struct request_queue *q); | ||
411 | |||
395 | #endif /* _LINUX_DEVICE_MAPPER_H */ | 412 | #endif /* _LINUX_DEVICE_MAPPER_H */ |
diff --git a/include/linux/device.h b/include/linux/device.h index ed4e39f2c423..aebb81036db2 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -25,8 +25,6 @@ | |||
25 | #include <asm/atomic.h> | 25 | #include <asm/atomic.h> |
26 | #include <asm/device.h> | 26 | #include <asm/device.h> |
27 | 27 | ||
28 | #define BUS_ID_SIZE 20 | ||
29 | |||
30 | struct device; | 28 | struct device; |
31 | struct device_private; | 29 | struct device_private; |
32 | struct device_driver; | 30 | struct device_driver; |
diff --git a/include/linux/dm-ioctl.h b/include/linux/dm-ioctl.h index 48e44ee2b466..2ab84c83c31a 100644 --- a/include/linux/dm-ioctl.h +++ b/include/linux/dm-ioctl.h | |||
@@ -123,6 +123,16 @@ struct dm_ioctl { | |||
123 | __u32 target_count; /* in/out */ | 123 | __u32 target_count; /* in/out */ |
124 | __s32 open_count; /* out */ | 124 | __s32 open_count; /* out */ |
125 | __u32 flags; /* in/out */ | 125 | __u32 flags; /* in/out */ |
126 | |||
127 | /* | ||
128 | * event_nr holds either the event number (input and output) or the | ||
129 | * udev cookie value (input only). | ||
130 | * The DM_DEV_WAIT ioctl takes an event number as input. | ||
131 | * The DM_SUSPEND, DM_DEV_REMOVE and DM_DEV_RENAME ioctls | ||
132 | * use the field as a cookie to return in the DM_COOKIE | ||
133 | * variable with the uevents they issue. | ||
134 | * For output, the ioctls return the event number, not the cookie. | ||
135 | */ | ||
126 | __u32 event_nr; /* in/out */ | 136 | __u32 event_nr; /* in/out */ |
127 | __u32 padding; | 137 | __u32 padding; |
128 | 138 | ||
@@ -256,9 +266,9 @@ enum { | |||
256 | #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) | 266 | #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) |
257 | 267 | ||
258 | #define DM_VERSION_MAJOR 4 | 268 | #define DM_VERSION_MAJOR 4 |
259 | #define DM_VERSION_MINOR 14 | 269 | #define DM_VERSION_MINOR 15 |
260 | #define DM_VERSION_PATCHLEVEL 0 | 270 | #define DM_VERSION_PATCHLEVEL 0 |
261 | #define DM_VERSION_EXTRA "-ioctl (2008-04-23)" | 271 | #define DM_VERSION_EXTRA "-ioctl (2009-04-01)" |
262 | 272 | ||
263 | /* Status bits */ | 273 | /* Status bits */ |
264 | #define DM_READONLY_FLAG (1 << 0) /* In/Out */ | 274 | #define DM_READONLY_FLAG (1 << 0) /* In/Out */ |
diff --git a/include/linux/dm-log-userspace.h b/include/linux/dm-log-userspace.h new file mode 100644 index 000000000000..8a1f972c0fe9 --- /dev/null +++ b/include/linux/dm-log-userspace.h | |||
@@ -0,0 +1,397 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2006-2009 Red Hat, Inc. | ||
3 | * | ||
4 | * This file is released under the LGPL. | ||
5 | */ | ||
6 | |||
7 | #ifndef __DM_LOG_USERSPACE_H__ | ||
8 | #define __DM_LOG_USERSPACE_H__ | ||
9 | |||
10 | #include <linux/dm-ioctl.h> /* For DM_UUID_LEN */ | ||
11 | |||
12 | /* | ||
13 | * The device-mapper userspace log module consists of a kernel component and | ||
14 | * a user-space component. The kernel component implements the API defined | ||
15 | * in dm-dirty-log.h. Its purpose is simply to pass the parameters and | ||
16 | * return values of those API functions between kernel and user-space. | ||
17 | * | ||
18 | * Below are defined the 'request_types' - DM_ULOG_CTR, DM_ULOG_DTR, etc. | ||
19 | * These request types represent the different functions in the device-mapper | ||
20 | * dirty log API. Each of these is described in more detail below. | ||
21 | * | ||
22 | * The user-space program must listen for requests from the kernel (representing | ||
23 | * the various API functions) and process them. | ||
24 | * | ||
25 | * User-space begins by setting up the communication link (error checking | ||
26 | * removed for clarity): | ||
27 | * fd = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_CONNECTOR); | ||
28 | * addr.nl_family = AF_NETLINK; | ||
29 | * addr.nl_groups = CN_IDX_DM; | ||
30 | * addr.nl_pid = 0; | ||
31 | * r = bind(fd, (struct sockaddr *) &addr, sizeof(addr)); | ||
32 | * opt = addr.nl_groups; | ||
33 | * setsockopt(fd, SOL_NETLINK, NETLINK_ADD_MEMBERSHIP, &opt, sizeof(opt)); | ||
34 | * | ||
35 | * User-space will then wait to receive requests form the kernel, which it | ||
36 | * will process as described below. The requests are received in the form, | ||
37 | * ((struct dm_ulog_request) + (additional data)). Depending on the request | ||
38 | * type, there may or may not be 'additional data'. In the descriptions below, | ||
39 | * you will see 'Payload-to-userspace' and 'Payload-to-kernel'. The | ||
40 | * 'Payload-to-userspace' is what the kernel sends in 'additional data' as | ||
41 | * necessary parameters to complete the request. The 'Payload-to-kernel' is | ||
42 | * the 'additional data' returned to the kernel that contains the necessary | ||
43 | * results of the request. The 'data_size' field in the dm_ulog_request | ||
44 | * structure denotes the availability and amount of payload data. | ||
45 | */ | ||
46 | |||
47 | /* | ||
48 | * DM_ULOG_CTR corresponds to (found in dm-dirty-log.h): | ||
49 | * int (*ctr)(struct dm_dirty_log *log, struct dm_target *ti, | ||
50 | * unsigned argc, char **argv); | ||
51 | * | ||
52 | * Payload-to-userspace: | ||
53 | * A single string containing all the argv arguments separated by ' 's | ||
54 | * Payload-to-kernel: | ||
55 | * None. ('data_size' in the dm_ulog_request struct should be 0.) | ||
56 | * | ||
57 | * The UUID contained in the dm_ulog_request structure is the reference that | ||
58 | * will be used by all request types to a specific log. The constructor must | ||
59 | * record this assotiation with instance created. | ||
60 | * | ||
61 | * When the request has been processed, user-space must return the | ||
62 | * dm_ulog_request to the kernel - setting the 'error' field and | ||
63 | * 'data_size' appropriately. | ||
64 | */ | ||
65 | #define DM_ULOG_CTR 1 | ||
66 | |||
67 | /* | ||
68 | * DM_ULOG_DTR corresponds to (found in dm-dirty-log.h): | ||
69 | * void (*dtr)(struct dm_dirty_log *log); | ||
70 | * | ||
71 | * Payload-to-userspace: | ||
72 | * A single string containing all the argv arguments separated by ' 's | ||
73 | * Payload-to-kernel: | ||
74 | * None. ('data_size' in the dm_ulog_request struct should be 0.) | ||
75 | * | ||
76 | * The UUID contained in the dm_ulog_request structure is all that is | ||
77 | * necessary to identify the log instance being destroyed. There is no | ||
78 | * payload data. | ||
79 | * | ||
80 | * When the request has been processed, user-space must return the | ||
81 | * dm_ulog_request to the kernel - setting the 'error' field and clearing | ||
82 | * 'data_size' appropriately. | ||
83 | */ | ||
84 | #define DM_ULOG_DTR 2 | ||
85 | |||
86 | /* | ||
87 | * DM_ULOG_PRESUSPEND corresponds to (found in dm-dirty-log.h): | ||
88 | * int (*presuspend)(struct dm_dirty_log *log); | ||
89 | * | ||
90 | * Payload-to-userspace: | ||
91 | * None. | ||
92 | * Payload-to-kernel: | ||
93 | * None. | ||
94 | * | ||
95 | * The UUID contained in the dm_ulog_request structure is all that is | ||
96 | * necessary to identify the log instance being presuspended. There is no | ||
97 | * payload data. | ||
98 | * | ||
99 | * When the request has been processed, user-space must return the | ||
100 | * dm_ulog_request to the kernel - setting the 'error' field and | ||
101 | * 'data_size' appropriately. | ||
102 | */ | ||
103 | #define DM_ULOG_PRESUSPEND 3 | ||
104 | |||
105 | /* | ||
106 | * DM_ULOG_POSTSUSPEND corresponds to (found in dm-dirty-log.h): | ||
107 | * int (*postsuspend)(struct dm_dirty_log *log); | ||
108 | * | ||
109 | * Payload-to-userspace: | ||
110 | * None. | ||
111 | * Payload-to-kernel: | ||
112 | * None. | ||
113 | * | ||
114 | * The UUID contained in the dm_ulog_request structure is all that is | ||
115 | * necessary to identify the log instance being postsuspended. There is no | ||
116 | * payload data. | ||
117 | * | ||
118 | * When the request has been processed, user-space must return the | ||
119 | * dm_ulog_request to the kernel - setting the 'error' field and | ||
120 | * 'data_size' appropriately. | ||
121 | */ | ||
122 | #define DM_ULOG_POSTSUSPEND 4 | ||
123 | |||
124 | /* | ||
125 | * DM_ULOG_RESUME corresponds to (found in dm-dirty-log.h): | ||
126 | * int (*resume)(struct dm_dirty_log *log); | ||
127 | * | ||
128 | * Payload-to-userspace: | ||
129 | * None. | ||
130 | * Payload-to-kernel: | ||
131 | * None. | ||
132 | * | ||
133 | * The UUID contained in the dm_ulog_request structure is all that is | ||
134 | * necessary to identify the log instance being resumed. There is no | ||
135 | * payload data. | ||
136 | * | ||
137 | * When the request has been processed, user-space must return the | ||
138 | * dm_ulog_request to the kernel - setting the 'error' field and | ||
139 | * 'data_size' appropriately. | ||
140 | */ | ||
141 | #define DM_ULOG_RESUME 5 | ||
142 | |||
143 | /* | ||
144 | * DM_ULOG_GET_REGION_SIZE corresponds to (found in dm-dirty-log.h): | ||
145 | * uint32_t (*get_region_size)(struct dm_dirty_log *log); | ||
146 | * | ||
147 | * Payload-to-userspace: | ||
148 | * None. | ||
149 | * Payload-to-kernel: | ||
150 | * uint64_t - contains the region size | ||
151 | * | ||
152 | * The region size is something that was determined at constructor time. | ||
153 | * It is returned in the payload area and 'data_size' is set to | ||
154 | * reflect this. | ||
155 | * | ||
156 | * When the request has been processed, user-space must return the | ||
157 | * dm_ulog_request to the kernel - setting the 'error' field appropriately. | ||
158 | */ | ||
159 | #define DM_ULOG_GET_REGION_SIZE 6 | ||
160 | |||
161 | /* | ||
162 | * DM_ULOG_IS_CLEAN corresponds to (found in dm-dirty-log.h): | ||
163 | * int (*is_clean)(struct dm_dirty_log *log, region_t region); | ||
164 | * | ||
165 | * Payload-to-userspace: | ||
166 | * uint64_t - the region to get clean status on | ||
167 | * Payload-to-kernel: | ||
168 | * int64_t - 1 if clean, 0 otherwise | ||
169 | * | ||
170 | * Payload is sizeof(uint64_t) and contains the region for which the clean | ||
171 | * status is being made. | ||
172 | * | ||
173 | * When the request has been processed, user-space must return the | ||
174 | * dm_ulog_request to the kernel - filling the payload with 0 (not clean) or | ||
175 | * 1 (clean), setting 'data_size' and 'error' appropriately. | ||
176 | */ | ||
177 | #define DM_ULOG_IS_CLEAN 7 | ||
178 | |||
179 | /* | ||
180 | * DM_ULOG_IN_SYNC corresponds to (found in dm-dirty-log.h): | ||
181 | * int (*in_sync)(struct dm_dirty_log *log, region_t region, | ||
182 | * int can_block); | ||
183 | * | ||
184 | * Payload-to-userspace: | ||
185 | * uint64_t - the region to get sync status on | ||
186 | * Payload-to-kernel: | ||
187 | * int64_t - 1 if in-sync, 0 otherwise | ||
188 | * | ||
189 | * Exactly the same as 'is_clean' above, except this time asking "has the | ||
190 | * region been recovered?" vs. "is the region not being modified?" | ||
191 | */ | ||
192 | #define DM_ULOG_IN_SYNC 8 | ||
193 | |||
194 | /* | ||
195 | * DM_ULOG_FLUSH corresponds to (found in dm-dirty-log.h): | ||
196 | * int (*flush)(struct dm_dirty_log *log); | ||
197 | * | ||
198 | * Payload-to-userspace: | ||
199 | * None. | ||
200 | * Payload-to-kernel: | ||
201 | * None. | ||
202 | * | ||
203 | * No incoming or outgoing payload. Simply flush log state to disk. | ||
204 | * | ||
205 | * When the request has been processed, user-space must return the | ||
206 | * dm_ulog_request to the kernel - setting the 'error' field and clearing | ||
207 | * 'data_size' appropriately. | ||
208 | */ | ||
209 | #define DM_ULOG_FLUSH 9 | ||
210 | |||
211 | /* | ||
212 | * DM_ULOG_MARK_REGION corresponds to (found in dm-dirty-log.h): | ||
213 | * void (*mark_region)(struct dm_dirty_log *log, region_t region); | ||
214 | * | ||
215 | * Payload-to-userspace: | ||
216 | * uint64_t [] - region(s) to mark | ||
217 | * Payload-to-kernel: | ||
218 | * None. | ||
219 | * | ||
220 | * Incoming payload contains the one or more regions to mark dirty. | ||
221 | * The number of regions contained in the payload can be determined from | ||
222 | * 'data_size/sizeof(uint64_t)'. | ||
223 | * | ||
224 | * When the request has been processed, user-space must return the | ||
225 | * dm_ulog_request to the kernel - setting the 'error' field and clearing | ||
226 | * 'data_size' appropriately. | ||
227 | */ | ||
228 | #define DM_ULOG_MARK_REGION 10 | ||
229 | |||
230 | /* | ||
231 | * DM_ULOG_CLEAR_REGION corresponds to (found in dm-dirty-log.h): | ||
232 | * void (*clear_region)(struct dm_dirty_log *log, region_t region); | ||
233 | * | ||
234 | * Payload-to-userspace: | ||
235 | * uint64_t [] - region(s) to clear | ||
236 | * Payload-to-kernel: | ||
237 | * None. | ||
238 | * | ||
239 | * Incoming payload contains the one or more regions to mark clean. | ||
240 | * The number of regions contained in the payload can be determined from | ||
241 | * 'data_size/sizeof(uint64_t)'. | ||
242 | * | ||
243 | * When the request has been processed, user-space must return the | ||
244 | * dm_ulog_request to the kernel - setting the 'error' field and clearing | ||
245 | * 'data_size' appropriately. | ||
246 | */ | ||
247 | #define DM_ULOG_CLEAR_REGION 11 | ||
248 | |||
249 | /* | ||
250 | * DM_ULOG_GET_RESYNC_WORK corresponds to (found in dm-dirty-log.h): | ||
251 | * int (*get_resync_work)(struct dm_dirty_log *log, region_t *region); | ||
252 | * | ||
253 | * Payload-to-userspace: | ||
254 | * None. | ||
255 | * Payload-to-kernel: | ||
256 | * { | ||
257 | * int64_t i; -- 1 if recovery necessary, 0 otherwise | ||
258 | * uint64_t r; -- The region to recover if i=1 | ||
259 | * } | ||
260 | * 'data_size' should be set appropriately. | ||
261 | * | ||
262 | * When the request has been processed, user-space must return the | ||
263 | * dm_ulog_request to the kernel - setting the 'error' field appropriately. | ||
264 | */ | ||
265 | #define DM_ULOG_GET_RESYNC_WORK 12 | ||
266 | |||
267 | /* | ||
268 | * DM_ULOG_SET_REGION_SYNC corresponds to (found in dm-dirty-log.h): | ||
269 | * void (*set_region_sync)(struct dm_dirty_log *log, | ||
270 | * region_t region, int in_sync); | ||
271 | * | ||
272 | * Payload-to-userspace: | ||
273 | * { | ||
274 | * uint64_t - region to set sync state on | ||
275 | * int64_t - 0 if not-in-sync, 1 if in-sync | ||
276 | * } | ||
277 | * Payload-to-kernel: | ||
278 | * None. | ||
279 | * | ||
280 | * When the request has been processed, user-space must return the | ||
281 | * dm_ulog_request to the kernel - setting the 'error' field and clearing | ||
282 | * 'data_size' appropriately. | ||
283 | */ | ||
284 | #define DM_ULOG_SET_REGION_SYNC 13 | ||
285 | |||
286 | /* | ||
287 | * DM_ULOG_GET_SYNC_COUNT corresponds to (found in dm-dirty-log.h): | ||
288 | * region_t (*get_sync_count)(struct dm_dirty_log *log); | ||
289 | * | ||
290 | * Payload-to-userspace: | ||
291 | * None. | ||
292 | * Payload-to-kernel: | ||
293 | * uint64_t - the number of in-sync regions | ||
294 | * | ||
295 | * No incoming payload. Kernel-bound payload contains the number of | ||
296 | * regions that are in-sync (in a size_t). | ||
297 | * | ||
298 | * When the request has been processed, user-space must return the | ||
299 | * dm_ulog_request to the kernel - setting the 'error' field and | ||
300 | * 'data_size' appropriately. | ||
301 | */ | ||
302 | #define DM_ULOG_GET_SYNC_COUNT 14 | ||
303 | |||
304 | /* | ||
305 | * DM_ULOG_STATUS_INFO corresponds to (found in dm-dirty-log.h): | ||
306 | * int (*status)(struct dm_dirty_log *log, STATUSTYPE_INFO, | ||
307 | * char *result, unsigned maxlen); | ||
308 | * | ||
309 | * Payload-to-userspace: | ||
310 | * None. | ||
311 | * Payload-to-kernel: | ||
312 | * Character string containing STATUSTYPE_INFO | ||
313 | * | ||
314 | * When the request has been processed, user-space must return the | ||
315 | * dm_ulog_request to the kernel - setting the 'error' field and | ||
316 | * 'data_size' appropriately. | ||
317 | */ | ||
318 | #define DM_ULOG_STATUS_INFO 15 | ||
319 | |||
320 | /* | ||
321 | * DM_ULOG_STATUS_TABLE corresponds to (found in dm-dirty-log.h): | ||
322 | * int (*status)(struct dm_dirty_log *log, STATUSTYPE_TABLE, | ||
323 | * char *result, unsigned maxlen); | ||
324 | * | ||
325 | * Payload-to-userspace: | ||
326 | * None. | ||
327 | * Payload-to-kernel: | ||
328 | * Character string containing STATUSTYPE_TABLE | ||
329 | * | ||
330 | * When the request has been processed, user-space must return the | ||
331 | * dm_ulog_request to the kernel - setting the 'error' field and | ||
332 | * 'data_size' appropriately. | ||
333 | */ | ||
334 | #define DM_ULOG_STATUS_TABLE 16 | ||
335 | |||
336 | /* | ||
337 | * DM_ULOG_IS_REMOTE_RECOVERING corresponds to (found in dm-dirty-log.h): | ||
338 | * int (*is_remote_recovering)(struct dm_dirty_log *log, region_t region); | ||
339 | * | ||
340 | * Payload-to-userspace: | ||
341 | * uint64_t - region to determine recovery status on | ||
342 | * Payload-to-kernel: | ||
343 | * { | ||
344 | * int64_t is_recovering; -- 0 if no, 1 if yes | ||
345 | * uint64_t in_sync_hint; -- lowest region still needing resync | ||
346 | * } | ||
347 | * | ||
348 | * When the request has been processed, user-space must return the | ||
349 | * dm_ulog_request to the kernel - setting the 'error' field and | ||
350 | * 'data_size' appropriately. | ||
351 | */ | ||
352 | #define DM_ULOG_IS_REMOTE_RECOVERING 17 | ||
353 | |||
354 | /* | ||
355 | * (DM_ULOG_REQUEST_MASK & request_type) to get the request type | ||
356 | * | ||
357 | * Payload-to-userspace: | ||
358 | * A single string containing all the argv arguments separated by ' 's | ||
359 | * Payload-to-kernel: | ||
360 | * None. ('data_size' in the dm_ulog_request struct should be 0.) | ||
361 | * | ||
362 | * We are reserving 8 bits of the 32-bit 'request_type' field for the | ||
363 | * various request types above. The remaining 24-bits are currently | ||
364 | * set to zero and are reserved for future use and compatibility concerns. | ||
365 | * | ||
366 | * User-space should always use DM_ULOG_REQUEST_TYPE to aquire the | ||
367 | * request type from the 'request_type' field to maintain forward compatibility. | ||
368 | */ | ||
369 | #define DM_ULOG_REQUEST_MASK 0xFF | ||
370 | #define DM_ULOG_REQUEST_TYPE(request_type) \ | ||
371 | (DM_ULOG_REQUEST_MASK & (request_type)) | ||
372 | |||
373 | struct dm_ulog_request { | ||
374 | /* | ||
375 | * The local unique identifier (luid) and the universally unique | ||
376 | * identifier (uuid) are used to tie a request to a specific | ||
377 | * mirror log. A single machine log could probably make due with | ||
378 | * just the 'luid', but a cluster-aware log must use the 'uuid' and | ||
379 | * the 'luid'. The uuid is what is required for node to node | ||
380 | * communication concerning a particular log, but the 'luid' helps | ||
381 | * differentiate between logs that are being swapped and have the | ||
382 | * same 'uuid'. (Think "live" and "inactive" device-mapper tables.) | ||
383 | */ | ||
384 | uint64_t luid; | ||
385 | char uuid[DM_UUID_LEN]; | ||
386 | char padding[7]; /* Padding because DM_UUID_LEN = 129 */ | ||
387 | |||
388 | int32_t error; /* Used to report back processing errors */ | ||
389 | |||
390 | uint32_t seq; /* Sequence number for request */ | ||
391 | uint32_t request_type; /* DM_ULOG_* defined above */ | ||
392 | uint32_t data_size; /* How much data (not including this struct) */ | ||
393 | |||
394 | char data[0]; | ||
395 | }; | ||
396 | |||
397 | #endif /* __DM_LOG_USERSPACE_H__ */ | ||
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index 8083b6a36a38..07dfd460d286 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h | |||
@@ -63,24 +63,26 @@ struct dma_map_ops { | |||
63 | 63 | ||
64 | #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1)) | 64 | #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1)) |
65 | 65 | ||
66 | typedef u64 DMA_nnBIT_MASK __deprecated; | ||
67 | |||
66 | /* | 68 | /* |
67 | * NOTE: do not use the below macros in new code and do not add new definitions | 69 | * NOTE: do not use the below macros in new code and do not add new definitions |
68 | * here. | 70 | * here. |
69 | * | 71 | * |
70 | * Instead, just open-code DMA_BIT_MASK(n) within your driver | 72 | * Instead, just open-code DMA_BIT_MASK(n) within your driver |
71 | */ | 73 | */ |
72 | #define DMA_64BIT_MASK DMA_BIT_MASK(64) | 74 | #define DMA_64BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(64) |
73 | #define DMA_48BIT_MASK DMA_BIT_MASK(48) | 75 | #define DMA_48BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(48) |
74 | #define DMA_47BIT_MASK DMA_BIT_MASK(47) | 76 | #define DMA_47BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(47) |
75 | #define DMA_40BIT_MASK DMA_BIT_MASK(40) | 77 | #define DMA_40BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(40) |
76 | #define DMA_39BIT_MASK DMA_BIT_MASK(39) | 78 | #define DMA_39BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(39) |
77 | #define DMA_35BIT_MASK DMA_BIT_MASK(35) | 79 | #define DMA_35BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(35) |
78 | #define DMA_32BIT_MASK DMA_BIT_MASK(32) | 80 | #define DMA_32BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(32) |
79 | #define DMA_31BIT_MASK DMA_BIT_MASK(31) | 81 | #define DMA_31BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(31) |
80 | #define DMA_30BIT_MASK DMA_BIT_MASK(30) | 82 | #define DMA_30BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(30) |
81 | #define DMA_29BIT_MASK DMA_BIT_MASK(29) | 83 | #define DMA_29BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(29) |
82 | #define DMA_28BIT_MASK DMA_BIT_MASK(28) | 84 | #define DMA_28BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(28) |
83 | #define DMA_24BIT_MASK DMA_BIT_MASK(24) | 85 | #define DMA_24BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(24) |
84 | 86 | ||
85 | #define DMA_MASK_NONE 0x0ULL | 87 | #define DMA_MASK_NONE 0x0ULL |
86 | 88 | ||
@@ -107,9 +109,20 @@ static inline int is_buffer_dma_capable(u64 mask, dma_addr_t addr, size_t size) | |||
107 | #include <asm-generic/dma-mapping-broken.h> | 109 | #include <asm-generic/dma-mapping-broken.h> |
108 | #endif | 110 | #endif |
109 | 111 | ||
110 | /* Backwards compat, remove in 2.7.x */ | 112 | /* for backwards compatibility, removed soon */ |
111 | #define dma_sync_single dma_sync_single_for_cpu | 113 | static inline void __deprecated dma_sync_single(struct device *dev, |
112 | #define dma_sync_sg dma_sync_sg_for_cpu | 114 | dma_addr_t addr, size_t size, |
115 | enum dma_data_direction dir) | ||
116 | { | ||
117 | dma_sync_single_for_cpu(dev, addr, size, dir); | ||
118 | } | ||
119 | |||
120 | static inline void __deprecated dma_sync_sg(struct device *dev, | ||
121 | struct scatterlist *sg, int nelems, | ||
122 | enum dma_data_direction dir) | ||
123 | { | ||
124 | dma_sync_sg_for_cpu(dev, sg, nelems, dir); | ||
125 | } | ||
113 | 126 | ||
114 | static inline u64 dma_get_mask(struct device *dev) | 127 | static inline u64 dma_get_mask(struct device *dev) |
115 | { | 128 | { |
diff --git a/include/linux/dma_remapping.h b/include/linux/dma_remapping.h index 1a455f1f86d7..5619f8522738 100644 --- a/include/linux/dma_remapping.h +++ b/include/linux/dma_remapping.h | |||
@@ -13,6 +13,10 @@ | |||
13 | #define DMA_PTE_WRITE (2) | 13 | #define DMA_PTE_WRITE (2) |
14 | #define DMA_PTE_SNP (1 << 11) | 14 | #define DMA_PTE_SNP (1 << 11) |
15 | 15 | ||
16 | #define CONTEXT_TT_MULTI_LEVEL 0 | ||
17 | #define CONTEXT_TT_DEV_IOTLB 1 | ||
18 | #define CONTEXT_TT_PASS_THROUGH 2 | ||
19 | |||
16 | struct intel_iommu; | 20 | struct intel_iommu; |
17 | struct dmar_domain; | 21 | struct dmar_domain; |
18 | struct root_entry; | 22 | struct root_entry; |
@@ -21,11 +25,16 @@ extern void free_dmar_iommu(struct intel_iommu *iommu); | |||
21 | 25 | ||
22 | #ifdef CONFIG_DMAR | 26 | #ifdef CONFIG_DMAR |
23 | extern int iommu_calculate_agaw(struct intel_iommu *iommu); | 27 | extern int iommu_calculate_agaw(struct intel_iommu *iommu); |
28 | extern int iommu_calculate_max_sagaw(struct intel_iommu *iommu); | ||
24 | #else | 29 | #else |
25 | static inline int iommu_calculate_agaw(struct intel_iommu *iommu) | 30 | static inline int iommu_calculate_agaw(struct intel_iommu *iommu) |
26 | { | 31 | { |
27 | return 0; | 32 | return 0; |
28 | } | 33 | } |
34 | static inline int iommu_calculate_max_sagaw(struct intel_iommu *iommu) | ||
35 | { | ||
36 | return 0; | ||
37 | } | ||
29 | #endif | 38 | #endif |
30 | 39 | ||
31 | extern int dmar_disabled; | 40 | extern int dmar_disabled; |
diff --git a/include/linux/dmar.h b/include/linux/dmar.h index 10ff5c498824..4a2b162c256a 100644 --- a/include/linux/dmar.h +++ b/include/linux/dmar.h | |||
@@ -126,6 +126,8 @@ extern int free_irte(int irq); | |||
126 | extern int irq_remapped(int irq); | 126 | extern int irq_remapped(int irq); |
127 | extern struct intel_iommu *map_dev_to_ir(struct pci_dev *dev); | 127 | extern struct intel_iommu *map_dev_to_ir(struct pci_dev *dev); |
128 | extern struct intel_iommu *map_ioapic_to_ir(int apic); | 128 | extern struct intel_iommu *map_ioapic_to_ir(int apic); |
129 | extern int set_ioapic_sid(struct irte *irte, int apic); | ||
130 | extern int set_msi_sid(struct irte *irte, struct pci_dev *dev); | ||
129 | #else | 131 | #else |
130 | static inline int alloc_irte(struct intel_iommu *iommu, int irq, u16 count) | 132 | static inline int alloc_irte(struct intel_iommu *iommu, int irq, u16 count) |
131 | { | 133 | { |
@@ -156,6 +158,15 @@ static inline struct intel_iommu *map_ioapic_to_ir(int apic) | |||
156 | { | 158 | { |
157 | return NULL; | 159 | return NULL; |
158 | } | 160 | } |
161 | static inline int set_ioapic_sid(struct irte *irte, int apic) | ||
162 | { | ||
163 | return 0; | ||
164 | } | ||
165 | static inline int set_msi_sid(struct irte *irte, struct pci_dev *dev) | ||
166 | { | ||
167 | return 0; | ||
168 | } | ||
169 | |||
159 | #define irq_remapped(irq) (0) | 170 | #define irq_remapped(irq) (0) |
160 | #define enable_intr_remapping(mode) (-1) | 171 | #define enable_intr_remapping(mode) (-1) |
161 | #define disable_intr_remapping() (0) | 172 | #define disable_intr_remapping() (0) |
@@ -188,6 +199,15 @@ struct dmar_rmrr_unit { | |||
188 | 199 | ||
189 | #define for_each_rmrr_units(rmrr) \ | 200 | #define for_each_rmrr_units(rmrr) \ |
190 | list_for_each_entry(rmrr, &dmar_rmrr_units, list) | 201 | list_for_each_entry(rmrr, &dmar_rmrr_units, list) |
202 | |||
203 | struct dmar_atsr_unit { | ||
204 | struct list_head list; /* list of ATSR units */ | ||
205 | struct acpi_dmar_header *hdr; /* ACPI header */ | ||
206 | struct pci_dev **devices; /* target devices */ | ||
207 | int devices_cnt; /* target device count */ | ||
208 | u8 include_all:1; /* include all ports */ | ||
209 | }; | ||
210 | |||
191 | /* Intel DMAR initialization functions */ | 211 | /* Intel DMAR initialization functions */ |
192 | extern int intel_iommu_init(void); | 212 | extern int intel_iommu_init(void); |
193 | #else | 213 | #else |
diff --git a/include/linux/elfcore.h b/include/linux/elfcore.h index 7605c5e9589f..00d6a68d0421 100644 --- a/include/linux/elfcore.h +++ b/include/linux/elfcore.h | |||
@@ -122,9 +122,10 @@ static inline void elf_core_copy_kernel_regs(elf_gregset_t *elfregs, struct pt_r | |||
122 | 122 | ||
123 | static inline int elf_core_copy_task_regs(struct task_struct *t, elf_gregset_t* elfregs) | 123 | static inline int elf_core_copy_task_regs(struct task_struct *t, elf_gregset_t* elfregs) |
124 | { | 124 | { |
125 | #ifdef ELF_CORE_COPY_TASK_REGS | 125 | #if defined (ELF_CORE_COPY_TASK_REGS) |
126 | |||
127 | return ELF_CORE_COPY_TASK_REGS(t, elfregs); | 126 | return ELF_CORE_COPY_TASK_REGS(t, elfregs); |
127 | #elif defined (task_pt_regs) | ||
128 | elf_core_copy_regs(elfregs, task_pt_regs(t)); | ||
128 | #endif | 129 | #endif |
129 | return 0; | 130 | return 0; |
130 | } | 131 | } |
diff --git a/include/linux/eventfd.h b/include/linux/eventfd.h index f45a8ae5f828..3b85ba6479f4 100644 --- a/include/linux/eventfd.h +++ b/include/linux/eventfd.h | |||
@@ -8,10 +8,8 @@ | |||
8 | #ifndef _LINUX_EVENTFD_H | 8 | #ifndef _LINUX_EVENTFD_H |
9 | #define _LINUX_EVENTFD_H | 9 | #define _LINUX_EVENTFD_H |
10 | 10 | ||
11 | #ifdef CONFIG_EVENTFD | ||
12 | |||
13 | /* For O_CLOEXEC and O_NONBLOCK */ | ||
14 | #include <linux/fcntl.h> | 11 | #include <linux/fcntl.h> |
12 | #include <linux/file.h> | ||
15 | 13 | ||
16 | /* | 14 | /* |
17 | * CAREFUL: Check include/asm-generic/fcntl.h when defining | 15 | * CAREFUL: Check include/asm-generic/fcntl.h when defining |
@@ -27,16 +25,37 @@ | |||
27 | #define EFD_SHARED_FCNTL_FLAGS (O_CLOEXEC | O_NONBLOCK) | 25 | #define EFD_SHARED_FCNTL_FLAGS (O_CLOEXEC | O_NONBLOCK) |
28 | #define EFD_FLAGS_SET (EFD_SHARED_FCNTL_FLAGS | EFD_SEMAPHORE) | 26 | #define EFD_FLAGS_SET (EFD_SHARED_FCNTL_FLAGS | EFD_SEMAPHORE) |
29 | 27 | ||
28 | #ifdef CONFIG_EVENTFD | ||
29 | |||
30 | struct eventfd_ctx *eventfd_ctx_get(struct eventfd_ctx *ctx); | ||
31 | void eventfd_ctx_put(struct eventfd_ctx *ctx); | ||
30 | struct file *eventfd_fget(int fd); | 32 | struct file *eventfd_fget(int fd); |
31 | int eventfd_signal(struct file *file, int n); | 33 | struct eventfd_ctx *eventfd_ctx_fdget(int fd); |
34 | struct eventfd_ctx *eventfd_ctx_fileget(struct file *file); | ||
35 | int eventfd_signal(struct eventfd_ctx *ctx, int n); | ||
32 | 36 | ||
33 | #else /* CONFIG_EVENTFD */ | 37 | #else /* CONFIG_EVENTFD */ |
34 | 38 | ||
35 | #define eventfd_fget(fd) ERR_PTR(-ENOSYS) | 39 | /* |
36 | static inline int eventfd_signal(struct file *file, int n) | 40 | * Ugly ugly ugly error layer to support modules that uses eventfd but |
37 | { return 0; } | 41 | * pretend to work in !CONFIG_EVENTFD configurations. Namely, AIO. |
42 | */ | ||
43 | static inline struct eventfd_ctx *eventfd_ctx_fdget(int fd) | ||
44 | { | ||
45 | return ERR_PTR(-ENOSYS); | ||
46 | } | ||
47 | |||
48 | static inline int eventfd_signal(struct eventfd_ctx *ctx, int n) | ||
49 | { | ||
50 | return -ENOSYS; | ||
51 | } | ||
52 | |||
53 | static inline void eventfd_ctx_put(struct eventfd_ctx *ctx) | ||
54 | { | ||
55 | |||
56 | } | ||
38 | 57 | ||
39 | #endif /* CONFIG_EVENTFD */ | 58 | #endif |
40 | 59 | ||
41 | #endif /* _LINUX_EVENTFD_H */ | 60 | #endif /* _LINUX_EVENTFD_H */ |
42 | 61 | ||
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index 634a5e5aba3e..7499b3667798 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h | |||
@@ -874,7 +874,7 @@ struct buffer_head * ext3_getblk (handle_t *, struct inode *, long, int, int *); | |||
874 | struct buffer_head * ext3_bread (handle_t *, struct inode *, int, int, int *); | 874 | struct buffer_head * ext3_bread (handle_t *, struct inode *, int, int, int *); |
875 | int ext3_get_blocks_handle(handle_t *handle, struct inode *inode, | 875 | int ext3_get_blocks_handle(handle_t *handle, struct inode *inode, |
876 | sector_t iblock, unsigned long maxblocks, struct buffer_head *bh_result, | 876 | sector_t iblock, unsigned long maxblocks, struct buffer_head *bh_result, |
877 | int create, int extend_disksize); | 877 | int create); |
878 | 878 | ||
879 | extern struct inode *ext3_iget(struct super_block *, unsigned long); | 879 | extern struct inode *ext3_iget(struct super_block *, unsigned long); |
880 | extern int ext3_write_inode (struct inode *, int); | 880 | extern int ext3_write_inode (struct inode *, int); |
diff --git a/include/linux/ext3_fs_i.h b/include/linux/ext3_fs_i.h index 7894dd0f3b77..ca1bfe90004f 100644 --- a/include/linux/ext3_fs_i.h +++ b/include/linux/ext3_fs_i.h | |||
@@ -103,10 +103,6 @@ struct ext3_inode_info { | |||
103 | */ | 103 | */ |
104 | struct rw_semaphore xattr_sem; | 104 | struct rw_semaphore xattr_sem; |
105 | #endif | 105 | #endif |
106 | #ifdef CONFIG_EXT3_FS_POSIX_ACL | ||
107 | struct posix_acl *i_acl; | ||
108 | struct posix_acl *i_default_acl; | ||
109 | #endif | ||
110 | 106 | ||
111 | struct list_head i_orphan; /* unlinked but open inodes */ | 107 | struct list_head i_orphan; /* unlinked but open inodes */ |
112 | 108 | ||
diff --git a/include/linux/falloc.h b/include/linux/falloc.h index 8e912ab6a072..3c155107d61f 100644 --- a/include/linux/falloc.h +++ b/include/linux/falloc.h | |||
@@ -3,4 +3,25 @@ | |||
3 | 3 | ||
4 | #define FALLOC_FL_KEEP_SIZE 0x01 /* default is extend size */ | 4 | #define FALLOC_FL_KEEP_SIZE 0x01 /* default is extend size */ |
5 | 5 | ||
6 | #ifdef __KERNEL__ | ||
7 | |||
8 | /* | ||
9 | * Space reservation ioctls and argument structure | ||
10 | * are designed to be compatible with the legacy XFS ioctls. | ||
11 | */ | ||
12 | struct space_resv { | ||
13 | __s16 l_type; | ||
14 | __s16 l_whence; | ||
15 | __s64 l_start; | ||
16 | __s64 l_len; /* len == 0 means until end of file */ | ||
17 | __s32 l_sysid; | ||
18 | __u32 l_pid; | ||
19 | __s32 l_pad[4]; /* reserved area */ | ||
20 | }; | ||
21 | |||
22 | #define FS_IOC_RESVSP _IOW('X', 40, struct space_resv) | ||
23 | #define FS_IOC_RESVSP64 _IOW('X', 42, struct space_resv) | ||
24 | |||
25 | #endif /* __KERNEL__ */ | ||
26 | |||
6 | #endif /* _FALLOC_H_ */ | 27 | #endif /* _FALLOC_H_ */ |
diff --git a/include/linux/fb.h b/include/linux/fb.h index dd68358996b7..f847df9e99b6 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -819,6 +819,7 @@ struct fb_info { | |||
819 | int node; | 819 | int node; |
820 | int flags; | 820 | int flags; |
821 | struct mutex lock; /* Lock for open/release/ioctl funcs */ | 821 | struct mutex lock; /* Lock for open/release/ioctl funcs */ |
822 | struct mutex mm_lock; /* Lock for fb_mmap and smem_* fields */ | ||
822 | struct fb_var_screeninfo var; /* Current var */ | 823 | struct fb_var_screeninfo var; /* Current var */ |
823 | struct fb_fix_screeninfo fix; /* Current fix */ | 824 | struct fb_fix_screeninfo fix; /* Current fix */ |
824 | struct fb_monspecs monspecs; /* Current Monitor specs */ | 825 | struct fb_monspecs monspecs; /* Current Monitor specs */ |
diff --git a/include/linux/firewire.h b/include/linux/firewire.h index e584b7215e8b..192d1e43c43c 100644 --- a/include/linux/firewire.h +++ b/include/linux/firewire.h | |||
@@ -3,6 +3,7 @@ | |||
3 | 3 | ||
4 | #include <linux/completion.h> | 4 | #include <linux/completion.h> |
5 | #include <linux/device.h> | 5 | #include <linux/device.h> |
6 | #include <linux/dma-mapping.h> | ||
6 | #include <linux/kernel.h> | 7 | #include <linux/kernel.h> |
7 | #include <linux/kref.h> | 8 | #include <linux/kref.h> |
8 | #include <linux/list.h> | 9 | #include <linux/list.h> |
@@ -126,6 +127,7 @@ struct fw_card { | |||
126 | struct delayed_work work; | 127 | struct delayed_work work; |
127 | int bm_retries; | 128 | int bm_retries; |
128 | int bm_generation; | 129 | int bm_generation; |
130 | __be32 bm_transaction_data[2]; | ||
129 | 131 | ||
130 | bool broadcast_channel_allocated; | 132 | bool broadcast_channel_allocated; |
131 | u32 broadcast_channel; | 133 | u32 broadcast_channel; |
@@ -355,4 +357,90 @@ int fw_run_transaction(struct fw_card *card, int tcode, int destination_id, | |||
355 | int generation, int speed, unsigned long long offset, | 357 | int generation, int speed, unsigned long long offset, |
356 | void *payload, size_t length); | 358 | void *payload, size_t length); |
357 | 359 | ||
360 | static inline int fw_stream_packet_destination_id(int tag, int channel, int sy) | ||
361 | { | ||
362 | return tag << 14 | channel << 8 | sy; | ||
363 | } | ||
364 | |||
365 | struct fw_descriptor { | ||
366 | struct list_head link; | ||
367 | size_t length; | ||
368 | u32 immediate; | ||
369 | u32 key; | ||
370 | const u32 *data; | ||
371 | }; | ||
372 | |||
373 | int fw_core_add_descriptor(struct fw_descriptor *desc); | ||
374 | void fw_core_remove_descriptor(struct fw_descriptor *desc); | ||
375 | |||
376 | /* | ||
377 | * The iso packet format allows for an immediate header/payload part | ||
378 | * stored in 'header' immediately after the packet info plus an | ||
379 | * indirect payload part that is pointer to by the 'payload' field. | ||
380 | * Applications can use one or the other or both to implement simple | ||
381 | * low-bandwidth streaming (e.g. audio) or more advanced | ||
382 | * scatter-gather streaming (e.g. assembling video frame automatically). | ||
383 | */ | ||
384 | struct fw_iso_packet { | ||
385 | u16 payload_length; /* Length of indirect payload. */ | ||
386 | u32 interrupt:1; /* Generate interrupt on this packet */ | ||
387 | u32 skip:1; /* Set to not send packet at all. */ | ||
388 | u32 tag:2; | ||
389 | u32 sy:4; | ||
390 | u32 header_length:8; /* Length of immediate header. */ | ||
391 | u32 header[0]; | ||
392 | }; | ||
393 | |||
394 | #define FW_ISO_CONTEXT_TRANSMIT 0 | ||
395 | #define FW_ISO_CONTEXT_RECEIVE 1 | ||
396 | |||
397 | #define FW_ISO_CONTEXT_MATCH_TAG0 1 | ||
398 | #define FW_ISO_CONTEXT_MATCH_TAG1 2 | ||
399 | #define FW_ISO_CONTEXT_MATCH_TAG2 4 | ||
400 | #define FW_ISO_CONTEXT_MATCH_TAG3 8 | ||
401 | #define FW_ISO_CONTEXT_MATCH_ALL_TAGS 15 | ||
402 | |||
403 | /* | ||
404 | * An iso buffer is just a set of pages mapped for DMA in the | ||
405 | * specified direction. Since the pages are to be used for DMA, they | ||
406 | * are not mapped into the kernel virtual address space. We store the | ||
407 | * DMA address in the page private. The helper function | ||
408 | * fw_iso_buffer_map() will map the pages into a given vma. | ||
409 | */ | ||
410 | struct fw_iso_buffer { | ||
411 | enum dma_data_direction direction; | ||
412 | struct page **pages; | ||
413 | int page_count; | ||
414 | }; | ||
415 | |||
416 | int fw_iso_buffer_init(struct fw_iso_buffer *buffer, struct fw_card *card, | ||
417 | int page_count, enum dma_data_direction direction); | ||
418 | void fw_iso_buffer_destroy(struct fw_iso_buffer *buffer, struct fw_card *card); | ||
419 | |||
420 | struct fw_iso_context; | ||
421 | typedef void (*fw_iso_callback_t)(struct fw_iso_context *context, | ||
422 | u32 cycle, size_t header_length, | ||
423 | void *header, void *data); | ||
424 | struct fw_iso_context { | ||
425 | struct fw_card *card; | ||
426 | int type; | ||
427 | int channel; | ||
428 | int speed; | ||
429 | size_t header_size; | ||
430 | fw_iso_callback_t callback; | ||
431 | void *callback_data; | ||
432 | }; | ||
433 | |||
434 | struct fw_iso_context *fw_iso_context_create(struct fw_card *card, | ||
435 | int type, int channel, int speed, size_t header_size, | ||
436 | fw_iso_callback_t callback, void *callback_data); | ||
437 | int fw_iso_context_queue(struct fw_iso_context *ctx, | ||
438 | struct fw_iso_packet *packet, | ||
439 | struct fw_iso_buffer *buffer, | ||
440 | unsigned long payload); | ||
441 | int fw_iso_context_start(struct fw_iso_context *ctx, | ||
442 | int cycle, int sync, int tags); | ||
443 | int fw_iso_context_stop(struct fw_iso_context *ctx); | ||
444 | void fw_iso_context_destroy(struct fw_iso_context *ctx); | ||
445 | |||
358 | #endif /* _LINUX_FIREWIRE_H */ | 446 | #endif /* _LINUX_FIREWIRE_H */ |
diff --git a/include/linux/flex_array.h b/include/linux/flex_array.h new file mode 100644 index 000000000000..45ff18491514 --- /dev/null +++ b/include/linux/flex_array.h | |||
@@ -0,0 +1,49 @@ | |||
1 | #ifndef _FLEX_ARRAY_H | ||
2 | #define _FLEX_ARRAY_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | #include <asm/page.h> | ||
6 | |||
7 | #define FLEX_ARRAY_PART_SIZE PAGE_SIZE | ||
8 | #define FLEX_ARRAY_BASE_SIZE PAGE_SIZE | ||
9 | |||
10 | struct flex_array_part; | ||
11 | |||
12 | /* | ||
13 | * This is meant to replace cases where an array-like | ||
14 | * structure has gotten too big to fit into kmalloc() | ||
15 | * and the developer is getting tempted to use | ||
16 | * vmalloc(). | ||
17 | */ | ||
18 | |||
19 | struct flex_array { | ||
20 | union { | ||
21 | struct { | ||
22 | int element_size; | ||
23 | int total_nr_elements; | ||
24 | struct flex_array_part *parts[]; | ||
25 | }; | ||
26 | /* | ||
27 | * This little trick makes sure that | ||
28 | * sizeof(flex_array) == PAGE_SIZE | ||
29 | */ | ||
30 | char padding[FLEX_ARRAY_BASE_SIZE]; | ||
31 | }; | ||
32 | }; | ||
33 | |||
34 | #define FLEX_ARRAY_INIT(size, total) { { {\ | ||
35 | .element_size = (size), \ | ||
36 | .total_nr_elements = (total), \ | ||
37 | } } } | ||
38 | |||
39 | struct flex_array *flex_array_alloc(int element_size, unsigned int total, | ||
40 | gfp_t flags); | ||
41 | int flex_array_prealloc(struct flex_array *fa, unsigned int start, | ||
42 | unsigned int end, gfp_t flags); | ||
43 | void flex_array_free(struct flex_array *fa); | ||
44 | void flex_array_free_parts(struct flex_array *fa); | ||
45 | int flex_array_put(struct flex_array *fa, unsigned int element_nr, void *src, | ||
46 | gfp_t flags); | ||
47 | void *flex_array_get(struct flex_array *fa, unsigned int element_nr); | ||
48 | |||
49 | #endif /* _FLEX_ARRAY_H */ | ||
diff --git a/include/linux/fs.h b/include/linux/fs.h index 74a57938c880..a79f48373e7e 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -710,9 +710,12 @@ static inline int mapping_writably_mapped(struct address_space *mapping) | |||
710 | #define i_size_ordered_init(inode) do { } while (0) | 710 | #define i_size_ordered_init(inode) do { } while (0) |
711 | #endif | 711 | #endif |
712 | 712 | ||
713 | struct posix_acl; | ||
714 | #define ACL_NOT_CACHED ((void *)(-1)) | ||
715 | |||
713 | struct inode { | 716 | struct inode { |
714 | struct hlist_node i_hash; | 717 | struct hlist_node i_hash; |
715 | struct list_head i_list; | 718 | struct list_head i_list; /* backing dev IO list */ |
716 | struct list_head i_sb_list; | 719 | struct list_head i_sb_list; |
717 | struct list_head i_dentry; | 720 | struct list_head i_dentry; |
718 | unsigned long i_ino; | 721 | unsigned long i_ino; |
@@ -773,6 +776,10 @@ struct inode { | |||
773 | #ifdef CONFIG_SECURITY | 776 | #ifdef CONFIG_SECURITY |
774 | void *i_security; | 777 | void *i_security; |
775 | #endif | 778 | #endif |
779 | #ifdef CONFIG_FS_POSIX_ACL | ||
780 | struct posix_acl *i_acl; | ||
781 | struct posix_acl *i_default_acl; | ||
782 | #endif | ||
776 | void *i_private; /* fs or device private pointer */ | 783 | void *i_private; /* fs or device private pointer */ |
777 | }; | 784 | }; |
778 | 785 | ||
@@ -1107,6 +1114,7 @@ extern void locks_copy_lock(struct file_lock *, struct file_lock *); | |||
1107 | extern void __locks_copy_lock(struct file_lock *, const struct file_lock *); | 1114 | extern void __locks_copy_lock(struct file_lock *, const struct file_lock *); |
1108 | extern void locks_remove_posix(struct file *, fl_owner_t); | 1115 | extern void locks_remove_posix(struct file *, fl_owner_t); |
1109 | extern void locks_remove_flock(struct file *); | 1116 | extern void locks_remove_flock(struct file *); |
1117 | extern void locks_release_private(struct file_lock *); | ||
1110 | extern void posix_test_lock(struct file *, struct file_lock *); | 1118 | extern void posix_test_lock(struct file *, struct file_lock *); |
1111 | extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *); | 1119 | extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *); |
1112 | extern int posix_lock_file_wait(struct file *, struct file_lock *); | 1120 | extern int posix_lock_file_wait(struct file *, struct file_lock *); |
@@ -1328,9 +1336,6 @@ struct super_block { | |||
1328 | struct xattr_handler **s_xattr; | 1336 | struct xattr_handler **s_xattr; |
1329 | 1337 | ||
1330 | struct list_head s_inodes; /* all inodes */ | 1338 | struct list_head s_inodes; /* all inodes */ |
1331 | struct list_head s_dirty; /* dirty inodes */ | ||
1332 | struct list_head s_io; /* parked for writeback */ | ||
1333 | struct list_head s_more_io; /* parked for more writeback */ | ||
1334 | struct hlist_head s_anon; /* anonymous dentries for (nfs) exporting */ | 1339 | struct hlist_head s_anon; /* anonymous dentries for (nfs) exporting */ |
1335 | struct list_head s_files; | 1340 | struct list_head s_files; |
1336 | /* s_dentry_lru and s_nr_dentry_unused are protected by dcache_lock */ | 1341 | /* s_dentry_lru and s_nr_dentry_unused are protected by dcache_lock */ |
@@ -1520,6 +1525,7 @@ struct inode_operations { | |||
1520 | void (*put_link) (struct dentry *, struct nameidata *, void *); | 1525 | void (*put_link) (struct dentry *, struct nameidata *, void *); |
1521 | void (*truncate) (struct inode *); | 1526 | void (*truncate) (struct inode *); |
1522 | int (*permission) (struct inode *, int); | 1527 | int (*permission) (struct inode *, int); |
1528 | int (*check_acl)(struct inode *, int); | ||
1523 | int (*setattr) (struct dentry *, struct iattr *); | 1529 | int (*setattr) (struct dentry *, struct iattr *); |
1524 | int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *); | 1530 | int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *); |
1525 | int (*setxattr) (struct dentry *, const char *,const void *,size_t,int); | 1531 | int (*setxattr) (struct dentry *, const char *,const void *,size_t,int); |
@@ -1780,6 +1786,7 @@ extern int get_sb_pseudo(struct file_system_type *, char *, | |||
1780 | struct vfsmount *mnt); | 1786 | struct vfsmount *mnt); |
1781 | extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb); | 1787 | extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb); |
1782 | int __put_super_and_need_restart(struct super_block *sb); | 1788 | int __put_super_and_need_restart(struct super_block *sb); |
1789 | void put_super(struct super_block *sb); | ||
1783 | 1790 | ||
1784 | /* Alas, no aliases. Too much hassle with bringing module.h everywhere */ | 1791 | /* Alas, no aliases. Too much hassle with bringing module.h everywhere */ |
1785 | #define fops_get(fops) \ | 1792 | #define fops_get(fops) \ |
@@ -1905,6 +1912,8 @@ static inline int break_lease(struct inode *inode, unsigned int mode) | |||
1905 | 1912 | ||
1906 | extern int do_truncate(struct dentry *, loff_t start, unsigned int time_attrs, | 1913 | extern int do_truncate(struct dentry *, loff_t start, unsigned int time_attrs, |
1907 | struct file *filp); | 1914 | struct file *filp); |
1915 | extern int do_fallocate(struct file *file, int mode, loff_t offset, | ||
1916 | loff_t len); | ||
1908 | extern long do_sys_open(int dfd, const char __user *filename, int flags, | 1917 | extern long do_sys_open(int dfd, const char __user *filename, int flags, |
1909 | int mode); | 1918 | int mode); |
1910 | extern struct file *filp_open(const char *, int, int); | 1919 | extern struct file *filp_open(const char *, int, int); |
@@ -1913,6 +1922,10 @@ extern struct file * dentry_open(struct dentry *, struct vfsmount *, int, | |||
1913 | extern int filp_close(struct file *, fl_owner_t id); | 1922 | extern int filp_close(struct file *, fl_owner_t id); |
1914 | extern char * getname(const char __user *); | 1923 | extern char * getname(const char __user *); |
1915 | 1924 | ||
1925 | /* fs/ioctl.c */ | ||
1926 | |||
1927 | extern int ioctl_preallocate(struct file *filp, void __user *argp); | ||
1928 | |||
1916 | /* fs/dcache.c */ | 1929 | /* fs/dcache.c */ |
1917 | extern void __init vfs_caches_init_early(void); | 1930 | extern void __init vfs_caches_init_early(void); |
1918 | extern void __init vfs_caches_init(unsigned long); | 1931 | extern void __init vfs_caches_init(unsigned long); |
@@ -1932,6 +1945,7 @@ extern void putname(const char *name); | |||
1932 | extern int register_blkdev(unsigned int, const char *); | 1945 | extern int register_blkdev(unsigned int, const char *); |
1933 | extern void unregister_blkdev(unsigned int, const char *); | 1946 | extern void unregister_blkdev(unsigned int, const char *); |
1934 | extern struct block_device *bdget(dev_t); | 1947 | extern struct block_device *bdget(dev_t); |
1948 | extern struct block_device *bdgrab(struct block_device *bdev); | ||
1935 | extern void bd_set_size(struct block_device *, loff_t size); | 1949 | extern void bd_set_size(struct block_device *, loff_t size); |
1936 | extern void bd_forget(struct inode *inode); | 1950 | extern void bd_forget(struct inode *inode); |
1937 | extern void bdput(struct block_device *); | 1951 | extern void bdput(struct block_device *); |
@@ -1983,12 +1997,25 @@ extern void bd_release_from_disk(struct block_device *, struct gendisk *); | |||
1983 | #define CHRDEV_MAJOR_HASH_SIZE 255 | 1997 | #define CHRDEV_MAJOR_HASH_SIZE 255 |
1984 | extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *); | 1998 | extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *); |
1985 | extern int register_chrdev_region(dev_t, unsigned, const char *); | 1999 | extern int register_chrdev_region(dev_t, unsigned, const char *); |
1986 | extern int register_chrdev(unsigned int, const char *, | 2000 | extern int __register_chrdev(unsigned int major, unsigned int baseminor, |
1987 | const struct file_operations *); | 2001 | unsigned int count, const char *name, |
1988 | extern void unregister_chrdev(unsigned int, const char *); | 2002 | const struct file_operations *fops); |
2003 | extern void __unregister_chrdev(unsigned int major, unsigned int baseminor, | ||
2004 | unsigned int count, const char *name); | ||
1989 | extern void unregister_chrdev_region(dev_t, unsigned); | 2005 | extern void unregister_chrdev_region(dev_t, unsigned); |
1990 | extern void chrdev_show(struct seq_file *,off_t); | 2006 | extern void chrdev_show(struct seq_file *,off_t); |
1991 | 2007 | ||
2008 | static inline int register_chrdev(unsigned int major, const char *name, | ||
2009 | const struct file_operations *fops) | ||
2010 | { | ||
2011 | return __register_chrdev(major, 0, 256, name, fops); | ||
2012 | } | ||
2013 | |||
2014 | static inline void unregister_chrdev(unsigned int major, const char *name) | ||
2015 | { | ||
2016 | __unregister_chrdev(major, 0, 256, name); | ||
2017 | } | ||
2018 | |||
1992 | /* fs/block_dev.c */ | 2019 | /* fs/block_dev.c */ |
1993 | #define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */ | 2020 | #define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */ |
1994 | #define BDEVT_SIZE 10 /* Largest string for MAJ:MIN for blkdev */ | 2021 | #define BDEVT_SIZE 10 /* Largest string for MAJ:MIN for blkdev */ |
@@ -2055,8 +2082,6 @@ static inline void invalidate_remote_inode(struct inode *inode) | |||
2055 | extern int invalidate_inode_pages2(struct address_space *mapping); | 2082 | extern int invalidate_inode_pages2(struct address_space *mapping); |
2056 | extern int invalidate_inode_pages2_range(struct address_space *mapping, | 2083 | extern int invalidate_inode_pages2_range(struct address_space *mapping, |
2057 | pgoff_t start, pgoff_t end); | 2084 | pgoff_t start, pgoff_t end); |
2058 | extern void generic_sync_sb_inodes(struct super_block *sb, | ||
2059 | struct writeback_control *wbc); | ||
2060 | extern int write_inode_now(struct inode *, int); | 2085 | extern int write_inode_now(struct inode *, int); |
2061 | extern int filemap_fdatawrite(struct address_space *); | 2086 | extern int filemap_fdatawrite(struct address_space *); |
2062 | extern int filemap_flush(struct address_space *); | 2087 | extern int filemap_flush(struct address_space *); |
@@ -2108,7 +2133,7 @@ extern struct file *do_filp_open(int dfd, const char *pathname, | |||
2108 | int open_flag, int mode, int acc_mode); | 2133 | int open_flag, int mode, int acc_mode); |
2109 | extern int may_open(struct path *, int, int); | 2134 | extern int may_open(struct path *, int, int); |
2110 | 2135 | ||
2111 | extern int kernel_read(struct file *, unsigned long, char *, unsigned long); | 2136 | extern int kernel_read(struct file *, loff_t, char *, unsigned long); |
2112 | extern struct file * open_exec(const char *); | 2137 | extern struct file * open_exec(const char *); |
2113 | 2138 | ||
2114 | /* fs/dcache.c -- generic fs support functions */ | 2139 | /* fs/dcache.c -- generic fs support functions */ |
@@ -2122,7 +2147,7 @@ extern loff_t default_llseek(struct file *file, loff_t offset, int origin); | |||
2122 | 2147 | ||
2123 | extern loff_t vfs_llseek(struct file *file, loff_t offset, int origin); | 2148 | extern loff_t vfs_llseek(struct file *file, loff_t offset, int origin); |
2124 | 2149 | ||
2125 | extern struct inode * inode_init_always(struct super_block *, struct inode *); | 2150 | extern int inode_init_always(struct super_block *, struct inode *); |
2126 | extern void inode_init_once(struct inode *); | 2151 | extern void inode_init_once(struct inode *); |
2127 | extern void inode_add_to_lists(struct super_block *, struct inode *); | 2152 | extern void inode_add_to_lists(struct super_block *, struct inode *); |
2128 | extern void iput(struct inode *); | 2153 | extern void iput(struct inode *); |
@@ -2149,6 +2174,7 @@ extern void __iget(struct inode * inode); | |||
2149 | extern void iget_failed(struct inode *); | 2174 | extern void iget_failed(struct inode *); |
2150 | extern void clear_inode(struct inode *); | 2175 | extern void clear_inode(struct inode *); |
2151 | extern void destroy_inode(struct inode *); | 2176 | extern void destroy_inode(struct inode *); |
2177 | extern void __destroy_inode(struct inode *); | ||
2152 | extern struct inode *new_inode(struct super_block *); | 2178 | extern struct inode *new_inode(struct super_block *); |
2153 | extern int should_remove_suid(struct dentry *); | 2179 | extern int should_remove_suid(struct dentry *); |
2154 | extern int file_remove_suid(struct file *); | 2180 | extern int file_remove_suid(struct file *); |
@@ -2170,7 +2196,6 @@ extern int bdev_read_only(struct block_device *); | |||
2170 | extern int set_blocksize(struct block_device *, int); | 2196 | extern int set_blocksize(struct block_device *, int); |
2171 | extern int sb_set_blocksize(struct super_block *, int); | 2197 | extern int sb_set_blocksize(struct super_block *, int); |
2172 | extern int sb_min_blocksize(struct super_block *, int); | 2198 | extern int sb_min_blocksize(struct super_block *, int); |
2173 | extern int sb_has_dirty_inodes(struct super_block *); | ||
2174 | 2199 | ||
2175 | extern int generic_file_mmap(struct file *, struct vm_area_struct *); | 2200 | extern int generic_file_mmap(struct file *, struct vm_area_struct *); |
2176 | extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *); | 2201 | extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *); |
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h index 244677cc082b..43fc95d822d5 100644 --- a/include/linux/fsl_devices.h +++ b/include/linux/fsl_devices.h | |||
@@ -79,10 +79,6 @@ struct fsl_spi_platform_data { | |||
79 | u16 max_chipselect; | 79 | u16 max_chipselect; |
80 | void (*cs_control)(struct spi_device *spi, bool on); | 80 | void (*cs_control)(struct spi_device *spi, bool on); |
81 | u32 sysclk; | 81 | u32 sysclk; |
82 | |||
83 | /* Legacy hooks, used by mpc52xx_psc_spi driver. */ | ||
84 | void (*activate_cs)(u8 cs, u8 polarity); | ||
85 | void (*deactivate_cs)(u8 cs, u8 polarity); | ||
86 | }; | 82 | }; |
87 | 83 | ||
88 | struct mpc8xx_pcmcia_ops { | 84 | struct mpc8xx_pcmcia_ops { |
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h index 44848aa830dc..4d6f47b51189 100644 --- a/include/linux/fsnotify_backend.h +++ b/include/linux/fsnotify_backend.h | |||
@@ -280,7 +280,7 @@ static inline void __fsnotify_update_dcache_flags(struct dentry *dentry) | |||
280 | assert_spin_locked(&dentry->d_lock); | 280 | assert_spin_locked(&dentry->d_lock); |
281 | 281 | ||
282 | parent = dentry->d_parent; | 282 | parent = dentry->d_parent; |
283 | if (fsnotify_inode_watches_children(parent->d_inode)) | 283 | if (parent->d_inode && fsnotify_inode_watches_children(parent->d_inode)) |
284 | dentry->d_flags |= DCACHE_FSNOTIFY_PARENT_WATCHED; | 284 | dentry->d_flags |= DCACHE_FSNOTIFY_PARENT_WATCHED; |
285 | else | 285 | else |
286 | dentry->d_flags &= ~DCACHE_FSNOTIFY_PARENT_WATCHED; | 286 | dentry->d_flags &= ~DCACHE_FSNOTIFY_PARENT_WATCHED; |
@@ -352,7 +352,7 @@ extern void fsnotify_unmount_inodes(struct list_head *list); | |||
352 | /* put here because inotify does some weird stuff when destroying watches */ | 352 | /* put here because inotify does some weird stuff when destroying watches */ |
353 | extern struct fsnotify_event *fsnotify_create_event(struct inode *to_tell, __u32 mask, | 353 | extern struct fsnotify_event *fsnotify_create_event(struct inode *to_tell, __u32 mask, |
354 | void *data, int data_is, const char *name, | 354 | void *data, int data_is, const char *name, |
355 | u32 cookie); | 355 | u32 cookie, gfp_t gfp); |
356 | 356 | ||
357 | #else | 357 | #else |
358 | 358 | ||
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 39b95c56587e..dc3b1328aaeb 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
@@ -362,6 +362,7 @@ struct ftrace_ret_stack { | |||
362 | unsigned long func; | 362 | unsigned long func; |
363 | unsigned long long calltime; | 363 | unsigned long long calltime; |
364 | unsigned long long subtime; | 364 | unsigned long long subtime; |
365 | unsigned long fp; | ||
365 | }; | 366 | }; |
366 | 367 | ||
367 | /* | 368 | /* |
@@ -372,7 +373,8 @@ struct ftrace_ret_stack { | |||
372 | extern void return_to_handler(void); | 373 | extern void return_to_handler(void); |
373 | 374 | ||
374 | extern int | 375 | extern int |
375 | ftrace_push_return_trace(unsigned long ret, unsigned long func, int *depth); | 376 | ftrace_push_return_trace(unsigned long ret, unsigned long func, int *depth, |
377 | unsigned long frame_pointer); | ||
376 | 378 | ||
377 | /* | 379 | /* |
378 | * Sometimes we don't want to trace a function with the function | 380 | * Sometimes we don't want to trace a function with the function |
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 5c093ffc655b..a81170de7f6b 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
@@ -89,7 +89,9 @@ enum print_line_t { | |||
89 | TRACE_TYPE_NO_CONSUME = 3 /* Handled but ask to not consume */ | 89 | TRACE_TYPE_NO_CONSUME = 3 /* Handled but ask to not consume */ |
90 | }; | 90 | }; |
91 | 91 | ||
92 | 92 | void tracing_generic_entry_update(struct trace_entry *entry, | |
93 | unsigned long flags, | ||
94 | int pc); | ||
93 | struct ring_buffer_event * | 95 | struct ring_buffer_event * |
94 | trace_current_buffer_lock_reserve(int type, unsigned long len, | 96 | trace_current_buffer_lock_reserve(int type, unsigned long len, |
95 | unsigned long flags, int pc); | 97 | unsigned long flags, int pc); |
@@ -119,11 +121,9 @@ struct ftrace_event_call { | |||
119 | void *filter; | 121 | void *filter; |
120 | void *mod; | 122 | void *mod; |
121 | 123 | ||
122 | #ifdef CONFIG_EVENT_PROFILE | 124 | atomic_t profile_count; |
123 | atomic_t profile_count; | 125 | int (*profile_enable)(struct ftrace_event_call *); |
124 | int (*profile_enable)(struct ftrace_event_call *); | 126 | void (*profile_disable)(struct ftrace_event_call *); |
125 | void (*profile_disable)(struct ftrace_event_call *); | ||
126 | #endif | ||
127 | }; | 127 | }; |
128 | 128 | ||
129 | #define MAX_FILTER_PRED 32 | 129 | #define MAX_FILTER_PRED 32 |
diff --git a/include/linux/fuse.h b/include/linux/fuse.h index d41ed593f79f..cf593bf9fd32 100644 --- a/include/linux/fuse.h +++ b/include/linux/fuse.h | |||
@@ -25,6 +25,11 @@ | |||
25 | * - add IOCTL message | 25 | * - add IOCTL message |
26 | * - add unsolicited notification support | 26 | * - add unsolicited notification support |
27 | * - add POLL message and NOTIFY_POLL notification | 27 | * - add POLL message and NOTIFY_POLL notification |
28 | * | ||
29 | * 7.12 | ||
30 | * - add umask flag to input argument of open, mknod and mkdir | ||
31 | * - add notification messages for invalidation of inodes and | ||
32 | * directory entries | ||
28 | */ | 33 | */ |
29 | 34 | ||
30 | #ifndef _LINUX_FUSE_H | 35 | #ifndef _LINUX_FUSE_H |
@@ -36,7 +41,7 @@ | |||
36 | #define FUSE_KERNEL_VERSION 7 | 41 | #define FUSE_KERNEL_VERSION 7 |
37 | 42 | ||
38 | /** Minor version number of this interface */ | 43 | /** Minor version number of this interface */ |
39 | #define FUSE_KERNEL_MINOR_VERSION 11 | 44 | #define FUSE_KERNEL_MINOR_VERSION 12 |
40 | 45 | ||
41 | /** The node ID of the root inode */ | 46 | /** The node ID of the root inode */ |
42 | #define FUSE_ROOT_ID 1 | 47 | #define FUSE_ROOT_ID 1 |
@@ -112,6 +117,7 @@ struct fuse_file_lock { | |||
112 | * INIT request/reply flags | 117 | * INIT request/reply flags |
113 | * | 118 | * |
114 | * FUSE_EXPORT_SUPPORT: filesystem handles lookups of "." and ".." | 119 | * FUSE_EXPORT_SUPPORT: filesystem handles lookups of "." and ".." |
120 | * FUSE_DONT_MASK: don't apply umask to file mode on create operations | ||
115 | */ | 121 | */ |
116 | #define FUSE_ASYNC_READ (1 << 0) | 122 | #define FUSE_ASYNC_READ (1 << 0) |
117 | #define FUSE_POSIX_LOCKS (1 << 1) | 123 | #define FUSE_POSIX_LOCKS (1 << 1) |
@@ -119,6 +125,7 @@ struct fuse_file_lock { | |||
119 | #define FUSE_ATOMIC_O_TRUNC (1 << 3) | 125 | #define FUSE_ATOMIC_O_TRUNC (1 << 3) |
120 | #define FUSE_EXPORT_SUPPORT (1 << 4) | 126 | #define FUSE_EXPORT_SUPPORT (1 << 4) |
121 | #define FUSE_BIG_WRITES (1 << 5) | 127 | #define FUSE_BIG_WRITES (1 << 5) |
128 | #define FUSE_DONT_MASK (1 << 6) | ||
122 | 129 | ||
123 | /** | 130 | /** |
124 | * CUSE INIT request/reply flags | 131 | * CUSE INIT request/reply flags |
@@ -224,6 +231,8 @@ enum fuse_opcode { | |||
224 | 231 | ||
225 | enum fuse_notify_code { | 232 | enum fuse_notify_code { |
226 | FUSE_NOTIFY_POLL = 1, | 233 | FUSE_NOTIFY_POLL = 1, |
234 | FUSE_NOTIFY_INVAL_INODE = 2, | ||
235 | FUSE_NOTIFY_INVAL_ENTRY = 3, | ||
227 | FUSE_NOTIFY_CODE_MAX, | 236 | FUSE_NOTIFY_CODE_MAX, |
228 | }; | 237 | }; |
229 | 238 | ||
@@ -262,14 +271,18 @@ struct fuse_attr_out { | |||
262 | struct fuse_attr attr; | 271 | struct fuse_attr attr; |
263 | }; | 272 | }; |
264 | 273 | ||
274 | #define FUSE_COMPAT_MKNOD_IN_SIZE 8 | ||
275 | |||
265 | struct fuse_mknod_in { | 276 | struct fuse_mknod_in { |
266 | __u32 mode; | 277 | __u32 mode; |
267 | __u32 rdev; | 278 | __u32 rdev; |
279 | __u32 umask; | ||
280 | __u32 padding; | ||
268 | }; | 281 | }; |
269 | 282 | ||
270 | struct fuse_mkdir_in { | 283 | struct fuse_mkdir_in { |
271 | __u32 mode; | 284 | __u32 mode; |
272 | __u32 padding; | 285 | __u32 umask; |
273 | }; | 286 | }; |
274 | 287 | ||
275 | struct fuse_rename_in { | 288 | struct fuse_rename_in { |
@@ -301,7 +314,14 @@ struct fuse_setattr_in { | |||
301 | 314 | ||
302 | struct fuse_open_in { | 315 | struct fuse_open_in { |
303 | __u32 flags; | 316 | __u32 flags; |
317 | __u32 unused; | ||
318 | }; | ||
319 | |||
320 | struct fuse_create_in { | ||
321 | __u32 flags; | ||
304 | __u32 mode; | 322 | __u32 mode; |
323 | __u32 umask; | ||
324 | __u32 padding; | ||
305 | }; | 325 | }; |
306 | 326 | ||
307 | struct fuse_open_out { | 327 | struct fuse_open_out { |
@@ -508,4 +528,16 @@ struct fuse_dirent { | |||
508 | #define FUSE_DIRENT_SIZE(d) \ | 528 | #define FUSE_DIRENT_SIZE(d) \ |
509 | FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen) | 529 | FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen) |
510 | 530 | ||
531 | struct fuse_notify_inval_inode_out { | ||
532 | __u64 ino; | ||
533 | __s64 off; | ||
534 | __s64 len; | ||
535 | }; | ||
536 | |||
537 | struct fuse_notify_inval_entry_out { | ||
538 | __u64 parent; | ||
539 | __u32 namelen; | ||
540 | __u32 padding; | ||
541 | }; | ||
542 | |||
511 | #endif /* _LINUX_FUSE_H */ | 543 | #endif /* _LINUX_FUSE_H */ |
diff --git a/include/linux/gameport.h b/include/linux/gameport.h index 0cd825f7363a..1bc08541c2b9 100644 --- a/include/linux/gameport.h +++ b/include/linux/gameport.h | |||
@@ -11,6 +11,7 @@ | |||
11 | 11 | ||
12 | #ifdef __KERNEL__ | 12 | #ifdef __KERNEL__ |
13 | #include <asm/io.h> | 13 | #include <asm/io.h> |
14 | #include <linux/types.h> | ||
14 | #include <linux/list.h> | 15 | #include <linux/list.h> |
15 | #include <linux/mutex.h> | 16 | #include <linux/mutex.h> |
16 | #include <linux/device.h> | 17 | #include <linux/device.h> |
@@ -62,7 +63,7 @@ struct gameport_driver { | |||
62 | 63 | ||
63 | struct device_driver driver; | 64 | struct device_driver driver; |
64 | 65 | ||
65 | unsigned int ignore; | 66 | bool ignore; |
66 | }; | 67 | }; |
67 | #define to_gameport_driver(d) container_of(d, struct gameport_driver, driver) | 68 | #define to_gameport_driver(d) container_of(d, struct gameport_driver, driver) |
68 | 69 | ||
diff --git a/include/linux/gcd.h b/include/linux/gcd.h new file mode 100644 index 000000000000..69f5e8a01bad --- /dev/null +++ b/include/linux/gcd.h | |||
@@ -0,0 +1,8 @@ | |||
1 | #ifndef _GCD_H | ||
2 | #define _GCD_H | ||
3 | |||
4 | #include <linux/compiler.h> | ||
5 | |||
6 | unsigned long gcd(unsigned long a, unsigned long b) __attribute_const__; | ||
7 | |||
8 | #endif /* _GCD_H */ | ||
diff --git a/include/linux/gen_stats.h b/include/linux/gen_stats.h index 0ffa41df0ee8..710e901085d0 100644 --- a/include/linux/gen_stats.h +++ b/include/linux/gen_stats.h | |||
@@ -22,6 +22,11 @@ struct gnet_stats_basic | |||
22 | { | 22 | { |
23 | __u64 bytes; | 23 | __u64 bytes; |
24 | __u32 packets; | 24 | __u32 packets; |
25 | }; | ||
26 | struct gnet_stats_basic_packed | ||
27 | { | ||
28 | __u64 bytes; | ||
29 | __u32 packets; | ||
25 | } __attribute__ ((packed)); | 30 | } __attribute__ ((packed)); |
26 | 31 | ||
27 | /** | 32 | /** |
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index cfdb35d71bca..7c777a0da17a 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -99,7 +99,7 @@ struct vm_area_struct; | |||
99 | __GFP_NORETRY|__GFP_NOMEMALLOC) | 99 | __GFP_NORETRY|__GFP_NOMEMALLOC) |
100 | 100 | ||
101 | /* Control slab gfp mask during early boot */ | 101 | /* Control slab gfp mask during early boot */ |
102 | #define SLAB_GFP_BOOT_MASK __GFP_BITS_MASK & ~(__GFP_WAIT|__GFP_IO|__GFP_FS) | 102 | #define GFP_BOOT_MASK __GFP_BITS_MASK & ~(__GFP_WAIT|__GFP_IO|__GFP_FS) |
103 | 103 | ||
104 | /* Control allocation constraints */ | 104 | /* Control allocation constraints */ |
105 | #define GFP_CONSTRAINT_MASK (__GFP_HARDWALL|__GFP_THISNODE) | 105 | #define GFP_CONSTRAINT_MASK (__GFP_HARDWALL|__GFP_THISNODE) |
@@ -348,4 +348,11 @@ static inline void oom_killer_enable(void) | |||
348 | oom_killer_disabled = false; | 348 | oom_killer_disabled = false; |
349 | } | 349 | } |
350 | 350 | ||
351 | extern gfp_t gfp_allowed_mask; | ||
352 | |||
353 | static inline void set_gfp_allowed_mask(gfp_t mask) | ||
354 | { | ||
355 | gfp_allowed_mask = mask; | ||
356 | } | ||
357 | |||
351 | #endif /* __LINUX_GFP_H */ | 358 | #endif /* __LINUX_GFP_H */ |
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index 45257475623c..8246c697863d 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h | |||
@@ -2,7 +2,9 @@ | |||
2 | #define LINUX_HARDIRQ_H | 2 | #define LINUX_HARDIRQ_H |
3 | 3 | ||
4 | #include <linux/preempt.h> | 4 | #include <linux/preempt.h> |
5 | #ifdef CONFIG_PREEMPT | ||
5 | #include <linux/smp_lock.h> | 6 | #include <linux/smp_lock.h> |
7 | #endif | ||
6 | #include <linux/lockdep.h> | 8 | #include <linux/lockdep.h> |
7 | #include <linux/ftrace_irq.h> | 9 | #include <linux/ftrace_irq.h> |
8 | #include <asm/hardirq.h> | 10 | #include <asm/hardirq.h> |
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 7400900de94a..4759917adc71 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/list.h> | 21 | #include <linux/list.h> |
22 | #include <linux/wait.h> | 22 | #include <linux/wait.h> |
23 | #include <linux/percpu.h> | 23 | #include <linux/percpu.h> |
24 | #include <linux/timer.h> | ||
24 | 25 | ||
25 | 26 | ||
26 | struct hrtimer_clock_base; | 27 | struct hrtimer_clock_base; |
@@ -447,6 +448,8 @@ extern void timer_stats_update_stats(void *timer, pid_t pid, void *startf, | |||
447 | 448 | ||
448 | static inline void timer_stats_account_hrtimer(struct hrtimer *timer) | 449 | static inline void timer_stats_account_hrtimer(struct hrtimer *timer) |
449 | { | 450 | { |
451 | if (likely(!timer->start_site)) | ||
452 | return; | ||
450 | timer_stats_update_stats(timer, timer->start_pid, timer->start_site, | 453 | timer_stats_update_stats(timer, timer->start_pid, timer->start_site, |
451 | timer->function, timer->start_comm, 0); | 454 | timer->function, timer->start_comm, 0); |
452 | } | 455 | } |
@@ -456,6 +459,8 @@ extern void __timer_stats_hrtimer_set_start_info(struct hrtimer *timer, | |||
456 | 459 | ||
457 | static inline void timer_stats_hrtimer_set_start_info(struct hrtimer *timer) | 460 | static inline void timer_stats_hrtimer_set_start_info(struct hrtimer *timer) |
458 | { | 461 | { |
462 | if (likely(!timer_stats_active)) | ||
463 | return; | ||
459 | __timer_stats_hrtimer_set_start_info(timer, __builtin_return_address(0)); | 464 | __timer_stats_hrtimer_set_start_info(timer, __builtin_return_address(0)); |
460 | } | 465 | } |
461 | 466 | ||
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index a05a5ef33391..5cbc620bdfe0 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <asm/tlbflush.h> | 10 | #include <asm/tlbflush.h> |
11 | 11 | ||
12 | struct ctl_table; | 12 | struct ctl_table; |
13 | struct user_struct; | ||
13 | 14 | ||
14 | int PageHuge(struct page *page); | 15 | int PageHuge(struct page *page); |
15 | 16 | ||
@@ -33,7 +34,7 @@ void hugetlb_report_meminfo(struct seq_file *); | |||
33 | int hugetlb_report_node_meminfo(int, char *); | 34 | int hugetlb_report_node_meminfo(int, char *); |
34 | unsigned long hugetlb_total_pages(void); | 35 | unsigned long hugetlb_total_pages(void); |
35 | int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, | 36 | int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, |
36 | unsigned long address, int write_access); | 37 | unsigned long address, unsigned int flags); |
37 | int hugetlb_reserve_pages(struct inode *inode, long from, long to, | 38 | int hugetlb_reserve_pages(struct inode *inode, long from, long to, |
38 | struct vm_area_struct *vma, | 39 | struct vm_area_struct *vma, |
39 | int acctflags); | 40 | int acctflags); |
@@ -98,7 +99,7 @@ static inline void hugetlb_report_meminfo(struct seq_file *m) | |||
98 | #define pud_huge(x) 0 | 99 | #define pud_huge(x) 0 |
99 | #define is_hugepage_only_range(mm, addr, len) 0 | 100 | #define is_hugepage_only_range(mm, addr, len) 0 |
100 | #define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; }) | 101 | #define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; }) |
101 | #define hugetlb_fault(mm, vma, addr, write) ({ BUG(); 0; }) | 102 | #define hugetlb_fault(mm, vma, addr, flags) ({ BUG(); 0; }) |
102 | 103 | ||
103 | #define hugetlb_change_protection(vma, address, end, newprot) | 104 | #define hugetlb_change_protection(vma, address, end, newprot) |
104 | 105 | ||
@@ -146,7 +147,8 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb) | |||
146 | 147 | ||
147 | extern const struct file_operations hugetlbfs_file_operations; | 148 | extern const struct file_operations hugetlbfs_file_operations; |
148 | extern struct vm_operations_struct hugetlb_vm_ops; | 149 | extern struct vm_operations_struct hugetlb_vm_ops; |
149 | struct file *hugetlb_file_setup(const char *name, size_t, int); | 150 | struct file *hugetlb_file_setup(const char *name, size_t size, int acct, |
151 | struct user_struct **user); | ||
150 | int hugetlb_get_quota(struct address_space *mapping, long delta); | 152 | int hugetlb_get_quota(struct address_space *mapping, long delta); |
151 | void hugetlb_put_quota(struct address_space *mapping, long delta); | 153 | void hugetlb_put_quota(struct address_space *mapping, long delta); |
152 | 154 | ||
@@ -168,7 +170,7 @@ static inline void set_file_hugepages(struct file *file) | |||
168 | 170 | ||
169 | #define is_file_hugepages(file) 0 | 171 | #define is_file_hugepages(file) 0 |
170 | #define set_file_hugepages(file) BUG() | 172 | #define set_file_hugepages(file) BUG() |
171 | #define hugetlb_file_setup(name,size,acctflag) ERR_PTR(-ENOSYS) | 173 | #define hugetlb_file_setup(name,size,acct,user) ERR_PTR(-ENOSYS) |
172 | 174 | ||
173 | #endif /* !CONFIG_HUGETLBFS */ | 175 | #endif /* !CONFIG_HUGETLBFS */ |
174 | 176 | ||
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index ad2580596033..f4784c0fe975 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -47,6 +47,7 @@ struct i2c_driver; | |||
47 | union i2c_smbus_data; | 47 | union i2c_smbus_data; |
48 | struct i2c_board_info; | 48 | struct i2c_board_info; |
49 | 49 | ||
50 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) | ||
50 | /* | 51 | /* |
51 | * The master routines are the ones normally used to transmit data to devices | 52 | * The master routines are the ones normally used to transmit data to devices |
52 | * on a bus (or read from them). Apart from two basic transfer functions to | 53 | * on a bus (or read from them). Apart from two basic transfer functions to |
@@ -93,6 +94,7 @@ extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client *client, | |||
93 | extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client *client, | 94 | extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client *client, |
94 | u8 command, u8 length, | 95 | u8 command, u8 length, |
95 | const u8 *values); | 96 | const u8 *values); |
97 | #endif /* I2C */ | ||
96 | 98 | ||
97 | /** | 99 | /** |
98 | * struct i2c_driver - represent an I2C device driver | 100 | * struct i2c_driver - represent an I2C device driver |
@@ -100,9 +102,8 @@ extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client *client, | |||
100 | * @class: What kind of i2c device we instantiate (for detect) | 102 | * @class: What kind of i2c device we instantiate (for detect) |
101 | * @attach_adapter: Callback for bus addition (for legacy drivers) | 103 | * @attach_adapter: Callback for bus addition (for legacy drivers) |
102 | * @detach_adapter: Callback for bus removal (for legacy drivers) | 104 | * @detach_adapter: Callback for bus removal (for legacy drivers) |
103 | * @detach_client: Callback for device removal (for legacy drivers) | 105 | * @probe: Callback for device binding |
104 | * @probe: Callback for device binding (new-style drivers) | 106 | * @remove: Callback for device unbinding |
105 | * @remove: Callback for device unbinding (new-style drivers) | ||
106 | * @shutdown: Callback for device shutdown | 107 | * @shutdown: Callback for device shutdown |
107 | * @suspend: Callback for device suspend | 108 | * @suspend: Callback for device suspend |
108 | * @resume: Callback for device resume | 109 | * @resume: Callback for device resume |
@@ -137,26 +138,14 @@ struct i2c_driver { | |||
137 | int id; | 138 | int id; |
138 | unsigned int class; | 139 | unsigned int class; |
139 | 140 | ||
140 | /* Notifies the driver that a new bus has appeared. This routine | 141 | /* Notifies the driver that a new bus has appeared or is about to be |
141 | * can be used by the driver to test if the bus meets its conditions | 142 | * removed. You should avoid using this if you can, it will probably |
142 | * & seek for the presence of the chip(s) it supports. If found, it | 143 | * be removed in a near future. |
143 | * registers the client(s) that are on the bus to the i2c admin. via | ||
144 | * i2c_attach_client. (LEGACY I2C DRIVERS ONLY) | ||
145 | */ | 144 | */ |
146 | int (*attach_adapter)(struct i2c_adapter *); | 145 | int (*attach_adapter)(struct i2c_adapter *); |
147 | int (*detach_adapter)(struct i2c_adapter *); | 146 | int (*detach_adapter)(struct i2c_adapter *); |
148 | 147 | ||
149 | /* tells the driver that a client is about to be deleted & gives it | 148 | /* Standard driver model interfaces */ |
150 | * the chance to remove its private data. Also, if the client struct | ||
151 | * has been dynamically allocated by the driver in the function above, | ||
152 | * it must be freed here. (LEGACY I2C DRIVERS ONLY) | ||
153 | */ | ||
154 | int (*detach_client)(struct i2c_client *) __deprecated; | ||
155 | |||
156 | /* Standard driver model interfaces, for "new style" i2c drivers. | ||
157 | * With the driver model, device enumeration is NEVER done by drivers; | ||
158 | * it's done by infrastructure. (NEW STYLE DRIVERS ONLY) | ||
159 | */ | ||
160 | int (*probe)(struct i2c_client *, const struct i2c_device_id *); | 149 | int (*probe)(struct i2c_client *, const struct i2c_device_id *); |
161 | int (*remove)(struct i2c_client *); | 150 | int (*remove)(struct i2c_client *); |
162 | 151 | ||
@@ -191,9 +180,8 @@ struct i2c_driver { | |||
191 | * @driver: device's driver, hence pointer to access routines | 180 | * @driver: device's driver, hence pointer to access routines |
192 | * @dev: Driver model device node for the slave. | 181 | * @dev: Driver model device node for the slave. |
193 | * @irq: indicates the IRQ generated by this device (if any) | 182 | * @irq: indicates the IRQ generated by this device (if any) |
194 | * @list: list of active/busy clients (DEPRECATED) | 183 | * @detected: member of an i2c_driver.clients list or i2c-core's |
195 | * @detected: member of an i2c_driver.clients list | 184 | * userspace_devices list |
196 | * @released: used to synchronize client releases & detaches and references | ||
197 | * | 185 | * |
198 | * An i2c_client identifies a single device (i.e. chip) connected to an | 186 | * An i2c_client identifies a single device (i.e. chip) connected to an |
199 | * i2c bus. The behaviour exposed to Linux is defined by the driver | 187 | * i2c bus. The behaviour exposed to Linux is defined by the driver |
@@ -209,9 +197,7 @@ struct i2c_client { | |||
209 | struct i2c_driver *driver; /* and our access routines */ | 197 | struct i2c_driver *driver; /* and our access routines */ |
210 | struct device dev; /* the device structure */ | 198 | struct device dev; /* the device structure */ |
211 | int irq; /* irq issued by device */ | 199 | int irq; /* irq issued by device */ |
212 | struct list_head list; /* DEPRECATED */ | ||
213 | struct list_head detected; | 200 | struct list_head detected; |
214 | struct completion released; | ||
215 | }; | 201 | }; |
216 | #define to_i2c_client(d) container_of(d, struct i2c_client, dev) | 202 | #define to_i2c_client(d) container_of(d, struct i2c_client, dev) |
217 | 203 | ||
@@ -248,11 +234,10 @@ static inline void i2c_set_clientdata(struct i2c_client *dev, void *data) | |||
248 | * that, such as chip type, configuration, associated IRQ, and so on. | 234 | * that, such as chip type, configuration, associated IRQ, and so on. |
249 | * | 235 | * |
250 | * i2c_board_info is used to build tables of information listing I2C devices | 236 | * i2c_board_info is used to build tables of information listing I2C devices |
251 | * that are present. This information is used to grow the driver model tree | 237 | * that are present. This information is used to grow the driver model tree. |
252 | * for "new style" I2C drivers. For mainboards this is done statically using | 238 | * For mainboards this is done statically using i2c_register_board_info(); |
253 | * i2c_register_board_info(); bus numbers identify adapters that aren't | 239 | * bus numbers identify adapters that aren't yet available. For add-on boards, |
254 | * yet available. For add-on boards, i2c_new_device() does this dynamically | 240 | * i2c_new_device() does this dynamically with the adapter already known. |
255 | * with the adapter already known. | ||
256 | */ | 241 | */ |
257 | struct i2c_board_info { | 242 | struct i2c_board_info { |
258 | char type[I2C_NAME_SIZE]; | 243 | char type[I2C_NAME_SIZE]; |
@@ -277,6 +262,7 @@ struct i2c_board_info { | |||
277 | .type = dev_type, .addr = (dev_addr) | 262 | .type = dev_type, .addr = (dev_addr) |
278 | 263 | ||
279 | 264 | ||
265 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) | ||
280 | /* Add-on boards should register/unregister their devices; e.g. a board | 266 | /* Add-on boards should register/unregister their devices; e.g. a board |
281 | * with integrated I2C, a config eeprom, sensors, and a codec that's | 267 | * with integrated I2C, a config eeprom, sensors, and a codec that's |
282 | * used in conjunction with the primary hardware. | 268 | * used in conjunction with the primary hardware. |
@@ -300,6 +286,7 @@ extern struct i2c_client * | |||
300 | i2c_new_dummy(struct i2c_adapter *adap, u16 address); | 286 | i2c_new_dummy(struct i2c_adapter *adap, u16 address); |
301 | 287 | ||
302 | extern void i2c_unregister_device(struct i2c_client *); | 288 | extern void i2c_unregister_device(struct i2c_client *); |
289 | #endif /* I2C */ | ||
303 | 290 | ||
304 | /* Mainboard arch_initcall() code should register all its I2C devices. | 291 | /* Mainboard arch_initcall() code should register all its I2C devices. |
305 | * This is done at arch_initcall time, before declaring any i2c adapters. | 292 | * This is done at arch_initcall time, before declaring any i2c adapters. |
@@ -316,7 +303,7 @@ i2c_register_board_info(int busnum, struct i2c_board_info const *info, | |||
316 | { | 303 | { |
317 | return 0; | 304 | return 0; |
318 | } | 305 | } |
319 | #endif | 306 | #endif /* I2C_BOARDINFO */ |
320 | 307 | ||
321 | /* | 308 | /* |
322 | * The following structs are for those who like to implement new bus drivers: | 309 | * The following structs are for those who like to implement new bus drivers: |
@@ -352,21 +339,15 @@ struct i2c_adapter { | |||
352 | const struct i2c_algorithm *algo; /* the algorithm to access the bus */ | 339 | const struct i2c_algorithm *algo; /* the algorithm to access the bus */ |
353 | void *algo_data; | 340 | void *algo_data; |
354 | 341 | ||
355 | /* --- administration stuff. */ | ||
356 | int (*client_register)(struct i2c_client *) __deprecated; | ||
357 | int (*client_unregister)(struct i2c_client *) __deprecated; | ||
358 | |||
359 | /* data fields that are valid for all devices */ | 342 | /* data fields that are valid for all devices */ |
360 | u8 level; /* nesting level for lockdep */ | 343 | u8 level; /* nesting level for lockdep */ |
361 | struct mutex bus_lock; | 344 | struct mutex bus_lock; |
362 | struct mutex clist_lock; | ||
363 | 345 | ||
364 | int timeout; /* in jiffies */ | 346 | int timeout; /* in jiffies */ |
365 | int retries; | 347 | int retries; |
366 | struct device dev; /* the adapter device */ | 348 | struct device dev; /* the adapter device */ |
367 | 349 | ||
368 | int nr; | 350 | int nr; |
369 | struct list_head clients; /* DEPRECATED */ | ||
370 | char name[48]; | 351 | char name[48]; |
371 | struct completion dev_released; | 352 | struct completion dev_released; |
372 | }; | 353 | }; |
@@ -412,11 +393,16 @@ struct i2c_client_address_data { | |||
412 | /* The numbers to use to set I2C bus address */ | 393 | /* The numbers to use to set I2C bus address */ |
413 | #define ANY_I2C_BUS 0xffff | 394 | #define ANY_I2C_BUS 0xffff |
414 | 395 | ||
396 | /* Construct an I2C_CLIENT_END-terminated array of i2c addresses */ | ||
397 | #define I2C_ADDRS(addr, addrs...) \ | ||
398 | ((const unsigned short []){ addr, ## addrs, I2C_CLIENT_END }) | ||
399 | |||
415 | 400 | ||
416 | /* ----- functions exported by i2c.o */ | 401 | /* ----- functions exported by i2c.o */ |
417 | 402 | ||
418 | /* administration... | 403 | /* administration... |
419 | */ | 404 | */ |
405 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) | ||
420 | extern int i2c_add_adapter(struct i2c_adapter *); | 406 | extern int i2c_add_adapter(struct i2c_adapter *); |
421 | extern int i2c_del_adapter(struct i2c_adapter *); | 407 | extern int i2c_del_adapter(struct i2c_adapter *); |
422 | extern int i2c_add_numbered_adapter(struct i2c_adapter *); | 408 | extern int i2c_add_numbered_adapter(struct i2c_adapter *); |
@@ -429,11 +415,6 @@ static inline int i2c_add_driver(struct i2c_driver *driver) | |||
429 | return i2c_register_driver(THIS_MODULE, driver); | 415 | return i2c_register_driver(THIS_MODULE, driver); |
430 | } | 416 | } |
431 | 417 | ||
432 | /* These are deprecated, your driver should use the standard .probe() | ||
433 | * and .remove() methods instead. */ | ||
434 | extern int __deprecated i2c_attach_client(struct i2c_client *); | ||
435 | extern int __deprecated i2c_detach_client(struct i2c_client *); | ||
436 | |||
437 | extern struct i2c_client *i2c_use_client(struct i2c_client *client); | 418 | extern struct i2c_client *i2c_use_client(struct i2c_client *client); |
438 | extern void i2c_release_client(struct i2c_client *client); | 419 | extern void i2c_release_client(struct i2c_client *client); |
439 | 420 | ||
@@ -442,14 +423,6 @@ extern void i2c_release_client(struct i2c_client *client); | |||
442 | extern void i2c_clients_command(struct i2c_adapter *adap, | 423 | extern void i2c_clients_command(struct i2c_adapter *adap, |
443 | unsigned int cmd, void *arg); | 424 | unsigned int cmd, void *arg); |
444 | 425 | ||
445 | /* Detect function. It iterates over all possible addresses itself. | ||
446 | * It will only call found_proc if some client is connected at the | ||
447 | * specific address (unless a 'force' matched); | ||
448 | */ | ||
449 | extern int i2c_probe(struct i2c_adapter *adapter, | ||
450 | const struct i2c_client_address_data *address_data, | ||
451 | int (*found_proc) (struct i2c_adapter *, int, int)); | ||
452 | |||
453 | extern struct i2c_adapter *i2c_get_adapter(int id); | 426 | extern struct i2c_adapter *i2c_get_adapter(int id); |
454 | extern void i2c_put_adapter(struct i2c_adapter *adap); | 427 | extern void i2c_put_adapter(struct i2c_adapter *adap); |
455 | 428 | ||
@@ -471,6 +444,7 @@ static inline int i2c_adapter_id(struct i2c_adapter *adap) | |||
471 | { | 444 | { |
472 | return adap->nr; | 445 | return adap->nr; |
473 | } | 446 | } |
447 | #endif /* I2C */ | ||
474 | #endif /* __KERNEL__ */ | 448 | #endif /* __KERNEL__ */ |
475 | 449 | ||
476 | /** | 450 | /** |
diff --git a/include/linux/i2c/lm8323.h b/include/linux/i2c/lm8323.h new file mode 100644 index 000000000000..478d668bc590 --- /dev/null +++ b/include/linux/i2c/lm8323.h | |||
@@ -0,0 +1,46 @@ | |||
1 | /* | ||
2 | * lm8323.h - Configuration for LM8323 keypad driver. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation (version 2 of the License only). | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program; if not, write to the Free Software | ||
15 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
16 | */ | ||
17 | |||
18 | #ifndef __LINUX_LM8323_H | ||
19 | #define __LINUX_LM8323_H | ||
20 | |||
21 | #include <linux/types.h> | ||
22 | |||
23 | /* | ||
24 | * Largest keycode that the chip can send, plus one, | ||
25 | * so keys can be mapped directly at the index of the | ||
26 | * LM8323 keycode instead of subtracting one. | ||
27 | */ | ||
28 | #define LM8323_KEYMAP_SIZE (0x7f + 1) | ||
29 | |||
30 | #define LM8323_NUM_PWMS 3 | ||
31 | |||
32 | struct lm8323_platform_data { | ||
33 | int debounce_time; /* Time to watch for key bouncing, in ms. */ | ||
34 | int active_time; /* Idle time until sleep, in ms. */ | ||
35 | |||
36 | int size_x; | ||
37 | int size_y; | ||
38 | bool repeat; | ||
39 | const unsigned short *keymap; | ||
40 | |||
41 | const char *pwm_names[LM8323_NUM_PWMS]; | ||
42 | |||
43 | const char *name; /* Device name. */ | ||
44 | }; | ||
45 | |||
46 | #endif /* __LINUX_LM8323_H */ | ||
diff --git a/include/linux/i2c/pca953x.h b/include/linux/i2c/pca953x.h index 3c7361217df8..81736d6a8db7 100644 --- a/include/linux/i2c/pca953x.h +++ b/include/linux/i2c/pca953x.h | |||
@@ -15,4 +15,5 @@ struct pca953x_platform_data { | |||
15 | int (*teardown)(struct i2c_client *client, | 15 | int (*teardown)(struct i2c_client *client, |
16 | unsigned gpio, unsigned ngpio, | 16 | unsigned gpio, unsigned ngpio, |
17 | void *context); | 17 | void *context); |
18 | char **names; | ||
18 | }; | 19 | }; |
diff --git a/include/linux/icmpv6.h b/include/linux/icmpv6.h index 10d701eec484..b6a85183c333 100644 --- a/include/linux/icmpv6.h +++ b/include/linux/icmpv6.h | |||
@@ -175,16 +175,16 @@ struct icmp6_filter { | |||
175 | 175 | ||
176 | 176 | ||
177 | extern void icmpv6_send(struct sk_buff *skb, | 177 | extern void icmpv6_send(struct sk_buff *skb, |
178 | int type, int code, | 178 | u8 type, u8 code, |
179 | __u32 info, | 179 | __u32 info, |
180 | struct net_device *dev); | 180 | struct net_device *dev); |
181 | 181 | ||
182 | extern int icmpv6_init(void); | 182 | extern int icmpv6_init(void); |
183 | extern int icmpv6_err_convert(int type, int code, | 183 | extern int icmpv6_err_convert(u8 type, u8 code, |
184 | int *err); | 184 | int *err); |
185 | extern void icmpv6_cleanup(void); | 185 | extern void icmpv6_cleanup(void); |
186 | extern void icmpv6_param_prob(struct sk_buff *skb, | 186 | extern void icmpv6_param_prob(struct sk_buff *skb, |
187 | int code, int pos); | 187 | u8 code, int pos); |
188 | 188 | ||
189 | struct flowi; | 189 | struct flowi; |
190 | struct in6_addr; | 190 | struct in6_addr; |
diff --git a/include/linux/ide.h b/include/linux/ide.h index a6c6a2fad7c8..edc93a6d931d 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -157,12 +157,6 @@ enum { | |||
157 | #define REQ_UNPARK_HEADS 0x23 | 157 | #define REQ_UNPARK_HEADS 0x23 |
158 | 158 | ||
159 | /* | 159 | /* |
160 | * Check for an interrupt and acknowledge the interrupt status | ||
161 | */ | ||
162 | struct hwif_s; | ||
163 | typedef int (ide_ack_intr_t)(struct hwif_s *); | ||
164 | |||
165 | /* | ||
166 | * hwif_chipset_t is used to keep track of the specific hardware | 160 | * hwif_chipset_t is used to keep track of the specific hardware |
167 | * chipset used by each IDE interface, if known. | 161 | * chipset used by each IDE interface, if known. |
168 | */ | 162 | */ |
@@ -185,7 +179,6 @@ struct ide_hw { | |||
185 | }; | 179 | }; |
186 | 180 | ||
187 | int irq; /* our irq number */ | 181 | int irq; /* our irq number */ |
188 | ide_ack_intr_t *ack_intr; /* acknowledge interrupt */ | ||
189 | struct device *dev, *parent; | 182 | struct device *dev, *parent; |
190 | unsigned long config; | 183 | unsigned long config; |
191 | }; | 184 | }; |
@@ -331,11 +324,6 @@ enum { | |||
331 | PC_FLAG_WRITING = (1 << 6), | 324 | PC_FLAG_WRITING = (1 << 6), |
332 | }; | 325 | }; |
333 | 326 | ||
334 | /* | ||
335 | * With each packet command, we allocate a buffer of IDE_PC_BUFFER_SIZE bytes. | ||
336 | * This is used for several packet commands (not for READ/WRITE commands). | ||
337 | */ | ||
338 | #define IDE_PC_BUFFER_SIZE 64 | ||
339 | #define ATAPI_WAIT_PC (60 * HZ) | 327 | #define ATAPI_WAIT_PC (60 * HZ) |
340 | 328 | ||
341 | struct ide_atapi_pc { | 329 | struct ide_atapi_pc { |
@@ -347,12 +335,6 @@ struct ide_atapi_pc { | |||
347 | 335 | ||
348 | /* bytes to transfer */ | 336 | /* bytes to transfer */ |
349 | int req_xfer; | 337 | int req_xfer; |
350 | /* bytes actually transferred */ | ||
351 | int xferred; | ||
352 | |||
353 | /* data buffer */ | ||
354 | u8 *buf; | ||
355 | int buf_size; | ||
356 | 338 | ||
357 | /* the corresponding request */ | 339 | /* the corresponding request */ |
358 | struct request *rq; | 340 | struct request *rq; |
@@ -363,8 +345,6 @@ struct ide_atapi_pc { | |||
363 | * those are more or less driver-specific and some of them are subject | 345 | * those are more or less driver-specific and some of them are subject |
364 | * to change/removal later. | 346 | * to change/removal later. |
365 | */ | 347 | */ |
366 | u8 pc_buf[IDE_PC_BUFFER_SIZE]; | ||
367 | |||
368 | unsigned long timeout; | 348 | unsigned long timeout; |
369 | }; | 349 | }; |
370 | 350 | ||
@@ -552,7 +532,7 @@ struct ide_drive_s { | |||
552 | 532 | ||
553 | unsigned int bios_cyl; /* BIOS/fdisk/LILO number of cyls */ | 533 | unsigned int bios_cyl; /* BIOS/fdisk/LILO number of cyls */ |
554 | unsigned int cyl; /* "real" number of cyls */ | 534 | unsigned int cyl; /* "real" number of cyls */ |
555 | unsigned int drive_data; /* used by set_pio_mode/dev_select() */ | 535 | void *drive_data; /* used by set_pio_mode/dev_select() */ |
556 | unsigned int failures; /* current failure count */ | 536 | unsigned int failures; /* current failure count */ |
557 | unsigned int max_failures; /* maximum allowed failure count */ | 537 | unsigned int max_failures; /* maximum allowed failure count */ |
558 | u64 probed_capacity;/* initial/native media capacity */ | 538 | u64 probed_capacity;/* initial/native media capacity */ |
@@ -649,6 +629,7 @@ struct ide_port_ops { | |||
649 | void (*maskproc)(ide_drive_t *, int); | 629 | void (*maskproc)(ide_drive_t *, int); |
650 | void (*quirkproc)(ide_drive_t *); | 630 | void (*quirkproc)(ide_drive_t *); |
651 | void (*clear_irq)(ide_drive_t *); | 631 | void (*clear_irq)(ide_drive_t *); |
632 | int (*test_irq)(struct hwif_s *); | ||
652 | 633 | ||
653 | u8 (*mdma_filter)(ide_drive_t *); | 634 | u8 (*mdma_filter)(ide_drive_t *); |
654 | u8 (*udma_filter)(ide_drive_t *); | 635 | u8 (*udma_filter)(ide_drive_t *); |
@@ -674,6 +655,10 @@ struct ide_dma_ops { | |||
674 | u8 (*dma_sff_read_status)(struct hwif_s *); | 655 | u8 (*dma_sff_read_status)(struct hwif_s *); |
675 | }; | 656 | }; |
676 | 657 | ||
658 | enum { | ||
659 | IDE_PFLAG_PROBING = (1 << 0), | ||
660 | }; | ||
661 | |||
677 | struct ide_host; | 662 | struct ide_host; |
678 | 663 | ||
679 | typedef struct hwif_s { | 664 | typedef struct hwif_s { |
@@ -690,6 +675,8 @@ typedef struct hwif_s { | |||
690 | 675 | ||
691 | ide_drive_t *devices[MAX_DRIVES + 1]; | 676 | ide_drive_t *devices[MAX_DRIVES + 1]; |
692 | 677 | ||
678 | unsigned long port_flags; | ||
679 | |||
693 | u8 major; /* our major number */ | 680 | u8 major; /* our major number */ |
694 | u8 index; /* 0 for ide0; 1 for ide1; ... */ | 681 | u8 index; /* 0 for ide0; 1 for ide1; ... */ |
695 | u8 channel; /* for dual-port chips: 0=primary, 1=secondary */ | 682 | u8 channel; /* for dual-port chips: 0=primary, 1=secondary */ |
@@ -708,8 +695,6 @@ typedef struct hwif_s { | |||
708 | 695 | ||
709 | struct device *dev; | 696 | struct device *dev; |
710 | 697 | ||
711 | ide_ack_intr_t *ack_intr; | ||
712 | |||
713 | void (*rw_disk)(ide_drive_t *, struct request *); | 698 | void (*rw_disk)(ide_drive_t *, struct request *); |
714 | 699 | ||
715 | const struct ide_tp_ops *tp_ops; | 700 | const struct ide_tp_ops *tp_ops; |
@@ -1077,7 +1062,6 @@ int generic_ide_ioctl(ide_drive_t *, struct block_device *, unsigned, unsigned l | |||
1077 | extern int ide_vlb_clk; | 1062 | extern int ide_vlb_clk; |
1078 | extern int ide_pci_clk; | 1063 | extern int ide_pci_clk; |
1079 | 1064 | ||
1080 | unsigned int ide_rq_bytes(struct request *); | ||
1081 | int ide_end_rq(ide_drive_t *, struct request *, int, unsigned int); | 1065 | int ide_end_rq(ide_drive_t *, struct request *, int, unsigned int); |
1082 | void ide_kill_rq(ide_drive_t *, struct request *); | 1066 | void ide_kill_rq(ide_drive_t *, struct request *); |
1083 | 1067 | ||
@@ -1130,6 +1114,8 @@ void SELECT_MASK(ide_drive_t *, int); | |||
1130 | u8 ide_read_error(ide_drive_t *); | 1114 | u8 ide_read_error(ide_drive_t *); |
1131 | void ide_read_bcount_and_ireason(ide_drive_t *, u16 *, u8 *); | 1115 | void ide_read_bcount_and_ireason(ide_drive_t *, u16 *, u8 *); |
1132 | 1116 | ||
1117 | int ide_check_ireason(ide_drive_t *, struct request *, int, int, int); | ||
1118 | |||
1133 | int ide_check_atapi_device(ide_drive_t *, const char *); | 1119 | int ide_check_atapi_device(ide_drive_t *, const char *); |
1134 | 1120 | ||
1135 | void ide_init_pc(struct ide_atapi_pc *); | 1121 | void ide_init_pc(struct ide_atapi_pc *); |
@@ -1154,7 +1140,8 @@ enum { | |||
1154 | REQ_IDETAPE_WRITE = (1 << 3), | 1140 | REQ_IDETAPE_WRITE = (1 << 3), |
1155 | }; | 1141 | }; |
1156 | 1142 | ||
1157 | int ide_queue_pc_tail(ide_drive_t *, struct gendisk *, struct ide_atapi_pc *); | 1143 | int ide_queue_pc_tail(ide_drive_t *, struct gendisk *, struct ide_atapi_pc *, |
1144 | void *, unsigned int); | ||
1158 | 1145 | ||
1159 | int ide_do_test_unit_ready(ide_drive_t *, struct gendisk *); | 1146 | int ide_do_test_unit_ready(ide_drive_t *, struct gendisk *); |
1160 | int ide_do_start_stop(ide_drive_t *, struct gendisk *, int); | 1147 | int ide_do_start_stop(ide_drive_t *, struct gendisk *, int); |
@@ -1373,7 +1360,6 @@ int ide_in_drive_list(u16 *, const struct drive_list_entry *); | |||
1373 | #ifdef CONFIG_BLK_DEV_IDEDMA | 1360 | #ifdef CONFIG_BLK_DEV_IDEDMA |
1374 | int ide_dma_good_drive(ide_drive_t *); | 1361 | int ide_dma_good_drive(ide_drive_t *); |
1375 | int __ide_dma_bad_drive(ide_drive_t *); | 1362 | int __ide_dma_bad_drive(ide_drive_t *); |
1376 | int ide_id_dma_bug(ide_drive_t *); | ||
1377 | 1363 | ||
1378 | u8 ide_find_dma_mode(ide_drive_t *, u8); | 1364 | u8 ide_find_dma_mode(ide_drive_t *, u8); |
1379 | 1365 | ||
@@ -1414,7 +1400,6 @@ void ide_dma_lost_irq(ide_drive_t *); | |||
1414 | ide_startstop_t ide_dma_timeout_retry(ide_drive_t *, int); | 1400 | ide_startstop_t ide_dma_timeout_retry(ide_drive_t *, int); |
1415 | 1401 | ||
1416 | #else | 1402 | #else |
1417 | static inline int ide_id_dma_bug(ide_drive_t *drive) { return 0; } | ||
1418 | static inline u8 ide_find_dma_mode(ide_drive_t *drive, u8 speed) { return 0; } | 1403 | static inline u8 ide_find_dma_mode(ide_drive_t *drive, u8 speed) { return 0; } |
1419 | static inline u8 ide_max_dma_mode(ide_drive_t *drive) { return 0; } | 1404 | static inline u8 ide_max_dma_mode(ide_drive_t *drive) { return 0; } |
1420 | static inline void ide_dma_off_quietly(ide_drive_t *drive) { ; } | 1405 | static inline void ide_dma_off_quietly(ide_drive_t *drive) { ; } |
@@ -1434,6 +1419,7 @@ static inline void ide_dma_unmap_sg(ide_drive_t *drive, | |||
1434 | 1419 | ||
1435 | #ifdef CONFIG_BLK_DEV_IDEACPI | 1420 | #ifdef CONFIG_BLK_DEV_IDEACPI |
1436 | int ide_acpi_init(void); | 1421 | int ide_acpi_init(void); |
1422 | bool ide_port_acpi(ide_hwif_t *hwif); | ||
1437 | extern int ide_acpi_exec_tfs(ide_drive_t *drive); | 1423 | extern int ide_acpi_exec_tfs(ide_drive_t *drive); |
1438 | extern void ide_acpi_get_timing(ide_hwif_t *hwif); | 1424 | extern void ide_acpi_get_timing(ide_hwif_t *hwif); |
1439 | extern void ide_acpi_push_timing(ide_hwif_t *hwif); | 1425 | extern void ide_acpi_push_timing(ide_hwif_t *hwif); |
@@ -1442,6 +1428,7 @@ void ide_acpi_port_init_devices(ide_hwif_t *); | |||
1442 | extern void ide_acpi_set_state(ide_hwif_t *hwif, int on); | 1428 | extern void ide_acpi_set_state(ide_hwif_t *hwif, int on); |
1443 | #else | 1429 | #else |
1444 | static inline int ide_acpi_init(void) { return 0; } | 1430 | static inline int ide_acpi_init(void) { return 0; } |
1431 | static inline bool ide_port_acpi(ide_hwif_t *hwif) { return 0; } | ||
1445 | static inline int ide_acpi_exec_tfs(ide_drive_t *drive) { return 0; } | 1432 | static inline int ide_acpi_exec_tfs(ide_drive_t *drive) { return 0; } |
1446 | static inline void ide_acpi_get_timing(ide_hwif_t *hwif) { ; } | 1433 | static inline void ide_acpi_get_timing(ide_hwif_t *hwif) { ; } |
1447 | static inline void ide_acpi_push_timing(ide_hwif_t *hwif) { ; } | 1434 | static inline void ide_acpi_push_timing(ide_hwif_t *hwif) { ; } |
@@ -1524,6 +1511,7 @@ int ide_timing_compute(ide_drive_t *, u8, struct ide_timing *, int, int); | |||
1524 | int ide_scan_pio_blacklist(char *); | 1511 | int ide_scan_pio_blacklist(char *); |
1525 | const char *ide_xfer_verbose(u8); | 1512 | const char *ide_xfer_verbose(u8); |
1526 | u8 ide_get_best_pio_mode(ide_drive_t *, u8, u8); | 1513 | u8 ide_get_best_pio_mode(ide_drive_t *, u8, u8); |
1514 | int ide_pio_need_iordy(ide_drive_t *, const u8); | ||
1527 | int ide_set_pio_mode(ide_drive_t *, u8); | 1515 | int ide_set_pio_mode(ide_drive_t *, u8); |
1528 | int ide_set_dma_mode(ide_drive_t *, u8); | 1516 | int ide_set_dma_mode(ide_drive_t *, u8); |
1529 | void ide_set_pio(ide_drive_t *, u8); | 1517 | void ide_set_pio(ide_drive_t *, u8); |
@@ -1561,6 +1549,16 @@ static inline ide_drive_t *ide_get_pair_dev(ide_drive_t *drive) | |||
1561 | return (peer->dev_flags & IDE_DFLAG_PRESENT) ? peer : NULL; | 1549 | return (peer->dev_flags & IDE_DFLAG_PRESENT) ? peer : NULL; |
1562 | } | 1550 | } |
1563 | 1551 | ||
1552 | static inline void *ide_get_drivedata(ide_drive_t *drive) | ||
1553 | { | ||
1554 | return drive->drive_data; | ||
1555 | } | ||
1556 | |||
1557 | static inline void ide_set_drivedata(ide_drive_t *drive, void *data) | ||
1558 | { | ||
1559 | drive->drive_data = data; | ||
1560 | } | ||
1561 | |||
1564 | #define ide_port_for_each_dev(i, dev, port) \ | 1562 | #define ide_port_for_each_dev(i, dev, port) \ |
1565 | for ((i) = 0; ((dev) = (port)->devices[i]) || (i) < MAX_DRIVES; (i)++) | 1563 | for ((i) = 0; ((dev) = (port)->devices[i]) || (i) < MAX_DRIVES; (i)++) |
1566 | 1564 | ||
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h index ae3a1871413d..70fdba2bbf71 100644 --- a/include/linux/if_ether.h +++ b/include/linux/if_ether.h | |||
@@ -78,6 +78,7 @@ | |||
78 | #define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */ | 78 | #define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */ |
79 | #define ETH_P_AOE 0x88A2 /* ATA over Ethernet */ | 79 | #define ETH_P_AOE 0x88A2 /* ATA over Ethernet */ |
80 | #define ETH_P_TIPC 0x88CA /* TIPC */ | 80 | #define ETH_P_TIPC 0x88CA /* TIPC */ |
81 | #define ETH_P_1588 0x88F7 /* IEEE 1588 Timesync */ | ||
81 | #define ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */ | 82 | #define ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */ |
82 | #define ETH_P_FIP 0x8914 /* FCoE Initialization Protocol */ | 83 | #define ETH_P_FIP 0x8914 /* FCoE Initialization Protocol */ |
83 | #define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */ | 84 | #define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */ |
diff --git a/include/linux/ima.h b/include/linux/ima.h index b1b827d091a9..0e3f2a4c25f6 100644 --- a/include/linux/ima.h +++ b/include/linux/ima.h | |||
@@ -24,6 +24,7 @@ extern int ima_path_check(struct path *path, int mask, int update_counts); | |||
24 | extern void ima_file_free(struct file *file); | 24 | extern void ima_file_free(struct file *file); |
25 | extern int ima_file_mmap(struct file *file, unsigned long prot); | 25 | extern int ima_file_mmap(struct file *file, unsigned long prot); |
26 | extern void ima_counts_get(struct file *file); | 26 | extern void ima_counts_get(struct file *file); |
27 | extern void ima_counts_put(struct path *path, int mask); | ||
27 | 28 | ||
28 | #else | 29 | #else |
29 | static inline int ima_bprm_check(struct linux_binprm *bprm) | 30 | static inline int ima_bprm_check(struct linux_binprm *bprm) |
@@ -60,5 +61,10 @@ static inline void ima_counts_get(struct file *file) | |||
60 | { | 61 | { |
61 | return; | 62 | return; |
62 | } | 63 | } |
64 | |||
65 | static inline void ima_counts_put(struct path *path, int mask) | ||
66 | { | ||
67 | return; | ||
68 | } | ||
63 | #endif /* CONFIG_IMA_H */ | 69 | #endif /* CONFIG_IMA_H */ |
64 | #endif /* _LINUX_IMA_H */ | 70 | #endif /* _LINUX_IMA_H */ |
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index acef2a770b6b..ad27c7da8798 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h | |||
@@ -82,7 +82,7 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev) | |||
82 | 82 | ||
83 | #define IN_DEV_FORWARD(in_dev) IN_DEV_CONF_GET((in_dev), FORWARDING) | 83 | #define IN_DEV_FORWARD(in_dev) IN_DEV_CONF_GET((in_dev), FORWARDING) |
84 | #define IN_DEV_MFORWARD(in_dev) IN_DEV_ANDCONF((in_dev), MC_FORWARDING) | 84 | #define IN_DEV_MFORWARD(in_dev) IN_DEV_ANDCONF((in_dev), MC_FORWARDING) |
85 | #define IN_DEV_RPFILTER(in_dev) IN_DEV_ANDCONF((in_dev), RP_FILTER) | 85 | #define IN_DEV_RPFILTER(in_dev) IN_DEV_MAXCONF((in_dev), RP_FILTER) |
86 | #define IN_DEV_SOURCE_ROUTE(in_dev) IN_DEV_ANDCONF((in_dev), \ | 86 | #define IN_DEV_SOURCE_ROUTE(in_dev) IN_DEV_ANDCONF((in_dev), \ |
87 | ACCEPT_SOURCE_ROUTE) | 87 | ACCEPT_SOURCE_ROUTE) |
88 | #define IN_DEV_BOOTP_RELAY(in_dev) IN_DEV_ANDCONF((in_dev), BOOTP_RELAY) | 88 | #define IN_DEV_BOOTP_RELAY(in_dev) IN_DEV_ANDCONF((in_dev), BOOTP_RELAY) |
diff --git a/include/linux/init.h b/include/linux/init.h index 8c2c9989626d..13b633ed695e 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
@@ -134,6 +134,9 @@ typedef void (*exitcall_t)(void); | |||
134 | extern initcall_t __con_initcall_start[], __con_initcall_end[]; | 134 | extern initcall_t __con_initcall_start[], __con_initcall_end[]; |
135 | extern initcall_t __security_initcall_start[], __security_initcall_end[]; | 135 | extern initcall_t __security_initcall_start[], __security_initcall_end[]; |
136 | 136 | ||
137 | /* Used for contructor calls. */ | ||
138 | typedef void (*ctor_fn_t)(void); | ||
139 | |||
137 | /* Defined in init/main.c */ | 140 | /* Defined in init/main.c */ |
138 | extern int do_one_initcall(initcall_t fn); | 141 | extern int do_one_initcall(initcall_t fn); |
139 | extern char __initdata boot_command_line[]; | 142 | extern char __initdata boot_command_line[]; |
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 5368fbdc7801..7fc01b13be43 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
@@ -183,5 +183,8 @@ extern struct cred init_cred; | |||
183 | LIST_HEAD_INIT(cpu_timers[2]), \ | 183 | LIST_HEAD_INIT(cpu_timers[2]), \ |
184 | } | 184 | } |
185 | 185 | ||
186 | /* Attach to the init_task data structure for proper alignment */ | ||
187 | #define __init_task_data __attribute__((__section__(".data.init_task"))) | ||
188 | |||
186 | 189 | ||
187 | #endif | 190 | #endif |
diff --git a/include/linux/input.h b/include/linux/input.h index 6fed4f6a9c9e..8b3bc3e0d146 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -53,6 +53,7 @@ struct input_absinfo { | |||
53 | __s32 maximum; | 53 | __s32 maximum; |
54 | __s32 fuzz; | 54 | __s32 fuzz; |
55 | __s32 flat; | 55 | __s32 flat; |
56 | __s32 resolution; | ||
56 | }; | 57 | }; |
57 | 58 | ||
58 | #define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */ | 59 | #define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */ |
@@ -1109,6 +1110,7 @@ struct input_dev { | |||
1109 | int absmin[ABS_MAX + 1]; | 1110 | int absmin[ABS_MAX + 1]; |
1110 | int absfuzz[ABS_MAX + 1]; | 1111 | int absfuzz[ABS_MAX + 1]; |
1111 | int absflat[ABS_MAX + 1]; | 1112 | int absflat[ABS_MAX + 1]; |
1113 | int absres[ABS_MAX + 1]; | ||
1112 | 1114 | ||
1113 | int (*open)(struct input_dev *dev); | 1115 | int (*open)(struct input_dev *dev); |
1114 | void (*close)(struct input_dev *dev); | 1116 | void (*close)(struct input_dev *dev); |
diff --git a/include/linux/input/matrix_keypad.h b/include/linux/input/matrix_keypad.h new file mode 100644 index 000000000000..15d5903af2dd --- /dev/null +++ b/include/linux/input/matrix_keypad.h | |||
@@ -0,0 +1,66 @@ | |||
1 | #ifndef _MATRIX_KEYPAD_H | ||
2 | #define _MATRIX_KEYPAD_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | #include <linux/input.h> | ||
6 | |||
7 | #define MATRIX_MAX_ROWS 16 | ||
8 | #define MATRIX_MAX_COLS 16 | ||
9 | |||
10 | #define KEY(row, col, val) ((((row) & (MATRIX_MAX_ROWS - 1)) << 24) |\ | ||
11 | (((col) & (MATRIX_MAX_COLS - 1)) << 16) |\ | ||
12 | (val & 0xffff)) | ||
13 | |||
14 | #define KEY_ROW(k) (((k) >> 24) & 0xff) | ||
15 | #define KEY_COL(k) (((k) >> 16) & 0xff) | ||
16 | #define KEY_VAL(k) ((k) & 0xffff) | ||
17 | |||
18 | #define MATRIX_SCAN_CODE(row, col, row_shift) (((row) << (row_shift)) + (col)) | ||
19 | |||
20 | /** | ||
21 | * struct matrix_keymap_data - keymap for matrix keyboards | ||
22 | * @keymap: pointer to array of uint32 values encoded with KEY() macro | ||
23 | * representing keymap | ||
24 | * @keymap_size: number of entries (initialized) in this keymap | ||
25 | * | ||
26 | * This structure is supposed to be used by platform code to supply | ||
27 | * keymaps to drivers that implement matrix-like keypads/keyboards. | ||
28 | */ | ||
29 | struct matrix_keymap_data { | ||
30 | const uint32_t *keymap; | ||
31 | unsigned int keymap_size; | ||
32 | }; | ||
33 | |||
34 | /** | ||
35 | * struct matrix_keypad_platform_data - platform-dependent keypad data | ||
36 | * @keymap_data: pointer to &matrix_keymap_data | ||
37 | * @row_gpios: pointer to array of gpio numbers representing rows | ||
38 | * @col_gpios: pointer to array of gpio numbers reporesenting colums | ||
39 | * @num_row_gpios: actual number of row gpios used by device | ||
40 | * @num_col_gpios: actual number of col gpios used by device | ||
41 | * @col_scan_delay_us: delay, measured in microseconds, that is | ||
42 | * needed before we can keypad after activating column gpio | ||
43 | * @debounce_ms: debounce interval in milliseconds | ||
44 | * | ||
45 | * This structure represents platform-specific data that use used by | ||
46 | * matrix_keypad driver to perform proper initialization. | ||
47 | */ | ||
48 | struct matrix_keypad_platform_data { | ||
49 | const struct matrix_keymap_data *keymap_data; | ||
50 | |||
51 | const unsigned int *row_gpios; | ||
52 | const unsigned int *col_gpios; | ||
53 | |||
54 | unsigned int num_row_gpios; | ||
55 | unsigned int num_col_gpios; | ||
56 | |||
57 | unsigned int col_scan_delay_us; | ||
58 | |||
59 | /* key debounce interval in milli-second */ | ||
60 | unsigned int debounce_ms; | ||
61 | |||
62 | bool active_low; | ||
63 | bool wakeup; | ||
64 | }; | ||
65 | |||
66 | #endif /* _MATRIX_KEYPAD_H */ | ||
diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h index aa8c53171233..482dc91fd53a 100644 --- a/include/linux/intel-iommu.h +++ b/include/linux/intel-iommu.h | |||
@@ -53,6 +53,7 @@ | |||
53 | #define DMAR_PHMLIMIT_REG 0x78 /* pmrr high limit */ | 53 | #define DMAR_PHMLIMIT_REG 0x78 /* pmrr high limit */ |
54 | #define DMAR_IQH_REG 0x80 /* Invalidation queue head register */ | 54 | #define DMAR_IQH_REG 0x80 /* Invalidation queue head register */ |
55 | #define DMAR_IQT_REG 0x88 /* Invalidation queue tail register */ | 55 | #define DMAR_IQT_REG 0x88 /* Invalidation queue tail register */ |
56 | #define DMAR_IQ_SHIFT 4 /* Invalidation queue head/tail shift */ | ||
56 | #define DMAR_IQA_REG 0x90 /* Invalidation queue addr register */ | 57 | #define DMAR_IQA_REG 0x90 /* Invalidation queue addr register */ |
57 | #define DMAR_ICS_REG 0x98 /* Invalidation complete status register */ | 58 | #define DMAR_ICS_REG 0x98 /* Invalidation complete status register */ |
58 | #define DMAR_IRTA_REG 0xb8 /* Interrupt remapping table addr register */ | 59 | #define DMAR_IRTA_REG 0xb8 /* Interrupt remapping table addr register */ |
@@ -120,8 +121,10 @@ static inline void dmar_writeq(void __iomem *addr, u64 val) | |||
120 | (ecap_iotlb_offset(e) + ecap_niotlb_iunits(e) * 16) | 121 | (ecap_iotlb_offset(e) + ecap_niotlb_iunits(e) * 16) |
121 | #define ecap_coherent(e) ((e) & 0x1) | 122 | #define ecap_coherent(e) ((e) & 0x1) |
122 | #define ecap_qis(e) ((e) & 0x2) | 123 | #define ecap_qis(e) ((e) & 0x2) |
124 | #define ecap_pass_through(e) ((e >> 6) & 0x1) | ||
123 | #define ecap_eim_support(e) ((e >> 4) & 0x1) | 125 | #define ecap_eim_support(e) ((e >> 4) & 0x1) |
124 | #define ecap_ir_support(e) ((e >> 3) & 0x1) | 126 | #define ecap_ir_support(e) ((e >> 3) & 0x1) |
127 | #define ecap_dev_iotlb_support(e) (((e) >> 2) & 0x1) | ||
125 | #define ecap_max_handle_mask(e) ((e >> 20) & 0xf) | 128 | #define ecap_max_handle_mask(e) ((e >> 20) & 0xf) |
126 | #define ecap_sc_support(e) ((e >> 7) & 0x1) /* Snooping Control */ | 129 | #define ecap_sc_support(e) ((e >> 7) & 0x1) /* Snooping Control */ |
127 | 130 | ||
@@ -197,6 +200,8 @@ static inline void dmar_writeq(void __iomem *addr, u64 val) | |||
197 | #define DMA_FSTS_PPF ((u32)2) | 200 | #define DMA_FSTS_PPF ((u32)2) |
198 | #define DMA_FSTS_PFO ((u32)1) | 201 | #define DMA_FSTS_PFO ((u32)1) |
199 | #define DMA_FSTS_IQE (1 << 4) | 202 | #define DMA_FSTS_IQE (1 << 4) |
203 | #define DMA_FSTS_ICE (1 << 5) | ||
204 | #define DMA_FSTS_ITE (1 << 6) | ||
200 | #define dma_fsts_fault_record_index(s) (((s) >> 8) & 0xff) | 205 | #define dma_fsts_fault_record_index(s) (((s) >> 8) & 0xff) |
201 | 206 | ||
202 | /* FRCD_REG, 32 bits access */ | 207 | /* FRCD_REG, 32 bits access */ |
@@ -225,7 +230,8 @@ do { \ | |||
225 | enum { | 230 | enum { |
226 | QI_FREE, | 231 | QI_FREE, |
227 | QI_IN_USE, | 232 | QI_IN_USE, |
228 | QI_DONE | 233 | QI_DONE, |
234 | QI_ABORT | ||
229 | }; | 235 | }; |
230 | 236 | ||
231 | #define QI_CC_TYPE 0x1 | 237 | #define QI_CC_TYPE 0x1 |
@@ -254,6 +260,12 @@ enum { | |||
254 | #define QI_CC_DID(did) (((u64)did) << 16) | 260 | #define QI_CC_DID(did) (((u64)did) << 16) |
255 | #define QI_CC_GRAN(gran) (((u64)gran) >> (DMA_CCMD_INVL_GRANU_OFFSET-4)) | 261 | #define QI_CC_GRAN(gran) (((u64)gran) >> (DMA_CCMD_INVL_GRANU_OFFSET-4)) |
256 | 262 | ||
263 | #define QI_DEV_IOTLB_SID(sid) ((u64)((sid) & 0xffff) << 32) | ||
264 | #define QI_DEV_IOTLB_QDEP(qdep) (((qdep) & 0x1f) << 16) | ||
265 | #define QI_DEV_IOTLB_ADDR(addr) ((u64)(addr) & VTD_PAGE_MASK) | ||
266 | #define QI_DEV_IOTLB_SIZE 1 | ||
267 | #define QI_DEV_IOTLB_MAX_INVS 32 | ||
268 | |||
257 | struct qi_desc { | 269 | struct qi_desc { |
258 | u64 low, high; | 270 | u64 low, high; |
259 | }; | 271 | }; |
@@ -280,10 +292,10 @@ struct ir_table { | |||
280 | #endif | 292 | #endif |
281 | 293 | ||
282 | struct iommu_flush { | 294 | struct iommu_flush { |
283 | int (*flush_context)(struct intel_iommu *iommu, u16 did, u16 sid, u8 fm, | 295 | void (*flush_context)(struct intel_iommu *iommu, u16 did, u16 sid, |
284 | u64 type, int non_present_entry_flush); | 296 | u8 fm, u64 type); |
285 | int (*flush_iotlb)(struct intel_iommu *iommu, u16 did, u64 addr, | 297 | void (*flush_iotlb)(struct intel_iommu *iommu, u16 did, u64 addr, |
286 | unsigned int size_order, u64 type, int non_present_entry_flush); | 298 | unsigned int size_order, u64 type); |
287 | }; | 299 | }; |
288 | 300 | ||
289 | enum { | 301 | enum { |
@@ -302,6 +314,7 @@ struct intel_iommu { | |||
302 | spinlock_t register_lock; /* protect register handling */ | 314 | spinlock_t register_lock; /* protect register handling */ |
303 | int seq_id; /* sequence id of the iommu */ | 315 | int seq_id; /* sequence id of the iommu */ |
304 | int agaw; /* agaw of this iommu */ | 316 | int agaw; /* agaw of this iommu */ |
317 | int msagaw; /* max sagaw of this iommu */ | ||
305 | unsigned int irq; | 318 | unsigned int irq; |
306 | unsigned char name[13]; /* Device Name */ | 319 | unsigned char name[13]; /* Device Name */ |
307 | 320 | ||
@@ -329,6 +342,7 @@ static inline void __iommu_flush_cache( | |||
329 | } | 342 | } |
330 | 343 | ||
331 | extern struct dmar_drhd_unit * dmar_find_matched_drhd_unit(struct pci_dev *dev); | 344 | extern struct dmar_drhd_unit * dmar_find_matched_drhd_unit(struct pci_dev *dev); |
345 | extern int dmar_find_matched_atsr_unit(struct pci_dev *dev); | ||
332 | 346 | ||
333 | extern int alloc_iommu(struct dmar_drhd_unit *drhd); | 347 | extern int alloc_iommu(struct dmar_drhd_unit *drhd); |
334 | extern void free_iommu(struct intel_iommu *iommu); | 348 | extern void free_iommu(struct intel_iommu *iommu); |
@@ -337,11 +351,12 @@ extern void dmar_disable_qi(struct intel_iommu *iommu); | |||
337 | extern int dmar_reenable_qi(struct intel_iommu *iommu); | 351 | extern int dmar_reenable_qi(struct intel_iommu *iommu); |
338 | extern void qi_global_iec(struct intel_iommu *iommu); | 352 | extern void qi_global_iec(struct intel_iommu *iommu); |
339 | 353 | ||
340 | extern int qi_flush_context(struct intel_iommu *iommu, u16 did, u16 sid, | 354 | extern void qi_flush_context(struct intel_iommu *iommu, u16 did, u16 sid, |
341 | u8 fm, u64 type, int non_present_entry_flush); | 355 | u8 fm, u64 type); |
342 | extern int qi_flush_iotlb(struct intel_iommu *iommu, u16 did, u64 addr, | 356 | extern void qi_flush_iotlb(struct intel_iommu *iommu, u16 did, u64 addr, |
343 | unsigned int size_order, u64 type, | 357 | unsigned int size_order, u64 type); |
344 | int non_present_entry_flush); | 358 | extern void qi_flush_dev_iotlb(struct intel_iommu *iommu, u16 sid, u16 qdep, |
359 | u64 addr, unsigned mask); | ||
345 | 360 | ||
346 | extern int qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu); | 361 | extern int qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu); |
347 | 362 | ||
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 2721f07e9354..35e7df1e9f30 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/irqflags.h> | 14 | #include <linux/irqflags.h> |
15 | #include <linux/smp.h> | 15 | #include <linux/smp.h> |
16 | #include <linux/percpu.h> | 16 | #include <linux/percpu.h> |
17 | #include <linux/hrtimer.h> | ||
17 | 18 | ||
18 | #include <asm/atomic.h> | 19 | #include <asm/atomic.h> |
19 | #include <asm/ptrace.h> | 20 | #include <asm/ptrace.h> |
@@ -64,11 +65,13 @@ | |||
64 | * IRQTF_RUNTHREAD - signals that the interrupt handler thread should run | 65 | * IRQTF_RUNTHREAD - signals that the interrupt handler thread should run |
65 | * IRQTF_DIED - handler thread died | 66 | * IRQTF_DIED - handler thread died |
66 | * IRQTF_WARNED - warning "IRQ_WAKE_THREAD w/o thread_fn" has been printed | 67 | * IRQTF_WARNED - warning "IRQ_WAKE_THREAD w/o thread_fn" has been printed |
68 | * IRQTF_AFFINITY - irq thread is requested to adjust affinity | ||
67 | */ | 69 | */ |
68 | enum { | 70 | enum { |
69 | IRQTF_RUNTHREAD, | 71 | IRQTF_RUNTHREAD, |
70 | IRQTF_DIED, | 72 | IRQTF_DIED, |
71 | IRQTF_WARNED, | 73 | IRQTF_WARNED, |
74 | IRQTF_AFFINITY, | ||
72 | }; | 75 | }; |
73 | 76 | ||
74 | typedef irqreturn_t (*irq_handler_t)(int, void *); | 77 | typedef irqreturn_t (*irq_handler_t)(int, void *); |
@@ -517,6 +520,31 @@ extern void tasklet_kill_immediate(struct tasklet_struct *t, unsigned int cpu); | |||
517 | extern void tasklet_init(struct tasklet_struct *t, | 520 | extern void tasklet_init(struct tasklet_struct *t, |
518 | void (*func)(unsigned long), unsigned long data); | 521 | void (*func)(unsigned long), unsigned long data); |
519 | 522 | ||
523 | struct tasklet_hrtimer { | ||
524 | struct hrtimer timer; | ||
525 | struct tasklet_struct tasklet; | ||
526 | enum hrtimer_restart (*function)(struct hrtimer *); | ||
527 | }; | ||
528 | |||
529 | extern void | ||
530 | tasklet_hrtimer_init(struct tasklet_hrtimer *ttimer, | ||
531 | enum hrtimer_restart (*function)(struct hrtimer *), | ||
532 | clockid_t which_clock, enum hrtimer_mode mode); | ||
533 | |||
534 | static inline | ||
535 | int tasklet_hrtimer_start(struct tasklet_hrtimer *ttimer, ktime_t time, | ||
536 | const enum hrtimer_mode mode) | ||
537 | { | ||
538 | return hrtimer_start(&ttimer->timer, time, mode); | ||
539 | } | ||
540 | |||
541 | static inline | ||
542 | void tasklet_hrtimer_cancel(struct tasklet_hrtimer *ttimer) | ||
543 | { | ||
544 | hrtimer_cancel(&ttimer->timer); | ||
545 | tasklet_kill(&ttimer->tasklet); | ||
546 | } | ||
547 | |||
520 | /* | 548 | /* |
521 | * Autoprobing for irqs: | 549 | * Autoprobing for irqs: |
522 | * | 550 | * |
diff --git a/include/linux/iocontext.h b/include/linux/iocontext.h index dd05434fa45f..4da4a75c3f1e 100644 --- a/include/linux/iocontext.h +++ b/include/linux/iocontext.h | |||
@@ -92,7 +92,7 @@ static inline struct io_context *ioc_task_link(struct io_context *ioc) | |||
92 | * a race). | 92 | * a race). |
93 | */ | 93 | */ |
94 | if (ioc && atomic_long_inc_not_zero(&ioc->refcount)) { | 94 | if (ioc && atomic_long_inc_not_zero(&ioc->refcount)) { |
95 | atomic_long_inc(&ioc->refcount); | 95 | atomic_inc(&ioc->nr_tasks); |
96 | return ioc; | 96 | return ioc; |
97 | } | 97 | } |
98 | 98 | ||
diff --git a/include/linux/ioport.h b/include/linux/ioport.h index 32e4b2f72294..786e7b8cece9 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h | |||
@@ -49,6 +49,8 @@ struct resource_list { | |||
49 | #define IORESOURCE_SIZEALIGN 0x00020000 /* size indicates alignment */ | 49 | #define IORESOURCE_SIZEALIGN 0x00020000 /* size indicates alignment */ |
50 | #define IORESOURCE_STARTALIGN 0x00040000 /* start field is alignment */ | 50 | #define IORESOURCE_STARTALIGN 0x00040000 /* start field is alignment */ |
51 | 51 | ||
52 | #define IORESOURCE_MEM_64 0x00100000 | ||
53 | |||
52 | #define IORESOURCE_EXCLUSIVE 0x08000000 /* Userland may not map this resource */ | 54 | #define IORESOURCE_EXCLUSIVE 0x08000000 /* Userland may not map this resource */ |
53 | #define IORESOURCE_DISABLED 0x10000000 | 55 | #define IORESOURCE_DISABLED 0x10000000 |
54 | #define IORESOURCE_UNSET 0x20000000 | 56 | #define IORESOURCE_UNSET 0x20000000 |
diff --git a/include/linux/ipc_namespace.h b/include/linux/ipc_namespace.h index 3bf40e246a80..e408722a84c7 100644 --- a/include/linux/ipc_namespace.h +++ b/include/linux/ipc_namespace.h | |||
@@ -94,13 +94,8 @@ static inline int mq_init_ns(struct ipc_namespace *ns) { return 0; } | |||
94 | #endif | 94 | #endif |
95 | 95 | ||
96 | #if defined(CONFIG_IPC_NS) | 96 | #if defined(CONFIG_IPC_NS) |
97 | extern void free_ipc_ns(struct ipc_namespace *ns); | ||
98 | extern struct ipc_namespace *copy_ipcs(unsigned long flags, | 97 | extern struct ipc_namespace *copy_ipcs(unsigned long flags, |
99 | struct ipc_namespace *ns); | 98 | struct ipc_namespace *ns); |
100 | extern void free_ipcs(struct ipc_namespace *ns, struct ipc_ids *ids, | ||
101 | void (*free)(struct ipc_namespace *, | ||
102 | struct kern_ipc_perm *)); | ||
103 | |||
104 | static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) | 99 | static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) |
105 | { | 100 | { |
106 | if (ns) | 101 | if (ns) |
diff --git a/include/linux/irq.h b/include/linux/irq.h index 1e50c34f0062..cb2e77a3f7f7 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -157,7 +157,7 @@ struct irq_2_iommu; | |||
157 | * @irqs_unhandled: stats field for spurious unhandled interrupts | 157 | * @irqs_unhandled: stats field for spurious unhandled interrupts |
158 | * @lock: locking for SMP | 158 | * @lock: locking for SMP |
159 | * @affinity: IRQ affinity on SMP | 159 | * @affinity: IRQ affinity on SMP |
160 | * @cpu: cpu index useful for balancing | 160 | * @node: node index useful for balancing |
161 | * @pending_mask: pending rebalanced interrupts | 161 | * @pending_mask: pending rebalanced interrupts |
162 | * @threads_active: number of irqaction threads currently running | 162 | * @threads_active: number of irqaction threads currently running |
163 | * @wait_for_threads: wait queue for sync_irq to wait for threaded handlers | 163 | * @wait_for_threads: wait queue for sync_irq to wait for threaded handlers |
@@ -423,7 +423,7 @@ extern int set_irq_msi(unsigned int irq, struct msi_desc *entry); | |||
423 | /** | 423 | /** |
424 | * alloc_desc_masks - allocate cpumasks for irq_desc | 424 | * alloc_desc_masks - allocate cpumasks for irq_desc |
425 | * @desc: pointer to irq_desc struct | 425 | * @desc: pointer to irq_desc struct |
426 | * @cpu: cpu which will be handling the cpumasks | 426 | * @node: node which will be handling the cpumasks |
427 | * @boot: true if need bootmem | 427 | * @boot: true if need bootmem |
428 | * | 428 | * |
429 | * Allocates affinity and pending_mask cpumask if required. | 429 | * Allocates affinity and pending_mask cpumask if required. |
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index cc02393bfce8..d97eb652d6ca 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h | |||
@@ -1315,6 +1315,12 @@ extern int jbd_blocks_per_page(struct inode *inode); | |||
1315 | #define BUFFER_TRACE2(bh, bh2, info) do {} while (0) | 1315 | #define BUFFER_TRACE2(bh, bh2, info) do {} while (0) |
1316 | #define JBUFFER_TRACE(jh, info) do {} while (0) | 1316 | #define JBUFFER_TRACE(jh, info) do {} while (0) |
1317 | 1317 | ||
1318 | /* | ||
1319 | * jbd2_dev_to_name is a utility function used by the jbd2 and ext4 | ||
1320 | * tracing infrastructure to map a dev_t to a device name. | ||
1321 | */ | ||
1322 | extern const char *jbd2_dev_to_name(dev_t device); | ||
1323 | |||
1318 | #endif /* __KERNEL__ */ | 1324 | #endif /* __KERNEL__ */ |
1319 | 1325 | ||
1320 | #endif /* _LINUX_JBD2_H */ | 1326 | #endif /* _LINUX_JBD2_H */ |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index c5a71c38a95f..d6320a3e8def 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -58,7 +58,7 @@ extern const char linux_proc_banner[]; | |||
58 | #define _RET_IP_ (unsigned long)__builtin_return_address(0) | 58 | #define _RET_IP_ (unsigned long)__builtin_return_address(0) |
59 | #define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; }) | 59 | #define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; }) |
60 | 60 | ||
61 | #ifdef CONFIG_LBD | 61 | #ifdef CONFIG_LBDAF |
62 | # include <asm/div64.h> | 62 | # include <asm/div64.h> |
63 | # define sector_div(a, b) do_div(a, b) | 63 | # define sector_div(a, b) do_div(a, b) |
64 | #else | 64 | #else |
@@ -303,6 +303,7 @@ extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in | |||
303 | extern int panic_timeout; | 303 | extern int panic_timeout; |
304 | extern int panic_on_oops; | 304 | extern int panic_on_oops; |
305 | extern int panic_on_unrecovered_nmi; | 305 | extern int panic_on_unrecovered_nmi; |
306 | extern int panic_on_io_nmi; | ||
306 | extern const char *print_tainted(void); | 307 | extern const char *print_tainted(void); |
307 | extern void add_taint(unsigned flag); | 308 | extern void add_taint(unsigned flag); |
308 | extern int test_taint(unsigned flag); | 309 | extern int test_taint(unsigned flag); |
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h index a77c6007dc99..348fa8874b52 100644 --- a/include/linux/kernel_stat.h +++ b/include/linux/kernel_stat.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <linux/threads.h> | 5 | #include <linux/threads.h> |
6 | #include <linux/percpu.h> | 6 | #include <linux/percpu.h> |
7 | #include <linux/cpumask.h> | 7 | #include <linux/cpumask.h> |
8 | #include <linux/interrupt.h> | ||
8 | #include <asm/irq.h> | 9 | #include <asm/irq.h> |
9 | #include <asm/cputime.h> | 10 | #include <asm/cputime.h> |
10 | 11 | ||
@@ -31,6 +32,7 @@ struct kernel_stat { | |||
31 | #ifndef CONFIG_GENERIC_HARDIRQS | 32 | #ifndef CONFIG_GENERIC_HARDIRQS |
32 | unsigned int irqs[NR_IRQS]; | 33 | unsigned int irqs[NR_IRQS]; |
33 | #endif | 34 | #endif |
35 | unsigned int softirqs[NR_SOFTIRQS]; | ||
34 | }; | 36 | }; |
35 | 37 | ||
36 | DECLARE_PER_CPU(struct kernel_stat, kstat); | 38 | DECLARE_PER_CPU(struct kernel_stat, kstat); |
@@ -67,6 +69,16 @@ extern unsigned int kstat_irqs_cpu(unsigned int irq, int cpu); | |||
67 | 69 | ||
68 | #endif | 70 | #endif |
69 | 71 | ||
72 | static inline void kstat_incr_softirqs_this_cpu(unsigned int irq) | ||
73 | { | ||
74 | kstat_this_cpu.softirqs[irq]++; | ||
75 | } | ||
76 | |||
77 | static inline unsigned int kstat_softirqs_cpu(unsigned int irq, int cpu) | ||
78 | { | ||
79 | return kstat_cpu(cpu).softirqs[irq]; | ||
80 | } | ||
81 | |||
70 | /* | 82 | /* |
71 | * Number of interrupts per specific IRQ source, since bootup | 83 | * Number of interrupts per specific IRQ source, since bootup |
72 | */ | 84 | */ |
diff --git a/include/linux/key.h b/include/linux/key.h index e544f466d69a..cd50dfa1d4c2 100644 --- a/include/linux/key.h +++ b/include/linux/key.h | |||
@@ -129,7 +129,10 @@ struct key { | |||
129 | struct rw_semaphore sem; /* change vs change sem */ | 129 | struct rw_semaphore sem; /* change vs change sem */ |
130 | struct key_user *user; /* owner of this key */ | 130 | struct key_user *user; /* owner of this key */ |
131 | void *security; /* security data for this key */ | 131 | void *security; /* security data for this key */ |
132 | time_t expiry; /* time at which key expires (or 0) */ | 132 | union { |
133 | time_t expiry; /* time at which key expires (or 0) */ | ||
134 | time_t revoked_at; /* time at which key was revoked */ | ||
135 | }; | ||
133 | uid_t uid; | 136 | uid_t uid; |
134 | gid_t gid; | 137 | gid_t gid; |
135 | key_perm_t perm; /* access permissions */ | 138 | key_perm_t perm; /* access permissions */ |
@@ -275,6 +278,8 @@ static inline key_serial_t key_serial(struct key *key) | |||
275 | extern ctl_table key_sysctls[]; | 278 | extern ctl_table key_sysctls[]; |
276 | #endif | 279 | #endif |
277 | 280 | ||
281 | extern void key_replace_session_keyring(void); | ||
282 | |||
278 | /* | 283 | /* |
279 | * the userspace interface | 284 | * the userspace interface |
280 | */ | 285 | */ |
@@ -297,6 +302,7 @@ extern void key_init(void); | |||
297 | #define key_fsuid_changed(t) do { } while(0) | 302 | #define key_fsuid_changed(t) do { } while(0) |
298 | #define key_fsgid_changed(t) do { } while(0) | 303 | #define key_fsgid_changed(t) do { } while(0) |
299 | #define key_init() do { } while(0) | 304 | #define key_init() do { } while(0) |
305 | #define key_replace_session_keyring() do { } while(0) | ||
300 | 306 | ||
301 | #endif /* CONFIG_KEYS */ | 307 | #endif /* CONFIG_KEYS */ |
302 | #endif /* __KERNEL__ */ | 308 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/keyctl.h b/include/linux/keyctl.h index c0688eb72093..bd383f1944fb 100644 --- a/include/linux/keyctl.h +++ b/include/linux/keyctl.h | |||
@@ -52,5 +52,6 @@ | |||
52 | #define KEYCTL_SET_TIMEOUT 15 /* set key timeout */ | 52 | #define KEYCTL_SET_TIMEOUT 15 /* set key timeout */ |
53 | #define KEYCTL_ASSUME_AUTHORITY 16 /* assume request_key() authorisation */ | 53 | #define KEYCTL_ASSUME_AUTHORITY 16 /* assume request_key() authorisation */ |
54 | #define KEYCTL_GET_SECURITY 17 /* get key security label */ | 54 | #define KEYCTL_GET_SECURITY 17 /* get key security label */ |
55 | #define KEYCTL_SESSION_TO_PARENT 18 /* apply session keyring to parent process */ | ||
55 | 56 | ||
56 | #endif /* _LINUX_KEYCTL_H */ | 57 | #endif /* _LINUX_KEYCTL_H */ |
diff --git a/include/linux/kmemcheck.h b/include/linux/kmemcheck.h index 47b39b7c7e84..dc2fd545db00 100644 --- a/include/linux/kmemcheck.h +++ b/include/linux/kmemcheck.h | |||
@@ -34,6 +34,8 @@ void kmemcheck_mark_initialized_pages(struct page *p, unsigned int n); | |||
34 | int kmemcheck_show_addr(unsigned long address); | 34 | int kmemcheck_show_addr(unsigned long address); |
35 | int kmemcheck_hide_addr(unsigned long address); | 35 | int kmemcheck_hide_addr(unsigned long address); |
36 | 36 | ||
37 | bool kmemcheck_is_obj_initialized(unsigned long addr, size_t size); | ||
38 | |||
37 | #else | 39 | #else |
38 | #define kmemcheck_enabled 0 | 40 | #define kmemcheck_enabled 0 |
39 | 41 | ||
@@ -99,6 +101,11 @@ static inline void kmemcheck_mark_initialized_pages(struct page *p, | |||
99 | { | 101 | { |
100 | } | 102 | } |
101 | 103 | ||
104 | static inline bool kmemcheck_is_obj_initialized(unsigned long addr, size_t size) | ||
105 | { | ||
106 | return true; | ||
107 | } | ||
108 | |||
102 | #endif /* CONFIG_KMEMCHECK */ | 109 | #endif /* CONFIG_KMEMCHECK */ |
103 | 110 | ||
104 | /* | 111 | /* |
diff --git a/include/linux/kmemleak.h b/include/linux/kmemleak.h index 7796aed6cdd5..3c7497d46ee9 100644 --- a/include/linux/kmemleak.h +++ b/include/linux/kmemleak.h | |||
@@ -23,17 +23,18 @@ | |||
23 | 23 | ||
24 | #ifdef CONFIG_DEBUG_KMEMLEAK | 24 | #ifdef CONFIG_DEBUG_KMEMLEAK |
25 | 25 | ||
26 | extern void kmemleak_init(void); | 26 | extern void kmemleak_init(void) __ref; |
27 | extern void kmemleak_alloc(const void *ptr, size_t size, int min_count, | 27 | extern void kmemleak_alloc(const void *ptr, size_t size, int min_count, |
28 | gfp_t gfp); | 28 | gfp_t gfp) __ref; |
29 | extern void kmemleak_free(const void *ptr); | 29 | extern void kmemleak_free(const void *ptr) __ref; |
30 | extern void kmemleak_free_part(const void *ptr, size_t size) __ref; | ||
30 | extern void kmemleak_padding(const void *ptr, unsigned long offset, | 31 | extern void kmemleak_padding(const void *ptr, unsigned long offset, |
31 | size_t size); | 32 | size_t size) __ref; |
32 | extern void kmemleak_not_leak(const void *ptr); | 33 | extern void kmemleak_not_leak(const void *ptr) __ref; |
33 | extern void kmemleak_ignore(const void *ptr); | 34 | extern void kmemleak_ignore(const void *ptr) __ref; |
34 | extern void kmemleak_scan_area(const void *ptr, unsigned long offset, | 35 | extern void kmemleak_scan_area(const void *ptr, unsigned long offset, |
35 | size_t length, gfp_t gfp); | 36 | size_t length, gfp_t gfp) __ref; |
36 | extern void kmemleak_no_scan(const void *ptr); | 37 | extern void kmemleak_no_scan(const void *ptr) __ref; |
37 | 38 | ||
38 | static inline void kmemleak_alloc_recursive(const void *ptr, size_t size, | 39 | static inline void kmemleak_alloc_recursive(const void *ptr, size_t size, |
39 | int min_count, unsigned long flags, | 40 | int min_count, unsigned long flags, |
@@ -71,6 +72,9 @@ static inline void kmemleak_alloc_recursive(const void *ptr, size_t size, | |||
71 | static inline void kmemleak_free(const void *ptr) | 72 | static inline void kmemleak_free(const void *ptr) |
72 | { | 73 | { |
73 | } | 74 | } |
75 | static inline void kmemleak_free_part(const void *ptr, size_t size) | ||
76 | { | ||
77 | } | ||
74 | static inline void kmemleak_free_recursive(const void *ptr, unsigned long flags) | 78 | static inline void kmemleak_free_recursive(const void *ptr, unsigned long flags) |
75 | { | 79 | { |
76 | } | 80 | } |
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index aacc5449f586..3060bdc35ffe 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -110,6 +110,7 @@ struct kvm_memory_slot { | |||
110 | 110 | ||
111 | struct kvm_kernel_irq_routing_entry { | 111 | struct kvm_kernel_irq_routing_entry { |
112 | u32 gsi; | 112 | u32 gsi; |
113 | u32 type; | ||
113 | int (*set)(struct kvm_kernel_irq_routing_entry *e, | 114 | int (*set)(struct kvm_kernel_irq_routing_entry *e, |
114 | struct kvm *kvm, int level); | 115 | struct kvm *kvm, int level); |
115 | union { | 116 | union { |
@@ -125,6 +126,7 @@ struct kvm_kernel_irq_routing_entry { | |||
125 | struct kvm { | 126 | struct kvm { |
126 | struct mutex lock; /* protects the vcpus array and APIC accesses */ | 127 | struct mutex lock; /* protects the vcpus array and APIC accesses */ |
127 | spinlock_t mmu_lock; | 128 | spinlock_t mmu_lock; |
129 | spinlock_t requests_lock; | ||
128 | struct rw_semaphore slots_lock; | 130 | struct rw_semaphore slots_lock; |
129 | struct mm_struct *mm; /* userspace tied to this vm */ | 131 | struct mm_struct *mm; /* userspace tied to this vm */ |
130 | int nmemslots; | 132 | int nmemslots; |
diff --git a/include/linux/leds-lp3944.h b/include/linux/leds-lp3944.h new file mode 100644 index 000000000000..afc9f9fd70f5 --- /dev/null +++ b/include/linux/leds-lp3944.h | |||
@@ -0,0 +1,53 @@ | |||
1 | /* | ||
2 | * leds-lp3944.h - platform data structure for lp3944 led controller | ||
3 | * | ||
4 | * Copyright (C) 2009 Antonio Ospite <ospite@studenti.unina.it> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | */ | ||
11 | |||
12 | #ifndef __LINUX_LEDS_LP3944_H | ||
13 | #define __LINUX_LEDS_LP3944_H | ||
14 | |||
15 | #include <linux/leds.h> | ||
16 | #include <linux/workqueue.h> | ||
17 | |||
18 | #define LP3944_LED0 0 | ||
19 | #define LP3944_LED1 1 | ||
20 | #define LP3944_LED2 2 | ||
21 | #define LP3944_LED3 3 | ||
22 | #define LP3944_LED4 4 | ||
23 | #define LP3944_LED5 5 | ||
24 | #define LP3944_LED6 6 | ||
25 | #define LP3944_LED7 7 | ||
26 | #define LP3944_LEDS_MAX 8 | ||
27 | |||
28 | #define LP3944_LED_STATUS_MASK 0x03 | ||
29 | enum lp3944_status { | ||
30 | LP3944_LED_STATUS_OFF = 0x0, | ||
31 | LP3944_LED_STATUS_ON = 0x1, | ||
32 | LP3944_LED_STATUS_DIM0 = 0x2, | ||
33 | LP3944_LED_STATUS_DIM1 = 0x3 | ||
34 | }; | ||
35 | |||
36 | enum lp3944_type { | ||
37 | LP3944_LED_TYPE_NONE, | ||
38 | LP3944_LED_TYPE_LED, | ||
39 | LP3944_LED_TYPE_LED_INVERTED, | ||
40 | }; | ||
41 | |||
42 | struct lp3944_led { | ||
43 | char *name; | ||
44 | enum lp3944_type type; | ||
45 | enum lp3944_status status; | ||
46 | }; | ||
47 | |||
48 | struct lp3944_platform_data { | ||
49 | struct lp3944_led leds[LP3944_LEDS_MAX]; | ||
50 | u8 leds_size; | ||
51 | }; | ||
52 | |||
53 | #endif /* __LINUX_LEDS_LP3944_H */ | ||
diff --git a/include/linux/leds.h b/include/linux/leds.h index 376fe07732ea..d8bf9665e70c 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h | |||
@@ -45,7 +45,10 @@ struct led_classdev { | |||
45 | /* Get LED brightness level */ | 45 | /* Get LED brightness level */ |
46 | enum led_brightness (*brightness_get)(struct led_classdev *led_cdev); | 46 | enum led_brightness (*brightness_get)(struct led_classdev *led_cdev); |
47 | 47 | ||
48 | /* Activate hardware accelerated blink */ | 48 | /* Activate hardware accelerated blink, delays are in |
49 | * miliseconds and if none is provided then a sensible default | ||
50 | * should be chosen. The call can adjust the timings if it can't | ||
51 | * match the values specified exactly. */ | ||
49 | int (*blink_set)(struct led_classdev *led_cdev, | 52 | int (*blink_set)(struct led_classdev *led_cdev, |
50 | unsigned long *delay_on, | 53 | unsigned long *delay_on, |
51 | unsigned long *delay_off); | 54 | unsigned long *delay_off); |
@@ -141,9 +144,14 @@ struct gpio_led { | |||
141 | const char *name; | 144 | const char *name; |
142 | const char *default_trigger; | 145 | const char *default_trigger; |
143 | unsigned gpio; | 146 | unsigned gpio; |
144 | u8 active_low : 1; | 147 | unsigned active_low : 1; |
145 | u8 retain_state_suspended : 1; | 148 | unsigned retain_state_suspended : 1; |
149 | unsigned default_state : 2; | ||
150 | /* default_state should be one of LEDS_GPIO_DEFSTATE_(ON|OFF|KEEP) */ | ||
146 | }; | 151 | }; |
152 | #define LEDS_GPIO_DEFSTATE_OFF 0 | ||
153 | #define LEDS_GPIO_DEFSTATE_ON 1 | ||
154 | #define LEDS_GPIO_DEFSTATE_KEEP 2 | ||
147 | 155 | ||
148 | struct gpio_led_platform_data { | 156 | struct gpio_led_platform_data { |
149 | int num_leds; | 157 | int num_leds; |
diff --git a/include/linux/lguest.h b/include/linux/lguest.h index 7bc1440fc473..2fb1dcbcb5aa 100644 --- a/include/linux/lguest.h +++ b/include/linux/lguest.h | |||
@@ -1,5 +1,7 @@ | |||
1 | /* Things the lguest guest needs to know. Note: like all lguest interfaces, | 1 | /* |
2 | * this is subject to wild and random change between versions. */ | 2 | * Things the lguest guest needs to know. Note: like all lguest interfaces, |
3 | * this is subject to wild and random change between versions. | ||
4 | */ | ||
3 | #ifndef _LINUX_LGUEST_H | 5 | #ifndef _LINUX_LGUEST_H |
4 | #define _LINUX_LGUEST_H | 6 | #define _LINUX_LGUEST_H |
5 | 7 | ||
@@ -11,32 +13,41 @@ | |||
11 | #define LG_CLOCK_MIN_DELTA 100UL | 13 | #define LG_CLOCK_MIN_DELTA 100UL |
12 | #define LG_CLOCK_MAX_DELTA ULONG_MAX | 14 | #define LG_CLOCK_MAX_DELTA ULONG_MAX |
13 | 15 | ||
14 | /*G:032 The second method of communicating with the Host is to via "struct | 16 | /*G:031 |
17 | * The second method of communicating with the Host is to via "struct | ||
15 | * lguest_data". Once the Guest's initialization hypercall tells the Host where | 18 | * lguest_data". Once the Guest's initialization hypercall tells the Host where |
16 | * this is, the Guest and Host both publish information in it. :*/ | 19 | * this is, the Guest and Host both publish information in it. |
17 | struct lguest_data | 20 | :*/ |
18 | { | 21 | struct lguest_data { |
19 | /* 512 == enabled (same as eflags in normal hardware). The Guest | 22 | /* |
20 | * changes interrupts so often that a hypercall is too slow. */ | 23 | * 512 == enabled (same as eflags in normal hardware). The Guest |
24 | * changes interrupts so often that a hypercall is too slow. | ||
25 | */ | ||
21 | unsigned int irq_enabled; | 26 | unsigned int irq_enabled; |
22 | /* Fine-grained interrupt disabling by the Guest */ | 27 | /* Fine-grained interrupt disabling by the Guest */ |
23 | DECLARE_BITMAP(blocked_interrupts, LGUEST_IRQS); | 28 | DECLARE_BITMAP(blocked_interrupts, LGUEST_IRQS); |
24 | 29 | ||
25 | /* The Host writes the virtual address of the last page fault here, | 30 | /* |
31 | * The Host writes the virtual address of the last page fault here, | ||
26 | * which saves the Guest a hypercall. CR2 is the native register where | 32 | * which saves the Guest a hypercall. CR2 is the native register where |
27 | * this address would normally be found. */ | 33 | * this address would normally be found. |
34 | */ | ||
28 | unsigned long cr2; | 35 | unsigned long cr2; |
29 | 36 | ||
30 | /* Wallclock time set by the Host. */ | 37 | /* Wallclock time set by the Host. */ |
31 | struct timespec time; | 38 | struct timespec time; |
32 | 39 | ||
33 | /* Interrupt pending set by the Host. The Guest should do a hypercall | 40 | /* |
34 | * if it re-enables interrupts and sees this set (to X86_EFLAGS_IF). */ | 41 | * Interrupt pending set by the Host. The Guest should do a hypercall |
42 | * if it re-enables interrupts and sees this set (to X86_EFLAGS_IF). | ||
43 | */ | ||
35 | int irq_pending; | 44 | int irq_pending; |
36 | 45 | ||
37 | /* Async hypercall ring. Instead of directly making hypercalls, we can | 46 | /* |
47 | * Async hypercall ring. Instead of directly making hypercalls, we can | ||
38 | * place them in here for processing the next time the Host wants. | 48 | * place them in here for processing the next time the Host wants. |
39 | * This batching can be quite efficient. */ | 49 | * This batching can be quite efficient. |
50 | */ | ||
40 | 51 | ||
41 | /* 0xFF == done (set by Host), 0 == pending (set by Guest). */ | 52 | /* 0xFF == done (set by Host), 0 == pending (set by Guest). */ |
42 | u8 hcall_status[LHCALL_RING_SIZE]; | 53 | u8 hcall_status[LHCALL_RING_SIZE]; |
diff --git a/include/linux/lguest_launcher.h b/include/linux/lguest_launcher.h index bfefbdf7498a..495203ff221c 100644 --- a/include/linux/lguest_launcher.h +++ b/include/linux/lguest_launcher.h | |||
@@ -29,8 +29,10 @@ struct lguest_device_desc { | |||
29 | __u8 type; | 29 | __u8 type; |
30 | /* The number of virtqueues (first in config array) */ | 30 | /* The number of virtqueues (first in config array) */ |
31 | __u8 num_vq; | 31 | __u8 num_vq; |
32 | /* The number of bytes of feature bits. Multiply by 2: one for host | 32 | /* |
33 | * features and one for Guest acknowledgements. */ | 33 | * The number of bytes of feature bits. Multiply by 2: one for host |
34 | * features and one for Guest acknowledgements. | ||
35 | */ | ||
34 | __u8 feature_len; | 36 | __u8 feature_len; |
35 | /* The number of bytes of the config array after virtqueues. */ | 37 | /* The number of bytes of the config array after virtqueues. */ |
36 | __u8 config_len; | 38 | __u8 config_len; |
@@ -39,8 +41,10 @@ struct lguest_device_desc { | |||
39 | __u8 config[0]; | 41 | __u8 config[0]; |
40 | }; | 42 | }; |
41 | 43 | ||
42 | /*D:135 This is how we expect the device configuration field for a virtqueue | 44 | /*D:135 |
43 | * to be laid out in config space. */ | 45 | * This is how we expect the device configuration field for a virtqueue |
46 | * to be laid out in config space. | ||
47 | */ | ||
44 | struct lguest_vqconfig { | 48 | struct lguest_vqconfig { |
45 | /* The number of entries in the virtio_ring */ | 49 | /* The number of entries in the virtio_ring */ |
46 | __u16 num; | 50 | __u16 num; |
@@ -61,7 +65,9 @@ enum lguest_req | |||
61 | LHREQ_EVENTFD, /* + address, fd. */ | 65 | LHREQ_EVENTFD, /* + address, fd. */ |
62 | }; | 66 | }; |
63 | 67 | ||
64 | /* The alignment to use between consumer and producer parts of vring. | 68 | /* |
65 | * x86 pagesize for historical reasons. */ | 69 | * The alignment to use between consumer and producer parts of vring. |
70 | * x86 pagesize for historical reasons. | ||
71 | */ | ||
66 | #define LGUEST_VRING_ALIGN 4096 | 72 | #define LGUEST_VRING_ALIGN 4096 |
67 | #endif /* _LINUX_LGUEST_LAUNCHER */ | 73 | #endif /* _LINUX_LGUEST_LAUNCHER */ |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 3d501db36a26..e5b6e33c6571 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -385,6 +385,7 @@ enum { | |||
385 | not multiple of 16 bytes */ | 385 | not multiple of 16 bytes */ |
386 | ATA_HORKAGE_FIRMWARE_WARN = (1 << 12), /* firmware update warning */ | 386 | ATA_HORKAGE_FIRMWARE_WARN = (1 << 12), /* firmware update warning */ |
387 | ATA_HORKAGE_1_5_GBPS = (1 << 13), /* force 1.5 Gbps */ | 387 | ATA_HORKAGE_1_5_GBPS = (1 << 13), /* force 1.5 Gbps */ |
388 | ATA_HORKAGE_NOSETXFER = (1 << 14), /* skip SETXFER, SATA only */ | ||
388 | 389 | ||
389 | /* DMA mask for user DMA control: User visible values; DO NOT | 390 | /* DMA mask for user DMA control: User visible values; DO NOT |
390 | renumber */ | 391 | renumber */ |
@@ -588,6 +589,7 @@ struct ata_device { | |||
588 | #endif | 589 | #endif |
589 | /* n_sector is CLEAR_BEGIN, read comment above CLEAR_BEGIN */ | 590 | /* n_sector is CLEAR_BEGIN, read comment above CLEAR_BEGIN */ |
590 | u64 n_sectors; /* size of device, if ATA */ | 591 | u64 n_sectors; /* size of device, if ATA */ |
592 | u64 n_native_sectors; /* native size, if ATA */ | ||
591 | unsigned int class; /* ATA_DEV_xxx */ | 593 | unsigned int class; /* ATA_DEV_xxx */ |
592 | unsigned long unpark_deadline; | 594 | unsigned long unpark_deadline; |
593 | 595 | ||
diff --git a/include/linux/linkage.h b/include/linux/linkage.h index fee9e59649c1..691f59171c6c 100644 --- a/include/linux/linkage.h +++ b/include/linux/linkage.h | |||
@@ -22,6 +22,15 @@ | |||
22 | #define __page_aligned_bss __section(.bss.page_aligned) __aligned(PAGE_SIZE) | 22 | #define __page_aligned_bss __section(.bss.page_aligned) __aligned(PAGE_SIZE) |
23 | 23 | ||
24 | /* | 24 | /* |
25 | * For assembly routines. | ||
26 | * | ||
27 | * Note when using these that you must specify the appropriate | ||
28 | * alignment directives yourself | ||
29 | */ | ||
30 | #define __PAGE_ALIGNED_DATA .section ".data.page_aligned", "aw" | ||
31 | #define __PAGE_ALIGNED_BSS .section ".bss.page_aligned", "aw" | ||
32 | |||
33 | /* | ||
25 | * This is used by architectures to keep arguments on the stack | 34 | * This is used by architectures to keep arguments on the stack |
26 | * untouched by the compiler by keeping them live until the end. | 35 | * untouched by the compiler by keeping them live until the end. |
27 | * The argument stack may be owned by the assembly-language | 36 | * The argument stack may be owned by the assembly-language |
diff --git a/include/linux/lmb.h b/include/linux/lmb.h index c46c89505dac..2442e3f3d033 100644 --- a/include/linux/lmb.h +++ b/include/linux/lmb.h | |||
@@ -51,7 +51,7 @@ extern u64 __init lmb_alloc_base(u64 size, | |||
51 | extern u64 __init __lmb_alloc_base(u64 size, | 51 | extern u64 __init __lmb_alloc_base(u64 size, |
52 | u64 align, u64 max_addr); | 52 | u64 align, u64 max_addr); |
53 | extern u64 __init lmb_phys_mem_size(void); | 53 | extern u64 __init lmb_phys_mem_size(void); |
54 | extern u64 __init lmb_end_of_DRAM(void); | 54 | extern u64 lmb_end_of_DRAM(void); |
55 | extern void __init lmb_enforce_memory_limit(u64 memory_limit); | 55 | extern void __init lmb_enforce_memory_limit(u64 memory_limit); |
56 | extern int __init lmb_is_reserved(u64 addr); | 56 | extern int __init lmb_is_reserved(u64 addr); |
57 | extern int lmb_find(struct lmb_property *res); | 57 | extern int lmb_find(struct lmb_property *res); |
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index 51855dfd8adb..c325b187966b 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h | |||
@@ -195,7 +195,7 @@ extern struct svc_procedure nlmsvc_procedures4[]; | |||
195 | extern int nlmsvc_grace_period; | 195 | extern int nlmsvc_grace_period; |
196 | extern unsigned long nlmsvc_timeout; | 196 | extern unsigned long nlmsvc_timeout; |
197 | extern int nsm_use_hostnames; | 197 | extern int nsm_use_hostnames; |
198 | extern int nsm_local_state; | 198 | extern u32 nsm_local_state; |
199 | 199 | ||
200 | /* | 200 | /* |
201 | * Lockd client functions | 201 | * Lockd client functions |
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index da5a5a1f4cd2..b25d1b53df0d 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h | |||
@@ -258,6 +258,16 @@ extern void lockdep_init_map(struct lockdep_map *lock, const char *name, | |||
258 | #define lockdep_set_subclass(lock, sub) \ | 258 | #define lockdep_set_subclass(lock, sub) \ |
259 | lockdep_init_map(&(lock)->dep_map, #lock, \ | 259 | lockdep_init_map(&(lock)->dep_map, #lock, \ |
260 | (lock)->dep_map.key, sub) | 260 | (lock)->dep_map.key, sub) |
261 | /* | ||
262 | * Compare locking classes | ||
263 | */ | ||
264 | #define lockdep_match_class(lock, key) lockdep_match_key(&(lock)->dep_map, key) | ||
265 | |||
266 | static inline int lockdep_match_key(struct lockdep_map *lock, | ||
267 | struct lock_class_key *key) | ||
268 | { | ||
269 | return lock->key == key; | ||
270 | } | ||
261 | 271 | ||
262 | /* | 272 | /* |
263 | * Acquire a lock. | 273 | * Acquire a lock. |
@@ -326,6 +336,11 @@ static inline void lockdep_on(void) | |||
326 | #define lockdep_set_class_and_subclass(lock, key, sub) \ | 336 | #define lockdep_set_class_and_subclass(lock, key, sub) \ |
327 | do { (void)(key); } while (0) | 337 | do { (void)(key); } while (0) |
328 | #define lockdep_set_subclass(lock, sub) do { } while (0) | 338 | #define lockdep_set_subclass(lock, sub) do { } while (0) |
339 | /* | ||
340 | * We don't define lockdep_match_class() and lockdep_match_key() for !LOCKDEP | ||
341 | * case since the result is not well defined and the caller should rather | ||
342 | * #ifdef the call himself. | ||
343 | */ | ||
329 | 344 | ||
330 | # define INIT_LOCKDEP | 345 | # define INIT_LOCKDEP |
331 | # define lockdep_reset() do { debug_locks = 1; } while (0) | 346 | # define lockdep_reset() do { debug_locks = 1; } while (0) |
diff --git a/include/linux/lsm_audit.h b/include/linux/lsm_audit.h index e461b2c3d711..190c37854870 100644 --- a/include/linux/lsm_audit.h +++ b/include/linux/lsm_audit.h | |||
@@ -33,6 +33,7 @@ struct common_audit_data { | |||
33 | #define LSM_AUDIT_DATA_IPC 4 | 33 | #define LSM_AUDIT_DATA_IPC 4 |
34 | #define LSM_AUDIT_DATA_TASK 5 | 34 | #define LSM_AUDIT_DATA_TASK 5 |
35 | #define LSM_AUDIT_DATA_KEY 6 | 35 | #define LSM_AUDIT_DATA_KEY 6 |
36 | #define LSM_AUDIT_NO_AUDIT 7 | ||
36 | struct task_struct *tsk; | 37 | struct task_struct *tsk; |
37 | union { | 38 | union { |
38 | struct { | 39 | struct { |
@@ -66,16 +67,19 @@ struct common_audit_data { | |||
66 | } key_struct; | 67 | } key_struct; |
67 | #endif | 68 | #endif |
68 | } u; | 69 | } u; |
69 | const char *function; | ||
70 | /* this union contains LSM specific data */ | 70 | /* this union contains LSM specific data */ |
71 | union { | 71 | union { |
72 | #ifdef CONFIG_SECURITY_SMACK | ||
72 | /* SMACK data */ | 73 | /* SMACK data */ |
73 | struct smack_audit_data { | 74 | struct smack_audit_data { |
75 | const char *function; | ||
74 | char *subject; | 76 | char *subject; |
75 | char *object; | 77 | char *object; |
76 | char *request; | 78 | char *request; |
77 | int result; | 79 | int result; |
78 | } smack_audit_data; | 80 | } smack_audit_data; |
81 | #endif | ||
82 | #ifdef CONFIG_SECURITY_SELINUX | ||
79 | /* SELinux data */ | 83 | /* SELinux data */ |
80 | struct { | 84 | struct { |
81 | u32 ssid; | 85 | u32 ssid; |
@@ -83,10 +87,12 @@ struct common_audit_data { | |||
83 | u16 tclass; | 87 | u16 tclass; |
84 | u32 requested; | 88 | u32 requested; |
85 | u32 audited; | 89 | u32 audited; |
90 | u32 denied; | ||
86 | struct av_decision *avd; | 91 | struct av_decision *avd; |
87 | int result; | 92 | int result; |
88 | } selinux_audit_data; | 93 | } selinux_audit_data; |
89 | } lsm_priv; | 94 | #endif |
95 | }; | ||
90 | /* these callback will be implemented by a specific LSM */ | 96 | /* these callback will be implemented by a specific LSM */ |
91 | void (*lsm_pre_audit)(struct audit_buffer *, void *); | 97 | void (*lsm_pre_audit)(struct audit_buffer *, void *); |
92 | void (*lsm_post_audit)(struct audit_buffer *, void *); | 98 | void (*lsm_post_audit)(struct audit_buffer *, void *); |
@@ -104,7 +110,7 @@ int ipv6_skb_to_auditdata(struct sk_buff *skb, | |||
104 | /* Initialize an LSM audit data structure. */ | 110 | /* Initialize an LSM audit data structure. */ |
105 | #define COMMON_AUDIT_DATA_INIT(_d, _t) \ | 111 | #define COMMON_AUDIT_DATA_INIT(_d, _t) \ |
106 | { memset((_d), 0, sizeof(struct common_audit_data)); \ | 112 | { memset((_d), 0, sizeof(struct common_audit_data)); \ |
107 | (_d)->type = LSM_AUDIT_DATA_##_t; (_d)->function = __func__; } | 113 | (_d)->type = LSM_AUDIT_DATA_##_t; } |
108 | 114 | ||
109 | void common_lsm_audit(struct common_audit_data *a); | 115 | void common_lsm_audit(struct common_audit_data *a); |
110 | 116 | ||
diff --git a/include/linux/max17040_battery.h b/include/linux/max17040_battery.h new file mode 100644 index 000000000000..ad97b06cf930 --- /dev/null +++ b/include/linux/max17040_battery.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009 Samsung Electronics | ||
3 | * Minkyu Kang <mk7.kang@samsung.com> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | */ | ||
9 | |||
10 | #ifndef __MAX17040_BATTERY_H_ | ||
11 | #define __MAX17040_BATTERY_H_ | ||
12 | |||
13 | struct max17040_platform_data { | ||
14 | int (*battery_online)(void); | ||
15 | int (*charger_online)(void); | ||
16 | int (*charger_enable)(void); | ||
17 | }; | ||
18 | |||
19 | #endif | ||
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 45add35dda1b..e46a0734ab6e 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -117,7 +117,7 @@ static inline bool mem_cgroup_disabled(void) | |||
117 | } | 117 | } |
118 | 118 | ||
119 | extern bool mem_cgroup_oom_called(struct task_struct *task); | 119 | extern bool mem_cgroup_oom_called(struct task_struct *task); |
120 | 120 | void mem_cgroup_update_mapped_file_stat(struct page *page, int val); | |
121 | #else /* CONFIG_CGROUP_MEM_RES_CTLR */ | 121 | #else /* CONFIG_CGROUP_MEM_RES_CTLR */ |
122 | struct mem_cgroup; | 122 | struct mem_cgroup; |
123 | 123 | ||
@@ -271,6 +271,11 @@ mem_cgroup_print_oom_info(struct mem_cgroup *memcg, struct task_struct *p) | |||
271 | { | 271 | { |
272 | } | 272 | } |
273 | 273 | ||
274 | static inline void mem_cgroup_update_mapped_file_stat(struct page *page, | ||
275 | int val) | ||
276 | { | ||
277 | } | ||
278 | |||
274 | #endif /* CONFIG_CGROUP_MEM_CONT */ | 279 | #endif /* CONFIG_CGROUP_MEM_CONT */ |
275 | 280 | ||
276 | #endif /* _LINUX_MEMCONTROL_H */ | 281 | #endif /* _LINUX_MEMCONTROL_H */ |
diff --git a/include/linux/mm.h b/include/linux/mm.h index d88d6fc530ad..9a72cc78e6b8 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -34,8 +34,6 @@ extern int sysctl_legacy_va_layout; | |||
34 | #define sysctl_legacy_va_layout 0 | 34 | #define sysctl_legacy_va_layout 0 |
35 | #endif | 35 | #endif |
36 | 36 | ||
37 | extern unsigned long mmap_min_addr; | ||
38 | |||
39 | #include <asm/page.h> | 37 | #include <asm/page.h> |
40 | #include <asm/pgtable.h> | 38 | #include <asm/pgtable.h> |
41 | #include <asm/processor.h> | 39 | #include <asm/processor.h> |
@@ -575,19 +573,6 @@ static inline void set_page_links(struct page *page, enum zone_type zone, | |||
575 | } | 573 | } |
576 | 574 | ||
577 | /* | 575 | /* |
578 | * If a hint addr is less than mmap_min_addr change hint to be as | ||
579 | * low as possible but still greater than mmap_min_addr | ||
580 | */ | ||
581 | static inline unsigned long round_hint_to_min(unsigned long hint) | ||
582 | { | ||
583 | hint &= PAGE_MASK; | ||
584 | if (((void *)hint != NULL) && | ||
585 | (hint < mmap_min_addr)) | ||
586 | return PAGE_ALIGN(mmap_min_addr); | ||
587 | return hint; | ||
588 | } | ||
589 | |||
590 | /* | ||
591 | * Some inline functions in vmstat.h depend on page_zone() | 576 | * Some inline functions in vmstat.h depend on page_zone() |
592 | */ | 577 | */ |
593 | #include <linux/vmstat.h> | 578 | #include <linux/vmstat.h> |
@@ -810,11 +795,11 @@ extern int vmtruncate_range(struct inode * inode, loff_t offset, loff_t end); | |||
810 | 795 | ||
811 | #ifdef CONFIG_MMU | 796 | #ifdef CONFIG_MMU |
812 | extern int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma, | 797 | extern int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma, |
813 | unsigned long address, int write_access); | 798 | unsigned long address, unsigned int flags); |
814 | #else | 799 | #else |
815 | static inline int handle_mm_fault(struct mm_struct *mm, | 800 | static inline int handle_mm_fault(struct mm_struct *mm, |
816 | struct vm_area_struct *vma, unsigned long address, | 801 | struct vm_area_struct *vma, unsigned long address, |
817 | int write_access) | 802 | unsigned int flags) |
818 | { | 803 | { |
819 | /* should never happen if there's no MMU */ | 804 | /* should never happen if there's no MMU */ |
820 | BUG(); | 805 | BUG(); |
@@ -826,7 +811,7 @@ extern int make_pages_present(unsigned long addr, unsigned long end); | |||
826 | extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write); | 811 | extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write); |
827 | 812 | ||
828 | int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, | 813 | int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, |
829 | unsigned long start, int len, int write, int force, | 814 | unsigned long start, int nr_pages, int write, int force, |
830 | struct page **pages, struct vm_area_struct **vmas); | 815 | struct page **pages, struct vm_area_struct **vmas); |
831 | int get_user_pages_fast(unsigned long start, int nr_pages, int write, | 816 | int get_user_pages_fast(unsigned long start, int nr_pages, int write, |
832 | struct page **pages); | 817 | struct page **pages); |
@@ -854,6 +839,12 @@ extern int mprotect_fixup(struct vm_area_struct *vma, | |||
854 | unsigned long end, unsigned long newflags); | 839 | unsigned long end, unsigned long newflags); |
855 | 840 | ||
856 | /* | 841 | /* |
842 | * doesn't attempt to fault and will return short. | ||
843 | */ | ||
844 | int __get_user_pages_fast(unsigned long start, int nr_pages, int write, | ||
845 | struct page **pages); | ||
846 | |||
847 | /* | ||
857 | * A callback you can register to apply pressure to ageable caches. | 848 | * A callback you can register to apply pressure to ageable caches. |
858 | * | 849 | * |
859 | * 'shrink' is passed a count 'nr_to_scan' and a 'gfpmask'. It should | 850 | * 'shrink' is passed a count 'nr_to_scan' and a 'gfpmask'. It should |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 7acc8439d9b3..0042090a4d70 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
@@ -240,8 +240,6 @@ struct mm_struct { | |||
240 | 240 | ||
241 | unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */ | 241 | unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */ |
242 | 242 | ||
243 | s8 oom_adj; /* OOM kill score adjustment (bit shift) */ | ||
244 | |||
245 | cpumask_t cpu_vm_mask; | 243 | cpumask_t cpu_vm_mask; |
246 | 244 | ||
247 | /* Architecture-specific MM context */ | 245 | /* Architecture-specific MM context */ |
diff --git a/include/linux/mnt_namespace.h b/include/linux/mnt_namespace.h index 3a059298cc19..d74785c2393a 100644 --- a/include/linux/mnt_namespace.h +++ b/include/linux/mnt_namespace.h | |||
@@ -2,10 +2,9 @@ | |||
2 | #define _NAMESPACE_H_ | 2 | #define _NAMESPACE_H_ |
3 | #ifdef __KERNEL__ | 3 | #ifdef __KERNEL__ |
4 | 4 | ||
5 | #include <linux/mount.h> | 5 | #include <linux/path.h> |
6 | #include <linux/sched.h> | ||
7 | #include <linux/nsproxy.h> | ||
8 | #include <linux/seq_file.h> | 6 | #include <linux/seq_file.h> |
7 | #include <linux/wait.h> | ||
9 | 8 | ||
10 | struct mnt_namespace { | 9 | struct mnt_namespace { |
11 | atomic_t count; | 10 | atomic_t count; |
@@ -24,24 +23,10 @@ struct proc_mounts { | |||
24 | 23 | ||
25 | struct fs_struct; | 24 | struct fs_struct; |
26 | 25 | ||
26 | extern struct mnt_namespace *create_mnt_ns(struct vfsmount *mnt); | ||
27 | extern struct mnt_namespace *copy_mnt_ns(unsigned long, struct mnt_namespace *, | 27 | extern struct mnt_namespace *copy_mnt_ns(unsigned long, struct mnt_namespace *, |
28 | struct fs_struct *); | 28 | struct fs_struct *); |
29 | extern void __put_mnt_ns(struct mnt_namespace *ns); | 29 | extern void put_mnt_ns(struct mnt_namespace *ns); |
30 | |||
31 | static inline void put_mnt_ns(struct mnt_namespace *ns) | ||
32 | { | ||
33 | if (atomic_dec_and_lock(&ns->count, &vfsmount_lock)) | ||
34 | /* releases vfsmount_lock */ | ||
35 | __put_mnt_ns(ns); | ||
36 | } | ||
37 | |||
38 | static inline void exit_mnt_ns(struct task_struct *p) | ||
39 | { | ||
40 | struct mnt_namespace *ns = p->nsproxy->mnt_ns; | ||
41 | if (ns) | ||
42 | put_mnt_ns(ns); | ||
43 | } | ||
44 | |||
45 | static inline void get_mnt_ns(struct mnt_namespace *ns) | 30 | static inline void get_mnt_ns(struct mnt_namespace *ns) |
46 | { | 31 | { |
47 | atomic_inc(&ns->count); | 32 | atomic_inc(&ns->count); |
diff --git a/include/linux/module.h b/include/linux/module.h index 505f20dcc1c7..098bdb7bfacf 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -363,6 +363,12 @@ struct module | |||
363 | local_t ref; | 363 | local_t ref; |
364 | #endif | 364 | #endif |
365 | #endif | 365 | #endif |
366 | |||
367 | #ifdef CONFIG_CONSTRUCTORS | ||
368 | /* Constructor functions. */ | ||
369 | ctor_fn_t *ctors; | ||
370 | unsigned int num_ctors; | ||
371 | #endif | ||
366 | }; | 372 | }; |
367 | #ifndef MODULE_ARCH_INIT | 373 | #ifndef MODULE_ARCH_INIT |
368 | #define MODULE_ARCH_INIT {} | 374 | #define MODULE_ARCH_INIT {} |
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 5675b63a0631..0f32a9b6ff55 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
@@ -251,7 +251,7 @@ struct mtd_info { | |||
251 | 251 | ||
252 | static inline struct mtd_info *dev_to_mtd(struct device *dev) | 252 | static inline struct mtd_info *dev_to_mtd(struct device *dev) |
253 | { | 253 | { |
254 | return dev ? container_of(dev, struct mtd_info, dev) : NULL; | 254 | return dev ? dev_get_drvdata(dev) : NULL; |
255 | } | 255 | } |
256 | 256 | ||
257 | static inline uint32_t mtd_div_by_eb(uint64_t sz, struct mtd_info *mtd) | 257 | static inline uint32_t mtd_div_by_eb(uint64_t sz, struct mtd_info *mtd) |
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 7efb9be34662..4030ebada49e 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
@@ -563,6 +563,7 @@ extern int nand_do_read(struct mtd_info *mtd, loff_t from, size_t len, | |||
563 | * @options: Option flags, e.g. 16bit buswidth | 563 | * @options: Option flags, e.g. 16bit buswidth |
564 | * @ecclayout: ecc layout info structure | 564 | * @ecclayout: ecc layout info structure |
565 | * @part_probe_types: NULL-terminated array of probe types | 565 | * @part_probe_types: NULL-terminated array of probe types |
566 | * @set_parts: platform specific function to set partitions | ||
566 | * @priv: hardware controller specific settings | 567 | * @priv: hardware controller specific settings |
567 | */ | 568 | */ |
568 | struct platform_nand_chip { | 569 | struct platform_nand_chip { |
@@ -574,26 +575,41 @@ struct platform_nand_chip { | |||
574 | int chip_delay; | 575 | int chip_delay; |
575 | unsigned int options; | 576 | unsigned int options; |
576 | const char **part_probe_types; | 577 | const char **part_probe_types; |
578 | void (*set_parts)(uint64_t size, | ||
579 | struct platform_nand_chip *chip); | ||
577 | void *priv; | 580 | void *priv; |
578 | }; | 581 | }; |
579 | 582 | ||
583 | /* Keep gcc happy */ | ||
584 | struct platform_device; | ||
585 | |||
580 | /** | 586 | /** |
581 | * struct platform_nand_ctrl - controller level device structure | 587 | * struct platform_nand_ctrl - controller level device structure |
588 | * @probe: platform specific function to probe/setup hardware | ||
589 | * @remove: platform specific function to remove/teardown hardware | ||
582 | * @hwcontrol: platform specific hardware control structure | 590 | * @hwcontrol: platform specific hardware control structure |
583 | * @dev_ready: platform specific function to read ready/busy pin | 591 | * @dev_ready: platform specific function to read ready/busy pin |
584 | * @select_chip: platform specific chip select function | 592 | * @select_chip: platform specific chip select function |
585 | * @cmd_ctrl: platform specific function for controlling | 593 | * @cmd_ctrl: platform specific function for controlling |
586 | * ALE/CLE/nCE. Also used to write command and address | 594 | * ALE/CLE/nCE. Also used to write command and address |
595 | * @write_buf: platform specific function for write buffer | ||
596 | * @read_buf: platform specific function for read buffer | ||
587 | * @priv: private data to transport driver specific settings | 597 | * @priv: private data to transport driver specific settings |
588 | * | 598 | * |
589 | * All fields are optional and depend on the hardware driver requirements | 599 | * All fields are optional and depend on the hardware driver requirements |
590 | */ | 600 | */ |
591 | struct platform_nand_ctrl { | 601 | struct platform_nand_ctrl { |
602 | int (*probe)(struct platform_device *pdev); | ||
603 | void (*remove)(struct platform_device *pdev); | ||
592 | void (*hwcontrol)(struct mtd_info *mtd, int cmd); | 604 | void (*hwcontrol)(struct mtd_info *mtd, int cmd); |
593 | int (*dev_ready)(struct mtd_info *mtd); | 605 | int (*dev_ready)(struct mtd_info *mtd); |
594 | void (*select_chip)(struct mtd_info *mtd, int chip); | 606 | void (*select_chip)(struct mtd_info *mtd, int chip); |
595 | void (*cmd_ctrl)(struct mtd_info *mtd, int dat, | 607 | void (*cmd_ctrl)(struct mtd_info *mtd, int dat, |
596 | unsigned int ctrl); | 608 | unsigned int ctrl); |
609 | void (*write_buf)(struct mtd_info *mtd, | ||
610 | const uint8_t *buf, int len); | ||
611 | void (*read_buf)(struct mtd_info *mtd, | ||
612 | uint8_t *buf, int len); | ||
597 | void *priv; | 613 | void *priv; |
598 | }; | 614 | }; |
599 | 615 | ||
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h index 9aa2a9149b58..8ed873374381 100644 --- a/include/linux/mtd/onenand.h +++ b/include/linux/mtd/onenand.h | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/mtd/onenand_regs.h> | 17 | #include <linux/mtd/onenand_regs.h> |
18 | #include <linux/mtd/bbm.h> | 18 | #include <linux/mtd/bbm.h> |
19 | 19 | ||
20 | #define MAX_DIES 2 | ||
20 | #define MAX_BUFFERRAM 2 | 21 | #define MAX_BUFFERRAM 2 |
21 | 22 | ||
22 | /* Scan and identify a OneNAND device */ | 23 | /* Scan and identify a OneNAND device */ |
@@ -51,7 +52,12 @@ struct onenand_bufferram { | |||
51 | /** | 52 | /** |
52 | * struct onenand_chip - OneNAND Private Flash Chip Data | 53 | * struct onenand_chip - OneNAND Private Flash Chip Data |
53 | * @base: [BOARDSPECIFIC] address to access OneNAND | 54 | * @base: [BOARDSPECIFIC] address to access OneNAND |
55 | * @dies: [INTERN][FLEX-ONENAND] number of dies on chip | ||
56 | * @boundary: [INTERN][FLEX-ONENAND] Boundary of the dies | ||
57 | * @diesize: [INTERN][FLEX-ONENAND] Size of the dies | ||
54 | * @chipsize: [INTERN] the size of one chip for multichip arrays | 58 | * @chipsize: [INTERN] the size of one chip for multichip arrays |
59 | * FIXME For Flex-OneNAND, chipsize holds maximum possible | ||
60 | * device size ie when all blocks are considered MLC | ||
55 | * @device_id: [INTERN] device ID | 61 | * @device_id: [INTERN] device ID |
56 | * @density_mask: chip density, used for DDP devices | 62 | * @density_mask: chip density, used for DDP devices |
57 | * @verstion_id: [INTERN] version ID | 63 | * @verstion_id: [INTERN] version ID |
@@ -68,6 +74,8 @@ struct onenand_bufferram { | |||
68 | * @command: [REPLACEABLE] hardware specific function for writing | 74 | * @command: [REPLACEABLE] hardware specific function for writing |
69 | * commands to the chip | 75 | * commands to the chip |
70 | * @wait: [REPLACEABLE] hardware specific function for wait on ready | 76 | * @wait: [REPLACEABLE] hardware specific function for wait on ready |
77 | * @bbt_wait: [REPLACEABLE] hardware specific function for bbt wait on ready | ||
78 | * @unlock_all: [REPLACEABLE] hardware specific function for unlock all | ||
71 | * @read_bufferram: [REPLACEABLE] hardware specific function for BufferRAM Area | 79 | * @read_bufferram: [REPLACEABLE] hardware specific function for BufferRAM Area |
72 | * @write_bufferram: [REPLACEABLE] hardware specific function for BufferRAM Area | 80 | * @write_bufferram: [REPLACEABLE] hardware specific function for BufferRAM Area |
73 | * @read_word: [REPLACEABLE] hardware specific function for read | 81 | * @read_word: [REPLACEABLE] hardware specific function for read |
@@ -92,9 +100,13 @@ struct onenand_bufferram { | |||
92 | */ | 100 | */ |
93 | struct onenand_chip { | 101 | struct onenand_chip { |
94 | void __iomem *base; | 102 | void __iomem *base; |
103 | unsigned dies; | ||
104 | unsigned boundary[MAX_DIES]; | ||
105 | loff_t diesize[MAX_DIES]; | ||
95 | unsigned int chipsize; | 106 | unsigned int chipsize; |
96 | unsigned int device_id; | 107 | unsigned int device_id; |
97 | unsigned int version_id; | 108 | unsigned int version_id; |
109 | unsigned int technology; | ||
98 | unsigned int density_mask; | 110 | unsigned int density_mask; |
99 | unsigned int options; | 111 | unsigned int options; |
100 | 112 | ||
@@ -108,6 +120,8 @@ struct onenand_chip { | |||
108 | 120 | ||
109 | int (*command)(struct mtd_info *mtd, int cmd, loff_t address, size_t len); | 121 | int (*command)(struct mtd_info *mtd, int cmd, loff_t address, size_t len); |
110 | int (*wait)(struct mtd_info *mtd, int state); | 122 | int (*wait)(struct mtd_info *mtd, int state); |
123 | int (*bbt_wait)(struct mtd_info *mtd, int state); | ||
124 | void (*unlock_all)(struct mtd_info *mtd); | ||
111 | int (*read_bufferram)(struct mtd_info *mtd, int area, | 125 | int (*read_bufferram)(struct mtd_info *mtd, int area, |
112 | unsigned char *buffer, int offset, size_t count); | 126 | unsigned char *buffer, int offset, size_t count); |
113 | int (*write_bufferram)(struct mtd_info *mtd, int area, | 127 | int (*write_bufferram)(struct mtd_info *mtd, int area, |
@@ -145,6 +159,8 @@ struct onenand_chip { | |||
145 | #define ONENAND_SET_BUFFERRAM0(this) (this->bufferram_index = 0) | 159 | #define ONENAND_SET_BUFFERRAM0(this) (this->bufferram_index = 0) |
146 | #define ONENAND_SET_BUFFERRAM1(this) (this->bufferram_index = 1) | 160 | #define ONENAND_SET_BUFFERRAM1(this) (this->bufferram_index = 1) |
147 | 161 | ||
162 | #define FLEXONENAND(this) \ | ||
163 | (this->device_id & DEVICE_IS_FLEXONENAND) | ||
148 | #define ONENAND_GET_SYS_CFG1(this) \ | 164 | #define ONENAND_GET_SYS_CFG1(this) \ |
149 | (this->read_word(this->base + ONENAND_REG_SYS_CFG1)) | 165 | (this->read_word(this->base + ONENAND_REG_SYS_CFG1)) |
150 | #define ONENAND_SET_SYS_CFG1(v, this) \ | 166 | #define ONENAND_SET_SYS_CFG1(v, this) \ |
@@ -153,6 +169,9 @@ struct onenand_chip { | |||
153 | #define ONENAND_IS_DDP(this) \ | 169 | #define ONENAND_IS_DDP(this) \ |
154 | (this->device_id & ONENAND_DEVICE_IS_DDP) | 170 | (this->device_id & ONENAND_DEVICE_IS_DDP) |
155 | 171 | ||
172 | #define ONENAND_IS_MLC(this) \ | ||
173 | (this->technology & ONENAND_TECHNOLOGY_IS_MLC) | ||
174 | |||
156 | #ifdef CONFIG_MTD_ONENAND_2X_PROGRAM | 175 | #ifdef CONFIG_MTD_ONENAND_2X_PROGRAM |
157 | #define ONENAND_IS_2PLANE(this) \ | 176 | #define ONENAND_IS_2PLANE(this) \ |
158 | (this->options & ONENAND_HAS_2PLANE) | 177 | (this->options & ONENAND_HAS_2PLANE) |
@@ -169,6 +188,7 @@ struct onenand_chip { | |||
169 | #define ONENAND_HAS_CONT_LOCK (0x0001) | 188 | #define ONENAND_HAS_CONT_LOCK (0x0001) |
170 | #define ONENAND_HAS_UNLOCK_ALL (0x0002) | 189 | #define ONENAND_HAS_UNLOCK_ALL (0x0002) |
171 | #define ONENAND_HAS_2PLANE (0x0004) | 190 | #define ONENAND_HAS_2PLANE (0x0004) |
191 | #define ONENAND_SKIP_UNLOCK_CHECK (0x0100) | ||
172 | #define ONENAND_PAGEBUF_ALLOC (0x1000) | 192 | #define ONENAND_PAGEBUF_ALLOC (0x1000) |
173 | #define ONENAND_OOBBUF_ALLOC (0x2000) | 193 | #define ONENAND_OOBBUF_ALLOC (0x2000) |
174 | 194 | ||
@@ -176,6 +196,7 @@ struct onenand_chip { | |||
176 | * OneNAND Flash Manufacturer ID Codes | 196 | * OneNAND Flash Manufacturer ID Codes |
177 | */ | 197 | */ |
178 | #define ONENAND_MFR_SAMSUNG 0xec | 198 | #define ONENAND_MFR_SAMSUNG 0xec |
199 | #define ONENAND_MFR_NUMONYX 0x20 | ||
179 | 200 | ||
180 | /** | 201 | /** |
181 | * struct onenand_manufacturers - NAND Flash Manufacturer ID Structure | 202 | * struct onenand_manufacturers - NAND Flash Manufacturer ID Structure |
@@ -189,5 +210,8 @@ struct onenand_manufacturers { | |||
189 | 210 | ||
190 | int onenand_bbt_read_oob(struct mtd_info *mtd, loff_t from, | 211 | int onenand_bbt_read_oob(struct mtd_info *mtd, loff_t from, |
191 | struct mtd_oob_ops *ops); | 212 | struct mtd_oob_ops *ops); |
213 | unsigned onenand_block(struct onenand_chip *this, loff_t addr); | ||
214 | loff_t onenand_addr(struct onenand_chip *this, int block); | ||
215 | int flexonenand_region(struct mtd_info *mtd, loff_t addr); | ||
192 | 216 | ||
193 | #endif /* __LINUX_MTD_ONENAND_H */ | 217 | #endif /* __LINUX_MTD_ONENAND_H */ |
diff --git a/include/linux/mtd/onenand_regs.h b/include/linux/mtd/onenand_regs.h index 0c6bbe28f38c..86a6bbef6465 100644 --- a/include/linux/mtd/onenand_regs.h +++ b/include/linux/mtd/onenand_regs.h | |||
@@ -67,6 +67,9 @@ | |||
67 | /* | 67 | /* |
68 | * Device ID Register F001h (R) | 68 | * Device ID Register F001h (R) |
69 | */ | 69 | */ |
70 | #define DEVICE_IS_FLEXONENAND (1 << 9) | ||
71 | #define FLEXONENAND_PI_MASK (0x3ff) | ||
72 | #define FLEXONENAND_PI_UNLOCK_SHIFT (14) | ||
70 | #define ONENAND_DEVICE_DENSITY_MASK (0xf) | 73 | #define ONENAND_DEVICE_DENSITY_MASK (0xf) |
71 | #define ONENAND_DEVICE_DENSITY_SHIFT (4) | 74 | #define ONENAND_DEVICE_DENSITY_SHIFT (4) |
72 | #define ONENAND_DEVICE_IS_DDP (1 << 3) | 75 | #define ONENAND_DEVICE_IS_DDP (1 << 3) |
@@ -84,6 +87,11 @@ | |||
84 | #define ONENAND_VERSION_PROCESS_SHIFT (8) | 87 | #define ONENAND_VERSION_PROCESS_SHIFT (8) |
85 | 88 | ||
86 | /* | 89 | /* |
90 | * Technology Register F006h (R) | ||
91 | */ | ||
92 | #define ONENAND_TECHNOLOGY_IS_MLC (1 << 0) | ||
93 | |||
94 | /* | ||
87 | * Start Address 1 F100h (R/W) & Start Address 2 F101h (R/W) | 95 | * Start Address 1 F100h (R/W) & Start Address 2 F101h (R/W) |
88 | */ | 96 | */ |
89 | #define ONENAND_DDP_SHIFT (15) | 97 | #define ONENAND_DDP_SHIFT (15) |
@@ -93,7 +101,8 @@ | |||
93 | /* | 101 | /* |
94 | * Start Address 8 F107h (R/W) | 102 | * Start Address 8 F107h (R/W) |
95 | */ | 103 | */ |
96 | #define ONENAND_FPA_MASK (0x3f) | 104 | /* Note: It's actually 0x3f in case of SLC */ |
105 | #define ONENAND_FPA_MASK (0x7f) | ||
97 | #define ONENAND_FPA_SHIFT (2) | 106 | #define ONENAND_FPA_SHIFT (2) |
98 | #define ONENAND_FSA_MASK (0x03) | 107 | #define ONENAND_FSA_MASK (0x03) |
99 | 108 | ||
@@ -105,7 +114,8 @@ | |||
105 | #define ONENAND_BSA_BOOTRAM (0 << 2) | 114 | #define ONENAND_BSA_BOOTRAM (0 << 2) |
106 | #define ONENAND_BSA_DATARAM0 (2 << 2) | 115 | #define ONENAND_BSA_DATARAM0 (2 << 2) |
107 | #define ONENAND_BSA_DATARAM1 (3 << 2) | 116 | #define ONENAND_BSA_DATARAM1 (3 << 2) |
108 | #define ONENAND_BSC_MASK (0x03) | 117 | /* Note: It's actually 0x03 in case of SLC */ |
118 | #define ONENAND_BSC_MASK (0x07) | ||
109 | 119 | ||
110 | /* | 120 | /* |
111 | * Command Register F220h (R/W) | 121 | * Command Register F220h (R/W) |
@@ -124,9 +134,13 @@ | |||
124 | #define ONENAND_CMD_RESET (0xF0) | 134 | #define ONENAND_CMD_RESET (0xF0) |
125 | #define ONENAND_CMD_OTP_ACCESS (0x65) | 135 | #define ONENAND_CMD_OTP_ACCESS (0x65) |
126 | #define ONENAND_CMD_READID (0x90) | 136 | #define ONENAND_CMD_READID (0x90) |
137 | #define FLEXONENAND_CMD_PI_UPDATE (0x05) | ||
138 | #define FLEXONENAND_CMD_PI_ACCESS (0x66) | ||
139 | #define FLEXONENAND_CMD_RECOVER_LSB (0x05) | ||
127 | 140 | ||
128 | /* NOTE: Those are not *REAL* commands */ | 141 | /* NOTE: Those are not *REAL* commands */ |
129 | #define ONENAND_CMD_BUFFERRAM (0x1978) | 142 | #define ONENAND_CMD_BUFFERRAM (0x1978) |
143 | #define FLEXONENAND_CMD_READ_PI (0x1985) | ||
130 | 144 | ||
131 | /* | 145 | /* |
132 | * System Configuration 1 Register F221h (R, R/W) | 146 | * System Configuration 1 Register F221h (R, R/W) |
@@ -192,10 +206,12 @@ | |||
192 | #define ONENAND_ECC_1BIT_ALL (0x5555) | 206 | #define ONENAND_ECC_1BIT_ALL (0x5555) |
193 | #define ONENAND_ECC_2BIT (1 << 1) | 207 | #define ONENAND_ECC_2BIT (1 << 1) |
194 | #define ONENAND_ECC_2BIT_ALL (0xAAAA) | 208 | #define ONENAND_ECC_2BIT_ALL (0xAAAA) |
209 | #define FLEXONENAND_UNCORRECTABLE_ERROR (0x1010) | ||
195 | 210 | ||
196 | /* | 211 | /* |
197 | * One-Time Programmable (OTP) | 212 | * One-Time Programmable (OTP) |
198 | */ | 213 | */ |
214 | #define FLEXONENAND_OTP_LOCK_OFFSET (2048) | ||
199 | #define ONENAND_OTP_LOCK_OFFSET (14) | 215 | #define ONENAND_OTP_LOCK_OFFSET (14) |
200 | 216 | ||
201 | #endif /* __ONENAND_REG_H */ | 217 | #endif /* __ONENAND_REG_H */ |
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h index 7535a74083b9..b70313d33ff8 100644 --- a/include/linux/mtd/partitions.h +++ b/include/linux/mtd/partitions.h | |||
@@ -40,7 +40,6 @@ struct mtd_partition { | |||
40 | uint64_t offset; /* offset within the master MTD space */ | 40 | uint64_t offset; /* offset within the master MTD space */ |
41 | uint32_t mask_flags; /* master MTD flags to mask out for this partition */ | 41 | uint32_t mask_flags; /* master MTD flags to mask out for this partition */ |
42 | struct nand_ecclayout *ecclayout; /* out of band layout for this partition (NAND only)*/ | 42 | struct nand_ecclayout *ecclayout; /* out of band layout for this partition (NAND only)*/ |
43 | struct mtd_info **mtdp; /* pointer to store the MTD object */ | ||
44 | }; | 43 | }; |
45 | 44 | ||
46 | #define MTDPART_OFS_NXTBLK (-2) | 45 | #define MTDPART_OFS_NXTBLK (-2) |
@@ -48,6 +47,8 @@ struct mtd_partition { | |||
48 | #define MTDPART_SIZ_FULL (0) | 47 | #define MTDPART_SIZ_FULL (0) |
49 | 48 | ||
50 | 49 | ||
50 | struct mtd_info; | ||
51 | |||
51 | int add_mtd_partitions(struct mtd_info *, const struct mtd_partition *, int); | 52 | int add_mtd_partitions(struct mtd_info *, const struct mtd_partition *, int); |
52 | int del_mtd_partitions(struct mtd_info *); | 53 | int del_mtd_partitions(struct mtd_info *); |
53 | 54 | ||
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 9ea8d6dfe540..d4a4d9867794 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -224,6 +224,11 @@ struct netdev_hw_addr { | |||
224 | struct rcu_head rcu_head; | 224 | struct rcu_head rcu_head; |
225 | }; | 225 | }; |
226 | 226 | ||
227 | struct netdev_hw_addr_list { | ||
228 | struct list_head list; | ||
229 | int count; | ||
230 | }; | ||
231 | |||
227 | struct hh_cache | 232 | struct hh_cache |
228 | { | 233 | { |
229 | struct hh_cache *hh_next; /* Next entry */ | 234 | struct hh_cache *hh_next; /* Next entry */ |
@@ -776,9 +781,8 @@ struct net_device | |||
776 | unsigned char addr_len; /* hardware address length */ | 781 | unsigned char addr_len; /* hardware address length */ |
777 | unsigned short dev_id; /* for shared network cards */ | 782 | unsigned short dev_id; /* for shared network cards */ |
778 | 783 | ||
779 | struct list_head uc_list; /* Secondary unicast mac | 784 | struct netdev_hw_addr_list uc; /* Secondary unicast |
780 | addresses */ | 785 | mac addresses */ |
781 | int uc_count; /* Number of installed ucasts */ | ||
782 | int uc_promisc; | 786 | int uc_promisc; |
783 | spinlock_t addr_list_lock; | 787 | spinlock_t addr_list_lock; |
784 | struct dev_addr_list *mc_list; /* Multicast mac addresses */ | 788 | struct dev_addr_list *mc_list; /* Multicast mac addresses */ |
@@ -810,7 +814,8 @@ struct net_device | |||
810 | because most packets are | 814 | because most packets are |
811 | unicast) */ | 815 | unicast) */ |
812 | 816 | ||
813 | struct list_head dev_addr_list; /* list of device hw addresses */ | 817 | struct netdev_hw_addr_list dev_addrs; /* list of device |
818 | hw addresses */ | ||
814 | 819 | ||
815 | unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */ | 820 | unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */ |
816 | 821 | ||
@@ -1806,11 +1811,11 @@ static inline void netif_addr_unlock_bh(struct net_device *dev) | |||
1806 | } | 1811 | } |
1807 | 1812 | ||
1808 | /* | 1813 | /* |
1809 | * dev_addr_list walker. Should be used only for read access. Call with | 1814 | * dev_addrs walker. Should be used only for read access. Call with |
1810 | * rcu_read_lock held. | 1815 | * rcu_read_lock held. |
1811 | */ | 1816 | */ |
1812 | #define for_each_dev_addr(dev, ha) \ | 1817 | #define for_each_dev_addr(dev, ha) \ |
1813 | list_for_each_entry_rcu(ha, &dev->dev_addr_list, list) | 1818 | list_for_each_entry_rcu(ha, &dev->dev_addrs.list, list) |
1814 | 1819 | ||
1815 | /* These functions live elsewhere (drivers/net/net_init.c, but related) */ | 1820 | /* These functions live elsewhere (drivers/net/net_init.c, but related) */ |
1816 | 1821 | ||
diff --git a/include/linux/netfilter/xt_conntrack.h b/include/linux/netfilter/xt_conntrack.h index 3430c7751948..7ae05338e94c 100644 --- a/include/linux/netfilter/xt_conntrack.h +++ b/include/linux/netfilter/xt_conntrack.h | |||
@@ -81,4 +81,17 @@ struct xt_conntrack_mtinfo1 { | |||
81 | __u8 state_mask, status_mask; | 81 | __u8 state_mask, status_mask; |
82 | }; | 82 | }; |
83 | 83 | ||
84 | struct xt_conntrack_mtinfo2 { | ||
85 | union nf_inet_addr origsrc_addr, origsrc_mask; | ||
86 | union nf_inet_addr origdst_addr, origdst_mask; | ||
87 | union nf_inet_addr replsrc_addr, replsrc_mask; | ||
88 | union nf_inet_addr repldst_addr, repldst_mask; | ||
89 | __u32 expires_min, expires_max; | ||
90 | __u16 l4proto; | ||
91 | __be16 origsrc_port, origdst_port; | ||
92 | __be16 replsrc_port, repldst_port; | ||
93 | __u16 match_flags, invert_flags; | ||
94 | __u16 state_mask, status_mask; | ||
95 | }; | ||
96 | |||
84 | #endif /*_XT_CONNTRACK_H*/ | 97 | #endif /*_XT_CONNTRACK_H*/ |
diff --git a/include/linux/netfilter/xt_osf.h b/include/linux/netfilter/xt_osf.h index fd2272e0959a..18afa495f973 100644 --- a/include/linux/netfilter/xt_osf.h +++ b/include/linux/netfilter/xt_osf.h | |||
@@ -20,6 +20,8 @@ | |||
20 | #ifndef _XT_OSF_H | 20 | #ifndef _XT_OSF_H |
21 | #define _XT_OSF_H | 21 | #define _XT_OSF_H |
22 | 22 | ||
23 | #include <linux/types.h> | ||
24 | |||
23 | #define MAXGENRELEN 32 | 25 | #define MAXGENRELEN 32 |
24 | 26 | ||
25 | #define XT_OSF_GENRE (1<<0) | 27 | #define XT_OSF_GENRE (1<<0) |
diff --git a/include/linux/nfs.h b/include/linux/nfs.h index 214d499718f7..f387919bbc59 100644 --- a/include/linux/nfs.h +++ b/include/linux/nfs.h | |||
@@ -25,8 +25,9 @@ | |||
25 | #define NFSMODE_SOCK 0140000 | 25 | #define NFSMODE_SOCK 0140000 |
26 | #define NFSMODE_FIFO 0010000 | 26 | #define NFSMODE_FIFO 0010000 |
27 | 27 | ||
28 | #define NFS_MNT_PROGRAM 100005 | 28 | #define NFS_MNT_PROGRAM 100005 |
29 | #define NFS_MNT_PORT 627 | 29 | #define NFS_MNT_VERSION 1 |
30 | #define NFS_MNT3_VERSION 3 | ||
30 | 31 | ||
31 | /* | 32 | /* |
32 | * NFS stats. The good thing with these values is that NFSv3 errors are | 33 | * NFS stats. The good thing with these values is that NFSv3 errors are |
diff --git a/include/linux/nfs2.h b/include/linux/nfs2.h index 0ed9517138fc..fde24b30cc9e 100644 --- a/include/linux/nfs2.h +++ b/include/linux/nfs2.h | |||
@@ -64,11 +64,4 @@ struct nfs2_fh { | |||
64 | #define NFSPROC_READDIR 16 | 64 | #define NFSPROC_READDIR 16 |
65 | #define NFSPROC_STATFS 17 | 65 | #define NFSPROC_STATFS 17 |
66 | 66 | ||
67 | #define NFS_MNT_PROGRAM 100005 | ||
68 | #define NFS_MNT_VERSION 1 | ||
69 | #define MNTPROC_NULL 0 | ||
70 | #define MNTPROC_MNT 1 | ||
71 | #define MNTPROC_UMNT 3 | ||
72 | #define MNTPROC_UMNTALL 4 | ||
73 | |||
74 | #endif /* _LINUX_NFS2_H */ | 67 | #endif /* _LINUX_NFS2_H */ |
diff --git a/include/linux/nfs3.h b/include/linux/nfs3.h index 539f3b550eab..ac33806ec7f9 100644 --- a/include/linux/nfs3.h +++ b/include/linux/nfs3.h | |||
@@ -88,12 +88,7 @@ struct nfs3_fh { | |||
88 | #define NFS3PROC_PATHCONF 20 | 88 | #define NFS3PROC_PATHCONF 20 |
89 | #define NFS3PROC_COMMIT 21 | 89 | #define NFS3PROC_COMMIT 21 |
90 | 90 | ||
91 | #define NFS_MNT3_PROGRAM 100005 | ||
92 | #define NFS_MNT3_VERSION 3 | 91 | #define NFS_MNT3_VERSION 3 |
93 | #define MOUNTPROC3_NULL 0 | ||
94 | #define MOUNTPROC3_MNT 1 | ||
95 | #define MOUNTPROC3_UMNT 3 | ||
96 | #define MOUNTPROC3_UMNTALL 4 | ||
97 | 92 | ||
98 | 93 | ||
99 | #if defined(__KERNEL__) | 94 | #if defined(__KERNEL__) |
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index e3f0cbcbd0db..bd2eba530667 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #define NFS4_FHSIZE 128 | 21 | #define NFS4_FHSIZE 128 |
22 | #define NFS4_MAXPATHLEN PATH_MAX | 22 | #define NFS4_MAXPATHLEN PATH_MAX |
23 | #define NFS4_MAXNAMLEN NAME_MAX | 23 | #define NFS4_MAXNAMLEN NAME_MAX |
24 | #define NFS4_OPAQUE_LIMIT 1024 | ||
24 | #define NFS4_MAX_SESSIONID_LEN 16 | 25 | #define NFS4_MAX_SESSIONID_LEN 16 |
25 | 26 | ||
26 | #define NFS4_ACCESS_READ 0x0001 | 27 | #define NFS4_ACCESS_READ 0x0001 |
@@ -130,6 +131,16 @@ | |||
130 | 131 | ||
131 | #define NFS4_MAX_UINT64 (~(u64)0) | 132 | #define NFS4_MAX_UINT64 (~(u64)0) |
132 | 133 | ||
134 | /* An NFS4 sessions server must support at least NFS4_MAX_OPS operations. | ||
135 | * If a compound requires more operations, adjust NFS4_MAX_OPS accordingly. | ||
136 | */ | ||
137 | #define NFS4_MAX_OPS 8 | ||
138 | |||
139 | /* Our NFS4 client back channel server only wants the cb_sequene and the | ||
140 | * actual operation per compound | ||
141 | */ | ||
142 | #define NFS4_MAX_BACK_CHANNEL_OPS 2 | ||
143 | |||
133 | enum nfs4_acl_whotype { | 144 | enum nfs4_acl_whotype { |
134 | NFS4_ACL_WHO_NAMED = 0, | 145 | NFS4_ACL_WHO_NAMED = 0, |
135 | NFS4_ACL_WHO_OWNER, | 146 | NFS4_ACL_WHO_OWNER, |
@@ -462,6 +473,13 @@ enum lock_type4 { | |||
462 | #define NFSPROC4_NULL 0 | 473 | #define NFSPROC4_NULL 0 |
463 | #define NFSPROC4_COMPOUND 1 | 474 | #define NFSPROC4_COMPOUND 1 |
464 | #define NFS4_MINOR_VERSION 0 | 475 | #define NFS4_MINOR_VERSION 0 |
476 | |||
477 | #if defined(CONFIG_NFS_V4_1) | ||
478 | #define NFS4_MAX_MINOR_VERSION 1 | ||
479 | #else | ||
480 | #define NFS4_MAX_MINOR_VERSION 0 | ||
481 | #endif /* CONFIG_NFS_V4_1 */ | ||
482 | |||
465 | #define NFS4_DEBUG 1 | 483 | #define NFS4_DEBUG 1 |
466 | 484 | ||
467 | /* Index of predefined Linux client operations */ | 485 | /* Index of predefined Linux client operations */ |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index fdffb413b192..f6b90240dd41 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -473,7 +473,6 @@ extern int nfs_writepages(struct address_space *, struct writeback_control *); | |||
473 | extern int nfs_flush_incompatible(struct file *file, struct page *page); | 473 | extern int nfs_flush_incompatible(struct file *file, struct page *page); |
474 | extern int nfs_updatepage(struct file *, struct page *, unsigned int, unsigned int); | 474 | extern int nfs_updatepage(struct file *, struct page *, unsigned int, unsigned int); |
475 | extern int nfs_writeback_done(struct rpc_task *, struct nfs_write_data *); | 475 | extern int nfs_writeback_done(struct rpc_task *, struct nfs_write_data *); |
476 | extern void nfs_writedata_release(void *); | ||
477 | 476 | ||
478 | /* | 477 | /* |
479 | * Try to write back everything synchronously (but check the | 478 | * Try to write back everything synchronously (but check the |
@@ -488,7 +487,6 @@ extern int nfs_wb_page_cancel(struct inode *inode, struct page* page); | |||
488 | extern int nfs_commit_inode(struct inode *, int); | 487 | extern int nfs_commit_inode(struct inode *, int); |
489 | extern struct nfs_write_data *nfs_commitdata_alloc(void); | 488 | extern struct nfs_write_data *nfs_commitdata_alloc(void); |
490 | extern void nfs_commit_free(struct nfs_write_data *wdata); | 489 | extern void nfs_commit_free(struct nfs_write_data *wdata); |
491 | extern void nfs_commitdata_release(void *wdata); | ||
492 | #else | 490 | #else |
493 | static inline int | 491 | static inline int |
494 | nfs_commit_inode(struct inode *inode, int how) | 492 | nfs_commit_inode(struct inode *inode, int how) |
@@ -507,6 +505,7 @@ nfs_have_writebacks(struct inode *inode) | |||
507 | * Allocate nfs_write_data structures | 505 | * Allocate nfs_write_data structures |
508 | */ | 506 | */ |
509 | extern struct nfs_write_data *nfs_writedata_alloc(unsigned int npages); | 507 | extern struct nfs_write_data *nfs_writedata_alloc(unsigned int npages); |
508 | extern void nfs_writedata_free(struct nfs_write_data *); | ||
510 | 509 | ||
511 | /* | 510 | /* |
512 | * linux/fs/nfs/read.c | 511 | * linux/fs/nfs/read.c |
@@ -515,7 +514,6 @@ extern int nfs_readpage(struct file *, struct page *); | |||
515 | extern int nfs_readpages(struct file *, struct address_space *, | 514 | extern int nfs_readpages(struct file *, struct address_space *, |
516 | struct list_head *, unsigned); | 515 | struct list_head *, unsigned); |
517 | extern int nfs_readpage_result(struct rpc_task *, struct nfs_read_data *); | 516 | extern int nfs_readpage_result(struct rpc_task *, struct nfs_read_data *); |
518 | extern void nfs_readdata_release(void *data); | ||
519 | extern int nfs_readpage_async(struct nfs_open_context *, struct inode *, | 517 | extern int nfs_readpage_async(struct nfs_open_context *, struct inode *, |
520 | struct page *); | 518 | struct page *); |
521 | 519 | ||
@@ -523,6 +521,7 @@ extern int nfs_readpage_async(struct nfs_open_context *, struct inode *, | |||
523 | * Allocate nfs_read_data structures | 521 | * Allocate nfs_read_data structures |
524 | */ | 522 | */ |
525 | extern struct nfs_read_data *nfs_readdata_alloc(unsigned int npages); | 523 | extern struct nfs_read_data *nfs_readdata_alloc(unsigned int npages); |
524 | extern void nfs_readdata_free(struct nfs_read_data *); | ||
526 | 525 | ||
527 | /* | 526 | /* |
528 | * linux/fs/nfs3proc.c | 527 | * linux/fs/nfs3proc.c |
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index 6ad75948cbf7..19fe15d12042 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h | |||
@@ -4,11 +4,17 @@ | |||
4 | #include <linux/list.h> | 4 | #include <linux/list.h> |
5 | #include <linux/backing-dev.h> | 5 | #include <linux/backing-dev.h> |
6 | #include <linux/wait.h> | 6 | #include <linux/wait.h> |
7 | #include <linux/nfs_xdr.h> | ||
8 | #include <linux/sunrpc/xprt.h> | ||
7 | 9 | ||
8 | #include <asm/atomic.h> | 10 | #include <asm/atomic.h> |
9 | 11 | ||
12 | struct nfs4_session; | ||
10 | struct nfs_iostats; | 13 | struct nfs_iostats; |
11 | struct nlm_host; | 14 | struct nlm_host; |
15 | struct nfs4_sequence_args; | ||
16 | struct nfs4_sequence_res; | ||
17 | struct nfs_server; | ||
12 | 18 | ||
13 | /* | 19 | /* |
14 | * The nfs_client identifies our client state to the server. | 20 | * The nfs_client identifies our client state to the server. |
@@ -18,6 +24,7 @@ struct nfs_client { | |||
18 | int cl_cons_state; /* current construction state (-ve: init error) */ | 24 | int cl_cons_state; /* current construction state (-ve: init error) */ |
19 | #define NFS_CS_READY 0 /* ready to be used */ | 25 | #define NFS_CS_READY 0 /* ready to be used */ |
20 | #define NFS_CS_INITING 1 /* busy initialising */ | 26 | #define NFS_CS_INITING 1 /* busy initialising */ |
27 | #define NFS_CS_SESSION_INITING 2 /* busy initialising session */ | ||
21 | unsigned long cl_res_state; /* NFS resources state */ | 28 | unsigned long cl_res_state; /* NFS resources state */ |
22 | #define NFS_CS_CALLBACK 1 /* - callback started */ | 29 | #define NFS_CS_CALLBACK 1 /* - callback started */ |
23 | #define NFS_CS_IDMAP 2 /* - idmap started */ | 30 | #define NFS_CS_IDMAP 2 /* - idmap started */ |
@@ -32,6 +39,7 @@ struct nfs_client { | |||
32 | const struct nfs_rpc_ops *rpc_ops; /* NFS protocol vector */ | 39 | const struct nfs_rpc_ops *rpc_ops; /* NFS protocol vector */ |
33 | int cl_proto; /* Network transport protocol */ | 40 | int cl_proto; /* Network transport protocol */ |
34 | 41 | ||
42 | u32 cl_minorversion;/* NFSv4 minorversion */ | ||
35 | struct rpc_cred *cl_machine_cred; | 43 | struct rpc_cred *cl_machine_cred; |
36 | 44 | ||
37 | #ifdef CONFIG_NFS_V4 | 45 | #ifdef CONFIG_NFS_V4 |
@@ -63,7 +71,22 @@ struct nfs_client { | |||
63 | */ | 71 | */ |
64 | char cl_ipaddr[48]; | 72 | char cl_ipaddr[48]; |
65 | unsigned char cl_id_uniquifier; | 73 | unsigned char cl_id_uniquifier; |
66 | #endif | 74 | int (* cl_call_sync)(struct nfs_server *server, |
75 | struct rpc_message *msg, | ||
76 | struct nfs4_sequence_args *args, | ||
77 | struct nfs4_sequence_res *res, | ||
78 | int cache_reply); | ||
79 | #endif /* CONFIG_NFS_V4 */ | ||
80 | |||
81 | #ifdef CONFIG_NFS_V4_1 | ||
82 | /* clientid returned from EXCHANGE_ID, used by session operations */ | ||
83 | u64 cl_ex_clid; | ||
84 | /* The sequence id to use for the next CREATE_SESSION */ | ||
85 | u32 cl_seqid; | ||
86 | /* The flags used for obtaining the clientid during EXCHANGE_ID */ | ||
87 | u32 cl_exchange_flags; | ||
88 | struct nfs4_session *cl_session; /* sharred session */ | ||
89 | #endif /* CONFIG_NFS_V4_1 */ | ||
67 | 90 | ||
68 | #ifdef CONFIG_NFS_FSCACHE | 91 | #ifdef CONFIG_NFS_FSCACHE |
69 | struct fscache_cookie *fscache; /* client index cache cookie */ | 92 | struct fscache_cookie *fscache; /* client index cache cookie */ |
@@ -145,4 +168,46 @@ struct nfs_server { | |||
145 | #define NFS_CAP_ACLS (1U << 3) | 168 | #define NFS_CAP_ACLS (1U << 3) |
146 | #define NFS_CAP_ATOMIC_OPEN (1U << 4) | 169 | #define NFS_CAP_ATOMIC_OPEN (1U << 4) |
147 | 170 | ||
171 | |||
172 | /* maximum number of slots to use */ | ||
173 | #define NFS4_MAX_SLOT_TABLE RPC_MAX_SLOT_TABLE | ||
174 | |||
175 | #if defined(CONFIG_NFS_V4_1) | ||
176 | |||
177 | /* Sessions */ | ||
178 | #define SLOT_TABLE_SZ (NFS4_MAX_SLOT_TABLE/(8*sizeof(long))) | ||
179 | struct nfs4_slot_table { | ||
180 | struct nfs4_slot *slots; /* seqid per slot */ | ||
181 | unsigned long used_slots[SLOT_TABLE_SZ]; /* used/unused bitmap */ | ||
182 | spinlock_t slot_tbl_lock; | ||
183 | struct rpc_wait_queue slot_tbl_waitq; /* allocators may wait here */ | ||
184 | int max_slots; /* # slots in table */ | ||
185 | int highest_used_slotid; /* sent to server on each SEQ. | ||
186 | * op for dynamic resizing */ | ||
187 | }; | ||
188 | |||
189 | static inline int slot_idx(struct nfs4_slot_table *tbl, struct nfs4_slot *sp) | ||
190 | { | ||
191 | return sp - tbl->slots; | ||
192 | } | ||
193 | |||
194 | /* | ||
195 | * Session related parameters | ||
196 | */ | ||
197 | struct nfs4_session { | ||
198 | struct nfs4_sessionid sess_id; | ||
199 | u32 flags; | ||
200 | unsigned long session_state; | ||
201 | u32 hash_alg; | ||
202 | u32 ssv_len; | ||
203 | |||
204 | /* The fore and back channel */ | ||
205 | struct nfs4_channel_attrs fc_attrs; | ||
206 | struct nfs4_slot_table fc_slot_table; | ||
207 | struct nfs4_channel_attrs bc_attrs; | ||
208 | struct nfs4_slot_table bc_slot_table; | ||
209 | struct nfs_client *clp; | ||
210 | }; | ||
211 | |||
212 | #endif /* CONFIG_NFS_V4_1 */ | ||
148 | #endif | 213 | #endif |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index b89c34e40bc2..62f63fb0c4c8 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
@@ -145,6 +145,44 @@ struct nfs4_change_info { | |||
145 | }; | 145 | }; |
146 | 146 | ||
147 | struct nfs_seqid; | 147 | struct nfs_seqid; |
148 | |||
149 | /* nfs41 sessions channel attributes */ | ||
150 | struct nfs4_channel_attrs { | ||
151 | u32 headerpadsz; | ||
152 | u32 max_rqst_sz; | ||
153 | u32 max_resp_sz; | ||
154 | u32 max_resp_sz_cached; | ||
155 | u32 max_ops; | ||
156 | u32 max_reqs; | ||
157 | }; | ||
158 | |||
159 | /* nfs41 sessions slot seqid */ | ||
160 | struct nfs4_slot { | ||
161 | u32 seq_nr; | ||
162 | }; | ||
163 | |||
164 | struct nfs4_sequence_args { | ||
165 | struct nfs4_session *sa_session; | ||
166 | u8 sa_slotid; | ||
167 | u8 sa_cache_this; | ||
168 | }; | ||
169 | |||
170 | struct nfs4_sequence_res { | ||
171 | struct nfs4_session *sr_session; | ||
172 | u8 sr_slotid; /* slot used to send request */ | ||
173 | unsigned long sr_renewal_time; | ||
174 | int sr_status; /* sequence operation status */ | ||
175 | }; | ||
176 | |||
177 | struct nfs4_get_lease_time_args { | ||
178 | struct nfs4_sequence_args la_seq_args; | ||
179 | }; | ||
180 | |||
181 | struct nfs4_get_lease_time_res { | ||
182 | struct nfs_fsinfo *lr_fsinfo; | ||
183 | struct nfs4_sequence_res lr_seq_res; | ||
184 | }; | ||
185 | |||
148 | /* | 186 | /* |
149 | * Arguments to the open call. | 187 | * Arguments to the open call. |
150 | */ | 188 | */ |
@@ -165,6 +203,7 @@ struct nfs_openargs { | |||
165 | const struct nfs_server *server; /* Needed for ID mapping */ | 203 | const struct nfs_server *server; /* Needed for ID mapping */ |
166 | const u32 * bitmask; | 204 | const u32 * bitmask; |
167 | __u32 claim; | 205 | __u32 claim; |
206 | struct nfs4_sequence_args seq_args; | ||
168 | }; | 207 | }; |
169 | 208 | ||
170 | struct nfs_openres { | 209 | struct nfs_openres { |
@@ -181,6 +220,7 @@ struct nfs_openres { | |||
181 | __u32 do_recall; | 220 | __u32 do_recall; |
182 | __u64 maxsize; | 221 | __u64 maxsize; |
183 | __u32 attrset[NFS4_BITMAP_SIZE]; | 222 | __u32 attrset[NFS4_BITMAP_SIZE]; |
223 | struct nfs4_sequence_res seq_res; | ||
184 | }; | 224 | }; |
185 | 225 | ||
186 | /* | 226 | /* |
@@ -206,6 +246,7 @@ struct nfs_closeargs { | |||
206 | struct nfs_seqid * seqid; | 246 | struct nfs_seqid * seqid; |
207 | fmode_t fmode; | 247 | fmode_t fmode; |
208 | const u32 * bitmask; | 248 | const u32 * bitmask; |
249 | struct nfs4_sequence_args seq_args; | ||
209 | }; | 250 | }; |
210 | 251 | ||
211 | struct nfs_closeres { | 252 | struct nfs_closeres { |
@@ -213,6 +254,7 @@ struct nfs_closeres { | |||
213 | struct nfs_fattr * fattr; | 254 | struct nfs_fattr * fattr; |
214 | struct nfs_seqid * seqid; | 255 | struct nfs_seqid * seqid; |
215 | const struct nfs_server *server; | 256 | const struct nfs_server *server; |
257 | struct nfs4_sequence_res seq_res; | ||
216 | }; | 258 | }; |
217 | /* | 259 | /* |
218 | * * Arguments to the lock,lockt, and locku call. | 260 | * * Arguments to the lock,lockt, and locku call. |
@@ -233,12 +275,14 @@ struct nfs_lock_args { | |||
233 | unsigned char block : 1; | 275 | unsigned char block : 1; |
234 | unsigned char reclaim : 1; | 276 | unsigned char reclaim : 1; |
235 | unsigned char new_lock_owner : 1; | 277 | unsigned char new_lock_owner : 1; |
278 | struct nfs4_sequence_args seq_args; | ||
236 | }; | 279 | }; |
237 | 280 | ||
238 | struct nfs_lock_res { | 281 | struct nfs_lock_res { |
239 | nfs4_stateid stateid; | 282 | nfs4_stateid stateid; |
240 | struct nfs_seqid * lock_seqid; | 283 | struct nfs_seqid * lock_seqid; |
241 | struct nfs_seqid * open_seqid; | 284 | struct nfs_seqid * open_seqid; |
285 | struct nfs4_sequence_res seq_res; | ||
242 | }; | 286 | }; |
243 | 287 | ||
244 | struct nfs_locku_args { | 288 | struct nfs_locku_args { |
@@ -246,32 +290,38 @@ struct nfs_locku_args { | |||
246 | struct file_lock * fl; | 290 | struct file_lock * fl; |
247 | struct nfs_seqid * seqid; | 291 | struct nfs_seqid * seqid; |
248 | nfs4_stateid * stateid; | 292 | nfs4_stateid * stateid; |
293 | struct nfs4_sequence_args seq_args; | ||
249 | }; | 294 | }; |
250 | 295 | ||
251 | struct nfs_locku_res { | 296 | struct nfs_locku_res { |
252 | nfs4_stateid stateid; | 297 | nfs4_stateid stateid; |
253 | struct nfs_seqid * seqid; | 298 | struct nfs_seqid * seqid; |
299 | struct nfs4_sequence_res seq_res; | ||
254 | }; | 300 | }; |
255 | 301 | ||
256 | struct nfs_lockt_args { | 302 | struct nfs_lockt_args { |
257 | struct nfs_fh * fh; | 303 | struct nfs_fh * fh; |
258 | struct file_lock * fl; | 304 | struct file_lock * fl; |
259 | struct nfs_lowner lock_owner; | 305 | struct nfs_lowner lock_owner; |
306 | struct nfs4_sequence_args seq_args; | ||
260 | }; | 307 | }; |
261 | 308 | ||
262 | struct nfs_lockt_res { | 309 | struct nfs_lockt_res { |
263 | struct file_lock * denied; /* LOCK, LOCKT failed */ | 310 | struct file_lock * denied; /* LOCK, LOCKT failed */ |
311 | struct nfs4_sequence_res seq_res; | ||
264 | }; | 312 | }; |
265 | 313 | ||
266 | struct nfs4_delegreturnargs { | 314 | struct nfs4_delegreturnargs { |
267 | const struct nfs_fh *fhandle; | 315 | const struct nfs_fh *fhandle; |
268 | const nfs4_stateid *stateid; | 316 | const nfs4_stateid *stateid; |
269 | const u32 * bitmask; | 317 | const u32 * bitmask; |
318 | struct nfs4_sequence_args seq_args; | ||
270 | }; | 319 | }; |
271 | 320 | ||
272 | struct nfs4_delegreturnres { | 321 | struct nfs4_delegreturnres { |
273 | struct nfs_fattr * fattr; | 322 | struct nfs_fattr * fattr; |
274 | const struct nfs_server *server; | 323 | const struct nfs_server *server; |
324 | struct nfs4_sequence_res seq_res; | ||
275 | }; | 325 | }; |
276 | 326 | ||
277 | /* | 327 | /* |
@@ -284,12 +334,14 @@ struct nfs_readargs { | |||
284 | __u32 count; | 334 | __u32 count; |
285 | unsigned int pgbase; | 335 | unsigned int pgbase; |
286 | struct page ** pages; | 336 | struct page ** pages; |
337 | struct nfs4_sequence_args seq_args; | ||
287 | }; | 338 | }; |
288 | 339 | ||
289 | struct nfs_readres { | 340 | struct nfs_readres { |
290 | struct nfs_fattr * fattr; | 341 | struct nfs_fattr * fattr; |
291 | __u32 count; | 342 | __u32 count; |
292 | int eof; | 343 | int eof; |
344 | struct nfs4_sequence_res seq_res; | ||
293 | }; | 345 | }; |
294 | 346 | ||
295 | /* | 347 | /* |
@@ -304,6 +356,7 @@ struct nfs_writeargs { | |||
304 | unsigned int pgbase; | 356 | unsigned int pgbase; |
305 | struct page ** pages; | 357 | struct page ** pages; |
306 | const u32 * bitmask; | 358 | const u32 * bitmask; |
359 | struct nfs4_sequence_args seq_args; | ||
307 | }; | 360 | }; |
308 | 361 | ||
309 | struct nfs_writeverf { | 362 | struct nfs_writeverf { |
@@ -316,6 +369,7 @@ struct nfs_writeres { | |||
316 | struct nfs_writeverf * verf; | 369 | struct nfs_writeverf * verf; |
317 | __u32 count; | 370 | __u32 count; |
318 | const struct nfs_server *server; | 371 | const struct nfs_server *server; |
372 | struct nfs4_sequence_res seq_res; | ||
319 | }; | 373 | }; |
320 | 374 | ||
321 | /* | 375 | /* |
@@ -325,12 +379,14 @@ struct nfs_removeargs { | |||
325 | const struct nfs_fh *fh; | 379 | const struct nfs_fh *fh; |
326 | struct qstr name; | 380 | struct qstr name; |
327 | const u32 * bitmask; | 381 | const u32 * bitmask; |
382 | struct nfs4_sequence_args seq_args; | ||
328 | }; | 383 | }; |
329 | 384 | ||
330 | struct nfs_removeres { | 385 | struct nfs_removeres { |
331 | const struct nfs_server *server; | 386 | const struct nfs_server *server; |
332 | struct nfs4_change_info cinfo; | 387 | struct nfs4_change_info cinfo; |
333 | struct nfs_fattr dir_attr; | 388 | struct nfs_fattr dir_attr; |
389 | struct nfs4_sequence_res seq_res; | ||
334 | }; | 390 | }; |
335 | 391 | ||
336 | /* | 392 | /* |
@@ -383,6 +439,7 @@ struct nfs_setattrargs { | |||
383 | struct iattr * iap; | 439 | struct iattr * iap; |
384 | const struct nfs_server * server; /* Needed for name mapping */ | 440 | const struct nfs_server * server; /* Needed for name mapping */ |
385 | const u32 * bitmask; | 441 | const u32 * bitmask; |
442 | struct nfs4_sequence_args seq_args; | ||
386 | }; | 443 | }; |
387 | 444 | ||
388 | struct nfs_setaclargs { | 445 | struct nfs_setaclargs { |
@@ -390,6 +447,11 @@ struct nfs_setaclargs { | |||
390 | size_t acl_len; | 447 | size_t acl_len; |
391 | unsigned int acl_pgbase; | 448 | unsigned int acl_pgbase; |
392 | struct page ** acl_pages; | 449 | struct page ** acl_pages; |
450 | struct nfs4_sequence_args seq_args; | ||
451 | }; | ||
452 | |||
453 | struct nfs_setaclres { | ||
454 | struct nfs4_sequence_res seq_res; | ||
393 | }; | 455 | }; |
394 | 456 | ||
395 | struct nfs_getaclargs { | 457 | struct nfs_getaclargs { |
@@ -397,11 +459,18 @@ struct nfs_getaclargs { | |||
397 | size_t acl_len; | 459 | size_t acl_len; |
398 | unsigned int acl_pgbase; | 460 | unsigned int acl_pgbase; |
399 | struct page ** acl_pages; | 461 | struct page ** acl_pages; |
462 | struct nfs4_sequence_args seq_args; | ||
463 | }; | ||
464 | |||
465 | struct nfs_getaclres { | ||
466 | size_t acl_len; | ||
467 | struct nfs4_sequence_res seq_res; | ||
400 | }; | 468 | }; |
401 | 469 | ||
402 | struct nfs_setattrres { | 470 | struct nfs_setattrres { |
403 | struct nfs_fattr * fattr; | 471 | struct nfs_fattr * fattr; |
404 | const struct nfs_server * server; | 472 | const struct nfs_server * server; |
473 | struct nfs4_sequence_res seq_res; | ||
405 | }; | 474 | }; |
406 | 475 | ||
407 | struct nfs_linkargs { | 476 | struct nfs_linkargs { |
@@ -583,6 +652,7 @@ struct nfs4_accessargs { | |||
583 | const struct nfs_fh * fh; | 652 | const struct nfs_fh * fh; |
584 | const u32 * bitmask; | 653 | const u32 * bitmask; |
585 | u32 access; | 654 | u32 access; |
655 | struct nfs4_sequence_args seq_args; | ||
586 | }; | 656 | }; |
587 | 657 | ||
588 | struct nfs4_accessres { | 658 | struct nfs4_accessres { |
@@ -590,6 +660,7 @@ struct nfs4_accessres { | |||
590 | struct nfs_fattr * fattr; | 660 | struct nfs_fattr * fattr; |
591 | u32 supported; | 661 | u32 supported; |
592 | u32 access; | 662 | u32 access; |
663 | struct nfs4_sequence_res seq_res; | ||
593 | }; | 664 | }; |
594 | 665 | ||
595 | struct nfs4_create_arg { | 666 | struct nfs4_create_arg { |
@@ -609,6 +680,7 @@ struct nfs4_create_arg { | |||
609 | const struct iattr * attrs; | 680 | const struct iattr * attrs; |
610 | const struct nfs_fh * dir_fh; | 681 | const struct nfs_fh * dir_fh; |
611 | const u32 * bitmask; | 682 | const u32 * bitmask; |
683 | struct nfs4_sequence_args seq_args; | ||
612 | }; | 684 | }; |
613 | 685 | ||
614 | struct nfs4_create_res { | 686 | struct nfs4_create_res { |
@@ -617,21 +689,30 @@ struct nfs4_create_res { | |||
617 | struct nfs_fattr * fattr; | 689 | struct nfs_fattr * fattr; |
618 | struct nfs4_change_info dir_cinfo; | 690 | struct nfs4_change_info dir_cinfo; |
619 | struct nfs_fattr * dir_fattr; | 691 | struct nfs_fattr * dir_fattr; |
692 | struct nfs4_sequence_res seq_res; | ||
620 | }; | 693 | }; |
621 | 694 | ||
622 | struct nfs4_fsinfo_arg { | 695 | struct nfs4_fsinfo_arg { |
623 | const struct nfs_fh * fh; | 696 | const struct nfs_fh * fh; |
624 | const u32 * bitmask; | 697 | const u32 * bitmask; |
698 | struct nfs4_sequence_args seq_args; | ||
699 | }; | ||
700 | |||
701 | struct nfs4_fsinfo_res { | ||
702 | struct nfs_fsinfo *fsinfo; | ||
703 | struct nfs4_sequence_res seq_res; | ||
625 | }; | 704 | }; |
626 | 705 | ||
627 | struct nfs4_getattr_arg { | 706 | struct nfs4_getattr_arg { |
628 | const struct nfs_fh * fh; | 707 | const struct nfs_fh * fh; |
629 | const u32 * bitmask; | 708 | const u32 * bitmask; |
709 | struct nfs4_sequence_args seq_args; | ||
630 | }; | 710 | }; |
631 | 711 | ||
632 | struct nfs4_getattr_res { | 712 | struct nfs4_getattr_res { |
633 | const struct nfs_server * server; | 713 | const struct nfs_server * server; |
634 | struct nfs_fattr * fattr; | 714 | struct nfs_fattr * fattr; |
715 | struct nfs4_sequence_res seq_res; | ||
635 | }; | 716 | }; |
636 | 717 | ||
637 | struct nfs4_link_arg { | 718 | struct nfs4_link_arg { |
@@ -639,6 +720,7 @@ struct nfs4_link_arg { | |||
639 | const struct nfs_fh * dir_fh; | 720 | const struct nfs_fh * dir_fh; |
640 | const struct qstr * name; | 721 | const struct qstr * name; |
641 | const u32 * bitmask; | 722 | const u32 * bitmask; |
723 | struct nfs4_sequence_args seq_args; | ||
642 | }; | 724 | }; |
643 | 725 | ||
644 | struct nfs4_link_res { | 726 | struct nfs4_link_res { |
@@ -646,6 +728,7 @@ struct nfs4_link_res { | |||
646 | struct nfs_fattr * fattr; | 728 | struct nfs_fattr * fattr; |
647 | struct nfs4_change_info cinfo; | 729 | struct nfs4_change_info cinfo; |
648 | struct nfs_fattr * dir_attr; | 730 | struct nfs_fattr * dir_attr; |
731 | struct nfs4_sequence_res seq_res; | ||
649 | }; | 732 | }; |
650 | 733 | ||
651 | 734 | ||
@@ -653,21 +736,30 @@ struct nfs4_lookup_arg { | |||
653 | const struct nfs_fh * dir_fh; | 736 | const struct nfs_fh * dir_fh; |
654 | const struct qstr * name; | 737 | const struct qstr * name; |
655 | const u32 * bitmask; | 738 | const u32 * bitmask; |
739 | struct nfs4_sequence_args seq_args; | ||
656 | }; | 740 | }; |
657 | 741 | ||
658 | struct nfs4_lookup_res { | 742 | struct nfs4_lookup_res { |
659 | const struct nfs_server * server; | 743 | const struct nfs_server * server; |
660 | struct nfs_fattr * fattr; | 744 | struct nfs_fattr * fattr; |
661 | struct nfs_fh * fh; | 745 | struct nfs_fh * fh; |
746 | struct nfs4_sequence_res seq_res; | ||
662 | }; | 747 | }; |
663 | 748 | ||
664 | struct nfs4_lookup_root_arg { | 749 | struct nfs4_lookup_root_arg { |
665 | const u32 * bitmask; | 750 | const u32 * bitmask; |
751 | struct nfs4_sequence_args seq_args; | ||
666 | }; | 752 | }; |
667 | 753 | ||
668 | struct nfs4_pathconf_arg { | 754 | struct nfs4_pathconf_arg { |
669 | const struct nfs_fh * fh; | 755 | const struct nfs_fh * fh; |
670 | const u32 * bitmask; | 756 | const u32 * bitmask; |
757 | struct nfs4_sequence_args seq_args; | ||
758 | }; | ||
759 | |||
760 | struct nfs4_pathconf_res { | ||
761 | struct nfs_pathconf *pathconf; | ||
762 | struct nfs4_sequence_res seq_res; | ||
671 | }; | 763 | }; |
672 | 764 | ||
673 | struct nfs4_readdir_arg { | 765 | struct nfs4_readdir_arg { |
@@ -678,11 +770,13 @@ struct nfs4_readdir_arg { | |||
678 | struct page ** pages; /* zero-copy data */ | 770 | struct page ** pages; /* zero-copy data */ |
679 | unsigned int pgbase; /* zero-copy data */ | 771 | unsigned int pgbase; /* zero-copy data */ |
680 | const u32 * bitmask; | 772 | const u32 * bitmask; |
773 | struct nfs4_sequence_args seq_args; | ||
681 | }; | 774 | }; |
682 | 775 | ||
683 | struct nfs4_readdir_res { | 776 | struct nfs4_readdir_res { |
684 | nfs4_verifier verifier; | 777 | nfs4_verifier verifier; |
685 | unsigned int pgbase; | 778 | unsigned int pgbase; |
779 | struct nfs4_sequence_res seq_res; | ||
686 | }; | 780 | }; |
687 | 781 | ||
688 | struct nfs4_readlink { | 782 | struct nfs4_readlink { |
@@ -690,6 +784,11 @@ struct nfs4_readlink { | |||
690 | unsigned int pgbase; | 784 | unsigned int pgbase; |
691 | unsigned int pglen; /* zero-copy data */ | 785 | unsigned int pglen; /* zero-copy data */ |
692 | struct page ** pages; /* zero-copy data */ | 786 | struct page ** pages; /* zero-copy data */ |
787 | struct nfs4_sequence_args seq_args; | ||
788 | }; | ||
789 | |||
790 | struct nfs4_readlink_res { | ||
791 | struct nfs4_sequence_res seq_res; | ||
693 | }; | 792 | }; |
694 | 793 | ||
695 | struct nfs4_rename_arg { | 794 | struct nfs4_rename_arg { |
@@ -698,6 +797,7 @@ struct nfs4_rename_arg { | |||
698 | const struct qstr * old_name; | 797 | const struct qstr * old_name; |
699 | const struct qstr * new_name; | 798 | const struct qstr * new_name; |
700 | const u32 * bitmask; | 799 | const u32 * bitmask; |
800 | struct nfs4_sequence_args seq_args; | ||
701 | }; | 801 | }; |
702 | 802 | ||
703 | struct nfs4_rename_res { | 803 | struct nfs4_rename_res { |
@@ -706,6 +806,7 @@ struct nfs4_rename_res { | |||
706 | struct nfs_fattr * old_fattr; | 806 | struct nfs_fattr * old_fattr; |
707 | struct nfs4_change_info new_cinfo; | 807 | struct nfs4_change_info new_cinfo; |
708 | struct nfs_fattr * new_fattr; | 808 | struct nfs_fattr * new_fattr; |
809 | struct nfs4_sequence_res seq_res; | ||
709 | }; | 810 | }; |
710 | 811 | ||
711 | #define NFS4_SETCLIENTID_NAMELEN (127) | 812 | #define NFS4_SETCLIENTID_NAMELEN (127) |
@@ -724,6 +825,17 @@ struct nfs4_setclientid { | |||
724 | struct nfs4_statfs_arg { | 825 | struct nfs4_statfs_arg { |
725 | const struct nfs_fh * fh; | 826 | const struct nfs_fh * fh; |
726 | const u32 * bitmask; | 827 | const u32 * bitmask; |
828 | struct nfs4_sequence_args seq_args; | ||
829 | }; | ||
830 | |||
831 | struct nfs4_statfs_res { | ||
832 | struct nfs_fsstat *fsstat; | ||
833 | struct nfs4_sequence_res seq_res; | ||
834 | }; | ||
835 | |||
836 | struct nfs4_server_caps_arg { | ||
837 | struct nfs_fh *fhandle; | ||
838 | struct nfs4_sequence_args seq_args; | ||
727 | }; | 839 | }; |
728 | 840 | ||
729 | struct nfs4_server_caps_res { | 841 | struct nfs4_server_caps_res { |
@@ -731,6 +843,7 @@ struct nfs4_server_caps_res { | |||
731 | u32 acl_bitmask; | 843 | u32 acl_bitmask; |
732 | u32 has_links; | 844 | u32 has_links; |
733 | u32 has_symlinks; | 845 | u32 has_symlinks; |
846 | struct nfs4_sequence_res seq_res; | ||
734 | }; | 847 | }; |
735 | 848 | ||
736 | struct nfs4_string { | 849 | struct nfs4_string { |
@@ -765,10 +878,68 @@ struct nfs4_fs_locations_arg { | |||
765 | const struct qstr *name; | 878 | const struct qstr *name; |
766 | struct page *page; | 879 | struct page *page; |
767 | const u32 *bitmask; | 880 | const u32 *bitmask; |
881 | struct nfs4_sequence_args seq_args; | ||
882 | }; | ||
883 | |||
884 | struct nfs4_fs_locations_res { | ||
885 | struct nfs4_fs_locations *fs_locations; | ||
886 | struct nfs4_sequence_res seq_res; | ||
768 | }; | 887 | }; |
769 | 888 | ||
770 | #endif /* CONFIG_NFS_V4 */ | 889 | #endif /* CONFIG_NFS_V4 */ |
771 | 890 | ||
891 | struct nfstime4 { | ||
892 | u64 seconds; | ||
893 | u32 nseconds; | ||
894 | }; | ||
895 | |||
896 | #ifdef CONFIG_NFS_V4_1 | ||
897 | struct nfs_impl_id4 { | ||
898 | u32 domain_len; | ||
899 | char *domain; | ||
900 | u32 name_len; | ||
901 | char *name; | ||
902 | struct nfstime4 date; | ||
903 | }; | ||
904 | |||
905 | #define NFS4_EXCHANGE_ID_LEN (48) | ||
906 | struct nfs41_exchange_id_args { | ||
907 | struct nfs_client *client; | ||
908 | nfs4_verifier *verifier; | ||
909 | unsigned int id_len; | ||
910 | char id[NFS4_EXCHANGE_ID_LEN]; | ||
911 | u32 flags; | ||
912 | }; | ||
913 | |||
914 | struct server_owner { | ||
915 | uint64_t minor_id; | ||
916 | uint32_t major_id_sz; | ||
917 | char major_id[NFS4_OPAQUE_LIMIT]; | ||
918 | }; | ||
919 | |||
920 | struct server_scope { | ||
921 | uint32_t server_scope_sz; | ||
922 | char server_scope[NFS4_OPAQUE_LIMIT]; | ||
923 | }; | ||
924 | |||
925 | struct nfs41_exchange_id_res { | ||
926 | struct nfs_client *client; | ||
927 | u32 flags; | ||
928 | }; | ||
929 | |||
930 | struct nfs41_create_session_args { | ||
931 | struct nfs_client *client; | ||
932 | uint32_t flags; | ||
933 | uint32_t cb_program; | ||
934 | struct nfs4_channel_attrs fc_attrs; /* Fore Channel */ | ||
935 | struct nfs4_channel_attrs bc_attrs; /* Back Channel */ | ||
936 | }; | ||
937 | |||
938 | struct nfs41_create_session_res { | ||
939 | struct nfs_client *client; | ||
940 | }; | ||
941 | #endif /* CONFIG_NFS_V4_1 */ | ||
942 | |||
772 | struct nfs_page; | 943 | struct nfs_page; |
773 | 944 | ||
774 | #define NFS_PAGEVEC_SIZE (8U) | 945 | #define NFS_PAGEVEC_SIZE (8U) |
diff --git a/include/linux/nfsd/cache.h b/include/linux/nfsd/cache.h index 5bccaab81056..3a3f58934f5e 100644 --- a/include/linux/nfsd/cache.h +++ b/include/linux/nfsd/cache.h | |||
@@ -14,8 +14,7 @@ | |||
14 | #include <linux/uio.h> | 14 | #include <linux/uio.h> |
15 | 15 | ||
16 | /* | 16 | /* |
17 | * Representation of a reply cache entry. The first two members *must* | 17 | * Representation of a reply cache entry. |
18 | * be hash_next and hash_prev. | ||
19 | */ | 18 | */ |
20 | struct svc_cacherep { | 19 | struct svc_cacherep { |
21 | struct hlist_node c_hash; | 20 | struct hlist_node c_hash; |
diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h index afa19016c4a8..8f641c908450 100644 --- a/include/linux/nfsd/nfsfh.h +++ b/include/linux/nfsd/nfsfh.h | |||
@@ -151,9 +151,15 @@ typedef struct svc_fh { | |||
151 | __u64 fh_pre_size; /* size before operation */ | 151 | __u64 fh_pre_size; /* size before operation */ |
152 | struct timespec fh_pre_mtime; /* mtime before oper */ | 152 | struct timespec fh_pre_mtime; /* mtime before oper */ |
153 | struct timespec fh_pre_ctime; /* ctime before oper */ | 153 | struct timespec fh_pre_ctime; /* ctime before oper */ |
154 | /* | ||
155 | * pre-op nfsv4 change attr: note must check IS_I_VERSION(inode) | ||
156 | * to find out if it is valid. | ||
157 | */ | ||
158 | u64 fh_pre_change; | ||
154 | 159 | ||
155 | /* Post-op attributes saved in fh_unlock */ | 160 | /* Post-op attributes saved in fh_unlock */ |
156 | struct kstat fh_post_attr; /* full attrs after operation */ | 161 | struct kstat fh_post_attr; /* full attrs after operation */ |
162 | u64 fh_post_change; /* nfsv4 change; see above */ | ||
157 | #endif /* CONFIG_NFSD_V3 */ | 163 | #endif /* CONFIG_NFSD_V3 */ |
158 | 164 | ||
159 | } svc_fh; | 165 | } svc_fh; |
@@ -298,6 +304,7 @@ fill_pre_wcc(struct svc_fh *fhp) | |||
298 | fhp->fh_pre_mtime = inode->i_mtime; | 304 | fhp->fh_pre_mtime = inode->i_mtime; |
299 | fhp->fh_pre_ctime = inode->i_ctime; | 305 | fhp->fh_pre_ctime = inode->i_ctime; |
300 | fhp->fh_pre_size = inode->i_size; | 306 | fhp->fh_pre_size = inode->i_size; |
307 | fhp->fh_pre_change = inode->i_version; | ||
301 | fhp->fh_pre_saved = 1; | 308 | fhp->fh_pre_saved = 1; |
302 | } | 309 | } |
303 | } | 310 | } |
diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h index 4d61c873feed..57ab2ed08459 100644 --- a/include/linux/nfsd/state.h +++ b/include/linux/nfsd/state.h | |||
@@ -41,7 +41,6 @@ | |||
41 | #include <linux/kref.h> | 41 | #include <linux/kref.h> |
42 | #include <linux/sunrpc/clnt.h> | 42 | #include <linux/sunrpc/clnt.h> |
43 | 43 | ||
44 | #define NFS4_OPAQUE_LIMIT 1024 | ||
45 | typedef struct { | 44 | typedef struct { |
46 | u32 cl_boot; | 45 | u32 cl_boot; |
47 | u32 cl_id; | 46 | u32 cl_id; |
@@ -61,15 +60,6 @@ typedef struct { | |||
61 | #define si_stateownerid si_opaque.so_stateownerid | 60 | #define si_stateownerid si_opaque.so_stateownerid |
62 | #define si_fileid si_opaque.so_fileid | 61 | #define si_fileid si_opaque.so_fileid |
63 | 62 | ||
64 | |||
65 | struct nfs4_cb_recall { | ||
66 | u32 cbr_ident; | ||
67 | int cbr_trunc; | ||
68 | stateid_t cbr_stateid; | ||
69 | struct knfsd_fh cbr_fh; | ||
70 | struct nfs4_delegation *cbr_dp; | ||
71 | }; | ||
72 | |||
73 | struct nfs4_delegation { | 63 | struct nfs4_delegation { |
74 | struct list_head dl_perfile; | 64 | struct list_head dl_perfile; |
75 | struct list_head dl_perclnt; | 65 | struct list_head dl_perclnt; |
@@ -81,22 +71,25 @@ struct nfs4_delegation { | |||
81 | struct file *dl_vfs_file; | 71 | struct file *dl_vfs_file; |
82 | u32 dl_type; | 72 | u32 dl_type; |
83 | time_t dl_time; | 73 | time_t dl_time; |
84 | struct nfs4_cb_recall dl_recall; | 74 | /* For recall: */ |
75 | u32 dl_ident; | ||
76 | stateid_t dl_stateid; | ||
77 | struct knfsd_fh dl_fh; | ||
78 | int dl_retries; | ||
85 | }; | 79 | }; |
86 | 80 | ||
87 | #define dl_stateid dl_recall.cbr_stateid | ||
88 | #define dl_fh dl_recall.cbr_fh | ||
89 | |||
90 | /* client delegation callback info */ | 81 | /* client delegation callback info */ |
91 | struct nfs4_callback { | 82 | struct nfs4_cb_conn { |
92 | /* SETCLIENTID info */ | 83 | /* SETCLIENTID info */ |
93 | u32 cb_addr; | 84 | u32 cb_addr; |
94 | unsigned short cb_port; | 85 | unsigned short cb_port; |
95 | u32 cb_prog; | 86 | u32 cb_prog; |
96 | u32 cb_ident; | 87 | u32 cb_minorversion; |
88 | u32 cb_ident; /* minorversion 0 only */ | ||
97 | /* RPC client info */ | 89 | /* RPC client info */ |
98 | atomic_t cb_set; /* successful CB_NULL call */ | 90 | atomic_t cb_set; /* successful CB_NULL call */ |
99 | struct rpc_clnt * cb_client; | 91 | struct rpc_clnt * cb_client; |
92 | struct rpc_cred * cb_cred; | ||
100 | }; | 93 | }; |
101 | 94 | ||
102 | /* Maximum number of slots per session. 128 is useful for long haul TCP */ | 95 | /* Maximum number of slots per session. 128 is useful for long haul TCP */ |
@@ -122,6 +115,17 @@ struct nfsd4_slot { | |||
122 | struct nfsd4_cache_entry sl_cache_entry; | 115 | struct nfsd4_cache_entry sl_cache_entry; |
123 | }; | 116 | }; |
124 | 117 | ||
118 | struct nfsd4_channel_attrs { | ||
119 | u32 headerpadsz; | ||
120 | u32 maxreq_sz; | ||
121 | u32 maxresp_sz; | ||
122 | u32 maxresp_cached; | ||
123 | u32 maxops; | ||
124 | u32 maxreqs; | ||
125 | u32 nr_rdma_attrs; | ||
126 | u32 rdma_attrs; | ||
127 | }; | ||
128 | |||
125 | struct nfsd4_session { | 129 | struct nfsd4_session { |
126 | struct kref se_ref; | 130 | struct kref se_ref; |
127 | struct list_head se_hash; /* hash by sessionid */ | 131 | struct list_head se_hash; /* hash by sessionid */ |
@@ -129,11 +133,8 @@ struct nfsd4_session { | |||
129 | u32 se_flags; | 133 | u32 se_flags; |
130 | struct nfs4_client *se_client; /* for expire_client */ | 134 | struct nfs4_client *se_client; /* for expire_client */ |
131 | struct nfs4_sessionid se_sessionid; | 135 | struct nfs4_sessionid se_sessionid; |
132 | u32 se_fmaxreq_sz; | 136 | struct nfsd4_channel_attrs se_fchannel; |
133 | u32 se_fmaxresp_sz; | 137 | struct nfsd4_channel_attrs se_bchannel; |
134 | u32 se_fmaxresp_cached; | ||
135 | u32 se_fmaxops; | ||
136 | u32 se_fnumslots; | ||
137 | struct nfsd4_slot se_slots[]; /* forward channel slots */ | 138 | struct nfsd4_slot se_slots[]; /* forward channel slots */ |
138 | }; | 139 | }; |
139 | 140 | ||
@@ -185,7 +186,7 @@ struct nfs4_client { | |||
185 | struct svc_cred cl_cred; /* setclientid principal */ | 186 | struct svc_cred cl_cred; /* setclientid principal */ |
186 | clientid_t cl_clientid; /* generated by server */ | 187 | clientid_t cl_clientid; /* generated by server */ |
187 | nfs4_verifier cl_confirm; /* generated by server */ | 188 | nfs4_verifier cl_confirm; /* generated by server */ |
188 | struct nfs4_callback cl_callback; /* callback info */ | 189 | struct nfs4_cb_conn cl_cb_conn; /* callback info */ |
189 | atomic_t cl_count; /* ref count */ | 190 | atomic_t cl_count; /* ref count */ |
190 | u32 cl_firststate; /* recovery dir creation */ | 191 | u32 cl_firststate; /* recovery dir creation */ |
191 | 192 | ||
diff --git a/include/linux/nfsd/xdr4.h b/include/linux/nfsd/xdr4.h index f80d6013fdc3..2bacf7535069 100644 --- a/include/linux/nfsd/xdr4.h +++ b/include/linux/nfsd/xdr4.h | |||
@@ -64,10 +64,13 @@ static inline bool nfsd4_has_session(struct nfsd4_compound_state *cs) | |||
64 | 64 | ||
65 | struct nfsd4_change_info { | 65 | struct nfsd4_change_info { |
66 | u32 atomic; | 66 | u32 atomic; |
67 | bool change_supported; | ||
67 | u32 before_ctime_sec; | 68 | u32 before_ctime_sec; |
68 | u32 before_ctime_nsec; | 69 | u32 before_ctime_nsec; |
70 | u64 before_change; | ||
69 | u32 after_ctime_sec; | 71 | u32 after_ctime_sec; |
70 | u32 after_ctime_nsec; | 72 | u32 after_ctime_nsec; |
73 | u64 after_change; | ||
71 | }; | 74 | }; |
72 | 75 | ||
73 | struct nfsd4_access { | 76 | struct nfsd4_access { |
@@ -363,17 +366,6 @@ struct nfsd4_exchange_id { | |||
363 | int spa_how; | 366 | int spa_how; |
364 | }; | 367 | }; |
365 | 368 | ||
366 | struct nfsd4_channel_attrs { | ||
367 | u32 headerpadsz; | ||
368 | u32 maxreq_sz; | ||
369 | u32 maxresp_sz; | ||
370 | u32 maxresp_cached; | ||
371 | u32 maxops; | ||
372 | u32 maxreqs; | ||
373 | u32 nr_rdma_attrs; | ||
374 | u32 rdma_attrs; | ||
375 | }; | ||
376 | |||
377 | struct nfsd4_create_session { | 369 | struct nfsd4_create_session { |
378 | clientid_t clientid; | 370 | clientid_t clientid; |
379 | struct nfs4_sessionid sessionid; | 371 | struct nfs4_sessionid sessionid; |
@@ -503,10 +495,16 @@ set_change_info(struct nfsd4_change_info *cinfo, struct svc_fh *fhp) | |||
503 | { | 495 | { |
504 | BUG_ON(!fhp->fh_pre_saved || !fhp->fh_post_saved); | 496 | BUG_ON(!fhp->fh_pre_saved || !fhp->fh_post_saved); |
505 | cinfo->atomic = 1; | 497 | cinfo->atomic = 1; |
506 | cinfo->before_ctime_sec = fhp->fh_pre_ctime.tv_sec; | 498 | cinfo->change_supported = IS_I_VERSION(fhp->fh_dentry->d_inode); |
507 | cinfo->before_ctime_nsec = fhp->fh_pre_ctime.tv_nsec; | 499 | if (cinfo->change_supported) { |
508 | cinfo->after_ctime_sec = fhp->fh_post_attr.ctime.tv_sec; | 500 | cinfo->before_change = fhp->fh_pre_change; |
509 | cinfo->after_ctime_nsec = fhp->fh_post_attr.ctime.tv_nsec; | 501 | cinfo->after_change = fhp->fh_post_change; |
502 | } else { | ||
503 | cinfo->before_ctime_sec = fhp->fh_pre_ctime.tv_sec; | ||
504 | cinfo->before_ctime_nsec = fhp->fh_pre_ctime.tv_nsec; | ||
505 | cinfo->after_ctime_sec = fhp->fh_post_attr.ctime.tv_sec; | ||
506 | cinfo->after_ctime_nsec = fhp->fh_post_attr.ctime.tv_nsec; | ||
507 | } | ||
510 | } | 508 | } |
511 | 509 | ||
512 | int nfs4svc_encode_voidres(struct svc_rqst *, __be32 *, void *); | 510 | int nfs4svc_encode_voidres(struct svc_rqst *, __be32 *, void *); |
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h index 829b94b156f2..b359c4a9ec9e 100644 --- a/include/linux/nodemask.h +++ b/include/linux/nodemask.h | |||
@@ -82,6 +82,12 @@ | |||
82 | * to generate slightly worse code. So use a simple one-line #define | 82 | * to generate slightly worse code. So use a simple one-line #define |
83 | * for node_isset(), instead of wrapping an inline inside a macro, the | 83 | * for node_isset(), instead of wrapping an inline inside a macro, the |
84 | * way we do the other calls. | 84 | * way we do the other calls. |
85 | * | ||
86 | * NODEMASK_SCRATCH | ||
87 | * When doing above logical AND, OR, XOR, Remap operations the callers tend to | ||
88 | * need temporary nodemask_t's on the stack. But if NODES_SHIFT is large, | ||
89 | * nodemask_t's consume too much stack space. NODEMASK_SCRATCH is a helper | ||
90 | * for such situations. See below and CPUMASK_ALLOC also. | ||
85 | */ | 91 | */ |
86 | 92 | ||
87 | #include <linux/kernel.h> | 93 | #include <linux/kernel.h> |
@@ -473,4 +479,26 @@ static inline int num_node_state(enum node_states state) | |||
473 | #define for_each_node(node) for_each_node_state(node, N_POSSIBLE) | 479 | #define for_each_node(node) for_each_node_state(node, N_POSSIBLE) |
474 | #define for_each_online_node(node) for_each_node_state(node, N_ONLINE) | 480 | #define for_each_online_node(node) for_each_node_state(node, N_ONLINE) |
475 | 481 | ||
482 | /* | ||
483 | * For nodemask scrach area.(See CPUMASK_ALLOC() in cpumask.h) | ||
484 | */ | ||
485 | |||
486 | #if NODES_SHIFT > 8 /* nodemask_t > 64 bytes */ | ||
487 | #define NODEMASK_ALLOC(x, m) struct x *m = kmalloc(sizeof(*m), GFP_KERNEL) | ||
488 | #define NODEMASK_FREE(m) kfree(m) | ||
489 | #else | ||
490 | #define NODEMASK_ALLOC(x, m) struct x _m, *m = &_m | ||
491 | #define NODEMASK_FREE(m) | ||
492 | #endif | ||
493 | |||
494 | /* A example struture for using NODEMASK_ALLOC, used in mempolicy. */ | ||
495 | struct nodemask_scratch { | ||
496 | nodemask_t mask1; | ||
497 | nodemask_t mask2; | ||
498 | }; | ||
499 | |||
500 | #define NODEMASK_SCRATCH(x) NODEMASK_ALLOC(nodemask_scratch, x) | ||
501 | #define NODEMASK_SCRATCH_FREE(x) NODEMASK_FREE(x) | ||
502 | |||
503 | |||
476 | #endif /* __LINUX_NODEMASK_H */ | 504 | #endif /* __LINUX_NODEMASK_H */ |
diff --git a/include/linux/of_mdio.h b/include/linux/of_mdio.h index c9663c690303..53b94e025c7c 100644 --- a/include/linux/of_mdio.h +++ b/include/linux/of_mdio.h | |||
@@ -18,5 +18,8 @@ extern struct phy_device *of_phy_connect(struct net_device *dev, | |||
18 | struct device_node *phy_np, | 18 | struct device_node *phy_np, |
19 | void (*hndlr)(struct net_device *), | 19 | void (*hndlr)(struct net_device *), |
20 | u32 flags, phy_interface_t iface); | 20 | u32 flags, phy_interface_t iface); |
21 | extern struct phy_device *of_phy_connect_fixed_link(struct net_device *dev, | ||
22 | void (*hndlr)(struct net_device *), | ||
23 | phy_interface_t iface); | ||
21 | 24 | ||
22 | #endif /* __LINUX_OF_MDIO_H */ | 25 | #endif /* __LINUX_OF_MDIO_H */ |
diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h index 092e82e0048c..93a7c08f869d 100644 --- a/include/linux/pci-acpi.h +++ b/include/linux/pci-acpi.h | |||
@@ -15,7 +15,7 @@ static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev) | |||
15 | { | 15 | { |
16 | struct pci_bus *pbus = pdev->bus; | 16 | struct pci_bus *pbus = pdev->bus; |
17 | /* Find a PCI root bus */ | 17 | /* Find a PCI root bus */ |
18 | while (pbus->parent) | 18 | while (!pci_is_root_bus(pbus)) |
19 | pbus = pbus->parent; | 19 | pbus = pbus->parent; |
20 | return acpi_get_pci_rootbridge_handle(pci_domain_nr(pbus), | 20 | return acpi_get_pci_rootbridge_handle(pci_domain_nr(pbus), |
21 | pbus->number); | 21 | pbus->number); |
@@ -23,7 +23,7 @@ static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev) | |||
23 | 23 | ||
24 | static inline acpi_handle acpi_pci_get_bridge_handle(struct pci_bus *pbus) | 24 | static inline acpi_handle acpi_pci_get_bridge_handle(struct pci_bus *pbus) |
25 | { | 25 | { |
26 | if (pbus->parent) | 26 | if (!pci_is_root_bus(pbus)) |
27 | return DEVICE_ACPI_HANDLE(&(pbus->self->dev)); | 27 | return DEVICE_ACPI_HANDLE(&(pbus->self->dev)); |
28 | return acpi_get_pci_rootbridge_handle(pci_domain_nr(pbus), | 28 | return acpi_get_pci_rootbridge_handle(pci_domain_nr(pbus), |
29 | pbus->number); | 29 | pbus->number); |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 8e366bb0705f..115fb7ba5089 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -196,6 +196,7 @@ struct pci_cap_saved_state { | |||
196 | struct pcie_link_state; | 196 | struct pcie_link_state; |
197 | struct pci_vpd; | 197 | struct pci_vpd; |
198 | struct pci_sriov; | 198 | struct pci_sriov; |
199 | struct pci_ats; | ||
199 | 200 | ||
200 | /* | 201 | /* |
201 | * The pci_dev structure is used to describe PCI devices. | 202 | * The pci_dev structure is used to describe PCI devices. |
@@ -293,6 +294,7 @@ struct pci_dev { | |||
293 | struct pci_sriov *sriov; /* SR-IOV capability related */ | 294 | struct pci_sriov *sriov; /* SR-IOV capability related */ |
294 | struct pci_dev *physfn; /* the PF this VF is associated with */ | 295 | struct pci_dev *physfn; /* the PF this VF is associated with */ |
295 | }; | 296 | }; |
297 | struct pci_ats *ats; /* Address Translation Service */ | ||
296 | #endif | 298 | #endif |
297 | }; | 299 | }; |
298 | 300 | ||
@@ -607,8 +609,6 @@ extern void pci_sort_breadthfirst(void); | |||
607 | struct pci_dev __deprecated *pci_find_device(unsigned int vendor, | 609 | struct pci_dev __deprecated *pci_find_device(unsigned int vendor, |
608 | unsigned int device, | 610 | unsigned int device, |
609 | struct pci_dev *from); | 611 | struct pci_dev *from); |
610 | struct pci_dev __deprecated *pci_find_slot(unsigned int bus, | ||
611 | unsigned int devfn); | ||
612 | #endif /* CONFIG_PCI_LEGACY */ | 612 | #endif /* CONFIG_PCI_LEGACY */ |
613 | 613 | ||
614 | enum pci_lost_interrupt_reason { | 614 | enum pci_lost_interrupt_reason { |
@@ -647,6 +647,7 @@ int pci_bus_write_config_word(struct pci_bus *bus, unsigned int devfn, | |||
647 | int where, u16 val); | 647 | int where, u16 val); |
648 | int pci_bus_write_config_dword(struct pci_bus *bus, unsigned int devfn, | 648 | int pci_bus_write_config_dword(struct pci_bus *bus, unsigned int devfn, |
649 | int where, u32 val); | 649 | int where, u32 val); |
650 | struct pci_ops *pci_bus_set_ops(struct pci_bus *bus, struct pci_ops *ops); | ||
650 | 651 | ||
651 | static inline int pci_read_config_byte(struct pci_dev *dev, int where, u8 *val) | 652 | static inline int pci_read_config_byte(struct pci_dev *dev, int where, u8 *val) |
652 | { | 653 | { |
@@ -711,8 +712,8 @@ int pcix_get_mmrbc(struct pci_dev *dev); | |||
711 | int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc); | 712 | int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc); |
712 | int pcie_get_readrq(struct pci_dev *dev); | 713 | int pcie_get_readrq(struct pci_dev *dev); |
713 | int pcie_set_readrq(struct pci_dev *dev, int rq); | 714 | int pcie_set_readrq(struct pci_dev *dev, int rq); |
715 | int __pci_reset_function(struct pci_dev *dev); | ||
714 | int pci_reset_function(struct pci_dev *dev); | 716 | int pci_reset_function(struct pci_dev *dev); |
715 | int pci_execute_reset_function(struct pci_dev *dev); | ||
716 | void pci_update_resource(struct pci_dev *dev, int resno); | 717 | void pci_update_resource(struct pci_dev *dev, int resno); |
717 | int __must_check pci_assign_resource(struct pci_dev *dev, int i); | 718 | int __must_check pci_assign_resource(struct pci_dev *dev, int i); |
718 | int pci_select_bars(struct pci_dev *dev, unsigned long flags); | 719 | int pci_select_bars(struct pci_dev *dev, unsigned long flags); |
@@ -732,7 +733,7 @@ int pci_set_power_state(struct pci_dev *dev, pci_power_t state); | |||
732 | pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); | 733 | pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); |
733 | bool pci_pme_capable(struct pci_dev *dev, pci_power_t state); | 734 | bool pci_pme_capable(struct pci_dev *dev, pci_power_t state); |
734 | void pci_pme_active(struct pci_dev *dev, bool enable); | 735 | void pci_pme_active(struct pci_dev *dev, bool enable); |
735 | int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable); | 736 | int pci_enable_wake(struct pci_dev *dev, pci_power_t state, bool enable); |
736 | int pci_wake_from_d3(struct pci_dev *dev, bool enable); | 737 | int pci_wake_from_d3(struct pci_dev *dev, bool enable); |
737 | pci_power_t pci_target_state(struct pci_dev *dev); | 738 | pci_power_t pci_target_state(struct pci_dev *dev); |
738 | int pci_prepare_to_sleep(struct pci_dev *dev); | 739 | int pci_prepare_to_sleep(struct pci_dev *dev); |
@@ -798,7 +799,7 @@ const struct pci_device_id *pci_match_id(const struct pci_device_id *ids, | |||
798 | int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, | 799 | int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, |
799 | int pass); | 800 | int pass); |
800 | 801 | ||
801 | void pci_walk_bus(struct pci_bus *top, void (*cb)(struct pci_dev *, void *), | 802 | void pci_walk_bus(struct pci_bus *top, int (*cb)(struct pci_dev *, void *), |
802 | void *userdata); | 803 | void *userdata); |
803 | int pci_cfg_space_size_ext(struct pci_dev *dev); | 804 | int pci_cfg_space_size_ext(struct pci_dev *dev); |
804 | int pci_cfg_space_size(struct pci_dev *dev); | 805 | int pci_cfg_space_size(struct pci_dev *dev); |
@@ -888,6 +889,17 @@ static inline int pcie_aspm_enabled(void) | |||
888 | extern int pcie_aspm_enabled(void); | 889 | extern int pcie_aspm_enabled(void); |
889 | #endif | 890 | #endif |
890 | 891 | ||
892 | #ifndef CONFIG_PCIE_ECRC | ||
893 | static inline void pcie_set_ecrc_checking(struct pci_dev *dev) | ||
894 | { | ||
895 | return; | ||
896 | } | ||
897 | static inline void pcie_ecrc_get_policy(char *str) {}; | ||
898 | #else | ||
899 | extern void pcie_set_ecrc_checking(struct pci_dev *dev); | ||
900 | extern void pcie_ecrc_get_policy(char *str); | ||
901 | #endif | ||
902 | |||
891 | #define pci_enable_msi(pdev) pci_enable_msi_block(pdev, 1) | 903 | #define pci_enable_msi(pdev) pci_enable_msi_block(pdev, 1) |
892 | 904 | ||
893 | #ifdef CONFIG_HT_IRQ | 905 | #ifdef CONFIG_HT_IRQ |
@@ -944,12 +956,6 @@ static inline struct pci_dev *pci_find_device(unsigned int vendor, | |||
944 | return NULL; | 956 | return NULL; |
945 | } | 957 | } |
946 | 958 | ||
947 | static inline struct pci_dev *pci_find_slot(unsigned int bus, | ||
948 | unsigned int devfn) | ||
949 | { | ||
950 | return NULL; | ||
951 | } | ||
952 | |||
953 | static inline struct pci_dev *pci_get_device(unsigned int vendor, | 959 | static inline struct pci_dev *pci_get_device(unsigned int vendor, |
954 | unsigned int device, | 960 | unsigned int device, |
955 | struct pci_dev *from) | 961 | struct pci_dev *from) |
@@ -1105,6 +1111,10 @@ static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus, | |||
1105 | 1111 | ||
1106 | #include <asm/pci.h> | 1112 | #include <asm/pci.h> |
1107 | 1113 | ||
1114 | #ifndef PCIBIOS_MAX_MEM_32 | ||
1115 | #define PCIBIOS_MAX_MEM_32 (-1) | ||
1116 | #endif | ||
1117 | |||
1108 | /* these helpers provide future and backwards compatibility | 1118 | /* these helpers provide future and backwards compatibility |
1109 | * for accessing popular PCI BAR info */ | 1119 | * for accessing popular PCI BAR info */ |
1110 | #define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start) | 1120 | #define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start) |
@@ -1135,7 +1145,7 @@ static inline void pci_set_drvdata(struct pci_dev *pdev, void *data) | |||
1135 | /* If you want to know what to call your pci_dev, ask this function. | 1145 | /* If you want to know what to call your pci_dev, ask this function. |
1136 | * Again, it's a wrapper around the generic device. | 1146 | * Again, it's a wrapper around the generic device. |
1137 | */ | 1147 | */ |
1138 | static inline const char *pci_name(struct pci_dev *pdev) | 1148 | static inline const char *pci_name(const struct pci_dev *pdev) |
1139 | { | 1149 | { |
1140 | return dev_name(&pdev->dev); | 1150 | return dev_name(&pdev->dev); |
1141 | } | 1151 | } |
@@ -1261,5 +1271,10 @@ static inline irqreturn_t pci_sriov_migration(struct pci_dev *dev) | |||
1261 | } | 1271 | } |
1262 | #endif | 1272 | #endif |
1263 | 1273 | ||
1274 | #if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE) | ||
1275 | extern void pci_hp_create_module_link(struct pci_slot *pci_slot); | ||
1276 | extern void pci_hp_remove_module_link(struct pci_slot *pci_slot); | ||
1277 | #endif | ||
1278 | |||
1264 | #endif /* __KERNEL__ */ | 1279 | #endif /* __KERNEL__ */ |
1265 | #endif /* LINUX_PCI_H */ | 1280 | #endif /* LINUX_PCI_H */ |
diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h index 20998746518e..4391741b99dc 100644 --- a/include/linux/pci_hotplug.h +++ b/include/linux/pci_hotplug.h | |||
@@ -66,17 +66,10 @@ enum pcie_link_speed { | |||
66 | PCIE_LNK_SPEED_UNKNOWN = 0xFF, | 66 | PCIE_LNK_SPEED_UNKNOWN = 0xFF, |
67 | }; | 67 | }; |
68 | 68 | ||
69 | struct hotplug_slot; | ||
70 | struct hotplug_slot_attribute { | ||
71 | struct attribute attr; | ||
72 | ssize_t (*show)(struct hotplug_slot *, char *); | ||
73 | ssize_t (*store)(struct hotplug_slot *, const char *, size_t); | ||
74 | }; | ||
75 | #define to_hotplug_attr(n) container_of(n, struct hotplug_slot_attribute, attr); | ||
76 | |||
77 | /** | 69 | /** |
78 | * struct hotplug_slot_ops -the callbacks that the hotplug pci core can use | 70 | * struct hotplug_slot_ops -the callbacks that the hotplug pci core can use |
79 | * @owner: The module owner of this structure | 71 | * @owner: The module owner of this structure |
72 | * @mod_name: The module name (KBUILD_MODNAME) of this structure | ||
80 | * @enable_slot: Called when the user wants to enable a specific pci slot | 73 | * @enable_slot: Called when the user wants to enable a specific pci slot |
81 | * @disable_slot: Called when the user wants to disable a specific pci slot | 74 | * @disable_slot: Called when the user wants to disable a specific pci slot |
82 | * @set_attention_status: Called to set the specific slot's attention LED to | 75 | * @set_attention_status: Called to set the specific slot's attention LED to |
@@ -109,6 +102,7 @@ struct hotplug_slot_attribute { | |||
109 | */ | 102 | */ |
110 | struct hotplug_slot_ops { | 103 | struct hotplug_slot_ops { |
111 | struct module *owner; | 104 | struct module *owner; |
105 | const char *mod_name; | ||
112 | int (*enable_slot) (struct hotplug_slot *slot); | 106 | int (*enable_slot) (struct hotplug_slot *slot); |
113 | int (*disable_slot) (struct hotplug_slot *slot); | 107 | int (*disable_slot) (struct hotplug_slot *slot); |
114 | int (*set_attention_status) (struct hotplug_slot *slot, u8 value); | 108 | int (*set_attention_status) (struct hotplug_slot *slot, u8 value); |
@@ -167,12 +161,21 @@ static inline const char *hotplug_slot_name(const struct hotplug_slot *slot) | |||
167 | return pci_slot_name(slot->pci_slot); | 161 | return pci_slot_name(slot->pci_slot); |
168 | } | 162 | } |
169 | 163 | ||
170 | extern int pci_hp_register(struct hotplug_slot *, struct pci_bus *, int nr, | 164 | extern int __pci_hp_register(struct hotplug_slot *slot, struct pci_bus *pbus, |
171 | const char *name); | 165 | int nr, const char *name, |
166 | struct module *owner, const char *mod_name); | ||
172 | extern int pci_hp_deregister(struct hotplug_slot *slot); | 167 | extern int pci_hp_deregister(struct hotplug_slot *slot); |
173 | extern int __must_check pci_hp_change_slot_info (struct hotplug_slot *slot, | 168 | extern int __must_check pci_hp_change_slot_info (struct hotplug_slot *slot, |
174 | struct hotplug_slot_info *info); | 169 | struct hotplug_slot_info *info); |
175 | 170 | ||
171 | static inline int pci_hp_register(struct hotplug_slot *slot, | ||
172 | struct pci_bus *pbus, | ||
173 | int devnr, const char *name) | ||
174 | { | ||
175 | return __pci_hp_register(slot, pbus, devnr, name, | ||
176 | THIS_MODULE, KBUILD_MODNAME); | ||
177 | } | ||
178 | |||
176 | /* PCI Setting Record (Type 0) */ | 179 | /* PCI Setting Record (Type 0) */ |
177 | struct hpp_type0 { | 180 | struct hpp_type0 { |
178 | u32 revision; | 181 | u32 revision; |
@@ -226,7 +229,6 @@ struct hotplug_params { | |||
226 | extern acpi_status acpi_get_hp_params_from_firmware(struct pci_bus *bus, | 229 | extern acpi_status acpi_get_hp_params_from_firmware(struct pci_bus *bus, |
227 | struct hotplug_params *hpp); | 230 | struct hotplug_params *hpp); |
228 | int acpi_get_hp_hw_control_from_firmware(struct pci_dev *dev, u32 flags); | 231 | int acpi_get_hp_hw_control_from_firmware(struct pci_dev *dev, u32 flags); |
229 | int acpi_root_bridge(acpi_handle handle); | ||
230 | int acpi_pci_check_ejectable(struct pci_bus *pbus, acpi_handle handle); | 232 | int acpi_pci_check_ejectable(struct pci_bus *pbus, acpi_handle handle); |
231 | int acpi_pci_detect_ejectable(struct pci_bus *pbus); | 233 | int acpi_pci_detect_ejectable(struct pci_bus *pbus); |
232 | #endif | 234 | #endif |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index a3b000365795..73b46b6b904f 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -2645,6 +2645,7 @@ | |||
2645 | #define PCI_DEVICE_ID_NETMOS_9835 0x9835 | 2645 | #define PCI_DEVICE_ID_NETMOS_9835 0x9835 |
2646 | #define PCI_DEVICE_ID_NETMOS_9845 0x9845 | 2646 | #define PCI_DEVICE_ID_NETMOS_9845 0x9845 |
2647 | #define PCI_DEVICE_ID_NETMOS_9855 0x9855 | 2647 | #define PCI_DEVICE_ID_NETMOS_9855 0x9855 |
2648 | #define PCI_DEVICE_ID_NETMOS_9901 0x9901 | ||
2648 | 2649 | ||
2649 | #define PCI_VENDOR_ID_3COM_2 0xa727 | 2650 | #define PCI_VENDOR_ID_3COM_2 0xa727 |
2650 | 2651 | ||
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h index 616bf8b3c8b5..fcaee42c7ac2 100644 --- a/include/linux/pci_regs.h +++ b/include/linux/pci_regs.h | |||
@@ -295,8 +295,9 @@ | |||
295 | #define PCI_MSI_ADDRESS_LO 4 /* Lower 32 bits */ | 295 | #define PCI_MSI_ADDRESS_LO 4 /* Lower 32 bits */ |
296 | #define PCI_MSI_ADDRESS_HI 8 /* Upper 32 bits (if PCI_MSI_FLAGS_64BIT set) */ | 296 | #define PCI_MSI_ADDRESS_HI 8 /* Upper 32 bits (if PCI_MSI_FLAGS_64BIT set) */ |
297 | #define PCI_MSI_DATA_32 8 /* 16 bits of data for 32-bit devices */ | 297 | #define PCI_MSI_DATA_32 8 /* 16 bits of data for 32-bit devices */ |
298 | #define PCI_MSI_MASK_32 12 /* Mask bits register for 32-bit devices */ | ||
298 | #define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */ | 299 | #define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */ |
299 | #define PCI_MSI_MASK_BIT 16 /* Mask bits register */ | 300 | #define PCI_MSI_MASK_64 16 /* Mask bits register for 64-bit devices */ |
300 | 301 | ||
301 | /* MSI-X registers (these are at offset PCI_MSIX_FLAGS) */ | 302 | /* MSI-X registers (these are at offset PCI_MSIX_FLAGS) */ |
302 | #define PCI_MSIX_FLAGS 2 | 303 | #define PCI_MSIX_FLAGS 2 |
@@ -304,7 +305,6 @@ | |||
304 | #define PCI_MSIX_FLAGS_ENABLE (1 << 15) | 305 | #define PCI_MSIX_FLAGS_ENABLE (1 << 15) |
305 | #define PCI_MSIX_FLAGS_MASKALL (1 << 14) | 306 | #define PCI_MSIX_FLAGS_MASKALL (1 << 14) |
306 | #define PCI_MSIX_FLAGS_BIRMASK (7 << 0) | 307 | #define PCI_MSIX_FLAGS_BIRMASK (7 << 0) |
307 | #define PCI_MSIX_FLAGS_BITMASK (1 << 0) | ||
308 | 308 | ||
309 | /* CompactPCI Hotswap Register */ | 309 | /* CompactPCI Hotswap Register */ |
310 | 310 | ||
@@ -502,6 +502,7 @@ | |||
502 | #define PCI_EXT_CAP_ID_DSN 3 | 502 | #define PCI_EXT_CAP_ID_DSN 3 |
503 | #define PCI_EXT_CAP_ID_PWR 4 | 503 | #define PCI_EXT_CAP_ID_PWR 4 |
504 | #define PCI_EXT_CAP_ID_ARI 14 | 504 | #define PCI_EXT_CAP_ID_ARI 14 |
505 | #define PCI_EXT_CAP_ID_ATS 15 | ||
505 | #define PCI_EXT_CAP_ID_SRIOV 16 | 506 | #define PCI_EXT_CAP_ID_SRIOV 16 |
506 | 507 | ||
507 | /* Advanced Error Reporting */ | 508 | /* Advanced Error Reporting */ |
@@ -620,6 +621,15 @@ | |||
620 | #define PCI_ARI_CTRL_ACS 0x0002 /* ACS Function Groups Enable */ | 621 | #define PCI_ARI_CTRL_ACS 0x0002 /* ACS Function Groups Enable */ |
621 | #define PCI_ARI_CTRL_FG(x) (((x) >> 4) & 7) /* Function Group */ | 622 | #define PCI_ARI_CTRL_FG(x) (((x) >> 4) & 7) /* Function Group */ |
622 | 623 | ||
624 | /* Address Translation Service */ | ||
625 | #define PCI_ATS_CAP 0x04 /* ATS Capability Register */ | ||
626 | #define PCI_ATS_CAP_QDEP(x) ((x) & 0x1f) /* Invalidate Queue Depth */ | ||
627 | #define PCI_ATS_MAX_QDEP 32 /* Max Invalidate Queue Depth */ | ||
628 | #define PCI_ATS_CTRL 0x06 /* ATS Control Register */ | ||
629 | #define PCI_ATS_CTRL_ENABLE 0x8000 /* ATS Enable */ | ||
630 | #define PCI_ATS_CTRL_STU(x) ((x) & 0x1f) /* Smallest Translation Unit */ | ||
631 | #define PCI_ATS_MIN_STU 12 /* shift of minimum STU block */ | ||
632 | |||
623 | /* Single Root I/O Virtualization */ | 633 | /* Single Root I/O Virtualization */ |
624 | #define PCI_SRIOV_CAP 0x04 /* SR-IOV Capabilities */ | 634 | #define PCI_SRIOV_CAP 0x04 /* SR-IOV Capabilities */ |
625 | #define PCI_SRIOV_CAP_VFM 0x01 /* VF Migration Capable */ | 635 | #define PCI_SRIOV_CAP_VFM 0x01 /* VF Migration Capable */ |
diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h index 8f921d74f49f..68438e18fff4 100644 --- a/include/linux/percpu-defs.h +++ b/include/linux/percpu-defs.h | |||
@@ -24,7 +24,8 @@ | |||
24 | 24 | ||
25 | #define DEFINE_PER_CPU_SECTION(type, name, section) \ | 25 | #define DEFINE_PER_CPU_SECTION(type, name, section) \ |
26 | __attribute__((__section__(PER_CPU_BASE_SECTION section))) \ | 26 | __attribute__((__section__(PER_CPU_BASE_SECTION section))) \ |
27 | PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name | 27 | PER_CPU_ATTRIBUTES PER_CPU_DEF_ATTRIBUTES \ |
28 | __typeof__(type) per_cpu__##name | ||
28 | 29 | ||
29 | /* | 30 | /* |
30 | * Variant on the per-CPU variable declaration/definition theme used for | 31 | * Variant on the per-CPU variable declaration/definition theme used for |
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h index 1b3118a1023a..b53f7006cc4e 100644 --- a/include/linux/perf_counter.h +++ b/include/linux/perf_counter.h | |||
@@ -115,26 +115,44 @@ enum perf_counter_sample_format { | |||
115 | PERF_SAMPLE_TID = 1U << 1, | 115 | PERF_SAMPLE_TID = 1U << 1, |
116 | PERF_SAMPLE_TIME = 1U << 2, | 116 | PERF_SAMPLE_TIME = 1U << 2, |
117 | PERF_SAMPLE_ADDR = 1U << 3, | 117 | PERF_SAMPLE_ADDR = 1U << 3, |
118 | PERF_SAMPLE_GROUP = 1U << 4, | 118 | PERF_SAMPLE_READ = 1U << 4, |
119 | PERF_SAMPLE_CALLCHAIN = 1U << 5, | 119 | PERF_SAMPLE_CALLCHAIN = 1U << 5, |
120 | PERF_SAMPLE_ID = 1U << 6, | 120 | PERF_SAMPLE_ID = 1U << 6, |
121 | PERF_SAMPLE_CPU = 1U << 7, | 121 | PERF_SAMPLE_CPU = 1U << 7, |
122 | PERF_SAMPLE_PERIOD = 1U << 8, | 122 | PERF_SAMPLE_PERIOD = 1U << 8, |
123 | PERF_SAMPLE_STREAM_ID = 1U << 9, | ||
124 | PERF_SAMPLE_RAW = 1U << 10, | ||
123 | 125 | ||
124 | PERF_SAMPLE_MAX = 1U << 9, /* non-ABI */ | 126 | PERF_SAMPLE_MAX = 1U << 11, /* non-ABI */ |
125 | }; | 127 | }; |
126 | 128 | ||
127 | /* | 129 | /* |
128 | * Bits that can be set in attr.read_format to request that | 130 | * The format of the data returned by read() on a perf counter fd, |
129 | * reads on the counter should return the indicated quantities, | 131 | * as specified by attr.read_format: |
130 | * in increasing order of bit value, after the counter value. | 132 | * |
133 | * struct read_format { | ||
134 | * { u64 value; | ||
135 | * { u64 time_enabled; } && PERF_FORMAT_ENABLED | ||
136 | * { u64 time_running; } && PERF_FORMAT_RUNNING | ||
137 | * { u64 id; } && PERF_FORMAT_ID | ||
138 | * } && !PERF_FORMAT_GROUP | ||
139 | * | ||
140 | * { u64 nr; | ||
141 | * { u64 time_enabled; } && PERF_FORMAT_ENABLED | ||
142 | * { u64 time_running; } && PERF_FORMAT_RUNNING | ||
143 | * { u64 value; | ||
144 | * { u64 id; } && PERF_FORMAT_ID | ||
145 | * } cntr[nr]; | ||
146 | * } && PERF_FORMAT_GROUP | ||
147 | * }; | ||
131 | */ | 148 | */ |
132 | enum perf_counter_read_format { | 149 | enum perf_counter_read_format { |
133 | PERF_FORMAT_TOTAL_TIME_ENABLED = 1U << 0, | 150 | PERF_FORMAT_TOTAL_TIME_ENABLED = 1U << 0, |
134 | PERF_FORMAT_TOTAL_TIME_RUNNING = 1U << 1, | 151 | PERF_FORMAT_TOTAL_TIME_RUNNING = 1U << 1, |
135 | PERF_FORMAT_ID = 1U << 2, | 152 | PERF_FORMAT_ID = 1U << 2, |
153 | PERF_FORMAT_GROUP = 1U << 3, | ||
136 | 154 | ||
137 | PERF_FORMAT_MAX = 1U << 3, /* non-ABI */ | 155 | PERF_FORMAT_MAX = 1U << 4, /* non-ABI */ |
138 | }; | 156 | }; |
139 | 157 | ||
140 | #define PERF_ATTR_SIZE_VER0 64 /* sizeof first published struct */ | 158 | #define PERF_ATTR_SIZE_VER0 64 /* sizeof first published struct */ |
@@ -178,8 +196,11 @@ struct perf_counter_attr { | |||
178 | mmap : 1, /* include mmap data */ | 196 | mmap : 1, /* include mmap data */ |
179 | comm : 1, /* include comm data */ | 197 | comm : 1, /* include comm data */ |
180 | freq : 1, /* use freq, not period */ | 198 | freq : 1, /* use freq, not period */ |
199 | inherit_stat : 1, /* per task counts */ | ||
200 | enable_on_exec : 1, /* next exec enables */ | ||
201 | task : 1, /* trace fork/exit */ | ||
181 | 202 | ||
182 | __reserved_1 : 53; | 203 | __reserved_1 : 50; |
183 | 204 | ||
184 | __u32 wakeup_events; /* wakeup every n events */ | 205 | __u32 wakeup_events; /* wakeup every n events */ |
185 | __u32 __reserved_2; | 206 | __u32 __reserved_2; |
@@ -232,14 +253,28 @@ struct perf_counter_mmap_page { | |||
232 | __u32 lock; /* seqlock for synchronization */ | 253 | __u32 lock; /* seqlock for synchronization */ |
233 | __u32 index; /* hardware counter identifier */ | 254 | __u32 index; /* hardware counter identifier */ |
234 | __s64 offset; /* add to hardware counter value */ | 255 | __s64 offset; /* add to hardware counter value */ |
256 | __u64 time_enabled; /* time counter active */ | ||
257 | __u64 time_running; /* time counter on cpu */ | ||
258 | |||
259 | /* | ||
260 | * Hole for extension of the self monitor capabilities | ||
261 | */ | ||
262 | |||
263 | __u64 __reserved[123]; /* align to 1k */ | ||
235 | 264 | ||
236 | /* | 265 | /* |
237 | * Control data for the mmap() data buffer. | 266 | * Control data for the mmap() data buffer. |
238 | * | 267 | * |
239 | * User-space reading this value should issue an rmb(), on SMP capable | 268 | * User-space reading the @data_head value should issue an rmb(), on |
240 | * platforms, after reading this value -- see perf_counter_wakeup(). | 269 | * SMP capable platforms, after reading this value -- see |
270 | * perf_counter_wakeup(). | ||
271 | * | ||
272 | * When the mapping is PROT_WRITE the @data_tail value should be | ||
273 | * written by userspace to reflect the last read data. In this case | ||
274 | * the kernel will not over-write unread data. | ||
241 | */ | 275 | */ |
242 | __u64 data_head; /* head in the data section */ | 276 | __u64 data_head; /* head in the data section */ |
277 | __u64 data_tail; /* user-space written tail */ | ||
243 | }; | 278 | }; |
244 | 279 | ||
245 | #define PERF_EVENT_MISC_CPUMODE_MASK (3 << 0) | 280 | #define PERF_EVENT_MISC_CPUMODE_MASK (3 << 0) |
@@ -247,7 +282,6 @@ struct perf_counter_mmap_page { | |||
247 | #define PERF_EVENT_MISC_KERNEL (1 << 0) | 282 | #define PERF_EVENT_MISC_KERNEL (1 << 0) |
248 | #define PERF_EVENT_MISC_USER (2 << 0) | 283 | #define PERF_EVENT_MISC_USER (2 << 0) |
249 | #define PERF_EVENT_MISC_HYPERVISOR (3 << 0) | 284 | #define PERF_EVENT_MISC_HYPERVISOR (3 << 0) |
250 | #define PERF_EVENT_MISC_OVERFLOW (1 << 2) | ||
251 | 285 | ||
252 | struct perf_event_header { | 286 | struct perf_event_header { |
253 | __u32 type; | 287 | __u32 type; |
@@ -275,6 +309,15 @@ enum perf_event_type { | |||
275 | 309 | ||
276 | /* | 310 | /* |
277 | * struct { | 311 | * struct { |
312 | * struct perf_event_header header; | ||
313 | * u64 id; | ||
314 | * u64 lost; | ||
315 | * }; | ||
316 | */ | ||
317 | PERF_EVENT_LOST = 2, | ||
318 | |||
319 | /* | ||
320 | * struct { | ||
278 | * struct perf_event_header header; | 321 | * struct perf_event_header header; |
279 | * | 322 | * |
280 | * u32 pid, tid; | 323 | * u32 pid, tid; |
@@ -286,18 +329,18 @@ enum perf_event_type { | |||
286 | /* | 329 | /* |
287 | * struct { | 330 | * struct { |
288 | * struct perf_event_header header; | 331 | * struct perf_event_header header; |
289 | * u64 time; | 332 | * u32 pid, ppid; |
290 | * u64 id; | 333 | * u32 tid, ptid; |
291 | * u64 sample_period; | ||
292 | * }; | 334 | * }; |
293 | */ | 335 | */ |
294 | PERF_EVENT_PERIOD = 4, | 336 | PERF_EVENT_EXIT = 4, |
295 | 337 | ||
296 | /* | 338 | /* |
297 | * struct { | 339 | * struct { |
298 | * struct perf_event_header header; | 340 | * struct perf_event_header header; |
299 | * u64 time; | 341 | * u64 time; |
300 | * u64 id; | 342 | * u64 id; |
343 | * u64 stream_id; | ||
301 | * }; | 344 | * }; |
302 | */ | 345 | */ |
303 | PERF_EVENT_THROTTLE = 5, | 346 | PERF_EVENT_THROTTLE = 5, |
@@ -307,34 +350,69 @@ enum perf_event_type { | |||
307 | * struct { | 350 | * struct { |
308 | * struct perf_event_header header; | 351 | * struct perf_event_header header; |
309 | * u32 pid, ppid; | 352 | * u32 pid, ppid; |
353 | * u32 tid, ptid; | ||
310 | * }; | 354 | * }; |
311 | */ | 355 | */ |
312 | PERF_EVENT_FORK = 7, | 356 | PERF_EVENT_FORK = 7, |
313 | 357 | ||
314 | /* | 358 | /* |
315 | * When header.misc & PERF_EVENT_MISC_OVERFLOW the event_type field | 359 | * struct { |
316 | * will be PERF_RECORD_* | 360 | * struct perf_event_header header; |
361 | * u32 pid, tid; | ||
317 | * | 362 | * |
363 | * struct read_format values; | ||
364 | * }; | ||
365 | */ | ||
366 | PERF_EVENT_READ = 8, | ||
367 | |||
368 | /* | ||
318 | * struct { | 369 | * struct { |
319 | * struct perf_event_header header; | 370 | * struct perf_event_header header; |
320 | * | 371 | * |
321 | * { u64 ip; } && PERF_RECORD_IP | 372 | * { u64 ip; } && PERF_SAMPLE_IP |
322 | * { u32 pid, tid; } && PERF_RECORD_TID | 373 | * { u32 pid, tid; } && PERF_SAMPLE_TID |
323 | * { u64 time; } && PERF_RECORD_TIME | 374 | * { u64 time; } && PERF_SAMPLE_TIME |
324 | * { u64 addr; } && PERF_RECORD_ADDR | 375 | * { u64 addr; } && PERF_SAMPLE_ADDR |
325 | * { u64 config; } && PERF_RECORD_CONFIG | 376 | * { u64 id; } && PERF_SAMPLE_ID |
326 | * { u32 cpu, res; } && PERF_RECORD_CPU | 377 | * { u64 stream_id;} && PERF_SAMPLE_STREAM_ID |
378 | * { u32 cpu, res; } && PERF_SAMPLE_CPU | ||
379 | * { u64 period; } && PERF_SAMPLE_PERIOD | ||
380 | * | ||
381 | * { struct read_format values; } && PERF_SAMPLE_READ | ||
327 | * | 382 | * |
328 | * { u64 nr; | 383 | * { u64 nr, |
329 | * { u64 id, val; } cnt[nr]; } && PERF_RECORD_GROUP | 384 | * u64 ips[nr]; } && PERF_SAMPLE_CALLCHAIN |
330 | * | 385 | * |
331 | * { u16 nr, | 386 | * # |
332 | * hv, | 387 | * # The RAW record below is opaque data wrt the ABI |
333 | * kernel, | 388 | * # |
334 | * user; | 389 | * # That is, the ABI doesn't make any promises wrt to |
335 | * u64 ips[nr]; } && PERF_RECORD_CALLCHAIN | 390 | * # the stability of its content, it may vary depending |
391 | * # on event, hardware, kernel version and phase of | ||
392 | * # the moon. | ||
393 | * # | ||
394 | * # In other words, PERF_SAMPLE_RAW contents are not an ABI. | ||
395 | * # | ||
396 | * | ||
397 | * { u32 size; | ||
398 | * char data[size];}&& PERF_SAMPLE_RAW | ||
336 | * }; | 399 | * }; |
337 | */ | 400 | */ |
401 | PERF_EVENT_SAMPLE = 9, | ||
402 | |||
403 | PERF_EVENT_MAX, /* non-ABI */ | ||
404 | }; | ||
405 | |||
406 | enum perf_callchain_context { | ||
407 | PERF_CONTEXT_HV = (__u64)-32, | ||
408 | PERF_CONTEXT_KERNEL = (__u64)-128, | ||
409 | PERF_CONTEXT_USER = (__u64)-512, | ||
410 | |||
411 | PERF_CONTEXT_GUEST = (__u64)-2048, | ||
412 | PERF_CONTEXT_GUEST_KERNEL = (__u64)-2176, | ||
413 | PERF_CONTEXT_GUEST_USER = (__u64)-2560, | ||
414 | |||
415 | PERF_CONTEXT_MAX = (__u64)-4095, | ||
338 | }; | 416 | }; |
339 | 417 | ||
340 | #ifdef __KERNEL__ | 418 | #ifdef __KERNEL__ |
@@ -356,6 +434,18 @@ enum perf_event_type { | |||
356 | #include <linux/pid_namespace.h> | 434 | #include <linux/pid_namespace.h> |
357 | #include <asm/atomic.h> | 435 | #include <asm/atomic.h> |
358 | 436 | ||
437 | #define PERF_MAX_STACK_DEPTH 255 | ||
438 | |||
439 | struct perf_callchain_entry { | ||
440 | __u64 nr; | ||
441 | __u64 ip[PERF_MAX_STACK_DEPTH]; | ||
442 | }; | ||
443 | |||
444 | struct perf_raw_record { | ||
445 | u32 size; | ||
446 | void *data; | ||
447 | }; | ||
448 | |||
359 | struct task_struct; | 449 | struct task_struct; |
360 | 450 | ||
361 | /** | 451 | /** |
@@ -414,6 +504,7 @@ struct file; | |||
414 | struct perf_mmap_data { | 504 | struct perf_mmap_data { |
415 | struct rcu_head rcu_head; | 505 | struct rcu_head rcu_head; |
416 | int nr_pages; /* nr of data pages */ | 506 | int nr_pages; /* nr of data pages */ |
507 | int writable; /* are we writable */ | ||
417 | int nr_locked; /* nr pages mlocked */ | 508 | int nr_locked; /* nr pages mlocked */ |
418 | 509 | ||
419 | atomic_t poll; /* POLL_ for wakeups */ | 510 | atomic_t poll; /* POLL_ for wakeups */ |
@@ -423,8 +514,8 @@ struct perf_mmap_data { | |||
423 | atomic_long_t done_head; /* completed head */ | 514 | atomic_long_t done_head; /* completed head */ |
424 | 515 | ||
425 | atomic_t lock; /* concurrent writes */ | 516 | atomic_t lock; /* concurrent writes */ |
426 | |||
427 | atomic_t wakeup; /* needs a wakeup */ | 517 | atomic_t wakeup; /* needs a wakeup */ |
518 | atomic_t lost; /* nr records lost */ | ||
428 | 519 | ||
429 | struct perf_counter_mmap_page *user_page; | 520 | struct perf_counter_mmap_page *user_page; |
430 | void *data_pages[0]; | 521 | void *data_pages[0]; |
@@ -550,6 +641,7 @@ struct perf_counter_context { | |||
550 | int nr_counters; | 641 | int nr_counters; |
551 | int nr_active; | 642 | int nr_active; |
552 | int is_active; | 643 | int is_active; |
644 | int nr_stat; | ||
553 | atomic_t refcount; | 645 | atomic_t refcount; |
554 | struct task_struct *task; | 646 | struct task_struct *task; |
555 | 647 | ||
@@ -604,6 +696,7 @@ extern void perf_counter_task_tick(struct task_struct *task, int cpu); | |||
604 | extern int perf_counter_init_task(struct task_struct *child); | 696 | extern int perf_counter_init_task(struct task_struct *child); |
605 | extern void perf_counter_exit_task(struct task_struct *child); | 697 | extern void perf_counter_exit_task(struct task_struct *child); |
606 | extern void perf_counter_free_task(struct task_struct *task); | 698 | extern void perf_counter_free_task(struct task_struct *task); |
699 | extern void set_perf_counter_pending(void); | ||
607 | extern void perf_counter_do_pending(void); | 700 | extern void perf_counter_do_pending(void); |
608 | extern void perf_counter_print_debug(void); | 701 | extern void perf_counter_print_debug(void); |
609 | extern void __perf_disable(void); | 702 | extern void __perf_disable(void); |
@@ -621,10 +714,13 @@ struct perf_sample_data { | |||
621 | struct pt_regs *regs; | 714 | struct pt_regs *regs; |
622 | u64 addr; | 715 | u64 addr; |
623 | u64 period; | 716 | u64 period; |
717 | struct perf_raw_record *raw; | ||
624 | }; | 718 | }; |
625 | 719 | ||
626 | extern int perf_counter_overflow(struct perf_counter *counter, int nmi, | 720 | extern int perf_counter_overflow(struct perf_counter *counter, int nmi, |
627 | struct perf_sample_data *data); | 721 | struct perf_sample_data *data); |
722 | extern void perf_counter_output(struct perf_counter *counter, int nmi, | ||
723 | struct perf_sample_data *data); | ||
628 | 724 | ||
629 | /* | 725 | /* |
630 | * Return 1 for a software counter, 0 for a hardware counter | 726 | * Return 1 for a software counter, 0 for a hardware counter |
@@ -636,7 +732,16 @@ static inline int is_software_counter(struct perf_counter *counter) | |||
636 | (counter->attr.type != PERF_TYPE_HW_CACHE); | 732 | (counter->attr.type != PERF_TYPE_HW_CACHE); |
637 | } | 733 | } |
638 | 734 | ||
639 | extern void perf_swcounter_event(u32, u64, int, struct pt_regs *, u64); | 735 | extern atomic_t perf_swcounter_enabled[PERF_COUNT_SW_MAX]; |
736 | |||
737 | extern void __perf_swcounter_event(u32, u64, int, struct pt_regs *, u64); | ||
738 | |||
739 | static inline void | ||
740 | perf_swcounter_event(u32 event, u64 nr, int nmi, struct pt_regs *regs, u64 addr) | ||
741 | { | ||
742 | if (atomic_read(&perf_swcounter_enabled[event])) | ||
743 | __perf_swcounter_event(event, nr, nmi, regs, addr); | ||
744 | } | ||
640 | 745 | ||
641 | extern void __perf_counter_mmap(struct vm_area_struct *vma); | 746 | extern void __perf_counter_mmap(struct vm_area_struct *vma); |
642 | 747 | ||
@@ -649,18 +754,6 @@ static inline void perf_counter_mmap(struct vm_area_struct *vma) | |||
649 | extern void perf_counter_comm(struct task_struct *tsk); | 754 | extern void perf_counter_comm(struct task_struct *tsk); |
650 | extern void perf_counter_fork(struct task_struct *tsk); | 755 | extern void perf_counter_fork(struct task_struct *tsk); |
651 | 756 | ||
652 | extern void perf_counter_task_migration(struct task_struct *task, int cpu); | ||
653 | |||
654 | #define MAX_STACK_DEPTH 255 | ||
655 | |||
656 | struct perf_callchain_entry { | ||
657 | u16 nr; | ||
658 | u16 hv; | ||
659 | u16 kernel; | ||
660 | u16 user; | ||
661 | u64 ip[MAX_STACK_DEPTH]; | ||
662 | }; | ||
663 | |||
664 | extern struct perf_callchain_entry *perf_callchain(struct pt_regs *regs); | 757 | extern struct perf_callchain_entry *perf_callchain(struct pt_regs *regs); |
665 | 758 | ||
666 | extern int sysctl_perf_counter_paranoid; | 759 | extern int sysctl_perf_counter_paranoid; |
@@ -701,8 +794,6 @@ static inline void perf_counter_mmap(struct vm_area_struct *vma) { } | |||
701 | static inline void perf_counter_comm(struct task_struct *tsk) { } | 794 | static inline void perf_counter_comm(struct task_struct *tsk) { } |
702 | static inline void perf_counter_fork(struct task_struct *tsk) { } | 795 | static inline void perf_counter_fork(struct task_struct *tsk) { } |
703 | static inline void perf_counter_init(void) { } | 796 | static inline void perf_counter_init(void) { } |
704 | static inline void perf_counter_task_migration(struct task_struct *task, | ||
705 | int cpu) { } | ||
706 | #endif | 797 | #endif |
707 | 798 | ||
708 | #endif /* __KERNEL__ */ | 799 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/personality.h b/include/linux/personality.h index a84e9ff9b27e..126120819a0d 100644 --- a/include/linux/personality.h +++ b/include/linux/personality.h | |||
@@ -40,7 +40,10 @@ enum { | |||
40 | * Security-relevant compatibility flags that must be | 40 | * Security-relevant compatibility flags that must be |
41 | * cleared upon setuid or setgid exec: | 41 | * cleared upon setuid or setgid exec: |
42 | */ | 42 | */ |
43 | #define PER_CLEAR_ON_SETID (READ_IMPLIES_EXEC|ADDR_NO_RANDOMIZE) | 43 | #define PER_CLEAR_ON_SETID (READ_IMPLIES_EXEC | \ |
44 | ADDR_NO_RANDOMIZE | \ | ||
45 | ADDR_COMPAT_LAYOUT | \ | ||
46 | MMAP_PAGE_ZERO) | ||
44 | 47 | ||
45 | /* | 48 | /* |
46 | * Personality types. | 49 | * Personality types. |
diff --git a/include/linux/posix_acl.h b/include/linux/posix_acl.h index 4bc241290c24..065a3652a3ea 100644 --- a/include/linux/posix_acl.h +++ b/include/linux/posix_acl.h | |||
@@ -83,4 +83,78 @@ extern int posix_acl_chmod_masq(struct posix_acl *, mode_t); | |||
83 | extern struct posix_acl *get_posix_acl(struct inode *, int); | 83 | extern struct posix_acl *get_posix_acl(struct inode *, int); |
84 | extern int set_posix_acl(struct inode *, int, struct posix_acl *); | 84 | extern int set_posix_acl(struct inode *, int, struct posix_acl *); |
85 | 85 | ||
86 | #ifdef CONFIG_FS_POSIX_ACL | ||
87 | static inline struct posix_acl *get_cached_acl(struct inode *inode, int type) | ||
88 | { | ||
89 | struct posix_acl **p, *acl; | ||
90 | switch (type) { | ||
91 | case ACL_TYPE_ACCESS: | ||
92 | p = &inode->i_acl; | ||
93 | break; | ||
94 | case ACL_TYPE_DEFAULT: | ||
95 | p = &inode->i_default_acl; | ||
96 | break; | ||
97 | default: | ||
98 | return ERR_PTR(-EINVAL); | ||
99 | } | ||
100 | acl = ACCESS_ONCE(*p); | ||
101 | if (acl) { | ||
102 | spin_lock(&inode->i_lock); | ||
103 | acl = *p; | ||
104 | if (acl != ACL_NOT_CACHED) | ||
105 | acl = posix_acl_dup(acl); | ||
106 | spin_unlock(&inode->i_lock); | ||
107 | } | ||
108 | return acl; | ||
109 | } | ||
110 | |||
111 | static inline void set_cached_acl(struct inode *inode, | ||
112 | int type, | ||
113 | struct posix_acl *acl) | ||
114 | { | ||
115 | struct posix_acl *old = NULL; | ||
116 | spin_lock(&inode->i_lock); | ||
117 | switch (type) { | ||
118 | case ACL_TYPE_ACCESS: | ||
119 | old = inode->i_acl; | ||
120 | inode->i_acl = posix_acl_dup(acl); | ||
121 | break; | ||
122 | case ACL_TYPE_DEFAULT: | ||
123 | old = inode->i_default_acl; | ||
124 | inode->i_default_acl = posix_acl_dup(acl); | ||
125 | break; | ||
126 | } | ||
127 | spin_unlock(&inode->i_lock); | ||
128 | if (old != ACL_NOT_CACHED) | ||
129 | posix_acl_release(old); | ||
130 | } | ||
131 | |||
132 | static inline void forget_cached_acl(struct inode *inode, int type) | ||
133 | { | ||
134 | struct posix_acl *old = NULL; | ||
135 | spin_lock(&inode->i_lock); | ||
136 | switch (type) { | ||
137 | case ACL_TYPE_ACCESS: | ||
138 | old = inode->i_acl; | ||
139 | inode->i_acl = ACL_NOT_CACHED; | ||
140 | break; | ||
141 | case ACL_TYPE_DEFAULT: | ||
142 | old = inode->i_default_acl; | ||
143 | inode->i_default_acl = ACL_NOT_CACHED; | ||
144 | break; | ||
145 | } | ||
146 | spin_unlock(&inode->i_lock); | ||
147 | if (old != ACL_NOT_CACHED) | ||
148 | posix_acl_release(old); | ||
149 | } | ||
150 | #endif | ||
151 | |||
152 | static inline void cache_no_acl(struct inode *inode) | ||
153 | { | ||
154 | #ifdef CONFIG_FS_POSIX_ACL | ||
155 | inode->i_acl = NULL; | ||
156 | inode->i_default_acl = NULL; | ||
157 | #endif | ||
158 | } | ||
159 | |||
86 | #endif /* __LINUX_POSIX_ACL_H */ | 160 | #endif /* __LINUX_POSIX_ACL_H */ |
diff --git a/include/linux/pps.h b/include/linux/pps.h new file mode 100644 index 000000000000..0194ab06177b --- /dev/null +++ b/include/linux/pps.h | |||
@@ -0,0 +1,124 @@ | |||
1 | /* | ||
2 | * PPS API header | ||
3 | * | ||
4 | * Copyright (C) 2005-2009 Rodolfo Giometti <giometti@linux.it> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
19 | */ | ||
20 | |||
21 | |||
22 | #ifndef _PPS_H_ | ||
23 | #define _PPS_H_ | ||
24 | |||
25 | #include <linux/types.h> | ||
26 | |||
27 | #define PPS_VERSION "5.3.6" | ||
28 | #define PPS_MAX_SOURCES 16 /* should be enough... */ | ||
29 | |||
30 | /* Implementation note: the logical states ``assert'' and ``clear'' | ||
31 | * are implemented in terms of the chip register, i.e. ``assert'' | ||
32 | * means the bit is set. */ | ||
33 | |||
34 | /* | ||
35 | * 3.2 New data structures | ||
36 | */ | ||
37 | |||
38 | #define PPS_API_VERS_1 1 | ||
39 | #define PPS_API_VERS PPS_API_VERS_1 /* we use API version 1 */ | ||
40 | #define PPS_MAX_NAME_LEN 32 | ||
41 | |||
42 | /* 32-bit vs. 64-bit compatibility. | ||
43 | * | ||
44 | * 0n i386, the alignment of a uint64_t is only 4 bytes, while on most other | ||
45 | * architectures it's 8 bytes. On i386, there will be no padding between the | ||
46 | * two consecutive 'struct pps_ktime' members of struct pps_kinfo and struct | ||
47 | * pps_kparams. But on most platforms there will be padding to ensure correct | ||
48 | * alignment. | ||
49 | * | ||
50 | * The simple fix is probably to add an explicit padding. | ||
51 | * [David Woodhouse] | ||
52 | */ | ||
53 | struct pps_ktime { | ||
54 | __s64 sec; | ||
55 | __s32 nsec; | ||
56 | __u32 flags; | ||
57 | }; | ||
58 | #define PPS_TIME_INVALID (1<<0) /* used to specify timeout==NULL */ | ||
59 | |||
60 | struct pps_kinfo { | ||
61 | __u32 assert_sequence; /* seq. num. of assert event */ | ||
62 | __u32 clear_sequence; /* seq. num. of clear event */ | ||
63 | struct pps_ktime assert_tu; /* time of assert event */ | ||
64 | struct pps_ktime clear_tu; /* time of clear event */ | ||
65 | int current_mode; /* current mode bits */ | ||
66 | }; | ||
67 | |||
68 | struct pps_kparams { | ||
69 | int api_version; /* API version # */ | ||
70 | int mode; /* mode bits */ | ||
71 | struct pps_ktime assert_off_tu; /* offset compensation for assert */ | ||
72 | struct pps_ktime clear_off_tu; /* offset compensation for clear */ | ||
73 | }; | ||
74 | |||
75 | /* | ||
76 | * 3.3 Mode bit definitions | ||
77 | */ | ||
78 | |||
79 | /* Device/implementation parameters */ | ||
80 | #define PPS_CAPTUREASSERT 0x01 /* capture assert events */ | ||
81 | #define PPS_CAPTURECLEAR 0x02 /* capture clear events */ | ||
82 | #define PPS_CAPTUREBOTH 0x03 /* capture assert and clear events */ | ||
83 | |||
84 | #define PPS_OFFSETASSERT 0x10 /* apply compensation for assert ev. */ | ||
85 | #define PPS_OFFSETCLEAR 0x20 /* apply compensation for clear ev. */ | ||
86 | |||
87 | #define PPS_CANWAIT 0x100 /* can we wait for an event? */ | ||
88 | #define PPS_CANPOLL 0x200 /* bit reserved for future use */ | ||
89 | |||
90 | /* Kernel actions */ | ||
91 | #define PPS_ECHOASSERT 0x40 /* feed back assert event to output */ | ||
92 | #define PPS_ECHOCLEAR 0x80 /* feed back clear event to output */ | ||
93 | |||
94 | /* Timestamp formats */ | ||
95 | #define PPS_TSFMT_TSPEC 0x1000 /* select timespec format */ | ||
96 | #define PPS_TSFMT_NTPFP 0x2000 /* select NTP format */ | ||
97 | |||
98 | /* | ||
99 | * 3.4.4 New functions: disciplining the kernel timebase | ||
100 | */ | ||
101 | |||
102 | /* Kernel consumers */ | ||
103 | #define PPS_KC_HARDPPS 0 /* hardpps() (or equivalent) */ | ||
104 | #define PPS_KC_HARDPPS_PLL 1 /* hardpps() constrained to | ||
105 | use a phase-locked loop */ | ||
106 | #define PPS_KC_HARDPPS_FLL 2 /* hardpps() constrained to | ||
107 | use a frequency-locked loop */ | ||
108 | /* | ||
109 | * Here begins the implementation-specific part! | ||
110 | */ | ||
111 | |||
112 | struct pps_fdata { | ||
113 | struct pps_kinfo info; | ||
114 | struct pps_ktime timeout; | ||
115 | }; | ||
116 | |||
117 | #include <linux/ioctl.h> | ||
118 | |||
119 | #define PPS_GETPARAMS _IOR('p', 0xa1, struct pps_kparams *) | ||
120 | #define PPS_SETPARAMS _IOW('p', 0xa2, struct pps_kparams *) | ||
121 | #define PPS_GETCAP _IOR('p', 0xa3, int *) | ||
122 | #define PPS_FETCH _IOWR('p', 0xa4, struct pps_fdata *) | ||
123 | |||
124 | #endif /* _PPS_H_ */ | ||
diff --git a/include/linux/pps_kernel.h b/include/linux/pps_kernel.h new file mode 100644 index 000000000000..e0a193f830ef --- /dev/null +++ b/include/linux/pps_kernel.h | |||
@@ -0,0 +1,89 @@ | |||
1 | /* | ||
2 | * PPS API kernel header | ||
3 | * | ||
4 | * Copyright (C) 2009 Rodolfo Giometti <giometti@linux.it> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
19 | */ | ||
20 | |||
21 | #include <linux/pps.h> | ||
22 | |||
23 | #include <linux/cdev.h> | ||
24 | #include <linux/device.h> | ||
25 | #include <linux/time.h> | ||
26 | |||
27 | /* | ||
28 | * Global defines | ||
29 | */ | ||
30 | |||
31 | /* The specific PPS source info */ | ||
32 | struct pps_source_info { | ||
33 | char name[PPS_MAX_NAME_LEN]; /* simbolic name */ | ||
34 | char path[PPS_MAX_NAME_LEN]; /* path of connected device */ | ||
35 | int mode; /* PPS's allowed mode */ | ||
36 | |||
37 | void (*echo)(int source, int event, void *data); /* PPS echo function */ | ||
38 | |||
39 | struct module *owner; | ||
40 | struct device *dev; | ||
41 | }; | ||
42 | |||
43 | /* The main struct */ | ||
44 | struct pps_device { | ||
45 | struct pps_source_info info; /* PSS source info */ | ||
46 | |||
47 | struct pps_kparams params; /* PPS's current params */ | ||
48 | |||
49 | __u32 assert_sequence; /* PPS' assert event seq # */ | ||
50 | __u32 clear_sequence; /* PPS' clear event seq # */ | ||
51 | struct pps_ktime assert_tu; | ||
52 | struct pps_ktime clear_tu; | ||
53 | int current_mode; /* PPS mode at event time */ | ||
54 | |||
55 | int go; /* PPS event is arrived? */ | ||
56 | wait_queue_head_t queue; /* PPS event queue */ | ||
57 | |||
58 | unsigned int id; /* PPS source unique ID */ | ||
59 | struct cdev cdev; | ||
60 | struct device *dev; | ||
61 | int devno; | ||
62 | struct fasync_struct *async_queue; /* fasync method */ | ||
63 | spinlock_t lock; | ||
64 | |||
65 | atomic_t usage; /* usage count */ | ||
66 | }; | ||
67 | |||
68 | /* | ||
69 | * Global variables | ||
70 | */ | ||
71 | |||
72 | extern spinlock_t pps_idr_lock; | ||
73 | extern struct idr pps_idr; | ||
74 | extern struct timespec pps_irq_ts[]; | ||
75 | |||
76 | extern struct device_attribute pps_attrs[]; | ||
77 | |||
78 | /* | ||
79 | * Exported functions | ||
80 | */ | ||
81 | |||
82 | struct pps_device *pps_get_source(int source); | ||
83 | extern void pps_put_source(struct pps_device *pps); | ||
84 | extern int pps_register_source(struct pps_source_info *info, | ||
85 | int default_params); | ||
86 | extern void pps_unregister_source(int source); | ||
87 | extern int pps_register_cdev(struct pps_device *pps); | ||
88 | extern void pps_unregister_cdev(struct pps_device *pps); | ||
89 | extern void pps_event(int source, struct pps_ktime *ts, int event, void *data); | ||
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index 59e133d39d50..7456d7d87a19 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h | |||
@@ -81,7 +81,6 @@ | |||
81 | 81 | ||
82 | 82 | ||
83 | extern long arch_ptrace(struct task_struct *child, long request, long addr, long data); | 83 | extern long arch_ptrace(struct task_struct *child, long request, long addr, long data); |
84 | extern struct task_struct *ptrace_get_task_struct(pid_t pid); | ||
85 | extern int ptrace_traceme(void); | 84 | extern int ptrace_traceme(void); |
86 | extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len); | 85 | extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len); |
87 | extern int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len); | 86 | extern int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len); |
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h index 7bc457593684..26361c4c037a 100644 --- a/include/linux/quotaops.h +++ b/include/linux/quotaops.h | |||
@@ -7,7 +7,6 @@ | |||
7 | #ifndef _LINUX_QUOTAOPS_ | 7 | #ifndef _LINUX_QUOTAOPS_ |
8 | #define _LINUX_QUOTAOPS_ | 8 | #define _LINUX_QUOTAOPS_ |
9 | 9 | ||
10 | #include <linux/smp_lock.h> | ||
11 | #include <linux/fs.h> | 10 | #include <linux/fs.h> |
12 | 11 | ||
13 | static inline struct quota_info *sb_dqopt(struct super_block *sb) | 12 | static inline struct quota_info *sb_dqopt(struct super_block *sb) |
diff --git a/include/linux/raid/md_p.h b/include/linux/raid/md_p.h index 6ba830fa8538..ffa2efbbe382 100644 --- a/include/linux/raid/md_p.h +++ b/include/linux/raid/md_p.h | |||
@@ -232,7 +232,7 @@ struct mdp_superblock_1 { | |||
232 | __le64 reshape_position; /* next address in array-space for reshape */ | 232 | __le64 reshape_position; /* next address in array-space for reshape */ |
233 | __le32 delta_disks; /* change in number of raid_disks */ | 233 | __le32 delta_disks; /* change in number of raid_disks */ |
234 | __le32 new_layout; /* new layout */ | 234 | __le32 new_layout; /* new layout */ |
235 | __le32 new_chunk; /* new chunk size (bytes) */ | 235 | __le32 new_chunk; /* new chunk size (512byte sectors) */ |
236 | __u8 pad1[128-124]; /* set to 0 when written */ | 236 | __u8 pad1[128-124]; /* set to 0 when written */ |
237 | 237 | ||
238 | /* constant this-device information - 64 bytes */ | 238 | /* constant this-device information - 64 bytes */ |
diff --git a/include/linux/reiserfs_acl.h b/include/linux/reiserfs_acl.h index 8cc65757e47a..b4448853900e 100644 --- a/include/linux/reiserfs_acl.h +++ b/include/linux/reiserfs_acl.h | |||
@@ -56,15 +56,6 @@ int reiserfs_cache_default_acl(struct inode *dir); | |||
56 | extern struct xattr_handler reiserfs_posix_acl_default_handler; | 56 | extern struct xattr_handler reiserfs_posix_acl_default_handler; |
57 | extern struct xattr_handler reiserfs_posix_acl_access_handler; | 57 | extern struct xattr_handler reiserfs_posix_acl_access_handler; |
58 | 58 | ||
59 | static inline void reiserfs_init_acl_access(struct inode *inode) | ||
60 | { | ||
61 | REISERFS_I(inode)->i_acl_access = NULL; | ||
62 | } | ||
63 | |||
64 | static inline void reiserfs_init_acl_default(struct inode *inode) | ||
65 | { | ||
66 | REISERFS_I(inode)->i_acl_default = NULL; | ||
67 | } | ||
68 | #else | 59 | #else |
69 | 60 | ||
70 | #define reiserfs_cache_default_acl(inode) 0 | 61 | #define reiserfs_cache_default_acl(inode) 0 |
@@ -86,12 +77,4 @@ reiserfs_inherit_default_acl(struct reiserfs_transaction_handle *th, | |||
86 | { | 77 | { |
87 | return 0; | 78 | return 0; |
88 | } | 79 | } |
89 | |||
90 | static inline void reiserfs_init_acl_access(struct inode *inode) | ||
91 | { | ||
92 | } | ||
93 | |||
94 | static inline void reiserfs_init_acl_default(struct inode *inode) | ||
95 | { | ||
96 | } | ||
97 | #endif | 80 | #endif |
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index 2245c78d5876..dd31e7bae35c 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h | |||
@@ -660,23 +660,54 @@ static inline void set_le_key_k_type(int version, struct reiserfs_key *key, | |||
660 | cpu_to_le32(type2uniqueness(type))) | 660 | cpu_to_le32(type2uniqueness(type))) |
661 | : (void)(set_offset_v2_k_type(&(key->u.k_offset_v2), type)); | 661 | : (void)(set_offset_v2_k_type(&(key->u.k_offset_v2), type)); |
662 | } | 662 | } |
663 | |||
663 | static inline void set_le_ih_k_type(struct item_head *ih, int type) | 664 | static inline void set_le_ih_k_type(struct item_head *ih, int type) |
664 | { | 665 | { |
665 | set_le_key_k_type(ih_version(ih), &(ih->ih_key), type); | 666 | set_le_key_k_type(ih_version(ih), &(ih->ih_key), type); |
666 | } | 667 | } |
667 | 668 | ||
668 | #define is_direntry_le_key(version,key) (le_key_k_type (version, key) == TYPE_DIRENTRY) | 669 | static inline int is_direntry_le_key(int version, struct reiserfs_key *key) |
669 | #define is_direct_le_key(version,key) (le_key_k_type (version, key) == TYPE_DIRECT) | 670 | { |
670 | #define is_indirect_le_key(version,key) (le_key_k_type (version, key) == TYPE_INDIRECT) | 671 | return le_key_k_type(version, key) == TYPE_DIRENTRY; |
671 | #define is_statdata_le_key(version,key) (le_key_k_type (version, key) == TYPE_STAT_DATA) | 672 | } |
673 | |||
674 | static inline int is_direct_le_key(int version, struct reiserfs_key *key) | ||
675 | { | ||
676 | return le_key_k_type(version, key) == TYPE_DIRECT; | ||
677 | } | ||
678 | |||
679 | static inline int is_indirect_le_key(int version, struct reiserfs_key *key) | ||
680 | { | ||
681 | return le_key_k_type(version, key) == TYPE_INDIRECT; | ||
682 | } | ||
683 | |||
684 | static inline int is_statdata_le_key(int version, struct reiserfs_key *key) | ||
685 | { | ||
686 | return le_key_k_type(version, key) == TYPE_STAT_DATA; | ||
687 | } | ||
672 | 688 | ||
673 | // | 689 | // |
674 | // item header has version. | 690 | // item header has version. |
675 | // | 691 | // |
676 | #define is_direntry_le_ih(ih) is_direntry_le_key (ih_version (ih), &((ih)->ih_key)) | 692 | static inline int is_direntry_le_ih(struct item_head *ih) |
677 | #define is_direct_le_ih(ih) is_direct_le_key (ih_version (ih), &((ih)->ih_key)) | 693 | { |
678 | #define is_indirect_le_ih(ih) is_indirect_le_key (ih_version(ih), &((ih)->ih_key)) | 694 | return is_direntry_le_key(ih_version(ih), &ih->ih_key); |
679 | #define is_statdata_le_ih(ih) is_statdata_le_key (ih_version (ih), &((ih)->ih_key)) | 695 | } |
696 | |||
697 | static inline int is_direct_le_ih(struct item_head *ih) | ||
698 | { | ||
699 | return is_direct_le_key(ih_version(ih), &ih->ih_key); | ||
700 | } | ||
701 | |||
702 | static inline int is_indirect_le_ih(struct item_head *ih) | ||
703 | { | ||
704 | return is_indirect_le_key(ih_version(ih), &ih->ih_key); | ||
705 | } | ||
706 | |||
707 | static inline int is_statdata_le_ih(struct item_head *ih) | ||
708 | { | ||
709 | return is_statdata_le_key(ih_version(ih), &ih->ih_key); | ||
710 | } | ||
680 | 711 | ||
681 | // | 712 | // |
682 | // key is pointer to cpu key, result is cpu | 713 | // key is pointer to cpu key, result is cpu |
diff --git a/include/linux/reiserfs_fs_i.h b/include/linux/reiserfs_fs_i.h index 76360b36ac33..89f4d3abbf5a 100644 --- a/include/linux/reiserfs_fs_i.h +++ b/include/linux/reiserfs_fs_i.h | |||
@@ -54,10 +54,6 @@ struct reiserfs_inode_info { | |||
54 | unsigned int i_trans_id; | 54 | unsigned int i_trans_id; |
55 | struct reiserfs_journal_list *i_jl; | 55 | struct reiserfs_journal_list *i_jl; |
56 | struct mutex i_mmap; | 56 | struct mutex i_mmap; |
57 | #ifdef CONFIG_REISERFS_FS_POSIX_ACL | ||
58 | struct posix_acl *i_acl_access; | ||
59 | struct posix_acl *i_acl_default; | ||
60 | #endif | ||
61 | #ifdef CONFIG_REISERFS_FS_XATTR | 57 | #ifdef CONFIG_REISERFS_FS_XATTR |
62 | struct rw_semaphore i_xattr_sem; | 58 | struct rw_semaphore i_xattr_sem; |
63 | #endif | 59 | #endif |
diff --git a/include/linux/res_counter.h b/include/linux/res_counter.h index 4c5bcf6ca7e8..511f42fc6816 100644 --- a/include/linux/res_counter.h +++ b/include/linux/res_counter.h | |||
@@ -49,6 +49,8 @@ struct res_counter { | |||
49 | struct res_counter *parent; | 49 | struct res_counter *parent; |
50 | }; | 50 | }; |
51 | 51 | ||
52 | #define RESOURCE_MAX (unsigned long long)LLONG_MAX | ||
53 | |||
52 | /** | 54 | /** |
53 | * Helpers to interact with userspace | 55 | * Helpers to interact with userspace |
54 | * res_counter_read_u64() - returns the value of the specified member. | 56 | * res_counter_read_u64() - returns the value of the specified member. |
diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h index 16e39c7a67fc..278777fa8a3a 100644 --- a/include/linux/rfkill.h +++ b/include/linux/rfkill.h | |||
@@ -99,7 +99,6 @@ enum rfkill_user_states { | |||
99 | #undef RFKILL_STATE_UNBLOCKED | 99 | #undef RFKILL_STATE_UNBLOCKED |
100 | #undef RFKILL_STATE_HARD_BLOCKED | 100 | #undef RFKILL_STATE_HARD_BLOCKED |
101 | 101 | ||
102 | #include <linux/types.h> | ||
103 | #include <linux/kernel.h> | 102 | #include <linux/kernel.h> |
104 | #include <linux/list.h> | 103 | #include <linux/list.h> |
105 | #include <linux/mutex.h> | 104 | #include <linux/mutex.h> |
@@ -160,8 +159,9 @@ struct rfkill * __must_check rfkill_alloc(const char *name, | |||
160 | * the rfkill structure. Before calling this function the driver needs | 159 | * the rfkill structure. Before calling this function the driver needs |
161 | * to be ready to service method calls from rfkill. | 160 | * to be ready to service method calls from rfkill. |
162 | * | 161 | * |
163 | * If the software blocked state is not set before registration, | 162 | * If rfkill_init_sw_state() is not called before registration, |
164 | * set_block will be called to initialize it to a default value. | 163 | * set_block() will be called to initialize the software blocked state |
164 | * to a default value. | ||
165 | * | 165 | * |
166 | * If the hardware blocked state is not set before registration, | 166 | * If the hardware blocked state is not set before registration, |
167 | * it is assumed to be unblocked. | 167 | * it is assumed to be unblocked. |
@@ -224,7 +224,7 @@ void rfkill_destroy(struct rfkill *rfkill); | |||
224 | * should be blocked) so that drivers need not keep track of the soft | 224 | * should be blocked) so that drivers need not keep track of the soft |
225 | * block state -- which they might not be able to. | 225 | * block state -- which they might not be able to. |
226 | */ | 226 | */ |
227 | bool __must_check rfkill_set_hw_state(struct rfkill *rfkill, bool blocked); | 227 | bool rfkill_set_hw_state(struct rfkill *rfkill, bool blocked); |
228 | 228 | ||
229 | /** | 229 | /** |
230 | * rfkill_set_sw_state - Set the internal rfkill software block state | 230 | * rfkill_set_sw_state - Set the internal rfkill software block state |
@@ -234,9 +234,11 @@ bool __must_check rfkill_set_hw_state(struct rfkill *rfkill, bool blocked); | |||
234 | * rfkill drivers that get events when the soft-blocked state changes | 234 | * rfkill drivers that get events when the soft-blocked state changes |
235 | * (yes, some platforms directly act on input but allow changing again) | 235 | * (yes, some platforms directly act on input but allow changing again) |
236 | * use this function to notify the rfkill core (and through that also | 236 | * use this function to notify the rfkill core (and through that also |
237 | * userspace) of the current state. It is not necessary to notify on | 237 | * userspace) of the current state. |
238 | * resume; since hibernation can always change the soft-blocked state, | 238 | * |
239 | * the rfkill core will unconditionally restore the previous state. | 239 | * Drivers should also call this function after resume if the state has |
240 | * been changed by the user. This only makes sense for "persistent" | ||
241 | * devices (see rfkill_init_sw_state()). | ||
240 | * | 242 | * |
241 | * This function can be called in any context, even from within rfkill | 243 | * This function can be called in any context, even from within rfkill |
242 | * callbacks. | 244 | * callbacks. |
@@ -247,6 +249,22 @@ bool __must_check rfkill_set_hw_state(struct rfkill *rfkill, bool blocked); | |||
247 | bool rfkill_set_sw_state(struct rfkill *rfkill, bool blocked); | 249 | bool rfkill_set_sw_state(struct rfkill *rfkill, bool blocked); |
248 | 250 | ||
249 | /** | 251 | /** |
252 | * rfkill_init_sw_state - Initialize persistent software block state | ||
253 | * @rfkill: pointer to the rfkill class to modify. | ||
254 | * @state: the current software block state to set | ||
255 | * | ||
256 | * rfkill drivers that preserve their software block state over power off | ||
257 | * use this function to notify the rfkill core (and through that also | ||
258 | * userspace) of their initial state. It should only be used before | ||
259 | * registration. | ||
260 | * | ||
261 | * In addition, it marks the device as "persistent", an attribute which | ||
262 | * can be read by userspace. Persistent devices are expected to preserve | ||
263 | * their own state when suspended. | ||
264 | */ | ||
265 | void rfkill_init_sw_state(struct rfkill *rfkill, bool blocked); | ||
266 | |||
267 | /** | ||
250 | * rfkill_set_states - Set the internal rfkill block states | 268 | * rfkill_set_states - Set the internal rfkill block states |
251 | * @rfkill: pointer to the rfkill class to modify. | 269 | * @rfkill: pointer to the rfkill class to modify. |
252 | * @sw: the current software block state to set | 270 | * @sw: the current software block state to set |
@@ -307,6 +325,10 @@ static inline bool rfkill_set_sw_state(struct rfkill *rfkill, bool blocked) | |||
307 | return blocked; | 325 | return blocked; |
308 | } | 326 | } |
309 | 327 | ||
328 | static inline void rfkill_init_sw_state(struct rfkill *rfkill, bool blocked) | ||
329 | { | ||
330 | } | ||
331 | |||
310 | static inline void rfkill_set_states(struct rfkill *rfkill, bool sw, bool hw) | 332 | static inline void rfkill_set_states(struct rfkill *rfkill, bool sw, bool hw) |
311 | { | 333 | { |
312 | } | 334 | } |
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index 216d024f830d..bf116d0dbf23 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
@@ -118,7 +118,14 @@ int try_to_munlock(struct page *); | |||
118 | #define anon_vma_prepare(vma) (0) | 118 | #define anon_vma_prepare(vma) (0) |
119 | #define anon_vma_link(vma) do {} while (0) | 119 | #define anon_vma_link(vma) do {} while (0) |
120 | 120 | ||
121 | #define page_referenced(page, locked, cnt, flags) TestClearPageReferenced(page) | 121 | static inline int page_referenced(struct page *page, int is_locked, |
122 | struct mem_cgroup *cnt, | ||
123 | unsigned long *vm_flags) | ||
124 | { | ||
125 | *vm_flags = 0; | ||
126 | return TestClearPageReferenced(page); | ||
127 | } | ||
128 | |||
122 | #define try_to_unmap(page, refs) SWAP_FAIL | 129 | #define try_to_unmap(page, refs) SWAP_FAIL |
123 | 130 | ||
124 | static inline int page_mkclean(struct page *page) | 131 | static inline int page_mkclean(struct page *page) |
diff --git a/include/linux/rotary_encoder.h b/include/linux/rotary_encoder.h index 12d63a30c347..215278b8df2a 100644 --- a/include/linux/rotary_encoder.h +++ b/include/linux/rotary_encoder.h | |||
@@ -8,6 +8,8 @@ struct rotary_encoder_platform_data { | |||
8 | unsigned int gpio_b; | 8 | unsigned int gpio_b; |
9 | unsigned int inverted_a; | 9 | unsigned int inverted_a; |
10 | unsigned int inverted_b; | 10 | unsigned int inverted_b; |
11 | bool relative_axis; | ||
12 | bool rollover; | ||
11 | }; | 13 | }; |
12 | 14 | ||
13 | #endif /* __ROTARY_ENCODER_H__ */ | 15 | #endif /* __ROTARY_ENCODER_H__ */ |
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h index e5996984ddd0..9aaf5bfdad1a 100644 --- a/include/linux/scatterlist.h +++ b/include/linux/scatterlist.h | |||
@@ -242,6 +242,8 @@ size_t sg_copy_to_buffer(struct scatterlist *sgl, unsigned int nents, | |||
242 | */ | 242 | */ |
243 | 243 | ||
244 | #define SG_MITER_ATOMIC (1 << 0) /* use kmap_atomic */ | 244 | #define SG_MITER_ATOMIC (1 << 0) /* use kmap_atomic */ |
245 | #define SG_MITER_TO_SG (1 << 1) /* flush back to phys on unmap */ | ||
246 | #define SG_MITER_FROM_SG (1 << 2) /* nop */ | ||
245 | 247 | ||
246 | struct sg_mapping_iter { | 248 | struct sg_mapping_iter { |
247 | /* the following three fields can be accessed directly */ | 249 | /* the following three fields can be accessed directly */ |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 02042e7f2196..9304027673b0 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -92,7 +92,6 @@ struct sched_param { | |||
92 | 92 | ||
93 | #include <asm/processor.h> | 93 | #include <asm/processor.h> |
94 | 94 | ||
95 | struct mem_cgroup; | ||
96 | struct exec_domain; | 95 | struct exec_domain; |
97 | struct futex_pi_state; | 96 | struct futex_pi_state; |
98 | struct robust_list_head; | 97 | struct robust_list_head; |
@@ -210,7 +209,7 @@ extern unsigned long long time_sync_thresh; | |||
210 | ((task->state & (__TASK_STOPPED | __TASK_TRACED)) != 0) | 209 | ((task->state & (__TASK_STOPPED | __TASK_TRACED)) != 0) |
211 | #define task_contributes_to_load(task) \ | 210 | #define task_contributes_to_load(task) \ |
212 | ((task->state & TASK_UNINTERRUPTIBLE) != 0 && \ | 211 | ((task->state & TASK_UNINTERRUPTIBLE) != 0 && \ |
213 | (task->flags & PF_FROZEN) == 0) | 212 | (task->flags & PF_FREEZING) == 0) |
214 | 213 | ||
215 | #define __set_task_state(tsk, state_value) \ | 214 | #define __set_task_state(tsk, state_value) \ |
216 | do { (tsk)->state = (state_value); } while (0) | 215 | do { (tsk)->state = (state_value); } while (0) |
@@ -350,8 +349,20 @@ extern int mutex_spin_on_owner(struct mutex *lock, struct thread_info *owner); | |||
350 | struct nsproxy; | 349 | struct nsproxy; |
351 | struct user_namespace; | 350 | struct user_namespace; |
352 | 351 | ||
353 | /* Maximum number of active map areas.. This is a random (large) number */ | 352 | /* |
354 | #define DEFAULT_MAX_MAP_COUNT 65536 | 353 | * Default maximum number of active map areas, this limits the number of vmas |
354 | * per mm struct. Users can overwrite this number by sysctl but there is a | ||
355 | * problem. | ||
356 | * | ||
357 | * When a program's coredump is generated as ELF format, a section is created | ||
358 | * per a vma. In ELF, the number of sections is represented in unsigned short. | ||
359 | * This means the number of sections should be smaller than 65535 at coredump. | ||
360 | * Because the kernel adds some informative sections to a image of program at | ||
361 | * generating coredump, we need some margin. The number of extra sections is | ||
362 | * 1-3 now and depends on arch. We use "5" as safe margin, here. | ||
363 | */ | ||
364 | #define MAPCOUNT_ELF_CORE_MARGIN (5) | ||
365 | #define DEFAULT_MAX_MAP_COUNT (USHORT_MAX - MAPCOUNT_ELF_CORE_MARGIN) | ||
355 | 366 | ||
356 | extern int sysctl_max_map_count; | 367 | extern int sysctl_max_map_count; |
357 | 368 | ||
@@ -487,6 +498,15 @@ struct task_cputime { | |||
487 | .sum_exec_runtime = 0, \ | 498 | .sum_exec_runtime = 0, \ |
488 | } | 499 | } |
489 | 500 | ||
501 | /* | ||
502 | * Disable preemption until the scheduler is running. | ||
503 | * Reset by start_kernel()->sched_init()->init_idle(). | ||
504 | * | ||
505 | * We include PREEMPT_ACTIVE to avoid cond_resched() from working | ||
506 | * before the scheduler is active -- see should_resched(). | ||
507 | */ | ||
508 | #define INIT_PREEMPT_COUNT (1 + PREEMPT_ACTIVE) | ||
509 | |||
490 | /** | 510 | /** |
491 | * struct thread_group_cputimer - thread group interval timer counts | 511 | * struct thread_group_cputimer - thread group interval timer counts |
492 | * @cputime: thread group interval timers. | 512 | * @cputime: thread group interval timers. |
@@ -1178,6 +1198,7 @@ struct task_struct { | |||
1178 | * a short time | 1198 | * a short time |
1179 | */ | 1199 | */ |
1180 | unsigned char fpu_counter; | 1200 | unsigned char fpu_counter; |
1201 | s8 oomkilladj; /* OOM kill score adjustment (bit shift). */ | ||
1181 | #ifdef CONFIG_BLK_DEV_IO_TRACE | 1202 | #ifdef CONFIG_BLK_DEV_IO_TRACE |
1182 | unsigned int btrace_seq; | 1203 | unsigned int btrace_seq; |
1183 | #endif | 1204 | #endif |
@@ -1271,6 +1292,7 @@ struct task_struct { | |||
1271 | struct mutex cred_guard_mutex; /* guard against foreign influences on | 1292 | struct mutex cred_guard_mutex; /* guard against foreign influences on |
1272 | * credential calculations | 1293 | * credential calculations |
1273 | * (notably. ptrace) */ | 1294 | * (notably. ptrace) */ |
1295 | struct cred *replacement_session_keyring; /* for KEYCTL_SESSION_TO_PARENT */ | ||
1274 | 1296 | ||
1275 | char comm[TASK_COMM_LEN]; /* executable name excluding path | 1297 | char comm[TASK_COMM_LEN]; /* executable name excluding path |
1276 | - access with [gs]et_task_comm (which lock | 1298 | - access with [gs]et_task_comm (which lock |
@@ -1660,6 +1682,7 @@ extern cputime_t task_gtime(struct task_struct *p); | |||
1660 | #define PF_MEMALLOC 0x00000800 /* Allocating memory */ | 1682 | #define PF_MEMALLOC 0x00000800 /* Allocating memory */ |
1661 | #define PF_FLUSHER 0x00001000 /* responsible for disk writeback */ | 1683 | #define PF_FLUSHER 0x00001000 /* responsible for disk writeback */ |
1662 | #define PF_USED_MATH 0x00002000 /* if unset the fpu must be initialized before use */ | 1684 | #define PF_USED_MATH 0x00002000 /* if unset the fpu must be initialized before use */ |
1685 | #define PF_FREEZING 0x00004000 /* freeze in progress. do not account to load */ | ||
1663 | #define PF_NOFREEZE 0x00008000 /* this thread should not be frozen */ | 1686 | #define PF_NOFREEZE 0x00008000 /* this thread should not be frozen */ |
1664 | #define PF_FROZEN 0x00010000 /* frozen for system suspend */ | 1687 | #define PF_FROZEN 0x00010000 /* frozen for system suspend */ |
1665 | #define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */ | 1688 | #define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */ |
@@ -1879,9 +1902,6 @@ extern struct pid_namespace init_pid_ns; | |||
1879 | /* | 1902 | /* |
1880 | * find a task by one of its numerical ids | 1903 | * find a task by one of its numerical ids |
1881 | * | 1904 | * |
1882 | * find_task_by_pid_type_ns(): | ||
1883 | * it is the most generic call - it finds a task by all id, | ||
1884 | * type and namespace specified | ||
1885 | * find_task_by_pid_ns(): | 1905 | * find_task_by_pid_ns(): |
1886 | * finds a task by its pid in the specified namespace | 1906 | * finds a task by its pid in the specified namespace |
1887 | * find_task_by_vpid(): | 1907 | * find_task_by_vpid(): |
@@ -1890,9 +1910,6 @@ extern struct pid_namespace init_pid_ns; | |||
1890 | * see also find_vpid() etc in include/linux/pid.h | 1910 | * see also find_vpid() etc in include/linux/pid.h |
1891 | */ | 1911 | */ |
1892 | 1912 | ||
1893 | extern struct task_struct *find_task_by_pid_type_ns(int type, int pid, | ||
1894 | struct pid_namespace *ns); | ||
1895 | |||
1896 | extern struct task_struct *find_task_by_vpid(pid_t nr); | 1913 | extern struct task_struct *find_task_by_vpid(pid_t nr); |
1897 | extern struct task_struct *find_task_by_pid_ns(pid_t nr, | 1914 | extern struct task_struct *find_task_by_pid_ns(pid_t nr, |
1898 | struct pid_namespace *ns); | 1915 | struct pid_namespace *ns); |
@@ -2061,7 +2078,7 @@ static inline unsigned long wait_task_inactive(struct task_struct *p, | |||
2061 | #define for_each_process(p) \ | 2078 | #define for_each_process(p) \ |
2062 | for (p = &init_task ; (p = next_task(p)) != &init_task ; ) | 2079 | for (p = &init_task ; (p = next_task(p)) != &init_task ; ) |
2063 | 2080 | ||
2064 | extern bool is_single_threaded(struct task_struct *); | 2081 | extern bool current_is_single_threaded(void); |
2065 | 2082 | ||
2066 | /* | 2083 | /* |
2067 | * Careful: do_each_thread/while_each_thread is a double loop so | 2084 | * Careful: do_each_thread/while_each_thread is a double loop so |
diff --git a/include/linux/security.h b/include/linux/security.h index 5eff459b3833..d050b66ab9ef 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/resource.h> | 28 | #include <linux/resource.h> |
29 | #include <linux/sem.h> | 29 | #include <linux/sem.h> |
30 | #include <linux/shm.h> | 30 | #include <linux/shm.h> |
31 | #include <linux/mm.h> /* PAGE_ALIGN */ | ||
31 | #include <linux/msg.h> | 32 | #include <linux/msg.h> |
32 | #include <linux/sched.h> | 33 | #include <linux/sched.h> |
33 | #include <linux/key.h> | 34 | #include <linux/key.h> |
@@ -52,7 +53,7 @@ struct audit_krule; | |||
52 | extern int cap_capable(struct task_struct *tsk, const struct cred *cred, | 53 | extern int cap_capable(struct task_struct *tsk, const struct cred *cred, |
53 | int cap, int audit); | 54 | int cap, int audit); |
54 | extern int cap_settime(struct timespec *ts, struct timezone *tz); | 55 | extern int cap_settime(struct timespec *ts, struct timezone *tz); |
55 | extern int cap_ptrace_may_access(struct task_struct *child, unsigned int mode); | 56 | extern int cap_ptrace_access_check(struct task_struct *child, unsigned int mode); |
56 | extern int cap_ptrace_traceme(struct task_struct *parent); | 57 | extern int cap_ptrace_traceme(struct task_struct *parent); |
57 | extern int cap_capget(struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted); | 58 | extern int cap_capget(struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted); |
58 | extern int cap_capset(struct cred *new, const struct cred *old, | 59 | extern int cap_capset(struct cred *new, const struct cred *old, |
@@ -66,6 +67,9 @@ extern int cap_inode_setxattr(struct dentry *dentry, const char *name, | |||
66 | extern int cap_inode_removexattr(struct dentry *dentry, const char *name); | 67 | extern int cap_inode_removexattr(struct dentry *dentry, const char *name); |
67 | extern int cap_inode_need_killpriv(struct dentry *dentry); | 68 | extern int cap_inode_need_killpriv(struct dentry *dentry); |
68 | extern int cap_inode_killpriv(struct dentry *dentry); | 69 | extern int cap_inode_killpriv(struct dentry *dentry); |
70 | extern int cap_file_mmap(struct file *file, unsigned long reqprot, | ||
71 | unsigned long prot, unsigned long flags, | ||
72 | unsigned long addr, unsigned long addr_only); | ||
69 | extern int cap_task_fix_setuid(struct cred *new, const struct cred *old, int flags); | 73 | extern int cap_task_fix_setuid(struct cred *new, const struct cred *old, int flags); |
70 | extern int cap_task_prctl(int option, unsigned long arg2, unsigned long arg3, | 74 | extern int cap_task_prctl(int option, unsigned long arg2, unsigned long arg3, |
71 | unsigned long arg4, unsigned long arg5); | 75 | unsigned long arg4, unsigned long arg5); |
@@ -92,6 +96,7 @@ extern int cap_netlink_send(struct sock *sk, struct sk_buff *skb); | |||
92 | extern int cap_netlink_recv(struct sk_buff *skb, int cap); | 96 | extern int cap_netlink_recv(struct sk_buff *skb, int cap); |
93 | 97 | ||
94 | extern unsigned long mmap_min_addr; | 98 | extern unsigned long mmap_min_addr; |
99 | extern unsigned long dac_mmap_min_addr; | ||
95 | /* | 100 | /* |
96 | * Values used in the task_security_ops calls | 101 | * Values used in the task_security_ops calls |
97 | */ | 102 | */ |
@@ -116,6 +121,21 @@ struct request_sock; | |||
116 | #define LSM_UNSAFE_PTRACE 2 | 121 | #define LSM_UNSAFE_PTRACE 2 |
117 | #define LSM_UNSAFE_PTRACE_CAP 4 | 122 | #define LSM_UNSAFE_PTRACE_CAP 4 |
118 | 123 | ||
124 | /* | ||
125 | * If a hint addr is less than mmap_min_addr change hint to be as | ||
126 | * low as possible but still greater than mmap_min_addr | ||
127 | */ | ||
128 | static inline unsigned long round_hint_to_min(unsigned long hint) | ||
129 | { | ||
130 | hint &= PAGE_MASK; | ||
131 | if (((void *)hint != NULL) && | ||
132 | (hint < mmap_min_addr)) | ||
133 | return PAGE_ALIGN(mmap_min_addr); | ||
134 | return hint; | ||
135 | } | ||
136 | extern int mmap_min_addr_handler(struct ctl_table *table, int write, struct file *filp, | ||
137 | void __user *buffer, size_t *lenp, loff_t *ppos); | ||
138 | |||
119 | #ifdef CONFIG_SECURITY | 139 | #ifdef CONFIG_SECURITY |
120 | 140 | ||
121 | struct security_mnt_opts { | 141 | struct security_mnt_opts { |
@@ -633,6 +653,11 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
633 | * manual page for definitions of the @clone_flags. | 653 | * manual page for definitions of the @clone_flags. |
634 | * @clone_flags contains the flags indicating what should be shared. | 654 | * @clone_flags contains the flags indicating what should be shared. |
635 | * Return 0 if permission is granted. | 655 | * Return 0 if permission is granted. |
656 | * @cred_alloc_blank: | ||
657 | * @cred points to the credentials. | ||
658 | * @gfp indicates the atomicity of any memory allocations. | ||
659 | * Only allocate sufficient memory and attach to @cred such that | ||
660 | * cred_transfer() will not get ENOMEM. | ||
636 | * @cred_free: | 661 | * @cred_free: |
637 | * @cred points to the credentials. | 662 | * @cred points to the credentials. |
638 | * Deallocate and clear the cred->security field in a set of credentials. | 663 | * Deallocate and clear the cred->security field in a set of credentials. |
@@ -645,6 +670,10 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
645 | * @new points to the new credentials. | 670 | * @new points to the new credentials. |
646 | * @old points to the original credentials. | 671 | * @old points to the original credentials. |
647 | * Install a new set of credentials. | 672 | * Install a new set of credentials. |
673 | * @cred_transfer: | ||
674 | * @new points to the new credentials. | ||
675 | * @old points to the original credentials. | ||
676 | * Transfer data from original creds to new creds | ||
648 | * @kernel_act_as: | 677 | * @kernel_act_as: |
649 | * Set the credentials for a kernel service to act as (subjective context). | 678 | * Set the credentials for a kernel service to act as (subjective context). |
650 | * @new points to the credentials to be modified. | 679 | * @new points to the credentials to be modified. |
@@ -658,6 +687,10 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
658 | * @inode points to the inode to use as a reference. | 687 | * @inode points to the inode to use as a reference. |
659 | * The current task must be the one that nominated @inode. | 688 | * The current task must be the one that nominated @inode. |
660 | * Return 0 if successful. | 689 | * Return 0 if successful. |
690 | * @kernel_module_request: | ||
691 | * Ability to trigger the kernel to automatically upcall to userspace for | ||
692 | * userspace to load a kernel module with the given name. | ||
693 | * Return 0 if successful. | ||
661 | * @task_setuid: | 694 | * @task_setuid: |
662 | * Check permission before setting one or more of the user identity | 695 | * Check permission before setting one or more of the user identity |
663 | * attributes of the current process. The @flags parameter indicates | 696 | * attributes of the current process. The @flags parameter indicates |
@@ -974,6 +1007,17 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
974 | * Sets the connection's peersid to the secmark on skb. | 1007 | * Sets the connection's peersid to the secmark on skb. |
975 | * @req_classify_flow: | 1008 | * @req_classify_flow: |
976 | * Sets the flow's sid to the openreq sid. | 1009 | * Sets the flow's sid to the openreq sid. |
1010 | * @tun_dev_create: | ||
1011 | * Check permissions prior to creating a new TUN device. | ||
1012 | * @tun_dev_post_create: | ||
1013 | * This hook allows a module to update or allocate a per-socket security | ||
1014 | * structure. | ||
1015 | * @sk contains the newly created sock structure. | ||
1016 | * @tun_dev_attach: | ||
1017 | * Check permissions prior to attaching to a persistent TUN device. This | ||
1018 | * hook can also be used by the module to update any security state | ||
1019 | * associated with the TUN device's sock structure. | ||
1020 | * @sk contains the existing sock structure. | ||
977 | * | 1021 | * |
978 | * Security hooks for XFRM operations. | 1022 | * Security hooks for XFRM operations. |
979 | * | 1023 | * |
@@ -1068,6 +1112,13 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
1068 | * Return the length of the string (including terminating NUL) or -ve if | 1112 | * Return the length of the string (including terminating NUL) or -ve if |
1069 | * an error. | 1113 | * an error. |
1070 | * May also return 0 (and a NULL buffer pointer) if there is no label. | 1114 | * May also return 0 (and a NULL buffer pointer) if there is no label. |
1115 | * @key_session_to_parent: | ||
1116 | * Forcibly assign the session keyring from a process to its parent | ||
1117 | * process. | ||
1118 | * @cred: Pointer to process's credentials | ||
1119 | * @parent_cred: Pointer to parent process's credentials | ||
1120 | * @keyring: Proposed new session keyring | ||
1121 | * Return 0 if permission is granted, -ve error otherwise. | ||
1071 | * | 1122 | * |
1072 | * Security hooks affecting all System V IPC operations. | 1123 | * Security hooks affecting all System V IPC operations. |
1073 | * | 1124 | * |
@@ -1209,7 +1260,7 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
1209 | * @alter contains the flag indicating whether changes are to be made. | 1260 | * @alter contains the flag indicating whether changes are to be made. |
1210 | * Return 0 if permission is granted. | 1261 | * Return 0 if permission is granted. |
1211 | * | 1262 | * |
1212 | * @ptrace_may_access: | 1263 | * @ptrace_access_check: |
1213 | * Check permission before allowing the current process to trace the | 1264 | * Check permission before allowing the current process to trace the |
1214 | * @child process. | 1265 | * @child process. |
1215 | * Security modules may also want to perform a process tracing check | 1266 | * Security modules may also want to perform a process tracing check |
@@ -1224,7 +1275,7 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
1224 | * Check that the @parent process has sufficient permission to trace the | 1275 | * Check that the @parent process has sufficient permission to trace the |
1225 | * current process before allowing the current process to present itself | 1276 | * current process before allowing the current process to present itself |
1226 | * to the @parent process for tracing. | 1277 | * to the @parent process for tracing. |
1227 | * The parent process will still have to undergo the ptrace_may_access | 1278 | * The parent process will still have to undergo the ptrace_access_check |
1228 | * checks before it is allowed to trace this one. | 1279 | * checks before it is allowed to trace this one. |
1229 | * @parent contains the task_struct structure for debugger process. | 1280 | * @parent contains the task_struct structure for debugger process. |
1230 | * Return 0 if permission is granted. | 1281 | * Return 0 if permission is granted. |
@@ -1331,12 +1382,47 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
1331 | * audit_rule_init. | 1382 | * audit_rule_init. |
1332 | * @rule contains the allocated rule | 1383 | * @rule contains the allocated rule |
1333 | * | 1384 | * |
1385 | * @inode_notifysecctx: | ||
1386 | * Notify the security module of what the security context of an inode | ||
1387 | * should be. Initializes the incore security context managed by the | ||
1388 | * security module for this inode. Example usage: NFS client invokes | ||
1389 | * this hook to initialize the security context in its incore inode to the | ||
1390 | * value provided by the server for the file when the server returned the | ||
1391 | * file's attributes to the client. | ||
1392 | * | ||
1393 | * Must be called with inode->i_mutex locked. | ||
1394 | * | ||
1395 | * @inode we wish to set the security context of. | ||
1396 | * @ctx contains the string which we wish to set in the inode. | ||
1397 | * @ctxlen contains the length of @ctx. | ||
1398 | * | ||
1399 | * @inode_setsecctx: | ||
1400 | * Change the security context of an inode. Updates the | ||
1401 | * incore security context managed by the security module and invokes the | ||
1402 | * fs code as needed (via __vfs_setxattr_noperm) to update any backing | ||
1403 | * xattrs that represent the context. Example usage: NFS server invokes | ||
1404 | * this hook to change the security context in its incore inode and on the | ||
1405 | * backing filesystem to a value provided by the client on a SETATTR | ||
1406 | * operation. | ||
1407 | * | ||
1408 | * Must be called with inode->i_mutex locked. | ||
1409 | * | ||
1410 | * @dentry contains the inode we wish to set the security context of. | ||
1411 | * @ctx contains the string which we wish to set in the inode. | ||
1412 | * @ctxlen contains the length of @ctx. | ||
1413 | * | ||
1414 | * @inode_getsecctx: | ||
1415 | * Returns a string containing all relavent security context information | ||
1416 | * | ||
1417 | * @inode we wish to set the security context of. | ||
1418 | * @ctx is a pointer in which to place the allocated security context. | ||
1419 | * @ctxlen points to the place to put the length of @ctx. | ||
1334 | * This is the main security structure. | 1420 | * This is the main security structure. |
1335 | */ | 1421 | */ |
1336 | struct security_operations { | 1422 | struct security_operations { |
1337 | char name[SECURITY_NAME_MAX + 1]; | 1423 | char name[SECURITY_NAME_MAX + 1]; |
1338 | 1424 | ||
1339 | int (*ptrace_may_access) (struct task_struct *child, unsigned int mode); | 1425 | int (*ptrace_access_check) (struct task_struct *child, unsigned int mode); |
1340 | int (*ptrace_traceme) (struct task_struct *parent); | 1426 | int (*ptrace_traceme) (struct task_struct *parent); |
1341 | int (*capget) (struct task_struct *target, | 1427 | int (*capget) (struct task_struct *target, |
1342 | kernel_cap_t *effective, | 1428 | kernel_cap_t *effective, |
@@ -1463,12 +1549,15 @@ struct security_operations { | |||
1463 | int (*dentry_open) (struct file *file, const struct cred *cred); | 1549 | int (*dentry_open) (struct file *file, const struct cred *cred); |
1464 | 1550 | ||
1465 | int (*task_create) (unsigned long clone_flags); | 1551 | int (*task_create) (unsigned long clone_flags); |
1552 | int (*cred_alloc_blank) (struct cred *cred, gfp_t gfp); | ||
1466 | void (*cred_free) (struct cred *cred); | 1553 | void (*cred_free) (struct cred *cred); |
1467 | int (*cred_prepare)(struct cred *new, const struct cred *old, | 1554 | int (*cred_prepare)(struct cred *new, const struct cred *old, |
1468 | gfp_t gfp); | 1555 | gfp_t gfp); |
1469 | void (*cred_commit)(struct cred *new, const struct cred *old); | 1556 | void (*cred_commit)(struct cred *new, const struct cred *old); |
1557 | void (*cred_transfer)(struct cred *new, const struct cred *old); | ||
1470 | int (*kernel_act_as)(struct cred *new, u32 secid); | 1558 | int (*kernel_act_as)(struct cred *new, u32 secid); |
1471 | int (*kernel_create_files_as)(struct cred *new, struct inode *inode); | 1559 | int (*kernel_create_files_as)(struct cred *new, struct inode *inode); |
1560 | int (*kernel_module_request)(void); | ||
1472 | int (*task_setuid) (uid_t id0, uid_t id1, uid_t id2, int flags); | 1561 | int (*task_setuid) (uid_t id0, uid_t id1, uid_t id2, int flags); |
1473 | int (*task_fix_setuid) (struct cred *new, const struct cred *old, | 1562 | int (*task_fix_setuid) (struct cred *new, const struct cred *old, |
1474 | int flags); | 1563 | int flags); |
@@ -1536,6 +1625,10 @@ struct security_operations { | |||
1536 | int (*secctx_to_secid) (const char *secdata, u32 seclen, u32 *secid); | 1625 | int (*secctx_to_secid) (const char *secdata, u32 seclen, u32 *secid); |
1537 | void (*release_secctx) (char *secdata, u32 seclen); | 1626 | void (*release_secctx) (char *secdata, u32 seclen); |
1538 | 1627 | ||
1628 | int (*inode_notifysecctx)(struct inode *inode, void *ctx, u32 ctxlen); | ||
1629 | int (*inode_setsecctx)(struct dentry *dentry, void *ctx, u32 ctxlen); | ||
1630 | int (*inode_getsecctx)(struct inode *inode, void **ctx, u32 *ctxlen); | ||
1631 | |||
1539 | #ifdef CONFIG_SECURITY_NETWORK | 1632 | #ifdef CONFIG_SECURITY_NETWORK |
1540 | int (*unix_stream_connect) (struct socket *sock, | 1633 | int (*unix_stream_connect) (struct socket *sock, |
1541 | struct socket *other, struct sock *newsk); | 1634 | struct socket *other, struct sock *newsk); |
@@ -1572,6 +1665,9 @@ struct security_operations { | |||
1572 | void (*inet_csk_clone) (struct sock *newsk, const struct request_sock *req); | 1665 | void (*inet_csk_clone) (struct sock *newsk, const struct request_sock *req); |
1573 | void (*inet_conn_established) (struct sock *sk, struct sk_buff *skb); | 1666 | void (*inet_conn_established) (struct sock *sk, struct sk_buff *skb); |
1574 | void (*req_classify_flow) (const struct request_sock *req, struct flowi *fl); | 1667 | void (*req_classify_flow) (const struct request_sock *req, struct flowi *fl); |
1668 | int (*tun_dev_create)(void); | ||
1669 | void (*tun_dev_post_create)(struct sock *sk); | ||
1670 | int (*tun_dev_attach)(struct sock *sk); | ||
1575 | #endif /* CONFIG_SECURITY_NETWORK */ | 1671 | #endif /* CONFIG_SECURITY_NETWORK */ |
1576 | 1672 | ||
1577 | #ifdef CONFIG_SECURITY_NETWORK_XFRM | 1673 | #ifdef CONFIG_SECURITY_NETWORK_XFRM |
@@ -1600,6 +1696,9 @@ struct security_operations { | |||
1600 | const struct cred *cred, | 1696 | const struct cred *cred, |
1601 | key_perm_t perm); | 1697 | key_perm_t perm); |
1602 | int (*key_getsecurity)(struct key *key, char **_buffer); | 1698 | int (*key_getsecurity)(struct key *key, char **_buffer); |
1699 | int (*key_session_to_parent)(const struct cred *cred, | ||
1700 | const struct cred *parent_cred, | ||
1701 | struct key *key); | ||
1603 | #endif /* CONFIG_KEYS */ | 1702 | #endif /* CONFIG_KEYS */ |
1604 | 1703 | ||
1605 | #ifdef CONFIG_AUDIT | 1704 | #ifdef CONFIG_AUDIT |
@@ -1617,7 +1716,7 @@ extern int security_module_enable(struct security_operations *ops); | |||
1617 | extern int register_security(struct security_operations *ops); | 1716 | extern int register_security(struct security_operations *ops); |
1618 | 1717 | ||
1619 | /* Security operations */ | 1718 | /* Security operations */ |
1620 | int security_ptrace_may_access(struct task_struct *child, unsigned int mode); | 1719 | int security_ptrace_access_check(struct task_struct *child, unsigned int mode); |
1621 | int security_ptrace_traceme(struct task_struct *parent); | 1720 | int security_ptrace_traceme(struct task_struct *parent); |
1622 | int security_capget(struct task_struct *target, | 1721 | int security_capget(struct task_struct *target, |
1623 | kernel_cap_t *effective, | 1722 | kernel_cap_t *effective, |
@@ -1716,11 +1815,14 @@ int security_file_send_sigiotask(struct task_struct *tsk, | |||
1716 | int security_file_receive(struct file *file); | 1815 | int security_file_receive(struct file *file); |
1717 | int security_dentry_open(struct file *file, const struct cred *cred); | 1816 | int security_dentry_open(struct file *file, const struct cred *cred); |
1718 | int security_task_create(unsigned long clone_flags); | 1817 | int security_task_create(unsigned long clone_flags); |
1818 | int security_cred_alloc_blank(struct cred *cred, gfp_t gfp); | ||
1719 | void security_cred_free(struct cred *cred); | 1819 | void security_cred_free(struct cred *cred); |
1720 | int security_prepare_creds(struct cred *new, const struct cred *old, gfp_t gfp); | 1820 | int security_prepare_creds(struct cred *new, const struct cred *old, gfp_t gfp); |
1721 | void security_commit_creds(struct cred *new, const struct cred *old); | 1821 | void security_commit_creds(struct cred *new, const struct cred *old); |
1822 | void security_transfer_creds(struct cred *new, const struct cred *old); | ||
1722 | int security_kernel_act_as(struct cred *new, u32 secid); | 1823 | int security_kernel_act_as(struct cred *new, u32 secid); |
1723 | int security_kernel_create_files_as(struct cred *new, struct inode *inode); | 1824 | int security_kernel_create_files_as(struct cred *new, struct inode *inode); |
1825 | int security_kernel_module_request(void); | ||
1724 | int security_task_setuid(uid_t id0, uid_t id1, uid_t id2, int flags); | 1826 | int security_task_setuid(uid_t id0, uid_t id1, uid_t id2, int flags); |
1725 | int security_task_fix_setuid(struct cred *new, const struct cred *old, | 1827 | int security_task_fix_setuid(struct cred *new, const struct cred *old, |
1726 | int flags); | 1828 | int flags); |
@@ -1776,6 +1878,9 @@ int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen); | |||
1776 | int security_secctx_to_secid(const char *secdata, u32 seclen, u32 *secid); | 1878 | int security_secctx_to_secid(const char *secdata, u32 seclen, u32 *secid); |
1777 | void security_release_secctx(char *secdata, u32 seclen); | 1879 | void security_release_secctx(char *secdata, u32 seclen); |
1778 | 1880 | ||
1881 | int security_inode_notifysecctx(struct inode *inode, void *ctx, u32 ctxlen); | ||
1882 | int security_inode_setsecctx(struct dentry *dentry, void *ctx, u32 ctxlen); | ||
1883 | int security_inode_getsecctx(struct inode *inode, void **ctx, u32 *ctxlen); | ||
1779 | #else /* CONFIG_SECURITY */ | 1884 | #else /* CONFIG_SECURITY */ |
1780 | struct security_mnt_opts { | 1885 | struct security_mnt_opts { |
1781 | }; | 1886 | }; |
@@ -1798,10 +1903,10 @@ static inline int security_init(void) | |||
1798 | return 0; | 1903 | return 0; |
1799 | } | 1904 | } |
1800 | 1905 | ||
1801 | static inline int security_ptrace_may_access(struct task_struct *child, | 1906 | static inline int security_ptrace_access_check(struct task_struct *child, |
1802 | unsigned int mode) | 1907 | unsigned int mode) |
1803 | { | 1908 | { |
1804 | return cap_ptrace_may_access(child, mode); | 1909 | return cap_ptrace_access_check(child, mode); |
1805 | } | 1910 | } |
1806 | 1911 | ||
1807 | static inline int security_ptrace_traceme(struct task_struct *parent) | 1912 | static inline int security_ptrace_traceme(struct task_struct *parent) |
@@ -2197,9 +2302,7 @@ static inline int security_file_mmap(struct file *file, unsigned long reqprot, | |||
2197 | unsigned long addr, | 2302 | unsigned long addr, |
2198 | unsigned long addr_only) | 2303 | unsigned long addr_only) |
2199 | { | 2304 | { |
2200 | if ((addr < mmap_min_addr) && !capable(CAP_SYS_RAWIO)) | 2305 | return cap_file_mmap(file, reqprot, prot, flags, addr, addr_only); |
2201 | return -EACCES; | ||
2202 | return 0; | ||
2203 | } | 2306 | } |
2204 | 2307 | ||
2205 | static inline int security_file_mprotect(struct vm_area_struct *vma, | 2308 | static inline int security_file_mprotect(struct vm_area_struct *vma, |
@@ -2248,6 +2351,11 @@ static inline int security_task_create(unsigned long clone_flags) | |||
2248 | return 0; | 2351 | return 0; |
2249 | } | 2352 | } |
2250 | 2353 | ||
2354 | static inline int security_cred_alloc_blank(struct cred *cred, gfp_t gfp) | ||
2355 | { | ||
2356 | return 0; | ||
2357 | } | ||
2358 | |||
2251 | static inline void security_cred_free(struct cred *cred) | 2359 | static inline void security_cred_free(struct cred *cred) |
2252 | { } | 2360 | { } |
2253 | 2361 | ||
@@ -2263,6 +2371,11 @@ static inline void security_commit_creds(struct cred *new, | |||
2263 | { | 2371 | { |
2264 | } | 2372 | } |
2265 | 2373 | ||
2374 | static inline void security_transfer_creds(struct cred *new, | ||
2375 | const struct cred *old) | ||
2376 | { | ||
2377 | } | ||
2378 | |||
2266 | static inline int security_kernel_act_as(struct cred *cred, u32 secid) | 2379 | static inline int security_kernel_act_as(struct cred *cred, u32 secid) |
2267 | { | 2380 | { |
2268 | return 0; | 2381 | return 0; |
@@ -2274,6 +2387,11 @@ static inline int security_kernel_create_files_as(struct cred *cred, | |||
2274 | return 0; | 2387 | return 0; |
2275 | } | 2388 | } |
2276 | 2389 | ||
2390 | static inline int security_kernel_module_request(void) | ||
2391 | { | ||
2392 | return 0; | ||
2393 | } | ||
2394 | |||
2277 | static inline int security_task_setuid(uid_t id0, uid_t id1, uid_t id2, | 2395 | static inline int security_task_setuid(uid_t id0, uid_t id1, uid_t id2, |
2278 | int flags) | 2396 | int flags) |
2279 | { | 2397 | { |
@@ -2519,6 +2637,19 @@ static inline int security_secctx_to_secid(const char *secdata, | |||
2519 | static inline void security_release_secctx(char *secdata, u32 seclen) | 2637 | static inline void security_release_secctx(char *secdata, u32 seclen) |
2520 | { | 2638 | { |
2521 | } | 2639 | } |
2640 | |||
2641 | static inline int security_inode_notifysecctx(struct inode *inode, void *ctx, u32 ctxlen) | ||
2642 | { | ||
2643 | return -EOPNOTSUPP; | ||
2644 | } | ||
2645 | static inline int security_inode_setsecctx(struct dentry *dentry, void *ctx, u32 ctxlen) | ||
2646 | { | ||
2647 | return -EOPNOTSUPP; | ||
2648 | } | ||
2649 | static inline int security_inode_getsecctx(struct inode *inode, void **ctx, u32 *ctxlen) | ||
2650 | { | ||
2651 | return -EOPNOTSUPP; | ||
2652 | } | ||
2522 | #endif /* CONFIG_SECURITY */ | 2653 | #endif /* CONFIG_SECURITY */ |
2523 | 2654 | ||
2524 | #ifdef CONFIG_SECURITY_NETWORK | 2655 | #ifdef CONFIG_SECURITY_NETWORK |
@@ -2557,6 +2688,9 @@ void security_inet_csk_clone(struct sock *newsk, | |||
2557 | const struct request_sock *req); | 2688 | const struct request_sock *req); |
2558 | void security_inet_conn_established(struct sock *sk, | 2689 | void security_inet_conn_established(struct sock *sk, |
2559 | struct sk_buff *skb); | 2690 | struct sk_buff *skb); |
2691 | int security_tun_dev_create(void); | ||
2692 | void security_tun_dev_post_create(struct sock *sk); | ||
2693 | int security_tun_dev_attach(struct sock *sk); | ||
2560 | 2694 | ||
2561 | #else /* CONFIG_SECURITY_NETWORK */ | 2695 | #else /* CONFIG_SECURITY_NETWORK */ |
2562 | static inline int security_unix_stream_connect(struct socket *sock, | 2696 | static inline int security_unix_stream_connect(struct socket *sock, |
@@ -2707,6 +2841,20 @@ static inline void security_inet_conn_established(struct sock *sk, | |||
2707 | struct sk_buff *skb) | 2841 | struct sk_buff *skb) |
2708 | { | 2842 | { |
2709 | } | 2843 | } |
2844 | |||
2845 | static inline int security_tun_dev_create(void) | ||
2846 | { | ||
2847 | return 0; | ||
2848 | } | ||
2849 | |||
2850 | static inline void security_tun_dev_post_create(struct sock *sk) | ||
2851 | { | ||
2852 | } | ||
2853 | |||
2854 | static inline int security_tun_dev_attach(struct sock *sk) | ||
2855 | { | ||
2856 | return 0; | ||
2857 | } | ||
2710 | #endif /* CONFIG_SECURITY_NETWORK */ | 2858 | #endif /* CONFIG_SECURITY_NETWORK */ |
2711 | 2859 | ||
2712 | #ifdef CONFIG_SECURITY_NETWORK_XFRM | 2860 | #ifdef CONFIG_SECURITY_NETWORK_XFRM |
@@ -2863,6 +3011,9 @@ void security_key_free(struct key *key); | |||
2863 | int security_key_permission(key_ref_t key_ref, | 3011 | int security_key_permission(key_ref_t key_ref, |
2864 | const struct cred *cred, key_perm_t perm); | 3012 | const struct cred *cred, key_perm_t perm); |
2865 | int security_key_getsecurity(struct key *key, char **_buffer); | 3013 | int security_key_getsecurity(struct key *key, char **_buffer); |
3014 | int security_key_session_to_parent(const struct cred *cred, | ||
3015 | const struct cred *parent_cred, | ||
3016 | struct key *key); | ||
2866 | 3017 | ||
2867 | #else | 3018 | #else |
2868 | 3019 | ||
@@ -2890,6 +3041,13 @@ static inline int security_key_getsecurity(struct key *key, char **_buffer) | |||
2890 | return 0; | 3041 | return 0; |
2891 | } | 3042 | } |
2892 | 3043 | ||
3044 | static inline int security_key_session_to_parent(const struct cred *cred, | ||
3045 | const struct cred *parent_cred, | ||
3046 | struct key *key) | ||
3047 | { | ||
3048 | return 0; | ||
3049 | } | ||
3050 | |||
2893 | #endif | 3051 | #endif |
2894 | #endif /* CONFIG_KEYS */ | 3052 | #endif /* CONFIG_KEYS */ |
2895 | 3053 | ||
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index 004f3b3342c5..0c6a86b79596 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h | |||
@@ -43,6 +43,7 @@ int seq_release(struct inode *, struct file *); | |||
43 | int seq_escape(struct seq_file *, const char *, const char *); | 43 | int seq_escape(struct seq_file *, const char *, const char *); |
44 | int seq_putc(struct seq_file *m, char c); | 44 | int seq_putc(struct seq_file *m, char c); |
45 | int seq_puts(struct seq_file *m, const char *s); | 45 | int seq_puts(struct seq_file *m, const char *s); |
46 | int seq_write(struct seq_file *seq, const void *data, size_t len); | ||
46 | 47 | ||
47 | int seq_printf(struct seq_file *, const char *, ...) | 48 | int seq_printf(struct seq_file *, const char *, ...) |
48 | __attribute__ ((format (printf,2,3))); | 49 | __attribute__ ((format (printf,2,3))); |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 6fd80c4243f1..23d2fb051f97 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -171,6 +171,9 @@ | |||
171 | /* Timberdale UART */ | 171 | /* Timberdale UART */ |
172 | #define PORT_TIMBUART 87 | 172 | #define PORT_TIMBUART 87 |
173 | 173 | ||
174 | /* Qualcomm MSM SoCs */ | ||
175 | #define PORT_MSM 88 | ||
176 | |||
174 | #ifdef __KERNEL__ | 177 | #ifdef __KERNEL__ |
175 | 178 | ||
176 | #include <linux/compiler.h> | 179 | #include <linux/compiler.h> |
diff --git a/include/linux/serial_reg.h b/include/linux/serial_reg.h index 96c0d93fc2ca..850db2e80510 100644 --- a/include/linux/serial_reg.h +++ b/include/linux/serial_reg.h | |||
@@ -323,6 +323,7 @@ | |||
323 | #define UART_OMAP_MVER 0x14 /* Module version register */ | 323 | #define UART_OMAP_MVER 0x14 /* Module version register */ |
324 | #define UART_OMAP_SYSC 0x15 /* System configuration register */ | 324 | #define UART_OMAP_SYSC 0x15 /* System configuration register */ |
325 | #define UART_OMAP_SYSS 0x16 /* System status register */ | 325 | #define UART_OMAP_SYSS 0x16 /* System status register */ |
326 | #define UART_OMAP_WER 0x17 /* Wake-up enable register */ | ||
326 | 327 | ||
327 | #endif /* _LINUX_SERIAL_REG_H */ | 328 | #endif /* _LINUX_SERIAL_REG_H */ |
328 | 329 | ||
diff --git a/include/linux/serio.h b/include/linux/serio.h index e0417e4d3f15..126d24c9eaa8 100644 --- a/include/linux/serio.h +++ b/include/linux/serio.h | |||
@@ -15,6 +15,7 @@ | |||
15 | 15 | ||
16 | #ifdef __KERNEL__ | 16 | #ifdef __KERNEL__ |
17 | 17 | ||
18 | #include <linux/types.h> | ||
18 | #include <linux/interrupt.h> | 19 | #include <linux/interrupt.h> |
19 | #include <linux/list.h> | 20 | #include <linux/list.h> |
20 | #include <linux/spinlock.h> | 21 | #include <linux/spinlock.h> |
@@ -28,7 +29,10 @@ struct serio { | |||
28 | char name[32]; | 29 | char name[32]; |
29 | char phys[32]; | 30 | char phys[32]; |
30 | 31 | ||
31 | unsigned int manual_bind; | 32 | bool manual_bind; |
33 | bool registered; /* port has been fully registered with driver core */ | ||
34 | bool suspended; /* port is suspended */ | ||
35 | |||
32 | 36 | ||
33 | struct serio_device_id id; | 37 | struct serio_device_id id; |
34 | 38 | ||
@@ -47,7 +51,6 @@ struct serio { | |||
47 | struct mutex drv_mutex; /* protects serio->drv so attributes can pin driver */ | 51 | struct mutex drv_mutex; /* protects serio->drv so attributes can pin driver */ |
48 | 52 | ||
49 | struct device dev; | 53 | struct device dev; |
50 | unsigned int registered; /* port has been fully registered with driver core */ | ||
51 | 54 | ||
52 | struct list_head node; | 55 | struct list_head node; |
53 | }; | 56 | }; |
@@ -58,7 +61,7 @@ struct serio_driver { | |||
58 | char *description; | 61 | char *description; |
59 | 62 | ||
60 | struct serio_device_id *id_table; | 63 | struct serio_device_id *id_table; |
61 | unsigned int manual_bind; | 64 | bool manual_bind; |
62 | 65 | ||
63 | void (*write_wakeup)(struct serio *); | 66 | void (*write_wakeup)(struct serio *); |
64 | irqreturn_t (*interrupt)(struct serio *, unsigned char, unsigned int); | 67 | irqreturn_t (*interrupt)(struct serio *, unsigned char, unsigned int); |
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h index fd83f2584b15..6d3f2f449ead 100644 --- a/include/linux/shmem_fs.h +++ b/include/linux/shmem_fs.h | |||
@@ -19,10 +19,6 @@ struct shmem_inode_info { | |||
19 | swp_entry_t i_direct[SHMEM_NR_DIRECT]; /* first blocks */ | 19 | swp_entry_t i_direct[SHMEM_NR_DIRECT]; /* first blocks */ |
20 | struct list_head swaplist; /* chain of maybes on swap */ | 20 | struct list_head swaplist; /* chain of maybes on swap */ |
21 | struct inode vfs_inode; | 21 | struct inode vfs_inode; |
22 | #ifdef CONFIG_TMPFS_POSIX_ACL | ||
23 | struct posix_acl *i_acl; | ||
24 | struct posix_acl *i_default_acl; | ||
25 | #endif | ||
26 | }; | 22 | }; |
27 | 23 | ||
28 | struct shmem_sb_info { | 24 | struct shmem_sb_info { |
@@ -43,9 +39,8 @@ static inline struct shmem_inode_info *SHMEM_I(struct inode *inode) | |||
43 | } | 39 | } |
44 | 40 | ||
45 | #ifdef CONFIG_TMPFS_POSIX_ACL | 41 | #ifdef CONFIG_TMPFS_POSIX_ACL |
46 | int shmem_permission(struct inode *, int); | 42 | int shmem_check_acl(struct inode *, int); |
47 | int shmem_acl_init(struct inode *, struct inode *); | 43 | int shmem_acl_init(struct inode *, struct inode *); |
48 | void shmem_acl_destroy_inode(struct inode *); | ||
49 | 44 | ||
50 | extern struct xattr_handler shmem_xattr_acl_access_handler; | 45 | extern struct xattr_handler shmem_xattr_acl_access_handler; |
51 | extern struct xattr_handler shmem_xattr_acl_default_handler; | 46 | extern struct xattr_handler shmem_xattr_acl_default_handler; |
@@ -57,9 +52,6 @@ static inline int shmem_acl_init(struct inode *inode, struct inode *dir) | |||
57 | { | 52 | { |
58 | return 0; | 53 | return 0; |
59 | } | 54 | } |
60 | static inline void shmem_acl_destroy_inode(struct inode *inode) | ||
61 | { | ||
62 | } | ||
63 | #endif /* CONFIG_TMPFS_POSIX_ACL */ | 55 | #endif /* CONFIG_TMPFS_POSIX_ACL */ |
64 | 56 | ||
65 | #endif | 57 | #endif |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 63ef24bc01d0..f2c69a2cca17 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -265,7 +265,7 @@ typedef unsigned char *sk_buff_data_t; | |||
265 | * @transport_header: Transport layer header | 265 | * @transport_header: Transport layer header |
266 | * @network_header: Network layer header | 266 | * @network_header: Network layer header |
267 | * @mac_header: Link layer header | 267 | * @mac_header: Link layer header |
268 | * @dst: destination entry | 268 | * @_skb_dst: destination entry |
269 | * @sp: the security path, used for xfrm | 269 | * @sp: the security path, used for xfrm |
270 | * @cb: Control buffer. Free for use by every layer. Put private vars here | 270 | * @cb: Control buffer. Free for use by every layer. Put private vars here |
271 | * @len: Length of actual data | 271 | * @len: Length of actual data |
@@ -1342,12 +1342,12 @@ static inline int skb_network_offset(const struct sk_buff *skb) | |||
1342 | * shifting the start of the packet by 2 bytes. Drivers should do this | 1342 | * shifting the start of the packet by 2 bytes. Drivers should do this |
1343 | * with: | 1343 | * with: |
1344 | * | 1344 | * |
1345 | * skb_reserve(NET_IP_ALIGN); | 1345 | * skb_reserve(skb, NET_IP_ALIGN); |
1346 | * | 1346 | * |
1347 | * The downside to this alignment of the IP header is that the DMA is now | 1347 | * The downside to this alignment of the IP header is that the DMA is now |
1348 | * unaligned. On some architectures the cost of an unaligned DMA is high | 1348 | * unaligned. On some architectures the cost of an unaligned DMA is high |
1349 | * and this cost outweighs the gains made by aligning the IP header. | 1349 | * and this cost outweighs the gains made by aligning the IP header. |
1350 | * | 1350 | * |
1351 | * Since this trade off varies between architectures, we allow NET_IP_ALIGN | 1351 | * Since this trade off varies between architectures, we allow NET_IP_ALIGN |
1352 | * to be overridden. | 1352 | * to be overridden. |
1353 | */ | 1353 | */ |
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index 4dcbc2c71491..c1c862b1d01a 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/workqueue.h> | 11 | #include <linux/workqueue.h> |
12 | #include <linux/kobject.h> | 12 | #include <linux/kobject.h> |
13 | #include <linux/kmemtrace.h> | 13 | #include <linux/kmemtrace.h> |
14 | #include <linux/kmemleak.h> | ||
14 | 15 | ||
15 | enum stat_item { | 16 | enum stat_item { |
16 | ALLOC_FASTPATH, /* Allocation from cpu slab */ | 17 | ALLOC_FASTPATH, /* Allocation from cpu slab */ |
@@ -233,6 +234,7 @@ static __always_inline void *kmalloc_large(size_t size, gfp_t flags) | |||
233 | unsigned int order = get_order(size); | 234 | unsigned int order = get_order(size); |
234 | void *ret = (void *) __get_free_pages(flags | __GFP_COMP, order); | 235 | void *ret = (void *) __get_free_pages(flags | __GFP_COMP, order); |
235 | 236 | ||
237 | kmemleak_alloc(ret, size, 1, flags); | ||
236 | trace_kmalloc(_THIS_IP_, ret, size, PAGE_SIZE << order, flags); | 238 | trace_kmalloc(_THIS_IP_, ret, size, PAGE_SIZE << order, flags); |
237 | 239 | ||
238 | return ret; | 240 | return ret; |
diff --git a/include/linux/spi/ads7846.h b/include/linux/spi/ads7846.h index 2ea20320c093..51948eb6927a 100644 --- a/include/linux/spi/ads7846.h +++ b/include/linux/spi/ads7846.h | |||
@@ -17,6 +17,7 @@ struct ads7846_platform_data { | |||
17 | u16 vref_mv; /* external vref value, milliVolts */ | 17 | u16 vref_mv; /* external vref value, milliVolts */ |
18 | bool keep_vref_on; /* set to keep vref on for differential | 18 | bool keep_vref_on; /* set to keep vref on for differential |
19 | * measurements as well */ | 19 | * measurements as well */ |
20 | bool swap_xy; /* swap x and y axes */ | ||
20 | 21 | ||
21 | /* Settling time of the analog signals; a function of Vcc and the | 22 | /* Settling time of the analog signals; a function of Vcc and the |
22 | * capacitance on the X/Y drivers. If set to non-zero, two samples | 23 | * capacitance on the X/Y drivers. If set to non-zero, two samples |
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index a0faa18f7b1b..c47c4b4da97e 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h | |||
@@ -80,6 +80,8 @@ struct spi_device { | |||
80 | #define SPI_LSB_FIRST 0x08 /* per-word bits-on-wire */ | 80 | #define SPI_LSB_FIRST 0x08 /* per-word bits-on-wire */ |
81 | #define SPI_3WIRE 0x10 /* SI/SO signals shared */ | 81 | #define SPI_3WIRE 0x10 /* SI/SO signals shared */ |
82 | #define SPI_LOOP 0x20 /* loopback mode */ | 82 | #define SPI_LOOP 0x20 /* loopback mode */ |
83 | #define SPI_NO_CS 0x40 /* 1 dev/bus, no chipselect */ | ||
84 | #define SPI_READY 0x80 /* slave pulls low to pause */ | ||
83 | u8 bits_per_word; | 85 | u8 bits_per_word; |
84 | int irq; | 86 | int irq; |
85 | void *controller_state; | 87 | void *controller_state; |
@@ -245,6 +247,13 @@ struct spi_master { | |||
245 | */ | 247 | */ |
246 | u16 dma_alignment; | 248 | u16 dma_alignment; |
247 | 249 | ||
250 | /* spi_device.mode flags understood by this controller driver */ | ||
251 | u16 mode_bits; | ||
252 | |||
253 | /* other constraints relevant to this driver */ | ||
254 | u16 flags; | ||
255 | #define SPI_MASTER_HALF_DUPLEX BIT(0) /* can't do full duplex */ | ||
256 | |||
248 | /* Setup mode and clock, etc (spi driver may call many times). | 257 | /* Setup mode and clock, etc (spi driver may call many times). |
249 | * | 258 | * |
250 | * IMPORTANT: this may be called when transfers to another | 259 | * IMPORTANT: this may be called when transfers to another |
@@ -523,30 +532,7 @@ static inline void spi_message_free(struct spi_message *m) | |||
523 | kfree(m); | 532 | kfree(m); |
524 | } | 533 | } |
525 | 534 | ||
526 | /** | 535 | extern int spi_setup(struct spi_device *spi); |
527 | * spi_setup - setup SPI mode and clock rate | ||
528 | * @spi: the device whose settings are being modified | ||
529 | * Context: can sleep, and no requests are queued to the device | ||
530 | * | ||
531 | * SPI protocol drivers may need to update the transfer mode if the | ||
532 | * device doesn't work with its default. They may likewise need | ||
533 | * to update clock rates or word sizes from initial values. This function | ||
534 | * changes those settings, and must be called from a context that can sleep. | ||
535 | * Except for SPI_CS_HIGH, which takes effect immediately, the changes take | ||
536 | * effect the next time the device is selected and data is transferred to | ||
537 | * or from it. When this function returns, the spi device is deselected. | ||
538 | * | ||
539 | * Note that this call will fail if the protocol driver specifies an option | ||
540 | * that the underlying controller or its driver does not support. For | ||
541 | * example, not all hardware supports wire transfers using nine bit words, | ||
542 | * LSB-first wire encoding, or active-high chipselects. | ||
543 | */ | ||
544 | static inline int | ||
545 | spi_setup(struct spi_device *spi) | ||
546 | { | ||
547 | return spi->master->setup(spi); | ||
548 | } | ||
549 | |||
550 | 536 | ||
551 | /** | 537 | /** |
552 | * spi_async - asynchronous SPI transfer | 538 | * spi_async - asynchronous SPI transfer |
diff --git a/include/linux/spi/spidev.h b/include/linux/spi/spidev.h index 95251ccd5a07..bf0570a84f7a 100644 --- a/include/linux/spi/spidev.h +++ b/include/linux/spi/spidev.h | |||
@@ -40,6 +40,8 @@ | |||
40 | #define SPI_LSB_FIRST 0x08 | 40 | #define SPI_LSB_FIRST 0x08 |
41 | #define SPI_3WIRE 0x10 | 41 | #define SPI_3WIRE 0x10 |
42 | #define SPI_LOOP 0x20 | 42 | #define SPI_LOOP 0x20 |
43 | #define SPI_NO_CS 0x40 | ||
44 | #define SPI_READY 0x80 | ||
43 | 45 | ||
44 | /*---------------------------------------------------------------------------*/ | 46 | /*---------------------------------------------------------------------------*/ |
45 | 47 | ||
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index 252b245cfcf4..4be57ab03478 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h | |||
@@ -132,6 +132,11 @@ do { \ | |||
132 | #endif /*__raw_spin_is_contended*/ | 132 | #endif /*__raw_spin_is_contended*/ |
133 | #endif | 133 | #endif |
134 | 134 | ||
135 | /* The lock does not imply full memory barrier. */ | ||
136 | #ifndef ARCH_HAS_SMP_MB_AFTER_LOCK | ||
137 | static inline void smp_mb__after_lock(void) { smp_mb(); } | ||
138 | #endif | ||
139 | |||
135 | /** | 140 | /** |
136 | * spin_unlock_wait - wait until the spinlock gets unlocked | 141 | * spin_unlock_wait - wait until the spinlock gets unlocked |
137 | * @lock: the spinlock in question. | 142 | * @lock: the spinlock in question. |
diff --git a/include/linux/sunrpc/bc_xprt.h b/include/linux/sunrpc/bc_xprt.h new file mode 100644 index 000000000000..6508f0dc0eff --- /dev/null +++ b/include/linux/sunrpc/bc_xprt.h | |||
@@ -0,0 +1,49 @@ | |||
1 | /****************************************************************************** | ||
2 | |||
3 | (c) 2008 NetApp. All Rights Reserved. | ||
4 | |||
5 | NetApp provides this source code under the GPL v2 License. | ||
6 | The GPL v2 license is available at | ||
7 | http://opensource.org/licenses/gpl-license.php. | ||
8 | |||
9 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
10 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
11 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
12 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR | ||
13 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
14 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | ||
15 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
16 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
17 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
18 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
19 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
20 | |||
21 | ******************************************************************************/ | ||
22 | |||
23 | /* | ||
24 | * Functions to create and manage the backchannel | ||
25 | */ | ||
26 | |||
27 | #ifndef _LINUX_SUNRPC_BC_XPRT_H | ||
28 | #define _LINUX_SUNRPC_BC_XPRT_H | ||
29 | |||
30 | #include <linux/sunrpc/svcsock.h> | ||
31 | #include <linux/sunrpc/xprt.h> | ||
32 | #include <linux/sunrpc/sched.h> | ||
33 | |||
34 | #ifdef CONFIG_NFS_V4_1 | ||
35 | struct rpc_rqst *xprt_alloc_bc_request(struct rpc_xprt *xprt); | ||
36 | void xprt_free_bc_request(struct rpc_rqst *req); | ||
37 | int xprt_setup_backchannel(struct rpc_xprt *, unsigned int min_reqs); | ||
38 | void xprt_destroy_backchannel(struct rpc_xprt *, int max_reqs); | ||
39 | void bc_release_request(struct rpc_task *); | ||
40 | int bc_send(struct rpc_rqst *req); | ||
41 | #else /* CONFIG_NFS_V4_1 */ | ||
42 | static inline int xprt_setup_backchannel(struct rpc_xprt *xprt, | ||
43 | unsigned int min_reqs) | ||
44 | { | ||
45 | return 0; | ||
46 | } | ||
47 | #endif /* CONFIG_NFS_V4_1 */ | ||
48 | #endif /* _LINUX_SUNRPC_BC_XPRT_H */ | ||
49 | |||
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index c39a21040dcb..37881f1a0bd7 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h | |||
@@ -143,6 +143,7 @@ int rpc_call_sync(struct rpc_clnt *clnt, | |||
143 | const struct rpc_message *msg, int flags); | 143 | const struct rpc_message *msg, int flags); |
144 | struct rpc_task *rpc_call_null(struct rpc_clnt *clnt, struct rpc_cred *cred, | 144 | struct rpc_task *rpc_call_null(struct rpc_clnt *clnt, struct rpc_cred *cred, |
145 | int flags); | 145 | int flags); |
146 | void rpc_restart_call_prepare(struct rpc_task *); | ||
146 | void rpc_restart_call(struct rpc_task *); | 147 | void rpc_restart_call(struct rpc_task *); |
147 | void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int); | 148 | void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int); |
148 | size_t rpc_max_payload(struct rpc_clnt *); | 149 | size_t rpc_max_payload(struct rpc_clnt *); |
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index 64981a2f1cae..401097781fc0 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h | |||
@@ -210,6 +210,8 @@ struct rpc_wait_queue { | |||
210 | */ | 210 | */ |
211 | struct rpc_task *rpc_new_task(const struct rpc_task_setup *); | 211 | struct rpc_task *rpc_new_task(const struct rpc_task_setup *); |
212 | struct rpc_task *rpc_run_task(const struct rpc_task_setup *); | 212 | struct rpc_task *rpc_run_task(const struct rpc_task_setup *); |
213 | struct rpc_task *rpc_run_bc_task(struct rpc_rqst *req, | ||
214 | const struct rpc_call_ops *ops); | ||
213 | void rpc_put_task(struct rpc_task *); | 215 | void rpc_put_task(struct rpc_task *); |
214 | void rpc_exit_task(struct rpc_task *); | 216 | void rpc_exit_task(struct rpc_task *); |
215 | void rpc_release_calldata(const struct rpc_call_ops *, void *); | 217 | void rpc_release_calldata(const struct rpc_call_ops *, void *); |
@@ -237,6 +239,7 @@ void rpc_show_tasks(void); | |||
237 | int rpc_init_mempool(void); | 239 | int rpc_init_mempool(void); |
238 | void rpc_destroy_mempool(void); | 240 | void rpc_destroy_mempool(void); |
239 | extern struct workqueue_struct *rpciod_workqueue; | 241 | extern struct workqueue_struct *rpciod_workqueue; |
242 | void rpc_prepare_task(struct rpc_task *task); | ||
240 | 243 | ||
241 | static inline void rpc_exit(struct rpc_task *task, int status) | 244 | static inline void rpc_exit(struct rpc_task *task, int status) |
242 | { | 245 | { |
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 2a30775959e9..ea8009695c69 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
@@ -96,6 +96,15 @@ struct svc_serv { | |||
96 | svc_thread_fn sv_function; /* main function for threads */ | 96 | svc_thread_fn sv_function; /* main function for threads */ |
97 | unsigned int sv_drc_max_pages; /* Total pages for DRC */ | 97 | unsigned int sv_drc_max_pages; /* Total pages for DRC */ |
98 | unsigned int sv_drc_pages_used;/* DRC pages used */ | 98 | unsigned int sv_drc_pages_used;/* DRC pages used */ |
99 | #if defined(CONFIG_NFS_V4_1) | ||
100 | struct list_head sv_cb_list; /* queue for callback requests | ||
101 | * that arrive over the same | ||
102 | * connection */ | ||
103 | spinlock_t sv_cb_lock; /* protects the svc_cb_list */ | ||
104 | wait_queue_head_t sv_cb_waitq; /* sleep here if there are no | ||
105 | * entries in the svc_cb_list */ | ||
106 | struct svc_xprt *bc_xprt; | ||
107 | #endif /* CONFIG_NFS_V4_1 */ | ||
99 | }; | 108 | }; |
100 | 109 | ||
101 | /* | 110 | /* |
@@ -411,6 +420,8 @@ int svc_set_num_threads(struct svc_serv *, struct svc_pool *, int); | |||
411 | int svc_pool_stats_open(struct svc_serv *serv, struct file *file); | 420 | int svc_pool_stats_open(struct svc_serv *serv, struct file *file); |
412 | void svc_destroy(struct svc_serv *); | 421 | void svc_destroy(struct svc_serv *); |
413 | int svc_process(struct svc_rqst *); | 422 | int svc_process(struct svc_rqst *); |
423 | int bc_svc_process(struct svc_serv *, struct rpc_rqst *, | ||
424 | struct svc_rqst *); | ||
414 | int svc_register(const struct svc_serv *, const int, | 425 | int svc_register(const struct svc_serv *, const int, |
415 | const unsigned short, const unsigned short); | 426 | const unsigned short, const unsigned short); |
416 | 427 | ||
diff --git a/include/linux/sunrpc/svc_xprt.h b/include/linux/sunrpc/svc_xprt.h index 0d9cb6ef28b0..2223ae0b5ed5 100644 --- a/include/linux/sunrpc/svc_xprt.h +++ b/include/linux/sunrpc/svc_xprt.h | |||
@@ -83,7 +83,7 @@ int svc_port_is_privileged(struct sockaddr *sin); | |||
83 | int svc_print_xprts(char *buf, int maxlen); | 83 | int svc_print_xprts(char *buf, int maxlen); |
84 | struct svc_xprt *svc_find_xprt(struct svc_serv *serv, const char *xcl_name, | 84 | struct svc_xprt *svc_find_xprt(struct svc_serv *serv, const char *xcl_name, |
85 | const sa_family_t af, const unsigned short port); | 85 | const sa_family_t af, const unsigned short port); |
86 | int svc_xprt_names(struct svc_serv *serv, char *buf, int buflen); | 86 | int svc_xprt_names(struct svc_serv *serv, char *buf, const int buflen); |
87 | 87 | ||
88 | static inline void svc_xprt_get(struct svc_xprt *xprt) | 88 | static inline void svc_xprt_get(struct svc_xprt *xprt) |
89 | { | 89 | { |
@@ -118,7 +118,7 @@ static inline unsigned short svc_addr_port(const struct sockaddr *sa) | |||
118 | return 0; | 118 | return 0; |
119 | } | 119 | } |
120 | 120 | ||
121 | static inline size_t svc_addr_len(struct sockaddr *sa) | 121 | static inline size_t svc_addr_len(const struct sockaddr *sa) |
122 | { | 122 | { |
123 | switch (sa->sa_family) { | 123 | switch (sa->sa_family) { |
124 | case AF_INET: | 124 | case AF_INET: |
@@ -126,7 +126,8 @@ static inline size_t svc_addr_len(struct sockaddr *sa) | |||
126 | case AF_INET6: | 126 | case AF_INET6: |
127 | return sizeof(struct sockaddr_in6); | 127 | return sizeof(struct sockaddr_in6); |
128 | } | 128 | } |
129 | return -EAFNOSUPPORT; | 129 | |
130 | return 0; | ||
130 | } | 131 | } |
131 | 132 | ||
132 | static inline unsigned short svc_xprt_local_port(const struct svc_xprt *xprt) | 133 | static inline unsigned short svc_xprt_local_port(const struct svc_xprt *xprt) |
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h index 483e10380aae..04dba23c59f2 100644 --- a/include/linux/sunrpc/svcsock.h +++ b/include/linux/sunrpc/svcsock.h | |||
@@ -38,10 +38,15 @@ int svc_recv(struct svc_rqst *, long); | |||
38 | int svc_send(struct svc_rqst *); | 38 | int svc_send(struct svc_rqst *); |
39 | void svc_drop(struct svc_rqst *); | 39 | void svc_drop(struct svc_rqst *); |
40 | void svc_sock_update_bufs(struct svc_serv *serv); | 40 | void svc_sock_update_bufs(struct svc_serv *serv); |
41 | int svc_sock_names(char *buf, struct svc_serv *serv, char *toclose); | 41 | int svc_sock_names(struct svc_serv *serv, char *buf, |
42 | int svc_addsock(struct svc_serv *serv, int fd, char *name_return); | 42 | const size_t buflen, |
43 | const char *toclose); | ||
44 | int svc_addsock(struct svc_serv *serv, const int fd, | ||
45 | char *name_return, const size_t len); | ||
43 | void svc_init_xprt_sock(void); | 46 | void svc_init_xprt_sock(void); |
44 | void svc_cleanup_xprt_sock(void); | 47 | void svc_cleanup_xprt_sock(void); |
48 | struct svc_xprt *svc_sock_create(struct svc_serv *serv, int prot); | ||
49 | void svc_sock_destroy(struct svc_xprt *); | ||
45 | 50 | ||
46 | /* | 51 | /* |
47 | * svc_makesock socket characteristics | 52 | * svc_makesock socket characteristics |
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index d8910b68e1bd..b99c625fddfe 100644 --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h | |||
@@ -12,7 +12,6 @@ | |||
12 | #include <linux/uio.h> | 12 | #include <linux/uio.h> |
13 | #include <asm/byteorder.h> | 13 | #include <asm/byteorder.h> |
14 | #include <linux/scatterlist.h> | 14 | #include <linux/scatterlist.h> |
15 | #include <linux/smp_lock.h> | ||
16 | 15 | ||
17 | /* | 16 | /* |
18 | * Buffer adjustment | 17 | * Buffer adjustment |
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index 08afe43118f4..1175d58efc2e 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
@@ -67,7 +67,8 @@ struct rpc_rqst { | |||
67 | struct rpc_task * rq_task; /* RPC task data */ | 67 | struct rpc_task * rq_task; /* RPC task data */ |
68 | __be32 rq_xid; /* request XID */ | 68 | __be32 rq_xid; /* request XID */ |
69 | int rq_cong; /* has incremented xprt->cong */ | 69 | int rq_cong; /* has incremented xprt->cong */ |
70 | int rq_received; /* receive completed */ | 70 | int rq_reply_bytes_recvd; /* number of reply */ |
71 | /* bytes received */ | ||
71 | u32 rq_seqno; /* gss seq no. used on req. */ | 72 | u32 rq_seqno; /* gss seq no. used on req. */ |
72 | int rq_enc_pages_num; | 73 | int rq_enc_pages_num; |
73 | struct page **rq_enc_pages; /* scratch pages for use by | 74 | struct page **rq_enc_pages; /* scratch pages for use by |
@@ -97,6 +98,12 @@ struct rpc_rqst { | |||
97 | 98 | ||
98 | unsigned long rq_xtime; /* when transmitted */ | 99 | unsigned long rq_xtime; /* when transmitted */ |
99 | int rq_ntrans; | 100 | int rq_ntrans; |
101 | |||
102 | #if defined(CONFIG_NFS_V4_1) | ||
103 | struct list_head rq_bc_list; /* Callback service list */ | ||
104 | unsigned long rq_bc_pa_state; /* Backchannel prealloc state */ | ||
105 | struct list_head rq_bc_pa_list; /* Backchannel prealloc list */ | ||
106 | #endif /* CONFIG_NFS_V4_1 */ | ||
100 | }; | 107 | }; |
101 | #define rq_svec rq_snd_buf.head | 108 | #define rq_svec rq_snd_buf.head |
102 | #define rq_slen rq_snd_buf.len | 109 | #define rq_slen rq_snd_buf.len |
@@ -174,6 +181,15 @@ struct rpc_xprt { | |||
174 | spinlock_t reserve_lock; /* lock slot table */ | 181 | spinlock_t reserve_lock; /* lock slot table */ |
175 | u32 xid; /* Next XID value to use */ | 182 | u32 xid; /* Next XID value to use */ |
176 | struct rpc_task * snd_task; /* Task blocked in send */ | 183 | struct rpc_task * snd_task; /* Task blocked in send */ |
184 | #if defined(CONFIG_NFS_V4_1) | ||
185 | struct svc_serv *bc_serv; /* The RPC service which will */ | ||
186 | /* process the callback */ | ||
187 | unsigned int bc_alloc_count; /* Total number of preallocs */ | ||
188 | spinlock_t bc_pa_lock; /* Protects the preallocated | ||
189 | * items */ | ||
190 | struct list_head bc_pa_list; /* List of preallocated | ||
191 | * backchannel rpc_rqst's */ | ||
192 | #endif /* CONFIG_NFS_V4_1 */ | ||
177 | struct list_head recv; | 193 | struct list_head recv; |
178 | 194 | ||
179 | struct { | 195 | struct { |
@@ -192,6 +208,26 @@ struct rpc_xprt { | |||
192 | const char *address_strings[RPC_DISPLAY_MAX]; | 208 | const char *address_strings[RPC_DISPLAY_MAX]; |
193 | }; | 209 | }; |
194 | 210 | ||
211 | #if defined(CONFIG_NFS_V4_1) | ||
212 | /* | ||
213 | * Backchannel flags | ||
214 | */ | ||
215 | #define RPC_BC_PA_IN_USE 0x0001 /* Preallocated backchannel */ | ||
216 | /* buffer in use */ | ||
217 | #endif /* CONFIG_NFS_V4_1 */ | ||
218 | |||
219 | #if defined(CONFIG_NFS_V4_1) | ||
220 | static inline int bc_prealloc(struct rpc_rqst *req) | ||
221 | { | ||
222 | return test_bit(RPC_BC_PA_IN_USE, &req->rq_bc_pa_state); | ||
223 | } | ||
224 | #else | ||
225 | static inline int bc_prealloc(struct rpc_rqst *req) | ||
226 | { | ||
227 | return 0; | ||
228 | } | ||
229 | #endif /* CONFIG_NFS_V4_1 */ | ||
230 | |||
195 | struct xprt_create { | 231 | struct xprt_create { |
196 | int ident; /* XPRT_TRANSPORT identifier */ | 232 | int ident; /* XPRT_TRANSPORT identifier */ |
197 | struct sockaddr * srcaddr; /* optional local address */ | 233 | struct sockaddr * srcaddr; /* optional local address */ |
diff --git a/include/linux/swap.h b/include/linux/swap.h index 0cedf31af0b0..7c15334f3ff2 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -298,8 +298,8 @@ extern int try_to_free_swap(struct page *); | |||
298 | struct backing_dev_info; | 298 | struct backing_dev_info; |
299 | 299 | ||
300 | /* linux/mm/thrash.c */ | 300 | /* linux/mm/thrash.c */ |
301 | extern struct mm_struct * swap_token_mm; | 301 | extern struct mm_struct *swap_token_mm; |
302 | extern void grab_swap_token(void); | 302 | extern void grab_swap_token(struct mm_struct *); |
303 | extern void __put_swap_token(struct mm_struct *); | 303 | extern void __put_swap_token(struct mm_struct *); |
304 | 304 | ||
305 | static inline int has_swap_token(struct mm_struct *mm) | 305 | static inline int has_swap_token(struct mm_struct *mm) |
@@ -319,10 +319,11 @@ static inline void disable_swap_token(void) | |||
319 | } | 319 | } |
320 | 320 | ||
321 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR | 321 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR |
322 | extern void mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent); | 322 | extern void |
323 | mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout); | ||
323 | #else | 324 | #else |
324 | static inline void | 325 | static inline void |
325 | mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent) | 326 | mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout) |
326 | { | 327 | { |
327 | } | 328 | } |
328 | #endif | 329 | #endif |
@@ -418,16 +419,10 @@ static inline swp_entry_t get_swap_page(void) | |||
418 | } | 419 | } |
419 | 420 | ||
420 | /* linux/mm/thrash.c */ | 421 | /* linux/mm/thrash.c */ |
421 | #define put_swap_token(x) do { } while(0) | 422 | #define put_swap_token(mm) do { } while (0) |
422 | #define grab_swap_token() do { } while(0) | 423 | #define grab_swap_token(mm) do { } while (0) |
423 | #define has_swap_token(x) 0 | 424 | #define has_swap_token(mm) 0 |
424 | #define disable_swap_token() do { } while(0) | 425 | #define disable_swap_token() do { } while (0) |
425 | |||
426 | static inline int mem_cgroup_cache_charge_swapin(struct page *page, | ||
427 | struct mm_struct *mm, gfp_t mask, bool locked) | ||
428 | { | ||
429 | return 0; | ||
430 | } | ||
431 | 426 | ||
432 | static inline void | 427 | static inline void |
433 | mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent) | 428 | mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent) |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index fa4242cdade8..80de7003d8c2 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -321,6 +321,8 @@ asmlinkage long sys_rt_sigtimedwait(const sigset_t __user *uthese, | |||
321 | siginfo_t __user *uinfo, | 321 | siginfo_t __user *uinfo, |
322 | const struct timespec __user *uts, | 322 | const struct timespec __user *uts, |
323 | size_t sigsetsize); | 323 | size_t sigsetsize); |
324 | asmlinkage long sys_rt_tgsigqueueinfo(pid_t tgid, pid_t pid, int sig, | ||
325 | siginfo_t __user *uinfo); | ||
324 | asmlinkage long sys_kill(int pid, int sig); | 326 | asmlinkage long sys_kill(int pid, int sig); |
325 | asmlinkage long sys_tgkill(int tgid, int pid, int sig); | 327 | asmlinkage long sys_tgkill(int tgid, int pid, int sig); |
326 | asmlinkage long sys_tkill(int pid, int sig); | 328 | asmlinkage long sys_tkill(int pid, int sig); |
diff --git a/include/linux/sysrq.h b/include/linux/sysrq.h index 98a1d8cfb73d..99adcdc0d3ca 100644 --- a/include/linux/sysrq.h +++ b/include/linux/sysrq.h | |||
@@ -14,6 +14,8 @@ | |||
14 | #ifndef _LINUX_SYSRQ_H | 14 | #ifndef _LINUX_SYSRQ_H |
15 | #define _LINUX_SYSRQ_H | 15 | #define _LINUX_SYSRQ_H |
16 | 16 | ||
17 | #include <linux/errno.h> | ||
18 | |||
17 | struct pt_regs; | 19 | struct pt_regs; |
18 | struct tty_struct; | 20 | struct tty_struct; |
19 | 21 | ||
diff --git a/include/linux/timer.h b/include/linux/timer.h index ccf882eed8f8..be62ec2ebea5 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h | |||
@@ -190,6 +190,8 @@ extern unsigned long get_next_timer_interrupt(unsigned long now); | |||
190 | */ | 190 | */ |
191 | #ifdef CONFIG_TIMER_STATS | 191 | #ifdef CONFIG_TIMER_STATS |
192 | 192 | ||
193 | extern int timer_stats_active; | ||
194 | |||
193 | #define TIMER_STATS_FLAG_DEFERRABLE 0x1 | 195 | #define TIMER_STATS_FLAG_DEFERRABLE 0x1 |
194 | 196 | ||
195 | extern void init_timer_stats(void); | 197 | extern void init_timer_stats(void); |
@@ -203,6 +205,8 @@ extern void __timer_stats_timer_set_start_info(struct timer_list *timer, | |||
203 | 205 | ||
204 | static inline void timer_stats_timer_set_start_info(struct timer_list *timer) | 206 | static inline void timer_stats_timer_set_start_info(struct timer_list *timer) |
205 | { | 207 | { |
208 | if (likely(!timer_stats_active)) | ||
209 | return; | ||
206 | __timer_stats_timer_set_start_info(timer, __builtin_return_address(0)); | 210 | __timer_stats_timer_set_start_info(timer, __builtin_return_address(0)); |
207 | } | 211 | } |
208 | 212 | ||
diff --git a/include/linux/trace_seq.h b/include/linux/trace_seq.h index c68bccba2074..c134dd1fe6b6 100644 --- a/include/linux/trace_seq.h +++ b/include/linux/trace_seq.h | |||
@@ -3,6 +3,8 @@ | |||
3 | 3 | ||
4 | #include <linux/fs.h> | 4 | #include <linux/fs.h> |
5 | 5 | ||
6 | #include <asm/page.h> | ||
7 | |||
6 | /* | 8 | /* |
7 | * Trace sequences are used to allow a function to call several other functions | 9 | * Trace sequences are used to allow a function to call several other functions |
8 | * to create a string of data to use (up to a max of PAGE_SIZE. | 10 | * to create a string of data to use (up to a max of PAGE_SIZE. |
diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h index eb96603d92db..17ba82efa483 100644 --- a/include/linux/tracehook.h +++ b/include/linux/tracehook.h | |||
@@ -143,7 +143,7 @@ static inline void tracehook_report_syscall_exit(struct pt_regs *regs, int step) | |||
143 | * | 143 | * |
144 | * Return %LSM_UNSAFE_* bits applied to an exec because of tracing. | 144 | * Return %LSM_UNSAFE_* bits applied to an exec because of tracing. |
145 | * | 145 | * |
146 | * Called with task_lock() held on @task. | 146 | * @task->cred_guard_mutex is held by the caller through the do_execve(). |
147 | */ | 147 | */ |
148 | static inline int tracehook_unsafe_exec(struct task_struct *task) | 148 | static inline int tracehook_unsafe_exec(struct task_struct *task) |
149 | { | 149 | { |
diff --git a/include/linux/tty.h b/include/linux/tty.h index 1488d8c81aac..0d3974f59c53 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -23,7 +23,7 @@ | |||
23 | */ | 23 | */ |
24 | #define NR_UNIX98_PTY_DEFAULT 4096 /* Default maximum for Unix98 ptys */ | 24 | #define NR_UNIX98_PTY_DEFAULT 4096 /* Default maximum for Unix98 ptys */ |
25 | #define NR_UNIX98_PTY_MAX (1 << MINORBITS) /* Absolute limit */ | 25 | #define NR_UNIX98_PTY_MAX (1 << MINORBITS) /* Absolute limit */ |
26 | #define NR_LDISCS 19 | 26 | #define NR_LDISCS 20 |
27 | 27 | ||
28 | /* line disciplines */ | 28 | /* line disciplines */ |
29 | #define N_TTY 0 | 29 | #define N_TTY 0 |
@@ -47,6 +47,8 @@ | |||
47 | #define N_SLCAN 17 /* Serial / USB serial CAN Adaptors */ | 47 | #define N_SLCAN 17 /* Serial / USB serial CAN Adaptors */ |
48 | #define N_PPS 18 /* Pulse per Second */ | 48 | #define N_PPS 18 /* Pulse per Second */ |
49 | 49 | ||
50 | #define N_V253 19 /* Codec control over voice modem */ | ||
51 | |||
50 | /* | 52 | /* |
51 | * This character is the same as _POSIX_VDISABLE: it cannot be used as | 53 | * This character is the same as _POSIX_VDISABLE: it cannot be used as |
52 | * a c_cc[] character, but indicates that a particular special character | 54 | * a c_cc[] character, but indicates that a particular special character |
@@ -394,6 +396,7 @@ extern void __do_SAK(struct tty_struct *tty); | |||
394 | extern void disassociate_ctty(int priv); | 396 | extern void disassociate_ctty(int priv); |
395 | extern void no_tty(void); | 397 | extern void no_tty(void); |
396 | extern void tty_flip_buffer_push(struct tty_struct *tty); | 398 | extern void tty_flip_buffer_push(struct tty_struct *tty); |
399 | extern void tty_flush_to_ldisc(struct tty_struct *tty); | ||
397 | extern void tty_buffer_free_all(struct tty_struct *tty); | 400 | extern void tty_buffer_free_all(struct tty_struct *tty); |
398 | extern void tty_buffer_flush(struct tty_struct *tty); | 401 | extern void tty_buffer_flush(struct tty_struct *tty); |
399 | extern void tty_buffer_init(struct tty_struct *tty); | 402 | extern void tty_buffer_init(struct tty_struct *tty); |
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h index 40f38d896777..0c4ee9b88f85 100644 --- a/include/linux/tty_ldisc.h +++ b/include/linux/tty_ldisc.h | |||
@@ -144,7 +144,7 @@ struct tty_ldisc_ops { | |||
144 | 144 | ||
145 | struct tty_ldisc { | 145 | struct tty_ldisc { |
146 | struct tty_ldisc_ops *ops; | 146 | struct tty_ldisc_ops *ops; |
147 | int refcount; | 147 | atomic_t users; |
148 | }; | 148 | }; |
149 | 149 | ||
150 | #define TTY_LDISC_MAGIC 0x5403 | 150 | #define TTY_LDISC_MAGIC 0x5403 |
diff --git a/include/linux/types.h b/include/linux/types.h index 5abe354020f9..c42724f8c802 100644 --- a/include/linux/types.h +++ b/include/linux/types.h | |||
@@ -131,7 +131,7 @@ typedef __s64 int64_t; | |||
131 | * | 131 | * |
132 | * blkcnt_t is the type of the inode's block count. | 132 | * blkcnt_t is the type of the inode's block count. |
133 | */ | 133 | */ |
134 | #ifdef CONFIG_LBD | 134 | #ifdef CONFIG_LBDAF |
135 | typedef u64 sector_t; | 135 | typedef u64 sector_t; |
136 | typedef u64 blkcnt_t; | 136 | typedef u64 blkcnt_t; |
137 | #else | 137 | #else |
diff --git a/include/linux/ucb1400.h b/include/linux/ucb1400.h index 970473bf8d5a..ae779bb8cc0f 100644 --- a/include/linux/ucb1400.h +++ b/include/linux/ucb1400.h | |||
@@ -73,6 +73,10 @@ | |||
73 | 73 | ||
74 | #define UCB_ADC_DATA 0x68 | 74 | #define UCB_ADC_DATA 0x68 |
75 | #define UCB_ADC_DAT_VALID (1 << 15) | 75 | #define UCB_ADC_DAT_VALID (1 << 15) |
76 | |||
77 | #define UCB_FCSR 0x6c | ||
78 | #define UCB_FCSR_AVE (1 << 12) | ||
79 | |||
76 | #define UCB_ADC_DAT_MASK 0x3ff | 80 | #define UCB_ADC_DAT_MASK 0x3ff |
77 | 81 | ||
78 | #define UCB_ID 0x7e | 82 | #define UCB_ID 0x7e |
@@ -134,28 +138,13 @@ static inline void ucb1400_adc_enable(struct snd_ac97 *ac97) | |||
134 | ucb1400_reg_write(ac97, UCB_ADC_CR, UCB_ADC_ENA); | 138 | ucb1400_reg_write(ac97, UCB_ADC_CR, UCB_ADC_ENA); |
135 | } | 139 | } |
136 | 140 | ||
137 | static unsigned int ucb1400_adc_read(struct snd_ac97 *ac97, u16 adc_channel, | ||
138 | int adcsync) | ||
139 | { | ||
140 | unsigned int val; | ||
141 | |||
142 | if (adcsync) | ||
143 | adc_channel |= UCB_ADC_SYNC_ENA; | ||
144 | |||
145 | ucb1400_reg_write(ac97, UCB_ADC_CR, UCB_ADC_ENA | adc_channel); | ||
146 | ucb1400_reg_write(ac97, UCB_ADC_CR, UCB_ADC_ENA | adc_channel | | ||
147 | UCB_ADC_START); | ||
148 | |||
149 | while (!((val = ucb1400_reg_read(ac97, UCB_ADC_DATA)) | ||
150 | & UCB_ADC_DAT_VALID)) | ||
151 | schedule_timeout_uninterruptible(1); | ||
152 | |||
153 | return val & UCB_ADC_DAT_MASK; | ||
154 | } | ||
155 | |||
156 | static inline void ucb1400_adc_disable(struct snd_ac97 *ac97) | 141 | static inline void ucb1400_adc_disable(struct snd_ac97 *ac97) |
157 | { | 142 | { |
158 | ucb1400_reg_write(ac97, UCB_ADC_CR, 0); | 143 | ucb1400_reg_write(ac97, UCB_ADC_CR, 0); |
159 | } | 144 | } |
160 | 145 | ||
146 | |||
147 | unsigned int ucb1400_adc_read(struct snd_ac97 *ac97, u16 adc_channel, | ||
148 | int adcsync); | ||
149 | |||
161 | #endif | 150 | #endif |
diff --git a/include/linux/uio.h b/include/linux/uio.h index b7fe13883bdb..98c114323a8b 100644 --- a/include/linux/uio.h +++ b/include/linux/uio.h | |||
@@ -19,15 +19,6 @@ struct iovec | |||
19 | __kernel_size_t iov_len; /* Must be size_t (1003.1g) */ | 19 | __kernel_size_t iov_len; /* Must be size_t (1003.1g) */ |
20 | }; | 20 | }; |
21 | 21 | ||
22 | #ifdef __KERNEL__ | ||
23 | |||
24 | struct kvec { | ||
25 | void *iov_base; /* and that should *never* hold a userland pointer */ | ||
26 | size_t iov_len; | ||
27 | }; | ||
28 | |||
29 | #endif | ||
30 | |||
31 | /* | 22 | /* |
32 | * UIO_MAXIOV shall be at least 16 1003.1g (5.4.1.1) | 23 | * UIO_MAXIOV shall be at least 16 1003.1g (5.4.1.1) |
33 | */ | 24 | */ |
@@ -35,6 +26,13 @@ struct kvec { | |||
35 | #define UIO_FASTIOV 8 | 26 | #define UIO_FASTIOV 8 |
36 | #define UIO_MAXIOV 1024 | 27 | #define UIO_MAXIOV 1024 |
37 | 28 | ||
29 | #ifdef __KERNEL__ | ||
30 | |||
31 | struct kvec { | ||
32 | void *iov_base; /* and that should *never* hold a userland pointer */ | ||
33 | size_t iov_len; | ||
34 | }; | ||
35 | |||
38 | /* | 36 | /* |
39 | * Total number of bytes covered by an iovec. | 37 | * Total number of bytes covered by an iovec. |
40 | * | 38 | * |
@@ -53,5 +51,6 @@ static inline size_t iov_length(const struct iovec *iov, unsigned long nr_segs) | |||
53 | } | 51 | } |
54 | 52 | ||
55 | unsigned long iov_shorten(struct iovec *iov, unsigned long nr_segs, size_t to); | 53 | unsigned long iov_shorten(struct iovec *iov, unsigned long nr_segs, size_t to); |
54 | #endif | ||
56 | 55 | ||
57 | #endif | 56 | #endif |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 84929e914034..b1e3c2fbfe11 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -888,8 +888,6 @@ struct usb_driver { | |||
888 | * struct usb_device_driver - identifies USB device driver to usbcore | 888 | * struct usb_device_driver - identifies USB device driver to usbcore |
889 | * @name: The driver name should be unique among USB drivers, | 889 | * @name: The driver name should be unique among USB drivers, |
890 | * and should normally be the same as the module name. | 890 | * and should normally be the same as the module name. |
891 | * @nodename: Callback to provide a naming hint for a possible | ||
892 | * device node to create. | ||
893 | * @probe: Called to see if the driver is willing to manage a particular | 891 | * @probe: Called to see if the driver is willing to manage a particular |
894 | * device. If it is, probe returns zero and uses dev_set_drvdata() | 892 | * device. If it is, probe returns zero and uses dev_set_drvdata() |
895 | * to associate driver-specific data with the device. If unwilling | 893 | * to associate driver-specific data with the device. If unwilling |
@@ -924,6 +922,8 @@ extern struct bus_type usb_bus_type; | |||
924 | /** | 922 | /** |
925 | * struct usb_class_driver - identifies a USB driver that wants to use the USB major number | 923 | * struct usb_class_driver - identifies a USB driver that wants to use the USB major number |
926 | * @name: the usb class device name for this driver. Will show up in sysfs. | 924 | * @name: the usb class device name for this driver. Will show up in sysfs. |
925 | * @nodename: Callback to provide a naming hint for a possible | ||
926 | * device node to create. | ||
927 | * @fops: pointer to the struct file_operations of this driver. | 927 | * @fops: pointer to the struct file_operations of this driver. |
928 | * @minor_base: the start of the minor range for this driver. | 928 | * @minor_base: the start of the minor range for this driver. |
929 | * | 929 | * |
@@ -1046,6 +1046,8 @@ typedef void (*usb_complete_t)(struct urb *); | |||
1046 | * the device driver is saying that it provided this DMA address, | 1046 | * the device driver is saying that it provided this DMA address, |
1047 | * which the host controller driver should use in preference to the | 1047 | * which the host controller driver should use in preference to the |
1048 | * transfer_buffer. | 1048 | * transfer_buffer. |
1049 | * @sg: scatter gather buffer list | ||
1050 | * @num_sgs: number of entries in the sg list | ||
1049 | * @transfer_buffer_length: How big is transfer_buffer. The transfer may | 1051 | * @transfer_buffer_length: How big is transfer_buffer. The transfer may |
1050 | * be broken up into chunks according to the current maximum packet | 1052 | * be broken up into chunks according to the current maximum packet |
1051 | * size for the endpoint, which is a function of the configuration | 1053 | * size for the endpoint, which is a function of the configuration |
diff --git a/include/linux/usb/langwell_otg.h b/include/linux/usb/langwell_otg.h deleted file mode 100644 index e115ae6df1da..000000000000 --- a/include/linux/usb/langwell_otg.h +++ /dev/null | |||
@@ -1,177 +0,0 @@ | |||
1 | /* | ||
2 | * Intel Langwell USB OTG transceiver driver | ||
3 | * Copyright (C) 2008, Intel Corporation. | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it | ||
6 | * under the terms and conditions of the GNU General Public License, | ||
7 | * version 2, as published by the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
12 | * more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License along with | ||
15 | * this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
17 | * | ||
18 | */ | ||
19 | |||
20 | #ifndef __LANGWELL_OTG_H__ | ||
21 | #define __LANGWELL_OTG_H__ | ||
22 | |||
23 | /* notify transceiver driver about OTG events */ | ||
24 | extern void langwell_update_transceiver(void); | ||
25 | /* HCD register bus driver */ | ||
26 | extern int langwell_register_host(struct pci_driver *host_driver); | ||
27 | /* HCD unregister bus driver */ | ||
28 | extern void langwell_unregister_host(struct pci_driver *host_driver); | ||
29 | /* DCD register bus driver */ | ||
30 | extern int langwell_register_peripheral(struct pci_driver *client_driver); | ||
31 | /* DCD unregister bus driver */ | ||
32 | extern void langwell_unregister_peripheral(struct pci_driver *client_driver); | ||
33 | /* No silent failure, output warning message */ | ||
34 | extern void langwell_otg_nsf_msg(unsigned long message); | ||
35 | |||
36 | #define CI_USBCMD 0x30 | ||
37 | # define USBCMD_RST BIT(1) | ||
38 | # define USBCMD_RS BIT(0) | ||
39 | #define CI_USBSTS 0x34 | ||
40 | # define USBSTS_SLI BIT(8) | ||
41 | # define USBSTS_URI BIT(6) | ||
42 | # define USBSTS_PCI BIT(2) | ||
43 | #define CI_PORTSC1 0x74 | ||
44 | # define PORTSC_PP BIT(12) | ||
45 | # define PORTSC_LS (BIT(11) | BIT(10)) | ||
46 | # define PORTSC_SUSP BIT(7) | ||
47 | # define PORTSC_CCS BIT(0) | ||
48 | #define CI_HOSTPC1 0xb4 | ||
49 | # define HOSTPC1_PHCD BIT(22) | ||
50 | #define CI_OTGSC 0xf4 | ||
51 | # define OTGSC_DPIE BIT(30) | ||
52 | # define OTGSC_1MSE BIT(29) | ||
53 | # define OTGSC_BSEIE BIT(28) | ||
54 | # define OTGSC_BSVIE BIT(27) | ||
55 | # define OTGSC_ASVIE BIT(26) | ||
56 | # define OTGSC_AVVIE BIT(25) | ||
57 | # define OTGSC_IDIE BIT(24) | ||
58 | # define OTGSC_DPIS BIT(22) | ||
59 | # define OTGSC_1MSS BIT(21) | ||
60 | # define OTGSC_BSEIS BIT(20) | ||
61 | # define OTGSC_BSVIS BIT(19) | ||
62 | # define OTGSC_ASVIS BIT(18) | ||
63 | # define OTGSC_AVVIS BIT(17) | ||
64 | # define OTGSC_IDIS BIT(16) | ||
65 | # define OTGSC_DPS BIT(14) | ||
66 | # define OTGSC_1MST BIT(13) | ||
67 | # define OTGSC_BSE BIT(12) | ||
68 | # define OTGSC_BSV BIT(11) | ||
69 | # define OTGSC_ASV BIT(10) | ||
70 | # define OTGSC_AVV BIT(9) | ||
71 | # define OTGSC_ID BIT(8) | ||
72 | # define OTGSC_HABA BIT(7) | ||
73 | # define OTGSC_HADP BIT(6) | ||
74 | # define OTGSC_IDPU BIT(5) | ||
75 | # define OTGSC_DP BIT(4) | ||
76 | # define OTGSC_OT BIT(3) | ||
77 | # define OTGSC_HAAR BIT(2) | ||
78 | # define OTGSC_VC BIT(1) | ||
79 | # define OTGSC_VD BIT(0) | ||
80 | # define OTGSC_INTEN_MASK (0x7f << 24) | ||
81 | # define OTGSC_INTSTS_MASK (0x7f << 16) | ||
82 | #define CI_USBMODE 0xf8 | ||
83 | # define USBMODE_CM (BIT(1) | BIT(0)) | ||
84 | # define USBMODE_IDLE 0 | ||
85 | # define USBMODE_DEVICE 0x2 | ||
86 | # define USBMODE_HOST 0x3 | ||
87 | |||
88 | #define INTR_DUMMY_MASK (USBSTS_SLI | USBSTS_URI | USBSTS_PCI) | ||
89 | |||
90 | struct otg_hsm { | ||
91 | /* Input */ | ||
92 | int a_bus_resume; | ||
93 | int a_bus_suspend; | ||
94 | int a_conn; | ||
95 | int a_sess_vld; | ||
96 | int a_srp_det; | ||
97 | int a_vbus_vld; | ||
98 | int b_bus_resume; | ||
99 | int b_bus_suspend; | ||
100 | int b_conn; | ||
101 | int b_se0_srp; | ||
102 | int b_sess_end; | ||
103 | int b_sess_vld; | ||
104 | int id; | ||
105 | |||
106 | /* Internal variables */ | ||
107 | int a_set_b_hnp_en; | ||
108 | int b_srp_done; | ||
109 | int b_hnp_enable; | ||
110 | |||
111 | /* Timeout indicator for timers */ | ||
112 | int a_wait_vrise_tmout; | ||
113 | int a_wait_bcon_tmout; | ||
114 | int a_aidl_bdis_tmout; | ||
115 | int b_ase0_brst_tmout; | ||
116 | int b_bus_suspend_tmout; | ||
117 | int b_srp_res_tmout; | ||
118 | |||
119 | /* Informative variables */ | ||
120 | int a_bus_drop; | ||
121 | int a_bus_req; | ||
122 | int a_clr_err; | ||
123 | int a_suspend_req; | ||
124 | int b_bus_req; | ||
125 | |||
126 | /* Output */ | ||
127 | int drv_vbus; | ||
128 | int loc_conn; | ||
129 | int loc_sof; | ||
130 | |||
131 | /* Others */ | ||
132 | int b_bus_suspend_vld; | ||
133 | }; | ||
134 | |||
135 | #define TA_WAIT_VRISE 100 | ||
136 | #define TA_WAIT_BCON 30000 | ||
137 | #define TA_AIDL_BDIS 15000 | ||
138 | #define TB_ASE0_BRST 5000 | ||
139 | #define TB_SE0_SRP 2 | ||
140 | #define TB_SRP_RES 100 | ||
141 | #define TB_BUS_SUSPEND 500 | ||
142 | |||
143 | struct langwell_otg_timer { | ||
144 | unsigned long expires; /* Number of count increase to timeout */ | ||
145 | unsigned long count; /* Tick counter */ | ||
146 | void (*function)(unsigned long); /* Timeout function */ | ||
147 | unsigned long data; /* Data passed to function */ | ||
148 | struct list_head list; | ||
149 | }; | ||
150 | |||
151 | struct langwell_otg { | ||
152 | struct otg_transceiver otg; | ||
153 | struct otg_hsm hsm; | ||
154 | void __iomem *regs; | ||
155 | unsigned region; | ||
156 | struct pci_driver *host_ops; | ||
157 | struct pci_driver *client_ops; | ||
158 | struct pci_dev *pdev; | ||
159 | struct work_struct work; | ||
160 | struct workqueue_struct *qwork; | ||
161 | spinlock_t lock; | ||
162 | spinlock_t wq_lock; | ||
163 | }; | ||
164 | |||
165 | static inline struct langwell_otg *otg_to_langwell(struct otg_transceiver *otg) | ||
166 | { | ||
167 | return container_of(otg, struct langwell_otg, otg); | ||
168 | } | ||
169 | |||
170 | #ifdef DEBUG | ||
171 | #define otg_dbg(fmt, args...) \ | ||
172 | printk(KERN_DEBUG fmt , ## args) | ||
173 | #else | ||
174 | #define otg_dbg(fmt, args...) \ | ||
175 | do { } while (0) | ||
176 | #endif /* DEBUG */ | ||
177 | #endif /* __LANGWELL_OTG_H__ */ | ||
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index 44801d26a37a..0ec50ba62139 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
@@ -317,7 +317,8 @@ extern int usb_serial_generic_register(int debug); | |||
317 | extern void usb_serial_generic_deregister(void); | 317 | extern void usb_serial_generic_deregister(void); |
318 | extern void usb_serial_generic_resubmit_read_urb(struct usb_serial_port *port, | 318 | extern void usb_serial_generic_resubmit_read_urb(struct usb_serial_port *port, |
319 | gfp_t mem_flags); | 319 | gfp_t mem_flags); |
320 | extern int usb_serial_handle_sysrq_char(struct usb_serial_port *port, | 320 | extern int usb_serial_handle_sysrq_char(struct tty_struct *tty, |
321 | struct usb_serial_port *port, | ||
321 | unsigned int ch); | 322 | unsigned int ch); |
322 | extern int usb_serial_handle_break(struct usb_serial_port *port); | 323 | extern int usb_serial_handle_break(struct usb_serial_port *port); |
323 | 324 | ||
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h index 5d44059f6d63..310e18a880ff 100644 --- a/include/linux/usb/usbnet.h +++ b/include/linux/usb/usbnet.h | |||
@@ -42,7 +42,6 @@ struct usbnet { | |||
42 | 42 | ||
43 | /* protocol/interface state */ | 43 | /* protocol/interface state */ |
44 | struct net_device *net; | 44 | struct net_device *net; |
45 | struct net_device_stats stats; | ||
46 | int msg_enable; | 45 | int msg_enable; |
47 | unsigned long data [5]; | 46 | unsigned long data [5]; |
48 | u32 xid; | 47 | u32 xid; |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index f24eceecc5a6..74f16876f38d 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -318,6 +318,8 @@ struct v4l2_pix_format { | |||
318 | /* see http://www.siliconimaging.com/RGB%20Bayer.htm */ | 318 | /* see http://www.siliconimaging.com/RGB%20Bayer.htm */ |
319 | #define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */ | 319 | #define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */ |
320 | #define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */ | 320 | #define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */ |
321 | #define V4L2_PIX_FMT_SGRBG8 v4l2_fourcc('G', 'R', 'B', 'G') /* 8 GRGR.. BGBG.. */ | ||
322 | |||
321 | /* | 323 | /* |
322 | * 10bit raw bayer, expanded to 16 bits | 324 | * 10bit raw bayer, expanded to 16 bits |
323 | * xxxxrrrrrrrrrrxxxxgggggggggg xxxxggggggggggxxxxbbbbbbbbbb... | 325 | * xxxxrrrrrrrrrrxxxxgggggggggg xxxxggggggggggxxxxbbbbbbbbbb... |
@@ -336,6 +338,7 @@ struct v4l2_pix_format { | |||
336 | /* Vendor-specific formats */ | 338 | /* Vendor-specific formats */ |
337 | #define V4L2_PIX_FMT_WNVA v4l2_fourcc('W', 'N', 'V', 'A') /* Winnov hw compress */ | 339 | #define V4L2_PIX_FMT_WNVA v4l2_fourcc('W', 'N', 'V', 'A') /* Winnov hw compress */ |
338 | #define V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S', '9', '1', '0') /* SN9C10x compression */ | 340 | #define V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S', '9', '1', '0') /* SN9C10x compression */ |
341 | #define V4L2_PIX_FMT_SN9C20X_I420 v4l2_fourcc('S', '9', '2', '0') /* SN9C20x YUV 4:2:0 */ | ||
339 | #define V4L2_PIX_FMT_PWC1 v4l2_fourcc('P', 'W', 'C', '1') /* pwc older webcam */ | 342 | #define V4L2_PIX_FMT_PWC1 v4l2_fourcc('P', 'W', 'C', '1') /* pwc older webcam */ |
340 | #define V4L2_PIX_FMT_PWC2 v4l2_fourcc('P', 'W', 'C', '2') /* pwc newer webcam */ | 343 | #define V4L2_PIX_FMT_PWC2 v4l2_fourcc('P', 'W', 'C', '2') /* pwc newer webcam */ |
341 | #define V4L2_PIX_FMT_ET61X251 v4l2_fourcc('E', '6', '2', '5') /* ET61X251 compression */ | 344 | #define V4L2_PIX_FMT_ET61X251 v4l2_fourcc('E', '6', '2', '5') /* ET61X251 compression */ |
@@ -348,6 +351,7 @@ struct v4l2_pix_format { | |||
348 | #define V4L2_PIX_FMT_SQ905C v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */ | 351 | #define V4L2_PIX_FMT_SQ905C v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */ |
349 | #define V4L2_PIX_FMT_PJPG v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */ | 352 | #define V4L2_PIX_FMT_PJPG v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */ |
350 | #define V4L2_PIX_FMT_YVYU v4l2_fourcc('Y', 'V', 'Y', 'U') /* 16 YVU 4:2:2 */ | 353 | #define V4L2_PIX_FMT_YVYU v4l2_fourcc('Y', 'V', 'Y', 'U') /* 16 YVU 4:2:2 */ |
354 | #define V4L2_PIX_FMT_OV511 v4l2_fourcc('O', '5', '1', '1') /* ov511 JPEG */ | ||
351 | #define V4L2_PIX_FMT_OV518 v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */ | 355 | #define V4L2_PIX_FMT_OV518 v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */ |
352 | 356 | ||
353 | /* | 357 | /* |
@@ -894,9 +898,10 @@ enum v4l2_colorfx { | |||
894 | V4L2_COLORFX_BW = 1, | 898 | V4L2_COLORFX_BW = 1, |
895 | V4L2_COLORFX_SEPIA = 2, | 899 | V4L2_COLORFX_SEPIA = 2, |
896 | }; | 900 | }; |
901 | #define V4L2_CID_AUTOBRIGHTNESS (V4L2_CID_BASE+32) | ||
897 | 902 | ||
898 | /* last CID + 1 */ | 903 | /* last CID + 1 */ |
899 | #define V4L2_CID_LASTP1 (V4L2_CID_BASE+32) | 904 | #define V4L2_CID_LASTP1 (V4L2_CID_BASE+33) |
900 | 905 | ||
901 | /* MPEG-class control IDs defined by V4L2 */ | 906 | /* MPEG-class control IDs defined by V4L2 */ |
902 | #define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) | 907 | #define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) |
diff --git a/include/linux/virtio_blk.h b/include/linux/virtio_blk.h index be7d255fc7cf..8dab9f2b8832 100644 --- a/include/linux/virtio_blk.h +++ b/include/linux/virtio_blk.h | |||
@@ -20,8 +20,7 @@ | |||
20 | 20 | ||
21 | #define VIRTIO_BLK_ID_BYTES (sizeof(__u16[256])) /* IDENTIFY DATA */ | 21 | #define VIRTIO_BLK_ID_BYTES (sizeof(__u16[256])) /* IDENTIFY DATA */ |
22 | 22 | ||
23 | struct virtio_blk_config | 23 | struct virtio_blk_config { |
24 | { | ||
25 | /* The capacity (in 512-byte sectors). */ | 24 | /* The capacity (in 512-byte sectors). */ |
26 | __u64 capacity; | 25 | __u64 capacity; |
27 | /* The maximum segment size (if VIRTIO_BLK_F_SIZE_MAX) */ | 26 | /* The maximum segment size (if VIRTIO_BLK_F_SIZE_MAX) */ |
@@ -50,8 +49,7 @@ struct virtio_blk_config | |||
50 | #define VIRTIO_BLK_T_BARRIER 0x80000000 | 49 | #define VIRTIO_BLK_T_BARRIER 0x80000000 |
51 | 50 | ||
52 | /* This is the first element of the read scatter-gather list. */ | 51 | /* This is the first element of the read scatter-gather list. */ |
53 | struct virtio_blk_outhdr | 52 | struct virtio_blk_outhdr { |
54 | { | ||
55 | /* VIRTIO_BLK_T* */ | 53 | /* VIRTIO_BLK_T* */ |
56 | __u32 type; | 54 | __u32 type; |
57 | /* io priority. */ | 55 | /* io priority. */ |
diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index 99f514575f6a..e547e3c8ee9a 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h | |||
@@ -79,8 +79,7 @@ | |||
79 | * the dev->feature bits if it wants. | 79 | * the dev->feature bits if it wants. |
80 | */ | 80 | */ |
81 | typedef void vq_callback_t(struct virtqueue *); | 81 | typedef void vq_callback_t(struct virtqueue *); |
82 | struct virtio_config_ops | 82 | struct virtio_config_ops { |
83 | { | ||
84 | void (*get)(struct virtio_device *vdev, unsigned offset, | 83 | void (*get)(struct virtio_device *vdev, unsigned offset, |
85 | void *buf, unsigned len); | 84 | void *buf, unsigned len); |
86 | void (*set)(struct virtio_device *vdev, unsigned offset, | 85 | void (*set)(struct virtio_device *vdev, unsigned offset, |
diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h index cec79adbe3ea..d8dd539c9f48 100644 --- a/include/linux/virtio_net.h +++ b/include/linux/virtio_net.h | |||
@@ -27,11 +27,11 @@ | |||
27 | #define VIRTIO_NET_F_CTRL_VQ 17 /* Control channel available */ | 27 | #define VIRTIO_NET_F_CTRL_VQ 17 /* Control channel available */ |
28 | #define VIRTIO_NET_F_CTRL_RX 18 /* Control channel RX mode support */ | 28 | #define VIRTIO_NET_F_CTRL_RX 18 /* Control channel RX mode support */ |
29 | #define VIRTIO_NET_F_CTRL_VLAN 19 /* Control channel VLAN filtering */ | 29 | #define VIRTIO_NET_F_CTRL_VLAN 19 /* Control channel VLAN filtering */ |
30 | #define VIRTIO_NET_F_CTRL_RX_EXTRA 20 /* Extra RX mode control support */ | ||
30 | 31 | ||
31 | #define VIRTIO_NET_S_LINK_UP 1 /* Link is up */ | 32 | #define VIRTIO_NET_S_LINK_UP 1 /* Link is up */ |
32 | 33 | ||
33 | struct virtio_net_config | 34 | struct virtio_net_config { |
34 | { | ||
35 | /* The config defining mac address (if VIRTIO_NET_F_MAC) */ | 35 | /* The config defining mac address (if VIRTIO_NET_F_MAC) */ |
36 | __u8 mac[6]; | 36 | __u8 mac[6]; |
37 | /* See VIRTIO_NET_F_STATUS and VIRTIO_NET_S_* above */ | 37 | /* See VIRTIO_NET_F_STATUS and VIRTIO_NET_S_* above */ |
@@ -40,8 +40,7 @@ struct virtio_net_config | |||
40 | 40 | ||
41 | /* This is the first element of the scatter-gather list. If you don't | 41 | /* This is the first element of the scatter-gather list. If you don't |
42 | * specify GSO or CSUM features, you can simply ignore the header. */ | 42 | * specify GSO or CSUM features, you can simply ignore the header. */ |
43 | struct virtio_net_hdr | 43 | struct virtio_net_hdr { |
44 | { | ||
45 | #define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 // Use csum_start, csum_offset | 44 | #define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 // Use csum_start, csum_offset |
46 | __u8 flags; | 45 | __u8 flags; |
47 | #define VIRTIO_NET_HDR_GSO_NONE 0 // Not a GSO frame | 46 | #define VIRTIO_NET_HDR_GSO_NONE 0 // Not a GSO frame |
@@ -81,14 +80,19 @@ typedef __u8 virtio_net_ctrl_ack; | |||
81 | #define VIRTIO_NET_ERR 1 | 80 | #define VIRTIO_NET_ERR 1 |
82 | 81 | ||
83 | /* | 82 | /* |
84 | * Control the RX mode, ie. promisucous and allmulti. PROMISC and | 83 | * Control the RX mode, ie. promisucous, allmulti, etc... |
85 | * ALLMULTI commands require an "out" sg entry containing a 1 byte | 84 | * All commands require an "out" sg entry containing a 1 byte |
86 | * state value, zero = disable, non-zero = enable. These commands | 85 | * state value, zero = disable, non-zero = enable. Commands |
87 | * are supported with the VIRTIO_NET_F_CTRL_RX feature. | 86 | * 0 and 1 are supported with the VIRTIO_NET_F_CTRL_RX feature. |
87 | * Commands 2-5 are added with VIRTIO_NET_F_CTRL_RX_EXTRA. | ||
88 | */ | 88 | */ |
89 | #define VIRTIO_NET_CTRL_RX 0 | 89 | #define VIRTIO_NET_CTRL_RX 0 |
90 | #define VIRTIO_NET_CTRL_RX_PROMISC 0 | 90 | #define VIRTIO_NET_CTRL_RX_PROMISC 0 |
91 | #define VIRTIO_NET_CTRL_RX_ALLMULTI 1 | 91 | #define VIRTIO_NET_CTRL_RX_ALLMULTI 1 |
92 | #define VIRTIO_NET_CTRL_RX_ALLUNI 2 | ||
93 | #define VIRTIO_NET_CTRL_RX_NOMULTI 3 | ||
94 | #define VIRTIO_NET_CTRL_RX_NOUNI 4 | ||
95 | #define VIRTIO_NET_CTRL_RX_NOBCAST 5 | ||
92 | 96 | ||
93 | /* | 97 | /* |
94 | * Control the MAC filter table. | 98 | * Control the MAC filter table. |
diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h index 693e0ec5afa6..e4d144b132b5 100644 --- a/include/linux/virtio_ring.h +++ b/include/linux/virtio_ring.h | |||
@@ -30,8 +30,7 @@ | |||
30 | #define VIRTIO_RING_F_INDIRECT_DESC 28 | 30 | #define VIRTIO_RING_F_INDIRECT_DESC 28 |
31 | 31 | ||
32 | /* Virtio ring descriptors: 16 bytes. These can chain together via "next". */ | 32 | /* Virtio ring descriptors: 16 bytes. These can chain together via "next". */ |
33 | struct vring_desc | 33 | struct vring_desc { |
34 | { | ||
35 | /* Address (guest-physical). */ | 34 | /* Address (guest-physical). */ |
36 | __u64 addr; | 35 | __u64 addr; |
37 | /* Length. */ | 36 | /* Length. */ |
@@ -42,24 +41,21 @@ struct vring_desc | |||
42 | __u16 next; | 41 | __u16 next; |
43 | }; | 42 | }; |
44 | 43 | ||
45 | struct vring_avail | 44 | struct vring_avail { |
46 | { | ||
47 | __u16 flags; | 45 | __u16 flags; |
48 | __u16 idx; | 46 | __u16 idx; |
49 | __u16 ring[]; | 47 | __u16 ring[]; |
50 | }; | 48 | }; |
51 | 49 | ||
52 | /* u32 is used here for ids for padding reasons. */ | 50 | /* u32 is used here for ids for padding reasons. */ |
53 | struct vring_used_elem | 51 | struct vring_used_elem { |
54 | { | ||
55 | /* Index of start of used descriptor chain. */ | 52 | /* Index of start of used descriptor chain. */ |
56 | __u32 id; | 53 | __u32 id; |
57 | /* Total length of the descriptor chain which was used (written to) */ | 54 | /* Total length of the descriptor chain which was used (written to) */ |
58 | __u32 len; | 55 | __u32 len; |
59 | }; | 56 | }; |
60 | 57 | ||
61 | struct vring_used | 58 | struct vring_used { |
62 | { | ||
63 | __u16 flags; | 59 | __u16 flags; |
64 | __u16 idx; | 60 | __u16 idx; |
65 | struct vring_used_elem ring[]; | 61 | struct vring_used_elem ring[]; |
diff --git a/include/linux/w1-gpio.h b/include/linux/w1-gpio.h index 9797fec7748a..3adeff82212f 100644 --- a/include/linux/w1-gpio.h +++ b/include/linux/w1-gpio.h | |||
@@ -18,6 +18,7 @@ | |||
18 | struct w1_gpio_platform_data { | 18 | struct w1_gpio_platform_data { |
19 | unsigned int pin; | 19 | unsigned int pin; |
20 | unsigned int is_open_drain:1; | 20 | unsigned int is_open_drain:1; |
21 | void (*enable_external_pullup)(int enable); | ||
21 | }; | 22 | }; |
22 | 23 | ||
23 | #endif /* _LINUX_W1_GPIO_H */ | 24 | #endif /* _LINUX_W1_GPIO_H */ |
diff --git a/include/linux/wait.h b/include/linux/wait.h index 6788e1a4d4ca..cf3c2f5dba51 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h | |||
@@ -77,7 +77,14 @@ struct task_struct; | |||
77 | #define __WAIT_BIT_KEY_INITIALIZER(word, bit) \ | 77 | #define __WAIT_BIT_KEY_INITIALIZER(word, bit) \ |
78 | { .flags = word, .bit_nr = bit, } | 78 | { .flags = word, .bit_nr = bit, } |
79 | 79 | ||
80 | extern void init_waitqueue_head(wait_queue_head_t *q); | 80 | extern void __init_waitqueue_head(wait_queue_head_t *q, struct lock_class_key *); |
81 | |||
82 | #define init_waitqueue_head(q) \ | ||
83 | do { \ | ||
84 | static struct lock_class_key __key; \ | ||
85 | \ | ||
86 | __init_waitqueue_head((q), &__key); \ | ||
87 | } while (0) | ||
81 | 88 | ||
82 | #ifdef CONFIG_LOCKDEP | 89 | #ifdef CONFIG_LOCKDEP |
83 | # define __WAIT_QUEUE_HEAD_INIT_ONSTACK(name) \ | 90 | # define __WAIT_QUEUE_HEAD_INIT_ONSTACK(name) \ |
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 13e1adf55c4c..6273fa97b527 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
@@ -240,6 +240,21 @@ static inline int cancel_delayed_work(struct delayed_work *work) | |||
240 | return ret; | 240 | return ret; |
241 | } | 241 | } |
242 | 242 | ||
243 | /* | ||
244 | * Like above, but uses del_timer() instead of del_timer_sync(). This means, | ||
245 | * if it returns 0 the timer function may be running and the queueing is in | ||
246 | * progress. | ||
247 | */ | ||
248 | static inline int __cancel_delayed_work(struct delayed_work *work) | ||
249 | { | ||
250 | int ret; | ||
251 | |||
252 | ret = del_timer(&work->timer); | ||
253 | if (ret) | ||
254 | work_clear_pending(&work->work); | ||
255 | return ret; | ||
256 | } | ||
257 | |||
243 | extern int cancel_delayed_work_sync(struct delayed_work *work); | 258 | extern int cancel_delayed_work_sync(struct delayed_work *work); |
244 | 259 | ||
245 | /* Obsolete. use cancel_delayed_work_sync() */ | 260 | /* Obsolete. use cancel_delayed_work_sync() */ |
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index 3224820c8514..78b1e4684cc9 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
@@ -14,17 +14,6 @@ extern struct list_head inode_in_use; | |||
14 | extern struct list_head inode_unused; | 14 | extern struct list_head inode_unused; |
15 | 15 | ||
16 | /* | 16 | /* |
17 | * Yes, writeback.h requires sched.h | ||
18 | * No, sched.h is not included from here. | ||
19 | */ | ||
20 | static inline int task_is_pdflush(struct task_struct *task) | ||
21 | { | ||
22 | return task->flags & PF_FLUSHER; | ||
23 | } | ||
24 | |||
25 | #define current_is_pdflush() task_is_pdflush(current) | ||
26 | |||
27 | /* | ||
28 | * fs/fs-writeback.c | 17 | * fs/fs-writeback.c |
29 | */ | 18 | */ |
30 | enum writeback_sync_modes { | 19 | enum writeback_sync_modes { |
@@ -40,6 +29,8 @@ enum writeback_sync_modes { | |||
40 | struct writeback_control { | 29 | struct writeback_control { |
41 | struct backing_dev_info *bdi; /* If !NULL, only write back this | 30 | struct backing_dev_info *bdi; /* If !NULL, only write back this |
42 | queue */ | 31 | queue */ |
32 | struct super_block *sb; /* if !NULL, only write inodes from | ||
33 | this super_block */ | ||
43 | enum writeback_sync_modes sync_mode; | 34 | enum writeback_sync_modes sync_mode; |
44 | unsigned long *older_than_this; /* If !NULL, only write back inodes | 35 | unsigned long *older_than_this; /* If !NULL, only write back inodes |
45 | older than this */ | 36 | older than this */ |
@@ -76,9 +67,13 @@ struct writeback_control { | |||
76 | /* | 67 | /* |
77 | * fs/fs-writeback.c | 68 | * fs/fs-writeback.c |
78 | */ | 69 | */ |
79 | void writeback_inodes(struct writeback_control *wbc); | 70 | struct bdi_writeback; |
80 | int inode_wait(void *); | 71 | int inode_wait(void *); |
81 | void sync_inodes_sb(struct super_block *, int wait); | 72 | long writeback_inodes_sb(struct super_block *); |
73 | long sync_inodes_sb(struct super_block *); | ||
74 | void writeback_inodes_wbc(struct writeback_control *wbc); | ||
75 | long wb_do_writeback(struct bdi_writeback *wb, int force_wait); | ||
76 | void wakeup_flusher_threads(long nr_pages); | ||
82 | 77 | ||
83 | /* writeback.h requires fs.h; it, too, is not included from here. */ | 78 | /* writeback.h requires fs.h; it, too, is not included from here. */ |
84 | static inline void wait_on_inode(struct inode *inode) | 79 | static inline void wait_on_inode(struct inode *inode) |
@@ -98,7 +93,6 @@ static inline void inode_sync_wait(struct inode *inode) | |||
98 | /* | 93 | /* |
99 | * mm/page-writeback.c | 94 | * mm/page-writeback.c |
100 | */ | 95 | */ |
101 | int wakeup_pdflush(long nr_pages); | ||
102 | void laptop_io_completion(void); | 96 | void laptop_io_completion(void); |
103 | void laptop_sync_completion(void); | 97 | void laptop_sync_completion(void); |
104 | void throttle_vm_writeout(gfp_t gfp_mask); | 98 | void throttle_vm_writeout(gfp_t gfp_mask); |
@@ -150,7 +144,6 @@ balance_dirty_pages_ratelimited(struct address_space *mapping) | |||
150 | typedef int (*writepage_t)(struct page *page, struct writeback_control *wbc, | 144 | typedef int (*writepage_t)(struct page *page, struct writeback_control *wbc, |
151 | void *data); | 145 | void *data); |
152 | 146 | ||
153 | int pdflush_operation(void (*fn)(unsigned long), unsigned long arg0); | ||
154 | int generic_writepages(struct address_space *mapping, | 147 | int generic_writepages(struct address_space *mapping, |
155 | struct writeback_control *wbc); | 148 | struct writeback_control *wbc); |
156 | int write_cache_pages(struct address_space *mapping, | 149 | int write_cache_pages(struct address_space *mapping, |
diff --git a/include/linux/xattr.h b/include/linux/xattr.h index d131e352cfe1..5c84af8c5f6f 100644 --- a/include/linux/xattr.h +++ b/include/linux/xattr.h | |||
@@ -49,6 +49,7 @@ struct xattr_handler { | |||
49 | ssize_t xattr_getsecurity(struct inode *, const char *, void *, size_t); | 49 | ssize_t xattr_getsecurity(struct inode *, const char *, void *, size_t); |
50 | ssize_t vfs_getxattr(struct dentry *, const char *, void *, size_t); | 50 | ssize_t vfs_getxattr(struct dentry *, const char *, void *, size_t); |
51 | ssize_t vfs_listxattr(struct dentry *d, char *list, size_t size); | 51 | ssize_t vfs_listxattr(struct dentry *d, char *list, size_t size); |
52 | int __vfs_setxattr_noperm(struct dentry *, const char *, const void *, size_t, int); | ||
52 | int vfs_setxattr(struct dentry *, const char *, const void *, size_t, int); | 53 | int vfs_setxattr(struct dentry *, const char *, const void *, size_t, int); |
53 | int vfs_removexattr(struct dentry *, const char *); | 54 | int vfs_removexattr(struct dentry *, const char *); |
54 | 55 | ||
diff --git a/include/media/ir-common.h b/include/media/ir-common.h index 7b5b91f60425..9dcb632f6083 100644 --- a/include/media/ir-common.h +++ b/include/media/ir-common.h | |||
@@ -162,6 +162,8 @@ extern IR_KEYTAB_TYPE ir_codes_ati_tv_wonder_hd_600[IR_KEYTAB_SIZE]; | |||
162 | extern IR_KEYTAB_TYPE ir_codes_kworld_plus_tv_analog[IR_KEYTAB_SIZE]; | 162 | extern IR_KEYTAB_TYPE ir_codes_kworld_plus_tv_analog[IR_KEYTAB_SIZE]; |
163 | extern IR_KEYTAB_TYPE ir_codes_kaiomy[IR_KEYTAB_SIZE]; | 163 | extern IR_KEYTAB_TYPE ir_codes_kaiomy[IR_KEYTAB_SIZE]; |
164 | extern IR_KEYTAB_TYPE ir_codes_dm1105_nec[IR_KEYTAB_SIZE]; | 164 | extern IR_KEYTAB_TYPE ir_codes_dm1105_nec[IR_KEYTAB_SIZE]; |
165 | extern IR_KEYTAB_TYPE ir_codes_evga_indtube[IR_KEYTAB_SIZE]; | ||
166 | |||
165 | #endif | 167 | #endif |
166 | 168 | ||
167 | /* | 169 | /* |
diff --git a/include/media/v4l2-chip-ident.h b/include/media/v4l2-chip-ident.h index 4d7e2272c42f..94e908c0d7a0 100644 --- a/include/media/v4l2-chip-ident.h +++ b/include/media/v4l2-chip-ident.h | |||
@@ -60,6 +60,10 @@ enum { | |||
60 | V4L2_IDENT_OV7670 = 250, | 60 | V4L2_IDENT_OV7670 = 250, |
61 | V4L2_IDENT_OV7720 = 251, | 61 | V4L2_IDENT_OV7720 = 251, |
62 | V4L2_IDENT_OV7725 = 252, | 62 | V4L2_IDENT_OV7725 = 252, |
63 | V4L2_IDENT_OV7660 = 253, | ||
64 | V4L2_IDENT_OV9650 = 254, | ||
65 | V4L2_IDENT_OV9655 = 255, | ||
66 | V4L2_IDENT_SOI968 = 256, | ||
63 | 67 | ||
64 | /* module saa7146: reserved range 300-309 */ | 68 | /* module saa7146: reserved range 300-309 */ |
65 | V4L2_IDENT_SAA7146 = 300, | 69 | V4L2_IDENT_SAA7146 = 300, |
@@ -155,9 +159,15 @@ enum { | |||
155 | /* module cafe_ccic, just ident 8801 */ | 159 | /* module cafe_ccic, just ident 8801 */ |
156 | V4L2_IDENT_CAFE = 8801, | 160 | V4L2_IDENT_CAFE = 8801, |
157 | 161 | ||
162 | /* module mt9v011, just ident 8243 */ | ||
163 | V4L2_IDENT_MT9V011 = 8243, | ||
164 | |||
158 | /* module tw9910: just ident 9910 */ | 165 | /* module tw9910: just ident 9910 */ |
159 | V4L2_IDENT_TW9910 = 9910, | 166 | V4L2_IDENT_TW9910 = 9910, |
160 | 167 | ||
168 | /* module sn9c20x: just ident 10000 */ | ||
169 | V4L2_IDENT_SN9C20X = 10000, | ||
170 | |||
161 | /* module msp3400: reserved range 34000-34999 and 44000-44999 */ | 171 | /* module msp3400: reserved range 34000-34999 and 44000-44999 */ |
162 | V4L2_IDENT_MSPX4XX = 34000, /* generic MSPX4XX identifier, only | 172 | V4L2_IDENT_MSPX4XX = 34000, /* generic MSPX4XX identifier, only |
163 | use internally (tveeprom.c). */ | 173 | use internally (tveeprom.c). */ |
@@ -234,6 +244,11 @@ enum { | |||
234 | V4L2_IDENT_MT9V022IX7ATC = 45010, /* No way to detect "normal" I77ATx */ | 244 | V4L2_IDENT_MT9V022IX7ATC = 45010, /* No way to detect "normal" I77ATx */ |
235 | V4L2_IDENT_MT9V022IX7ATM = 45015, /* and "lead free" IA7ATx chips */ | 245 | V4L2_IDENT_MT9V022IX7ATM = 45015, /* and "lead free" IA7ATx chips */ |
236 | V4L2_IDENT_MT9T031 = 45020, | 246 | V4L2_IDENT_MT9T031 = 45020, |
247 | V4L2_IDENT_MT9V111 = 45031, | ||
248 | V4L2_IDENT_MT9V112 = 45032, | ||
249 | |||
250 | /* HV7131R CMOS sensor: just ident 46000 */ | ||
251 | V4L2_IDENT_HV7131R = 46000, | ||
237 | 252 | ||
238 | /* module cs53132a: just ident 53132 */ | 253 | /* module cs53132a: just ident 53132 */ |
239 | V4L2_IDENT_CS53l32A = 53132, | 254 | V4L2_IDENT_CS53l32A = 53132, |
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h index c48c24e4d0fa..33a18426ab9b 100644 --- a/include/media/v4l2-common.h +++ b/include/media/v4l2-common.h | |||
@@ -153,6 +153,22 @@ struct v4l2_subdev *v4l2_i2c_new_probed_subdev(struct v4l2_device *v4l2_dev, | |||
153 | struct v4l2_subdev *v4l2_i2c_new_probed_subdev_addr(struct v4l2_device *v4l2_dev, | 153 | struct v4l2_subdev *v4l2_i2c_new_probed_subdev_addr(struct v4l2_device *v4l2_dev, |
154 | struct i2c_adapter *adapter, | 154 | struct i2c_adapter *adapter, |
155 | const char *module_name, const char *client_type, u8 addr); | 155 | const char *module_name, const char *client_type, u8 addr); |
156 | |||
157 | /* Load an i2c module and return an initialized v4l2_subdev struct. | ||
158 | Only call request_module if module_name != NULL. | ||
159 | The client_type argument is the name of the chip that's on the adapter. */ | ||
160 | struct v4l2_subdev *v4l2_i2c_new_subdev_cfg(struct v4l2_device *v4l2_dev, | ||
161 | struct i2c_adapter *adapter, | ||
162 | const char *module_name, const char *client_type, | ||
163 | int irq, void *platform_data, | ||
164 | u8 addr, const unsigned short *probe_addrs); | ||
165 | |||
166 | struct i2c_board_info; | ||
167 | |||
168 | struct v4l2_subdev *v4l2_i2c_new_subdev_board(struct v4l2_device *v4l2_dev, | ||
169 | struct i2c_adapter *adapter, const char *module_name, | ||
170 | struct i2c_board_info *info, const unsigned short *probe_addrs); | ||
171 | |||
156 | /* Initialize an v4l2_subdev with data from an i2c_client struct */ | 172 | /* Initialize an v4l2_subdev with data from an i2c_client struct */ |
157 | void v4l2_i2c_subdev_init(struct v4l2_subdev *sd, struct i2c_client *client, | 173 | void v4l2_i2c_subdev_init(struct v4l2_subdev *sd, struct i2c_client *client, |
158 | const struct v4l2_subdev_ops *ops); | 174 | const struct v4l2_subdev_ops *ops); |
@@ -193,4 +209,14 @@ struct v4l2_routing { | |||
193 | u32 output; | 209 | u32 output; |
194 | }; | 210 | }; |
195 | 211 | ||
212 | /* ------------------------------------------------------------------------- */ | ||
213 | |||
214 | /* Miscellaneous helper functions */ | ||
215 | |||
216 | void v4l_bound_align_image(unsigned int *w, unsigned int wmin, | ||
217 | unsigned int wmax, unsigned int walign, | ||
218 | unsigned int *h, unsigned int hmin, | ||
219 | unsigned int hmax, unsigned int halign, | ||
220 | unsigned int salign); | ||
221 | |||
196 | #endif /* V4L2_COMMON_H_ */ | 222 | #endif /* V4L2_COMMON_H_ */ |
diff --git a/include/media/v4l2-i2c-drv.h b/include/media/v4l2-i2c-drv.h index 10a2882c3cbf..74bf741d1a9b 100644 --- a/include/media/v4l2-i2c-drv.h +++ b/include/media/v4l2-i2c-drv.h | |||
@@ -22,7 +22,7 @@ | |||
22 | */ | 22 | */ |
23 | 23 | ||
24 | /* NOTE: the full version of this header is in the v4l-dvb repository | 24 | /* NOTE: the full version of this header is in the v4l-dvb repository |
25 | * and allows v4l i2c drivers to be compiled on older kernels as well. | 25 | * and allows v4l i2c drivers to be compiled on pre-2.6.26 kernels. |
26 | * The version of this header as it appears in the kernel is a stripped | 26 | * The version of this header as it appears in the kernel is a stripped |
27 | * version (without all the backwards compatibility stuff) and so it | 27 | * version (without all the backwards compatibility stuff) and so it |
28 | * looks a bit odd. | 28 | * looks a bit odd. |
@@ -30,6 +30,9 @@ | |||
30 | * If you look at the full version then you will understand the reason | 30 | * If you look at the full version then you will understand the reason |
31 | * for introducing this header since you really don't want to have all | 31 | * for introducing this header since you really don't want to have all |
32 | * the tricky backwards compatibility code in each and every i2c driver. | 32 | * the tricky backwards compatibility code in each and every i2c driver. |
33 | * | ||
34 | * If the i2c driver will never be compiled for pre-2.6.26 kernels, then | ||
35 | * DO NOT USE this header! Just write it as a regular i2c driver. | ||
33 | */ | 36 | */ |
34 | 37 | ||
35 | #ifndef __V4L2_I2C_DRV_H__ | 38 | #ifndef __V4L2_I2C_DRV_H__ |
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index a503e1cee78b..5dcb36785529 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h | |||
@@ -79,7 +79,11 @@ struct v4l2_decode_vbi_line { | |||
79 | not yet implemented) since ops provide proper type-checking. | 79 | not yet implemented) since ops provide proper type-checking. |
80 | */ | 80 | */ |
81 | 81 | ||
82 | /* init: initialize the sensor registors to some sort of reasonable default | 82 | /* s_config: if set, then it is always called by the v4l2_i2c_new_subdev* |
83 | functions after the v4l2_subdev was registered. It is used to pass | ||
84 | platform data to the subdev which can be used during initialization. | ||
85 | |||
86 | init: initialize the sensor registors to some sort of reasonable default | ||
83 | values. Do not use for new drivers and should be removed in existing | 87 | values. Do not use for new drivers and should be removed in existing |
84 | drivers. | 88 | drivers. |
85 | 89 | ||
@@ -96,6 +100,7 @@ struct v4l2_decode_vbi_line { | |||
96 | struct v4l2_subdev_core_ops { | 100 | struct v4l2_subdev_core_ops { |
97 | int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip); | 101 | int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip); |
98 | int (*log_status)(struct v4l2_subdev *sd); | 102 | int (*log_status)(struct v4l2_subdev *sd); |
103 | int (*s_config)(struct v4l2_subdev *sd, int irq, void *platform_data); | ||
99 | int (*init)(struct v4l2_subdev *sd, u32 val); | 104 | int (*init)(struct v4l2_subdev *sd, u32 val); |
100 | int (*load_fw)(struct v4l2_subdev *sd); | 105 | int (*load_fw)(struct v4l2_subdev *sd); |
101 | int (*reset)(struct v4l2_subdev *sd, u32 val); | 106 | int (*reset)(struct v4l2_subdev *sd, u32 val); |
diff --git a/include/mtd/Kbuild b/include/mtd/Kbuild index 8eb018f96002..192f8fb7d546 100644 --- a/include/mtd/Kbuild +++ b/include/mtd/Kbuild | |||
@@ -1,5 +1,4 @@ | |||
1 | header-y += inftl-user.h | 1 | header-y += inftl-user.h |
2 | header-y += jffs2-user.h | ||
3 | header-y += mtd-abi.h | 2 | header-y += mtd-abi.h |
4 | header-y += mtd-user.h | 3 | header-y += mtd-user.h |
5 | header-y += nftl-user.h | 4 | header-y += nftl-user.h |
diff --git a/include/mtd/jffs2-user.h b/include/mtd/jffs2-user.h deleted file mode 100644 index fa94b0eb67c1..000000000000 --- a/include/mtd/jffs2-user.h +++ /dev/null | |||
@@ -1,34 +0,0 @@ | |||
1 | /* | ||
2 | * JFFS2 definitions for use in user space only | ||
3 | */ | ||
4 | |||
5 | #ifndef __JFFS2_USER_H__ | ||
6 | #define __JFFS2_USER_H__ | ||
7 | |||
8 | /* This file is blessed for inclusion by userspace */ | ||
9 | #include <linux/jffs2.h> | ||
10 | #include <linux/types.h> | ||
11 | #include <endian.h> | ||
12 | #include <byteswap.h> | ||
13 | |||
14 | #undef cpu_to_je16 | ||
15 | #undef cpu_to_je32 | ||
16 | #undef cpu_to_jemode | ||
17 | #undef je16_to_cpu | ||
18 | #undef je32_to_cpu | ||
19 | #undef jemode_to_cpu | ||
20 | |||
21 | extern int target_endian; | ||
22 | |||
23 | #define t16(x) ({ __u16 __b = (x); (target_endian==__BYTE_ORDER)?__b:bswap_16(__b); }) | ||
24 | #define t32(x) ({ __u32 __b = (x); (target_endian==__BYTE_ORDER)?__b:bswap_32(__b); }) | ||
25 | |||
26 | #define cpu_to_je16(x) ((jint16_t){t16(x)}) | ||
27 | #define cpu_to_je32(x) ((jint32_t){t32(x)}) | ||
28 | #define cpu_to_jemode(x) ((jmode_t){t32(x)}) | ||
29 | |||
30 | #define je16_to_cpu(x) (t16((x).v16)) | ||
31 | #define je32_to_cpu(x) (t32((x).v32)) | ||
32 | #define jemode_to_cpu(x) (t32((x).m)) | ||
33 | |||
34 | #endif /* __JFFS2_USER_H__ */ | ||
diff --git a/include/mtd/mtd-abi.h b/include/mtd/mtd-abi.h index b6595b3c68b6..be51ae2bd0ff 100644 --- a/include/mtd/mtd-abi.h +++ b/include/mtd/mtd-abi.h | |||
@@ -12,12 +12,24 @@ struct erase_info_user { | |||
12 | __u32 length; | 12 | __u32 length; |
13 | }; | 13 | }; |
14 | 14 | ||
15 | struct erase_info_user64 { | ||
16 | __u64 start; | ||
17 | __u64 length; | ||
18 | }; | ||
19 | |||
15 | struct mtd_oob_buf { | 20 | struct mtd_oob_buf { |
16 | __u32 start; | 21 | __u32 start; |
17 | __u32 length; | 22 | __u32 length; |
18 | unsigned char __user *ptr; | 23 | unsigned char __user *ptr; |
19 | }; | 24 | }; |
20 | 25 | ||
26 | struct mtd_oob_buf64 { | ||
27 | __u64 start; | ||
28 | __u32 pad; | ||
29 | __u32 length; | ||
30 | __u64 usr_ptr; | ||
31 | }; | ||
32 | |||
21 | #define MTD_ABSENT 0 | 33 | #define MTD_ABSENT 0 |
22 | #define MTD_RAM 1 | 34 | #define MTD_RAM 1 |
23 | #define MTD_ROM 2 | 35 | #define MTD_ROM 2 |
@@ -95,6 +107,9 @@ struct otp_info { | |||
95 | #define ECCGETLAYOUT _IOR('M', 17, struct nand_ecclayout) | 107 | #define ECCGETLAYOUT _IOR('M', 17, struct nand_ecclayout) |
96 | #define ECCGETSTATS _IOR('M', 18, struct mtd_ecc_stats) | 108 | #define ECCGETSTATS _IOR('M', 18, struct mtd_ecc_stats) |
97 | #define MTDFILEMODE _IO('M', 19) | 109 | #define MTDFILEMODE _IO('M', 19) |
110 | #define MEMERASE64 _IOW('M', 20, struct erase_info_user64) | ||
111 | #define MEMWRITEOOB64 _IOWR('M', 21, struct mtd_oob_buf64) | ||
112 | #define MEMREADOOB64 _IOWR('M', 22, struct mtd_oob_buf64) | ||
98 | 113 | ||
99 | /* | 114 | /* |
100 | * Obsolete legacy interface. Keep it in order not to break userspace | 115 | * Obsolete legacy interface. Keep it in order not to break userspace |
diff --git a/include/net/act_api.h b/include/net/act_api.h index 565eed8fe496..c05fd717c588 100644 --- a/include/net/act_api.h +++ b/include/net/act_api.h | |||
@@ -16,7 +16,7 @@ struct tcf_common { | |||
16 | u32 tcfc_capab; | 16 | u32 tcfc_capab; |
17 | int tcfc_action; | 17 | int tcfc_action; |
18 | struct tcf_t tcfc_tm; | 18 | struct tcf_t tcfc_tm; |
19 | struct gnet_stats_basic tcfc_bstats; | 19 | struct gnet_stats_basic_packed tcfc_bstats; |
20 | struct gnet_stats_queue tcfc_qstats; | 20 | struct gnet_stats_queue tcfc_qstats; |
21 | struct gnet_stats_rate_est tcfc_rate_est; | 21 | struct gnet_stats_rate_est tcfc_rate_est; |
22 | spinlock_t tcfc_lock; | 22 | spinlock_t tcfc_lock; |
diff --git a/include/net/bluetooth/rfcomm.h b/include/net/bluetooth/rfcomm.h index 80072611d26a..c274993234e3 100644 --- a/include/net/bluetooth/rfcomm.h +++ b/include/net/bluetooth/rfcomm.h | |||
@@ -355,7 +355,17 @@ struct rfcomm_dev_list_req { | |||
355 | }; | 355 | }; |
356 | 356 | ||
357 | int rfcomm_dev_ioctl(struct sock *sk, unsigned int cmd, void __user *arg); | 357 | int rfcomm_dev_ioctl(struct sock *sk, unsigned int cmd, void __user *arg); |
358 | |||
359 | #ifdef CONFIG_BT_RFCOMM_TTY | ||
358 | int rfcomm_init_ttys(void); | 360 | int rfcomm_init_ttys(void); |
359 | void rfcomm_cleanup_ttys(void); | 361 | void rfcomm_cleanup_ttys(void); |
360 | 362 | #else | |
363 | static inline int rfcomm_init_ttys(void) | ||
364 | { | ||
365 | return 0; | ||
366 | } | ||
367 | static inline void rfcomm_cleanup_ttys(void) | ||
368 | { | ||
369 | } | ||
370 | #endif | ||
361 | #endif /* __RFCOMM_H */ | 371 | #endif /* __RFCOMM_H */ |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 1a21895b732b..d1892d66701a 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -979,6 +979,10 @@ struct cfg80211_ops { | |||
979 | * channels at a later time. This can be used for devices which do not | 979 | * channels at a later time. This can be used for devices which do not |
980 | * have calibration information gauranteed for frequencies or settings | 980 | * have calibration information gauranteed for frequencies or settings |
981 | * outside of its regulatory domain. | 981 | * outside of its regulatory domain. |
982 | * @disable_beacon_hints: enable this if your driver needs to ensure that | ||
983 | * passive scan flags and beaconing flags may not be lifted by cfg80211 | ||
984 | * due to regulatory beacon hints. For more information on beacon | ||
985 | * hints read the documenation for regulatory_hint_found_beacon() | ||
982 | * @reg_notifier: the driver's regulatory notification callback | 986 | * @reg_notifier: the driver's regulatory notification callback |
983 | * @regd: the driver's regulatory domain, if one was requested via | 987 | * @regd: the driver's regulatory domain, if one was requested via |
984 | * the regulatory_hint() API. This can be used by the driver | 988 | * the regulatory_hint() API. This can be used by the driver |
@@ -1004,6 +1008,7 @@ struct wiphy { | |||
1004 | 1008 | ||
1005 | bool custom_regulatory; | 1009 | bool custom_regulatory; |
1006 | bool strict_regulatory; | 1010 | bool strict_regulatory; |
1011 | bool disable_beacon_hints; | ||
1007 | 1012 | ||
1008 | enum cfg80211_signal_type signal_type; | 1013 | enum cfg80211_signal_type signal_type; |
1009 | 1014 | ||
diff --git a/include/net/gen_stats.h b/include/net/gen_stats.h index d136b5240ef2..c1488553e349 100644 --- a/include/net/gen_stats.h +++ b/include/net/gen_stats.h | |||
@@ -28,7 +28,7 @@ extern int gnet_stats_start_copy_compat(struct sk_buff *skb, int type, | |||
28 | spinlock_t *lock, struct gnet_dump *d); | 28 | spinlock_t *lock, struct gnet_dump *d); |
29 | 29 | ||
30 | extern int gnet_stats_copy_basic(struct gnet_dump *d, | 30 | extern int gnet_stats_copy_basic(struct gnet_dump *d, |
31 | struct gnet_stats_basic *b); | 31 | struct gnet_stats_basic_packed *b); |
32 | extern int gnet_stats_copy_rate_est(struct gnet_dump *d, | 32 | extern int gnet_stats_copy_rate_est(struct gnet_dump *d, |
33 | struct gnet_stats_rate_est *r); | 33 | struct gnet_stats_rate_est *r); |
34 | extern int gnet_stats_copy_queue(struct gnet_dump *d, | 34 | extern int gnet_stats_copy_queue(struct gnet_dump *d, |
@@ -37,14 +37,14 @@ extern int gnet_stats_copy_app(struct gnet_dump *d, void *st, int len); | |||
37 | 37 | ||
38 | extern int gnet_stats_finish_copy(struct gnet_dump *d); | 38 | extern int gnet_stats_finish_copy(struct gnet_dump *d); |
39 | 39 | ||
40 | extern int gen_new_estimator(struct gnet_stats_basic *bstats, | 40 | extern int gen_new_estimator(struct gnet_stats_basic_packed *bstats, |
41 | struct gnet_stats_rate_est *rate_est, | 41 | struct gnet_stats_rate_est *rate_est, |
42 | spinlock_t *stats_lock, struct nlattr *opt); | 42 | spinlock_t *stats_lock, struct nlattr *opt); |
43 | extern void gen_kill_estimator(struct gnet_stats_basic *bstats, | 43 | extern void gen_kill_estimator(struct gnet_stats_basic_packed *bstats, |
44 | struct gnet_stats_rate_est *rate_est); | 44 | struct gnet_stats_rate_est *rate_est); |
45 | extern int gen_replace_estimator(struct gnet_stats_basic *bstats, | 45 | extern int gen_replace_estimator(struct gnet_stats_basic_packed *bstats, |
46 | struct gnet_stats_rate_est *rate_est, | 46 | struct gnet_stats_rate_est *rate_est, |
47 | spinlock_t *stats_lock, struct nlattr *opt); | 47 | spinlock_t *stats_lock, struct nlattr *opt); |
48 | extern bool gen_estimator_active(const struct gnet_stats_basic *bstats, | 48 | extern bool gen_estimator_active(const struct gnet_stats_basic_packed *bstats, |
49 | const struct gnet_stats_rate_est *rate_est); | 49 | const struct gnet_stats_rate_est *rate_est); |
50 | #endif | 50 | #endif |
diff --git a/include/net/iucv/af_iucv.h b/include/net/iucv/af_iucv.h index 21ee49ffcbaf..f82a1e877372 100644 --- a/include/net/iucv/af_iucv.h +++ b/include/net/iucv/af_iucv.h | |||
@@ -94,8 +94,6 @@ unsigned int iucv_sock_poll(struct file *file, struct socket *sock, | |||
94 | poll_table *wait); | 94 | poll_table *wait); |
95 | void iucv_sock_link(struct iucv_sock_list *l, struct sock *s); | 95 | void iucv_sock_link(struct iucv_sock_list *l, struct sock *s); |
96 | void iucv_sock_unlink(struct iucv_sock_list *l, struct sock *s); | 96 | void iucv_sock_unlink(struct iucv_sock_list *l, struct sock *s); |
97 | int iucv_sock_wait_state(struct sock *sk, int state, int state2, | ||
98 | unsigned long timeo); | ||
99 | int iucv_sock_wait_cnt(struct sock *sk, unsigned long timeo); | 97 | int iucv_sock_wait_cnt(struct sock *sk, unsigned long timeo); |
100 | void iucv_accept_enqueue(struct sock *parent, struct sock *sk); | 98 | void iucv_accept_enqueue(struct sock *parent, struct sock *sk); |
101 | void iucv_accept_unlink(struct sock *sk); | 99 | void iucv_accept_unlink(struct sock *sk); |
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h index a632689b61b4..cbdd6284996d 100644 --- a/include/net/netfilter/nf_conntrack.h +++ b/include/net/netfilter/nf_conntrack.h | |||
@@ -258,8 +258,8 @@ static inline bool nf_ct_kill(struct nf_conn *ct) | |||
258 | /* Update TCP window tracking data when NAT mangles the packet */ | 258 | /* Update TCP window tracking data when NAT mangles the packet */ |
259 | extern void nf_conntrack_tcp_update(const struct sk_buff *skb, | 259 | extern void nf_conntrack_tcp_update(const struct sk_buff *skb, |
260 | unsigned int dataoff, | 260 | unsigned int dataoff, |
261 | struct nf_conn *ct, | 261 | struct nf_conn *ct, int dir, |
262 | int dir); | 262 | s16 offset); |
263 | 263 | ||
264 | /* Fake conntrack entry for untracked connections */ | 264 | /* Fake conntrack entry for untracked connections */ |
265 | extern struct nf_conn nf_conntrack_untracked; | 265 | extern struct nf_conn nf_conntrack_untracked; |
diff --git a/include/net/netfilter/xt_rateest.h b/include/net/netfilter/xt_rateest.h index 65d594dffbff..ddbf37e19616 100644 --- a/include/net/netfilter/xt_rateest.h +++ b/include/net/netfilter/xt_rateest.h | |||
@@ -8,7 +8,7 @@ struct xt_rateest { | |||
8 | spinlock_t lock; | 8 | spinlock_t lock; |
9 | struct gnet_estimator params; | 9 | struct gnet_estimator params; |
10 | struct gnet_stats_rate_est rstats; | 10 | struct gnet_stats_rate_est rstats; |
11 | struct gnet_stats_basic bstats; | 11 | struct gnet_stats_basic_packed bstats; |
12 | }; | 12 | }; |
13 | 13 | ||
14 | extern struct xt_rateest *xt_rateest_lookup(const char *name); | 14 | extern struct xt_rateest *xt_rateest_lookup(const char *name); |
diff --git a/include/net/phonet/pn_dev.h b/include/net/phonet/pn_dev.h index 5054dc5ea2c2..29d126736611 100644 --- a/include/net/phonet/pn_dev.h +++ b/include/net/phonet/pn_dev.h | |||
@@ -45,6 +45,7 @@ int phonet_address_add(struct net_device *dev, u8 addr); | |||
45 | int phonet_address_del(struct net_device *dev, u8 addr); | 45 | int phonet_address_del(struct net_device *dev, u8 addr); |
46 | u8 phonet_address_get(struct net_device *dev, u8 addr); | 46 | u8 phonet_address_get(struct net_device *dev, u8 addr); |
47 | int phonet_address_lookup(struct net *net, u8 addr); | 47 | int phonet_address_lookup(struct net *net, u8 addr); |
48 | void phonet_address_notify(int event, struct net_device *dev, u8 addr); | ||
48 | 49 | ||
49 | #define PN_NO_ADDR 0xff | 50 | #define PN_NO_ADDR 0xff |
50 | 51 | ||
diff --git a/include/net/protocol.h b/include/net/protocol.h index ffa5b8b1f1df..1089d5aabd49 100644 --- a/include/net/protocol.h +++ b/include/net/protocol.h | |||
@@ -53,7 +53,7 @@ struct inet6_protocol | |||
53 | 53 | ||
54 | void (*err_handler)(struct sk_buff *skb, | 54 | void (*err_handler)(struct sk_buff *skb, |
55 | struct inet6_skb_parm *opt, | 55 | struct inet6_skb_parm *opt, |
56 | int type, int code, int offset, | 56 | u8 type, u8 code, int offset, |
57 | __be32 info); | 57 | __be32 info); |
58 | 58 | ||
59 | int (*gso_send_check)(struct sk_buff *skb); | 59 | int (*gso_send_check)(struct sk_buff *skb); |
diff --git a/include/net/rawv6.h b/include/net/rawv6.h index 8a22599f26ba..f6b9b830df8c 100644 --- a/include/net/rawv6.h +++ b/include/net/rawv6.h | |||
@@ -6,7 +6,7 @@ | |||
6 | #include <net/protocol.h> | 6 | #include <net/protocol.h> |
7 | 7 | ||
8 | void raw6_icmp_error(struct sk_buff *, int nexthdr, | 8 | void raw6_icmp_error(struct sk_buff *, int nexthdr, |
9 | int type, int code, int inner_offset, __be32); | 9 | u8 type, u8 code, int inner_offset, __be32); |
10 | int raw6_local_deliver(struct sk_buff *, int); | 10 | int raw6_local_deliver(struct sk_buff *, int); |
11 | 11 | ||
12 | extern int rawv6_rcv(struct sock *sk, | 12 | extern int rawv6_rcv(struct sock *sk, |
diff --git a/include/net/rose.h b/include/net/rose.h index cbd5364b2c8a..5ba9f02731eb 100644 --- a/include/net/rose.h +++ b/include/net/rose.h | |||
@@ -156,7 +156,7 @@ extern int sysctl_rose_maximum_vcs; | |||
156 | extern int sysctl_rose_window_size; | 156 | extern int sysctl_rose_window_size; |
157 | extern int rosecmp(rose_address *, rose_address *); | 157 | extern int rosecmp(rose_address *, rose_address *); |
158 | extern int rosecmpm(rose_address *, rose_address *, unsigned short); | 158 | extern int rosecmpm(rose_address *, rose_address *, unsigned short); |
159 | extern const char *rose2asc(const rose_address *); | 159 | extern char *rose2asc(char *buf, const rose_address *); |
160 | extern struct sock *rose_find_socket(unsigned int, struct rose_neigh *); | 160 | extern struct sock *rose_find_socket(unsigned int, struct rose_neigh *); |
161 | extern void rose_kill_by_neigh(struct rose_neigh *); | 161 | extern void rose_kill_by_neigh(struct rose_neigh *); |
162 | extern unsigned int rose_new_lci(struct rose_neigh *); | 162 | extern unsigned int rose_new_lci(struct rose_neigh *); |
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index 964ffa0d8815..5482e9582f55 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h | |||
@@ -72,7 +72,7 @@ struct Qdisc | |||
72 | */ | 72 | */ |
73 | unsigned long state; | 73 | unsigned long state; |
74 | struct sk_buff_head q; | 74 | struct sk_buff_head q; |
75 | struct gnet_stats_basic bstats; | 75 | struct gnet_stats_basic_packed bstats; |
76 | struct gnet_stats_queue qstats; | 76 | struct gnet_stats_queue qstats; |
77 | }; | 77 | }; |
78 | 78 | ||
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index 9f80a7668289..d16a304cbed4 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h | |||
@@ -448,6 +448,7 @@ static inline void sctp_skb_set_owner_r(struct sk_buff *skb, struct sock *sk) | |||
448 | { | 448 | { |
449 | struct sctp_ulpevent *event = sctp_skb2event(skb); | 449 | struct sctp_ulpevent *event = sctp_skb2event(skb); |
450 | 450 | ||
451 | skb_orphan(skb); | ||
451 | skb->sk = sk; | 452 | skb->sk = sk; |
452 | skb->destructor = sctp_sock_rfree; | 453 | skb->destructor = sctp_sock_rfree; |
453 | atomic_add(event->rmem_len, &sk->sk_rmem_alloc); | 454 | atomic_add(event->rmem_len, &sk->sk_rmem_alloc); |
diff --git a/include/net/sock.h b/include/net/sock.h index 95bd3fd75f94..950409dcec3d 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -54,6 +54,7 @@ | |||
54 | 54 | ||
55 | #include <linux/filter.h> | 55 | #include <linux/filter.h> |
56 | #include <linux/rculist_nulls.h> | 56 | #include <linux/rculist_nulls.h> |
57 | #include <linux/poll.h> | ||
57 | 58 | ||
58 | #include <asm/atomic.h> | 59 | #include <asm/atomic.h> |
59 | #include <net/dst.h> | 60 | #include <net/dst.h> |
@@ -103,15 +104,15 @@ struct net; | |||
103 | 104 | ||
104 | /** | 105 | /** |
105 | * struct sock_common - minimal network layer representation of sockets | 106 | * struct sock_common - minimal network layer representation of sockets |
107 | * @skc_node: main hash linkage for various protocol lookup tables | ||
108 | * @skc_nulls_node: main hash linkage for UDP/UDP-Lite protocol | ||
109 | * @skc_refcnt: reference count | ||
110 | * @skc_hash: hash value used with various protocol lookup tables | ||
106 | * @skc_family: network address family | 111 | * @skc_family: network address family |
107 | * @skc_state: Connection state | 112 | * @skc_state: Connection state |
108 | * @skc_reuse: %SO_REUSEADDR setting | 113 | * @skc_reuse: %SO_REUSEADDR setting |
109 | * @skc_bound_dev_if: bound device index if != 0 | 114 | * @skc_bound_dev_if: bound device index if != 0 |
110 | * @skc_node: main hash linkage for various protocol lookup tables | ||
111 | * @skc_nulls_node: main hash linkage for UDP/UDP-Lite protocol | ||
112 | * @skc_bind_node: bind hash linkage for various protocol lookup tables | 115 | * @skc_bind_node: bind hash linkage for various protocol lookup tables |
113 | * @skc_refcnt: reference count | ||
114 | * @skc_hash: hash value used with various protocol lookup tables | ||
115 | * @skc_prot: protocol handlers inside a network family | 116 | * @skc_prot: protocol handlers inside a network family |
116 | * @skc_net: reference to the network namespace of this socket | 117 | * @skc_net: reference to the network namespace of this socket |
117 | * | 118 | * |
@@ -119,17 +120,21 @@ struct net; | |||
119 | * for struct sock and struct inet_timewait_sock. | 120 | * for struct sock and struct inet_timewait_sock. |
120 | */ | 121 | */ |
121 | struct sock_common { | 122 | struct sock_common { |
122 | unsigned short skc_family; | 123 | /* |
123 | volatile unsigned char skc_state; | 124 | * first fields are not copied in sock_copy() |
124 | unsigned char skc_reuse; | 125 | */ |
125 | int skc_bound_dev_if; | ||
126 | union { | 126 | union { |
127 | struct hlist_node skc_node; | 127 | struct hlist_node skc_node; |
128 | struct hlist_nulls_node skc_nulls_node; | 128 | struct hlist_nulls_node skc_nulls_node; |
129 | }; | 129 | }; |
130 | struct hlist_node skc_bind_node; | ||
131 | atomic_t skc_refcnt; | 130 | atomic_t skc_refcnt; |
131 | |||
132 | unsigned int skc_hash; | 132 | unsigned int skc_hash; |
133 | unsigned short skc_family; | ||
134 | volatile unsigned char skc_state; | ||
135 | unsigned char skc_reuse; | ||
136 | int skc_bound_dev_if; | ||
137 | struct hlist_node skc_bind_node; | ||
133 | struct proto *skc_prot; | 138 | struct proto *skc_prot; |
134 | #ifdef CONFIG_NET_NS | 139 | #ifdef CONFIG_NET_NS |
135 | struct net *skc_net; | 140 | struct net *skc_net; |
@@ -207,15 +212,17 @@ struct sock { | |||
207 | * don't add nothing before this first member (__sk_common) --acme | 212 | * don't add nothing before this first member (__sk_common) --acme |
208 | */ | 213 | */ |
209 | struct sock_common __sk_common; | 214 | struct sock_common __sk_common; |
215 | #define sk_node __sk_common.skc_node | ||
216 | #define sk_nulls_node __sk_common.skc_nulls_node | ||
217 | #define sk_refcnt __sk_common.skc_refcnt | ||
218 | |||
219 | #define sk_copy_start __sk_common.skc_hash | ||
220 | #define sk_hash __sk_common.skc_hash | ||
210 | #define sk_family __sk_common.skc_family | 221 | #define sk_family __sk_common.skc_family |
211 | #define sk_state __sk_common.skc_state | 222 | #define sk_state __sk_common.skc_state |
212 | #define sk_reuse __sk_common.skc_reuse | 223 | #define sk_reuse __sk_common.skc_reuse |
213 | #define sk_bound_dev_if __sk_common.skc_bound_dev_if | 224 | #define sk_bound_dev_if __sk_common.skc_bound_dev_if |
214 | #define sk_node __sk_common.skc_node | ||
215 | #define sk_nulls_node __sk_common.skc_nulls_node | ||
216 | #define sk_bind_node __sk_common.skc_bind_node | 225 | #define sk_bind_node __sk_common.skc_bind_node |
217 | #define sk_refcnt __sk_common.skc_refcnt | ||
218 | #define sk_hash __sk_common.skc_hash | ||
219 | #define sk_prot __sk_common.skc_prot | 226 | #define sk_prot __sk_common.skc_prot |
220 | #define sk_net __sk_common.skc_net | 227 | #define sk_net __sk_common.skc_net |
221 | kmemcheck_bitfield_begin(flags); | 228 | kmemcheck_bitfield_begin(flags); |
@@ -1208,6 +1215,107 @@ static inline int skb_copy_to_page(struct sock *sk, char __user *from, | |||
1208 | return 0; | 1215 | return 0; |
1209 | } | 1216 | } |
1210 | 1217 | ||
1218 | /** | ||
1219 | * sk_wmem_alloc_get - returns write allocations | ||
1220 | * @sk: socket | ||
1221 | * | ||
1222 | * Returns sk_wmem_alloc minus initial offset of one | ||
1223 | */ | ||
1224 | static inline int sk_wmem_alloc_get(const struct sock *sk) | ||
1225 | { | ||
1226 | return atomic_read(&sk->sk_wmem_alloc) - 1; | ||
1227 | } | ||
1228 | |||
1229 | /** | ||
1230 | * sk_rmem_alloc_get - returns read allocations | ||
1231 | * @sk: socket | ||
1232 | * | ||
1233 | * Returns sk_rmem_alloc | ||
1234 | */ | ||
1235 | static inline int sk_rmem_alloc_get(const struct sock *sk) | ||
1236 | { | ||
1237 | return atomic_read(&sk->sk_rmem_alloc); | ||
1238 | } | ||
1239 | |||
1240 | /** | ||
1241 | * sk_has_allocations - check if allocations are outstanding | ||
1242 | * @sk: socket | ||
1243 | * | ||
1244 | * Returns true if socket has write or read allocations | ||
1245 | */ | ||
1246 | static inline int sk_has_allocations(const struct sock *sk) | ||
1247 | { | ||
1248 | return sk_wmem_alloc_get(sk) || sk_rmem_alloc_get(sk); | ||
1249 | } | ||
1250 | |||
1251 | /** | ||
1252 | * sk_has_sleeper - check if there are any waiting processes | ||
1253 | * @sk: socket | ||
1254 | * | ||
1255 | * Returns true if socket has waiting processes | ||
1256 | * | ||
1257 | * The purpose of the sk_has_sleeper and sock_poll_wait is to wrap the memory | ||
1258 | * barrier call. They were added due to the race found within the tcp code. | ||
1259 | * | ||
1260 | * Consider following tcp code paths: | ||
1261 | * | ||
1262 | * CPU1 CPU2 | ||
1263 | * | ||
1264 | * sys_select receive packet | ||
1265 | * ... ... | ||
1266 | * __add_wait_queue update tp->rcv_nxt | ||
1267 | * ... ... | ||
1268 | * tp->rcv_nxt check sock_def_readable | ||
1269 | * ... { | ||
1270 | * schedule ... | ||
1271 | * if (sk->sk_sleep && waitqueue_active(sk->sk_sleep)) | ||
1272 | * wake_up_interruptible(sk->sk_sleep) | ||
1273 | * ... | ||
1274 | * } | ||
1275 | * | ||
1276 | * The race for tcp fires when the __add_wait_queue changes done by CPU1 stay | ||
1277 | * in its cache, and so does the tp->rcv_nxt update on CPU2 side. The CPU1 | ||
1278 | * could then endup calling schedule and sleep forever if there are no more | ||
1279 | * data on the socket. | ||
1280 | * | ||
1281 | * The sk_has_sleeper is always called right after a call to read_lock, so we | ||
1282 | * can use smp_mb__after_lock barrier. | ||
1283 | */ | ||
1284 | static inline int sk_has_sleeper(struct sock *sk) | ||
1285 | { | ||
1286 | /* | ||
1287 | * We need to be sure we are in sync with the | ||
1288 | * add_wait_queue modifications to the wait queue. | ||
1289 | * | ||
1290 | * This memory barrier is paired in the sock_poll_wait. | ||
1291 | */ | ||
1292 | smp_mb__after_lock(); | ||
1293 | return sk->sk_sleep && waitqueue_active(sk->sk_sleep); | ||
1294 | } | ||
1295 | |||
1296 | /** | ||
1297 | * sock_poll_wait - place memory barrier behind the poll_wait call. | ||
1298 | * @filp: file | ||
1299 | * @wait_address: socket wait queue | ||
1300 | * @p: poll_table | ||
1301 | * | ||
1302 | * See the comments in the sk_has_sleeper function. | ||
1303 | */ | ||
1304 | static inline void sock_poll_wait(struct file *filp, | ||
1305 | wait_queue_head_t *wait_address, poll_table *p) | ||
1306 | { | ||
1307 | if (p && wait_address) { | ||
1308 | poll_wait(filp, wait_address, p); | ||
1309 | /* | ||
1310 | * We need to be sure we are in sync with the | ||
1311 | * socket flags modification. | ||
1312 | * | ||
1313 | * This memory barrier is paired in the sk_has_sleeper. | ||
1314 | */ | ||
1315 | smp_mb(); | ||
1316 | } | ||
1317 | } | ||
1318 | |||
1211 | /* | 1319 | /* |
1212 | * Queue a received datagram if it will fit. Stream and sequenced | 1320 | * Queue a received datagram if it will fit. Stream and sequenced |
1213 | * protocols can't normally use this as they need to fit buffers in | 1321 | * protocols can't normally use this as they need to fit buffers in |
@@ -1219,6 +1327,7 @@ static inline int skb_copy_to_page(struct sock *sk, char __user *from, | |||
1219 | 1327 | ||
1220 | static inline void skb_set_owner_w(struct sk_buff *skb, struct sock *sk) | 1328 | static inline void skb_set_owner_w(struct sk_buff *skb, struct sock *sk) |
1221 | { | 1329 | { |
1330 | skb_orphan(skb); | ||
1222 | skb->sk = sk; | 1331 | skb->sk = sk; |
1223 | skb->destructor = sock_wfree; | 1332 | skb->destructor = sock_wfree; |
1224 | /* | 1333 | /* |
@@ -1231,6 +1340,7 @@ static inline void skb_set_owner_w(struct sk_buff *skb, struct sock *sk) | |||
1231 | 1340 | ||
1232 | static inline void skb_set_owner_r(struct sk_buff *skb, struct sock *sk) | 1341 | static inline void skb_set_owner_r(struct sk_buff *skb, struct sock *sk) |
1233 | { | 1342 | { |
1343 | skb_orphan(skb); | ||
1234 | skb->sk = sk; | 1344 | skb->sk = sk; |
1235 | skb->destructor = sock_rfree; | 1345 | skb->destructor = sock_rfree; |
1236 | atomic_add(skb->truesize, &sk->sk_rmem_alloc); | 1346 | atomic_add(skb->truesize, &sk->sk_rmem_alloc); |
diff --git a/include/net/tcp.h b/include/net/tcp.h index 19f4150f4d4d..88af84306471 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -1425,6 +1425,11 @@ struct tcp_request_sock_ops { | |||
1425 | #ifdef CONFIG_TCP_MD5SIG | 1425 | #ifdef CONFIG_TCP_MD5SIG |
1426 | struct tcp_md5sig_key *(*md5_lookup) (struct sock *sk, | 1426 | struct tcp_md5sig_key *(*md5_lookup) (struct sock *sk, |
1427 | struct request_sock *req); | 1427 | struct request_sock *req); |
1428 | int (*calc_md5_hash) (char *location, | ||
1429 | struct tcp_md5sig_key *md5, | ||
1430 | struct sock *sk, | ||
1431 | struct request_sock *req, | ||
1432 | struct sk_buff *skb); | ||
1428 | #endif | 1433 | #endif |
1429 | }; | 1434 | }; |
1430 | 1435 | ||
diff --git a/include/net/x25.h b/include/net/x25.h index fc3f03d976f8..2cda04011568 100644 --- a/include/net/x25.h +++ b/include/net/x25.h | |||
@@ -187,7 +187,7 @@ extern int x25_addr_ntoa(unsigned char *, struct x25_address *, | |||
187 | extern int x25_addr_aton(unsigned char *, struct x25_address *, | 187 | extern int x25_addr_aton(unsigned char *, struct x25_address *, |
188 | struct x25_address *); | 188 | struct x25_address *); |
189 | extern struct sock *x25_find_socket(unsigned int, struct x25_neigh *); | 189 | extern struct sock *x25_find_socket(unsigned int, struct x25_neigh *); |
190 | extern void x25_destroy_socket(struct sock *); | 190 | extern void x25_destroy_socket_from_timer(struct sock *); |
191 | extern int x25_rx_call_request(struct sk_buff *, struct x25_neigh *, unsigned int); | 191 | extern int x25_rx_call_request(struct sk_buff *, struct x25_neigh *, unsigned int); |
192 | extern void x25_kill_by_neigh(struct x25_neigh *); | 192 | extern void x25_kill_by_neigh(struct x25_neigh *); |
193 | 193 | ||
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 736bca450886..9e3a3f4c1f60 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -1274,7 +1274,7 @@ struct xfrm_tunnel { | |||
1274 | struct xfrm6_tunnel { | 1274 | struct xfrm6_tunnel { |
1275 | int (*handler)(struct sk_buff *skb); | 1275 | int (*handler)(struct sk_buff *skb); |
1276 | int (*err_handler)(struct sk_buff *skb, struct inet6_skb_parm *opt, | 1276 | int (*err_handler)(struct sk_buff *skb, struct inet6_skb_parm *opt, |
1277 | int type, int code, int offset, __be32 info); | 1277 | u8 type, u8 code, int offset, __be32 info); |
1278 | struct xfrm6_tunnel *next; | 1278 | struct xfrm6_tunnel *next; |
1279 | int priority; | 1279 | int priority; |
1280 | }; | 1280 | }; |
diff --git a/include/scsi/fc_encode.h b/include/scsi/fc_encode.h index 6300f556bce5..a0ff61c3e935 100644 --- a/include/scsi/fc_encode.h +++ b/include/scsi/fc_encode.h | |||
@@ -107,7 +107,6 @@ static inline int fc_ct_fill(struct fc_lport *lport, struct fc_frame *fp, | |||
107 | break; | 107 | break; |
108 | 108 | ||
109 | default: | 109 | default: |
110 | FC_DBG("Invalid op code %x \n", op); | ||
111 | return -EINVAL; | 110 | return -EINVAL; |
112 | } | 111 | } |
113 | *r_ctl = FC_RCTL_DD_UNSOL_CTL; | 112 | *r_ctl = FC_RCTL_DD_UNSOL_CTL; |
@@ -298,7 +297,6 @@ static inline int fc_els_fill(struct fc_lport *lport, struct fc_rport *rport, | |||
298 | break; | 297 | break; |
299 | 298 | ||
300 | default: | 299 | default: |
301 | FC_DBG("Invalid op code %x \n", op); | ||
302 | return -EINVAL; | 300 | return -EINVAL; |
303 | } | 301 | } |
304 | 302 | ||
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h index ebdd9f4cf070..b92584a8843a 100644 --- a/include/scsi/libfc.h +++ b/include/scsi/libfc.h | |||
@@ -34,17 +34,72 @@ | |||
34 | 34 | ||
35 | #include <scsi/fc_frame.h> | 35 | #include <scsi/fc_frame.h> |
36 | 36 | ||
37 | #define LIBFC_DEBUG | 37 | #define FC_LIBFC_LOGGING 0x01 /* General logging, not categorized */ |
38 | 38 | #define FC_LPORT_LOGGING 0x02 /* lport layer logging */ | |
39 | #ifdef LIBFC_DEBUG | 39 | #define FC_DISC_LOGGING 0x04 /* discovery layer logging */ |
40 | /* Log messages */ | 40 | #define FC_RPORT_LOGGING 0x08 /* rport layer logging */ |
41 | #define FC_DBG(fmt, args...) \ | 41 | #define FC_FCP_LOGGING 0x10 /* I/O path logging */ |
42 | do { \ | 42 | #define FC_EM_LOGGING 0x20 /* Exchange Manager logging */ |
43 | printk(KERN_INFO "%s " fmt, __func__, ##args); \ | 43 | #define FC_EXCH_LOGGING 0x40 /* Exchange/Sequence logging */ |
44 | } while (0) | 44 | #define FC_SCSI_LOGGING 0x80 /* SCSI logging (mostly error handling) */ |
45 | #else | 45 | |
46 | #define FC_DBG(fmt, args...) | 46 | extern unsigned int fc_debug_logging; |
47 | #endif | 47 | |
48 | #define FC_CHECK_LOGGING(LEVEL, CMD) \ | ||
49 | do { \ | ||
50 | if (unlikely(fc_debug_logging & LEVEL)) \ | ||
51 | do { \ | ||
52 | CMD; \ | ||
53 | } while (0); \ | ||
54 | } while (0); | ||
55 | |||
56 | #define FC_LIBFC_DBG(fmt, args...) \ | ||
57 | FC_CHECK_LOGGING(FC_LIBFC_LOGGING, \ | ||
58 | printk(KERN_INFO "libfc: " fmt, ##args);) | ||
59 | |||
60 | #define FC_LPORT_DBG(lport, fmt, args...) \ | ||
61 | FC_CHECK_LOGGING(FC_LPORT_LOGGING, \ | ||
62 | printk(KERN_INFO "lport: %6x: " fmt, \ | ||
63 | fc_host_port_id(lport->host), ##args);) | ||
64 | |||
65 | #define FC_DISC_DBG(disc, fmt, args...) \ | ||
66 | FC_CHECK_LOGGING(FC_DISC_LOGGING, \ | ||
67 | printk(KERN_INFO "disc: %6x: " fmt, \ | ||
68 | fc_host_port_id(disc->lport->host), \ | ||
69 | ##args);) | ||
70 | |||
71 | #define FC_RPORT_DBG(rport, fmt, args...) \ | ||
72 | do { \ | ||
73 | struct fc_rport_libfc_priv *rdata = rport->dd_data; \ | ||
74 | struct fc_lport *lport = rdata->local_port; \ | ||
75 | FC_CHECK_LOGGING(FC_RPORT_LOGGING, \ | ||
76 | printk(KERN_INFO "rport: %6x: %6x: " fmt, \ | ||
77 | fc_host_port_id(lport->host), \ | ||
78 | rport->port_id, ##args);) \ | ||
79 | } while (0); | ||
80 | |||
81 | #define FC_FCP_DBG(pkt, fmt, args...) \ | ||
82 | FC_CHECK_LOGGING(FC_FCP_LOGGING, \ | ||
83 | printk(KERN_INFO "fcp: %6x: %6x: " fmt, \ | ||
84 | fc_host_port_id(pkt->lp->host), \ | ||
85 | pkt->rport->port_id, ##args);) | ||
86 | |||
87 | #define FC_EM_DBG(em, fmt, args...) \ | ||
88 | FC_CHECK_LOGGING(FC_EM_LOGGING, \ | ||
89 | printk(KERN_INFO "em: %6x: " fmt, \ | ||
90 | fc_host_port_id(em->lp->host), \ | ||
91 | ##args);) | ||
92 | |||
93 | #define FC_EXCH_DBG(exch, fmt, args...) \ | ||
94 | FC_CHECK_LOGGING(FC_EXCH_LOGGING, \ | ||
95 | printk(KERN_INFO "exch: %6x: %4x: " fmt, \ | ||
96 | fc_host_port_id(exch->lp->host), \ | ||
97 | exch->xid, ##args);) | ||
98 | |||
99 | #define FC_SCSI_DBG(lport, fmt, args...) \ | ||
100 | FC_CHECK_LOGGING(FC_SCSI_LOGGING, \ | ||
101 | printk(KERN_INFO "scsi: %6x: " fmt, \ | ||
102 | fc_host_port_id(lport->host), ##args);) | ||
48 | 103 | ||
49 | /* | 104 | /* |
50 | * libfc error codes | 105 | * libfc error codes |
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h index 196525cd402f..61afeb59a836 100644 --- a/include/scsi/libiscsi.h +++ b/include/scsi/libiscsi.h | |||
@@ -125,6 +125,10 @@ struct iscsi_task { | |||
125 | struct scsi_cmnd *sc; /* associated SCSI cmd*/ | 125 | struct scsi_cmnd *sc; /* associated SCSI cmd*/ |
126 | struct iscsi_conn *conn; /* used connection */ | 126 | struct iscsi_conn *conn; /* used connection */ |
127 | 127 | ||
128 | /* data processing tracking */ | ||
129 | unsigned long last_xfer; | ||
130 | unsigned long last_timeout; | ||
131 | bool have_checked_conn; | ||
128 | /* state set/tested under session->lock */ | 132 | /* state set/tested under session->lock */ |
129 | int state; | 133 | int state; |
130 | atomic_t refcount; | 134 | atomic_t refcount; |
diff --git a/include/scsi/scsi_driver.h b/include/scsi/scsi_driver.h index 1f5ca7f62116..9fd6702f02e2 100644 --- a/include/scsi/scsi_driver.h +++ b/include/scsi/scsi_driver.h | |||
@@ -32,5 +32,6 @@ int scsi_setup_blk_pc_cmnd(struct scsi_device *sdev, struct request *req); | |||
32 | int scsi_setup_fs_cmnd(struct scsi_device *sdev, struct request *req); | 32 | int scsi_setup_fs_cmnd(struct scsi_device *sdev, struct request *req); |
33 | int scsi_prep_state_check(struct scsi_device *sdev, struct request *req); | 33 | int scsi_prep_state_check(struct scsi_device *sdev, struct request *req); |
34 | int scsi_prep_return(struct request_queue *q, struct request *req, int ret); | 34 | int scsi_prep_return(struct request_queue *q, struct request *req, int ret); |
35 | int scsi_prep_fn(struct request_queue *, struct request *); | ||
35 | 36 | ||
36 | #endif /* _SCSI_SCSI_DRIVER_H */ | 37 | #endif /* _SCSI_SCSI_DRIVER_H */ |
diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h index 251fc1cd5002..3dae3f799b9b 100644 --- a/include/sound/ac97_codec.h +++ b/include/sound/ac97_codec.h | |||
@@ -32,6 +32,9 @@ | |||
32 | #include "control.h" | 32 | #include "control.h" |
33 | #include "info.h" | 33 | #include "info.h" |
34 | 34 | ||
35 | /* maximum number of devices on the AC97 bus */ | ||
36 | #define AC97_BUS_MAX_DEVICES 4 | ||
37 | |||
35 | /* | 38 | /* |
36 | * AC'97 codec registers | 39 | * AC'97 codec registers |
37 | */ | 40 | */ |
@@ -642,4 +645,10 @@ int snd_ac97_pcm_double_rate_rules(struct snd_pcm_runtime *runtime); | |||
642 | /* ad hoc AC97 device driver access */ | 645 | /* ad hoc AC97 device driver access */ |
643 | extern struct bus_type ac97_bus_type; | 646 | extern struct bus_type ac97_bus_type; |
644 | 647 | ||
648 | /* AC97 platform_data adding function */ | ||
649 | static inline void snd_ac97_dev_add_pdata(struct snd_ac97 *ac97, void *data) | ||
650 | { | ||
651 | ac97->dev.platform_data = data; | ||
652 | } | ||
653 | |||
645 | #endif /* __SOUND_AC97_CODEC_H */ | 654 | #endif /* __SOUND_AC97_CODEC_H */ |
diff --git a/include/sound/asound.h b/include/sound/asound.h index 82aed3f47534..1f57bb92eb5a 100644 --- a/include/sound/asound.h +++ b/include/sound/asound.h | |||
@@ -138,7 +138,7 @@ struct snd_hwdep_dsp_image { | |||
138 | * * | 138 | * * |
139 | *****************************************************************************/ | 139 | *****************************************************************************/ |
140 | 140 | ||
141 | #define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 9) | 141 | #define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 10) |
142 | 142 | ||
143 | typedef unsigned long snd_pcm_uframes_t; | 143 | typedef unsigned long snd_pcm_uframes_t; |
144 | typedef signed long snd_pcm_sframes_t; | 144 | typedef signed long snd_pcm_sframes_t; |
diff --git a/include/sound/core.h b/include/sound/core.h index 309cb9659a05..a61499c22b0b 100644 --- a/include/sound/core.h +++ b/include/sound/core.h | |||
@@ -93,15 +93,6 @@ struct snd_device { | |||
93 | 93 | ||
94 | #define snd_device(n) list_entry(n, struct snd_device, list) | 94 | #define snd_device(n) list_entry(n, struct snd_device, list) |
95 | 95 | ||
96 | /* monitor files for graceful shutdown (hotplug) */ | ||
97 | |||
98 | struct snd_monitor_file { | ||
99 | struct file *file; | ||
100 | const struct file_operations *disconnected_f_op; | ||
101 | struct list_head shutdown_list; /* still need to shutdown */ | ||
102 | struct list_head list; /* link of monitor files */ | ||
103 | }; | ||
104 | |||
105 | /* main structure for soundcard */ | 96 | /* main structure for soundcard */ |
106 | 97 | ||
107 | struct snd_card { | 98 | struct snd_card { |
@@ -311,9 +302,7 @@ int snd_component_add(struct snd_card *card, const char *component); | |||
311 | int snd_card_file_add(struct snd_card *card, struct file *file); | 302 | int snd_card_file_add(struct snd_card *card, struct file *file); |
312 | int snd_card_file_remove(struct snd_card *card, struct file *file); | 303 | int snd_card_file_remove(struct snd_card *card, struct file *file); |
313 | 304 | ||
314 | #ifndef snd_card_set_dev | ||
315 | #define snd_card_set_dev(card, devptr) ((card)->dev = (devptr)) | 305 | #define snd_card_set_dev(card, devptr) ((card)->dev = (devptr)) |
316 | #endif | ||
317 | 306 | ||
318 | /* device.c */ | 307 | /* device.c */ |
319 | 308 | ||
@@ -340,18 +329,17 @@ unsigned int snd_dma_pointer(unsigned long dma, unsigned int size); | |||
340 | struct resource; | 329 | struct resource; |
341 | void release_and_free_resource(struct resource *res); | 330 | void release_and_free_resource(struct resource *res); |
342 | 331 | ||
343 | #ifdef CONFIG_SND_VERBOSE_PRINTK | ||
344 | void snd_verbose_printk(const char *file, int line, const char *format, ...) | ||
345 | __attribute__ ((format (printf, 3, 4))); | ||
346 | #endif | ||
347 | #if defined(CONFIG_SND_DEBUG) && defined(CONFIG_SND_VERBOSE_PRINTK) | ||
348 | void snd_verbose_printd(const char *file, int line, const char *format, ...) | ||
349 | __attribute__ ((format (printf, 3, 4))); | ||
350 | #endif | ||
351 | |||
352 | /* --- */ | 332 | /* --- */ |
353 | 333 | ||
354 | #ifdef CONFIG_SND_VERBOSE_PRINTK | 334 | #if defined(CONFIG_SND_DEBUG) || defined(CONFIG_SND_VERBOSE_PRINTK) |
335 | void __snd_printk(unsigned int level, const char *file, int line, | ||
336 | const char *format, ...) | ||
337 | __attribute__ ((format (printf, 4, 5))); | ||
338 | #else | ||
339 | #define __snd_printk(level, file, line, format, args...) \ | ||
340 | printk(format, ##args) | ||
341 | #endif | ||
342 | |||
355 | /** | 343 | /** |
356 | * snd_printk - printk wrapper | 344 | * snd_printk - printk wrapper |
357 | * @fmt: format string | 345 | * @fmt: format string |
@@ -360,15 +348,9 @@ void snd_verbose_printd(const char *file, int line, const char *format, ...) | |||
360 | * when configured with CONFIG_SND_VERBOSE_PRINTK. | 348 | * when configured with CONFIG_SND_VERBOSE_PRINTK. |
361 | */ | 349 | */ |
362 | #define snd_printk(fmt, args...) \ | 350 | #define snd_printk(fmt, args...) \ |
363 | snd_verbose_printk(__FILE__, __LINE__, fmt ,##args) | 351 | __snd_printk(0, __FILE__, __LINE__, fmt, ##args) |
364 | #else | ||
365 | #define snd_printk(fmt, args...) \ | ||
366 | printk(fmt ,##args) | ||
367 | #endif | ||
368 | 352 | ||
369 | #ifdef CONFIG_SND_DEBUG | 353 | #ifdef CONFIG_SND_DEBUG |
370 | |||
371 | #ifdef CONFIG_SND_VERBOSE_PRINTK | ||
372 | /** | 354 | /** |
373 | * snd_printd - debug printk | 355 | * snd_printd - debug printk |
374 | * @fmt: format string | 356 | * @fmt: format string |
@@ -377,11 +359,7 @@ void snd_verbose_printd(const char *file, int line, const char *format, ...) | |||
377 | * Ignored when CONFIG_SND_DEBUG is not set. | 359 | * Ignored when CONFIG_SND_DEBUG is not set. |
378 | */ | 360 | */ |
379 | #define snd_printd(fmt, args...) \ | 361 | #define snd_printd(fmt, args...) \ |
380 | snd_verbose_printd(__FILE__, __LINE__, fmt ,##args) | 362 | __snd_printk(1, __FILE__, __LINE__, fmt, ##args) |
381 | #else | ||
382 | #define snd_printd(fmt, args...) \ | ||
383 | printk(fmt ,##args) | ||
384 | #endif | ||
385 | 363 | ||
386 | /** | 364 | /** |
387 | * snd_BUG - give a BUG warning message and stack trace | 365 | * snd_BUG - give a BUG warning message and stack trace |
@@ -428,9 +406,10 @@ static inline int __snd_bug_on(int cond) | |||
428 | * Works like snd_printk() for debugging purposes. | 406 | * Works like snd_printk() for debugging purposes. |
429 | * Ignored when CONFIG_SND_DEBUG_VERBOSE is not set. | 407 | * Ignored when CONFIG_SND_DEBUG_VERBOSE is not set. |
430 | */ | 408 | */ |
431 | #define snd_printdd(format, args...) snd_printk(format, ##args) | 409 | #define snd_printdd(format, args...) \ |
410 | __snd_printk(2, __FILE__, __LINE__, format, ##args) | ||
432 | #else | 411 | #else |
433 | #define snd_printdd(format, args...) /* nothing */ | 412 | #define snd_printdd(format, args...) do { } while (0) |
434 | #endif | 413 | #endif |
435 | 414 | ||
436 | 415 | ||
@@ -438,12 +417,10 @@ static inline int __snd_bug_on(int cond) | |||
438 | 417 | ||
439 | /* for easier backward-porting */ | 418 | /* for easier backward-porting */ |
440 | #if defined(CONFIG_GAMEPORT) || defined(CONFIG_GAMEPORT_MODULE) | 419 | #if defined(CONFIG_GAMEPORT) || defined(CONFIG_GAMEPORT_MODULE) |
441 | #ifndef gameport_set_dev_parent | ||
442 | #define gameport_set_dev_parent(gp,xdev) ((gp)->dev.parent = (xdev)) | 420 | #define gameport_set_dev_parent(gp,xdev) ((gp)->dev.parent = (xdev)) |
443 | #define gameport_set_port_data(gp,r) ((gp)->port_data = (r)) | 421 | #define gameport_set_port_data(gp,r) ((gp)->port_data = (r)) |
444 | #define gameport_get_port_data(gp) (gp)->port_data | 422 | #define gameport_get_port_data(gp) (gp)->port_data |
445 | #endif | 423 | #endif |
446 | #endif | ||
447 | 424 | ||
448 | /* PCI quirk list helper */ | 425 | /* PCI quirk list helper */ |
449 | struct snd_pci_quirk { | 426 | struct snd_pci_quirk { |
diff --git a/include/sound/info.h b/include/sound/info.h index 7c2ee1a21b00..112e8949e1a7 100644 --- a/include/sound/info.h +++ b/include/sound/info.h | |||
@@ -110,13 +110,13 @@ void snd_card_info_read_oss(struct snd_info_buffer *buffer); | |||
110 | static inline void snd_card_info_read_oss(struct snd_info_buffer *buffer) {} | 110 | static inline void snd_card_info_read_oss(struct snd_info_buffer *buffer) {} |
111 | #endif | 111 | #endif |
112 | 112 | ||
113 | int snd_iprintf(struct snd_info_buffer *buffer, char *fmt, ...) \ | 113 | int snd_iprintf(struct snd_info_buffer *buffer, const char *fmt, ...) \ |
114 | __attribute__ ((format (printf, 2, 3))); | 114 | __attribute__ ((format (printf, 2, 3))); |
115 | int snd_info_init(void); | 115 | int snd_info_init(void); |
116 | int snd_info_done(void); | 116 | int snd_info_done(void); |
117 | 117 | ||
118 | int snd_info_get_line(struct snd_info_buffer *buffer, char *line, int len); | 118 | int snd_info_get_line(struct snd_info_buffer *buffer, char *line, int len); |
119 | char *snd_info_get_str(char *dest, char *src, int len); | 119 | const char *snd_info_get_str(char *dest, const char *src, int len); |
120 | struct snd_info_entry *snd_info_create_module_entry(struct module *module, | 120 | struct snd_info_entry *snd_info_create_module_entry(struct module *module, |
121 | const char *name, | 121 | const char *name, |
122 | struct snd_info_entry *parent); | 122 | struct snd_info_entry *parent); |
diff --git a/include/sound/memalloc.h b/include/sound/memalloc.h index 7ccce94a5255..c42506212649 100644 --- a/include/sound/memalloc.h +++ b/include/sound/memalloc.h | |||
@@ -47,7 +47,11 @@ struct snd_dma_device { | |||
47 | #define SNDRV_DMA_TYPE_UNKNOWN 0 /* not defined */ | 47 | #define SNDRV_DMA_TYPE_UNKNOWN 0 /* not defined */ |
48 | #define SNDRV_DMA_TYPE_CONTINUOUS 1 /* continuous no-DMA memory */ | 48 | #define SNDRV_DMA_TYPE_CONTINUOUS 1 /* continuous no-DMA memory */ |
49 | #define SNDRV_DMA_TYPE_DEV 2 /* generic device continuous */ | 49 | #define SNDRV_DMA_TYPE_DEV 2 /* generic device continuous */ |
50 | #ifdef CONFIG_SND_DMA_SGBUF | ||
50 | #define SNDRV_DMA_TYPE_DEV_SG 3 /* generic device SG-buffer */ | 51 | #define SNDRV_DMA_TYPE_DEV_SG 3 /* generic device SG-buffer */ |
52 | #else | ||
53 | #define SNDRV_DMA_TYPE_DEV_SG SNDRV_DMA_TYPE_DEV /* no SG-buf support */ | ||
54 | #endif | ||
51 | 55 | ||
52 | /* | 56 | /* |
53 | * info for buffer allocation | 57 | * info for buffer allocation |
@@ -60,6 +64,7 @@ struct snd_dma_buffer { | |||
60 | void *private_data; /* private for allocator; don't touch */ | 64 | void *private_data; /* private for allocator; don't touch */ |
61 | }; | 65 | }; |
62 | 66 | ||
67 | #ifdef CONFIG_SND_DMA_SGBUF | ||
63 | /* | 68 | /* |
64 | * Scatter-Gather generic device pages | 69 | * Scatter-Gather generic device pages |
65 | */ | 70 | */ |
@@ -107,6 +112,7 @@ static inline void *snd_sgbuf_get_ptr(struct snd_sg_buf *sgbuf, size_t offset) | |||
107 | { | 112 | { |
108 | return sgbuf->table[offset >> PAGE_SHIFT].buf + offset % PAGE_SIZE; | 113 | return sgbuf->table[offset >> PAGE_SHIFT].buf + offset % PAGE_SIZE; |
109 | } | 114 | } |
115 | #endif /* CONFIG_SND_DMA_SGBUF */ | ||
110 | 116 | ||
111 | /* allocate/release a buffer */ | 117 | /* allocate/release a buffer */ |
112 | int snd_dma_alloc_pages(int type, struct device *dev, size_t size, | 118 | int snd_dma_alloc_pages(int type, struct device *dev, size_t size, |
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index 23893523dc8c..de6d981de5d6 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h | |||
@@ -902,6 +902,7 @@ int snd_pcm_lib_preallocate_pages_for_all(struct snd_pcm *pcm, | |||
902 | int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size); | 902 | int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size); |
903 | int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream); | 903 | int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream); |
904 | 904 | ||
905 | #ifdef CONFIG_SND_DMA_SGBUF | ||
905 | /* | 906 | /* |
906 | * SG-buffer handling | 907 | * SG-buffer handling |
907 | */ | 908 | */ |
@@ -927,6 +928,28 @@ struct page *snd_pcm_sgbuf_ops_page(struct snd_pcm_substream *substream, | |||
927 | unsigned int snd_pcm_sgbuf_get_chunk_size(struct snd_pcm_substream *substream, | 928 | unsigned int snd_pcm_sgbuf_get_chunk_size(struct snd_pcm_substream *substream, |
928 | unsigned int ofs, unsigned int size); | 929 | unsigned int ofs, unsigned int size); |
929 | 930 | ||
931 | #else /* !SND_DMA_SGBUF */ | ||
932 | /* | ||
933 | * fake using a continuous buffer | ||
934 | */ | ||
935 | static inline dma_addr_t | ||
936 | snd_pcm_sgbuf_get_addr(struct snd_pcm_substream *substream, unsigned int ofs) | ||
937 | { | ||
938 | return substream->runtime->dma_addr + ofs; | ||
939 | } | ||
940 | |||
941 | static inline void * | ||
942 | snd_pcm_sgbuf_get_ptr(struct snd_pcm_substream *substream, unsigned int ofs) | ||
943 | { | ||
944 | return substream->runtime->dma_area + ofs; | ||
945 | } | ||
946 | |||
947 | #define snd_pcm_sgbuf_ops_page NULL | ||
948 | |||
949 | #define snd_pcm_sgbuf_get_chunk_size(subs, ofs, size) (size) | ||
950 | |||
951 | #endif /* SND_DMA_SGBUF */ | ||
952 | |||
930 | /* handle mmap counter - PCM mmap callback should handle this counter properly */ | 953 | /* handle mmap counter - PCM mmap callback should handle this counter properly */ |
931 | static inline void snd_pcm_mmap_data_open(struct vm_area_struct *area) | 954 | static inline void snd_pcm_mmap_data_open(struct vm_area_struct *area) |
932 | { | 955 | { |
@@ -965,4 +988,6 @@ static inline void snd_pcm_limit_isa_dma_size(int dma, size_t *max) | |||
965 | 988 | ||
966 | #define PCM_RUNTIME_CHECK(sub) snd_BUG_ON(!(sub) || !(sub)->runtime) | 989 | #define PCM_RUNTIME_CHECK(sub) snd_BUG_ON(!(sub) || !(sub)->runtime) |
967 | 990 | ||
991 | const char *snd_pcm_format_name(snd_pcm_format_t format); | ||
992 | |||
968 | #endif /* __SOUND_PCM_H */ | 993 | #endif /* __SOUND_PCM_H */ |
diff --git a/include/sound/sh_fsi.h b/include/sound/sh_fsi.h new file mode 100644 index 000000000000..c0227361a876 --- /dev/null +++ b/include/sound/sh_fsi.h | |||
@@ -0,0 +1,83 @@ | |||
1 | #ifndef __SOUND_FSI_H | ||
2 | #define __SOUND_FSI_H | ||
3 | |||
4 | /* | ||
5 | * Fifo-attached Serial Interface (FSI) support for SH7724 | ||
6 | * | ||
7 | * Copyright (C) 2009 Renesas Solutions Corp. | ||
8 | * Kuninori Morimoto <morimoto.kuninori@renesas.com> | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2 as | ||
12 | * published by the Free Software Foundation. | ||
13 | */ | ||
14 | |||
15 | /* flags format | ||
16 | |||
17 | * 0xABCDEEFF | ||
18 | * | ||
19 | * A: channel size for TDM (input) | ||
20 | * B: channel size for TDM (ooutput) | ||
21 | * C: inversion | ||
22 | * D: mode | ||
23 | * E: input format | ||
24 | * F: output format | ||
25 | */ | ||
26 | |||
27 | #include <linux/clk.h> | ||
28 | #include <sound/soc.h> | ||
29 | |||
30 | /* TDM channel */ | ||
31 | #define SH_FSI_SET_CH_I(x) ((x & 0xF) << 28) | ||
32 | #define SH_FSI_SET_CH_O(x) ((x & 0xF) << 24) | ||
33 | |||
34 | #define SH_FSI_CH_IMASK 0xF0000000 | ||
35 | #define SH_FSI_CH_OMASK 0x0F000000 | ||
36 | #define SH_FSI_GET_CH_I(x) ((x & SH_FSI_CH_IMASK) >> 28) | ||
37 | #define SH_FSI_GET_CH_O(x) ((x & SH_FSI_CH_OMASK) >> 24) | ||
38 | |||
39 | /* clock inversion */ | ||
40 | #define SH_FSI_INVERSION_MASK 0x00F00000 | ||
41 | #define SH_FSI_LRM_INV (1 << 20) | ||
42 | #define SH_FSI_BRM_INV (1 << 21) | ||
43 | #define SH_FSI_LRS_INV (1 << 22) | ||
44 | #define SH_FSI_BRS_INV (1 << 23) | ||
45 | |||
46 | /* mode */ | ||
47 | #define SH_FSI_MODE_MASK 0x000F0000 | ||
48 | #define SH_FSI_IN_SLAVE_MODE (1 << 16) /* default master mode */ | ||
49 | #define SH_FSI_OUT_SLAVE_MODE (1 << 17) /* default master mode */ | ||
50 | |||
51 | /* DI format */ | ||
52 | #define SH_FSI_FMT_MASK 0x000000FF | ||
53 | #define SH_FSI_IFMT(x) (((SH_FSI_FMT_ ## x) & SH_FSI_FMT_MASK) << 8) | ||
54 | #define SH_FSI_OFMT(x) (((SH_FSI_FMT_ ## x) & SH_FSI_FMT_MASK) << 0) | ||
55 | #define SH_FSI_GET_IFMT(x) ((x >> 8) & SH_FSI_FMT_MASK) | ||
56 | #define SH_FSI_GET_OFMT(x) ((x >> 0) & SH_FSI_FMT_MASK) | ||
57 | |||
58 | #define SH_FSI_FMT_MONO (1 << 0) | ||
59 | #define SH_FSI_FMT_MONO_DELAY (1 << 1) | ||
60 | #define SH_FSI_FMT_PCM (1 << 2) | ||
61 | #define SH_FSI_FMT_I2S (1 << 3) | ||
62 | #define SH_FSI_FMT_TDM (1 << 4) | ||
63 | #define SH_FSI_FMT_TDM_DELAY (1 << 5) | ||
64 | |||
65 | #define SH_FSI_IFMT_TDM_CH(x) \ | ||
66 | (SH_FSI_IFMT(TDM) | SH_FSI_SET_CH_I(x)) | ||
67 | #define SH_FSI_IFMT_TDM_DELAY_CH(x) \ | ||
68 | (SH_FSI_IFMT(TDM_DELAY) | SH_FSI_SET_CH_I(x)) | ||
69 | |||
70 | #define SH_FSI_OFMT_TDM_CH(x) \ | ||
71 | (SH_FSI_OFMT(TDM) | SH_FSI_SET_CH_O(x)) | ||
72 | #define SH_FSI_OFMT_TDM_DELAY_CH(x) \ | ||
73 | (SH_FSI_OFMT(TDM_DELAY) | SH_FSI_SET_CH_O(x)) | ||
74 | |||
75 | struct sh_fsi_platform_info { | ||
76 | unsigned long porta_flags; | ||
77 | unsigned long portb_flags; | ||
78 | }; | ||
79 | |||
80 | extern struct snd_soc_dai fsi_soc_dai[2]; | ||
81 | extern struct snd_soc_platform fsi_soc_platform; | ||
82 | |||
83 | #endif /* __SOUND_FSI_H */ | ||
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 352d7eee9b6d..97ca9af414dc 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h | |||
@@ -27,8 +27,8 @@ struct snd_pcm_substream; | |||
27 | #define SND_SOC_DAIFMT_I2S 0 /* I2S mode */ | 27 | #define SND_SOC_DAIFMT_I2S 0 /* I2S mode */ |
28 | #define SND_SOC_DAIFMT_RIGHT_J 1 /* Right Justified mode */ | 28 | #define SND_SOC_DAIFMT_RIGHT_J 1 /* Right Justified mode */ |
29 | #define SND_SOC_DAIFMT_LEFT_J 2 /* Left Justified mode */ | 29 | #define SND_SOC_DAIFMT_LEFT_J 2 /* Left Justified mode */ |
30 | #define SND_SOC_DAIFMT_DSP_A 3 /* L data msb after FRM LRC */ | 30 | #define SND_SOC_DAIFMT_DSP_A 3 /* L data MSB after FRM LRC */ |
31 | #define SND_SOC_DAIFMT_DSP_B 4 /* L data msb during FRM LRC */ | 31 | #define SND_SOC_DAIFMT_DSP_B 4 /* L data MSB during FRM LRC */ |
32 | #define SND_SOC_DAIFMT_AC97 5 /* AC97 */ | 32 | #define SND_SOC_DAIFMT_AC97 5 /* AC97 */ |
33 | 33 | ||
34 | /* left and right justified also known as MSB and LSB respectively */ | 34 | /* left and right justified also known as MSB and LSB respectively */ |
@@ -38,7 +38,7 @@ struct snd_pcm_substream; | |||
38 | /* | 38 | /* |
39 | * DAI Clock gating. | 39 | * DAI Clock gating. |
40 | * | 40 | * |
41 | * DAI bit clocks can be be gated (disabled) when not the DAI is not | 41 | * DAI bit clocks can be be gated (disabled) when the DAI is not |
42 | * sending or receiving PCM data in a frame. This can be used to save power. | 42 | * sending or receiving PCM data in a frame. This can be used to save power. |
43 | */ | 43 | */ |
44 | #define SND_SOC_DAIFMT_CONT (0 << 4) /* continuous clock */ | 44 | #define SND_SOC_DAIFMT_CONT (0 << 4) /* continuous clock */ |
@@ -51,21 +51,21 @@ struct snd_pcm_substream; | |||
51 | * format. | 51 | * format. |
52 | */ | 52 | */ |
53 | #define SND_SOC_DAIFMT_NB_NF (0 << 8) /* normal bit clock + frame */ | 53 | #define SND_SOC_DAIFMT_NB_NF (0 << 8) /* normal bit clock + frame */ |
54 | #define SND_SOC_DAIFMT_NB_IF (1 << 8) /* normal bclk + inv frm */ | 54 | #define SND_SOC_DAIFMT_NB_IF (1 << 8) /* normal BCLK + inv FRM */ |
55 | #define SND_SOC_DAIFMT_IB_NF (2 << 8) /* invert bclk + nor frm */ | 55 | #define SND_SOC_DAIFMT_IB_NF (2 << 8) /* invert BCLK + nor FRM */ |
56 | #define SND_SOC_DAIFMT_IB_IF (3 << 8) /* invert bclk + frm */ | 56 | #define SND_SOC_DAIFMT_IB_IF (3 << 8) /* invert BCLK + FRM */ |
57 | 57 | ||
58 | /* | 58 | /* |
59 | * DAI hardware clock masters. | 59 | * DAI hardware clock masters. |
60 | * | 60 | * |
61 | * This is wrt the codec, the inverse is true for the interface | 61 | * This is wrt the codec, the inverse is true for the interface |
62 | * i.e. if the codec is clk and frm master then the interface is | 62 | * i.e. if the codec is clk and FRM master then the interface is |
63 | * clk and frame slave. | 63 | * clk and frame slave. |
64 | */ | 64 | */ |
65 | #define SND_SOC_DAIFMT_CBM_CFM (0 << 12) /* codec clk & frm master */ | 65 | #define SND_SOC_DAIFMT_CBM_CFM (0 << 12) /* codec clk & FRM master */ |
66 | #define SND_SOC_DAIFMT_CBS_CFM (1 << 12) /* codec clk slave & frm master */ | 66 | #define SND_SOC_DAIFMT_CBS_CFM (1 << 12) /* codec clk slave & FRM master */ |
67 | #define SND_SOC_DAIFMT_CBM_CFS (2 << 12) /* codec clk master & frame slave */ | 67 | #define SND_SOC_DAIFMT_CBM_CFS (2 << 12) /* codec clk master & frame slave */ |
68 | #define SND_SOC_DAIFMT_CBS_CFS (3 << 12) /* codec clk & frm slave */ | 68 | #define SND_SOC_DAIFMT_CBS_CFS (3 << 12) /* codec clk & FRM slave */ |
69 | 69 | ||
70 | #define SND_SOC_DAIFMT_FORMAT_MASK 0x000f | 70 | #define SND_SOC_DAIFMT_FORMAT_MASK 0x000f |
71 | #define SND_SOC_DAIFMT_CLOCK_MASK 0x00f0 | 71 | #define SND_SOC_DAIFMT_CLOCK_MASK 0x00f0 |
@@ -78,7 +78,13 @@ struct snd_pcm_substream; | |||
78 | #define SND_SOC_CLOCK_IN 0 | 78 | #define SND_SOC_CLOCK_IN 0 |
79 | #define SND_SOC_CLOCK_OUT 1 | 79 | #define SND_SOC_CLOCK_OUT 1 |
80 | 80 | ||
81 | #define SND_SOC_STD_AC97_FMTS (SNDRV_PCM_FMTBIT_S16_LE |\ | 81 | #define SND_SOC_STD_AC97_FMTS (SNDRV_PCM_FMTBIT_S8 |\ |
82 | SNDRV_PCM_FMTBIT_S16_LE |\ | ||
83 | SNDRV_PCM_FMTBIT_S16_BE |\ | ||
84 | SNDRV_PCM_FMTBIT_S20_3LE |\ | ||
85 | SNDRV_PCM_FMTBIT_S20_3BE |\ | ||
86 | SNDRV_PCM_FMTBIT_S24_3LE |\ | ||
87 | SNDRV_PCM_FMTBIT_S24_3BE |\ | ||
82 | SNDRV_PCM_FMTBIT_S32_LE |\ | 88 | SNDRV_PCM_FMTBIT_S32_LE |\ |
83 | SNDRV_PCM_FMTBIT_S32_BE) | 89 | SNDRV_PCM_FMTBIT_S32_BE) |
84 | 90 | ||
@@ -106,7 +112,7 @@ int snd_soc_dai_set_pll(struct snd_soc_dai *dai, | |||
106 | int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt); | 112 | int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt); |
107 | 113 | ||
108 | int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai, | 114 | int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai, |
109 | unsigned int mask, int slots); | 115 | unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width); |
110 | 116 | ||
111 | int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate); | 117 | int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate); |
112 | 118 | ||
@@ -116,12 +122,12 @@ int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute); | |||
116 | /* | 122 | /* |
117 | * Digital Audio Interface. | 123 | * Digital Audio Interface. |
118 | * | 124 | * |
119 | * Describes the Digital Audio Interface in terms of it's ALSA, DAI and AC97 | 125 | * Describes the Digital Audio Interface in terms of its ALSA, DAI and AC97 |
120 | * operations an capabilities. Codec and platfom drivers will register a this | 126 | * operations and capabilities. Codec and platform drivers will register this |
121 | * structure for every DAI they have. | 127 | * structure for every DAI they have. |
122 | * | 128 | * |
123 | * This structure covers the clocking, formating and ALSA operations for each | 129 | * This structure covers the clocking, formating and ALSA operations for each |
124 | * interface a | 130 | * interface. |
125 | */ | 131 | */ |
126 | struct snd_soc_dai_ops { | 132 | struct snd_soc_dai_ops { |
127 | /* | 133 | /* |
@@ -140,7 +146,8 @@ struct snd_soc_dai_ops { | |||
140 | */ | 146 | */ |
141 | int (*set_fmt)(struct snd_soc_dai *dai, unsigned int fmt); | 147 | int (*set_fmt)(struct snd_soc_dai *dai, unsigned int fmt); |
142 | int (*set_tdm_slot)(struct snd_soc_dai *dai, | 148 | int (*set_tdm_slot)(struct snd_soc_dai *dai, |
143 | unsigned int mask, int slots); | 149 | unsigned int tx_mask, unsigned int rx_mask, |
150 | int slots, int slot_width); | ||
144 | int (*set_tristate)(struct snd_soc_dai *dai, int tristate); | 151 | int (*set_tristate)(struct snd_soc_dai *dai, int tristate); |
145 | 152 | ||
146 | /* | 153 | /* |
@@ -179,6 +186,7 @@ struct snd_soc_dai { | |||
179 | int ac97_control; | 186 | int ac97_control; |
180 | 187 | ||
181 | struct device *dev; | 188 | struct device *dev; |
189 | void *ac97_pdata; /* platform_data for the ac97 codec */ | ||
182 | 190 | ||
183 | /* DAI callbacks */ | 191 | /* DAI callbacks */ |
184 | int (*probe)(struct platform_device *pdev, | 192 | int (*probe)(struct platform_device *pdev, |
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index ec8a45f9a069..c1410e3191e3 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
@@ -137,6 +137,12 @@ | |||
137 | .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD} | 137 | .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD} |
138 | 138 | ||
139 | /* stream domain */ | 139 | /* stream domain */ |
140 | #define SND_SOC_DAPM_AIF_IN(wname, stname, wslot, wreg, wshift, winvert) \ | ||
141 | { .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \ | ||
142 | .reg = wreg, .shift = wshift, .invert = winvert } | ||
143 | #define SND_SOC_DAPM_AIF_OUT(wname, stname, wslot, wreg, wshift, winvert) \ | ||
144 | { .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \ | ||
145 | .reg = wreg, .shift = wshift, .invert = winvert } | ||
140 | #define SND_SOC_DAPM_DAC(wname, stname, wreg, wshift, winvert) \ | 146 | #define SND_SOC_DAPM_DAC(wname, stname, wreg, wshift, winvert) \ |
141 | { .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \ | 147 | { .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \ |
142 | .shift = wshift, .invert = winvert} | 148 | .shift = wshift, .invert = winvert} |
@@ -279,9 +285,11 @@ int snd_soc_dapm_add_routes(struct snd_soc_codec *codec, | |||
279 | /* dapm events */ | 285 | /* dapm events */ |
280 | int snd_soc_dapm_stream_event(struct snd_soc_codec *codec, char *stream, | 286 | int snd_soc_dapm_stream_event(struct snd_soc_codec *codec, char *stream, |
281 | int event); | 287 | int event); |
288 | void snd_soc_dapm_shutdown(struct snd_soc_device *socdev); | ||
282 | 289 | ||
283 | /* dapm sys fs - used by the core */ | 290 | /* dapm sys fs - used by the core */ |
284 | int snd_soc_dapm_sys_add(struct device *dev); | 291 | int snd_soc_dapm_sys_add(struct device *dev); |
292 | void snd_soc_dapm_debugfs_init(struct snd_soc_codec *codec); | ||
285 | 293 | ||
286 | /* dapm audio pin control and status */ | 294 | /* dapm audio pin control and status */ |
287 | int snd_soc_dapm_enable_pin(struct snd_soc_codec *codec, const char *pin); | 295 | int snd_soc_dapm_enable_pin(struct snd_soc_codec *codec, const char *pin); |
@@ -311,6 +319,8 @@ enum snd_soc_dapm_type { | |||
311 | snd_soc_dapm_pre, /* machine specific pre widget - exec first */ | 319 | snd_soc_dapm_pre, /* machine specific pre widget - exec first */ |
312 | snd_soc_dapm_post, /* machine specific post widget - exec last */ | 320 | snd_soc_dapm_post, /* machine specific post widget - exec last */ |
313 | snd_soc_dapm_supply, /* power/clock supply */ | 321 | snd_soc_dapm_supply, /* power/clock supply */ |
322 | snd_soc_dapm_aif_in, /* audio interface input */ | ||
323 | snd_soc_dapm_aif_out, /* audio interface output */ | ||
314 | }; | 324 | }; |
315 | 325 | ||
316 | /* | 326 | /* |
diff --git a/include/sound/soc.h b/include/sound/soc.h index cf6111d72b17..475cb7ed6bec 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -135,6 +135,28 @@ | |||
135 | .info = snd_soc_info_volsw, \ | 135 | .info = snd_soc_info_volsw, \ |
136 | .get = xhandler_get, .put = xhandler_put, \ | 136 | .get = xhandler_get, .put = xhandler_put, \ |
137 | .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) } | 137 | .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) } |
138 | #define SOC_DOUBLE_EXT_TLV(xname, xreg, shift_left, shift_right, xmax, xinvert,\ | ||
139 | xhandler_get, xhandler_put, tlv_array) \ | ||
140 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ | ||
141 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ | ||
142 | SNDRV_CTL_ELEM_ACCESS_READWRITE, \ | ||
143 | .tlv.p = (tlv_array), \ | ||
144 | .info = snd_soc_info_volsw, \ | ||
145 | .get = xhandler_get, .put = xhandler_put, \ | ||
146 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | ||
147 | {.reg = xreg, .shift = shift_left, .rshift = shift_right, \ | ||
148 | .max = xmax, .invert = xinvert} } | ||
149 | #define SOC_DOUBLE_R_EXT_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert,\ | ||
150 | xhandler_get, xhandler_put, tlv_array) \ | ||
151 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ | ||
152 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ | ||
153 | SNDRV_CTL_ELEM_ACCESS_READWRITE, \ | ||
154 | .tlv.p = (tlv_array), \ | ||
155 | .info = snd_soc_info_volsw_2r, \ | ||
156 | .get = xhandler_get, .put = xhandler_put, \ | ||
157 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | ||
158 | {.reg = reg_left, .rreg = reg_right, .shift = xshift, \ | ||
159 | .max = xmax, .invert = xinvert} } | ||
138 | #define SOC_SINGLE_BOOL_EXT(xname, xdata, xhandler_get, xhandler_put) \ | 160 | #define SOC_SINGLE_BOOL_EXT(xname, xdata, xhandler_get, xhandler_put) \ |
139 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 161 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
140 | .info = snd_soc_info_bool_ext, \ | 162 | .info = snd_soc_info_bool_ext, \ |
@@ -183,14 +205,28 @@ struct snd_soc_jack_gpio; | |||
183 | #endif | 205 | #endif |
184 | 206 | ||
185 | typedef int (*hw_write_t)(void *,const char* ,int); | 207 | typedef int (*hw_write_t)(void *,const char* ,int); |
186 | typedef int (*hw_read_t)(void *,char* ,int); | ||
187 | 208 | ||
188 | extern struct snd_ac97_bus_ops soc_ac97_ops; | 209 | extern struct snd_ac97_bus_ops soc_ac97_ops; |
189 | 210 | ||
211 | enum snd_soc_control_type { | ||
212 | SND_SOC_CUSTOM, | ||
213 | SND_SOC_I2C, | ||
214 | SND_SOC_SPI, | ||
215 | }; | ||
216 | |||
190 | int snd_soc_register_platform(struct snd_soc_platform *platform); | 217 | int snd_soc_register_platform(struct snd_soc_platform *platform); |
191 | void snd_soc_unregister_platform(struct snd_soc_platform *platform); | 218 | void snd_soc_unregister_platform(struct snd_soc_platform *platform); |
192 | int snd_soc_register_codec(struct snd_soc_codec *codec); | 219 | int snd_soc_register_codec(struct snd_soc_codec *codec); |
193 | void snd_soc_unregister_codec(struct snd_soc_codec *codec); | 220 | void snd_soc_unregister_codec(struct snd_soc_codec *codec); |
221 | int snd_soc_codec_volatile_register(struct snd_soc_codec *codec, int reg); | ||
222 | int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec, | ||
223 | int addr_bits, int data_bits, | ||
224 | enum snd_soc_control_type control); | ||
225 | |||
226 | #ifdef CONFIG_PM | ||
227 | int snd_soc_suspend_device(struct device *dev); | ||
228 | int snd_soc_resume_device(struct device *dev); | ||
229 | #endif | ||
194 | 230 | ||
195 | /* pcm <-> DAI connect */ | 231 | /* pcm <-> DAI connect */ |
196 | void snd_soc_free_pcms(struct snd_soc_device *socdev); | 232 | void snd_soc_free_pcms(struct snd_soc_device *socdev); |
@@ -216,9 +252,9 @@ void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count, | |||
216 | 252 | ||
217 | /* codec register bit access */ | 253 | /* codec register bit access */ |
218 | int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned short reg, | 254 | int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned short reg, |
219 | unsigned short mask, unsigned short value); | 255 | unsigned int mask, unsigned int value); |
220 | int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned short reg, | 256 | int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned short reg, |
221 | unsigned short mask, unsigned short value); | 257 | unsigned int mask, unsigned int value); |
222 | 258 | ||
223 | int snd_soc_new_ac97_codec(struct snd_soc_codec *codec, | 259 | int snd_soc_new_ac97_codec(struct snd_soc_codec *codec, |
224 | struct snd_ac97_bus_ops *ops, int num); | 260 | struct snd_ac97_bus_ops *ops, int num); |
@@ -356,8 +392,10 @@ struct snd_soc_codec { | |||
356 | int (*write)(struct snd_soc_codec *, unsigned int, unsigned int); | 392 | int (*write)(struct snd_soc_codec *, unsigned int, unsigned int); |
357 | int (*display_register)(struct snd_soc_codec *, char *, | 393 | int (*display_register)(struct snd_soc_codec *, char *, |
358 | size_t, unsigned int); | 394 | size_t, unsigned int); |
395 | int (*volatile_register)(unsigned int); | ||
396 | int (*readable_register)(unsigned int); | ||
359 | hw_write_t hw_write; | 397 | hw_write_t hw_write; |
360 | hw_read_t hw_read; | 398 | unsigned int (*hw_read)(struct snd_soc_codec *, unsigned int); |
361 | void *reg_cache; | 399 | void *reg_cache; |
362 | short reg_cache_size; | 400 | short reg_cache_size; |
363 | short reg_cache_step; | 401 | short reg_cache_step; |
@@ -369,8 +407,6 @@ struct snd_soc_codec { | |||
369 | enum snd_soc_bias_level bias_level; | 407 | enum snd_soc_bias_level bias_level; |
370 | enum snd_soc_bias_level suspend_bias_level; | 408 | enum snd_soc_bias_level suspend_bias_level; |
371 | struct delayed_work delayed_work; | 409 | struct delayed_work delayed_work; |
372 | struct list_head up_list; | ||
373 | struct list_head down_list; | ||
374 | 410 | ||
375 | /* codec DAI's */ | 411 | /* codec DAI's */ |
376 | struct snd_soc_dai *dai; | 412 | struct snd_soc_dai *dai; |
@@ -379,6 +415,7 @@ struct snd_soc_codec { | |||
379 | #ifdef CONFIG_DEBUG_FS | 415 | #ifdef CONFIG_DEBUG_FS |
380 | struct dentry *debugfs_reg; | 416 | struct dentry *debugfs_reg; |
381 | struct dentry *debugfs_pop_time; | 417 | struct dentry *debugfs_pop_time; |
418 | struct dentry *debugfs_dapm; | ||
382 | #endif | 419 | #endif |
383 | }; | 420 | }; |
384 | 421 | ||
diff --git a/include/sound/tlv.h b/include/sound/tlv.h index d136ea2181ed..9fd5b19ccf5c 100644 --- a/include/sound/tlv.h +++ b/include/sound/tlv.h | |||
@@ -35,6 +35,8 @@ | |||
35 | #define SNDRV_CTL_TLVT_DB_SCALE 1 /* dB scale */ | 35 | #define SNDRV_CTL_TLVT_DB_SCALE 1 /* dB scale */ |
36 | #define SNDRV_CTL_TLVT_DB_LINEAR 2 /* linear volume */ | 36 | #define SNDRV_CTL_TLVT_DB_LINEAR 2 /* linear volume */ |
37 | #define SNDRV_CTL_TLVT_DB_RANGE 3 /* dB range container */ | 37 | #define SNDRV_CTL_TLVT_DB_RANGE 3 /* dB range container */ |
38 | #define SNDRV_CTL_TLVT_DB_MINMAX 4 /* dB scale with min/max */ | ||
39 | #define SNDRV_CTL_TLVT_DB_MINMAX_MUTE 5 /* dB scale with min/max with mute */ | ||
38 | 40 | ||
39 | #define TLV_DB_SCALE_ITEM(min, step, mute) \ | 41 | #define TLV_DB_SCALE_ITEM(min, step, mute) \ |
40 | SNDRV_CTL_TLVT_DB_SCALE, 2 * sizeof(unsigned int), \ | 42 | SNDRV_CTL_TLVT_DB_SCALE, 2 * sizeof(unsigned int), \ |
@@ -42,6 +44,18 @@ | |||
42 | #define DECLARE_TLV_DB_SCALE(name, min, step, mute) \ | 44 | #define DECLARE_TLV_DB_SCALE(name, min, step, mute) \ |
43 | unsigned int name[] = { TLV_DB_SCALE_ITEM(min, step, mute) } | 45 | unsigned int name[] = { TLV_DB_SCALE_ITEM(min, step, mute) } |
44 | 46 | ||
47 | /* dB scale specified with min/max values instead of step */ | ||
48 | #define TLV_DB_MINMAX_ITEM(min_dB, max_dB) \ | ||
49 | SNDRV_CTL_TLVT_DB_MINMAX, 2 * sizeof(unsigned int), \ | ||
50 | (min_dB), (max_dB) | ||
51 | #define TLV_DB_MINMAX_MUTE_ITEM(min_dB, max_dB) \ | ||
52 | SNDRV_CTL_TLVT_DB_MINMAX_MUTE, 2 * sizeof(unsigned int), \ | ||
53 | (min_dB), (max_dB) | ||
54 | #define DECLARE_TLV_DB_MINMAX(name, min_dB, max_dB) \ | ||
55 | unsigned int name[] = { TLV_DB_MINMAX_ITEM(min_dB, max_dB) } | ||
56 | #define DECLARE_TLV_DB_MINMAX_MUTE(name, min_dB, max_dB) \ | ||
57 | unsigned int name[] = { TLV_DB_MINMAX_MUTE_ITEM(min_dB, max_dB) } | ||
58 | |||
45 | /* linear volume between min_dB and max_dB (.01dB unit) */ | 59 | /* linear volume between min_dB and max_dB (.01dB unit) */ |
46 | #define TLV_DB_LINEAR_ITEM(min_dB, max_dB) \ | 60 | #define TLV_DB_LINEAR_ITEM(min_dB, max_dB) \ |
47 | SNDRV_CTL_TLVT_DB_LINEAR, 2 * sizeof(unsigned int), \ | 61 | SNDRV_CTL_TLVT_DB_LINEAR, 2 * sizeof(unsigned int), \ |
diff --git a/include/sound/uda1380.h b/include/sound/uda1380.h new file mode 100644 index 000000000000..381319c7000c --- /dev/null +++ b/include/sound/uda1380.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * UDA1380 ALSA SoC Codec driver | ||
3 | * | ||
4 | * Copyright 2009 Philipp Zabel | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef __UDA1380_H | ||
12 | #define __UDA1380_H | ||
13 | |||
14 | struct uda1380_platform_data { | ||
15 | int gpio_power; | ||
16 | int gpio_reset; | ||
17 | int dac_clk; | ||
18 | #define UDA1380_DAC_CLK_SYSCLK 0 | ||
19 | #define UDA1380_DAC_CLK_WSPLL 1 | ||
20 | }; | ||
21 | |||
22 | #endif /* __UDA1380_H */ | ||
diff --git a/include/sound/version.h b/include/sound/version.h index 456f1359e1c0..22939142dd23 100644 --- a/include/sound/version.h +++ b/include/sound/version.h | |||
@@ -1,3 +1,3 @@ | |||
1 | /* include/version.h */ | 1 | /* include/version.h */ |
2 | #define CONFIG_SND_VERSION "1.0.20" | 2 | #define CONFIG_SND_VERSION "1.0.21" |
3 | #define CONFIG_SND_DATE "" | 3 | #define CONFIG_SND_DATE "" |
diff --git a/include/sound/wm8993.h b/include/sound/wm8993.h new file mode 100644 index 000000000000..9c661f2f8cda --- /dev/null +++ b/include/sound/wm8993.h | |||
@@ -0,0 +1,44 @@ | |||
1 | /* | ||
2 | * linux/sound/wm8993.h -- Platform data for WM8993 | ||
3 | * | ||
4 | * Copyright 2009 Wolfson Microelectronics. PLC. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef __LINUX_SND_WM8993_H | ||
12 | #define __LINUX_SND_WM8993_H | ||
13 | |||
14 | /* Note that EQ1 only contains the enable/disable bit so will be | ||
15 | ignored but is included for simplicity. | ||
16 | */ | ||
17 | struct wm8993_retune_mobile_setting { | ||
18 | const char *name; | ||
19 | unsigned int rate; | ||
20 | u16 config[24]; | ||
21 | }; | ||
22 | |||
23 | struct wm8993_platform_data { | ||
24 | struct wm8993_retune_mobile_setting *retune_configs; | ||
25 | int num_retune_configs; | ||
26 | |||
27 | /* LINEOUT can be differential or single ended */ | ||
28 | unsigned int lineout1_diff:1; | ||
29 | unsigned int lineout2_diff:1; | ||
30 | |||
31 | /* Common mode feedback */ | ||
32 | unsigned int lineout1fb:1; | ||
33 | unsigned int lineout2fb:1; | ||
34 | |||
35 | /* Microphone biases: 0=0.9*AVDD1 1=0.65*AVVD1 */ | ||
36 | unsigned int micbias1_lvl:1; | ||
37 | unsigned int micbias2_lvl:1; | ||
38 | |||
39 | /* Jack detect threashold levels, see datasheet for values */ | ||
40 | unsigned int jd_scthr:2; | ||
41 | unsigned int jd_thr:2; | ||
42 | }; | ||
43 | |||
44 | #endif | ||
diff --git a/include/sound/ymfpci.h b/include/sound/ymfpci.h index 05ead6698434..444cd6ba0ba7 100644 --- a/include/sound/ymfpci.h +++ b/include/sound/ymfpci.h | |||
@@ -331,6 +331,7 @@ struct snd_ymfpci { | |||
331 | struct snd_ac97 *ac97; | 331 | struct snd_ac97 *ac97; |
332 | struct snd_rawmidi *rawmidi; | 332 | struct snd_rawmidi *rawmidi; |
333 | struct snd_timer *timer; | 333 | struct snd_timer *timer; |
334 | unsigned int timer_ticks; | ||
334 | 335 | ||
335 | struct pci_dev *pci; | 336 | struct pci_dev *pci; |
336 | struct snd_card *card; | 337 | struct snd_card *card; |
diff --git a/include/trace/events/block.h b/include/trace/events/block.h index d6b05f42dd44..9a74b468a229 100644 --- a/include/trace/events/block.h +++ b/include/trace/events/block.h | |||
@@ -1,3 +1,6 @@ | |||
1 | #undef TRACE_SYSTEM | ||
2 | #define TRACE_SYSTEM block | ||
3 | |||
1 | #if !defined(_TRACE_BLOCK_H) || defined(TRACE_HEADER_MULTI_READ) | 4 | #if !defined(_TRACE_BLOCK_H) || defined(TRACE_HEADER_MULTI_READ) |
2 | #define _TRACE_BLOCK_H | 5 | #define _TRACE_BLOCK_H |
3 | 6 | ||
@@ -5,9 +8,6 @@ | |||
5 | #include <linux/blkdev.h> | 8 | #include <linux/blkdev.h> |
6 | #include <linux/tracepoint.h> | 9 | #include <linux/tracepoint.h> |
7 | 10 | ||
8 | #undef TRACE_SYSTEM | ||
9 | #define TRACE_SYSTEM block | ||
10 | |||
11 | TRACE_EVENT(block_rq_abort, | 11 | TRACE_EVENT(block_rq_abort, |
12 | 12 | ||
13 | TP_PROTO(struct request_queue *q, struct request *rq), | 13 | TP_PROTO(struct request_queue *q, struct request *rq), |
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h new file mode 100644 index 000000000000..7d8b5bc74185 --- /dev/null +++ b/include/trace/events/ext4.h | |||
@@ -0,0 +1,677 @@ | |||
1 | #undef TRACE_SYSTEM | ||
2 | #define TRACE_SYSTEM ext4 | ||
3 | |||
4 | #if !defined(_TRACE_EXT4_H) || defined(TRACE_HEADER_MULTI_READ) | ||
5 | #define _TRACE_EXT4_H | ||
6 | |||
7 | #include <linux/writeback.h> | ||
8 | #include "../../../fs/ext4/ext4.h" | ||
9 | #include "../../../fs/ext4/mballoc.h" | ||
10 | #include <linux/tracepoint.h> | ||
11 | |||
12 | TRACE_EVENT(ext4_free_inode, | ||
13 | TP_PROTO(struct inode *inode), | ||
14 | |||
15 | TP_ARGS(inode), | ||
16 | |||
17 | TP_STRUCT__entry( | ||
18 | __field( dev_t, dev ) | ||
19 | __field( ino_t, ino ) | ||
20 | __field( umode_t, mode ) | ||
21 | __field( uid_t, uid ) | ||
22 | __field( gid_t, gid ) | ||
23 | __field( blkcnt_t, blocks ) | ||
24 | ), | ||
25 | |||
26 | TP_fast_assign( | ||
27 | __entry->dev = inode->i_sb->s_dev; | ||
28 | __entry->ino = inode->i_ino; | ||
29 | __entry->mode = inode->i_mode; | ||
30 | __entry->uid = inode->i_uid; | ||
31 | __entry->gid = inode->i_gid; | ||
32 | __entry->blocks = inode->i_blocks; | ||
33 | ), | ||
34 | |||
35 | TP_printk("dev %s ino %lu mode %d uid %u gid %u blocks %llu", | ||
36 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->mode, | ||
37 | __entry->uid, __entry->gid, | ||
38 | (unsigned long long) __entry->blocks) | ||
39 | ); | ||
40 | |||
41 | TRACE_EVENT(ext4_request_inode, | ||
42 | TP_PROTO(struct inode *dir, int mode), | ||
43 | |||
44 | TP_ARGS(dir, mode), | ||
45 | |||
46 | TP_STRUCT__entry( | ||
47 | __field( dev_t, dev ) | ||
48 | __field( ino_t, dir ) | ||
49 | __field( umode_t, mode ) | ||
50 | ), | ||
51 | |||
52 | TP_fast_assign( | ||
53 | __entry->dev = dir->i_sb->s_dev; | ||
54 | __entry->dir = dir->i_ino; | ||
55 | __entry->mode = mode; | ||
56 | ), | ||
57 | |||
58 | TP_printk("dev %s dir %lu mode %d", | ||
59 | jbd2_dev_to_name(__entry->dev), __entry->dir, __entry->mode) | ||
60 | ); | ||
61 | |||
62 | TRACE_EVENT(ext4_allocate_inode, | ||
63 | TP_PROTO(struct inode *inode, struct inode *dir, int mode), | ||
64 | |||
65 | TP_ARGS(inode, dir, mode), | ||
66 | |||
67 | TP_STRUCT__entry( | ||
68 | __field( dev_t, dev ) | ||
69 | __field( ino_t, ino ) | ||
70 | __field( ino_t, dir ) | ||
71 | __field( umode_t, mode ) | ||
72 | ), | ||
73 | |||
74 | TP_fast_assign( | ||
75 | __entry->dev = inode->i_sb->s_dev; | ||
76 | __entry->ino = inode->i_ino; | ||
77 | __entry->dir = dir->i_ino; | ||
78 | __entry->mode = mode; | ||
79 | ), | ||
80 | |||
81 | TP_printk("dev %s ino %lu dir %lu mode %d", | ||
82 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->dir, __entry->mode) | ||
83 | ); | ||
84 | |||
85 | TRACE_EVENT(ext4_write_begin, | ||
86 | |||
87 | TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, | ||
88 | unsigned int flags), | ||
89 | |||
90 | TP_ARGS(inode, pos, len, flags), | ||
91 | |||
92 | TP_STRUCT__entry( | ||
93 | __field( dev_t, dev ) | ||
94 | __field( ino_t, ino ) | ||
95 | __field( loff_t, pos ) | ||
96 | __field( unsigned int, len ) | ||
97 | __field( unsigned int, flags ) | ||
98 | ), | ||
99 | |||
100 | TP_fast_assign( | ||
101 | __entry->dev = inode->i_sb->s_dev; | ||
102 | __entry->ino = inode->i_ino; | ||
103 | __entry->pos = pos; | ||
104 | __entry->len = len; | ||
105 | __entry->flags = flags; | ||
106 | ), | ||
107 | |||
108 | TP_printk("dev %s ino %lu pos %llu len %u flags %u", | ||
109 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->pos, __entry->len, | ||
110 | __entry->flags) | ||
111 | ); | ||
112 | |||
113 | TRACE_EVENT(ext4_ordered_write_end, | ||
114 | TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, | ||
115 | unsigned int copied), | ||
116 | |||
117 | TP_ARGS(inode, pos, len, copied), | ||
118 | |||
119 | TP_STRUCT__entry( | ||
120 | __field( dev_t, dev ) | ||
121 | __field( ino_t, ino ) | ||
122 | __field( loff_t, pos ) | ||
123 | __field( unsigned int, len ) | ||
124 | __field( unsigned int, copied ) | ||
125 | ), | ||
126 | |||
127 | TP_fast_assign( | ||
128 | __entry->dev = inode->i_sb->s_dev; | ||
129 | __entry->ino = inode->i_ino; | ||
130 | __entry->pos = pos; | ||
131 | __entry->len = len; | ||
132 | __entry->copied = copied; | ||
133 | ), | ||
134 | |||
135 | TP_printk("dev %s ino %lu pos %llu len %u copied %u", | ||
136 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->pos, __entry->len, | ||
137 | __entry->copied) | ||
138 | ); | ||
139 | |||
140 | TRACE_EVENT(ext4_writeback_write_end, | ||
141 | TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, | ||
142 | unsigned int copied), | ||
143 | |||
144 | TP_ARGS(inode, pos, len, copied), | ||
145 | |||
146 | TP_STRUCT__entry( | ||
147 | __field( dev_t, dev ) | ||
148 | __field( ino_t, ino ) | ||
149 | __field( loff_t, pos ) | ||
150 | __field( unsigned int, len ) | ||
151 | __field( unsigned int, copied ) | ||
152 | ), | ||
153 | |||
154 | TP_fast_assign( | ||
155 | __entry->dev = inode->i_sb->s_dev; | ||
156 | __entry->ino = inode->i_ino; | ||
157 | __entry->pos = pos; | ||
158 | __entry->len = len; | ||
159 | __entry->copied = copied; | ||
160 | ), | ||
161 | |||
162 | TP_printk("dev %s ino %lu pos %llu len %u copied %u", | ||
163 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->pos, __entry->len, | ||
164 | __entry->copied) | ||
165 | ); | ||
166 | |||
167 | TRACE_EVENT(ext4_journalled_write_end, | ||
168 | TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, | ||
169 | unsigned int copied), | ||
170 | TP_ARGS(inode, pos, len, copied), | ||
171 | |||
172 | TP_STRUCT__entry( | ||
173 | __field( dev_t, dev ) | ||
174 | __field( ino_t, ino ) | ||
175 | __field( loff_t, pos ) | ||
176 | __field( unsigned int, len ) | ||
177 | __field( unsigned int, copied ) | ||
178 | ), | ||
179 | |||
180 | TP_fast_assign( | ||
181 | __entry->dev = inode->i_sb->s_dev; | ||
182 | __entry->ino = inode->i_ino; | ||
183 | __entry->pos = pos; | ||
184 | __entry->len = len; | ||
185 | __entry->copied = copied; | ||
186 | ), | ||
187 | |||
188 | TP_printk("dev %s ino %lu pos %llu len %u copied %u", | ||
189 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->pos, __entry->len, | ||
190 | __entry->copied) | ||
191 | ); | ||
192 | |||
193 | TRACE_EVENT(ext4_writepage, | ||
194 | TP_PROTO(struct inode *inode, struct page *page), | ||
195 | |||
196 | TP_ARGS(inode, page), | ||
197 | |||
198 | TP_STRUCT__entry( | ||
199 | __field( dev_t, dev ) | ||
200 | __field( ino_t, ino ) | ||
201 | __field( pgoff_t, index ) | ||
202 | |||
203 | ), | ||
204 | |||
205 | TP_fast_assign( | ||
206 | __entry->dev = inode->i_sb->s_dev; | ||
207 | __entry->ino = inode->i_ino; | ||
208 | __entry->index = page->index; | ||
209 | ), | ||
210 | |||
211 | TP_printk("dev %s ino %lu page_index %lu", | ||
212 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->index) | ||
213 | ); | ||
214 | |||
215 | TRACE_EVENT(ext4_da_writepages, | ||
216 | TP_PROTO(struct inode *inode, struct writeback_control *wbc), | ||
217 | |||
218 | TP_ARGS(inode, wbc), | ||
219 | |||
220 | TP_STRUCT__entry( | ||
221 | __field( dev_t, dev ) | ||
222 | __field( ino_t, ino ) | ||
223 | __field( long, nr_to_write ) | ||
224 | __field( long, pages_skipped ) | ||
225 | __field( loff_t, range_start ) | ||
226 | __field( loff_t, range_end ) | ||
227 | __field( char, nonblocking ) | ||
228 | __field( char, for_kupdate ) | ||
229 | __field( char, for_reclaim ) | ||
230 | __field( char, for_writepages ) | ||
231 | __field( char, range_cyclic ) | ||
232 | ), | ||
233 | |||
234 | TP_fast_assign( | ||
235 | __entry->dev = inode->i_sb->s_dev; | ||
236 | __entry->ino = inode->i_ino; | ||
237 | __entry->nr_to_write = wbc->nr_to_write; | ||
238 | __entry->pages_skipped = wbc->pages_skipped; | ||
239 | __entry->range_start = wbc->range_start; | ||
240 | __entry->range_end = wbc->range_end; | ||
241 | __entry->nonblocking = wbc->nonblocking; | ||
242 | __entry->for_kupdate = wbc->for_kupdate; | ||
243 | __entry->for_reclaim = wbc->for_reclaim; | ||
244 | __entry->for_writepages = wbc->for_writepages; | ||
245 | __entry->range_cyclic = wbc->range_cyclic; | ||
246 | ), | ||
247 | |||
248 | TP_printk("dev %s ino %lu nr_t_write %ld pages_skipped %ld range_start %llu range_end %llu nonblocking %d for_kupdate %d for_reclaim %d for_writepages %d range_cyclic %d", | ||
249 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->nr_to_write, | ||
250 | __entry->pages_skipped, __entry->range_start, | ||
251 | __entry->range_end, __entry->nonblocking, | ||
252 | __entry->for_kupdate, __entry->for_reclaim, | ||
253 | __entry->for_writepages, __entry->range_cyclic) | ||
254 | ); | ||
255 | |||
256 | TRACE_EVENT(ext4_da_writepages_result, | ||
257 | TP_PROTO(struct inode *inode, struct writeback_control *wbc, | ||
258 | int ret, int pages_written), | ||
259 | |||
260 | TP_ARGS(inode, wbc, ret, pages_written), | ||
261 | |||
262 | TP_STRUCT__entry( | ||
263 | __field( dev_t, dev ) | ||
264 | __field( ino_t, ino ) | ||
265 | __field( int, ret ) | ||
266 | __field( int, pages_written ) | ||
267 | __field( long, pages_skipped ) | ||
268 | __field( char, encountered_congestion ) | ||
269 | __field( char, more_io ) | ||
270 | __field( char, no_nrwrite_index_update ) | ||
271 | ), | ||
272 | |||
273 | TP_fast_assign( | ||
274 | __entry->dev = inode->i_sb->s_dev; | ||
275 | __entry->ino = inode->i_ino; | ||
276 | __entry->ret = ret; | ||
277 | __entry->pages_written = pages_written; | ||
278 | __entry->pages_skipped = wbc->pages_skipped; | ||
279 | __entry->encountered_congestion = wbc->encountered_congestion; | ||
280 | __entry->more_io = wbc->more_io; | ||
281 | __entry->no_nrwrite_index_update = wbc->no_nrwrite_index_update; | ||
282 | ), | ||
283 | |||
284 | TP_printk("dev %s ino %lu ret %d pages_written %d pages_skipped %ld congestion %d more_io %d no_nrwrite_index_update %d", | ||
285 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->ret, | ||
286 | __entry->pages_written, __entry->pages_skipped, | ||
287 | __entry->encountered_congestion, __entry->more_io, | ||
288 | __entry->no_nrwrite_index_update) | ||
289 | ); | ||
290 | |||
291 | TRACE_EVENT(ext4_da_write_begin, | ||
292 | TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, | ||
293 | unsigned int flags), | ||
294 | |||
295 | TP_ARGS(inode, pos, len, flags), | ||
296 | |||
297 | TP_STRUCT__entry( | ||
298 | __field( dev_t, dev ) | ||
299 | __field( ino_t, ino ) | ||
300 | __field( loff_t, pos ) | ||
301 | __field( unsigned int, len ) | ||
302 | __field( unsigned int, flags ) | ||
303 | ), | ||
304 | |||
305 | TP_fast_assign( | ||
306 | __entry->dev = inode->i_sb->s_dev; | ||
307 | __entry->ino = inode->i_ino; | ||
308 | __entry->pos = pos; | ||
309 | __entry->len = len; | ||
310 | __entry->flags = flags; | ||
311 | ), | ||
312 | |||
313 | TP_printk("dev %s ino %lu pos %llu len %u flags %u", | ||
314 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->pos, __entry->len, | ||
315 | __entry->flags) | ||
316 | ); | ||
317 | |||
318 | TRACE_EVENT(ext4_da_write_end, | ||
319 | TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, | ||
320 | unsigned int copied), | ||
321 | |||
322 | TP_ARGS(inode, pos, len, copied), | ||
323 | |||
324 | TP_STRUCT__entry( | ||
325 | __field( dev_t, dev ) | ||
326 | __field( ino_t, ino ) | ||
327 | __field( loff_t, pos ) | ||
328 | __field( unsigned int, len ) | ||
329 | __field( unsigned int, copied ) | ||
330 | ), | ||
331 | |||
332 | TP_fast_assign( | ||
333 | __entry->dev = inode->i_sb->s_dev; | ||
334 | __entry->ino = inode->i_ino; | ||
335 | __entry->pos = pos; | ||
336 | __entry->len = len; | ||
337 | __entry->copied = copied; | ||
338 | ), | ||
339 | |||
340 | TP_printk("dev %s ino %lu pos %llu len %u copied %u", | ||
341 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->pos, __entry->len, | ||
342 | __entry->copied) | ||
343 | ); | ||
344 | |||
345 | TRACE_EVENT(ext4_discard_blocks, | ||
346 | TP_PROTO(struct super_block *sb, unsigned long long blk, | ||
347 | unsigned long long count), | ||
348 | |||
349 | TP_ARGS(sb, blk, count), | ||
350 | |||
351 | TP_STRUCT__entry( | ||
352 | __field( dev_t, dev ) | ||
353 | __field( __u64, blk ) | ||
354 | __field( __u64, count ) | ||
355 | |||
356 | ), | ||
357 | |||
358 | TP_fast_assign( | ||
359 | __entry->dev = sb->s_dev; | ||
360 | __entry->blk = blk; | ||
361 | __entry->count = count; | ||
362 | ), | ||
363 | |||
364 | TP_printk("dev %s blk %llu count %llu", | ||
365 | jbd2_dev_to_name(__entry->dev), __entry->blk, __entry->count) | ||
366 | ); | ||
367 | |||
368 | TRACE_EVENT(ext4_mb_new_inode_pa, | ||
369 | TP_PROTO(struct ext4_allocation_context *ac, | ||
370 | struct ext4_prealloc_space *pa), | ||
371 | |||
372 | TP_ARGS(ac, pa), | ||
373 | |||
374 | TP_STRUCT__entry( | ||
375 | __field( dev_t, dev ) | ||
376 | __field( ino_t, ino ) | ||
377 | __field( __u64, pa_pstart ) | ||
378 | __field( __u32, pa_len ) | ||
379 | __field( __u64, pa_lstart ) | ||
380 | |||
381 | ), | ||
382 | |||
383 | TP_fast_assign( | ||
384 | __entry->dev = ac->ac_sb->s_dev; | ||
385 | __entry->ino = ac->ac_inode->i_ino; | ||
386 | __entry->pa_pstart = pa->pa_pstart; | ||
387 | __entry->pa_len = pa->pa_len; | ||
388 | __entry->pa_lstart = pa->pa_lstart; | ||
389 | ), | ||
390 | |||
391 | TP_printk("dev %s ino %lu pstart %llu len %u lstart %llu", | ||
392 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->pa_pstart, | ||
393 | __entry->pa_len, __entry->pa_lstart) | ||
394 | ); | ||
395 | |||
396 | TRACE_EVENT(ext4_mb_new_group_pa, | ||
397 | TP_PROTO(struct ext4_allocation_context *ac, | ||
398 | struct ext4_prealloc_space *pa), | ||
399 | |||
400 | TP_ARGS(ac, pa), | ||
401 | |||
402 | TP_STRUCT__entry( | ||
403 | __field( dev_t, dev ) | ||
404 | __field( ino_t, ino ) | ||
405 | __field( __u64, pa_pstart ) | ||
406 | __field( __u32, pa_len ) | ||
407 | __field( __u64, pa_lstart ) | ||
408 | |||
409 | ), | ||
410 | |||
411 | TP_fast_assign( | ||
412 | __entry->dev = ac->ac_sb->s_dev; | ||
413 | __entry->ino = ac->ac_inode->i_ino; | ||
414 | __entry->pa_pstart = pa->pa_pstart; | ||
415 | __entry->pa_len = pa->pa_len; | ||
416 | __entry->pa_lstart = pa->pa_lstart; | ||
417 | ), | ||
418 | |||
419 | TP_printk("dev %s ino %lu pstart %llu len %u lstart %llu", | ||
420 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->pa_pstart, | ||
421 | __entry->pa_len, __entry->pa_lstart) | ||
422 | ); | ||
423 | |||
424 | TRACE_EVENT(ext4_mb_release_inode_pa, | ||
425 | TP_PROTO(struct ext4_allocation_context *ac, | ||
426 | struct ext4_prealloc_space *pa, | ||
427 | unsigned long long block, unsigned int count), | ||
428 | |||
429 | TP_ARGS(ac, pa, block, count), | ||
430 | |||
431 | TP_STRUCT__entry( | ||
432 | __field( dev_t, dev ) | ||
433 | __field( ino_t, ino ) | ||
434 | __field( __u64, block ) | ||
435 | __field( __u32, count ) | ||
436 | |||
437 | ), | ||
438 | |||
439 | TP_fast_assign( | ||
440 | __entry->dev = ac->ac_sb->s_dev; | ||
441 | __entry->ino = ac->ac_inode->i_ino; | ||
442 | __entry->block = block; | ||
443 | __entry->count = count; | ||
444 | ), | ||
445 | |||
446 | TP_printk("dev %s ino %lu block %llu count %u", | ||
447 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->block, | ||
448 | __entry->count) | ||
449 | ); | ||
450 | |||
451 | TRACE_EVENT(ext4_mb_release_group_pa, | ||
452 | TP_PROTO(struct ext4_allocation_context *ac, | ||
453 | struct ext4_prealloc_space *pa), | ||
454 | |||
455 | TP_ARGS(ac, pa), | ||
456 | |||
457 | TP_STRUCT__entry( | ||
458 | __field( dev_t, dev ) | ||
459 | __field( ino_t, ino ) | ||
460 | __field( __u64, pa_pstart ) | ||
461 | __field( __u32, pa_len ) | ||
462 | |||
463 | ), | ||
464 | |||
465 | TP_fast_assign( | ||
466 | __entry->dev = ac->ac_sb->s_dev; | ||
467 | __entry->ino = ac->ac_inode->i_ino; | ||
468 | __entry->pa_pstart = pa->pa_pstart; | ||
469 | __entry->pa_len = pa->pa_len; | ||
470 | ), | ||
471 | |||
472 | TP_printk("dev %s pstart %llu len %u", | ||
473 | jbd2_dev_to_name(__entry->dev), __entry->pa_pstart, __entry->pa_len) | ||
474 | ); | ||
475 | |||
476 | TRACE_EVENT(ext4_discard_preallocations, | ||
477 | TP_PROTO(struct inode *inode), | ||
478 | |||
479 | TP_ARGS(inode), | ||
480 | |||
481 | TP_STRUCT__entry( | ||
482 | __field( dev_t, dev ) | ||
483 | __field( ino_t, ino ) | ||
484 | |||
485 | ), | ||
486 | |||
487 | TP_fast_assign( | ||
488 | __entry->dev = inode->i_sb->s_dev; | ||
489 | __entry->ino = inode->i_ino; | ||
490 | ), | ||
491 | |||
492 | TP_printk("dev %s ino %lu", | ||
493 | jbd2_dev_to_name(__entry->dev), __entry->ino) | ||
494 | ); | ||
495 | |||
496 | TRACE_EVENT(ext4_mb_discard_preallocations, | ||
497 | TP_PROTO(struct super_block *sb, int needed), | ||
498 | |||
499 | TP_ARGS(sb, needed), | ||
500 | |||
501 | TP_STRUCT__entry( | ||
502 | __field( dev_t, dev ) | ||
503 | __field( int, needed ) | ||
504 | |||
505 | ), | ||
506 | |||
507 | TP_fast_assign( | ||
508 | __entry->dev = sb->s_dev; | ||
509 | __entry->needed = needed; | ||
510 | ), | ||
511 | |||
512 | TP_printk("dev %s needed %d", | ||
513 | jbd2_dev_to_name(__entry->dev), __entry->needed) | ||
514 | ); | ||
515 | |||
516 | TRACE_EVENT(ext4_request_blocks, | ||
517 | TP_PROTO(struct ext4_allocation_request *ar), | ||
518 | |||
519 | TP_ARGS(ar), | ||
520 | |||
521 | TP_STRUCT__entry( | ||
522 | __field( dev_t, dev ) | ||
523 | __field( ino_t, ino ) | ||
524 | __field( unsigned int, flags ) | ||
525 | __field( unsigned int, len ) | ||
526 | __field( __u64, logical ) | ||
527 | __field( __u64, goal ) | ||
528 | __field( __u64, lleft ) | ||
529 | __field( __u64, lright ) | ||
530 | __field( __u64, pleft ) | ||
531 | __field( __u64, pright ) | ||
532 | ), | ||
533 | |||
534 | TP_fast_assign( | ||
535 | __entry->dev = ar->inode->i_sb->s_dev; | ||
536 | __entry->ino = ar->inode->i_ino; | ||
537 | __entry->flags = ar->flags; | ||
538 | __entry->len = ar->len; | ||
539 | __entry->logical = ar->logical; | ||
540 | __entry->goal = ar->goal; | ||
541 | __entry->lleft = ar->lleft; | ||
542 | __entry->lright = ar->lright; | ||
543 | __entry->pleft = ar->pleft; | ||
544 | __entry->pright = ar->pright; | ||
545 | ), | ||
546 | |||
547 | TP_printk("dev %s ino %lu flags %u len %u lblk %llu goal %llu lleft %llu lright %llu pleft %llu pright %llu ", | ||
548 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->flags, | ||
549 | __entry->len, | ||
550 | (unsigned long long) __entry->logical, | ||
551 | (unsigned long long) __entry->goal, | ||
552 | (unsigned long long) __entry->lleft, | ||
553 | (unsigned long long) __entry->lright, | ||
554 | (unsigned long long) __entry->pleft, | ||
555 | (unsigned long long) __entry->pright) | ||
556 | ); | ||
557 | |||
558 | TRACE_EVENT(ext4_allocate_blocks, | ||
559 | TP_PROTO(struct ext4_allocation_request *ar, unsigned long long block), | ||
560 | |||
561 | TP_ARGS(ar, block), | ||
562 | |||
563 | TP_STRUCT__entry( | ||
564 | __field( dev_t, dev ) | ||
565 | __field( ino_t, ino ) | ||
566 | __field( __u64, block ) | ||
567 | __field( unsigned int, flags ) | ||
568 | __field( unsigned int, len ) | ||
569 | __field( __u64, logical ) | ||
570 | __field( __u64, goal ) | ||
571 | __field( __u64, lleft ) | ||
572 | __field( __u64, lright ) | ||
573 | __field( __u64, pleft ) | ||
574 | __field( __u64, pright ) | ||
575 | ), | ||
576 | |||
577 | TP_fast_assign( | ||
578 | __entry->dev = ar->inode->i_sb->s_dev; | ||
579 | __entry->ino = ar->inode->i_ino; | ||
580 | __entry->block = block; | ||
581 | __entry->flags = ar->flags; | ||
582 | __entry->len = ar->len; | ||
583 | __entry->logical = ar->logical; | ||
584 | __entry->goal = ar->goal; | ||
585 | __entry->lleft = ar->lleft; | ||
586 | __entry->lright = ar->lright; | ||
587 | __entry->pleft = ar->pleft; | ||
588 | __entry->pright = ar->pright; | ||
589 | ), | ||
590 | |||
591 | TP_printk("dev %s ino %lu flags %u len %u block %llu lblk %llu goal %llu lleft %llu lright %llu pleft %llu pright %llu ", | ||
592 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->flags, | ||
593 | __entry->len, __entry->block, | ||
594 | (unsigned long long) __entry->logical, | ||
595 | (unsigned long long) __entry->goal, | ||
596 | (unsigned long long) __entry->lleft, | ||
597 | (unsigned long long) __entry->lright, | ||
598 | (unsigned long long) __entry->pleft, | ||
599 | (unsigned long long) __entry->pright) | ||
600 | ); | ||
601 | |||
602 | TRACE_EVENT(ext4_free_blocks, | ||
603 | TP_PROTO(struct inode *inode, __u64 block, unsigned long count, | ||
604 | int metadata), | ||
605 | |||
606 | TP_ARGS(inode, block, count, metadata), | ||
607 | |||
608 | TP_STRUCT__entry( | ||
609 | __field( dev_t, dev ) | ||
610 | __field( ino_t, ino ) | ||
611 | __field( __u64, block ) | ||
612 | __field( unsigned long, count ) | ||
613 | __field( int, metadata ) | ||
614 | |||
615 | ), | ||
616 | |||
617 | TP_fast_assign( | ||
618 | __entry->dev = inode->i_sb->s_dev; | ||
619 | __entry->ino = inode->i_ino; | ||
620 | __entry->block = block; | ||
621 | __entry->count = count; | ||
622 | __entry->metadata = metadata; | ||
623 | ), | ||
624 | |||
625 | TP_printk("dev %s ino %lu block %llu count %lu metadata %d", | ||
626 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->block, | ||
627 | __entry->count, __entry->metadata) | ||
628 | ); | ||
629 | |||
630 | TRACE_EVENT(ext4_sync_file, | ||
631 | TP_PROTO(struct file *file, struct dentry *dentry, int datasync), | ||
632 | |||
633 | TP_ARGS(file, dentry, datasync), | ||
634 | |||
635 | TP_STRUCT__entry( | ||
636 | __field( dev_t, dev ) | ||
637 | __field( ino_t, ino ) | ||
638 | __field( ino_t, parent ) | ||
639 | __field( int, datasync ) | ||
640 | ), | ||
641 | |||
642 | TP_fast_assign( | ||
643 | __entry->dev = dentry->d_inode->i_sb->s_dev; | ||
644 | __entry->ino = dentry->d_inode->i_ino; | ||
645 | __entry->datasync = datasync; | ||
646 | __entry->parent = dentry->d_parent->d_inode->i_ino; | ||
647 | ), | ||
648 | |||
649 | TP_printk("dev %s ino %ld parent %ld datasync %d ", | ||
650 | jbd2_dev_to_name(__entry->dev), __entry->ino, __entry->parent, | ||
651 | __entry->datasync) | ||
652 | ); | ||
653 | |||
654 | TRACE_EVENT(ext4_sync_fs, | ||
655 | TP_PROTO(struct super_block *sb, int wait), | ||
656 | |||
657 | TP_ARGS(sb, wait), | ||
658 | |||
659 | TP_STRUCT__entry( | ||
660 | __field( dev_t, dev ) | ||
661 | __field( int, wait ) | ||
662 | |||
663 | ), | ||
664 | |||
665 | TP_fast_assign( | ||
666 | __entry->dev = sb->s_dev; | ||
667 | __entry->wait = wait; | ||
668 | ), | ||
669 | |||
670 | TP_printk("dev %s wait %d", jbd2_dev_to_name(__entry->dev), | ||
671 | __entry->wait) | ||
672 | ); | ||
673 | |||
674 | #endif /* _TRACE_EXT4_H */ | ||
675 | |||
676 | /* This part must be outside protection */ | ||
677 | #include <trace/define_trace.h> | ||
diff --git a/include/trace/events/irq.h b/include/trace/events/irq.h index b0c7ede55eb1..1cb0c3aa11e6 100644 --- a/include/trace/events/irq.h +++ b/include/trace/events/irq.h | |||
@@ -1,12 +1,12 @@ | |||
1 | #undef TRACE_SYSTEM | ||
2 | #define TRACE_SYSTEM irq | ||
3 | |||
1 | #if !defined(_TRACE_IRQ_H) || defined(TRACE_HEADER_MULTI_READ) | 4 | #if !defined(_TRACE_IRQ_H) || defined(TRACE_HEADER_MULTI_READ) |
2 | #define _TRACE_IRQ_H | 5 | #define _TRACE_IRQ_H |
3 | 6 | ||
4 | #include <linux/tracepoint.h> | 7 | #include <linux/tracepoint.h> |
5 | #include <linux/interrupt.h> | 8 | #include <linux/interrupt.h> |
6 | 9 | ||
7 | #undef TRACE_SYSTEM | ||
8 | #define TRACE_SYSTEM irq | ||
9 | |||
10 | #define softirq_name(sirq) { sirq##_SOFTIRQ, #sirq } | 10 | #define softirq_name(sirq) { sirq##_SOFTIRQ, #sirq } |
11 | #define show_softirq_name(val) \ | 11 | #define show_softirq_name(val) \ |
12 | __print_symbolic(val, \ | 12 | __print_symbolic(val, \ |
diff --git a/include/trace/events/jbd2.h b/include/trace/events/jbd2.h new file mode 100644 index 000000000000..10813fa0c8d0 --- /dev/null +++ b/include/trace/events/jbd2.h | |||
@@ -0,0 +1,168 @@ | |||
1 | #undef TRACE_SYSTEM | ||
2 | #define TRACE_SYSTEM jbd2 | ||
3 | |||
4 | #if !defined(_TRACE_JBD2_H) || defined(TRACE_HEADER_MULTI_READ) | ||
5 | #define _TRACE_JBD2_H | ||
6 | |||
7 | #include <linux/jbd2.h> | ||
8 | #include <linux/tracepoint.h> | ||
9 | |||
10 | TRACE_EVENT(jbd2_checkpoint, | ||
11 | |||
12 | TP_PROTO(journal_t *journal, int result), | ||
13 | |||
14 | TP_ARGS(journal, result), | ||
15 | |||
16 | TP_STRUCT__entry( | ||
17 | __field( dev_t, dev ) | ||
18 | __field( int, result ) | ||
19 | ), | ||
20 | |||
21 | TP_fast_assign( | ||
22 | __entry->dev = journal->j_fs_dev->bd_dev; | ||
23 | __entry->result = result; | ||
24 | ), | ||
25 | |||
26 | TP_printk("dev %s result %d", | ||
27 | jbd2_dev_to_name(__entry->dev), __entry->result) | ||
28 | ); | ||
29 | |||
30 | TRACE_EVENT(jbd2_start_commit, | ||
31 | |||
32 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), | ||
33 | |||
34 | TP_ARGS(journal, commit_transaction), | ||
35 | |||
36 | TP_STRUCT__entry( | ||
37 | __field( dev_t, dev ) | ||
38 | __field( char, sync_commit ) | ||
39 | __field( int, transaction ) | ||
40 | ), | ||
41 | |||
42 | TP_fast_assign( | ||
43 | __entry->dev = journal->j_fs_dev->bd_dev; | ||
44 | __entry->sync_commit = commit_transaction->t_synchronous_commit; | ||
45 | __entry->transaction = commit_transaction->t_tid; | ||
46 | ), | ||
47 | |||
48 | TP_printk("dev %s transaction %d sync %d", | ||
49 | jbd2_dev_to_name(__entry->dev), __entry->transaction, | ||
50 | __entry->sync_commit) | ||
51 | ); | ||
52 | |||
53 | TRACE_EVENT(jbd2_commit_locking, | ||
54 | |||
55 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), | ||
56 | |||
57 | TP_ARGS(journal, commit_transaction), | ||
58 | |||
59 | TP_STRUCT__entry( | ||
60 | __field( dev_t, dev ) | ||
61 | __field( char, sync_commit ) | ||
62 | __field( int, transaction ) | ||
63 | ), | ||
64 | |||
65 | TP_fast_assign( | ||
66 | __entry->dev = journal->j_fs_dev->bd_dev; | ||
67 | __entry->sync_commit = commit_transaction->t_synchronous_commit; | ||
68 | __entry->transaction = commit_transaction->t_tid; | ||
69 | ), | ||
70 | |||
71 | TP_printk("dev %s transaction %d sync %d", | ||
72 | jbd2_dev_to_name(__entry->dev), __entry->transaction, | ||
73 | __entry->sync_commit) | ||
74 | ); | ||
75 | |||
76 | TRACE_EVENT(jbd2_commit_flushing, | ||
77 | |||
78 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), | ||
79 | |||
80 | TP_ARGS(journal, commit_transaction), | ||
81 | |||
82 | TP_STRUCT__entry( | ||
83 | __field( dev_t, dev ) | ||
84 | __field( char, sync_commit ) | ||
85 | __field( int, transaction ) | ||
86 | ), | ||
87 | |||
88 | TP_fast_assign( | ||
89 | __entry->dev = journal->j_fs_dev->bd_dev; | ||
90 | __entry->sync_commit = commit_transaction->t_synchronous_commit; | ||
91 | __entry->transaction = commit_transaction->t_tid; | ||
92 | ), | ||
93 | |||
94 | TP_printk("dev %s transaction %d sync %d", | ||
95 | jbd2_dev_to_name(__entry->dev), __entry->transaction, | ||
96 | __entry->sync_commit) | ||
97 | ); | ||
98 | |||
99 | TRACE_EVENT(jbd2_commit_logging, | ||
100 | |||
101 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), | ||
102 | |||
103 | TP_ARGS(journal, commit_transaction), | ||
104 | |||
105 | TP_STRUCT__entry( | ||
106 | __field( dev_t, dev ) | ||
107 | __field( char, sync_commit ) | ||
108 | __field( int, transaction ) | ||
109 | ), | ||
110 | |||
111 | TP_fast_assign( | ||
112 | __entry->dev = journal->j_fs_dev->bd_dev; | ||
113 | __entry->sync_commit = commit_transaction->t_synchronous_commit; | ||
114 | __entry->transaction = commit_transaction->t_tid; | ||
115 | ), | ||
116 | |||
117 | TP_printk("dev %s transaction %d sync %d", | ||
118 | jbd2_dev_to_name(__entry->dev), __entry->transaction, | ||
119 | __entry->sync_commit) | ||
120 | ); | ||
121 | |||
122 | TRACE_EVENT(jbd2_end_commit, | ||
123 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), | ||
124 | |||
125 | TP_ARGS(journal, commit_transaction), | ||
126 | |||
127 | TP_STRUCT__entry( | ||
128 | __field( dev_t, dev ) | ||
129 | __field( char, sync_commit ) | ||
130 | __field( int, transaction ) | ||
131 | __field( int, head ) | ||
132 | ), | ||
133 | |||
134 | TP_fast_assign( | ||
135 | __entry->dev = journal->j_fs_dev->bd_dev; | ||
136 | __entry->sync_commit = commit_transaction->t_synchronous_commit; | ||
137 | __entry->transaction = commit_transaction->t_tid; | ||
138 | __entry->head = journal->j_tail_sequence; | ||
139 | ), | ||
140 | |||
141 | TP_printk("dev %s transaction %d sync %d head %d", | ||
142 | jbd2_dev_to_name(__entry->dev), __entry->transaction, | ||
143 | __entry->sync_commit, __entry->head) | ||
144 | ); | ||
145 | |||
146 | TRACE_EVENT(jbd2_submit_inode_data, | ||
147 | TP_PROTO(struct inode *inode), | ||
148 | |||
149 | TP_ARGS(inode), | ||
150 | |||
151 | TP_STRUCT__entry( | ||
152 | __field( dev_t, dev ) | ||
153 | __field( ino_t, ino ) | ||
154 | ), | ||
155 | |||
156 | TP_fast_assign( | ||
157 | __entry->dev = inode->i_sb->s_dev; | ||
158 | __entry->ino = inode->i_ino; | ||
159 | ), | ||
160 | |||
161 | TP_printk("dev %s ino %lu", | ||
162 | jbd2_dev_to_name(__entry->dev), __entry->ino) | ||
163 | ); | ||
164 | |||
165 | #endif /* _TRACE_JBD2_H */ | ||
166 | |||
167 | /* This part must be outside protection */ | ||
168 | #include <trace/define_trace.h> | ||
diff --git a/include/trace/events/kmem.h b/include/trace/events/kmem.h index 9baba50d6512..1493c541f9c4 100644 --- a/include/trace/events/kmem.h +++ b/include/trace/events/kmem.h | |||
@@ -1,12 +1,12 @@ | |||
1 | #undef TRACE_SYSTEM | ||
2 | #define TRACE_SYSTEM kmem | ||
3 | |||
1 | #if !defined(_TRACE_KMEM_H) || defined(TRACE_HEADER_MULTI_READ) | 4 | #if !defined(_TRACE_KMEM_H) || defined(TRACE_HEADER_MULTI_READ) |
2 | #define _TRACE_KMEM_H | 5 | #define _TRACE_KMEM_H |
3 | 6 | ||
4 | #include <linux/types.h> | 7 | #include <linux/types.h> |
5 | #include <linux/tracepoint.h> | 8 | #include <linux/tracepoint.h> |
6 | 9 | ||
7 | #undef TRACE_SYSTEM | ||
8 | #define TRACE_SYSTEM kmem | ||
9 | |||
10 | /* | 10 | /* |
11 | * The order of these masks is important. Matching masks will be seen | 11 | * The order of these masks is important. Matching masks will be seen |
12 | * first and the left over flags will end up showing by themselves. | 12 | * first and the left over flags will end up showing by themselves. |
diff --git a/include/trace/events/lockdep.h b/include/trace/events/lockdep.h index 0e956c9dfd7e..bcf1d209a00d 100644 --- a/include/trace/events/lockdep.h +++ b/include/trace/events/lockdep.h | |||
@@ -1,12 +1,12 @@ | |||
1 | #undef TRACE_SYSTEM | ||
2 | #define TRACE_SYSTEM lockdep | ||
3 | |||
1 | #if !defined(_TRACE_LOCKDEP_H) || defined(TRACE_HEADER_MULTI_READ) | 4 | #if !defined(_TRACE_LOCKDEP_H) || defined(TRACE_HEADER_MULTI_READ) |
2 | #define _TRACE_LOCKDEP_H | 5 | #define _TRACE_LOCKDEP_H |
3 | 6 | ||
4 | #include <linux/lockdep.h> | 7 | #include <linux/lockdep.h> |
5 | #include <linux/tracepoint.h> | 8 | #include <linux/tracepoint.h> |
6 | 9 | ||
7 | #undef TRACE_SYSTEM | ||
8 | #define TRACE_SYSTEM lockdep | ||
9 | |||
10 | #ifdef CONFIG_LOCKDEP | 10 | #ifdef CONFIG_LOCKDEP |
11 | 11 | ||
12 | TRACE_EVENT(lock_acquire, | 12 | TRACE_EVENT(lock_acquire, |
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h index 24ab5bcff7b2..8949bb7eb082 100644 --- a/include/trace/events/sched.h +++ b/include/trace/events/sched.h | |||
@@ -1,12 +1,12 @@ | |||
1 | #undef TRACE_SYSTEM | ||
2 | #define TRACE_SYSTEM sched | ||
3 | |||
1 | #if !defined(_TRACE_SCHED_H) || defined(TRACE_HEADER_MULTI_READ) | 4 | #if !defined(_TRACE_SCHED_H) || defined(TRACE_HEADER_MULTI_READ) |
2 | #define _TRACE_SCHED_H | 5 | #define _TRACE_SCHED_H |
3 | 6 | ||
4 | #include <linux/sched.h> | 7 | #include <linux/sched.h> |
5 | #include <linux/tracepoint.h> | 8 | #include <linux/tracepoint.h> |
6 | 9 | ||
7 | #undef TRACE_SYSTEM | ||
8 | #define TRACE_SYSTEM sched | ||
9 | |||
10 | /* | 10 | /* |
11 | * Tracepoint for calling kthread_stop, performed to end a kthread: | 11 | * Tracepoint for calling kthread_stop, performed to end a kthread: |
12 | */ | 12 | */ |
diff --git a/include/trace/events/skb.h b/include/trace/events/skb.h index 1e8fabb57c06..e499863b9669 100644 --- a/include/trace/events/skb.h +++ b/include/trace/events/skb.h | |||
@@ -1,12 +1,12 @@ | |||
1 | #undef TRACE_SYSTEM | ||
2 | #define TRACE_SYSTEM skb | ||
3 | |||
1 | #if !defined(_TRACE_SKB_H) || defined(TRACE_HEADER_MULTI_READ) | 4 | #if !defined(_TRACE_SKB_H) || defined(TRACE_HEADER_MULTI_READ) |
2 | #define _TRACE_SKB_H | 5 | #define _TRACE_SKB_H |
3 | 6 | ||
4 | #include <linux/skbuff.h> | 7 | #include <linux/skbuff.h> |
5 | #include <linux/tracepoint.h> | 8 | #include <linux/tracepoint.h> |
6 | 9 | ||
7 | #undef TRACE_SYSTEM | ||
8 | #define TRACE_SYSTEM skb | ||
9 | |||
10 | /* | 10 | /* |
11 | * Tracepoint for free an sk_buff: | 11 | * Tracepoint for free an sk_buff: |
12 | */ | 12 | */ |
diff --git a/include/trace/events/workqueue.h b/include/trace/events/workqueue.h index 035f1bff288e..fcfd9a1e4b96 100644 --- a/include/trace/events/workqueue.h +++ b/include/trace/events/workqueue.h | |||
@@ -1,3 +1,6 @@ | |||
1 | #undef TRACE_SYSTEM | ||
2 | #define TRACE_SYSTEM workqueue | ||
3 | |||
1 | #if !defined(_TRACE_WORKQUEUE_H) || defined(TRACE_HEADER_MULTI_READ) | 4 | #if !defined(_TRACE_WORKQUEUE_H) || defined(TRACE_HEADER_MULTI_READ) |
2 | #define _TRACE_WORKQUEUE_H | 5 | #define _TRACE_WORKQUEUE_H |
3 | 6 | ||
@@ -5,9 +8,6 @@ | |||
5 | #include <linux/sched.h> | 8 | #include <linux/sched.h> |
6 | #include <linux/tracepoint.h> | 9 | #include <linux/tracepoint.h> |
7 | 10 | ||
8 | #undef TRACE_SYSTEM | ||
9 | #define TRACE_SYSTEM workqueue | ||
10 | |||
11 | TRACE_EVENT(workqueue_insertion, | 11 | TRACE_EVENT(workqueue_insertion, |
12 | 12 | ||
13 | TP_PROTO(struct task_struct *wq_thread, struct work_struct *work), | 13 | TP_PROTO(struct task_struct *wq_thread, struct work_struct *work), |
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index 1867553c61e5..f64fbaae781a 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
@@ -144,6 +144,9 @@ | |||
144 | #undef TP_fast_assign | 144 | #undef TP_fast_assign |
145 | #define TP_fast_assign(args...) args | 145 | #define TP_fast_assign(args...) args |
146 | 146 | ||
147 | #undef TP_perf_assign | ||
148 | #define TP_perf_assign(args...) | ||
149 | |||
147 | #undef TRACE_EVENT | 150 | #undef TRACE_EVENT |
148 | #define TRACE_EVENT(call, proto, args, tstruct, func, print) \ | 151 | #define TRACE_EVENT(call, proto, args, tstruct, func, print) \ |
149 | static int \ | 152 | static int \ |
@@ -345,6 +348,56 @@ static inline int ftrace_get_offsets_##call( \ | |||
345 | 348 | ||
346 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 349 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
347 | 350 | ||
351 | #ifdef CONFIG_EVENT_PROFILE | ||
352 | |||
353 | /* | ||
354 | * Generate the functions needed for tracepoint perf_counter support. | ||
355 | * | ||
356 | * NOTE: The insertion profile callback (ftrace_profile_<call>) is defined later | ||
357 | * | ||
358 | * static int ftrace_profile_enable_<call>(struct ftrace_event_call *event_call) | ||
359 | * { | ||
360 | * int ret = 0; | ||
361 | * | ||
362 | * if (!atomic_inc_return(&event_call->profile_count)) | ||
363 | * ret = register_trace_<call>(ftrace_profile_<call>); | ||
364 | * | ||
365 | * return ret; | ||
366 | * } | ||
367 | * | ||
368 | * static void ftrace_profile_disable_<call>(struct ftrace_event_call *event_call) | ||
369 | * { | ||
370 | * if (atomic_add_negative(-1, &event->call->profile_count)) | ||
371 | * unregister_trace_<call>(ftrace_profile_<call>); | ||
372 | * } | ||
373 | * | ||
374 | */ | ||
375 | |||
376 | #undef TRACE_EVENT | ||
377 | #define TRACE_EVENT(call, proto, args, tstruct, assign, print) \ | ||
378 | \ | ||
379 | static void ftrace_profile_##call(proto); \ | ||
380 | \ | ||
381 | static int ftrace_profile_enable_##call(struct ftrace_event_call *event_call) \ | ||
382 | { \ | ||
383 | int ret = 0; \ | ||
384 | \ | ||
385 | if (!atomic_inc_return(&event_call->profile_count)) \ | ||
386 | ret = register_trace_##call(ftrace_profile_##call); \ | ||
387 | \ | ||
388 | return ret; \ | ||
389 | } \ | ||
390 | \ | ||
391 | static void ftrace_profile_disable_##call(struct ftrace_event_call *event_call)\ | ||
392 | { \ | ||
393 | if (atomic_add_negative(-1, &event_call->profile_count)) \ | ||
394 | unregister_trace_##call(ftrace_profile_##call); \ | ||
395 | } | ||
396 | |||
397 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | ||
398 | |||
399 | #endif | ||
400 | |||
348 | /* | 401 | /* |
349 | * Stage 4 of the trace events. | 402 | * Stage 4 of the trace events. |
350 | * | 403 | * |
@@ -447,28 +500,6 @@ static inline int ftrace_get_offsets_##call( \ | |||
447 | #define TP_FMT(fmt, args...) fmt "\n", ##args | 500 | #define TP_FMT(fmt, args...) fmt "\n", ##args |
448 | 501 | ||
449 | #ifdef CONFIG_EVENT_PROFILE | 502 | #ifdef CONFIG_EVENT_PROFILE |
450 | #define _TRACE_PROFILE(call, proto, args) \ | ||
451 | static void ftrace_profile_##call(proto) \ | ||
452 | { \ | ||
453 | extern void perf_tpcounter_event(int); \ | ||
454 | perf_tpcounter_event(event_##call.id); \ | ||
455 | } \ | ||
456 | \ | ||
457 | static int ftrace_profile_enable_##call(struct ftrace_event_call *event_call) \ | ||
458 | { \ | ||
459 | int ret = 0; \ | ||
460 | \ | ||
461 | if (!atomic_inc_return(&event_call->profile_count)) \ | ||
462 | ret = register_trace_##call(ftrace_profile_##call); \ | ||
463 | \ | ||
464 | return ret; \ | ||
465 | } \ | ||
466 | \ | ||
467 | static void ftrace_profile_disable_##call(struct ftrace_event_call *event_call)\ | ||
468 | { \ | ||
469 | if (atomic_add_negative(-1, &event_call->profile_count)) \ | ||
470 | unregister_trace_##call(ftrace_profile_##call); \ | ||
471 | } | ||
472 | 503 | ||
473 | #define _TRACE_PROFILE_INIT(call) \ | 504 | #define _TRACE_PROFILE_INIT(call) \ |
474 | .profile_count = ATOMIC_INIT(-1), \ | 505 | .profile_count = ATOMIC_INIT(-1), \ |
@@ -476,7 +507,6 @@ static void ftrace_profile_disable_##call(struct ftrace_event_call *event_call)\ | |||
476 | .profile_disable = ftrace_profile_disable_##call, | 507 | .profile_disable = ftrace_profile_disable_##call, |
477 | 508 | ||
478 | #else | 509 | #else |
479 | #define _TRACE_PROFILE(call, proto, args) | ||
480 | #define _TRACE_PROFILE_INIT(call) | 510 | #define _TRACE_PROFILE_INIT(call) |
481 | #endif | 511 | #endif |
482 | 512 | ||
@@ -502,7 +532,6 @@ static void ftrace_profile_disable_##call(struct ftrace_event_call *event_call)\ | |||
502 | 532 | ||
503 | #undef TRACE_EVENT | 533 | #undef TRACE_EVENT |
504 | #define TRACE_EVENT(call, proto, args, tstruct, assign, print) \ | 534 | #define TRACE_EVENT(call, proto, args, tstruct, assign, print) \ |
505 | _TRACE_PROFILE(call, PARAMS(proto), PARAMS(args)) \ | ||
506 | \ | 535 | \ |
507 | static struct ftrace_event_call event_##call; \ | 536 | static struct ftrace_event_call event_##call; \ |
508 | \ | 537 | \ |
@@ -586,6 +615,110 @@ __attribute__((section("_ftrace_events"))) event_##call = { \ | |||
586 | 615 | ||
587 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 616 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
588 | 617 | ||
589 | #undef _TRACE_PROFILE | 618 | /* |
619 | * Define the insertion callback to profile events | ||
620 | * | ||
621 | * The job is very similar to ftrace_raw_event_<call> except that we don't | ||
622 | * insert in the ring buffer but in a perf counter. | ||
623 | * | ||
624 | * static void ftrace_profile_<call>(proto) | ||
625 | * { | ||
626 | * struct ftrace_data_offsets_<call> __maybe_unused __data_offsets; | ||
627 | * struct ftrace_event_call *event_call = &event_<call>; | ||
628 | * extern void perf_tpcounter_event(int, u64, u64, void *, int); | ||
629 | * struct ftrace_raw_##call *entry; | ||
630 | * u64 __addr = 0, __count = 1; | ||
631 | * unsigned long irq_flags; | ||
632 | * int __entry_size; | ||
633 | * int __data_size; | ||
634 | * int pc; | ||
635 | * | ||
636 | * local_save_flags(irq_flags); | ||
637 | * pc = preempt_count(); | ||
638 | * | ||
639 | * __data_size = ftrace_get_offsets_<call>(&__data_offsets, args); | ||
640 | * | ||
641 | * // Below we want to get the aligned size by taking into account | ||
642 | * // the u32 field that will later store the buffer size | ||
643 | * __entry_size = ALIGN(__data_size + sizeof(*entry) + sizeof(u32), | ||
644 | * sizeof(u64)); | ||
645 | * __entry_size -= sizeof(u32); | ||
646 | * | ||
647 | * do { | ||
648 | * char raw_data[__entry_size]; <- allocate our sample in the stack | ||
649 | * struct trace_entry *ent; | ||
650 | * | ||
651 | * zero dead bytes from alignment to avoid stack leak to userspace: | ||
652 | * | ||
653 | * *(u64 *)(&raw_data[__entry_size - sizeof(u64)]) = 0ULL; | ||
654 | * entry = (struct ftrace_raw_<call> *)raw_data; | ||
655 | * ent = &entry->ent; | ||
656 | * tracing_generic_entry_update(ent, irq_flags, pc); | ||
657 | * ent->type = event_call->id; | ||
658 | * | ||
659 | * <tstruct> <- do some jobs with dynamic arrays | ||
660 | * | ||
661 | * <assign> <- affect our values | ||
662 | * | ||
663 | * perf_tpcounter_event(event_call->id, __addr, __count, entry, | ||
664 | * __entry_size); <- submit them to perf counter | ||
665 | * } while (0); | ||
666 | * | ||
667 | * } | ||
668 | */ | ||
669 | |||
670 | #ifdef CONFIG_EVENT_PROFILE | ||
671 | |||
672 | #undef __perf_addr | ||
673 | #define __perf_addr(a) __addr = (a) | ||
674 | |||
675 | #undef __perf_count | ||
676 | #define __perf_count(c) __count = (c) | ||
677 | |||
678 | #undef TRACE_EVENT | ||
679 | #define TRACE_EVENT(call, proto, args, tstruct, assign, print) \ | ||
680 | static void ftrace_profile_##call(proto) \ | ||
681 | { \ | ||
682 | struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ | ||
683 | struct ftrace_event_call *event_call = &event_##call; \ | ||
684 | extern void perf_tpcounter_event(int, u64, u64, void *, int); \ | ||
685 | struct ftrace_raw_##call *entry; \ | ||
686 | u64 __addr = 0, __count = 1; \ | ||
687 | unsigned long irq_flags; \ | ||
688 | int __entry_size; \ | ||
689 | int __data_size; \ | ||
690 | int pc; \ | ||
691 | \ | ||
692 | local_save_flags(irq_flags); \ | ||
693 | pc = preempt_count(); \ | ||
694 | \ | ||
695 | __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \ | ||
696 | __entry_size = ALIGN(__data_size + sizeof(*entry) + sizeof(u32),\ | ||
697 | sizeof(u64)); \ | ||
698 | __entry_size -= sizeof(u32); \ | ||
699 | \ | ||
700 | do { \ | ||
701 | char raw_data[__entry_size]; \ | ||
702 | struct trace_entry *ent; \ | ||
703 | \ | ||
704 | *(u64 *)(&raw_data[__entry_size - sizeof(u64)]) = 0ULL; \ | ||
705 | entry = (struct ftrace_raw_##call *)raw_data; \ | ||
706 | ent = &entry->ent; \ | ||
707 | tracing_generic_entry_update(ent, irq_flags, pc); \ | ||
708 | ent->type = event_call->id; \ | ||
709 | \ | ||
710 | tstruct \ | ||
711 | \ | ||
712 | { assign; } \ | ||
713 | \ | ||
714 | perf_tpcounter_event(event_call->id, __addr, __count, entry,\ | ||
715 | __entry_size); \ | ||
716 | } while (0); \ | ||
717 | \ | ||
718 | } | ||
719 | |||
720 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | ||
721 | #endif /* CONFIG_EVENT_PROFILE */ | ||
722 | |||
590 | #undef _TRACE_PROFILE_INIT | 723 | #undef _TRACE_PROFILE_INIT |
591 | 724 | ||