diff options
Diffstat (limited to 'include')
160 files changed, 2367 insertions, 3808 deletions
diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h index 5c823d5ab783..d814da4b5365 100644 --- a/include/acpi/acoutput.h +++ b/include/acpi/acoutput.h | |||
@@ -85,7 +85,8 @@ | |||
85 | #define ACPI_LV_INIT 0x00000001 | 85 | #define ACPI_LV_INIT 0x00000001 |
86 | #define ACPI_LV_DEBUG_OBJECT 0x00000002 | 86 | #define ACPI_LV_DEBUG_OBJECT 0x00000002 |
87 | #define ACPI_LV_INFO 0x00000004 | 87 | #define ACPI_LV_INFO 0x00000004 |
88 | #define ACPI_LV_ALL_EXCEPTIONS 0x00000007 | 88 | #define ACPI_LV_REPAIR 0x00000008 |
89 | #define ACPI_LV_ALL_EXCEPTIONS 0x0000000F | ||
89 | 90 | ||
90 | /* Trace verbosity level 1 [Standard Trace Level] */ | 91 | /* Trace verbosity level 1 [Standard Trace Level] */ |
91 | 92 | ||
@@ -143,6 +144,7 @@ | |||
143 | #define ACPI_DB_INIT ACPI_DEBUG_LEVEL (ACPI_LV_INIT) | 144 | #define ACPI_DB_INIT ACPI_DEBUG_LEVEL (ACPI_LV_INIT) |
144 | #define ACPI_DB_DEBUG_OBJECT ACPI_DEBUG_LEVEL (ACPI_LV_DEBUG_OBJECT) | 145 | #define ACPI_DB_DEBUG_OBJECT ACPI_DEBUG_LEVEL (ACPI_LV_DEBUG_OBJECT) |
145 | #define ACPI_DB_INFO ACPI_DEBUG_LEVEL (ACPI_LV_INFO) | 146 | #define ACPI_DB_INFO ACPI_DEBUG_LEVEL (ACPI_LV_INFO) |
147 | #define ACPI_DB_REPAIR ACPI_DEBUG_LEVEL (ACPI_LV_REPAIR) | ||
146 | #define ACPI_DB_ALL_EXCEPTIONS ACPI_DEBUG_LEVEL (ACPI_LV_ALL_EXCEPTIONS) | 148 | #define ACPI_DB_ALL_EXCEPTIONS ACPI_DEBUG_LEVEL (ACPI_LV_ALL_EXCEPTIONS) |
147 | 149 | ||
148 | /* Trace level -- also used in the global "DebugLevel" */ | 150 | /* Trace level -- also used in the global "DebugLevel" */ |
@@ -174,8 +176,8 @@ | |||
174 | 176 | ||
175 | /* Defaults for debug_level, debug and normal */ | 177 | /* Defaults for debug_level, debug and normal */ |
176 | 178 | ||
177 | #define ACPI_DEBUG_DEFAULT (ACPI_LV_INFO) | 179 | #define ACPI_DEBUG_DEFAULT (ACPI_LV_INFO | ACPI_LV_REPAIR) |
178 | #define ACPI_NORMAL_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT) | 180 | #define ACPI_NORMAL_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT | ACPI_LV_REPAIR) |
179 | #define ACPI_DEBUG_ALL (ACPI_LV_AML_DISASSEMBLE | ACPI_LV_ALL_EXCEPTIONS | ACPI_LV_ALL) | 181 | #define ACPI_DEBUG_ALL (ACPI_LV_AML_DISASSEMBLE | ACPI_LV_ALL_EXCEPTIONS | ACPI_LV_ALL) |
180 | 182 | ||
181 | #if defined (ACPI_DEBUG_OUTPUT) || !defined (ACPI_NO_ERROR_MESSAGES) | 183 | #if defined (ACPI_DEBUG_OUTPUT) || !defined (ACPI_NO_ERROR_MESSAGES) |
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index 5e1ad3cd1bbd..86e9735a96bd 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h | |||
@@ -47,7 +47,7 @@ | |||
47 | 47 | ||
48 | /* Current ACPICA subsystem version in YYYYMMDD format */ | 48 | /* Current ACPICA subsystem version in YYYYMMDD format */ |
49 | 49 | ||
50 | #define ACPI_CA_VERSION 0x20091112 | 50 | #define ACPI_CA_VERSION 0x20091214 |
51 | 51 | ||
52 | #include "actypes.h" | 52 | #include "actypes.h" |
53 | #include "actbl.h" | 53 | #include "actbl.h" |
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index 9d7febde10a1..09469971472f 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h | |||
@@ -152,7 +152,7 @@ static inline void *acpi_os_acquire_object(acpi_cache_t * cache) | |||
152 | #include <linux/hardirq.h> | 152 | #include <linux/hardirq.h> |
153 | #define ACPI_PREEMPTION_POINT() \ | 153 | #define ACPI_PREEMPTION_POINT() \ |
154 | do { \ | 154 | do { \ |
155 | if (!in_atomic_preempt_off()) \ | 155 | if (!in_atomic_preempt_off() && !irqs_disabled()) \ |
156 | cond_resched(); \ | 156 | cond_resched(); \ |
157 | } while (0) | 157 | } while (0) |
158 | 158 | ||
diff --git a/include/acpi/processor.h b/include/acpi/processor.h index 8b668ead6d6e..0ea5ef4eb6a9 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h | |||
@@ -224,8 +224,6 @@ struct acpi_processor { | |||
224 | struct acpi_processor_throttling throttling; | 224 | struct acpi_processor_throttling throttling; |
225 | struct acpi_processor_limit limit; | 225 | struct acpi_processor_limit limit; |
226 | struct thermal_cooling_device *cdev; | 226 | struct thermal_cooling_device *cdev; |
227 | /* the _PDC objects for this processor, if any */ | ||
228 | struct acpi_object_list *pdc; | ||
229 | }; | 227 | }; |
230 | 228 | ||
231 | struct acpi_processor_errata { | 229 | struct acpi_processor_errata { |
@@ -257,9 +255,6 @@ int acpi_processor_notify_smm(struct module *calling_module); | |||
257 | DECLARE_PER_CPU(struct acpi_processor *, processors); | 255 | DECLARE_PER_CPU(struct acpi_processor *, processors); |
258 | extern struct acpi_processor_errata errata; | 256 | extern struct acpi_processor_errata errata; |
259 | 257 | ||
260 | void arch_acpi_processor_init_pdc(struct acpi_processor *pr); | ||
261 | void arch_acpi_processor_cleanup_pdc(struct acpi_processor *pr); | ||
262 | |||
263 | #ifdef ARCH_HAS_POWER_INIT | 258 | #ifdef ARCH_HAS_POWER_INIT |
264 | void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags, | 259 | void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags, |
265 | unsigned int cpu); | 260 | unsigned int cpu); |
@@ -294,7 +289,7 @@ static inline void acpi_processor_ffh_cstate_enter(struct acpi_processor_cx | |||
294 | #ifdef CONFIG_CPU_FREQ | 289 | #ifdef CONFIG_CPU_FREQ |
295 | void acpi_processor_ppc_init(void); | 290 | void acpi_processor_ppc_init(void); |
296 | void acpi_processor_ppc_exit(void); | 291 | void acpi_processor_ppc_exit(void); |
297 | int acpi_processor_ppc_has_changed(struct acpi_processor *pr); | 292 | int acpi_processor_ppc_has_changed(struct acpi_processor *pr, int event_flag); |
298 | extern int acpi_processor_get_bios_limit(int cpu, unsigned int *limit); | 293 | extern int acpi_processor_get_bios_limit(int cpu, unsigned int *limit); |
299 | #else | 294 | #else |
300 | static inline void acpi_processor_ppc_init(void) | 295 | static inline void acpi_processor_ppc_init(void) |
@@ -305,7 +300,8 @@ static inline void acpi_processor_ppc_exit(void) | |||
305 | { | 300 | { |
306 | return; | 301 | return; |
307 | } | 302 | } |
308 | static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr) | 303 | static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr, |
304 | int event_flag) | ||
309 | { | 305 | { |
310 | static unsigned int printout = 1; | 306 | static unsigned int printout = 1; |
311 | if (printout) { | 307 | if (printout) { |
@@ -324,6 +320,9 @@ static inline int acpi_processor_get_bios_limit(int cpu, unsigned int *limit) | |||
324 | 320 | ||
325 | #endif /* CONFIG_CPU_FREQ */ | 321 | #endif /* CONFIG_CPU_FREQ */ |
326 | 322 | ||
323 | /* in processor_pdc.c */ | ||
324 | void acpi_processor_set_pdc(acpi_handle handle); | ||
325 | |||
327 | /* in processor_throttling.c */ | 326 | /* in processor_throttling.c */ |
328 | int acpi_processor_tstate_has_changed(struct acpi_processor *pr); | 327 | int acpi_processor_tstate_has_changed(struct acpi_processor *pr); |
329 | int acpi_processor_get_throttling_info(struct acpi_processor *pr); | 328 | int acpi_processor_get_throttling_info(struct acpi_processor *pr); |
diff --git a/include/asm-generic/fcntl.h b/include/asm-generic/fcntl.h index 681ddf3e844c..fcd268ce0674 100644 --- a/include/asm-generic/fcntl.h +++ b/include/asm-generic/fcntl.h | |||
@@ -51,7 +51,7 @@ | |||
51 | #endif | 51 | #endif |
52 | 52 | ||
53 | /* | 53 | /* |
54 | * Before Linux 2.6.32 only O_DSYNC semantics were implemented, but using | 54 | * Before Linux 2.6.33 only O_DSYNC semantics were implemented, but using |
55 | * the O_SYNC flag. We continue to use the existing numerical value | 55 | * the O_SYNC flag. We continue to use the existing numerical value |
56 | * for O_DSYNC semantics now, but using the correct symbolic name for it. | 56 | * for O_DSYNC semantics now, but using the correct symbolic name for it. |
57 | * This new value is used to request true Posix O_SYNC semantics. It is | 57 | * This new value is used to request true Posix O_SYNC semantics. It is |
diff --git a/include/asm-generic/mman-common.h b/include/asm-generic/mman-common.h index 20111265afd8..3da9e2742fa0 100644 --- a/include/asm-generic/mman-common.h +++ b/include/asm-generic/mman-common.h | |||
@@ -40,6 +40,7 @@ | |||
40 | #define MADV_DONTFORK 10 /* don't inherit across fork */ | 40 | #define MADV_DONTFORK 10 /* don't inherit across fork */ |
41 | #define MADV_DOFORK 11 /* do inherit across fork */ | 41 | #define MADV_DOFORK 11 /* do inherit across fork */ |
42 | #define MADV_HWPOISON 100 /* poison a page for testing */ | 42 | #define MADV_HWPOISON 100 /* poison a page for testing */ |
43 | #define MADV_SOFT_OFFLINE 101 /* soft offline page for testing */ | ||
43 | 44 | ||
44 | #define MADV_MERGEABLE 12 /* KSM may merge identical pages */ | 45 | #define MADV_MERGEABLE 12 /* KSM may merge identical pages */ |
45 | #define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages */ | 46 | #define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages */ |
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index b6e818f4b247..67e652068e0e 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
@@ -52,8 +52,12 @@ | |||
52 | #define LOAD_OFFSET 0 | 52 | #define LOAD_OFFSET 0 |
53 | #endif | 53 | #endif |
54 | 54 | ||
55 | #ifndef VMLINUX_SYMBOL | 55 | #ifndef SYMBOL_PREFIX |
56 | #define VMLINUX_SYMBOL(_sym_) _sym_ | 56 | #define VMLINUX_SYMBOL(sym) sym |
57 | #else | ||
58 | #define PASTE2(x,y) x##y | ||
59 | #define PASTE(x,y) PASTE2(x,y) | ||
60 | #define VMLINUX_SYMBOL(sym) PASTE(SYMBOL_PREFIX, sym) | ||
57 | #endif | 61 | #endif |
58 | 62 | ||
59 | /* Align . to a 8 byte boundary equals to maximum function alignment. */ | 63 | /* Align . to a 8 byte boundary equals to maximum function alignment. */ |
diff --git a/include/drm/Kbuild b/include/drm/Kbuild index cfa6af43c9ea..bd3a1c2fbdb4 100644 --- a/include/drm/Kbuild +++ b/include/drm/Kbuild | |||
@@ -7,5 +7,6 @@ unifdef-y += r128_drm.h | |||
7 | unifdef-y += radeon_drm.h | 7 | unifdef-y += radeon_drm.h |
8 | unifdef-y += sis_drm.h | 8 | unifdef-y += sis_drm.h |
9 | unifdef-y += savage_drm.h | 9 | unifdef-y += savage_drm.h |
10 | unifdef-y += vmwgfx_drm.h | ||
10 | unifdef-y += via_drm.h | 11 | unifdef-y += via_drm.h |
11 | unifdef-y += nouveau_drm.h | 12 | unifdef-y += nouveau_drm.h |
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 19ef8ebdc662..ffac157fb5b2 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
@@ -296,6 +296,7 @@ typedef int drm_ioctl_compat_t(struct file *filp, unsigned int cmd, | |||
296 | #define DRM_MASTER 0x2 | 296 | #define DRM_MASTER 0x2 |
297 | #define DRM_ROOT_ONLY 0x4 | 297 | #define DRM_ROOT_ONLY 0x4 |
298 | #define DRM_CONTROL_ALLOW 0x8 | 298 | #define DRM_CONTROL_ALLOW 0x8 |
299 | #define DRM_UNLOCKED 0x10 | ||
299 | 300 | ||
300 | struct drm_ioctl_desc { | 301 | struct drm_ioctl_desc { |
301 | unsigned int cmd; | 302 | unsigned int cmd; |
@@ -1128,8 +1129,8 @@ static inline int drm_mtrr_del(int handle, unsigned long offset, | |||
1128 | /* Driver support (drm_drv.h) */ | 1129 | /* Driver support (drm_drv.h) */ |
1129 | extern int drm_init(struct drm_driver *driver); | 1130 | extern int drm_init(struct drm_driver *driver); |
1130 | extern void drm_exit(struct drm_driver *driver); | 1131 | extern void drm_exit(struct drm_driver *driver); |
1131 | extern int drm_ioctl(struct inode *inode, struct file *filp, | 1132 | extern long drm_ioctl(struct file *filp, |
1132 | unsigned int cmd, unsigned long arg); | 1133 | unsigned int cmd, unsigned long arg); |
1133 | extern long drm_compat_ioctl(struct file *filp, | 1134 | extern long drm_compat_ioctl(struct file *filp, |
1134 | unsigned int cmd, unsigned long arg); | 1135 | unsigned int cmd, unsigned long arg); |
1135 | extern int drm_lastclose(struct drm_device *dev); | 1136 | extern int drm_lastclose(struct drm_device *dev); |
@@ -1407,7 +1408,7 @@ extern int drm_ati_pcigart_cleanup(struct drm_device *dev, | |||
1407 | struct drm_ati_pcigart_info * gart_info); | 1408 | struct drm_ati_pcigart_info * gart_info); |
1408 | 1409 | ||
1409 | extern drm_dma_handle_t *drm_pci_alloc(struct drm_device *dev, size_t size, | 1410 | extern drm_dma_handle_t *drm_pci_alloc(struct drm_device *dev, size_t size, |
1410 | size_t align, dma_addr_t maxaddr); | 1411 | size_t align); |
1411 | extern void __drm_pci_free(struct drm_device *dev, drm_dma_handle_t * dmah); | 1412 | extern void __drm_pci_free(struct drm_device *dev, drm_dma_handle_t * dmah); |
1412 | extern void drm_pci_free(struct drm_device *dev, drm_dma_handle_t * dmah); | 1413 | extern void drm_pci_free(struct drm_device *dev, drm_dma_handle_t * dmah); |
1413 | 1414 | ||
diff --git a/include/drm/drm_mode.h b/include/drm/drm_mode.h index 43009bc2e757..c5ba1636613c 100644 --- a/include/drm/drm_mode.h +++ b/include/drm/drm_mode.h | |||
@@ -85,7 +85,7 @@ struct drm_mode_modeinfo { | |||
85 | __u16 hdisplay, hsync_start, hsync_end, htotal, hskew; | 85 | __u16 hdisplay, hsync_start, hsync_end, htotal, hskew; |
86 | __u16 vdisplay, vsync_start, vsync_end, vtotal, vscan; | 86 | __u16 vdisplay, vsync_start, vsync_end, vtotal, vscan; |
87 | 87 | ||
88 | __u32 vrefresh; /* vertical refresh * 1000 */ | 88 | __u32 vrefresh; |
89 | 89 | ||
90 | __u32 flags; | 90 | __u32 flags; |
91 | __u32 type; | 91 | __u32 type; |
@@ -160,6 +160,7 @@ struct drm_mode_get_encoder { | |||
160 | #define DRM_MODE_CONNECTOR_HDMIA 11 | 160 | #define DRM_MODE_CONNECTOR_HDMIA 11 |
161 | #define DRM_MODE_CONNECTOR_HDMIB 12 | 161 | #define DRM_MODE_CONNECTOR_HDMIB 12 |
162 | #define DRM_MODE_CONNECTOR_TV 13 | 162 | #define DRM_MODE_CONNECTOR_TV 13 |
163 | #define DRM_MODE_CONNECTOR_eDP 14 | ||
163 | 164 | ||
164 | struct drm_mode_get_connector { | 165 | struct drm_mode_get_connector { |
165 | 166 | ||
diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h index ec3f5e80a5df..b64a8d7cdf6d 100644 --- a/include/drm/i915_drm.h +++ b/include/drm/i915_drm.h | |||
@@ -188,6 +188,7 @@ typedef struct _drm_i915_sarea { | |||
188 | #define DRM_I915_GEM_MADVISE 0x26 | 188 | #define DRM_I915_GEM_MADVISE 0x26 |
189 | #define DRM_I915_OVERLAY_PUT_IMAGE 0x27 | 189 | #define DRM_I915_OVERLAY_PUT_IMAGE 0x27 |
190 | #define DRM_I915_OVERLAY_ATTRS 0x28 | 190 | #define DRM_I915_OVERLAY_ATTRS 0x28 |
191 | #define DRM_I915_GEM_EXECBUFFER2 0x29 | ||
191 | 192 | ||
192 | #define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t) | 193 | #define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t) |
193 | #define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH) | 194 | #define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH) |
@@ -207,6 +208,7 @@ typedef struct _drm_i915_sarea { | |||
207 | #define DRM_IOCTL_I915_VBLANK_SWAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_VBLANK_SWAP, drm_i915_vblank_swap_t) | 208 | #define DRM_IOCTL_I915_VBLANK_SWAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_VBLANK_SWAP, drm_i915_vblank_swap_t) |
208 | #define DRM_IOCTL_I915_GEM_INIT DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_INIT, struct drm_i915_gem_init) | 209 | #define DRM_IOCTL_I915_GEM_INIT DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_INIT, struct drm_i915_gem_init) |
209 | #define DRM_IOCTL_I915_GEM_EXECBUFFER DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER, struct drm_i915_gem_execbuffer) | 210 | #define DRM_IOCTL_I915_GEM_EXECBUFFER DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER, struct drm_i915_gem_execbuffer) |
211 | #define DRM_IOCTL_I915_GEM_EXECBUFFER2 DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_EXECBUFFER2, struct drm_i915_gem_execbuffer2) | ||
210 | #define DRM_IOCTL_I915_GEM_PIN DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_PIN, struct drm_i915_gem_pin) | 212 | #define DRM_IOCTL_I915_GEM_PIN DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_PIN, struct drm_i915_gem_pin) |
211 | #define DRM_IOCTL_I915_GEM_UNPIN DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_UNPIN, struct drm_i915_gem_unpin) | 213 | #define DRM_IOCTL_I915_GEM_UNPIN DRM_IOW(DRM_COMMAND_BASE + DRM_I915_GEM_UNPIN, struct drm_i915_gem_unpin) |
212 | #define DRM_IOCTL_I915_GEM_BUSY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_BUSY, struct drm_i915_gem_busy) | 214 | #define DRM_IOCTL_I915_GEM_BUSY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_BUSY, struct drm_i915_gem_busy) |
@@ -272,6 +274,7 @@ typedef struct drm_i915_irq_wait { | |||
272 | #define I915_PARAM_NUM_FENCES_AVAIL 6 | 274 | #define I915_PARAM_NUM_FENCES_AVAIL 6 |
273 | #define I915_PARAM_HAS_OVERLAY 7 | 275 | #define I915_PARAM_HAS_OVERLAY 7 |
274 | #define I915_PARAM_HAS_PAGEFLIPPING 8 | 276 | #define I915_PARAM_HAS_PAGEFLIPPING 8 |
277 | #define I915_PARAM_HAS_EXECBUF2 9 | ||
275 | 278 | ||
276 | typedef struct drm_i915_getparam { | 279 | typedef struct drm_i915_getparam { |
277 | int param; | 280 | int param; |
@@ -567,6 +570,57 @@ struct drm_i915_gem_execbuffer { | |||
567 | __u64 cliprects_ptr; | 570 | __u64 cliprects_ptr; |
568 | }; | 571 | }; |
569 | 572 | ||
573 | struct drm_i915_gem_exec_object2 { | ||
574 | /** | ||
575 | * User's handle for a buffer to be bound into the GTT for this | ||
576 | * operation. | ||
577 | */ | ||
578 | __u32 handle; | ||
579 | |||
580 | /** Number of relocations to be performed on this buffer */ | ||
581 | __u32 relocation_count; | ||
582 | /** | ||
583 | * Pointer to array of struct drm_i915_gem_relocation_entry containing | ||
584 | * the relocations to be performed in this buffer. | ||
585 | */ | ||
586 | __u64 relocs_ptr; | ||
587 | |||
588 | /** Required alignment in graphics aperture */ | ||
589 | __u64 alignment; | ||
590 | |||
591 | /** | ||
592 | * Returned value of the updated offset of the object, for future | ||
593 | * presumed_offset writes. | ||
594 | */ | ||
595 | __u64 offset; | ||
596 | |||
597 | #define EXEC_OBJECT_NEEDS_FENCE (1<<0) | ||
598 | __u64 flags; | ||
599 | __u64 rsvd1; | ||
600 | __u64 rsvd2; | ||
601 | }; | ||
602 | |||
603 | struct drm_i915_gem_execbuffer2 { | ||
604 | /** | ||
605 | * List of gem_exec_object2 structs | ||
606 | */ | ||
607 | __u64 buffers_ptr; | ||
608 | __u32 buffer_count; | ||
609 | |||
610 | /** Offset in the batchbuffer to start execution from. */ | ||
611 | __u32 batch_start_offset; | ||
612 | /** Bytes used in batchbuffer from batch_start_offset */ | ||
613 | __u32 batch_len; | ||
614 | __u32 DR1; | ||
615 | __u32 DR4; | ||
616 | __u32 num_cliprects; | ||
617 | /** This is a struct drm_clip_rect *cliprects */ | ||
618 | __u64 cliprects_ptr; | ||
619 | __u64 flags; /* currently unused */ | ||
620 | __u64 rsvd1; | ||
621 | __u64 rsvd2; | ||
622 | }; | ||
623 | |||
570 | struct drm_i915_gem_pin { | 624 | struct drm_i915_gem_pin { |
571 | /** Handle of the buffer to be pinned. */ | 625 | /** Handle of the buffer to be pinned. */ |
572 | __u32 handle; | 626 | __u32 handle; |
diff --git a/include/drm/nouveau_drm.h b/include/drm/nouveau_drm.h index 1e67c441ea82..f745948b61e4 100644 --- a/include/drm/nouveau_drm.h +++ b/include/drm/nouveau_drm.h | |||
@@ -77,6 +77,7 @@ struct drm_nouveau_gpuobj_free { | |||
77 | #define NOUVEAU_GETPARAM_PCI_PHYSICAL 10 | 77 | #define NOUVEAU_GETPARAM_PCI_PHYSICAL 10 |
78 | #define NOUVEAU_GETPARAM_CHIPSET_ID 11 | 78 | #define NOUVEAU_GETPARAM_CHIPSET_ID 11 |
79 | #define NOUVEAU_GETPARAM_VM_VRAM_BASE 12 | 79 | #define NOUVEAU_GETPARAM_VM_VRAM_BASE 12 |
80 | #define NOUVEAU_GETPARAM_GRAPH_UNITS 13 | ||
80 | struct drm_nouveau_getparam { | 81 | struct drm_nouveau_getparam { |
81 | uint64_t param; | 82 | uint64_t param; |
82 | uint64_t value; | 83 | uint64_t value; |
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index ff7664e0c3cd..4c4e0f8375b3 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h | |||
@@ -353,6 +353,11 @@ struct ttm_bo_driver { | |||
353 | /* notify the driver we are taking a fault on this BO | 353 | /* notify the driver we are taking a fault on this BO |
354 | * and have reserved it */ | 354 | * and have reserved it */ |
355 | void (*fault_reserve_notify)(struct ttm_buffer_object *bo); | 355 | void (*fault_reserve_notify)(struct ttm_buffer_object *bo); |
356 | |||
357 | /** | ||
358 | * notify the driver that we're about to swap out this bo | ||
359 | */ | ||
360 | void (*swap_notify) (struct ttm_buffer_object *bo); | ||
356 | }; | 361 | }; |
357 | 362 | ||
358 | /** | 363 | /** |
diff --git a/include/drm/ttm/ttm_object.h b/include/drm/ttm/ttm_object.h index 703ca4db0a29..0d9db099978b 100644 --- a/include/drm/ttm/ttm_object.h +++ b/include/drm/ttm/ttm_object.h | |||
@@ -77,7 +77,11 @@ enum ttm_object_type { | |||
77 | ttm_buffer_type, | 77 | ttm_buffer_type, |
78 | ttm_lock_type, | 78 | ttm_lock_type, |
79 | ttm_driver_type0 = 256, | 79 | ttm_driver_type0 = 256, |
80 | ttm_driver_type1 | 80 | ttm_driver_type1, |
81 | ttm_driver_type2, | ||
82 | ttm_driver_type3, | ||
83 | ttm_driver_type4, | ||
84 | ttm_driver_type5 | ||
81 | }; | 85 | }; |
82 | 86 | ||
83 | struct ttm_object_file; | 87 | struct ttm_object_file; |
diff --git a/include/drm/vmwgfx_drm.h b/include/drm/vmwgfx_drm.h new file mode 100644 index 000000000000..c7645f480d12 --- /dev/null +++ b/include/drm/vmwgfx_drm.h | |||
@@ -0,0 +1,588 @@ | |||
1 | /************************************************************************** | ||
2 | * | ||
3 | * Copyright © 2009 VMware, Inc., Palo Alto, CA., USA | ||
4 | * All Rights Reserved. | ||
5 | * | ||
6 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
7 | * copy of this software and associated documentation files (the | ||
8 | * "Software"), to deal in the Software without restriction, including | ||
9 | * without limitation the rights to use, copy, modify, merge, publish, | ||
10 | * distribute, sub license, and/or sell copies of the Software, and to | ||
11 | * permit persons to whom the Software is furnished to do so, subject to | ||
12 | * the following conditions: | ||
13 | * | ||
14 | * The above copyright notice and this permission notice (including the | ||
15 | * next paragraph) shall be included in all copies or substantial portions | ||
16 | * of the Software. | ||
17 | * | ||
18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
20 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL | ||
21 | * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, | ||
22 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR | ||
23 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE | ||
24 | * USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
25 | * | ||
26 | **************************************************************************/ | ||
27 | |||
28 | #ifndef __VMWGFX_DRM_H__ | ||
29 | #define __VMWGFX_DRM_H__ | ||
30 | |||
31 | #define DRM_VMW_MAX_SURFACE_FACES 6 | ||
32 | #define DRM_VMW_MAX_MIP_LEVELS 24 | ||
33 | |||
34 | #define DRM_VMW_EXT_NAME_LEN 128 | ||
35 | |||
36 | #define DRM_VMW_GET_PARAM 0 | ||
37 | #define DRM_VMW_ALLOC_DMABUF 1 | ||
38 | #define DRM_VMW_UNREF_DMABUF 2 | ||
39 | #define DRM_VMW_CURSOR_BYPASS 3 | ||
40 | /* guarded by DRM_VMW_PARAM_NUM_STREAMS != 0*/ | ||
41 | #define DRM_VMW_CONTROL_STREAM 4 | ||
42 | #define DRM_VMW_CLAIM_STREAM 5 | ||
43 | #define DRM_VMW_UNREF_STREAM 6 | ||
44 | /* guarded by DRM_VMW_PARAM_3D == 1 */ | ||
45 | #define DRM_VMW_CREATE_CONTEXT 7 | ||
46 | #define DRM_VMW_UNREF_CONTEXT 8 | ||
47 | #define DRM_VMW_CREATE_SURFACE 9 | ||
48 | #define DRM_VMW_UNREF_SURFACE 10 | ||
49 | #define DRM_VMW_REF_SURFACE 11 | ||
50 | #define DRM_VMW_EXECBUF 12 | ||
51 | #define DRM_VMW_FIFO_DEBUG 13 | ||
52 | #define DRM_VMW_FENCE_WAIT 14 | ||
53 | |||
54 | |||
55 | /*************************************************************************/ | ||
56 | /** | ||
57 | * DRM_VMW_GET_PARAM - get device information. | ||
58 | * | ||
59 | * DRM_VMW_PARAM_FIFO_OFFSET: | ||
60 | * Offset to use to map the first page of the FIFO read-only. | ||
61 | * The fifo is mapped using the mmap() system call on the drm device. | ||
62 | * | ||
63 | * DRM_VMW_PARAM_OVERLAY_IOCTL: | ||
64 | * Does the driver support the overlay ioctl. | ||
65 | */ | ||
66 | |||
67 | #define DRM_VMW_PARAM_NUM_STREAMS 0 | ||
68 | #define DRM_VMW_PARAM_NUM_FREE_STREAMS 1 | ||
69 | #define DRM_VMW_PARAM_3D 2 | ||
70 | #define DRM_VMW_PARAM_FIFO_OFFSET 3 | ||
71 | #define DRM_VMW_PARAM_HW_CAPS 4 | ||
72 | #define DRM_VMW_PARAM_FIFO_CAPS 5 | ||
73 | |||
74 | /** | ||
75 | * struct drm_vmw_getparam_arg | ||
76 | * | ||
77 | * @value: Returned value. //Out | ||
78 | * @param: Parameter to query. //In. | ||
79 | * | ||
80 | * Argument to the DRM_VMW_GET_PARAM Ioctl. | ||
81 | */ | ||
82 | |||
83 | struct drm_vmw_getparam_arg { | ||
84 | uint64_t value; | ||
85 | uint32_t param; | ||
86 | uint32_t pad64; | ||
87 | }; | ||
88 | |||
89 | /*************************************************************************/ | ||
90 | /** | ||
91 | * DRM_VMW_EXTENSION - Query device extensions. | ||
92 | */ | ||
93 | |||
94 | /** | ||
95 | * struct drm_vmw_extension_rep | ||
96 | * | ||
97 | * @exists: The queried extension exists. | ||
98 | * @driver_ioctl_offset: Ioctl number of the first ioctl in the extension. | ||
99 | * @driver_sarea_offset: Offset to any space in the DRI SAREA | ||
100 | * used by the extension. | ||
101 | * @major: Major version number of the extension. | ||
102 | * @minor: Minor version number of the extension. | ||
103 | * @pl: Patch level version number of the extension. | ||
104 | * | ||
105 | * Output argument to the DRM_VMW_EXTENSION Ioctl. | ||
106 | */ | ||
107 | |||
108 | struct drm_vmw_extension_rep { | ||
109 | int32_t exists; | ||
110 | uint32_t driver_ioctl_offset; | ||
111 | uint32_t driver_sarea_offset; | ||
112 | uint32_t major; | ||
113 | uint32_t minor; | ||
114 | uint32_t pl; | ||
115 | uint32_t pad64; | ||
116 | }; | ||
117 | |||
118 | /** | ||
119 | * union drm_vmw_extension_arg | ||
120 | * | ||
121 | * @extension - Ascii name of the extension to be queried. //In | ||
122 | * @rep - Reply as defined above. //Out | ||
123 | * | ||
124 | * Argument to the DRM_VMW_EXTENSION Ioctl. | ||
125 | */ | ||
126 | |||
127 | union drm_vmw_extension_arg { | ||
128 | char extension[DRM_VMW_EXT_NAME_LEN]; | ||
129 | struct drm_vmw_extension_rep rep; | ||
130 | }; | ||
131 | |||
132 | /*************************************************************************/ | ||
133 | /** | ||
134 | * DRM_VMW_CREATE_CONTEXT - Create a host context. | ||
135 | * | ||
136 | * Allocates a device unique context id, and queues a create context command | ||
137 | * for the host. Does not wait for host completion. | ||
138 | */ | ||
139 | |||
140 | /** | ||
141 | * struct drm_vmw_context_arg | ||
142 | * | ||
143 | * @cid: Device unique context ID. | ||
144 | * | ||
145 | * Output argument to the DRM_VMW_CREATE_CONTEXT Ioctl. | ||
146 | * Input argument to the DRM_VMW_UNREF_CONTEXT Ioctl. | ||
147 | */ | ||
148 | |||
149 | struct drm_vmw_context_arg { | ||
150 | int32_t cid; | ||
151 | uint32_t pad64; | ||
152 | }; | ||
153 | |||
154 | /*************************************************************************/ | ||
155 | /** | ||
156 | * DRM_VMW_UNREF_CONTEXT - Create a host context. | ||
157 | * | ||
158 | * Frees a global context id, and queues a destroy host command for the host. | ||
159 | * Does not wait for host completion. The context ID can be used directly | ||
160 | * in the command stream and shows up as the same context ID on the host. | ||
161 | */ | ||
162 | |||
163 | /*************************************************************************/ | ||
164 | /** | ||
165 | * DRM_VMW_CREATE_SURFACE - Create a host suface. | ||
166 | * | ||
167 | * Allocates a device unique surface id, and queues a create surface command | ||
168 | * for the host. Does not wait for host completion. The surface ID can be | ||
169 | * used directly in the command stream and shows up as the same surface | ||
170 | * ID on the host. | ||
171 | */ | ||
172 | |||
173 | /** | ||
174 | * struct drm_wmv_surface_create_req | ||
175 | * | ||
176 | * @flags: Surface flags as understood by the host. | ||
177 | * @format: Surface format as understood by the host. | ||
178 | * @mip_levels: Number of mip levels for each face. | ||
179 | * An unused face should have 0 encoded. | ||
180 | * @size_addr: Address of a user-space array of sruct drm_vmw_size | ||
181 | * cast to an uint64_t for 32-64 bit compatibility. | ||
182 | * The size of the array should equal the total number of mipmap levels. | ||
183 | * @shareable: Boolean whether other clients (as identified by file descriptors) | ||
184 | * may reference this surface. | ||
185 | * @scanout: Boolean whether the surface is intended to be used as a | ||
186 | * scanout. | ||
187 | * | ||
188 | * Input data to the DRM_VMW_CREATE_SURFACE Ioctl. | ||
189 | * Output data from the DRM_VMW_REF_SURFACE Ioctl. | ||
190 | */ | ||
191 | |||
192 | struct drm_vmw_surface_create_req { | ||
193 | uint32_t flags; | ||
194 | uint32_t format; | ||
195 | uint32_t mip_levels[DRM_VMW_MAX_SURFACE_FACES]; | ||
196 | uint64_t size_addr; | ||
197 | int32_t shareable; | ||
198 | int32_t scanout; | ||
199 | }; | ||
200 | |||
201 | /** | ||
202 | * struct drm_wmv_surface_arg | ||
203 | * | ||
204 | * @sid: Surface id of created surface or surface to destroy or reference. | ||
205 | * | ||
206 | * Output data from the DRM_VMW_CREATE_SURFACE Ioctl. | ||
207 | * Input argument to the DRM_VMW_UNREF_SURFACE Ioctl. | ||
208 | * Input argument to the DRM_VMW_REF_SURFACE Ioctl. | ||
209 | */ | ||
210 | |||
211 | struct drm_vmw_surface_arg { | ||
212 | int32_t sid; | ||
213 | uint32_t pad64; | ||
214 | }; | ||
215 | |||
216 | /** | ||
217 | * struct drm_vmw_size ioctl. | ||
218 | * | ||
219 | * @width - mip level width | ||
220 | * @height - mip level height | ||
221 | * @depth - mip level depth | ||
222 | * | ||
223 | * Description of a mip level. | ||
224 | * Input data to the DRM_WMW_CREATE_SURFACE Ioctl. | ||
225 | */ | ||
226 | |||
227 | struct drm_vmw_size { | ||
228 | uint32_t width; | ||
229 | uint32_t height; | ||
230 | uint32_t depth; | ||
231 | uint32_t pad64; | ||
232 | }; | ||
233 | |||
234 | /** | ||
235 | * union drm_vmw_surface_create_arg | ||
236 | * | ||
237 | * @rep: Output data as described above. | ||
238 | * @req: Input data as described above. | ||
239 | * | ||
240 | * Argument to the DRM_VMW_CREATE_SURFACE Ioctl. | ||
241 | */ | ||
242 | |||
243 | union drm_vmw_surface_create_arg { | ||
244 | struct drm_vmw_surface_arg rep; | ||
245 | struct drm_vmw_surface_create_req req; | ||
246 | }; | ||
247 | |||
248 | /*************************************************************************/ | ||
249 | /** | ||
250 | * DRM_VMW_REF_SURFACE - Reference a host surface. | ||
251 | * | ||
252 | * Puts a reference on a host surface with a give sid, as previously | ||
253 | * returned by the DRM_VMW_CREATE_SURFACE ioctl. | ||
254 | * A reference will make sure the surface isn't destroyed while we hold | ||
255 | * it and will allow the calling client to use the surface ID in the command | ||
256 | * stream. | ||
257 | * | ||
258 | * On successful return, the Ioctl returns the surface information given | ||
259 | * in the DRM_VMW_CREATE_SURFACE ioctl. | ||
260 | */ | ||
261 | |||
262 | /** | ||
263 | * union drm_vmw_surface_reference_arg | ||
264 | * | ||
265 | * @rep: Output data as described above. | ||
266 | * @req: Input data as described above. | ||
267 | * | ||
268 | * Argument to the DRM_VMW_REF_SURFACE Ioctl. | ||
269 | */ | ||
270 | |||
271 | union drm_vmw_surface_reference_arg { | ||
272 | struct drm_vmw_surface_create_req rep; | ||
273 | struct drm_vmw_surface_arg req; | ||
274 | }; | ||
275 | |||
276 | /*************************************************************************/ | ||
277 | /** | ||
278 | * DRM_VMW_UNREF_SURFACE - Unreference a host surface. | ||
279 | * | ||
280 | * Clear a reference previously put on a host surface. | ||
281 | * When all references are gone, including the one implicitly placed | ||
282 | * on creation, | ||
283 | * a destroy surface command will be queued for the host. | ||
284 | * Does not wait for completion. | ||
285 | */ | ||
286 | |||
287 | /*************************************************************************/ | ||
288 | /** | ||
289 | * DRM_VMW_EXECBUF | ||
290 | * | ||
291 | * Submit a command buffer for execution on the host, and return a | ||
292 | * fence sequence that when signaled, indicates that the command buffer has | ||
293 | * executed. | ||
294 | */ | ||
295 | |||
296 | /** | ||
297 | * struct drm_vmw_execbuf_arg | ||
298 | * | ||
299 | * @commands: User-space address of a command buffer cast to an uint64_t. | ||
300 | * @command-size: Size in bytes of the command buffer. | ||
301 | * @throttle-us: Sleep until software is less than @throttle_us | ||
302 | * microseconds ahead of hardware. The driver may round this value | ||
303 | * to the nearest kernel tick. | ||
304 | * @fence_rep: User-space address of a struct drm_vmw_fence_rep cast to an | ||
305 | * uint64_t. | ||
306 | * @version: Allows expanding the execbuf ioctl parameters without breaking | ||
307 | * backwards compatibility, since user-space will always tell the kernel | ||
308 | * which version it uses. | ||
309 | * @flags: Execbuf flags. None currently. | ||
310 | * | ||
311 | * Argument to the DRM_VMW_EXECBUF Ioctl. | ||
312 | */ | ||
313 | |||
314 | #define DRM_VMW_EXECBUF_VERSION 0 | ||
315 | |||
316 | struct drm_vmw_execbuf_arg { | ||
317 | uint64_t commands; | ||
318 | uint32_t command_size; | ||
319 | uint32_t throttle_us; | ||
320 | uint64_t fence_rep; | ||
321 | uint32_t version; | ||
322 | uint32_t flags; | ||
323 | }; | ||
324 | |||
325 | /** | ||
326 | * struct drm_vmw_fence_rep | ||
327 | * | ||
328 | * @fence_seq: Fence sequence associated with a command submission. | ||
329 | * @error: This member should've been set to -EFAULT on submission. | ||
330 | * The following actions should be take on completion: | ||
331 | * error == -EFAULT: Fence communication failed. The host is synchronized. | ||
332 | * Use the last fence id read from the FIFO fence register. | ||
333 | * error != 0 && error != -EFAULT: | ||
334 | * Fence submission failed. The host is synchronized. Use the fence_seq member. | ||
335 | * error == 0: All is OK, The host may not be synchronized. | ||
336 | * Use the fence_seq member. | ||
337 | * | ||
338 | * Input / Output data to the DRM_VMW_EXECBUF Ioctl. | ||
339 | */ | ||
340 | |||
341 | struct drm_vmw_fence_rep { | ||
342 | uint64_t fence_seq; | ||
343 | int32_t error; | ||
344 | uint32_t pad64; | ||
345 | }; | ||
346 | |||
347 | /*************************************************************************/ | ||
348 | /** | ||
349 | * DRM_VMW_ALLOC_DMABUF | ||
350 | * | ||
351 | * Allocate a DMA buffer that is visible also to the host. | ||
352 | * NOTE: The buffer is | ||
353 | * identified by a handle and an offset, which are private to the guest, but | ||
354 | * useable in the command stream. The guest kernel may translate these | ||
355 | * and patch up the command stream accordingly. In the future, the offset may | ||
356 | * be zero at all times, or it may disappear from the interface before it is | ||
357 | * fixed. | ||
358 | * | ||
359 | * The DMA buffer may stay user-space mapped in the guest at all times, | ||
360 | * and is thus suitable for sub-allocation. | ||
361 | * | ||
362 | * DMA buffers are mapped using the mmap() syscall on the drm device. | ||
363 | */ | ||
364 | |||
365 | /** | ||
366 | * struct drm_vmw_alloc_dmabuf_req | ||
367 | * | ||
368 | * @size: Required minimum size of the buffer. | ||
369 | * | ||
370 | * Input data to the DRM_VMW_ALLOC_DMABUF Ioctl. | ||
371 | */ | ||
372 | |||
373 | struct drm_vmw_alloc_dmabuf_req { | ||
374 | uint32_t size; | ||
375 | uint32_t pad64; | ||
376 | }; | ||
377 | |||
378 | /** | ||
379 | * struct drm_vmw_dmabuf_rep | ||
380 | * | ||
381 | * @map_handle: Offset to use in the mmap() call used to map the buffer. | ||
382 | * @handle: Handle unique to this buffer. Used for unreferencing. | ||
383 | * @cur_gmr_id: GMR id to use in the command stream when this buffer is | ||
384 | * referenced. See not above. | ||
385 | * @cur_gmr_offset: Offset to use in the command stream when this buffer is | ||
386 | * referenced. See note above. | ||
387 | * | ||
388 | * Output data from the DRM_VMW_ALLOC_DMABUF Ioctl. | ||
389 | */ | ||
390 | |||
391 | struct drm_vmw_dmabuf_rep { | ||
392 | uint64_t map_handle; | ||
393 | uint32_t handle; | ||
394 | uint32_t cur_gmr_id; | ||
395 | uint32_t cur_gmr_offset; | ||
396 | uint32_t pad64; | ||
397 | }; | ||
398 | |||
399 | /** | ||
400 | * union drm_vmw_dmabuf_arg | ||
401 | * | ||
402 | * @req: Input data as described above. | ||
403 | * @rep: Output data as described above. | ||
404 | * | ||
405 | * Argument to the DRM_VMW_ALLOC_DMABUF Ioctl. | ||
406 | */ | ||
407 | |||
408 | union drm_vmw_alloc_dmabuf_arg { | ||
409 | struct drm_vmw_alloc_dmabuf_req req; | ||
410 | struct drm_vmw_dmabuf_rep rep; | ||
411 | }; | ||
412 | |||
413 | /*************************************************************************/ | ||
414 | /** | ||
415 | * DRM_VMW_UNREF_DMABUF - Free a DMA buffer. | ||
416 | * | ||
417 | */ | ||
418 | |||
419 | /** | ||
420 | * struct drm_vmw_unref_dmabuf_arg | ||
421 | * | ||
422 | * @handle: Handle indicating what buffer to free. Obtained from the | ||
423 | * DRM_VMW_ALLOC_DMABUF Ioctl. | ||
424 | * | ||
425 | * Argument to the DRM_VMW_UNREF_DMABUF Ioctl. | ||
426 | */ | ||
427 | |||
428 | struct drm_vmw_unref_dmabuf_arg { | ||
429 | uint32_t handle; | ||
430 | uint32_t pad64; | ||
431 | }; | ||
432 | |||
433 | /*************************************************************************/ | ||
434 | /** | ||
435 | * DRM_VMW_FIFO_DEBUG - Get last FIFO submission. | ||
436 | * | ||
437 | * This IOCTL copies the last FIFO submission directly out of the FIFO buffer. | ||
438 | */ | ||
439 | |||
440 | /** | ||
441 | * struct drm_vmw_fifo_debug_arg | ||
442 | * | ||
443 | * @debug_buffer: User space address of a debug_buffer cast to an uint64_t //In | ||
444 | * @debug_buffer_size: Size in bytes of debug buffer //In | ||
445 | * @used_size: Number of bytes copied to the buffer // Out | ||
446 | * @did_not_fit: Boolean indicating that the fifo contents did not fit. //Out | ||
447 | * | ||
448 | * Argument to the DRM_VMW_FIFO_DEBUG Ioctl. | ||
449 | */ | ||
450 | |||
451 | struct drm_vmw_fifo_debug_arg { | ||
452 | uint64_t debug_buffer; | ||
453 | uint32_t debug_buffer_size; | ||
454 | uint32_t used_size; | ||
455 | int32_t did_not_fit; | ||
456 | uint32_t pad64; | ||
457 | }; | ||
458 | |||
459 | struct drm_vmw_fence_wait_arg { | ||
460 | uint64_t sequence; | ||
461 | uint64_t kernel_cookie; | ||
462 | int32_t cookie_valid; | ||
463 | int32_t pad64; | ||
464 | }; | ||
465 | |||
466 | /*************************************************************************/ | ||
467 | /** | ||
468 | * DRM_VMW_CONTROL_STREAM - Control overlays, aka streams. | ||
469 | * | ||
470 | * This IOCTL controls the overlay units of the svga device. | ||
471 | * The SVGA overlay units does not work like regular hardware units in | ||
472 | * that they do not automaticaly read back the contents of the given dma | ||
473 | * buffer. But instead only read back for each call to this ioctl, and | ||
474 | * at any point between this call being made and a following call that | ||
475 | * either changes the buffer or disables the stream. | ||
476 | */ | ||
477 | |||
478 | /** | ||
479 | * struct drm_vmw_rect | ||
480 | * | ||
481 | * Defines a rectangle. Used in the overlay ioctl to define | ||
482 | * source and destination rectangle. | ||
483 | */ | ||
484 | |||
485 | struct drm_vmw_rect { | ||
486 | int32_t x; | ||
487 | int32_t y; | ||
488 | uint32_t w; | ||
489 | uint32_t h; | ||
490 | }; | ||
491 | |||
492 | /** | ||
493 | * struct drm_vmw_control_stream_arg | ||
494 | * | ||
495 | * @stream_id: Stearm to control | ||
496 | * @enabled: If false all following arguments are ignored. | ||
497 | * @handle: Handle to buffer for getting data from. | ||
498 | * @format: Format of the overlay as understood by the host. | ||
499 | * @width: Width of the overlay. | ||
500 | * @height: Height of the overlay. | ||
501 | * @size: Size of the overlay in bytes. | ||
502 | * @pitch: Array of pitches, the two last are only used for YUV12 formats. | ||
503 | * @offset: Offset from start of dma buffer to overlay. | ||
504 | * @src: Source rect, must be within the defined area above. | ||
505 | * @dst: Destination rect, x and y may be negative. | ||
506 | * | ||
507 | * Argument to the DRM_VMW_CONTROL_STREAM Ioctl. | ||
508 | */ | ||
509 | |||
510 | struct drm_vmw_control_stream_arg { | ||
511 | uint32_t stream_id; | ||
512 | uint32_t enabled; | ||
513 | |||
514 | uint32_t flags; | ||
515 | uint32_t color_key; | ||
516 | |||
517 | uint32_t handle; | ||
518 | uint32_t offset; | ||
519 | int32_t format; | ||
520 | uint32_t size; | ||
521 | uint32_t width; | ||
522 | uint32_t height; | ||
523 | uint32_t pitch[3]; | ||
524 | |||
525 | uint32_t pad64; | ||
526 | struct drm_vmw_rect src; | ||
527 | struct drm_vmw_rect dst; | ||
528 | }; | ||
529 | |||
530 | /*************************************************************************/ | ||
531 | /** | ||
532 | * DRM_VMW_CURSOR_BYPASS - Give extra information about cursor bypass. | ||
533 | * | ||
534 | */ | ||
535 | |||
536 | #define DRM_VMW_CURSOR_BYPASS_ALL (1 << 0) | ||
537 | #define DRM_VMW_CURSOR_BYPASS_FLAGS (1) | ||
538 | |||
539 | /** | ||
540 | * struct drm_vmw_cursor_bypass_arg | ||
541 | * | ||
542 | * @flags: Flags. | ||
543 | * @crtc_id: Crtc id, only used if DMR_CURSOR_BYPASS_ALL isn't passed. | ||
544 | * @xpos: X position of cursor. | ||
545 | * @ypos: Y position of cursor. | ||
546 | * @xhot: X hotspot. | ||
547 | * @yhot: Y hotspot. | ||
548 | * | ||
549 | * Argument to the DRM_VMW_CURSOR_BYPASS Ioctl. | ||
550 | */ | ||
551 | |||
552 | struct drm_vmw_cursor_bypass_arg { | ||
553 | uint32_t flags; | ||
554 | uint32_t crtc_id; | ||
555 | int32_t xpos; | ||
556 | int32_t ypos; | ||
557 | int32_t xhot; | ||
558 | int32_t yhot; | ||
559 | }; | ||
560 | |||
561 | /*************************************************************************/ | ||
562 | /** | ||
563 | * DRM_VMW_CLAIM_STREAM - Claim a single stream. | ||
564 | */ | ||
565 | |||
566 | /** | ||
567 | * struct drm_vmw_context_arg | ||
568 | * | ||
569 | * @stream_id: Device unique context ID. | ||
570 | * | ||
571 | * Output argument to the DRM_VMW_CREATE_CONTEXT Ioctl. | ||
572 | * Input argument to the DRM_VMW_UNREF_CONTEXT Ioctl. | ||
573 | */ | ||
574 | |||
575 | struct drm_vmw_stream_arg { | ||
576 | uint32_t stream_id; | ||
577 | uint32_t pad64; | ||
578 | }; | ||
579 | |||
580 | /*************************************************************************/ | ||
581 | /** | ||
582 | * DRM_VMW_UNREF_STREAM - Unclaim a stream. | ||
583 | * | ||
584 | * Return a single stream that was claimed by this process. Also makes | ||
585 | * sure that the stream has been stopped. | ||
586 | */ | ||
587 | |||
588 | #endif | ||
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index f72914db2a11..756f831cbdd5 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -118,6 +118,7 @@ header-y += mtio.h | |||
118 | header-y += ncp_no.h | 118 | header-y += ncp_no.h |
119 | header-y += neighbour.h | 119 | header-y += neighbour.h |
120 | header-y += net_dropmon.h | 120 | header-y += net_dropmon.h |
121 | header-y += net_tstamp.h | ||
121 | header-y += netfilter_arp.h | 122 | header-y += netfilter_arp.h |
122 | header-y += netrom.h | 123 | header-y += netrom.h |
123 | header-y += nfs2.h | 124 | header-y += nfs2.h |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index dfcd920c3e54..b926afe8c03e 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -80,7 +80,7 @@ char * __acpi_map_table (unsigned long phys_addr, unsigned long size); | |||
80 | void __acpi_unmap_table(char *map, unsigned long size); | 80 | void __acpi_unmap_table(char *map, unsigned long size); |
81 | int early_acpi_boot_init(void); | 81 | int early_acpi_boot_init(void); |
82 | int acpi_boot_init (void); | 82 | int acpi_boot_init (void); |
83 | int acpi_boot_table_init (void); | 83 | void acpi_boot_table_init (void); |
84 | int acpi_mps_check (void); | 84 | int acpi_mps_check (void); |
85 | int acpi_numa_init (void); | 85 | int acpi_numa_init (void); |
86 | 86 | ||
@@ -240,7 +240,7 @@ extern int pnpacpi_disabled; | |||
240 | #define PXM_INVAL (-1) | 240 | #define PXM_INVAL (-1) |
241 | #define NID_INVAL (-1) | 241 | #define NID_INVAL (-1) |
242 | 242 | ||
243 | int acpi_check_resource_conflict(struct resource *res); | 243 | int acpi_check_resource_conflict(const struct resource *res); |
244 | 244 | ||
245 | int acpi_check_region(resource_size_t start, resource_size_t n, | 245 | int acpi_check_region(resource_size_t start, resource_size_t n, |
246 | const char *name); | 246 | const char *name); |
@@ -251,12 +251,19 @@ int acpi_check_mem_region(resource_size_t start, resource_size_t n, | |||
251 | void __init acpi_no_s4_hw_signature(void); | 251 | void __init acpi_no_s4_hw_signature(void); |
252 | void __init acpi_old_suspend_ordering(void); | 252 | void __init acpi_old_suspend_ordering(void); |
253 | void __init acpi_s4_no_nvs(void); | 253 | void __init acpi_s4_no_nvs(void); |
254 | void __init acpi_set_sci_en_on_resume(void); | ||
254 | #endif /* CONFIG_PM_SLEEP */ | 255 | #endif /* CONFIG_PM_SLEEP */ |
255 | 256 | ||
257 | struct acpi_osc_context { | ||
258 | char *uuid_str; /* uuid string */ | ||
259 | int rev; | ||
260 | struct acpi_buffer cap; /* arg2/arg3 */ | ||
261 | struct acpi_buffer ret; /* free by caller if success */ | ||
262 | }; | ||
263 | |||
256 | #define OSC_QUERY_TYPE 0 | 264 | #define OSC_QUERY_TYPE 0 |
257 | #define OSC_SUPPORT_TYPE 1 | 265 | #define OSC_SUPPORT_TYPE 1 |
258 | #define OSC_CONTROL_TYPE 2 | 266 | #define OSC_CONTROL_TYPE 2 |
259 | #define OSC_SUPPORT_MASKS 0x1f | ||
260 | 267 | ||
261 | /* _OSC DW0 Definition */ | 268 | /* _OSC DW0 Definition */ |
262 | #define OSC_QUERY_ENABLE 1 | 269 | #define OSC_QUERY_ENABLE 1 |
@@ -265,12 +272,23 @@ void __init acpi_s4_no_nvs(void); | |||
265 | #define OSC_INVALID_REVISION_ERROR 8 | 272 | #define OSC_INVALID_REVISION_ERROR 8 |
266 | #define OSC_CAPABILITIES_MASK_ERROR 16 | 273 | #define OSC_CAPABILITIES_MASK_ERROR 16 |
267 | 274 | ||
275 | acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context); | ||
276 | |||
277 | /* platform-wide _OSC bits */ | ||
278 | #define OSC_SB_PAD_SUPPORT 1 | ||
279 | #define OSC_SB_PPC_OST_SUPPORT 2 | ||
280 | #define OSC_SB_PR3_SUPPORT 4 | ||
281 | #define OSC_SB_CPUHP_OST_SUPPORT 8 | ||
282 | #define OSC_SB_APEI_SUPPORT 16 | ||
283 | |||
284 | /* PCI defined _OSC bits */ | ||
268 | /* _OSC DW1 Definition (OS Support Fields) */ | 285 | /* _OSC DW1 Definition (OS Support Fields) */ |
269 | #define OSC_EXT_PCI_CONFIG_SUPPORT 1 | 286 | #define OSC_EXT_PCI_CONFIG_SUPPORT 1 |
270 | #define OSC_ACTIVE_STATE_PWR_SUPPORT 2 | 287 | #define OSC_ACTIVE_STATE_PWR_SUPPORT 2 |
271 | #define OSC_CLOCK_PWR_CAPABILITY_SUPPORT 4 | 288 | #define OSC_CLOCK_PWR_CAPABILITY_SUPPORT 4 |
272 | #define OSC_PCI_SEGMENT_GROUPS_SUPPORT 8 | 289 | #define OSC_PCI_SEGMENT_GROUPS_SUPPORT 8 |
273 | #define OSC_MSI_SUPPORT 16 | 290 | #define OSC_MSI_SUPPORT 16 |
291 | #define OSC_PCI_SUPPORT_MASKS 0x1f | ||
274 | 292 | ||
275 | /* _OSC DW1 Definition (OS Control Fields) */ | 293 | /* _OSC DW1 Definition (OS Control Fields) */ |
276 | #define OSC_PCI_EXPRESS_NATIVE_HP_CONTROL 1 | 294 | #define OSC_PCI_EXPRESS_NATIVE_HP_CONTROL 1 |
@@ -279,7 +297,7 @@ void __init acpi_s4_no_nvs(void); | |||
279 | #define OSC_PCI_EXPRESS_AER_CONTROL 8 | 297 | #define OSC_PCI_EXPRESS_AER_CONTROL 8 |
280 | #define OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL 16 | 298 | #define OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL 16 |
281 | 299 | ||
282 | #define OSC_CONTROL_MASKS (OSC_PCI_EXPRESS_NATIVE_HP_CONTROL | \ | 300 | #define OSC_PCI_CONTROL_MASKS (OSC_PCI_EXPRESS_NATIVE_HP_CONTROL | \ |
283 | OSC_SHPC_NATIVE_HP_CONTROL | \ | 301 | OSC_SHPC_NATIVE_HP_CONTROL | \ |
284 | OSC_PCI_EXPRESS_PME_CONTROL | \ | 302 | OSC_PCI_EXPRESS_PME_CONTROL | \ |
285 | OSC_PCI_EXPRESS_AER_CONTROL | \ | 303 | OSC_PCI_EXPRESS_AER_CONTROL | \ |
@@ -303,9 +321,9 @@ static inline int acpi_boot_init(void) | |||
303 | return 0; | 321 | return 0; |
304 | } | 322 | } |
305 | 323 | ||
306 | static inline int acpi_boot_table_init(void) | 324 | static inline void acpi_boot_table_init(void) |
307 | { | 325 | { |
308 | return 0; | 326 | return; |
309 | } | 327 | } |
310 | 328 | ||
311 | static inline int acpi_mps_check(void) | 329 | static inline int acpi_mps_check(void) |
diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h index ab94335b4bb9..6816be6c3f77 100644 --- a/include/linux/amba/bus.h +++ b/include/linux/amba/bus.h | |||
@@ -1,5 +1,9 @@ | |||
1 | /* | 1 | /* |
2 | * linux/include/asm-arm/hardware/amba.h | 2 | * linux/include/amba/bus.h |
3 | * | ||
4 | * This device type deals with ARM PrimeCells and anything else that | ||
5 | * presents a proper CID (0xB105F00D) at the end of the I/O register | ||
6 | * region or that is derived from a PrimeCell. | ||
3 | * | 7 | * |
4 | * Copyright (C) 2003 Deep Blue Solutions Ltd, All Rights Reserved. | 8 | * Copyright (C) 2003 Deep Blue Solutions Ltd, All Rights Reserved. |
5 | * | 9 | * |
diff --git a/include/linux/ata.h b/include/linux/ata.h index 38a6948ce0c2..20f31567ccee 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
@@ -647,9 +647,9 @@ static inline int ata_id_has_large_logical_sectors(const u16 *id) | |||
647 | return id[ATA_ID_SECTOR_SIZE] & (1 << 13); | 647 | return id[ATA_ID_SECTOR_SIZE] & (1 << 13); |
648 | } | 648 | } |
649 | 649 | ||
650 | static inline u8 ata_id_logical_per_physical_sectors(const u16 *id) | 650 | static inline u16 ata_id_logical_per_physical_sectors(const u16 *id) |
651 | { | 651 | { |
652 | return id[ATA_ID_SECTOR_SIZE] & 0xf; | 652 | return 1 << (id[ATA_ID_SECTOR_SIZE] & 0xf); |
653 | } | 653 | } |
654 | 654 | ||
655 | static inline int ata_id_has_lba48(const u16 *id) | 655 | static inline int ata_id_has_lba48(const u16 *id) |
diff --git a/include/linux/backlight.h b/include/linux/backlight.h index 0f5f57858a23..8c4f884db6b4 100644 --- a/include/linux/backlight.h +++ b/include/linux/backlight.h | |||
@@ -36,18 +36,18 @@ struct backlight_device; | |||
36 | struct fb_info; | 36 | struct fb_info; |
37 | 37 | ||
38 | struct backlight_ops { | 38 | struct backlight_ops { |
39 | unsigned int options; | 39 | const unsigned int options; |
40 | 40 | ||
41 | #define BL_CORE_SUSPENDRESUME (1 << 0) | 41 | #define BL_CORE_SUSPENDRESUME (1 << 0) |
42 | 42 | ||
43 | /* Notify the backlight driver some property has changed */ | 43 | /* Notify the backlight driver some property has changed */ |
44 | int (*update_status)(struct backlight_device *); | 44 | int (* const update_status)(struct backlight_device *); |
45 | /* Return the current backlight brightness (accounting for power, | 45 | /* Return the current backlight brightness (accounting for power, |
46 | fb_blank etc.) */ | 46 | fb_blank etc.) */ |
47 | int (*get_brightness)(struct backlight_device *); | 47 | int (* const get_brightness)(struct backlight_device *); |
48 | /* Check if given framebuffer device is the one bound to this backlight; | 48 | /* Check if given framebuffer device is the one bound to this backlight; |
49 | return 0 if not, !=0 if it is. If NULL, backlight always matches the fb. */ | 49 | return 0 if not, !=0 if it is. If NULL, backlight always matches the fb. */ |
50 | int (*check_fb)(struct fb_info *); | 50 | int (* const check_fb)(struct fb_info *); |
51 | }; | 51 | }; |
52 | 52 | ||
53 | /* This structure defines all the properties of a backlight */ | 53 | /* This structure defines all the properties of a backlight */ |
@@ -86,7 +86,7 @@ struct backlight_device { | |||
86 | registered this device has been unloaded, and if class_get_devdata() | 86 | registered this device has been unloaded, and if class_get_devdata() |
87 | points to something in the body of that driver, it is also invalid. */ | 87 | points to something in the body of that driver, it is also invalid. */ |
88 | struct mutex ops_lock; | 88 | struct mutex ops_lock; |
89 | struct backlight_ops *ops; | 89 | const struct backlight_ops *ops; |
90 | 90 | ||
91 | /* The framebuffer notifier block */ | 91 | /* The framebuffer notifier block */ |
92 | struct notifier_block fb_notif; | 92 | struct notifier_block fb_notif; |
@@ -103,7 +103,7 @@ static inline void backlight_update_status(struct backlight_device *bd) | |||
103 | } | 103 | } |
104 | 104 | ||
105 | extern struct backlight_device *backlight_device_register(const char *name, | 105 | extern struct backlight_device *backlight_device_register(const char *name, |
106 | struct device *dev, void *devdata, struct backlight_ops *ops); | 106 | struct device *dev, void *devdata, const struct backlight_ops *ops); |
107 | extern void backlight_device_unregister(struct backlight_device *bd); | 107 | extern void backlight_device_unregister(struct backlight_device *bd); |
108 | extern void backlight_force_update(struct backlight_device *bd, | 108 | extern void backlight_force_update(struct backlight_device *bd, |
109 | enum backlight_update_reason reason); | 109 | enum backlight_update_reason reason); |
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h index aece486ac734..89c6249fc561 100644 --- a/include/linux/binfmts.h +++ b/include/linux/binfmts.h | |||
@@ -68,6 +68,14 @@ struct linux_binprm{ | |||
68 | 68 | ||
69 | #define BINPRM_MAX_RECURSION 4 | 69 | #define BINPRM_MAX_RECURSION 4 |
70 | 70 | ||
71 | /* Function parameter for binfmt->coredump */ | ||
72 | struct coredump_params { | ||
73 | long signr; | ||
74 | struct pt_regs *regs; | ||
75 | struct file *file; | ||
76 | unsigned long limit; | ||
77 | }; | ||
78 | |||
71 | /* | 79 | /* |
72 | * This structure defines the functions that are used to load the binary formats that | 80 | * This structure defines the functions that are used to load the binary formats that |
73 | * linux accepts. | 81 | * linux accepts. |
@@ -77,7 +85,7 @@ struct linux_binfmt { | |||
77 | struct module *module; | 85 | struct module *module; |
78 | int (*load_binary)(struct linux_binprm *, struct pt_regs * regs); | 86 | int (*load_binary)(struct linux_binprm *, struct pt_regs * regs); |
79 | int (*load_shlib)(struct file *); | 87 | int (*load_shlib)(struct file *); |
80 | int (*core_dump)(long signr, struct pt_regs *regs, struct file *file, unsigned long limit); | 88 | int (*core_dump)(struct coredump_params *cprm); |
81 | unsigned long min_coredump; /* minimal dump size */ | 89 | unsigned long min_coredump; /* minimal dump size */ |
82 | int hasvdso; | 90 | int hasvdso; |
83 | }; | 91 | }; |
@@ -101,6 +109,7 @@ extern int prepare_binprm(struct linux_binprm *); | |||
101 | extern int __must_check remove_arg_zero(struct linux_binprm *); | 109 | extern int __must_check remove_arg_zero(struct linux_binprm *); |
102 | extern int search_binary_handler(struct linux_binprm *,struct pt_regs *); | 110 | extern int search_binary_handler(struct linux_binprm *,struct pt_regs *); |
103 | extern int flush_old_exec(struct linux_binprm * bprm); | 111 | extern int flush_old_exec(struct linux_binprm * bprm); |
112 | extern void setup_new_exec(struct linux_binprm * bprm); | ||
104 | 113 | ||
105 | extern int suid_dumpable; | 114 | extern int suid_dumpable; |
106 | #define SUID_DUMP_DISABLE 0 /* No setuid dumping */ | 115 | #define SUID_DUMP_DISABLE 0 /* No setuid dumping */ |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 784a919aa0d0..1896e868854f 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -461,8 +461,7 @@ struct request_queue | |||
461 | #define QUEUE_FLAG_NONROT 14 /* non-rotational device (SSD) */ | 461 | #define QUEUE_FLAG_NONROT 14 /* non-rotational device (SSD) */ |
462 | #define QUEUE_FLAG_VIRT QUEUE_FLAG_NONROT /* paravirt device */ | 462 | #define QUEUE_FLAG_VIRT QUEUE_FLAG_NONROT /* paravirt device */ |
463 | #define QUEUE_FLAG_IO_STAT 15 /* do IO stats */ | 463 | #define QUEUE_FLAG_IO_STAT 15 /* do IO stats */ |
464 | #define QUEUE_FLAG_CQ 16 /* hardware does queuing */ | 464 | #define QUEUE_FLAG_DISCARD 16 /* supports DISCARD */ |
465 | #define QUEUE_FLAG_DISCARD 17 /* supports DISCARD */ | ||
466 | 465 | ||
467 | #define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \ | 466 | #define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \ |
468 | (1 << QUEUE_FLAG_CLUSTER) | \ | 467 | (1 << QUEUE_FLAG_CLUSTER) | \ |
@@ -586,7 +585,6 @@ enum { | |||
586 | 585 | ||
587 | #define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags) | 586 | #define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags) |
588 | #define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags) | 587 | #define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags) |
589 | #define blk_queue_queuing(q) test_bit(QUEUE_FLAG_CQ, &(q)->queue_flags) | ||
590 | #define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) | 588 | #define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) |
591 | #define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags) | 589 | #define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags) |
592 | #define blk_queue_nonrot(q) test_bit(QUEUE_FLAG_NONROT, &(q)->queue_flags) | 590 | #define blk_queue_nonrot(q) test_bit(QUEUE_FLAG_NONROT, &(q)->queue_flags) |
@@ -845,7 +843,6 @@ static inline struct request_queue *bdev_get_queue(struct block_device *bdev) | |||
845 | * blk_rq_err_bytes() : bytes left till the next error boundary | 843 | * blk_rq_err_bytes() : bytes left till the next error boundary |
846 | * blk_rq_sectors() : sectors left in the entire request | 844 | * blk_rq_sectors() : sectors left in the entire request |
847 | * blk_rq_cur_sectors() : sectors left in the current segment | 845 | * blk_rq_cur_sectors() : sectors left in the current segment |
848 | * blk_rq_err_sectors() : sectors left till the next error boundary | ||
849 | */ | 846 | */ |
850 | static inline sector_t blk_rq_pos(const struct request *rq) | 847 | static inline sector_t blk_rq_pos(const struct request *rq) |
851 | { | 848 | { |
@@ -874,11 +871,6 @@ static inline unsigned int blk_rq_cur_sectors(const struct request *rq) | |||
874 | return blk_rq_cur_bytes(rq) >> 9; | 871 | return blk_rq_cur_bytes(rq) >> 9; |
875 | } | 872 | } |
876 | 873 | ||
877 | static inline unsigned int blk_rq_err_sectors(const struct request *rq) | ||
878 | { | ||
879 | return blk_rq_err_bytes(rq) >> 9; | ||
880 | } | ||
881 | |||
882 | /* | 874 | /* |
883 | * Request issue related functions. | 875 | * Request issue related functions. |
884 | */ | 876 | */ |
@@ -944,6 +936,8 @@ extern void blk_queue_io_opt(struct request_queue *q, unsigned int opt); | |||
944 | extern void blk_set_default_limits(struct queue_limits *lim); | 936 | extern void blk_set_default_limits(struct queue_limits *lim); |
945 | extern int blk_stack_limits(struct queue_limits *t, struct queue_limits *b, | 937 | extern int blk_stack_limits(struct queue_limits *t, struct queue_limits *b, |
946 | sector_t offset); | 938 | sector_t offset); |
939 | extern int bdev_stack_limits(struct queue_limits *t, struct block_device *bdev, | ||
940 | sector_t offset); | ||
947 | extern void disk_stack_limits(struct gendisk *disk, struct block_device *bdev, | 941 | extern void disk_stack_limits(struct gendisk *disk, struct block_device *bdev, |
948 | sector_t offset); | 942 | sector_t offset); |
949 | extern void blk_queue_stack_limits(struct request_queue *t, struct request_queue *b); | 943 | extern void blk_queue_stack_limits(struct request_queue *t, struct request_queue *b); |
@@ -1116,11 +1110,18 @@ static inline int queue_alignment_offset(struct request_queue *q) | |||
1116 | return q->limits.alignment_offset; | 1110 | return q->limits.alignment_offset; |
1117 | } | 1111 | } |
1118 | 1112 | ||
1113 | static inline int queue_limit_alignment_offset(struct queue_limits *lim, sector_t offset) | ||
1114 | { | ||
1115 | unsigned int granularity = max(lim->physical_block_size, lim->io_min); | ||
1116 | |||
1117 | offset &= granularity - 1; | ||
1118 | return (granularity + lim->alignment_offset - offset) & (granularity - 1); | ||
1119 | } | ||
1120 | |||
1119 | static inline int queue_sector_alignment_offset(struct request_queue *q, | 1121 | static inline int queue_sector_alignment_offset(struct request_queue *q, |
1120 | sector_t sector) | 1122 | sector_t sector) |
1121 | { | 1123 | { |
1122 | return ((sector << 9) - q->limits.alignment_offset) | 1124 | return queue_limit_alignment_offset(&q->limits, sector << 9); |
1123 | & (q->limits.io_min - 1); | ||
1124 | } | 1125 | } |
1125 | 1126 | ||
1126 | static inline int bdev_alignment_offset(struct block_device *bdev) | 1127 | static inline int bdev_alignment_offset(struct block_device *bdev) |
@@ -1147,8 +1148,11 @@ static inline int queue_discard_alignment(struct request_queue *q) | |||
1147 | static inline int queue_sector_discard_alignment(struct request_queue *q, | 1148 | static inline int queue_sector_discard_alignment(struct request_queue *q, |
1148 | sector_t sector) | 1149 | sector_t sector) |
1149 | { | 1150 | { |
1150 | return ((sector << 9) - q->limits.discard_alignment) | 1151 | struct queue_limits *lim = &q->limits; |
1151 | & (q->limits.discard_granularity - 1); | 1152 | unsigned int alignment = (sector << 9) & (lim->discard_granularity - 1); |
1153 | |||
1154 | return (lim->discard_granularity + lim->discard_alignment - alignment) | ||
1155 | & (lim->discard_granularity - 1); | ||
1152 | } | 1156 | } |
1153 | 1157 | ||
1154 | static inline unsigned int queue_discard_zeroes_data(struct request_queue *q) | 1158 | static inline unsigned int queue_discard_zeroes_data(struct request_queue *q) |
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h index 1ed2a5cc03f5..3db7767d2a17 100644 --- a/include/linux/can/dev.h +++ b/include/linux/can/dev.h | |||
@@ -51,6 +51,15 @@ struct can_priv { | |||
51 | struct sk_buff **echo_skb; | 51 | struct sk_buff **echo_skb; |
52 | }; | 52 | }; |
53 | 53 | ||
54 | /* | ||
55 | * get_can_dlc(value) - helper macro to cast a given data length code (dlc) | ||
56 | * to __u8 and ensure the dlc value to be max. 8 bytes. | ||
57 | * | ||
58 | * To be used in the CAN netdriver receive path to ensure conformance with | ||
59 | * ISO 11898-1 Chapter 8.4.2.3 (DLC field) | ||
60 | */ | ||
61 | #define get_can_dlc(i) (min_t(__u8, (i), 8)) | ||
62 | |||
54 | struct net_device *alloc_candev(int sizeof_priv, unsigned int echo_skb_max); | 63 | struct net_device *alloc_candev(int sizeof_priv, unsigned int echo_skb_max); |
55 | void free_candev(struct net_device *dev); | 64 | void free_candev(struct net_device *dev); |
56 | 65 | ||
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 5be3dab4a695..188fcae10a99 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
@@ -15,6 +15,7 @@ | |||
15 | # define __acquire(x) __context__(x,1) | 15 | # define __acquire(x) __context__(x,1) |
16 | # define __release(x) __context__(x,-1) | 16 | # define __release(x) __context__(x,-1) |
17 | # define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0) | 17 | # define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0) |
18 | # define __percpu __attribute__((noderef, address_space(3))) | ||
18 | extern void __chk_user_ptr(const volatile void __user *); | 19 | extern void __chk_user_ptr(const volatile void __user *); |
19 | extern void __chk_io_ptr(const volatile void __iomem *); | 20 | extern void __chk_io_ptr(const volatile void __iomem *); |
20 | #else | 21 | #else |
@@ -32,6 +33,7 @@ extern void __chk_io_ptr(const volatile void __iomem *); | |||
32 | # define __acquire(x) (void)0 | 33 | # define __acquire(x) (void)0 |
33 | # define __release(x) (void)0 | 34 | # define __release(x) (void)0 |
34 | # define __cond_lock(x,c) (c) | 35 | # define __cond_lock(x,c) (c) |
36 | # define __percpu | ||
35 | #endif | 37 | #endif |
36 | 38 | ||
37 | #ifdef __KERNEL__ | 39 | #ifdef __KERNEL__ |
diff --git a/include/linux/connector.h b/include/linux/connector.h index 72ba63eb83c5..3a779ffba60b 100644 --- a/include/linux/connector.h +++ b/include/linux/connector.h | |||
@@ -24,9 +24,6 @@ | |||
24 | 24 | ||
25 | #include <linux/types.h> | 25 | #include <linux/types.h> |
26 | 26 | ||
27 | #define CN_IDX_CONNECTOR 0xffffffff | ||
28 | #define CN_VAL_CONNECTOR 0xffffffff | ||
29 | |||
30 | /* | 27 | /* |
31 | * Process Events connector unique ids -- used for message routing | 28 | * Process Events connector unique ids -- used for message routing |
32 | */ | 29 | */ |
@@ -75,30 +72,6 @@ struct cn_msg { | |||
75 | __u8 data[0]; | 72 | __u8 data[0]; |
76 | }; | 73 | }; |
77 | 74 | ||
78 | /* | ||
79 | * Notify structure - requests notification about | ||
80 | * registering/unregistering idx/val in range [first, first+range]. | ||
81 | */ | ||
82 | struct cn_notify_req { | ||
83 | __u32 first; | ||
84 | __u32 range; | ||
85 | }; | ||
86 | |||
87 | /* | ||
88 | * Main notification control message | ||
89 | * *_notify_num - number of appropriate cn_notify_req structures after | ||
90 | * this struct. | ||
91 | * group - notification receiver's idx. | ||
92 | * len - total length of the attached data. | ||
93 | */ | ||
94 | struct cn_ctl_msg { | ||
95 | __u32 idx_notify_num; | ||
96 | __u32 val_notify_num; | ||
97 | __u32 group; | ||
98 | __u32 len; | ||
99 | __u8 data[0]; | ||
100 | }; | ||
101 | |||
102 | #ifdef __KERNEL__ | 75 | #ifdef __KERNEL__ |
103 | 76 | ||
104 | #include <asm/atomic.h> | 77 | #include <asm/atomic.h> |
@@ -151,11 +124,6 @@ struct cn_callback_entry { | |||
151 | u32 seq, group; | 124 | u32 seq, group; |
152 | }; | 125 | }; |
153 | 126 | ||
154 | struct cn_ctl_entry { | ||
155 | struct list_head notify_entry; | ||
156 | struct cn_ctl_msg *msg; | ||
157 | }; | ||
158 | |||
159 | struct cn_dev { | 127 | struct cn_dev { |
160 | struct cb_id id; | 128 | struct cb_id id; |
161 | 129 | ||
diff --git a/include/linux/decompress/mm.h b/include/linux/decompress/mm.h index 12ff8c3f1d05..5032b9a31ae7 100644 --- a/include/linux/decompress/mm.h +++ b/include/linux/decompress/mm.h | |||
@@ -25,7 +25,7 @@ static void *malloc(int size) | |||
25 | void *p; | 25 | void *p; |
26 | 26 | ||
27 | if (size < 0) | 27 | if (size < 0) |
28 | error("Malloc error"); | 28 | return NULL; |
29 | if (!malloc_ptr) | 29 | if (!malloc_ptr) |
30 | malloc_ptr = free_mem_ptr; | 30 | malloc_ptr = free_mem_ptr; |
31 | 31 | ||
@@ -35,7 +35,7 @@ static void *malloc(int size) | |||
35 | malloc_ptr += size; | 35 | malloc_ptr += size; |
36 | 36 | ||
37 | if (free_mem_end_ptr && malloc_ptr >= free_mem_end_ptr) | 37 | if (free_mem_end_ptr && malloc_ptr >= free_mem_end_ptr) |
38 | error("Out of memory"); | 38 | return NULL; |
39 | 39 | ||
40 | malloc_count++; | 40 | malloc_count++; |
41 | return p; | 41 | return p; |
diff --git a/include/linux/decompress/unlzo.h b/include/linux/decompress/unlzo.h new file mode 100644 index 000000000000..987229752519 --- /dev/null +++ b/include/linux/decompress/unlzo.h | |||
@@ -0,0 +1,10 @@ | |||
1 | #ifndef DECOMPRESS_UNLZO_H | ||
2 | #define DECOMPRESS_UNLZO_H | ||
3 | |||
4 | int unlzo(unsigned char *inbuf, int len, | ||
5 | int(*fill)(void*, unsigned int), | ||
6 | int(*flush)(void*, unsigned int), | ||
7 | unsigned char *output, | ||
8 | int *pos, | ||
9 | void(*error)(char *x)); | ||
10 | #endif | ||
diff --git a/include/linux/device.h b/include/linux/device.h index 2a73d9bcbc9c..a62799f2ab00 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -166,9 +166,9 @@ struct driver_attribute driver_attr_##_name = \ | |||
166 | __ATTR(_name, _mode, _show, _store) | 166 | __ATTR(_name, _mode, _show, _store) |
167 | 167 | ||
168 | extern int __must_check driver_create_file(struct device_driver *driver, | 168 | extern int __must_check driver_create_file(struct device_driver *driver, |
169 | struct driver_attribute *attr); | 169 | const struct driver_attribute *attr); |
170 | extern void driver_remove_file(struct device_driver *driver, | 170 | extern void driver_remove_file(struct device_driver *driver, |
171 | struct driver_attribute *attr); | 171 | const struct driver_attribute *attr); |
172 | 172 | ||
173 | extern int __must_check driver_add_kobj(struct device_driver *drv, | 173 | extern int __must_check driver_add_kobj(struct device_driver *drv, |
174 | struct kobject *kobj, | 174 | struct kobject *kobj, |
@@ -319,13 +319,13 @@ struct device_attribute { | |||
319 | struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store) | 319 | struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store) |
320 | 320 | ||
321 | extern int __must_check device_create_file(struct device *device, | 321 | extern int __must_check device_create_file(struct device *device, |
322 | struct device_attribute *entry); | 322 | const struct device_attribute *entry); |
323 | extern void device_remove_file(struct device *dev, | 323 | extern void device_remove_file(struct device *dev, |
324 | struct device_attribute *attr); | 324 | const struct device_attribute *attr); |
325 | extern int __must_check device_create_bin_file(struct device *dev, | 325 | extern int __must_check device_create_bin_file(struct device *dev, |
326 | struct bin_attribute *attr); | 326 | const struct bin_attribute *attr); |
327 | extern void device_remove_bin_file(struct device *dev, | 327 | extern void device_remove_bin_file(struct device *dev, |
328 | struct bin_attribute *attr); | 328 | const struct bin_attribute *attr); |
329 | extern int device_schedule_callback_owner(struct device *dev, | 329 | extern int device_schedule_callback_owner(struct device *dev, |
330 | void (*func)(struct device *dev), struct module *owner); | 330 | void (*func)(struct device *dev), struct module *owner); |
331 | 331 | ||
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 2b9f2ac7ed60..78784982b33e 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
@@ -74,7 +74,7 @@ enum dma_transaction_type { | |||
74 | * control completion, and communicate status. | 74 | * control completion, and communicate status. |
75 | * @DMA_PREP_INTERRUPT - trigger an interrupt (callback) upon completion of | 75 | * @DMA_PREP_INTERRUPT - trigger an interrupt (callback) upon completion of |
76 | * this transaction | 76 | * this transaction |
77 | * @DMA_CTRL_ACK - the descriptor cannot be reused until the client | 77 | * @DMA_CTRL_ACK - if clear, the descriptor cannot be reused until the client |
78 | * acknowledges receipt, i.e. has has a chance to establish any dependency | 78 | * acknowledges receipt, i.e. has has a chance to establish any dependency |
79 | * chains | 79 | * chains |
80 | * @DMA_COMPL_SKIP_SRC_UNMAP - set to disable dma-unmapping the source buffer(s) | 80 | * @DMA_COMPL_SKIP_SRC_UNMAP - set to disable dma-unmapping the source buffer(s) |
diff --git a/include/linux/drbd.h b/include/linux/drbd.h index e84f4733cb55..78962272338a 100644 --- a/include/linux/drbd.h +++ b/include/linux/drbd.h | |||
@@ -53,7 +53,7 @@ | |||
53 | 53 | ||
54 | 54 | ||
55 | extern const char *drbd_buildtag(void); | 55 | extern const char *drbd_buildtag(void); |
56 | #define REL_VERSION "8.3.6" | 56 | #define REL_VERSION "8.3.7" |
57 | #define API_VERSION 88 | 57 | #define API_VERSION 88 |
58 | #define PRO_VERSION_MIN 86 | 58 | #define PRO_VERSION_MIN 86 |
59 | #define PRO_VERSION_MAX 91 | 59 | #define PRO_VERSION_MAX 91 |
diff --git a/include/linux/drbd_nl.h b/include/linux/drbd_nl.h index db5721ad50d1..a4d82f895994 100644 --- a/include/linux/drbd_nl.h +++ b/include/linux/drbd_nl.h | |||
@@ -69,6 +69,7 @@ NL_PACKET(disconnect, 6, ) | |||
69 | 69 | ||
70 | NL_PACKET(resize, 7, | 70 | NL_PACKET(resize, 7, |
71 | NL_INT64( 29, T_MAY_IGNORE, resize_size) | 71 | NL_INT64( 29, T_MAY_IGNORE, resize_size) |
72 | NL_BIT( 68, T_MAY_IGNORE, resize_force) | ||
72 | ) | 73 | ) |
73 | 74 | ||
74 | NL_PACKET(syncer_conf, 8, | 75 | NL_PACKET(syncer_conf, 8, |
diff --git a/include/linux/dst.h b/include/linux/dst.h deleted file mode 100644 index e26fed84b1aa..000000000000 --- a/include/linux/dst.h +++ /dev/null | |||
@@ -1,587 +0,0 @@ | |||
1 | /* | ||
2 | * 2007+ Copyright (c) Evgeniy Polyakov <johnpol@2ka.mipt.ru> | ||
3 | * All rights reserved. | ||
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 as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | */ | ||
15 | |||
16 | #ifndef __DST_H | ||
17 | #define __DST_H | ||
18 | |||
19 | #include <linux/types.h> | ||
20 | #include <linux/connector.h> | ||
21 | |||
22 | #define DST_NAMELEN 32 | ||
23 | #define DST_NAME "dst" | ||
24 | |||
25 | enum { | ||
26 | /* Remove node with given id from storage */ | ||
27 | DST_DEL_NODE = 0, | ||
28 | /* Add remote node with given id to the storage */ | ||
29 | DST_ADD_REMOTE, | ||
30 | /* Add local node with given id to the storage to be exported and used by remote peers */ | ||
31 | DST_ADD_EXPORT, | ||
32 | /* Crypto initialization command (hash/cipher used to protect the connection) */ | ||
33 | DST_CRYPTO, | ||
34 | /* Security attributes for given connection (permissions for example) */ | ||
35 | DST_SECURITY, | ||
36 | /* Register given node in the block layer subsystem */ | ||
37 | DST_START, | ||
38 | DST_CMD_MAX | ||
39 | }; | ||
40 | |||
41 | struct dst_ctl | ||
42 | { | ||
43 | /* Storage name */ | ||
44 | char name[DST_NAMELEN]; | ||
45 | /* Command flags */ | ||
46 | __u32 flags; | ||
47 | /* Command itself (see above) */ | ||
48 | __u32 cmd; | ||
49 | /* Maximum number of pages per single request in this device */ | ||
50 | __u32 max_pages; | ||
51 | /* Stale/error transaction scanning timeout in milliseconds */ | ||
52 | __u32 trans_scan_timeout; | ||
53 | /* Maximum number of retry sends before completing transaction as broken */ | ||
54 | __u32 trans_max_retries; | ||
55 | /* Storage size */ | ||
56 | __u64 size; | ||
57 | }; | ||
58 | |||
59 | /* Reply command carries completion status */ | ||
60 | struct dst_ctl_ack | ||
61 | { | ||
62 | struct cn_msg msg; | ||
63 | int error; | ||
64 | int unused[3]; | ||
65 | }; | ||
66 | |||
67 | /* | ||
68 | * Unfortunaltely socket address structure is not exported to userspace | ||
69 | * and is redefined there. | ||
70 | */ | ||
71 | #define SADDR_MAX_DATA 128 | ||
72 | |||
73 | struct saddr { | ||
74 | /* address family, AF_xxx */ | ||
75 | unsigned short sa_family; | ||
76 | /* 14 bytes of protocol address */ | ||
77 | char sa_data[SADDR_MAX_DATA]; | ||
78 | /* Number of bytes used in sa_data */ | ||
79 | unsigned short sa_data_len; | ||
80 | }; | ||
81 | |||
82 | /* Address structure */ | ||
83 | struct dst_network_ctl | ||
84 | { | ||
85 | /* Socket type: datagram, stream...*/ | ||
86 | unsigned int type; | ||
87 | /* Let me guess, is it a Jupiter diameter? */ | ||
88 | unsigned int proto; | ||
89 | /* Peer's address */ | ||
90 | struct saddr addr; | ||
91 | }; | ||
92 | |||
93 | struct dst_crypto_ctl | ||
94 | { | ||
95 | /* Cipher and hash names */ | ||
96 | char cipher_algo[DST_NAMELEN]; | ||
97 | char hash_algo[DST_NAMELEN]; | ||
98 | |||
99 | /* Key sizes. Can be zero for digest for example */ | ||
100 | unsigned int cipher_keysize, hash_keysize; | ||
101 | /* Alignment. Calculated by the DST itself. */ | ||
102 | unsigned int crypto_attached_size; | ||
103 | /* Number of threads to perform crypto operations */ | ||
104 | int thread_num; | ||
105 | }; | ||
106 | |||
107 | /* Export security attributes have this bits checked in when client connects */ | ||
108 | #define DST_PERM_READ (1<<0) | ||
109 | #define DST_PERM_WRITE (1<<1) | ||
110 | |||
111 | /* | ||
112 | * Right now it is simple model, where each remote address | ||
113 | * is assigned to set of permissions it is allowed to perform. | ||
114 | * In real world block device does not know anything but | ||
115 | * reading and writing, so it should be more than enough. | ||
116 | */ | ||
117 | struct dst_secure_user | ||
118 | { | ||
119 | unsigned int permissions; | ||
120 | struct saddr addr; | ||
121 | }; | ||
122 | |||
123 | /* | ||
124 | * Export control command: device to export and network address to accept | ||
125 | * clients to work with given device | ||
126 | */ | ||
127 | struct dst_export_ctl | ||
128 | { | ||
129 | char device[DST_NAMELEN]; | ||
130 | struct dst_network_ctl ctl; | ||
131 | }; | ||
132 | |||
133 | enum { | ||
134 | DST_CFG = 1, /* Request remote configuration */ | ||
135 | DST_IO, /* IO command */ | ||
136 | DST_IO_RESPONSE, /* IO response */ | ||
137 | DST_PING, /* Keepalive message */ | ||
138 | DST_NCMD_MAX, | ||
139 | }; | ||
140 | |||
141 | struct dst_cmd | ||
142 | { | ||
143 | /* Network command itself, see above */ | ||
144 | __u32 cmd; | ||
145 | /* | ||
146 | * Size of the attached data | ||
147 | * (in most cases, for READ command it means how many bytes were requested) | ||
148 | */ | ||
149 | __u32 size; | ||
150 | /* Crypto size: number of attached bytes with digest/hmac */ | ||
151 | __u32 csize; | ||
152 | /* Here we can carry secret data */ | ||
153 | __u32 reserved; | ||
154 | /* Read/write bits, see how they are encoded in bio structure */ | ||
155 | __u64 rw; | ||
156 | /* BIO flags */ | ||
157 | __u64 flags; | ||
158 | /* Unique command id (like transaction ID) */ | ||
159 | __u64 id; | ||
160 | /* Sector to start IO from */ | ||
161 | __u64 sector; | ||
162 | /* Hash data is placed after this header */ | ||
163 | __u8 hash[0]; | ||
164 | }; | ||
165 | |||
166 | /* | ||
167 | * Convert command to/from network byte order. | ||
168 | * We do not use hton*() functions, since there is | ||
169 | * no 64-bit implementation. | ||
170 | */ | ||
171 | static inline void dst_convert_cmd(struct dst_cmd *c) | ||
172 | { | ||
173 | c->cmd = __cpu_to_be32(c->cmd); | ||
174 | c->csize = __cpu_to_be32(c->csize); | ||
175 | c->size = __cpu_to_be32(c->size); | ||
176 | c->sector = __cpu_to_be64(c->sector); | ||
177 | c->id = __cpu_to_be64(c->id); | ||
178 | c->flags = __cpu_to_be64(c->flags); | ||
179 | c->rw = __cpu_to_be64(c->rw); | ||
180 | } | ||
181 | |||
182 | /* Transaction id */ | ||
183 | typedef __u64 dst_gen_t; | ||
184 | |||
185 | #ifdef __KERNEL__ | ||
186 | |||
187 | #include <linux/blkdev.h> | ||
188 | #include <linux/bio.h> | ||
189 | #include <linux/device.h> | ||
190 | #include <linux/mempool.h> | ||
191 | #include <linux/net.h> | ||
192 | #include <linux/poll.h> | ||
193 | #include <linux/rbtree.h> | ||
194 | |||
195 | #ifdef CONFIG_DST_DEBUG | ||
196 | #define dprintk(f, a...) printk(KERN_NOTICE f, ##a) | ||
197 | #else | ||
198 | static inline void __attribute__ ((format (printf, 1, 2))) | ||
199 | dprintk(const char *fmt, ...) {} | ||
200 | #endif | ||
201 | |||
202 | struct dst_node; | ||
203 | |||
204 | struct dst_trans | ||
205 | { | ||
206 | /* DST node we are working with */ | ||
207 | struct dst_node *n; | ||
208 | |||
209 | /* Entry inside transaction tree */ | ||
210 | struct rb_node trans_entry; | ||
211 | |||
212 | /* Merlin kills this transaction when this memory cell equals zero */ | ||
213 | atomic_t refcnt; | ||
214 | |||
215 | /* How this transaction should be processed by crypto engine */ | ||
216 | short enc; | ||
217 | /* How many times this transaction was resent */ | ||
218 | short retries; | ||
219 | /* Completion status */ | ||
220 | int error; | ||
221 | |||
222 | /* When did we send it to the remote peer */ | ||
223 | long send_time; | ||
224 | |||
225 | /* My name is... | ||
226 | * Well, computers does not speak, they have unique id instead */ | ||
227 | dst_gen_t gen; | ||
228 | |||
229 | /* Block IO we are working with */ | ||
230 | struct bio *bio; | ||
231 | |||
232 | /* Network command for above block IO request */ | ||
233 | struct dst_cmd cmd; | ||
234 | }; | ||
235 | |||
236 | struct dst_crypto_engine | ||
237 | { | ||
238 | /* What should we do with all block requests */ | ||
239 | struct crypto_hash *hash; | ||
240 | struct crypto_ablkcipher *cipher; | ||
241 | |||
242 | /* Pool of pages used to encrypt data into before sending */ | ||
243 | int page_num; | ||
244 | struct page **pages; | ||
245 | |||
246 | /* What to do with current request */ | ||
247 | int enc; | ||
248 | /* Who we are and where do we go */ | ||
249 | struct scatterlist *src, *dst; | ||
250 | |||
251 | /* Maximum timeout waiting for encryption to be completed */ | ||
252 | long timeout; | ||
253 | /* IV is a 64-bit sequential counter */ | ||
254 | u64 iv; | ||
255 | |||
256 | /* Secret data */ | ||
257 | void *private; | ||
258 | |||
259 | /* Cached temporary data lives here */ | ||
260 | int size; | ||
261 | void *data; | ||
262 | }; | ||
263 | |||
264 | struct dst_state | ||
265 | { | ||
266 | /* The main state protection */ | ||
267 | struct mutex state_lock; | ||
268 | |||
269 | /* Polling machinery for sockets */ | ||
270 | wait_queue_t wait; | ||
271 | wait_queue_head_t *whead; | ||
272 | /* Most of events are being waited here */ | ||
273 | wait_queue_head_t thread_wait; | ||
274 | |||
275 | /* Who owns this? */ | ||
276 | struct dst_node *node; | ||
277 | |||
278 | /* Network address for this state */ | ||
279 | struct dst_network_ctl ctl; | ||
280 | |||
281 | /* Permissions to work with: read-only or rw connection */ | ||
282 | u32 permissions; | ||
283 | |||
284 | /* Called when we need to clean private data */ | ||
285 | void (* cleanup)(struct dst_state *st); | ||
286 | |||
287 | /* Used by the server: BIO completion queues BIOs here */ | ||
288 | struct list_head request_list; | ||
289 | spinlock_t request_lock; | ||
290 | |||
291 | /* Guess what? No, it is not number of planets */ | ||
292 | atomic_t refcnt; | ||
293 | |||
294 | /* This flags is set when connection should be dropped */ | ||
295 | int need_exit; | ||
296 | |||
297 | /* | ||
298 | * Socket to work with. Second pointer is used for | ||
299 | * lockless check if socket was changed before performing | ||
300 | * next action (like working with cached polling result) | ||
301 | */ | ||
302 | struct socket *socket, *read_socket; | ||
303 | |||
304 | /* Cached preallocated data */ | ||
305 | void *data; | ||
306 | unsigned int size; | ||
307 | |||
308 | /* Currently processed command */ | ||
309 | struct dst_cmd cmd; | ||
310 | }; | ||
311 | |||
312 | struct dst_info | ||
313 | { | ||
314 | /* Device size */ | ||
315 | u64 size; | ||
316 | |||
317 | /* Local device name for export devices */ | ||
318 | char local[DST_NAMELEN]; | ||
319 | |||
320 | /* Network setup */ | ||
321 | struct dst_network_ctl net; | ||
322 | |||
323 | /* Sysfs bits use this */ | ||
324 | struct device device; | ||
325 | }; | ||
326 | |||
327 | struct dst_node | ||
328 | { | ||
329 | struct list_head node_entry; | ||
330 | |||
331 | /* Hi, my name is stored here */ | ||
332 | char name[DST_NAMELEN]; | ||
333 | /* My cache name is stored here */ | ||
334 | char cache_name[DST_NAMELEN]; | ||
335 | |||
336 | /* Block device attached to given node. | ||
337 | * Only valid for exporting nodes */ | ||
338 | struct block_device *bdev; | ||
339 | /* Network state machine for given peer */ | ||
340 | struct dst_state *state; | ||
341 | |||
342 | /* Block IO machinery */ | ||
343 | struct request_queue *queue; | ||
344 | struct gendisk *disk; | ||
345 | |||
346 | /* Number of threads in processing pool */ | ||
347 | int thread_num; | ||
348 | /* Maximum number of pages in single IO */ | ||
349 | int max_pages; | ||
350 | |||
351 | /* I'm that big in bytes */ | ||
352 | loff_t size; | ||
353 | |||
354 | /* Exported to userspace node information */ | ||
355 | struct dst_info *info; | ||
356 | |||
357 | /* | ||
358 | * Security attribute list. | ||
359 | * Used only by exporting node currently. | ||
360 | */ | ||
361 | struct list_head security_list; | ||
362 | struct mutex security_lock; | ||
363 | |||
364 | /* | ||
365 | * When this unerflows below zero, university collapses. | ||
366 | * But this will not happen, since node will be freed, | ||
367 | * when reference counter reaches zero. | ||
368 | */ | ||
369 | atomic_t refcnt; | ||
370 | |||
371 | /* How precisely should I be started? */ | ||
372 | int (*start)(struct dst_node *); | ||
373 | |||
374 | /* Crypto capabilities */ | ||
375 | struct dst_crypto_ctl crypto; | ||
376 | u8 *hash_key; | ||
377 | u8 *cipher_key; | ||
378 | |||
379 | /* Pool of processing thread */ | ||
380 | struct thread_pool *pool; | ||
381 | |||
382 | /* Transaction IDs live here */ | ||
383 | atomic_long_t gen; | ||
384 | |||
385 | /* | ||
386 | * How frequently and how many times transaction | ||
387 | * tree should be scanned to drop stale objects. | ||
388 | */ | ||
389 | long trans_scan_timeout; | ||
390 | int trans_max_retries; | ||
391 | |||
392 | /* Small gnomes live here */ | ||
393 | struct rb_root trans_root; | ||
394 | struct mutex trans_lock; | ||
395 | |||
396 | /* | ||
397 | * Transaction cache/memory pool. | ||
398 | * It is big enough to contain not only transaction | ||
399 | * itself, but additional crypto data (digest/hmac). | ||
400 | */ | ||
401 | struct kmem_cache *trans_cache; | ||
402 | mempool_t *trans_pool; | ||
403 | |||
404 | /* This entity scans transaction tree */ | ||
405 | struct delayed_work trans_work; | ||
406 | |||
407 | wait_queue_head_t wait; | ||
408 | }; | ||
409 | |||
410 | /* Kernel representation of the security attribute */ | ||
411 | struct dst_secure | ||
412 | { | ||
413 | struct list_head sec_entry; | ||
414 | struct dst_secure_user sec; | ||
415 | }; | ||
416 | |||
417 | int dst_process_bio(struct dst_node *n, struct bio *bio); | ||
418 | |||
419 | int dst_node_init_connected(struct dst_node *n, struct dst_network_ctl *r); | ||
420 | int dst_node_init_listened(struct dst_node *n, struct dst_export_ctl *le); | ||
421 | |||
422 | static inline struct dst_state *dst_state_get(struct dst_state *st) | ||
423 | { | ||
424 | BUG_ON(atomic_read(&st->refcnt) == 0); | ||
425 | atomic_inc(&st->refcnt); | ||
426 | return st; | ||
427 | } | ||
428 | |||
429 | void dst_state_put(struct dst_state *st); | ||
430 | |||
431 | struct dst_state *dst_state_alloc(struct dst_node *n); | ||
432 | int dst_state_socket_create(struct dst_state *st); | ||
433 | void dst_state_socket_release(struct dst_state *st); | ||
434 | |||
435 | void dst_state_exit_connected(struct dst_state *st); | ||
436 | |||
437 | int dst_state_schedule_receiver(struct dst_state *st); | ||
438 | |||
439 | void dst_dump_addr(struct socket *sk, struct sockaddr *sa, char *str); | ||
440 | |||
441 | static inline void dst_state_lock(struct dst_state *st) | ||
442 | { | ||
443 | mutex_lock(&st->state_lock); | ||
444 | } | ||
445 | |||
446 | static inline void dst_state_unlock(struct dst_state *st) | ||
447 | { | ||
448 | mutex_unlock(&st->state_lock); | ||
449 | } | ||
450 | |||
451 | void dst_poll_exit(struct dst_state *st); | ||
452 | int dst_poll_init(struct dst_state *st); | ||
453 | |||
454 | static inline unsigned int dst_state_poll(struct dst_state *st) | ||
455 | { | ||
456 | unsigned int revents = POLLHUP | POLLERR; | ||
457 | |||
458 | dst_state_lock(st); | ||
459 | if (st->socket) | ||
460 | revents = st->socket->ops->poll(NULL, st->socket, NULL); | ||
461 | dst_state_unlock(st); | ||
462 | |||
463 | return revents; | ||
464 | } | ||
465 | |||
466 | static inline int dst_thread_setup(void *private, void *data) | ||
467 | { | ||
468 | return 0; | ||
469 | } | ||
470 | |||
471 | void dst_node_put(struct dst_node *n); | ||
472 | |||
473 | static inline struct dst_node *dst_node_get(struct dst_node *n) | ||
474 | { | ||
475 | atomic_inc(&n->refcnt); | ||
476 | return n; | ||
477 | } | ||
478 | |||
479 | int dst_data_recv(struct dst_state *st, void *data, unsigned int size); | ||
480 | int dst_recv_cdata(struct dst_state *st, void *cdata); | ||
481 | int dst_data_send_header(struct socket *sock, | ||
482 | void *data, unsigned int size, int more); | ||
483 | |||
484 | int dst_send_bio(struct dst_state *st, struct dst_cmd *cmd, struct bio *bio); | ||
485 | |||
486 | int dst_process_io(struct dst_state *st); | ||
487 | int dst_export_crypto(struct dst_node *n, struct bio *bio); | ||
488 | int dst_export_send_bio(struct bio *bio); | ||
489 | int dst_start_export(struct dst_node *n); | ||
490 | |||
491 | int __init dst_export_init(void); | ||
492 | void dst_export_exit(void); | ||
493 | |||
494 | /* Private structure for export block IO requests */ | ||
495 | struct dst_export_priv | ||
496 | { | ||
497 | struct list_head request_entry; | ||
498 | struct dst_state *state; | ||
499 | struct bio *bio; | ||
500 | struct dst_cmd cmd; | ||
501 | }; | ||
502 | |||
503 | static inline void dst_trans_get(struct dst_trans *t) | ||
504 | { | ||
505 | atomic_inc(&t->refcnt); | ||
506 | } | ||
507 | |||
508 | struct dst_trans *dst_trans_search(struct dst_node *node, dst_gen_t gen); | ||
509 | int dst_trans_remove(struct dst_trans *t); | ||
510 | int dst_trans_remove_nolock(struct dst_trans *t); | ||
511 | void dst_trans_put(struct dst_trans *t); | ||
512 | |||
513 | /* | ||
514 | * Convert bio into network command. | ||
515 | */ | ||
516 | static inline void dst_bio_to_cmd(struct bio *bio, struct dst_cmd *cmd, | ||
517 | u32 command, u64 id) | ||
518 | { | ||
519 | cmd->cmd = command; | ||
520 | cmd->flags = (bio->bi_flags << BIO_POOL_BITS) >> BIO_POOL_BITS; | ||
521 | cmd->rw = bio->bi_rw; | ||
522 | cmd->size = bio->bi_size; | ||
523 | cmd->csize = 0; | ||
524 | cmd->id = id; | ||
525 | cmd->sector = bio->bi_sector; | ||
526 | }; | ||
527 | |||
528 | int dst_trans_send(struct dst_trans *t); | ||
529 | int dst_trans_crypto(struct dst_trans *t); | ||
530 | |||
531 | int dst_node_crypto_init(struct dst_node *n, struct dst_crypto_ctl *ctl); | ||
532 | void dst_node_crypto_exit(struct dst_node *n); | ||
533 | |||
534 | static inline int dst_need_crypto(struct dst_node *n) | ||
535 | { | ||
536 | struct dst_crypto_ctl *c = &n->crypto; | ||
537 | /* | ||
538 | * Logical OR is appropriate here, but boolean one produces | ||
539 | * more optimal code, so it is used instead. | ||
540 | */ | ||
541 | return (c->hash_algo[0] | c->cipher_algo[0]); | ||
542 | } | ||
543 | |||
544 | int dst_node_trans_init(struct dst_node *n, unsigned int size); | ||
545 | void dst_node_trans_exit(struct dst_node *n); | ||
546 | |||
547 | /* | ||
548 | * Pool of threads. | ||
549 | * Ready list contains threads currently free to be used, | ||
550 | * active one contains threads with some work scheduled for them. | ||
551 | * Caller can wait in given queue when thread is ready. | ||
552 | */ | ||
553 | struct thread_pool | ||
554 | { | ||
555 | int thread_num; | ||
556 | struct mutex thread_lock; | ||
557 | struct list_head ready_list, active_list; | ||
558 | |||
559 | wait_queue_head_t wait; | ||
560 | }; | ||
561 | |||
562 | void thread_pool_del_worker(struct thread_pool *p); | ||
563 | void thread_pool_del_worker_id(struct thread_pool *p, unsigned int id); | ||
564 | int thread_pool_add_worker(struct thread_pool *p, | ||
565 | char *name, | ||
566 | unsigned int id, | ||
567 | void *(* init)(void *data), | ||
568 | void (* cleanup)(void *data), | ||
569 | void *data); | ||
570 | |||
571 | void thread_pool_destroy(struct thread_pool *p); | ||
572 | struct thread_pool *thread_pool_create(int num, char *name, | ||
573 | void *(* init)(void *data), | ||
574 | void (* cleanup)(void *data), | ||
575 | void *data); | ||
576 | |||
577 | int thread_pool_schedule(struct thread_pool *p, | ||
578 | int (* setup)(void *stored_private, void *setup_data), | ||
579 | int (* action)(void *stored_private, void *setup_data), | ||
580 | void *setup_data, long timeout); | ||
581 | int thread_pool_schedule_private(struct thread_pool *p, | ||
582 | int (* setup)(void *private, void *data), | ||
583 | int (* action)(void *private, void *data), | ||
584 | void *data, long timeout, void *id); | ||
585 | |||
586 | #endif /* __KERNEL__ */ | ||
587 | #endif /* __DST_H */ | ||
diff --git a/include/linux/elf.h b/include/linux/elf.h index 90a4ed0ea0e5..0cc4d55151b7 100644 --- a/include/linux/elf.h +++ b/include/linux/elf.h | |||
@@ -361,7 +361,7 @@ typedef struct elf64_shdr { | |||
361 | #define NT_PPC_VSX 0x102 /* PowerPC VSX registers */ | 361 | #define NT_PPC_VSX 0x102 /* PowerPC VSX registers */ |
362 | #define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */ | 362 | #define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */ |
363 | #define NT_386_IOPERM 0x201 /* x86 io permission bitmap (1=deny) */ | 363 | #define NT_386_IOPERM 0x201 /* x86 io permission bitmap (1=deny) */ |
364 | #define NT_PRXSTATUS 0x300 /* s390 upper register halves */ | 364 | #define NT_S390_HIGH_GPRS 0x300 /* s390 upper register halves */ |
365 | 365 | ||
366 | 366 | ||
367 | /* Note header in a PT_NOTE section */ | 367 | /* Note header in a PT_NOTE section */ |
diff --git a/include/linux/enclosure.h b/include/linux/enclosure.h index 90d1c2184112..9a33c5f7e126 100644 --- a/include/linux/enclosure.h +++ b/include/linux/enclosure.h | |||
@@ -42,6 +42,8 @@ enum enclosure_status { | |||
42 | ENCLOSURE_STATUS_NOT_INSTALLED, | 42 | ENCLOSURE_STATUS_NOT_INSTALLED, |
43 | ENCLOSURE_STATUS_UNKNOWN, | 43 | ENCLOSURE_STATUS_UNKNOWN, |
44 | ENCLOSURE_STATUS_UNAVAILABLE, | 44 | ENCLOSURE_STATUS_UNAVAILABLE, |
45 | /* last element for counting purposes */ | ||
46 | ENCLOSURE_STATUS_MAX | ||
45 | }; | 47 | }; |
46 | 48 | ||
47 | /* SFF-8485 activity light settings */ | 49 | /* SFF-8485 activity light settings */ |
diff --git a/include/linux/eventfd.h b/include/linux/eventfd.h index 94dd10366a78..91bb4f27238c 100644 --- a/include/linux/eventfd.h +++ b/include/linux/eventfd.h | |||
@@ -10,6 +10,7 @@ | |||
10 | 10 | ||
11 | #include <linux/fcntl.h> | 11 | #include <linux/fcntl.h> |
12 | #include <linux/file.h> | 12 | #include <linux/file.h> |
13 | #include <linux/wait.h> | ||
13 | 14 | ||
14 | /* | 15 | /* |
15 | * CAREFUL: Check include/asm-generic/fcntl.h when defining | 16 | * CAREFUL: Check include/asm-generic/fcntl.h when defining |
@@ -34,6 +35,9 @@ struct file *eventfd_fget(int fd); | |||
34 | struct eventfd_ctx *eventfd_ctx_fdget(int fd); | 35 | struct eventfd_ctx *eventfd_ctx_fdget(int fd); |
35 | struct eventfd_ctx *eventfd_ctx_fileget(struct file *file); | 36 | struct eventfd_ctx *eventfd_ctx_fileget(struct file *file); |
36 | int eventfd_signal(struct eventfd_ctx *ctx, int n); | 37 | int eventfd_signal(struct eventfd_ctx *ctx, int n); |
38 | ssize_t eventfd_ctx_read(struct eventfd_ctx *ctx, int no_wait, __u64 *cnt); | ||
39 | int eventfd_ctx_remove_wait_queue(struct eventfd_ctx *ctx, wait_queue_t *wait, | ||
40 | __u64 *cnt); | ||
37 | 41 | ||
38 | #else /* CONFIG_EVENTFD */ | 42 | #else /* CONFIG_EVENTFD */ |
39 | 43 | ||
@@ -61,6 +65,18 @@ static inline void eventfd_ctx_put(struct eventfd_ctx *ctx) | |||
61 | 65 | ||
62 | } | 66 | } |
63 | 67 | ||
68 | static inline ssize_t eventfd_ctx_read(struct eventfd_ctx *ctx, int no_wait, | ||
69 | __u64 *cnt) | ||
70 | { | ||
71 | return -ENOSYS; | ||
72 | } | ||
73 | |||
74 | static inline int eventfd_ctx_remove_wait_queue(struct eventfd_ctx *ctx, | ||
75 | wait_queue_t *wait, __u64 *cnt) | ||
76 | { | ||
77 | return -ENOSYS; | ||
78 | } | ||
79 | |||
64 | #endif | 80 | #endif |
65 | 81 | ||
66 | #endif /* _LINUX_EVENTFD_H */ | 82 | #endif /* _LINUX_EVENTFD_H */ |
diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h index 27e772cefb6a..dc12f416a49f 100644 --- a/include/linux/exportfs.h +++ b/include/linux/exportfs.h | |||
@@ -97,7 +97,7 @@ struct fid { | |||
97 | * @get_name: find the name for a given inode in a given directory | 97 | * @get_name: find the name for a given inode in a given directory |
98 | * @get_parent: find the parent of a given directory | 98 | * @get_parent: find the parent of a given directory |
99 | * | 99 | * |
100 | * See Documentation/filesystems/Exporting for details on how to use | 100 | * See Documentation/filesystems/nfs/Exporting for details on how to use |
101 | * this interface correctly. | 101 | * this interface correctly. |
102 | * | 102 | * |
103 | * encode_fh: | 103 | * encode_fh: |
diff --git a/include/linux/ext3_fs_sb.h b/include/linux/ext3_fs_sb.h index f07f34de2f0e..258088ab3c6b 100644 --- a/include/linux/ext3_fs_sb.h +++ b/include/linux/ext3_fs_sb.h | |||
@@ -72,6 +72,8 @@ struct ext3_sb_info { | |||
72 | struct inode * s_journal_inode; | 72 | struct inode * s_journal_inode; |
73 | struct journal_s * s_journal; | 73 | struct journal_s * s_journal; |
74 | struct list_head s_orphan; | 74 | struct list_head s_orphan; |
75 | struct mutex s_orphan_lock; | ||
76 | struct mutex s_resize_lock; | ||
75 | unsigned long s_commit_interval; | 77 | unsigned long s_commit_interval; |
76 | struct block_device *journal_bdev; | 78 | struct block_device *journal_bdev; |
77 | #ifdef CONFIG_JBD_DEBUG | 79 | #ifdef CONFIG_JBD_DEBUG |
diff --git a/include/linux/ext3_jbd.h b/include/linux/ext3_jbd.h index cf82d519be40..d7b5ddca99c2 100644 --- a/include/linux/ext3_jbd.h +++ b/include/linux/ext3_jbd.h | |||
@@ -44,13 +44,13 @@ | |||
44 | 44 | ||
45 | #define EXT3_DATA_TRANS_BLOCKS(sb) (EXT3_SINGLEDATA_TRANS_BLOCKS + \ | 45 | #define EXT3_DATA_TRANS_BLOCKS(sb) (EXT3_SINGLEDATA_TRANS_BLOCKS + \ |
46 | EXT3_XATTR_TRANS_BLOCKS - 2 + \ | 46 | EXT3_XATTR_TRANS_BLOCKS - 2 + \ |
47 | 2*EXT3_QUOTA_TRANS_BLOCKS(sb)) | 47 | EXT3_MAXQUOTAS_TRANS_BLOCKS(sb)) |
48 | 48 | ||
49 | /* Delete operations potentially hit one directory's namespace plus an | 49 | /* Delete operations potentially hit one directory's namespace plus an |
50 | * entire inode, plus arbitrary amounts of bitmap/indirection data. Be | 50 | * entire inode, plus arbitrary amounts of bitmap/indirection data. Be |
51 | * generous. We can grow the delete transaction later if necessary. */ | 51 | * generous. We can grow the delete transaction later if necessary. */ |
52 | 52 | ||
53 | #define EXT3_DELETE_TRANS_BLOCKS(sb) (2 * EXT3_DATA_TRANS_BLOCKS(sb) + 64) | 53 | #define EXT3_DELETE_TRANS_BLOCKS(sb) (EXT3_MAXQUOTAS_TRANS_BLOCKS(sb) + 64) |
54 | 54 | ||
55 | /* Define an arbitrary limit for the amount of data we will anticipate | 55 | /* Define an arbitrary limit for the amount of data we will anticipate |
56 | * writing to any given transaction. For unbounded transactions such as | 56 | * writing to any given transaction. For unbounded transactions such as |
@@ -86,6 +86,9 @@ | |||
86 | #define EXT3_QUOTA_INIT_BLOCKS(sb) 0 | 86 | #define EXT3_QUOTA_INIT_BLOCKS(sb) 0 |
87 | #define EXT3_QUOTA_DEL_BLOCKS(sb) 0 | 87 | #define EXT3_QUOTA_DEL_BLOCKS(sb) 0 |
88 | #endif | 88 | #endif |
89 | #define EXT3_MAXQUOTAS_TRANS_BLOCKS(sb) (MAXQUOTAS*EXT3_QUOTA_TRANS_BLOCKS(sb)) | ||
90 | #define EXT3_MAXQUOTAS_INIT_BLOCKS(sb) (MAXQUOTAS*EXT3_QUOTA_INIT_BLOCKS(sb)) | ||
91 | #define EXT3_MAXQUOTAS_DEL_BLOCKS(sb) (MAXQUOTAS*EXT3_QUOTA_DEL_BLOCKS(sb)) | ||
89 | 92 | ||
90 | int | 93 | int |
91 | ext3_mark_iloc_dirty(handle_t *handle, | 94 | ext3_mark_iloc_dirty(handle_t *handle, |
diff --git a/include/linux/fiemap.h b/include/linux/fiemap.h index 934e22d65801..d830747f5c0b 100644 --- a/include/linux/fiemap.h +++ b/include/linux/fiemap.h | |||
@@ -62,5 +62,7 @@ struct fiemap { | |||
62 | #define FIEMAP_EXTENT_MERGED 0x00001000 /* File does not natively | 62 | #define FIEMAP_EXTENT_MERGED 0x00001000 /* File does not natively |
63 | * support extents. Result | 63 | * support extents. Result |
64 | * merged for efficiency. */ | 64 | * merged for efficiency. */ |
65 | #define FIEMAP_EXTENT_SHARED 0x00002000 /* Space shared with other | ||
66 | * files. */ | ||
65 | 67 | ||
66 | #endif /* _LINUX_FIEMAP_H */ | 68 | #endif /* _LINUX_FIEMAP_H */ |
diff --git a/include/linux/file.h b/include/linux/file.h index 335a0a5c316e..5555508fd517 100644 --- a/include/linux/file.h +++ b/include/linux/file.h | |||
@@ -18,11 +18,9 @@ extern void drop_file_write_access(struct file *file); | |||
18 | struct file_operations; | 18 | struct file_operations; |
19 | struct vfsmount; | 19 | struct vfsmount; |
20 | struct dentry; | 20 | struct dentry; |
21 | extern int init_file(struct file *, struct vfsmount *mnt, | 21 | struct path; |
22 | struct dentry *dentry, fmode_t mode, | 22 | extern struct file *alloc_file(struct path *, fmode_t mode, |
23 | const struct file_operations *fop); | 23 | const struct file_operations *fop); |
24 | extern struct file *alloc_file(struct vfsmount *, struct dentry *dentry, | ||
25 | fmode_t mode, const struct file_operations *fop); | ||
26 | 24 | ||
27 | static inline void fput_light(struct file *file, int fput_needed) | 25 | static inline void fput_light(struct file *file, int fput_needed) |
28 | { | 26 | { |
diff --git a/include/linux/firewire-cdev.h b/include/linux/firewire-cdev.h index c6b3ca3af6df..520ecf86cbb3 100644 --- a/include/linux/firewire-cdev.h +++ b/include/linux/firewire-cdev.h | |||
@@ -340,6 +340,9 @@ struct fw_cdev_send_response { | |||
340 | * The @closure field is passed back to userspace in the response event. | 340 | * The @closure field is passed back to userspace in the response event. |
341 | * The @handle field is an out parameter, returning a handle to the allocated | 341 | * The @handle field is an out parameter, returning a handle to the allocated |
342 | * range to be used for later deallocation of the range. | 342 | * range to be used for later deallocation of the range. |
343 | * | ||
344 | * The address range is allocated on all local nodes. The address allocation | ||
345 | * is exclusive except for the FCP command and response registers. | ||
343 | */ | 346 | */ |
344 | struct fw_cdev_allocate { | 347 | struct fw_cdev_allocate { |
345 | __u64 offset; | 348 | __u64 offset; |
@@ -377,7 +380,7 @@ struct fw_cdev_initiate_bus_reset { | |||
377 | * @immediate: If non-zero, immediate key to insert before pointer | 380 | * @immediate: If non-zero, immediate key to insert before pointer |
378 | * @key: Upper 8 bits of root directory pointer | 381 | * @key: Upper 8 bits of root directory pointer |
379 | * @data: Userspace pointer to contents of descriptor block | 382 | * @data: Userspace pointer to contents of descriptor block |
380 | * @length: Length of descriptor block data, in bytes | 383 | * @length: Length of descriptor block data, in quadlets |
381 | * @handle: Handle to the descriptor, written by the kernel | 384 | * @handle: Handle to the descriptor, written by the kernel |
382 | * | 385 | * |
383 | * Add a descriptor block and optionally a preceding immediate key to the local | 386 | * Add a descriptor block and optionally a preceding immediate key to the local |
@@ -391,6 +394,8 @@ struct fw_cdev_initiate_bus_reset { | |||
391 | * If not 0, the @immediate field specifies an immediate key which will be | 394 | * If not 0, the @immediate field specifies an immediate key which will be |
392 | * inserted before the root directory pointer. | 395 | * inserted before the root directory pointer. |
393 | * | 396 | * |
397 | * @immediate, @key, and @data array elements are CPU-endian quadlets. | ||
398 | * | ||
394 | * If successful, the kernel adds the descriptor and writes back a handle to the | 399 | * If successful, the kernel adds the descriptor and writes back a handle to the |
395 | * kernel-side object to be used for later removal of the descriptor block and | 400 | * kernel-side object to be used for later removal of the descriptor block and |
396 | * immediate key. | 401 | * immediate key. |
diff --git a/include/linux/firewire.h b/include/linux/firewire.h index 9416a461b696..a0e67150a729 100644 --- a/include/linux/firewire.h +++ b/include/linux/firewire.h | |||
@@ -248,8 +248,8 @@ typedef void (*fw_transaction_callback_t)(struct fw_card *card, int rcode, | |||
248 | void *data, size_t length, | 248 | void *data, size_t length, |
249 | void *callback_data); | 249 | void *callback_data); |
250 | /* | 250 | /* |
251 | * Important note: The callback must guarantee that either fw_send_response() | 251 | * Important note: Except for the FCP registers, the callback must guarantee |
252 | * or kfree() is called on the @request. | 252 | * that either fw_send_response() or kfree() is called on the @request. |
253 | */ | 253 | */ |
254 | typedef void (*fw_address_callback_t)(struct fw_card *card, | 254 | typedef void (*fw_address_callback_t)(struct fw_card *card, |
255 | struct fw_request *request, | 255 | struct fw_request *request, |
diff --git a/include/linux/fs.h b/include/linux/fs.h index b23a7018eb90..ebb1cd5bc241 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -152,6 +152,7 @@ struct inodes_stat_t { | |||
152 | #define WRITE_SYNC_PLUG (WRITE | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_NOIDLE)) | 152 | #define WRITE_SYNC_PLUG (WRITE | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_NOIDLE)) |
153 | #define WRITE_SYNC (WRITE_SYNC_PLUG | (1 << BIO_RW_UNPLUG)) | 153 | #define WRITE_SYNC (WRITE_SYNC_PLUG | (1 << BIO_RW_UNPLUG)) |
154 | #define WRITE_ODIRECT_PLUG (WRITE | (1 << BIO_RW_SYNCIO)) | 154 | #define WRITE_ODIRECT_PLUG (WRITE | (1 << BIO_RW_SYNCIO)) |
155 | #define WRITE_META (WRITE | (1 << BIO_RW_META)) | ||
155 | #define SWRITE_SYNC_PLUG \ | 156 | #define SWRITE_SYNC_PLUG \ |
156 | (SWRITE | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_NOIDLE)) | 157 | (SWRITE | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_NOIDLE)) |
157 | #define SWRITE_SYNC (SWRITE_SYNC_PLUG | (1 << BIO_RW_UNPLUG)) | 158 | #define SWRITE_SYNC (SWRITE_SYNC_PLUG | (1 << BIO_RW_UNPLUG)) |
@@ -728,6 +729,7 @@ struct inode { | |||
728 | uid_t i_uid; | 729 | uid_t i_uid; |
729 | gid_t i_gid; | 730 | gid_t i_gid; |
730 | dev_t i_rdev; | 731 | dev_t i_rdev; |
732 | unsigned int i_blkbits; | ||
731 | u64 i_version; | 733 | u64 i_version; |
732 | loff_t i_size; | 734 | loff_t i_size; |
733 | #ifdef __NEED_I_SIZE_ORDERED | 735 | #ifdef __NEED_I_SIZE_ORDERED |
@@ -737,7 +739,6 @@ struct inode { | |||
737 | struct timespec i_mtime; | 739 | struct timespec i_mtime; |
738 | struct timespec i_ctime; | 740 | struct timespec i_ctime; |
739 | blkcnt_t i_blocks; | 741 | blkcnt_t i_blocks; |
740 | unsigned int i_blkbits; | ||
741 | unsigned short i_bytes; | 742 | unsigned short i_bytes; |
742 | umode_t i_mode; | 743 | umode_t i_mode; |
743 | spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ | 744 | spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ |
@@ -1094,10 +1095,6 @@ struct file_lock { | |||
1094 | 1095 | ||
1095 | extern void send_sigio(struct fown_struct *fown, int fd, int band); | 1096 | extern void send_sigio(struct fown_struct *fown, int fd, int band); |
1096 | 1097 | ||
1097 | /* fs/sync.c */ | ||
1098 | extern int do_sync_mapping_range(struct address_space *mapping, loff_t offset, | ||
1099 | loff_t endbyte, unsigned int flags); | ||
1100 | |||
1101 | #ifdef CONFIG_FILE_LOCKING | 1098 | #ifdef CONFIG_FILE_LOCKING |
1102 | extern int fcntl_getlk(struct file *, struct flock __user *); | 1099 | extern int fcntl_getlk(struct file *, struct flock __user *); |
1103 | extern int fcntl_setlk(unsigned int, struct file *, unsigned int, | 1100 | extern int fcntl_setlk(unsigned int, struct file *, unsigned int, |
@@ -1590,7 +1587,7 @@ struct super_operations { | |||
1590 | * until that flag is cleared. I_WILL_FREE, I_FREEING and I_CLEAR are set at | 1587 | * until that flag is cleared. I_WILL_FREE, I_FREEING and I_CLEAR are set at |
1591 | * various stages of removing an inode. | 1588 | * various stages of removing an inode. |
1592 | * | 1589 | * |
1593 | * Two bits are used for locking and completion notification, I_LOCK and I_SYNC. | 1590 | * Two bits are used for locking and completion notification, I_NEW and I_SYNC. |
1594 | * | 1591 | * |
1595 | * I_DIRTY_SYNC Inode is dirty, but doesn't have to be written on | 1592 | * I_DIRTY_SYNC Inode is dirty, but doesn't have to be written on |
1596 | * fdatasync(). i_atime is the usual cause. | 1593 | * fdatasync(). i_atime is the usual cause. |
@@ -1599,8 +1596,14 @@ struct super_operations { | |||
1599 | * don't have to write inode on fdatasync() when only | 1596 | * don't have to write inode on fdatasync() when only |
1600 | * mtime has changed in it. | 1597 | * mtime has changed in it. |
1601 | * I_DIRTY_PAGES Inode has dirty pages. Inode itself may be clean. | 1598 | * I_DIRTY_PAGES Inode has dirty pages. Inode itself may be clean. |
1602 | * I_NEW get_new_inode() sets i_state to I_LOCK|I_NEW. Both | 1599 | * I_NEW Serves as both a mutex and completion notification. |
1603 | * are cleared by unlock_new_inode(), called from iget(). | 1600 | * New inodes set I_NEW. If two processes both create |
1601 | * the same inode, one of them will release its inode and | ||
1602 | * wait for I_NEW to be released before returning. | ||
1603 | * Inodes in I_WILL_FREE, I_FREEING or I_CLEAR state can | ||
1604 | * also cause waiting on I_NEW, without I_NEW actually | ||
1605 | * being set. find_inode() uses this to prevent returning | ||
1606 | * nearly-dead inodes. | ||
1604 | * I_WILL_FREE Must be set when calling write_inode_now() if i_count | 1607 | * I_WILL_FREE Must be set when calling write_inode_now() if i_count |
1605 | * is zero. I_FREEING must be set when I_WILL_FREE is | 1608 | * is zero. I_FREEING must be set when I_WILL_FREE is |
1606 | * cleared. | 1609 | * cleared. |
@@ -1614,35 +1617,23 @@ struct super_operations { | |||
1614 | * prohibited for many purposes. iget() must wait for | 1617 | * prohibited for many purposes. iget() must wait for |
1615 | * the inode to be completely released, then create it | 1618 | * the inode to be completely released, then create it |
1616 | * anew. Other functions will just ignore such inodes, | 1619 | * anew. Other functions will just ignore such inodes, |
1617 | * if appropriate. I_LOCK is used for waiting. | 1620 | * if appropriate. I_NEW is used for waiting. |
1618 | * | 1621 | * |
1619 | * I_LOCK Serves as both a mutex and completion notification. | 1622 | * I_SYNC Synchonized write of dirty inode data. The bits is |
1620 | * New inodes set I_LOCK. If two processes both create | 1623 | * set during data writeback, and cleared with a wakeup |
1621 | * the same inode, one of them will release its inode and | 1624 | * on the bit address once it is done. |
1622 | * wait for I_LOCK to be released before returning. | ||
1623 | * Inodes in I_WILL_FREE, I_FREEING or I_CLEAR state can | ||
1624 | * also cause waiting on I_LOCK, without I_LOCK actually | ||
1625 | * being set. find_inode() uses this to prevent returning | ||
1626 | * nearly-dead inodes. | ||
1627 | * I_SYNC Similar to I_LOCK, but limited in scope to writeback | ||
1628 | * of inode dirty data. Having a separate lock for this | ||
1629 | * purpose reduces latency and prevents some filesystem- | ||
1630 | * specific deadlocks. | ||
1631 | * | 1625 | * |
1632 | * Q: What is the difference between I_WILL_FREE and I_FREEING? | 1626 | * Q: What is the difference between I_WILL_FREE and I_FREEING? |
1633 | * Q: igrab() only checks on (I_FREEING|I_WILL_FREE). Should it also check on | ||
1634 | * I_CLEAR? If not, why? | ||
1635 | */ | 1627 | */ |
1636 | #define I_DIRTY_SYNC 1 | 1628 | #define I_DIRTY_SYNC 1 |
1637 | #define I_DIRTY_DATASYNC 2 | 1629 | #define I_DIRTY_DATASYNC 2 |
1638 | #define I_DIRTY_PAGES 4 | 1630 | #define I_DIRTY_PAGES 4 |
1639 | #define I_NEW 8 | 1631 | #define __I_NEW 3 |
1632 | #define I_NEW (1 << __I_NEW) | ||
1640 | #define I_WILL_FREE 16 | 1633 | #define I_WILL_FREE 16 |
1641 | #define I_FREEING 32 | 1634 | #define I_FREEING 32 |
1642 | #define I_CLEAR 64 | 1635 | #define I_CLEAR 64 |
1643 | #define __I_LOCK 7 | 1636 | #define __I_SYNC 7 |
1644 | #define I_LOCK (1 << __I_LOCK) | ||
1645 | #define __I_SYNC 8 | ||
1646 | #define I_SYNC (1 << __I_SYNC) | 1637 | #define I_SYNC (1 << __I_SYNC) |
1647 | 1638 | ||
1648 | #define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES) | 1639 | #define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES) |
@@ -2189,7 +2180,6 @@ static inline void insert_inode_hash(struct inode *inode) { | |||
2189 | __insert_inode_hash(inode, inode->i_ino); | 2180 | __insert_inode_hash(inode, inode->i_ino); |
2190 | } | 2181 | } |
2191 | 2182 | ||
2192 | extern struct file * get_empty_filp(void); | ||
2193 | extern void file_move(struct file *f, struct list_head *list); | 2183 | extern void file_move(struct file *f, struct list_head *list); |
2194 | extern void file_kill(struct file *f); | 2184 | extern void file_kill(struct file *f); |
2195 | #ifdef CONFIG_BLOCK | 2185 | #ifdef CONFIG_BLOCK |
@@ -2307,6 +2297,7 @@ extern const struct inode_operations page_symlink_inode_operations; | |||
2307 | extern int generic_readlink(struct dentry *, char __user *, int); | 2297 | extern int generic_readlink(struct dentry *, char __user *, int); |
2308 | extern void generic_fillattr(struct inode *, struct kstat *); | 2298 | extern void generic_fillattr(struct inode *, struct kstat *); |
2309 | extern int vfs_getattr(struct vfsmount *, struct dentry *, struct kstat *); | 2299 | extern int vfs_getattr(struct vfsmount *, struct dentry *, struct kstat *); |
2300 | void __inode_add_bytes(struct inode *inode, loff_t bytes); | ||
2310 | void inode_add_bytes(struct inode *inode, loff_t bytes); | 2301 | void inode_add_bytes(struct inode *inode, loff_t bytes); |
2311 | void inode_sub_bytes(struct inode *inode, loff_t bytes); | 2302 | void inode_sub_bytes(struct inode *inode, loff_t bytes); |
2312 | loff_t inode_get_bytes(struct inode *inode); | 2303 | loff_t inode_get_bytes(struct inode *inode); |
@@ -2472,5 +2463,8 @@ int proc_nr_files(struct ctl_table *table, int write, | |||
2472 | 2463 | ||
2473 | int __init get_filesystem_list(char *buf); | 2464 | int __init get_filesystem_list(char *buf); |
2474 | 2465 | ||
2466 | #define ACC_MODE(x) ("\004\002\006\006"[(x)&O_ACCMODE]) | ||
2467 | #define OPEN_FMODE(flag) ((__force fmode_t)((flag + 1) & O_ACCMODE)) | ||
2468 | |||
2475 | #endif /* __KERNEL__ */ | 2469 | #endif /* __KERNEL__ */ |
2476 | #endif /* _LINUX_FS_H */ | 2470 | #endif /* _LINUX_FS_H */ |
diff --git a/include/linux/fs_stack.h b/include/linux/fs_stack.h index bb516ceeefc9..da317c7163ab 100644 --- a/include/linux/fs_stack.h +++ b/include/linux/fs_stack.h | |||
@@ -8,10 +8,8 @@ | |||
8 | #include <linux/fs.h> | 8 | #include <linux/fs.h> |
9 | 9 | ||
10 | /* externs for fs/stack.c */ | 10 | /* externs for fs/stack.c */ |
11 | extern void fsstack_copy_attr_all(struct inode *dest, const struct inode *src, | 11 | extern void fsstack_copy_attr_all(struct inode *dest, const struct inode *src); |
12 | int (*get_nlinks)(struct inode *)); | 12 | extern void fsstack_copy_inode_size(struct inode *dst, struct inode *src); |
13 | |||
14 | extern void fsstack_copy_inode_size(struct inode *dst, const struct inode *src); | ||
15 | 13 | ||
16 | /* inlines */ | 14 | /* inlines */ |
17 | static inline void fsstack_copy_attr_atime(struct inode *dest, | 15 | static inline void fsstack_copy_attr_atime(struct inode *dest, |
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 38f8d6553831..2233c98d80df 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
@@ -131,7 +131,7 @@ struct ftrace_event_call { | |||
131 | void *mod; | 131 | void *mod; |
132 | void *data; | 132 | void *data; |
133 | 133 | ||
134 | atomic_t profile_count; | 134 | int profile_count; |
135 | int (*profile_enable)(struct ftrace_event_call *); | 135 | int (*profile_enable)(struct ftrace_event_call *); |
136 | void (*profile_disable)(struct ftrace_event_call *); | 136 | void (*profile_disable)(struct ftrace_event_call *); |
137 | }; | 137 | }; |
@@ -158,7 +158,7 @@ enum { | |||
158 | FILTER_PTR_STRING, | 158 | FILTER_PTR_STRING, |
159 | }; | 159 | }; |
160 | 160 | ||
161 | extern int trace_define_common_fields(struct ftrace_event_call *call); | 161 | extern int trace_event_raw_init(struct ftrace_event_call *call); |
162 | extern int trace_define_field(struct ftrace_event_call *call, const char *type, | 162 | extern int trace_define_field(struct ftrace_event_call *call, const char *type, |
163 | const char *name, int offset, int size, | 163 | const char *name, int offset, int size, |
164 | int is_signed, int filter_type); | 164 | int is_signed, int filter_type); |
diff --git a/include/linux/generic_acl.h b/include/linux/generic_acl.h index 886f5faa08cb..ca666d18ed67 100644 --- a/include/linux/generic_acl.h +++ b/include/linux/generic_acl.h | |||
@@ -1,36 +1,15 @@ | |||
1 | /* | 1 | #ifndef LINUX_GENERIC_ACL_H |
2 | * include/linux/generic_acl.h | 2 | #define LINUX_GENERIC_ACL_H |
3 | * | ||
4 | * (C) 2005 Andreas Gruenbacher <agruen@suse.de> | ||
5 | * | ||
6 | * This file is released under the GPL. | ||
7 | */ | ||
8 | 3 | ||
9 | #ifndef GENERIC_ACL_H | 4 | #include <linux/xattr.h> |
10 | #define GENERIC_ACL_H | ||
11 | 5 | ||
12 | #include <linux/posix_acl.h> | 6 | struct inode; |
13 | #include <linux/posix_acl_xattr.h> | ||
14 | 7 | ||
15 | /** | 8 | extern struct xattr_handler generic_acl_access_handler; |
16 | * struct generic_acl_operations - filesystem operations | 9 | extern struct xattr_handler generic_acl_default_handler; |
17 | * | ||
18 | * Filesystems must make these operations available to the generic | ||
19 | * operations. | ||
20 | */ | ||
21 | struct generic_acl_operations { | ||
22 | struct posix_acl *(*getacl)(struct inode *, int); | ||
23 | void (*setacl)(struct inode *, int, struct posix_acl *); | ||
24 | }; | ||
25 | 10 | ||
26 | size_t generic_acl_list(struct inode *, struct generic_acl_operations *, int, | 11 | int generic_acl_init(struct inode *, struct inode *); |
27 | char *, size_t); | 12 | int generic_acl_chmod(struct inode *); |
28 | int generic_acl_get(struct inode *, struct generic_acl_operations *, int, | 13 | int generic_check_acl(struct inode *inode, int mask); |
29 | void *, size_t); | ||
30 | int generic_acl_set(struct inode *, struct generic_acl_operations *, int, | ||
31 | const void *, size_t); | ||
32 | int generic_acl_init(struct inode *, struct inode *, | ||
33 | struct generic_acl_operations *); | ||
34 | int generic_acl_chmod(struct inode *, struct generic_acl_operations *); | ||
35 | 14 | ||
36 | #endif | 15 | #endif /* LINUX_GENERIC_ACL_H */ |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index c6c0c41af35f..9717081c75ad 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -256,9 +256,9 @@ extern struct hd_struct *disk_map_sector_rcu(struct gendisk *disk, | |||
256 | #define part_stat_read(part, field) \ | 256 | #define part_stat_read(part, field) \ |
257 | ({ \ | 257 | ({ \ |
258 | typeof((part)->dkstats->field) res = 0; \ | 258 | typeof((part)->dkstats->field) res = 0; \ |
259 | int i; \ | 259 | unsigned int _cpu; \ |
260 | for_each_possible_cpu(i) \ | 260 | for_each_possible_cpu(_cpu) \ |
261 | res += per_cpu_ptr((part)->dkstats, i)->field; \ | 261 | res += per_cpu_ptr((part)->dkstats, _cpu)->field; \ |
262 | res; \ | 262 | res; \ |
263 | }) | 263 | }) |
264 | 264 | ||
diff --git a/include/linux/highmem.h b/include/linux/highmem.h index 211ff4497269..ab2cc20e21a5 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h | |||
@@ -46,7 +46,7 @@ void kmap_flush_unused(void); | |||
46 | 46 | ||
47 | static inline unsigned int nr_free_highpages(void) { return 0; } | 47 | static inline unsigned int nr_free_highpages(void) { return 0; } |
48 | 48 | ||
49 | #define totalhigh_pages 0 | 49 | #define totalhigh_pages 0UL |
50 | 50 | ||
51 | #ifndef ARCH_HAS_KMAP | 51 | #ifndef ARCH_HAS_KMAP |
52 | static inline void *kmap(struct page *page) | 52 | static inline void *kmap(struct page *page) |
diff --git a/include/linux/hw_breakpoint.h b/include/linux/hw_breakpoint.h index 41235c93e4e9..5977b724f7c6 100644 --- a/include/linux/hw_breakpoint.h +++ b/include/linux/hw_breakpoint.h | |||
@@ -44,7 +44,7 @@ static inline int hw_breakpoint_type(struct perf_event *bp) | |||
44 | return bp->attr.bp_type; | 44 | return bp->attr.bp_type; |
45 | } | 45 | } |
46 | 46 | ||
47 | static inline int hw_breakpoint_len(struct perf_event *bp) | 47 | static inline unsigned long hw_breakpoint_len(struct perf_event *bp) |
48 | { | 48 | { |
49 | return bp->attr.bp_len; | 49 | return bp->attr.bp_len; |
50 | } | 50 | } |
@@ -75,6 +75,8 @@ extern int __register_perf_hw_breakpoint(struct perf_event *bp); | |||
75 | extern void unregister_hw_breakpoint(struct perf_event *bp); | 75 | extern void unregister_hw_breakpoint(struct perf_event *bp); |
76 | extern void unregister_wide_hw_breakpoint(struct perf_event **cpu_events); | 76 | extern void unregister_wide_hw_breakpoint(struct perf_event **cpu_events); |
77 | 77 | ||
78 | extern int dbg_reserve_bp_slot(struct perf_event *bp); | ||
79 | extern int dbg_release_bp_slot(struct perf_event *bp); | ||
78 | extern int reserve_bp_slot(struct perf_event *bp); | 80 | extern int reserve_bp_slot(struct perf_event *bp); |
79 | extern void release_bp_slot(struct perf_event *bp); | 81 | extern void release_bp_slot(struct perf_event *bp); |
80 | 82 | ||
diff --git a/include/linux/i2c/adp5588.h b/include/linux/i2c/adp5588.h index fc5db826b48e..02c9af374741 100644 --- a/include/linux/i2c/adp5588.h +++ b/include/linux/i2c/adp5588.h | |||
@@ -89,4 +89,16 @@ struct adp5588_kpad_platform_data { | |||
89 | unsigned short unlock_key2; /* Unlock Key 2 */ | 89 | unsigned short unlock_key2; /* Unlock Key 2 */ |
90 | }; | 90 | }; |
91 | 91 | ||
92 | struct adp5588_gpio_platform_data { | ||
93 | unsigned gpio_start; /* GPIO Chip base # */ | ||
94 | unsigned pullup_dis_mask; /* Pull-Up Disable Mask */ | ||
95 | int (*setup)(struct i2c_client *client, | ||
96 | int gpio, unsigned ngpio, | ||
97 | void *context); | ||
98 | int (*teardown)(struct i2c_client *client, | ||
99 | int gpio, unsigned ngpio, | ||
100 | void *context); | ||
101 | void *context; | ||
102 | }; | ||
103 | |||
92 | #endif | 104 | #endif |
diff --git a/include/linux/i8042.h b/include/linux/i8042.h index 60c3360ef6ad..9bf6870ee5f4 100644 --- a/include/linux/i8042.h +++ b/include/linux/i8042.h | |||
@@ -39,6 +39,10 @@ void i8042_lock_chip(void); | |||
39 | void i8042_unlock_chip(void); | 39 | void i8042_unlock_chip(void); |
40 | int i8042_command(unsigned char *param, int command); | 40 | int i8042_command(unsigned char *param, int command); |
41 | bool i8042_check_port_owner(const struct serio *); | 41 | bool i8042_check_port_owner(const struct serio *); |
42 | int i8042_install_filter(bool (*filter)(unsigned char data, unsigned char str, | ||
43 | struct serio *serio)); | ||
44 | int i8042_remove_filter(bool (*filter)(unsigned char data, unsigned char str, | ||
45 | struct serio *serio)); | ||
42 | 46 | ||
43 | #else | 47 | #else |
44 | 48 | ||
@@ -52,7 +56,7 @@ void i8042_unlock_chip(void) | |||
52 | 56 | ||
53 | int i8042_command(unsigned char *param, int command) | 57 | int i8042_command(unsigned char *param, int command) |
54 | { | 58 | { |
55 | return -ENOSYS; | 59 | return -ENODEV; |
56 | } | 60 | } |
57 | 61 | ||
58 | bool i8042_check_port_owner(const struct serio *serio) | 62 | bool i8042_check_port_owner(const struct serio *serio) |
@@ -60,6 +64,18 @@ bool i8042_check_port_owner(const struct serio *serio) | |||
60 | return false; | 64 | return false; |
61 | } | 65 | } |
62 | 66 | ||
67 | int i8042_install_filter(bool (*filter)(unsigned char data, unsigned char str, | ||
68 | struct serio *serio)) | ||
69 | { | ||
70 | return -ENODEV; | ||
71 | } | ||
72 | |||
73 | int i8042_remove_filter(bool (*filter)(unsigned char data, unsigned char str, | ||
74 | struct serio *serio)) | ||
75 | { | ||
76 | return -ENODEV; | ||
77 | } | ||
78 | |||
63 | #endif | 79 | #endif |
64 | 80 | ||
65 | #endif | 81 | #endif |
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index d9724a28c0c2..163c840437d6 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
@@ -832,7 +832,7 @@ struct ieee80211_ht_cap { | |||
832 | #define IEEE80211_HT_CAP_DELAY_BA 0x0400 | 832 | #define IEEE80211_HT_CAP_DELAY_BA 0x0400 |
833 | #define IEEE80211_HT_CAP_MAX_AMSDU 0x0800 | 833 | #define IEEE80211_HT_CAP_MAX_AMSDU 0x0800 |
834 | #define IEEE80211_HT_CAP_DSSSCCK40 0x1000 | 834 | #define IEEE80211_HT_CAP_DSSSCCK40 0x1000 |
835 | #define IEEE80211_HT_CAP_PSMP_SUPPORT 0x2000 | 835 | #define IEEE80211_HT_CAP_RESERVED 0x2000 |
836 | #define IEEE80211_HT_CAP_40MHZ_INTOLERANT 0x4000 | 836 | #define IEEE80211_HT_CAP_40MHZ_INTOLERANT 0x4000 |
837 | #define IEEE80211_HT_CAP_LSIG_TXOP_PROT 0x8000 | 837 | #define IEEE80211_HT_CAP_LSIG_TXOP_PROT 0x8000 |
838 | 838 | ||
diff --git a/include/linux/ima.h b/include/linux/ima.h index 0e3f2a4c25f6..975837e7d6c0 100644 --- a/include/linux/ima.h +++ b/include/linux/ima.h | |||
@@ -13,18 +13,14 @@ | |||
13 | #include <linux/fs.h> | 13 | #include <linux/fs.h> |
14 | struct linux_binprm; | 14 | struct linux_binprm; |
15 | 15 | ||
16 | #define IMA_COUNT_UPDATE 1 | ||
17 | #define IMA_COUNT_LEAVE 0 | ||
18 | |||
19 | #ifdef CONFIG_IMA | 16 | #ifdef CONFIG_IMA |
20 | extern int ima_bprm_check(struct linux_binprm *bprm); | 17 | extern int ima_bprm_check(struct linux_binprm *bprm); |
21 | extern int ima_inode_alloc(struct inode *inode); | 18 | extern int ima_inode_alloc(struct inode *inode); |
22 | extern void ima_inode_free(struct inode *inode); | 19 | extern void ima_inode_free(struct inode *inode); |
23 | extern int ima_path_check(struct path *path, int mask, int update_counts); | 20 | extern int ima_file_check(struct file *file, int mask); |
24 | extern void ima_file_free(struct file *file); | 21 | extern void ima_file_free(struct file *file); |
25 | extern int ima_file_mmap(struct file *file, unsigned long prot); | 22 | extern int ima_file_mmap(struct file *file, unsigned long prot); |
26 | extern void ima_counts_get(struct file *file); | 23 | extern void ima_counts_get(struct file *file); |
27 | extern void ima_counts_put(struct path *path, int mask); | ||
28 | 24 | ||
29 | #else | 25 | #else |
30 | static inline int ima_bprm_check(struct linux_binprm *bprm) | 26 | static inline int ima_bprm_check(struct linux_binprm *bprm) |
@@ -42,7 +38,7 @@ static inline void ima_inode_free(struct inode *inode) | |||
42 | return; | 38 | return; |
43 | } | 39 | } |
44 | 40 | ||
45 | static inline int ima_path_check(struct path *path, int mask, int update_counts) | 41 | static inline int ima_file_check(struct file *file, int mask) |
46 | { | 42 | { |
47 | return 0; | 43 | return 0; |
48 | } | 44 | } |
@@ -62,9 +58,5 @@ static inline void ima_counts_get(struct file *file) | |||
62 | return; | 58 | return; |
63 | } | 59 | } |
64 | 60 | ||
65 | static inline void ima_counts_put(struct path *path, int mask) | ||
66 | { | ||
67 | return; | ||
68 | } | ||
69 | #endif /* CONFIG_IMA_H */ | 61 | #endif /* CONFIG_IMA_H */ |
70 | #endif /* _LINUX_IMA_H */ | 62 | #endif /* _LINUX_IMA_H */ |
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index 699e85c01a4d..b2304929434e 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h | |||
@@ -81,6 +81,7 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev) | |||
81 | #define IN_DEV_FORWARD(in_dev) IN_DEV_CONF_GET((in_dev), FORWARDING) | 81 | #define IN_DEV_FORWARD(in_dev) IN_DEV_CONF_GET((in_dev), FORWARDING) |
82 | #define IN_DEV_MFORWARD(in_dev) IN_DEV_ANDCONF((in_dev), MC_FORWARDING) | 82 | #define IN_DEV_MFORWARD(in_dev) IN_DEV_ANDCONF((in_dev), MC_FORWARDING) |
83 | #define IN_DEV_RPFILTER(in_dev) IN_DEV_MAXCONF((in_dev), RP_FILTER) | 83 | #define IN_DEV_RPFILTER(in_dev) IN_DEV_MAXCONF((in_dev), RP_FILTER) |
84 | #define IN_DEV_SRC_VMARK(in_dev) IN_DEV_ORCONF((in_dev), SRC_VMARK) | ||
84 | #define IN_DEV_SOURCE_ROUTE(in_dev) IN_DEV_ANDCONF((in_dev), \ | 85 | #define IN_DEV_SOURCE_ROUTE(in_dev) IN_DEV_ANDCONF((in_dev), \ |
85 | ACCEPT_SOURCE_ROUTE) | 86 | ACCEPT_SOURCE_ROUTE) |
86 | #define IN_DEV_ACCEPT_LOCAL(in_dev) IN_DEV_ORCONF((in_dev), ACCEPT_LOCAL) | 87 | #define IN_DEV_ACCEPT_LOCAL(in_dev) IN_DEV_ORCONF((in_dev), ACCEPT_LOCAL) |
diff --git a/include/linux/init.h b/include/linux/init.h index ff8bde520d03..ab1d31f9352b 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
@@ -149,6 +149,8 @@ void prepare_namespace(void); | |||
149 | 149 | ||
150 | extern void (*late_time_init)(void); | 150 | extern void (*late_time_init)(void); |
151 | 151 | ||
152 | extern int initcall_debug; | ||
153 | |||
152 | #endif | 154 | #endif |
153 | 155 | ||
154 | #ifndef MODULE | 156 | #ifndef MODULE |
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 5ed8b9c50355..abec69b63d7e 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
@@ -111,12 +111,6 @@ extern struct cred init_cred; | |||
111 | # define INIT_PERF_EVENTS(tsk) | 111 | # define INIT_PERF_EVENTS(tsk) |
112 | #endif | 112 | #endif |
113 | 113 | ||
114 | #ifdef CONFIG_FS_JOURNAL_INFO | ||
115 | #define INIT_JOURNAL_INFO .journal_info = NULL, | ||
116 | #else | ||
117 | #define INIT_JOURNAL_INFO | ||
118 | #endif | ||
119 | |||
120 | /* | 114 | /* |
121 | * INIT_TASK is used to set up the first task table, touch at | 115 | * INIT_TASK is used to set up the first task table, touch at |
122 | * your own risk!. Base=0, limit=0x1fffff (=2MB) | 116 | * your own risk!. Base=0, limit=0x1fffff (=2MB) |
@@ -168,6 +162,7 @@ extern struct cred init_cred; | |||
168 | .signal = {{0}}}, \ | 162 | .signal = {{0}}}, \ |
169 | .blocked = {{0}}, \ | 163 | .blocked = {{0}}, \ |
170 | .alloc_lock = __SPIN_LOCK_UNLOCKED(tsk.alloc_lock), \ | 164 | .alloc_lock = __SPIN_LOCK_UNLOCKED(tsk.alloc_lock), \ |
165 | .journal_info = NULL, \ | ||
171 | .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \ | 166 | .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \ |
172 | .fs_excl = ATOMIC_INIT(0), \ | 167 | .fs_excl = ATOMIC_INIT(0), \ |
173 | .pi_lock = __RAW_SPIN_LOCK_UNLOCKED(tsk.pi_lock), \ | 168 | .pi_lock = __RAW_SPIN_LOCK_UNLOCKED(tsk.pi_lock), \ |
@@ -178,7 +173,6 @@ extern struct cred init_cred; | |||
178 | [PIDTYPE_SID] = INIT_PID_LINK(PIDTYPE_SID), \ | 173 | [PIDTYPE_SID] = INIT_PID_LINK(PIDTYPE_SID), \ |
179 | }, \ | 174 | }, \ |
180 | .dirties = INIT_PROP_LOCAL_SINGLE(dirties), \ | 175 | .dirties = INIT_PROP_LOCAL_SINGLE(dirties), \ |
181 | INIT_JOURNAL_INFO \ | ||
182 | INIT_IDS \ | 176 | INIT_IDS \ |
183 | INIT_PERF_EVENTS(tsk) \ | 177 | INIT_PERF_EVENTS(tsk) \ |
184 | INIT_TRACE_IRQFLAGS \ | 178 | INIT_TRACE_IRQFLAGS \ |
diff --git a/include/linux/input.h b/include/linux/input.h index 7be8a6537b57..663208afb64c 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -376,6 +376,7 @@ struct input_absinfo { | |||
376 | #define KEY_DISPLAY_OFF 245 /* display device to off state */ | 376 | #define KEY_DISPLAY_OFF 245 /* display device to off state */ |
377 | 377 | ||
378 | #define KEY_WIMAX 246 | 378 | #define KEY_WIMAX 246 |
379 | #define KEY_RFKILL 247 /* Key that controls all radios */ | ||
379 | 380 | ||
380 | /* Range 248 - 255 is reserved for special needs of AT keyboard driver */ | 381 | /* Range 248 - 255 is reserved for special needs of AT keyboard driver */ |
381 | 382 | ||
@@ -660,6 +661,7 @@ struct input_absinfo { | |||
660 | #define ABS_MT_TOOL_TYPE 0x37 /* Type of touching device */ | 661 | #define ABS_MT_TOOL_TYPE 0x37 /* Type of touching device */ |
661 | #define ABS_MT_BLOB_ID 0x38 /* Group a set of packets as a blob */ | 662 | #define ABS_MT_BLOB_ID 0x38 /* Group a set of packets as a blob */ |
662 | #define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */ | 663 | #define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */ |
664 | #define ABS_MT_PRESSURE 0x3a /* Pressure on contact area */ | ||
663 | 665 | ||
664 | #define ABS_MAX 0x3f | 666 | #define ABS_MAX 0x3f |
665 | #define ABS_CNT (ABS_MAX+1) | 667 | #define ABS_CNT (ABS_MAX+1) |
diff --git a/include/linux/iocontext.h b/include/linux/iocontext.h index a63235996309..78ef023227d4 100644 --- a/include/linux/iocontext.h +++ b/include/linux/iocontext.h | |||
@@ -4,32 +4,6 @@ | |||
4 | #include <linux/radix-tree.h> | 4 | #include <linux/radix-tree.h> |
5 | #include <linux/rcupdate.h> | 5 | #include <linux/rcupdate.h> |
6 | 6 | ||
7 | /* | ||
8 | * This is the per-process anticipatory I/O scheduler state. | ||
9 | */ | ||
10 | struct as_io_context { | ||
11 | spinlock_t lock; | ||
12 | |||
13 | void (*dtor)(struct as_io_context *aic); /* destructor */ | ||
14 | void (*exit)(struct as_io_context *aic); /* called on task exit */ | ||
15 | |||
16 | unsigned long state; | ||
17 | atomic_t nr_queued; /* queued reads & sync writes */ | ||
18 | atomic_t nr_dispatched; /* number of requests gone to the drivers */ | ||
19 | |||
20 | /* IO History tracking */ | ||
21 | /* Thinktime */ | ||
22 | unsigned long last_end_request; | ||
23 | unsigned long ttime_total; | ||
24 | unsigned long ttime_samples; | ||
25 | unsigned long ttime_mean; | ||
26 | /* Layout pattern */ | ||
27 | unsigned int seek_samples; | ||
28 | sector_t last_request_pos; | ||
29 | u64 seek_total; | ||
30 | sector_t seek_mean; | ||
31 | }; | ||
32 | |||
33 | struct cfq_queue; | 7 | struct cfq_queue; |
34 | struct cfq_io_context { | 8 | struct cfq_io_context { |
35 | void *key; | 9 | void *key; |
@@ -78,7 +52,6 @@ struct io_context { | |||
78 | unsigned long last_waited; /* Time last woken after wait for request */ | 52 | unsigned long last_waited; /* Time last woken after wait for request */ |
79 | int nr_batch_requests; /* Number of requests left in the batch */ | 53 | int nr_batch_requests; /* Number of requests left in the batch */ |
80 | 54 | ||
81 | struct as_io_context *aic; | ||
82 | struct radix_tree_root radix_root; | 55 | struct radix_tree_root radix_root; |
83 | struct hlist_head cic_list; | 56 | struct hlist_head cic_list; |
84 | void *ioc_data; | 57 | void *ioc_data; |
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index f1011f7f3d41..638ce4554c76 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h | |||
@@ -653,6 +653,7 @@ struct transaction_s | |||
653 | * waiting for it to finish. | 653 | * waiting for it to finish. |
654 | */ | 654 | */ |
655 | unsigned int t_synchronous_commit:1; | 655 | unsigned int t_synchronous_commit:1; |
656 | unsigned int t_flushed_data_blocks:1; | ||
656 | 657 | ||
657 | /* | 658 | /* |
658 | * For use by the filesystem to store fs-specific data | 659 | * For use by the filesystem to store fs-specific data |
diff --git a/include/linux/kernel-page-flags.h b/include/linux/kernel-page-flags.h new file mode 100644 index 000000000000..bd92a89f4b0a --- /dev/null +++ b/include/linux/kernel-page-flags.h | |||
@@ -0,0 +1,46 @@ | |||
1 | #ifndef LINUX_KERNEL_PAGE_FLAGS_H | ||
2 | #define LINUX_KERNEL_PAGE_FLAGS_H | ||
3 | |||
4 | /* | ||
5 | * Stable page flag bits exported to user space | ||
6 | */ | ||
7 | |||
8 | #define KPF_LOCKED 0 | ||
9 | #define KPF_ERROR 1 | ||
10 | #define KPF_REFERENCED 2 | ||
11 | #define KPF_UPTODATE 3 | ||
12 | #define KPF_DIRTY 4 | ||
13 | #define KPF_LRU 5 | ||
14 | #define KPF_ACTIVE 6 | ||
15 | #define KPF_SLAB 7 | ||
16 | #define KPF_WRITEBACK 8 | ||
17 | #define KPF_RECLAIM 9 | ||
18 | #define KPF_BUDDY 10 | ||
19 | |||
20 | /* 11-20: new additions in 2.6.31 */ | ||
21 | #define KPF_MMAP 11 | ||
22 | #define KPF_ANON 12 | ||
23 | #define KPF_SWAPCACHE 13 | ||
24 | #define KPF_SWAPBACKED 14 | ||
25 | #define KPF_COMPOUND_HEAD 15 | ||
26 | #define KPF_COMPOUND_TAIL 16 | ||
27 | #define KPF_HUGE 17 | ||
28 | #define KPF_UNEVICTABLE 18 | ||
29 | #define KPF_HWPOISON 19 | ||
30 | #define KPF_NOPAGE 20 | ||
31 | |||
32 | #define KPF_KSM 21 | ||
33 | |||
34 | /* kernel hacking assistances | ||
35 | * WARNING: subject to change, never rely on them! | ||
36 | */ | ||
37 | #define KPF_RESERVED 32 | ||
38 | #define KPF_MLOCKED 33 | ||
39 | #define KPF_MAPPEDTODISK 34 | ||
40 | #define KPF_PRIVATE 35 | ||
41 | #define KPF_PRIVATE_2 36 | ||
42 | #define KPF_OWNER_PRIVATE 37 | ||
43 | #define KPF_ARCH 38 | ||
44 | #define KPF_UNCACHED 39 | ||
45 | |||
46 | #endif /* LINUX_KERNEL_PAGE_FLAGS_H */ | ||
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 4d9c916d06d9..328bca609b9b 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -535,6 +535,8 @@ extern int | |||
535 | __trace_printk(unsigned long ip, const char *fmt, ...) | 535 | __trace_printk(unsigned long ip, const char *fmt, ...) |
536 | __attribute__ ((format (printf, 2, 3))); | 536 | __attribute__ ((format (printf, 2, 3))); |
537 | 537 | ||
538 | extern void trace_dump_stack(void); | ||
539 | |||
538 | /* | 540 | /* |
539 | * The double __builtin_constant_p is because gcc will give us an error | 541 | * The double __builtin_constant_p is because gcc will give us an error |
540 | * if we try to allocate the static variable to fmt if it is not a | 542 | * if we try to allocate the static variable to fmt if it is not a |
@@ -568,6 +570,7 @@ trace_printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); | |||
568 | static inline void tracing_start(void) { } | 570 | static inline void tracing_start(void) { } |
569 | static inline void tracing_stop(void) { } | 571 | static inline void tracing_stop(void) { } |
570 | static inline void ftrace_off_permanent(void) { } | 572 | static inline void ftrace_off_permanent(void) { } |
573 | static inline void trace_dump_stack(void) { } | ||
571 | static inline int | 574 | static inline int |
572 | trace_printk(const char *fmt, ...) | 575 | trace_printk(const char *fmt, ...) |
573 | { | 576 | { |
@@ -731,6 +734,10 @@ struct sysinfo { | |||
731 | /* Force a compilation error if condition is constant and true */ | 734 | /* Force a compilation error if condition is constant and true */ |
732 | #define MAYBE_BUILD_BUG_ON(cond) ((void)sizeof(char[1 - 2 * !!(cond)])) | 735 | #define MAYBE_BUILD_BUG_ON(cond) ((void)sizeof(char[1 - 2 * !!(cond)])) |
733 | 736 | ||
737 | /* Force a compilation error if a constant expression is not a power of 2 */ | ||
738 | #define BUILD_BUG_ON_NOT_POWER_OF_2(n) \ | ||
739 | BUILD_BUG_ON((n) == 0 || (((n) & ((n) - 1)) != 0)) | ||
740 | |||
734 | /* Force a compilation error if condition is true, but also produce a | 741 | /* Force a compilation error if condition is true, but also produce a |
735 | result (of value 0 and type size_t), so the expression can be used | 742 | result (of value 0 and type size_t), so the expression can be used |
736 | e.g. in a structure initializer (or where-ever else comma expressions | 743 | e.g. in a structure initializer (or where-ever else comma expressions |
diff --git a/include/linux/kfifo.h b/include/linux/kfifo.h index ad6bdf5a5970..bc0fc795bd35 100644 --- a/include/linux/kfifo.h +++ b/include/linux/kfifo.h | |||
@@ -1,6 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * A simple kernel FIFO implementation. | 2 | * A generic kernel FIFO implementation. |
3 | * | 3 | * |
4 | * Copyright (C) 2009 Stefani Seibold <stefani@seibold.net> | ||
4 | * Copyright (C) 2004 Stelian Pop <stelian@popies.net> | 5 | * Copyright (C) 2004 Stelian Pop <stelian@popies.net> |
5 | * | 6 | * |
6 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
@@ -18,6 +19,25 @@ | |||
18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
19 | * | 20 | * |
20 | */ | 21 | */ |
22 | |||
23 | /* | ||
24 | * Howto porting drivers to the new generic fifo API: | ||
25 | * | ||
26 | * - Modify the declaration of the "struct kfifo *" object into a | ||
27 | * in-place "struct kfifo" object | ||
28 | * - Init the in-place object with kfifo_alloc() or kfifo_init() | ||
29 | * Note: The address of the in-place "struct kfifo" object must be | ||
30 | * passed as the first argument to this functions | ||
31 | * - Replace the use of __kfifo_put into kfifo_in and __kfifo_get | ||
32 | * into kfifo_out | ||
33 | * - Replace the use of kfifo_put into kfifo_in_locked and kfifo_get | ||
34 | * into kfifo_out_locked | ||
35 | * Note: the spinlock pointer formerly passed to kfifo_init/kfifo_alloc | ||
36 | * must be passed now to the kfifo_in_locked and kfifo_out_locked | ||
37 | * as the last parameter. | ||
38 | * - All formerly name __kfifo_* functions has been renamed into kfifo_* | ||
39 | */ | ||
40 | |||
21 | #ifndef _LINUX_KFIFO_H | 41 | #ifndef _LINUX_KFIFO_H |
22 | #define _LINUX_KFIFO_H | 42 | #define _LINUX_KFIFO_H |
23 | 43 | ||
@@ -29,26 +49,82 @@ struct kfifo { | |||
29 | unsigned int size; /* the size of the allocated buffer */ | 49 | unsigned int size; /* the size of the allocated buffer */ |
30 | unsigned int in; /* data is added at offset (in % size) */ | 50 | unsigned int in; /* data is added at offset (in % size) */ |
31 | unsigned int out; /* data is extracted from off. (out % size) */ | 51 | unsigned int out; /* data is extracted from off. (out % size) */ |
32 | spinlock_t *lock; /* protects concurrent modifications */ | ||
33 | }; | 52 | }; |
34 | 53 | ||
35 | extern struct kfifo *kfifo_init(unsigned char *buffer, unsigned int size, | 54 | /* |
36 | gfp_t gfp_mask, spinlock_t *lock); | 55 | * Macros for declaration and initialization of the kfifo datatype |
37 | extern struct kfifo *kfifo_alloc(unsigned int size, gfp_t gfp_mask, | 56 | */ |
38 | spinlock_t *lock); | 57 | |
58 | /* helper macro */ | ||
59 | #define __kfifo_initializer(s, b) \ | ||
60 | (struct kfifo) { \ | ||
61 | .size = s, \ | ||
62 | .in = 0, \ | ||
63 | .out = 0, \ | ||
64 | .buffer = b \ | ||
65 | } | ||
66 | |||
67 | /** | ||
68 | * DECLARE_KFIFO - macro to declare a kfifo and the associated buffer | ||
69 | * @name: name of the declared kfifo datatype | ||
70 | * @size: size of the fifo buffer. Must be a power of two. | ||
71 | * | ||
72 | * Note1: the macro can be used inside struct or union declaration | ||
73 | * Note2: the macro creates two objects: | ||
74 | * A kfifo object with the given name and a buffer for the kfifo | ||
75 | * object named name##kfifo_buffer | ||
76 | */ | ||
77 | #define DECLARE_KFIFO(name, size) \ | ||
78 | union { \ | ||
79 | struct kfifo name; \ | ||
80 | unsigned char name##kfifo_buffer[size + sizeof(struct kfifo)]; \ | ||
81 | } | ||
82 | |||
83 | /** | ||
84 | * INIT_KFIFO - Initialize a kfifo declared by DECLARE_KFIFO | ||
85 | * @name: name of the declared kfifo datatype | ||
86 | */ | ||
87 | #define INIT_KFIFO(name) \ | ||
88 | name = __kfifo_initializer(sizeof(name##kfifo_buffer) - \ | ||
89 | sizeof(struct kfifo), name##kfifo_buffer) | ||
90 | |||
91 | /** | ||
92 | * DEFINE_KFIFO - macro to define and initialize a kfifo | ||
93 | * @name: name of the declared kfifo datatype | ||
94 | * @size: size of the fifo buffer. Must be a power of two. | ||
95 | * | ||
96 | * Note1: the macro can be used for global and local kfifo data type variables | ||
97 | * Note2: the macro creates two objects: | ||
98 | * A kfifo object with the given name and a buffer for the kfifo | ||
99 | * object named name##kfifo_buffer | ||
100 | */ | ||
101 | #define DEFINE_KFIFO(name, size) \ | ||
102 | unsigned char name##kfifo_buffer[size]; \ | ||
103 | struct kfifo name = __kfifo_initializer(size, name##kfifo_buffer) | ||
104 | |||
105 | #undef __kfifo_initializer | ||
106 | |||
107 | extern void kfifo_init(struct kfifo *fifo, void *buffer, | ||
108 | unsigned int size); | ||
109 | extern __must_check int kfifo_alloc(struct kfifo *fifo, unsigned int size, | ||
110 | gfp_t gfp_mask); | ||
39 | extern void kfifo_free(struct kfifo *fifo); | 111 | extern void kfifo_free(struct kfifo *fifo); |
40 | extern unsigned int __kfifo_put(struct kfifo *fifo, | 112 | extern unsigned int kfifo_in(struct kfifo *fifo, |
41 | const unsigned char *buffer, unsigned int len); | 113 | const void *from, unsigned int len); |
42 | extern unsigned int __kfifo_get(struct kfifo *fifo, | 114 | extern __must_check unsigned int kfifo_out(struct kfifo *fifo, |
43 | unsigned char *buffer, unsigned int len); | 115 | void *to, unsigned int len); |
116 | extern __must_check unsigned int kfifo_out_peek(struct kfifo *fifo, | ||
117 | void *to, unsigned int len, unsigned offset); | ||
44 | 118 | ||
45 | /** | 119 | /** |
46 | * __kfifo_reset - removes the entire FIFO contents, no locking version | 120 | * kfifo_initialized - Check if kfifo is initialized. |
47 | * @fifo: the fifo to be emptied. | 121 | * @fifo: fifo to check |
122 | * Return %true if FIFO is initialized, otherwise %false. | ||
123 | * Assumes the fifo was 0 before. | ||
48 | */ | 124 | */ |
49 | static inline void __kfifo_reset(struct kfifo *fifo) | 125 | static inline bool kfifo_initialized(struct kfifo *fifo) |
50 | { | 126 | { |
51 | fifo->in = fifo->out = 0; | 127 | return fifo->buffer != NULL; |
52 | } | 128 | } |
53 | 129 | ||
54 | /** | 130 | /** |
@@ -57,96 +133,484 @@ static inline void __kfifo_reset(struct kfifo *fifo) | |||
57 | */ | 133 | */ |
58 | static inline void kfifo_reset(struct kfifo *fifo) | 134 | static inline void kfifo_reset(struct kfifo *fifo) |
59 | { | 135 | { |
60 | unsigned long flags; | 136 | fifo->in = fifo->out = 0; |
137 | } | ||
61 | 138 | ||
62 | spin_lock_irqsave(fifo->lock, flags); | 139 | /** |
140 | * kfifo_reset_out - skip FIFO contents | ||
141 | * @fifo: the fifo to be emptied. | ||
142 | */ | ||
143 | static inline void kfifo_reset_out(struct kfifo *fifo) | ||
144 | { | ||
145 | smp_mb(); | ||
146 | fifo->out = fifo->in; | ||
147 | } | ||
63 | 148 | ||
64 | __kfifo_reset(fifo); | 149 | /** |
150 | * kfifo_size - returns the size of the fifo in bytes | ||
151 | * @fifo: the fifo to be used. | ||
152 | */ | ||
153 | static inline __must_check unsigned int kfifo_size(struct kfifo *fifo) | ||
154 | { | ||
155 | return fifo->size; | ||
156 | } | ||
65 | 157 | ||
66 | spin_unlock_irqrestore(fifo->lock, flags); | 158 | /** |
159 | * kfifo_len - returns the number of used bytes in the FIFO | ||
160 | * @fifo: the fifo to be used. | ||
161 | */ | ||
162 | static inline unsigned int kfifo_len(struct kfifo *fifo) | ||
163 | { | ||
164 | register unsigned int out; | ||
165 | |||
166 | out = fifo->out; | ||
167 | smp_rmb(); | ||
168 | return fifo->in - out; | ||
67 | } | 169 | } |
68 | 170 | ||
69 | /** | 171 | /** |
70 | * kfifo_put - puts some data into the FIFO | 172 | * kfifo_is_empty - returns true if the fifo is empty |
71 | * @fifo: the fifo to be used. | 173 | * @fifo: the fifo to be used. |
72 | * @buffer: the data to be added. | 174 | */ |
73 | * @len: the length of the data to be added. | 175 | static inline __must_check int kfifo_is_empty(struct kfifo *fifo) |
176 | { | ||
177 | return fifo->in == fifo->out; | ||
178 | } | ||
179 | |||
180 | /** | ||
181 | * kfifo_is_full - returns true if the fifo is full | ||
182 | * @fifo: the fifo to be used. | ||
183 | */ | ||
184 | static inline __must_check int kfifo_is_full(struct kfifo *fifo) | ||
185 | { | ||
186 | return kfifo_len(fifo) == kfifo_size(fifo); | ||
187 | } | ||
188 | |||
189 | /** | ||
190 | * kfifo_avail - returns the number of bytes available in the FIFO | ||
191 | * @fifo: the fifo to be used. | ||
192 | */ | ||
193 | static inline __must_check unsigned int kfifo_avail(struct kfifo *fifo) | ||
194 | { | ||
195 | return kfifo_size(fifo) - kfifo_len(fifo); | ||
196 | } | ||
197 | |||
198 | /** | ||
199 | * kfifo_in_locked - puts some data into the FIFO using a spinlock for locking | ||
200 | * @fifo: the fifo to be used. | ||
201 | * @from: the data to be added. | ||
202 | * @n: the length of the data to be added. | ||
203 | * @lock: pointer to the spinlock to use for locking. | ||
74 | * | 204 | * |
75 | * This function copies at most @len bytes from the @buffer into | 205 | * This function copies at most @len bytes from the @from buffer into |
76 | * the FIFO depending on the free space, and returns the number of | 206 | * the FIFO depending on the free space, and returns the number of |
77 | * bytes copied. | 207 | * bytes copied. |
78 | */ | 208 | */ |
79 | static inline unsigned int kfifo_put(struct kfifo *fifo, | 209 | static inline unsigned int kfifo_in_locked(struct kfifo *fifo, |
80 | const unsigned char *buffer, unsigned int len) | 210 | const void *from, unsigned int n, spinlock_t *lock) |
81 | { | 211 | { |
82 | unsigned long flags; | 212 | unsigned long flags; |
83 | unsigned int ret; | 213 | unsigned int ret; |
84 | 214 | ||
85 | spin_lock_irqsave(fifo->lock, flags); | 215 | spin_lock_irqsave(lock, flags); |
86 | 216 | ||
87 | ret = __kfifo_put(fifo, buffer, len); | 217 | ret = kfifo_in(fifo, from, n); |
88 | 218 | ||
89 | spin_unlock_irqrestore(fifo->lock, flags); | 219 | spin_unlock_irqrestore(lock, flags); |
90 | 220 | ||
91 | return ret; | 221 | return ret; |
92 | } | 222 | } |
93 | 223 | ||
94 | /** | 224 | /** |
95 | * kfifo_get - gets some data from the FIFO | 225 | * kfifo_out_locked - gets some data from the FIFO using a spinlock for locking |
96 | * @fifo: the fifo to be used. | 226 | * @fifo: the fifo to be used. |
97 | * @buffer: where the data must be copied. | 227 | * @to: where the data must be copied. |
98 | * @len: the size of the destination buffer. | 228 | * @n: the size of the destination buffer. |
229 | * @lock: pointer to the spinlock to use for locking. | ||
99 | * | 230 | * |
100 | * This function copies at most @len bytes from the FIFO into the | 231 | * This function copies at most @len bytes from the FIFO into the |
101 | * @buffer and returns the number of copied bytes. | 232 | * @to buffer and returns the number of copied bytes. |
102 | */ | 233 | */ |
103 | static inline unsigned int kfifo_get(struct kfifo *fifo, | 234 | static inline __must_check unsigned int kfifo_out_locked(struct kfifo *fifo, |
104 | unsigned char *buffer, unsigned int len) | 235 | void *to, unsigned int n, spinlock_t *lock) |
105 | { | 236 | { |
106 | unsigned long flags; | 237 | unsigned long flags; |
107 | unsigned int ret; | 238 | unsigned int ret; |
108 | 239 | ||
109 | spin_lock_irqsave(fifo->lock, flags); | 240 | spin_lock_irqsave(lock, flags); |
241 | |||
242 | ret = kfifo_out(fifo, to, n); | ||
243 | |||
244 | spin_unlock_irqrestore(lock, flags); | ||
245 | |||
246 | return ret; | ||
247 | } | ||
248 | |||
249 | extern void kfifo_skip(struct kfifo *fifo, unsigned int len); | ||
250 | |||
251 | extern __must_check int kfifo_from_user(struct kfifo *fifo, | ||
252 | const void __user *from, unsigned int n, unsigned *lenout); | ||
253 | |||
254 | extern __must_check int kfifo_to_user(struct kfifo *fifo, | ||
255 | void __user *to, unsigned int n, unsigned *lenout); | ||
256 | |||
257 | /* | ||
258 | * __kfifo_add_out internal helper function for updating the out offset | ||
259 | */ | ||
260 | static inline void __kfifo_add_out(struct kfifo *fifo, | ||
261 | unsigned int off) | ||
262 | { | ||
263 | smp_mb(); | ||
264 | fifo->out += off; | ||
265 | } | ||
266 | |||
267 | /* | ||
268 | * __kfifo_add_in internal helper function for updating the in offset | ||
269 | */ | ||
270 | static inline void __kfifo_add_in(struct kfifo *fifo, | ||
271 | unsigned int off) | ||
272 | { | ||
273 | smp_wmb(); | ||
274 | fifo->in += off; | ||
275 | } | ||
276 | |||
277 | /* | ||
278 | * __kfifo_off internal helper function for calculating the index of a | ||
279 | * given offeset | ||
280 | */ | ||
281 | static inline unsigned int __kfifo_off(struct kfifo *fifo, unsigned int off) | ||
282 | { | ||
283 | return off & (fifo->size - 1); | ||
284 | } | ||
285 | |||
286 | /* | ||
287 | * __kfifo_peek_n internal helper function for determinate the length of | ||
288 | * the next record in the fifo | ||
289 | */ | ||
290 | static inline unsigned int __kfifo_peek_n(struct kfifo *fifo, | ||
291 | unsigned int recsize) | ||
292 | { | ||
293 | #define __KFIFO_GET(fifo, off, shift) \ | ||
294 | ((fifo)->buffer[__kfifo_off((fifo), (fifo)->out+(off))] << (shift)) | ||
295 | |||
296 | unsigned int l; | ||
297 | |||
298 | l = __KFIFO_GET(fifo, 0, 0); | ||
299 | |||
300 | if (--recsize) | ||
301 | l |= __KFIFO_GET(fifo, 1, 8); | ||
302 | |||
303 | return l; | ||
304 | #undef __KFIFO_GET | ||
305 | } | ||
306 | |||
307 | /* | ||
308 | * __kfifo_poke_n internal helper function for storing the length of | ||
309 | * the next record into the fifo | ||
310 | */ | ||
311 | static inline void __kfifo_poke_n(struct kfifo *fifo, | ||
312 | unsigned int recsize, unsigned int n) | ||
313 | { | ||
314 | #define __KFIFO_PUT(fifo, off, val, shift) \ | ||
315 | ( \ | ||
316 | (fifo)->buffer[__kfifo_off((fifo), (fifo)->in+(off))] = \ | ||
317 | (unsigned char)((val) >> (shift)) \ | ||
318 | ) | ||
319 | |||
320 | __KFIFO_PUT(fifo, 0, n, 0); | ||
321 | |||
322 | if (--recsize) | ||
323 | __KFIFO_PUT(fifo, 1, n, 8); | ||
324 | #undef __KFIFO_PUT | ||
325 | } | ||
326 | |||
327 | /* | ||
328 | * __kfifo_in_... internal functions for put date into the fifo | ||
329 | * do not call it directly, use kfifo_in_rec() instead | ||
330 | */ | ||
331 | extern unsigned int __kfifo_in_n(struct kfifo *fifo, | ||
332 | const void *from, unsigned int n, unsigned int recsize); | ||
110 | 333 | ||
111 | ret = __kfifo_get(fifo, buffer, len); | 334 | extern unsigned int __kfifo_in_generic(struct kfifo *fifo, |
335 | const void *from, unsigned int n, unsigned int recsize); | ||
112 | 336 | ||
113 | /* | 337 | static inline unsigned int __kfifo_in_rec(struct kfifo *fifo, |
114 | * optimization: if the FIFO is empty, set the indices to 0 | 338 | const void *from, unsigned int n, unsigned int recsize) |
115 | * so we don't wrap the next time | 339 | { |
116 | */ | 340 | unsigned int ret; |
117 | if (fifo->in == fifo->out) | ||
118 | fifo->in = fifo->out = 0; | ||
119 | 341 | ||
120 | spin_unlock_irqrestore(fifo->lock, flags); | 342 | ret = __kfifo_in_n(fifo, from, n, recsize); |
121 | 343 | ||
344 | if (likely(ret == 0)) { | ||
345 | if (recsize) | ||
346 | __kfifo_poke_n(fifo, recsize, n); | ||
347 | __kfifo_add_in(fifo, n + recsize); | ||
348 | } | ||
122 | return ret; | 349 | return ret; |
123 | } | 350 | } |
124 | 351 | ||
125 | /** | 352 | /** |
126 | * __kfifo_len - returns the number of bytes available in the FIFO, no locking version | 353 | * kfifo_in_rec - puts some record data into the FIFO |
127 | * @fifo: the fifo to be used. | 354 | * @fifo: the fifo to be used. |
355 | * @from: the data to be added. | ||
356 | * @n: the length of the data to be added. | ||
357 | * @recsize: size of record field | ||
358 | * | ||
359 | * This function copies @n bytes from the @from into the FIFO and returns | ||
360 | * the number of bytes which cannot be copied. | ||
361 | * A returned value greater than the @n value means that the record doesn't | ||
362 | * fit into the buffer. | ||
363 | * | ||
364 | * Note that with only one concurrent reader and one concurrent | ||
365 | * writer, you don't need extra locking to use these functions. | ||
366 | */ | ||
367 | static inline __must_check unsigned int kfifo_in_rec(struct kfifo *fifo, | ||
368 | void *from, unsigned int n, unsigned int recsize) | ||
369 | { | ||
370 | if (!__builtin_constant_p(recsize)) | ||
371 | return __kfifo_in_generic(fifo, from, n, recsize); | ||
372 | return __kfifo_in_rec(fifo, from, n, recsize); | ||
373 | } | ||
374 | |||
375 | /* | ||
376 | * __kfifo_out_... internal functions for get date from the fifo | ||
377 | * do not call it directly, use kfifo_out_rec() instead | ||
128 | */ | 378 | */ |
129 | static inline unsigned int __kfifo_len(struct kfifo *fifo) | 379 | extern unsigned int __kfifo_out_n(struct kfifo *fifo, |
380 | void *to, unsigned int reclen, unsigned int recsize); | ||
381 | |||
382 | extern unsigned int __kfifo_out_generic(struct kfifo *fifo, | ||
383 | void *to, unsigned int n, | ||
384 | unsigned int recsize, unsigned int *total); | ||
385 | |||
386 | static inline unsigned int __kfifo_out_rec(struct kfifo *fifo, | ||
387 | void *to, unsigned int n, unsigned int recsize, | ||
388 | unsigned int *total) | ||
130 | { | 389 | { |
131 | return fifo->in - fifo->out; | 390 | unsigned int l; |
391 | |||
392 | if (!recsize) { | ||
393 | l = n; | ||
394 | if (total) | ||
395 | *total = l; | ||
396 | } else { | ||
397 | l = __kfifo_peek_n(fifo, recsize); | ||
398 | if (total) | ||
399 | *total = l; | ||
400 | if (n < l) | ||
401 | return l; | ||
402 | } | ||
403 | |||
404 | return __kfifo_out_n(fifo, to, l, recsize); | ||
132 | } | 405 | } |
133 | 406 | ||
134 | /** | 407 | /** |
135 | * kfifo_len - returns the number of bytes available in the FIFO | 408 | * kfifo_out_rec - gets some record data from the FIFO |
136 | * @fifo: the fifo to be used. | 409 | * @fifo: the fifo to be used. |
410 | * @to: where the data must be copied. | ||
411 | * @n: the size of the destination buffer. | ||
412 | * @recsize: size of record field | ||
413 | * @total: pointer where the total number of to copied bytes should stored | ||
414 | * | ||
415 | * This function copies at most @n bytes from the FIFO to @to and returns the | ||
416 | * number of bytes which cannot be copied. | ||
417 | * A returned value greater than the @n value means that the record doesn't | ||
418 | * fit into the @to buffer. | ||
419 | * | ||
420 | * Note that with only one concurrent reader and one concurrent | ||
421 | * writer, you don't need extra locking to use these functions. | ||
137 | */ | 422 | */ |
138 | static inline unsigned int kfifo_len(struct kfifo *fifo) | 423 | static inline __must_check unsigned int kfifo_out_rec(struct kfifo *fifo, |
424 | void *to, unsigned int n, unsigned int recsize, | ||
425 | unsigned int *total) | ||
426 | |||
139 | { | 427 | { |
140 | unsigned long flags; | 428 | if (!__builtin_constant_p(recsize)) |
141 | unsigned int ret; | 429 | return __kfifo_out_generic(fifo, to, n, recsize, total); |
430 | return __kfifo_out_rec(fifo, to, n, recsize, total); | ||
431 | } | ||
142 | 432 | ||
143 | spin_lock_irqsave(fifo->lock, flags); | 433 | /* |
434 | * __kfifo_from_user_... internal functions for transfer from user space into | ||
435 | * the fifo. do not call it directly, use kfifo_from_user_rec() instead | ||
436 | */ | ||
437 | extern unsigned int __kfifo_from_user_n(struct kfifo *fifo, | ||
438 | const void __user *from, unsigned int n, unsigned int recsize); | ||
439 | |||
440 | extern unsigned int __kfifo_from_user_generic(struct kfifo *fifo, | ||
441 | const void __user *from, unsigned int n, unsigned int recsize); | ||
144 | 442 | ||
145 | ret = __kfifo_len(fifo); | 443 | static inline unsigned int __kfifo_from_user_rec(struct kfifo *fifo, |
444 | const void __user *from, unsigned int n, unsigned int recsize) | ||
445 | { | ||
446 | unsigned int ret; | ||
146 | 447 | ||
147 | spin_unlock_irqrestore(fifo->lock, flags); | 448 | ret = __kfifo_from_user_n(fifo, from, n, recsize); |
148 | 449 | ||
450 | if (likely(ret == 0)) { | ||
451 | if (recsize) | ||
452 | __kfifo_poke_n(fifo, recsize, n); | ||
453 | __kfifo_add_in(fifo, n + recsize); | ||
454 | } | ||
149 | return ret; | 455 | return ret; |
150 | } | 456 | } |
151 | 457 | ||
458 | /** | ||
459 | * kfifo_from_user_rec - puts some data from user space into the FIFO | ||
460 | * @fifo: the fifo to be used. | ||
461 | * @from: pointer to the data to be added. | ||
462 | * @n: the length of the data to be added. | ||
463 | * @recsize: size of record field | ||
464 | * | ||
465 | * This function copies @n bytes from the @from into the | ||
466 | * FIFO and returns the number of bytes which cannot be copied. | ||
467 | * | ||
468 | * If the returned value is equal or less the @n value, the copy_from_user() | ||
469 | * functions has failed. Otherwise the record doesn't fit into the buffer. | ||
470 | * | ||
471 | * Note that with only one concurrent reader and one concurrent | ||
472 | * writer, you don't need extra locking to use these functions. | ||
473 | */ | ||
474 | static inline __must_check unsigned int kfifo_from_user_rec(struct kfifo *fifo, | ||
475 | const void __user *from, unsigned int n, unsigned int recsize) | ||
476 | { | ||
477 | if (!__builtin_constant_p(recsize)) | ||
478 | return __kfifo_from_user_generic(fifo, from, n, recsize); | ||
479 | return __kfifo_from_user_rec(fifo, from, n, recsize); | ||
480 | } | ||
481 | |||
482 | /* | ||
483 | * __kfifo_to_user_... internal functions for transfer fifo data into user space | ||
484 | * do not call it directly, use kfifo_to_user_rec() instead | ||
485 | */ | ||
486 | extern unsigned int __kfifo_to_user_n(struct kfifo *fifo, | ||
487 | void __user *to, unsigned int n, unsigned int reclen, | ||
488 | unsigned int recsize); | ||
489 | |||
490 | extern unsigned int __kfifo_to_user_generic(struct kfifo *fifo, | ||
491 | void __user *to, unsigned int n, unsigned int recsize, | ||
492 | unsigned int *total); | ||
493 | |||
494 | static inline unsigned int __kfifo_to_user_rec(struct kfifo *fifo, | ||
495 | void __user *to, unsigned int n, | ||
496 | unsigned int recsize, unsigned int *total) | ||
497 | { | ||
498 | unsigned int l; | ||
499 | |||
500 | if (!recsize) { | ||
501 | l = n; | ||
502 | if (total) | ||
503 | *total = l; | ||
504 | } else { | ||
505 | l = __kfifo_peek_n(fifo, recsize); | ||
506 | if (total) | ||
507 | *total = l; | ||
508 | if (n < l) | ||
509 | return l; | ||
510 | } | ||
511 | |||
512 | return __kfifo_to_user_n(fifo, to, n, l, recsize); | ||
513 | } | ||
514 | |||
515 | /** | ||
516 | * kfifo_to_user_rec - gets data from the FIFO and write it to user space | ||
517 | * @fifo: the fifo to be used. | ||
518 | * @to: where the data must be copied. | ||
519 | * @n: the size of the destination buffer. | ||
520 | * @recsize: size of record field | ||
521 | * @total: pointer where the total number of to copied bytes should stored | ||
522 | * | ||
523 | * This function copies at most @n bytes from the FIFO to the @to. | ||
524 | * In case of an error, the function returns the number of bytes which cannot | ||
525 | * be copied. | ||
526 | * If the returned value is equal or less the @n value, the copy_to_user() | ||
527 | * functions has failed. Otherwise the record doesn't fit into the @to buffer. | ||
528 | * | ||
529 | * Note that with only one concurrent reader and one concurrent | ||
530 | * writer, you don't need extra locking to use these functions. | ||
531 | */ | ||
532 | static inline __must_check unsigned int kfifo_to_user_rec(struct kfifo *fifo, | ||
533 | void __user *to, unsigned int n, unsigned int recsize, | ||
534 | unsigned int *total) | ||
535 | { | ||
536 | if (!__builtin_constant_p(recsize)) | ||
537 | return __kfifo_to_user_generic(fifo, to, n, recsize, total); | ||
538 | return __kfifo_to_user_rec(fifo, to, n, recsize, total); | ||
539 | } | ||
540 | |||
541 | /* | ||
542 | * __kfifo_peek_... internal functions for peek into the next fifo record | ||
543 | * do not call it directly, use kfifo_peek_rec() instead | ||
544 | */ | ||
545 | extern unsigned int __kfifo_peek_generic(struct kfifo *fifo, | ||
546 | unsigned int recsize); | ||
547 | |||
548 | /** | ||
549 | * kfifo_peek_rec - gets the size of the next FIFO record data | ||
550 | * @fifo: the fifo to be used. | ||
551 | * @recsize: size of record field | ||
552 | * | ||
553 | * This function returns the size of the next FIFO record in number of bytes | ||
554 | */ | ||
555 | static inline __must_check unsigned int kfifo_peek_rec(struct kfifo *fifo, | ||
556 | unsigned int recsize) | ||
557 | { | ||
558 | if (!__builtin_constant_p(recsize)) | ||
559 | return __kfifo_peek_generic(fifo, recsize); | ||
560 | if (!recsize) | ||
561 | return kfifo_len(fifo); | ||
562 | return __kfifo_peek_n(fifo, recsize); | ||
563 | } | ||
564 | |||
565 | /* | ||
566 | * __kfifo_skip_... internal functions for skip the next fifo record | ||
567 | * do not call it directly, use kfifo_skip_rec() instead | ||
568 | */ | ||
569 | extern void __kfifo_skip_generic(struct kfifo *fifo, unsigned int recsize); | ||
570 | |||
571 | static inline void __kfifo_skip_rec(struct kfifo *fifo, | ||
572 | unsigned int recsize) | ||
573 | { | ||
574 | unsigned int l; | ||
575 | |||
576 | if (recsize) { | ||
577 | l = __kfifo_peek_n(fifo, recsize); | ||
578 | |||
579 | if (l + recsize <= kfifo_len(fifo)) { | ||
580 | __kfifo_add_out(fifo, l + recsize); | ||
581 | return; | ||
582 | } | ||
583 | } | ||
584 | kfifo_reset_out(fifo); | ||
585 | } | ||
586 | |||
587 | /** | ||
588 | * kfifo_skip_rec - skip the next fifo out record | ||
589 | * @fifo: the fifo to be used. | ||
590 | * @recsize: size of record field | ||
591 | * | ||
592 | * This function skips the next FIFO record | ||
593 | */ | ||
594 | static inline void kfifo_skip_rec(struct kfifo *fifo, | ||
595 | unsigned int recsize) | ||
596 | { | ||
597 | if (!__builtin_constant_p(recsize)) | ||
598 | __kfifo_skip_generic(fifo, recsize); | ||
599 | else | ||
600 | __kfifo_skip_rec(fifo, recsize); | ||
601 | } | ||
602 | |||
603 | /** | ||
604 | * kfifo_avail_rec - returns the number of bytes available in a record FIFO | ||
605 | * @fifo: the fifo to be used. | ||
606 | * @recsize: size of record field | ||
607 | */ | ||
608 | static inline __must_check unsigned int kfifo_avail_rec(struct kfifo *fifo, | ||
609 | unsigned int recsize) | ||
610 | { | ||
611 | unsigned int l = kfifo_size(fifo) - kfifo_len(fifo); | ||
612 | |||
613 | return (l > recsize) ? l - recsize : 0; | ||
614 | } | ||
615 | |||
152 | #endif | 616 | #endif |
diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h index 6adcc297e354..19ec41a183f5 100644 --- a/include/linux/kgdb.h +++ b/include/linux/kgdb.h | |||
@@ -29,8 +29,7 @@ struct pt_regs; | |||
29 | * | 29 | * |
30 | * On some architectures it is required to skip a breakpoint | 30 | * On some architectures it is required to skip a breakpoint |
31 | * exception when it occurs after a breakpoint has been removed. | 31 | * exception when it occurs after a breakpoint has been removed. |
32 | * This can be implemented in the architecture specific portion of | 32 | * This can be implemented in the architecture specific portion of kgdb. |
33 | * for kgdb. | ||
34 | */ | 33 | */ |
35 | extern int kgdb_skipexception(int exception, struct pt_regs *regs); | 34 | extern int kgdb_skipexception(int exception, struct pt_regs *regs); |
36 | 35 | ||
@@ -65,7 +64,7 @@ struct uart_port; | |||
65 | /** | 64 | /** |
66 | * kgdb_breakpoint - compiled in breakpoint | 65 | * kgdb_breakpoint - compiled in breakpoint |
67 | * | 66 | * |
68 | * This will be impelmented a static inline per architecture. This | 67 | * This will be implemented as a static inline per architecture. This |
69 | * function is called by the kgdb core to execute an architecture | 68 | * function is called by the kgdb core to execute an architecture |
70 | * specific trap to cause kgdb to enter the exception processing. | 69 | * specific trap to cause kgdb to enter the exception processing. |
71 | * | 70 | * |
@@ -190,7 +189,7 @@ kgdb_arch_handle_exception(int vector, int signo, int err_code, | |||
190 | * @flags: Current IRQ state | 189 | * @flags: Current IRQ state |
191 | * | 190 | * |
192 | * On SMP systems, we need to get the attention of the other CPUs | 191 | * On SMP systems, we need to get the attention of the other CPUs |
193 | * and get them be in a known state. This should do what is needed | 192 | * and get them into a known state. This should do what is needed |
194 | * to get the other CPUs to call kgdb_wait(). Note that on some arches, | 193 | * to get the other CPUs to call kgdb_wait(). Note that on some arches, |
195 | * the NMI approach is not used for rounding up all the CPUs. For example, | 194 | * the NMI approach is not used for rounding up all the CPUs. For example, |
196 | * in case of MIPS, smp_call_function() is used to roundup CPUs. In | 195 | * in case of MIPS, smp_call_function() is used to roundup CPUs. In |
diff --git a/include/linux/kmemcheck.h b/include/linux/kmemcheck.h index e880d4cf9e22..08d7dc4ddf40 100644 --- a/include/linux/kmemcheck.h +++ b/include/linux/kmemcheck.h | |||
@@ -36,6 +36,56 @@ int kmemcheck_hide_addr(unsigned long address); | |||
36 | 36 | ||
37 | bool kmemcheck_is_obj_initialized(unsigned long addr, size_t size); | 37 | bool kmemcheck_is_obj_initialized(unsigned long addr, size_t size); |
38 | 38 | ||
39 | /* | ||
40 | * Bitfield annotations | ||
41 | * | ||
42 | * How to use: If you have a struct using bitfields, for example | ||
43 | * | ||
44 | * struct a { | ||
45 | * int x:8, y:8; | ||
46 | * }; | ||
47 | * | ||
48 | * then this should be rewritten as | ||
49 | * | ||
50 | * struct a { | ||
51 | * kmemcheck_bitfield_begin(flags); | ||
52 | * int x:8, y:8; | ||
53 | * kmemcheck_bitfield_end(flags); | ||
54 | * }; | ||
55 | * | ||
56 | * Now the "flags_begin" and "flags_end" members may be used to refer to the | ||
57 | * beginning and end, respectively, of the bitfield (and things like | ||
58 | * &x.flags_begin is allowed). As soon as the struct is allocated, the bit- | ||
59 | * fields should be annotated: | ||
60 | * | ||
61 | * struct a *a = kmalloc(sizeof(struct a), GFP_KERNEL); | ||
62 | * kmemcheck_annotate_bitfield(a, flags); | ||
63 | */ | ||
64 | #define kmemcheck_bitfield_begin(name) \ | ||
65 | int name##_begin[0]; | ||
66 | |||
67 | #define kmemcheck_bitfield_end(name) \ | ||
68 | int name##_end[0]; | ||
69 | |||
70 | #define kmemcheck_annotate_bitfield(ptr, name) \ | ||
71 | do { \ | ||
72 | int _n; \ | ||
73 | \ | ||
74 | if (!ptr) \ | ||
75 | break; \ | ||
76 | \ | ||
77 | _n = (long) &((ptr)->name##_end) \ | ||
78 | - (long) &((ptr)->name##_begin); \ | ||
79 | MAYBE_BUILD_BUG_ON(_n < 0); \ | ||
80 | \ | ||
81 | kmemcheck_mark_initialized(&((ptr)->name##_begin), _n); \ | ||
82 | } while (0) | ||
83 | |||
84 | #define kmemcheck_annotate_variable(var) \ | ||
85 | do { \ | ||
86 | kmemcheck_mark_initialized(&(var), sizeof(var)); \ | ||
87 | } while (0) \ | ||
88 | |||
39 | #else | 89 | #else |
40 | #define kmemcheck_enabled 0 | 90 | #define kmemcheck_enabled 0 |
41 | 91 | ||
@@ -106,60 +156,16 @@ static inline bool kmemcheck_is_obj_initialized(unsigned long addr, size_t size) | |||
106 | return true; | 156 | return true; |
107 | } | 157 | } |
108 | 158 | ||
109 | #endif /* CONFIG_KMEMCHECK */ | 159 | #define kmemcheck_bitfield_begin(name) |
110 | 160 | #define kmemcheck_bitfield_end(name) | |
111 | /* | 161 | #define kmemcheck_annotate_bitfield(ptr, name) \ |
112 | * Bitfield annotations | 162 | do { \ |
113 | * | 163 | } while (0) |
114 | * How to use: If you have a struct using bitfields, for example | ||
115 | * | ||
116 | * struct a { | ||
117 | * int x:8, y:8; | ||
118 | * }; | ||
119 | * | ||
120 | * then this should be rewritten as | ||
121 | * | ||
122 | * struct a { | ||
123 | * kmemcheck_bitfield_begin(flags); | ||
124 | * int x:8, y:8; | ||
125 | * kmemcheck_bitfield_end(flags); | ||
126 | * }; | ||
127 | * | ||
128 | * Now the "flags_begin" and "flags_end" members may be used to refer to the | ||
129 | * beginning and end, respectively, of the bitfield (and things like | ||
130 | * &x.flags_begin is allowed). As soon as the struct is allocated, the bit- | ||
131 | * fields should be annotated: | ||
132 | * | ||
133 | * struct a *a = kmalloc(sizeof(struct a), GFP_KERNEL); | ||
134 | * kmemcheck_annotate_bitfield(a, flags); | ||
135 | * | ||
136 | * Note: We provide the same definitions for both kmemcheck and non- | ||
137 | * kmemcheck kernels. This makes it harder to introduce accidental errors. It | ||
138 | * is also allowed to pass NULL pointers to kmemcheck_annotate_bitfield(). | ||
139 | */ | ||
140 | #define kmemcheck_bitfield_begin(name) \ | ||
141 | int name##_begin[0]; | ||
142 | |||
143 | #define kmemcheck_bitfield_end(name) \ | ||
144 | int name##_end[0]; | ||
145 | 164 | ||
146 | #define kmemcheck_annotate_bitfield(ptr, name) \ | 165 | #define kmemcheck_annotate_variable(var) \ |
147 | do { \ | 166 | do { \ |
148 | int _n; \ | ||
149 | \ | ||
150 | if (!ptr) \ | ||
151 | break; \ | ||
152 | \ | ||
153 | _n = (long) &((ptr)->name##_end) \ | ||
154 | - (long) &((ptr)->name##_begin); \ | ||
155 | MAYBE_BUILD_BUG_ON(_n < 0); \ | ||
156 | \ | ||
157 | kmemcheck_mark_initialized(&((ptr)->name##_begin), _n); \ | ||
158 | } while (0) | 167 | } while (0) |
159 | 168 | ||
160 | #define kmemcheck_annotate_variable(var) \ | 169 | #endif /* CONFIG_KMEMCHECK */ |
161 | do { \ | ||
162 | kmemcheck_mark_initialized(&(var), sizeof(var)); \ | ||
163 | } while (0) \ | ||
164 | 170 | ||
165 | #endif /* LINUX_KMEMCHECK_H */ | 171 | #endif /* LINUX_KMEMCHECK_H */ |
diff --git a/include/linux/kmemleak.h b/include/linux/kmemleak.h index 3c7497d46ee9..99d9a6766f7e 100644 --- a/include/linux/kmemleak.h +++ b/include/linux/kmemleak.h | |||
@@ -32,8 +32,7 @@ extern void kmemleak_padding(const void *ptr, unsigned long offset, | |||
32 | size_t size) __ref; | 32 | size_t size) __ref; |
33 | extern void kmemleak_not_leak(const void *ptr) __ref; | 33 | extern void kmemleak_not_leak(const void *ptr) __ref; |
34 | extern void kmemleak_ignore(const void *ptr) __ref; | 34 | extern void kmemleak_ignore(const void *ptr) __ref; |
35 | extern void kmemleak_scan_area(const void *ptr, unsigned long offset, | 35 | extern void kmemleak_scan_area(const void *ptr, size_t size, gfp_t gfp) __ref; |
36 | size_t length, gfp_t gfp) __ref; | ||
37 | extern void kmemleak_no_scan(const void *ptr) __ref; | 36 | extern void kmemleak_no_scan(const void *ptr) __ref; |
38 | 37 | ||
39 | static inline void kmemleak_alloc_recursive(const void *ptr, size_t size, | 38 | static inline void kmemleak_alloc_recursive(const void *ptr, size_t size, |
@@ -84,8 +83,7 @@ static inline void kmemleak_not_leak(const void *ptr) | |||
84 | static inline void kmemleak_ignore(const void *ptr) | 83 | static inline void kmemleak_ignore(const void *ptr) |
85 | { | 84 | { |
86 | } | 85 | } |
87 | static inline void kmemleak_scan_area(const void *ptr, unsigned long offset, | 86 | static inline void kmemleak_scan_area(const void *ptr, size_t size, gfp_t gfp) |
88 | size_t length, gfp_t gfp) | ||
89 | { | 87 | { |
90 | } | 88 | } |
91 | static inline void kmemleak_erase(void **ptr) | 89 | static inline void kmemleak_erase(void **ptr) |
diff --git a/include/linux/leds-lp3944.h b/include/linux/leds-lp3944.h index afc9f9fd70f5..2618aa9063bc 100644 --- a/include/linux/leds-lp3944.h +++ b/include/linux/leds-lp3944.h | |||
@@ -12,9 +12,6 @@ | |||
12 | #ifndef __LINUX_LEDS_LP3944_H | 12 | #ifndef __LINUX_LEDS_LP3944_H |
13 | #define __LINUX_LEDS_LP3944_H | 13 | #define __LINUX_LEDS_LP3944_H |
14 | 14 | ||
15 | #include <linux/leds.h> | ||
16 | #include <linux/workqueue.h> | ||
17 | |||
18 | #define LP3944_LED0 0 | 15 | #define LP3944_LED0 0 |
19 | #define LP3944_LED1 1 | 16 | #define LP3944_LED1 1 |
20 | #define LP3944_LED2 2 | 17 | #define LP3944_LED2 2 |
diff --git a/include/linux/leds-pca9532.h b/include/linux/leds-pca9532.h index 96eea90f01a8..f158eb1149aa 100644 --- a/include/linux/leds-pca9532.h +++ b/include/linux/leds-pca9532.h | |||
@@ -32,7 +32,7 @@ struct pca9532_led { | |||
32 | struct i2c_client *client; | 32 | struct i2c_client *client; |
33 | char *name; | 33 | char *name; |
34 | struct led_classdev ldev; | 34 | struct led_classdev ldev; |
35 | struct work_struct work; | 35 | struct work_struct work; |
36 | enum pca9532_type type; | 36 | enum pca9532_type type; |
37 | enum pca9532_state state; | 37 | enum pca9532_state state; |
38 | }; | 38 | }; |
diff --git a/include/linux/leds-regulator.h b/include/linux/leds-regulator.h new file mode 100644 index 000000000000..5a8eb389aab8 --- /dev/null +++ b/include/linux/leds-regulator.h | |||
@@ -0,0 +1,46 @@ | |||
1 | /* | ||
2 | * leds-regulator.h - platform data structure for regulator driven LEDs. | ||
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_REGULATOR_H | ||
13 | #define __LINUX_LEDS_REGULATOR_H | ||
14 | |||
15 | /* | ||
16 | * Use "vled" as supply id when declaring the regulator consumer: | ||
17 | * | ||
18 | * static struct regulator_consumer_supply pcap_regulator_VVIB_consumers [] = { | ||
19 | * { .dev_name = "leds-regulator.0", supply = "vled" }, | ||
20 | * }; | ||
21 | * | ||
22 | * If you have several regulator driven LEDs, you can append a numerical id to | ||
23 | * .dev_name as done above, and use the same id when declaring the platform | ||
24 | * device: | ||
25 | * | ||
26 | * static struct led_regulator_platform_data a780_vibrator_data = { | ||
27 | * .name = "a780::vibrator", | ||
28 | * }; | ||
29 | * | ||
30 | * static struct platform_device a780_vibrator = { | ||
31 | * .name = "leds-regulator", | ||
32 | * .id = 0, | ||
33 | * .dev = { | ||
34 | * .platform_data = &a780_vibrator_data, | ||
35 | * }, | ||
36 | * }; | ||
37 | */ | ||
38 | |||
39 | #include <linux/leds.h> | ||
40 | |||
41 | struct led_regulator_platform_data { | ||
42 | char *name; /* LED name as expected by LED class */ | ||
43 | enum led_brightness brightness; /* initial brightness value */ | ||
44 | }; | ||
45 | |||
46 | #endif /* __LINUX_LEDS_REGULATOR_H */ | ||
diff --git a/include/linux/libata.h b/include/linux/libata.h index 6a9c4ddd3d95..73112250862c 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -354,6 +354,9 @@ enum { | |||
354 | /* max tries if error condition is still set after ->error_handler */ | 354 | /* max tries if error condition is still set after ->error_handler */ |
355 | ATA_EH_MAX_TRIES = 5, | 355 | ATA_EH_MAX_TRIES = 5, |
356 | 356 | ||
357 | /* sometimes resuming a link requires several retries */ | ||
358 | ATA_LINK_RESUME_TRIES = 5, | ||
359 | |||
357 | /* how hard are we gonna try to probe/recover devices */ | 360 | /* how hard are we gonna try to probe/recover devices */ |
358 | ATA_PROBE_MAX_TRIES = 3, | 361 | ATA_PROBE_MAX_TRIES = 3, |
359 | ATA_EH_DEV_TRIES = 3, | 362 | ATA_EH_DEV_TRIES = 3, |
diff --git a/include/linux/list_sort.h b/include/linux/list_sort.h new file mode 100644 index 000000000000..1a2df2efb771 --- /dev/null +++ b/include/linux/list_sort.h | |||
@@ -0,0 +1,11 @@ | |||
1 | #ifndef _LINUX_LIST_SORT_H | ||
2 | #define _LINUX_LIST_SORT_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | struct list_head; | ||
7 | |||
8 | void list_sort(void *priv, struct list_head *head, | ||
9 | int (*cmp)(void *priv, struct list_head *a, | ||
10 | struct list_head *b)); | ||
11 | #endif | ||
diff --git a/include/linux/lmb.h b/include/linux/lmb.h index 2442e3f3d033..ef82b8fcbddb 100644 --- a/include/linux/lmb.h +++ b/include/linux/lmb.h | |||
@@ -54,6 +54,7 @@ extern u64 __init lmb_phys_mem_size(void); | |||
54 | extern u64 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_is_region_reserved(u64 base, u64 size); | ||
57 | extern int lmb_find(struct lmb_property *res); | 58 | extern int lmb_find(struct lmb_property *res); |
58 | 59 | ||
59 | extern void lmb_dump_all(void); | 60 | extern void lmb_dump_all(void); |
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 0b46c2068b96..1f9b119f4ace 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -73,6 +73,7 @@ extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan, | |||
73 | extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask); | 73 | extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask); |
74 | int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem); | 74 | int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem); |
75 | 75 | ||
76 | extern struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page); | ||
76 | extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p); | 77 | extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p); |
77 | 78 | ||
78 | static inline | 79 | static inline |
@@ -85,6 +86,8 @@ int mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *cgroup) | |||
85 | return cgroup == mem; | 86 | return cgroup == mem; |
86 | } | 87 | } |
87 | 88 | ||
89 | extern struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *mem); | ||
90 | |||
88 | extern int | 91 | extern int |
89 | mem_cgroup_prepare_migration(struct page *page, struct mem_cgroup **ptr); | 92 | mem_cgroup_prepare_migration(struct page *page, struct mem_cgroup **ptr); |
90 | extern void mem_cgroup_end_migration(struct mem_cgroup *mem, | 93 | extern void mem_cgroup_end_migration(struct mem_cgroup *mem, |
@@ -202,6 +205,11 @@ mem_cgroup_move_lists(struct page *page, enum lru_list from, enum lru_list to) | |||
202 | { | 205 | { |
203 | } | 206 | } |
204 | 207 | ||
208 | static inline struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page) | ||
209 | { | ||
210 | return NULL; | ||
211 | } | ||
212 | |||
205 | static inline int mm_match_cgroup(struct mm_struct *mm, struct mem_cgroup *mem) | 213 | static inline int mm_match_cgroup(struct mm_struct *mm, struct mem_cgroup *mem) |
206 | { | 214 | { |
207 | return 1; | 215 | return 1; |
@@ -213,6 +221,11 @@ static inline int task_in_mem_cgroup(struct task_struct *task, | |||
213 | return 1; | 221 | return 1; |
214 | } | 222 | } |
215 | 223 | ||
224 | static inline struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *mem) | ||
225 | { | ||
226 | return NULL; | ||
227 | } | ||
228 | |||
216 | static inline int | 229 | static inline int |
217 | mem_cgroup_prepare_migration(struct page *page, struct mem_cgroup **ptr) | 230 | mem_cgroup_prepare_migration(struct page *page, struct mem_cgroup **ptr) |
218 | { | 231 | { |
diff --git a/include/linux/memory.h b/include/linux/memory.h index 37fa19b34ef5..1adfe779eb99 100644 --- a/include/linux/memory.h +++ b/include/linux/memory.h | |||
@@ -50,6 +50,19 @@ struct memory_notify { | |||
50 | int status_change_nid; | 50 | int status_change_nid; |
51 | }; | 51 | }; |
52 | 52 | ||
53 | /* | ||
54 | * During pageblock isolation, count the number of pages within the | ||
55 | * range [start_pfn, start_pfn + nr_pages) which are owned by code | ||
56 | * in the notifier chain. | ||
57 | */ | ||
58 | #define MEM_ISOLATE_COUNT (1<<0) | ||
59 | |||
60 | struct memory_isolate_notify { | ||
61 | unsigned long start_pfn; /* Start of range to check */ | ||
62 | unsigned int nr_pages; /* # pages in range to check */ | ||
63 | unsigned int pages_found; /* # pages owned found by callbacks */ | ||
64 | }; | ||
65 | |||
53 | struct notifier_block; | 66 | struct notifier_block; |
54 | struct mem_section; | 67 | struct mem_section; |
55 | 68 | ||
@@ -76,14 +89,28 @@ static inline int memory_notify(unsigned long val, void *v) | |||
76 | { | 89 | { |
77 | return 0; | 90 | return 0; |
78 | } | 91 | } |
92 | static inline int register_memory_isolate_notifier(struct notifier_block *nb) | ||
93 | { | ||
94 | return 0; | ||
95 | } | ||
96 | static inline void unregister_memory_isolate_notifier(struct notifier_block *nb) | ||
97 | { | ||
98 | } | ||
99 | static inline int memory_isolate_notify(unsigned long val, void *v) | ||
100 | { | ||
101 | return 0; | ||
102 | } | ||
79 | #else | 103 | #else |
80 | extern int register_memory_notifier(struct notifier_block *nb); | 104 | extern int register_memory_notifier(struct notifier_block *nb); |
81 | extern void unregister_memory_notifier(struct notifier_block *nb); | 105 | extern void unregister_memory_notifier(struct notifier_block *nb); |
106 | extern int register_memory_isolate_notifier(struct notifier_block *nb); | ||
107 | extern void unregister_memory_isolate_notifier(struct notifier_block *nb); | ||
82 | extern int register_new_memory(int, struct mem_section *); | 108 | extern int register_new_memory(int, struct mem_section *); |
83 | extern int unregister_memory_section(struct mem_section *); | 109 | extern int unregister_memory_section(struct mem_section *); |
84 | extern int memory_dev_init(void); | 110 | extern int memory_dev_init(void); |
85 | extern int remove_memory_block(unsigned long, struct mem_section *, int); | 111 | extern int remove_memory_block(unsigned long, struct mem_section *, int); |
86 | extern int memory_notify(unsigned long val, void *v); | 112 | extern int memory_notify(unsigned long val, void *v); |
113 | extern int memory_isolate_notify(unsigned long val, void *v); | ||
87 | extern struct memory_block *find_memory_block(struct mem_section *); | 114 | extern struct memory_block *find_memory_block(struct mem_section *); |
88 | #define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT) | 115 | #define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT) |
89 | enum mem_add_context { BOOT, HOTPLUG }; | 116 | enum mem_add_context { BOOT, HOTPLUG }; |
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h index 6b9c5d06690c..9cb1834deffa 100644 --- a/include/linux/mfd/tmio.h +++ b/include/linux/mfd/tmio.h | |||
@@ -2,6 +2,8 @@ | |||
2 | #define MFD_TMIO_H | 2 | #define MFD_TMIO_H |
3 | 3 | ||
4 | #include <linux/fb.h> | 4 | #include <linux/fb.h> |
5 | #include <linux/io.h> | ||
6 | #include <linux/platform_device.h> | ||
5 | 7 | ||
6 | #define tmio_ioread8(addr) readb(addr) | 8 | #define tmio_ioread8(addr) readb(addr) |
7 | #define tmio_ioread16(addr) readw(addr) | 9 | #define tmio_ioread16(addr) readw(addr) |
@@ -18,11 +20,48 @@ | |||
18 | writew((val) >> 16, (addr) + 2); \ | 20 | writew((val) >> 16, (addr) + 2); \ |
19 | } while (0) | 21 | } while (0) |
20 | 22 | ||
23 | #define CNF_CMD 0x04 | ||
24 | #define CNF_CTL_BASE 0x10 | ||
25 | #define CNF_INT_PIN 0x3d | ||
26 | #define CNF_STOP_CLK_CTL 0x40 | ||
27 | #define CNF_GCLK_CTL 0x41 | ||
28 | #define CNF_SD_CLK_MODE 0x42 | ||
29 | #define CNF_PIN_STATUS 0x44 | ||
30 | #define CNF_PWR_CTL_1 0x48 | ||
31 | #define CNF_PWR_CTL_2 0x49 | ||
32 | #define CNF_PWR_CTL_3 0x4a | ||
33 | #define CNF_CARD_DETECT_MODE 0x4c | ||
34 | #define CNF_SD_SLOT 0x50 | ||
35 | #define CNF_EXT_GCLK_CTL_1 0xf0 | ||
36 | #define CNF_EXT_GCLK_CTL_2 0xf1 | ||
37 | #define CNF_EXT_GCLK_CTL_3 0xf9 | ||
38 | #define CNF_SD_LED_EN_1 0xfa | ||
39 | #define CNF_SD_LED_EN_2 0xfe | ||
40 | |||
41 | #define SDCREN 0x2 /* Enable access to MMC CTL regs. (flag in COMMAND_REG)*/ | ||
42 | |||
43 | #define sd_config_write8(base, shift, reg, val) \ | ||
44 | tmio_iowrite8((val), (base) + ((reg) << (shift))) | ||
45 | #define sd_config_write16(base, shift, reg, val) \ | ||
46 | tmio_iowrite16((val), (base) + ((reg) << (shift))) | ||
47 | #define sd_config_write32(base, shift, reg, val) \ | ||
48 | do { \ | ||
49 | tmio_iowrite16((val), (base) + ((reg) << (shift))); \ | ||
50 | tmio_iowrite16((val) >> 16, (base) + ((reg + 2) << (shift))); \ | ||
51 | } while (0) | ||
52 | |||
53 | int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base); | ||
54 | int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base); | ||
55 | void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state); | ||
56 | void tmio_core_mmc_clk_div(void __iomem *cnf, int shift, int state); | ||
57 | |||
21 | /* | 58 | /* |
22 | * data for the MMC controller | 59 | * data for the MMC controller |
23 | */ | 60 | */ |
24 | struct tmio_mmc_data { | 61 | struct tmio_mmc_data { |
25 | const unsigned int hclk; | 62 | const unsigned int hclk; |
63 | void (*set_pwr)(struct platform_device *host, int state); | ||
64 | void (*set_clk_div)(struct platform_device *host, int state); | ||
26 | }; | 65 | }; |
27 | 66 | ||
28 | /* | 67 | /* |
diff --git a/include/linux/mfd/wm831x/pdata.h b/include/linux/mfd/wm831x/pdata.h index 415c228743d5..fd322aca33ba 100644 --- a/include/linux/mfd/wm831x/pdata.h +++ b/include/linux/mfd/wm831x/pdata.h | |||
@@ -41,6 +41,23 @@ struct wm831x_battery_pdata { | |||
41 | int timeout; /** Charge cycle timeout, in minutes */ | 41 | int timeout; /** Charge cycle timeout, in minutes */ |
42 | }; | 42 | }; |
43 | 43 | ||
44 | /** | ||
45 | * Configuration for the WM831x DC-DC BuckWise convertors. This | ||
46 | * should be passed as driver_data in the regulator_init_data. | ||
47 | * | ||
48 | * Currently all the configuration is for the fast DVS switching | ||
49 | * support of the devices. This allows MFPs on the device to be | ||
50 | * configured as an input to switch between two output voltages, | ||
51 | * allowing voltage transitions without the expense of an access over | ||
52 | * I2C or SPI buses. | ||
53 | */ | ||
54 | struct wm831x_buckv_pdata { | ||
55 | int dvs_gpio; /** CPU GPIO to use for DVS switching */ | ||
56 | int dvs_control_src; /** Hardware DVS source to use (1 or 2) */ | ||
57 | int dvs_init_state; /** DVS state to expect on startup */ | ||
58 | int dvs_state_gpio; /** CPU GPIO to use for monitoring status */ | ||
59 | }; | ||
60 | |||
44 | /* Sources for status LED configuration. Values are register values | 61 | /* Sources for status LED configuration. Values are register values |
45 | * plus 1 to allow for a zero default for preserve. | 62 | * plus 1 to allow for a zero default for preserve. |
46 | */ | 63 | */ |
diff --git a/include/linux/mfd/wm8350/pmic.h b/include/linux/mfd/wm8350/pmic.h index be3264e286e0..e786fe9841ef 100644 --- a/include/linux/mfd/wm8350/pmic.h +++ b/include/linux/mfd/wm8350/pmic.h | |||
@@ -666,20 +666,20 @@ | |||
666 | #define WM8350_ISINK_FLASH_DUR_64MS (1 << 8) | 666 | #define WM8350_ISINK_FLASH_DUR_64MS (1 << 8) |
667 | #define WM8350_ISINK_FLASH_DUR_96MS (2 << 8) | 667 | #define WM8350_ISINK_FLASH_DUR_96MS (2 << 8) |
668 | #define WM8350_ISINK_FLASH_DUR_1024MS (3 << 8) | 668 | #define WM8350_ISINK_FLASH_DUR_1024MS (3 << 8) |
669 | #define WM8350_ISINK_FLASH_ON_INSTANT (0 << 4) | 669 | #define WM8350_ISINK_FLASH_ON_INSTANT (0 << 0) |
670 | #define WM8350_ISINK_FLASH_ON_0_25S (1 << 4) | 670 | #define WM8350_ISINK_FLASH_ON_0_25S (1 << 0) |
671 | #define WM8350_ISINK_FLASH_ON_0_50S (2 << 4) | 671 | #define WM8350_ISINK_FLASH_ON_0_50S (2 << 0) |
672 | #define WM8350_ISINK_FLASH_ON_1_00S (3 << 4) | 672 | #define WM8350_ISINK_FLASH_ON_1_00S (3 << 0) |
673 | #define WM8350_ISINK_FLASH_ON_1_95S (1 << 4) | 673 | #define WM8350_ISINK_FLASH_ON_1_95S (1 << 0) |
674 | #define WM8350_ISINK_FLASH_ON_3_91S (2 << 4) | 674 | #define WM8350_ISINK_FLASH_ON_3_91S (2 << 0) |
675 | #define WM8350_ISINK_FLASH_ON_7_80S (3 << 4) | 675 | #define WM8350_ISINK_FLASH_ON_7_80S (3 << 0) |
676 | #define WM8350_ISINK_FLASH_OFF_INSTANT (0 << 0) | 676 | #define WM8350_ISINK_FLASH_OFF_INSTANT (0 << 4) |
677 | #define WM8350_ISINK_FLASH_OFF_0_25S (1 << 0) | 677 | #define WM8350_ISINK_FLASH_OFF_0_25S (1 << 4) |
678 | #define WM8350_ISINK_FLASH_OFF_0_50S (2 << 0) | 678 | #define WM8350_ISINK_FLASH_OFF_0_50S (2 << 4) |
679 | #define WM8350_ISINK_FLASH_OFF_1_00S (3 << 0) | 679 | #define WM8350_ISINK_FLASH_OFF_1_00S (3 << 4) |
680 | #define WM8350_ISINK_FLASH_OFF_1_95S (1 << 0) | 680 | #define WM8350_ISINK_FLASH_OFF_1_95S (1 << 4) |
681 | #define WM8350_ISINK_FLASH_OFF_3_91S (2 << 0) | 681 | #define WM8350_ISINK_FLASH_OFF_3_91S (2 << 4) |
682 | #define WM8350_ISINK_FLASH_OFF_7_80S (3 << 0) | 682 | #define WM8350_ISINK_FLASH_OFF_7_80S (3 << 4) |
683 | 683 | ||
684 | /* | 684 | /* |
685 | * Regulator Interrupts. | 685 | * Regulator Interrupts. |
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index ce7cc6c7bcbb..e92d1bfdb330 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
@@ -61,6 +61,7 @@ enum { | |||
61 | MLX4_DEV_CAP_FLAG_BAD_PKEY_CNTR = 1 << 8, | 61 | MLX4_DEV_CAP_FLAG_BAD_PKEY_CNTR = 1 << 8, |
62 | MLX4_DEV_CAP_FLAG_BAD_QKEY_CNTR = 1 << 9, | 62 | MLX4_DEV_CAP_FLAG_BAD_QKEY_CNTR = 1 << 9, |
63 | MLX4_DEV_CAP_FLAG_DPDP = 1 << 12, | 63 | MLX4_DEV_CAP_FLAG_DPDP = 1 << 12, |
64 | MLX4_DEV_CAP_FLAG_BLH = 1 << 15, | ||
64 | MLX4_DEV_CAP_FLAG_MEM_WINDOW = 1 << 16, | 65 | MLX4_DEV_CAP_FLAG_MEM_WINDOW = 1 << 16, |
65 | MLX4_DEV_CAP_FLAG_APM = 1 << 17, | 66 | MLX4_DEV_CAP_FLAG_APM = 1 << 17, |
66 | MLX4_DEV_CAP_FLAG_ATOMIC = 1 << 18, | 67 | MLX4_DEV_CAP_FLAG_ATOMIC = 1 << 18, |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 9d65ae4ba0e0..60c467bfbabd 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -1037,6 +1037,9 @@ extern void add_active_range(unsigned int nid, unsigned long start_pfn, | |||
1037 | extern void remove_active_range(unsigned int nid, unsigned long start_pfn, | 1037 | extern void remove_active_range(unsigned int nid, unsigned long start_pfn, |
1038 | unsigned long end_pfn); | 1038 | unsigned long end_pfn); |
1039 | extern void remove_all_active_ranges(void); | 1039 | extern void remove_all_active_ranges(void); |
1040 | void sort_node_map(void); | ||
1041 | unsigned long __absent_pages_in_range(int nid, unsigned long start_pfn, | ||
1042 | unsigned long end_pfn); | ||
1040 | extern unsigned long absent_pages_in_range(unsigned long start_pfn, | 1043 | extern unsigned long absent_pages_in_range(unsigned long start_pfn, |
1041 | unsigned long end_pfn); | 1044 | unsigned long end_pfn); |
1042 | extern void get_pfn_range_for_nid(unsigned int nid, | 1045 | extern void get_pfn_range_for_nid(unsigned int nid, |
@@ -1086,6 +1089,7 @@ extern void zone_pcp_update(struct zone *zone); | |||
1086 | 1089 | ||
1087 | /* nommu.c */ | 1090 | /* nommu.c */ |
1088 | extern atomic_long_t mmap_pages_allocated; | 1091 | extern atomic_long_t mmap_pages_allocated; |
1092 | extern int nommu_shrink_inode_mappings(struct inode *, size_t, size_t); | ||
1089 | 1093 | ||
1090 | /* prio_tree.c */ | 1094 | /* prio_tree.c */ |
1091 | void vma_prio_tree_add(struct vm_area_struct *, struct vm_area_struct *old); | 1095 | void vma_prio_tree_add(struct vm_area_struct *, struct vm_area_struct *old); |
@@ -1331,11 +1335,17 @@ extern int account_locked_memory(struct mm_struct *mm, struct rlimit *rlim, | |||
1331 | size_t size); | 1335 | size_t size); |
1332 | extern void refund_locked_memory(struct mm_struct *mm, size_t size); | 1336 | extern void refund_locked_memory(struct mm_struct *mm, size_t size); |
1333 | 1337 | ||
1338 | enum mf_flags { | ||
1339 | MF_COUNT_INCREASED = 1 << 0, | ||
1340 | }; | ||
1334 | extern void memory_failure(unsigned long pfn, int trapno); | 1341 | extern void memory_failure(unsigned long pfn, int trapno); |
1335 | extern int __memory_failure(unsigned long pfn, int trapno, int ref); | 1342 | extern int __memory_failure(unsigned long pfn, int trapno, int flags); |
1343 | extern int unpoison_memory(unsigned long pfn); | ||
1336 | extern int sysctl_memory_failure_early_kill; | 1344 | extern int sysctl_memory_failure_early_kill; |
1337 | extern int sysctl_memory_failure_recovery; | 1345 | extern int sysctl_memory_failure_recovery; |
1346 | extern void shake_page(struct page *p, int access); | ||
1338 | extern atomic_long_t mce_bad_pages; | 1347 | extern atomic_long_t mce_bad_pages; |
1348 | extern int soft_offline_page(struct page *page, int flags); | ||
1339 | 1349 | ||
1340 | #endif /* __KERNEL__ */ | 1350 | #endif /* __KERNEL__ */ |
1341 | #endif /* _LINUX_MM_H */ | 1351 | #endif /* _LINUX_MM_H */ |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 84a524afb3dc..36f96271306c 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
@@ -122,7 +122,9 @@ struct vm_region { | |||
122 | unsigned long vm_pgoff; /* the offset in vm_file corresponding to vm_start */ | 122 | unsigned long vm_pgoff; /* the offset in vm_file corresponding to vm_start */ |
123 | struct file *vm_file; /* the backing file or NULL */ | 123 | struct file *vm_file; /* the backing file or NULL */ |
124 | 124 | ||
125 | atomic_t vm_usage; /* region usage count */ | 125 | int vm_usage; /* region usage count (access under nommu_region_sem) */ |
126 | bool vm_icache_flushed : 1; /* true if the icache has been flushed for | ||
127 | * this region */ | ||
126 | }; | 128 | }; |
127 | 129 | ||
128 | /* | 130 | /* |
@@ -203,10 +205,12 @@ struct mm_struct { | |||
203 | struct vm_area_struct * mmap; /* list of VMAs */ | 205 | struct vm_area_struct * mmap; /* list of VMAs */ |
204 | struct rb_root mm_rb; | 206 | struct rb_root mm_rb; |
205 | struct vm_area_struct * mmap_cache; /* last find_vma result */ | 207 | struct vm_area_struct * mmap_cache; /* last find_vma result */ |
208 | #ifdef CONFIG_MMU | ||
206 | unsigned long (*get_unmapped_area) (struct file *filp, | 209 | unsigned long (*get_unmapped_area) (struct file *filp, |
207 | unsigned long addr, unsigned long len, | 210 | unsigned long addr, unsigned long len, |
208 | unsigned long pgoff, unsigned long flags); | 211 | unsigned long pgoff, unsigned long flags); |
209 | void (*unmap_area) (struct mm_struct *mm, unsigned long addr); | 212 | void (*unmap_area) (struct mm_struct *mm, unsigned long addr); |
213 | #endif | ||
210 | unsigned long mmap_base; /* base of mmap area */ | 214 | unsigned long mmap_base; /* base of mmap area */ |
211 | unsigned long task_size; /* size of task vm space */ | 215 | unsigned long task_size; /* size of task vm space */ |
212 | unsigned long cached_hole_size; /* if non-zero, the largest hole below free_area_cache */ | 216 | unsigned long cached_hole_size; /* if non-zero, the largest hole below free_area_cache */ |
diff --git a/include/linux/mmdebug.h b/include/linux/mmdebug.h index 8a5509877192..ee24ef8ab616 100644 --- a/include/linux/mmdebug.h +++ b/include/linux/mmdebug.h | |||
@@ -1,8 +1,6 @@ | |||
1 | #ifndef LINUX_MM_DEBUG_H | 1 | #ifndef LINUX_MM_DEBUG_H |
2 | #define LINUX_MM_DEBUG_H 1 | 2 | #define LINUX_MM_DEBUG_H 1 |
3 | 3 | ||
4 | #include <linux/autoconf.h> | ||
5 | |||
6 | #ifdef CONFIG_DEBUG_VM | 4 | #ifdef CONFIG_DEBUG_VM |
7 | #define VM_BUG_ON(cond) BUG_ON(cond) | 5 | #define VM_BUG_ON(cond) BUG_ON(cond) |
8 | #else | 6 | #else |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 6f7561730d88..30fe668c2542 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -15,7 +15,7 @@ | |||
15 | #include <linux/seqlock.h> | 15 | #include <linux/seqlock.h> |
16 | #include <linux/nodemask.h> | 16 | #include <linux/nodemask.h> |
17 | #include <linux/pageblock-flags.h> | 17 | #include <linux/pageblock-flags.h> |
18 | #include <linux/bounds.h> | 18 | #include <generated/bounds.h> |
19 | #include <asm/atomic.h> | 19 | #include <asm/atomic.h> |
20 | #include <asm/page.h> | 20 | #include <asm/page.h> |
21 | 21 | ||
diff --git a/include/linux/module.h b/include/linux/module.h index 482efc865acf..6cb1a3cab5d3 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -25,8 +25,10 @@ | |||
25 | /* Not Yet Implemented */ | 25 | /* Not Yet Implemented */ |
26 | #define MODULE_SUPPORTED_DEVICE(name) | 26 | #define MODULE_SUPPORTED_DEVICE(name) |
27 | 27 | ||
28 | /* some toolchains uses a `_' prefix for all user symbols */ | 28 | /* Some toolchains use a `_' prefix for all user symbols. */ |
29 | #ifndef MODULE_SYMBOL_PREFIX | 29 | #ifdef CONFIG_SYMBOL_PREFIX |
30 | #define MODULE_SYMBOL_PREFIX CONFIG_SYMBOL_PREFIX | ||
31 | #else | ||
30 | #define MODULE_SYMBOL_PREFIX "" | 32 | #define MODULE_SYMBOL_PREFIX "" |
31 | #endif | 33 | #endif |
32 | 34 | ||
diff --git a/include/linux/mtd/pismo.h b/include/linux/mtd/pismo.h new file mode 100644 index 000000000000..8dfb7e1421c5 --- /dev/null +++ b/include/linux/mtd/pismo.h | |||
@@ -0,0 +1,17 @@ | |||
1 | /* | ||
2 | * PISMO memory driver - http://www.pismoworld.org/ | ||
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; either version 2 of the License. | ||
7 | */ | ||
8 | #ifndef __LINUX_MTD_PISMO_H | ||
9 | #define __LINUX_MTD_PISMO_H | ||
10 | |||
11 | struct pismo_pdata { | ||
12 | void (*set_vpp)(void *, int); | ||
13 | void *vpp_data; | ||
14 | phys_addr_t cs_addrs[5]; | ||
15 | }; | ||
16 | |||
17 | #endif | ||
diff --git a/include/linux/namei.h b/include/linux/namei.h index 028946750289..05b441d93642 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h | |||
@@ -72,8 +72,6 @@ extern int vfs_path_lookup(struct dentry *, struct vfsmount *, | |||
72 | 72 | ||
73 | extern struct file *lookup_instantiate_filp(struct nameidata *nd, struct dentry *dentry, | 73 | extern struct file *lookup_instantiate_filp(struct nameidata *nd, struct dentry *dentry, |
74 | int (*open)(struct inode *, struct file *)); | 74 | int (*open)(struct inode *, struct file *)); |
75 | extern struct file *nameidata_to_filp(struct nameidata *nd, int flags); | ||
76 | extern void release_open_intent(struct nameidata *); | ||
77 | 75 | ||
78 | extern struct dentry *lookup_one_len(const char *, struct dentry *, int); | 76 | extern struct dentry *lookup_one_len(const char *, struct dentry *, int); |
79 | 77 | ||
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 51071b335751..89b28812ec24 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _LINUX_NFS_XDR_H | 2 | #define _LINUX_NFS_XDR_H |
3 | 3 | ||
4 | #include <linux/nfsacl.h> | 4 | #include <linux/nfsacl.h> |
5 | #include <linux/nfs3.h> | ||
5 | 6 | ||
6 | /* | 7 | /* |
7 | * To change the maximum rsize and wsize supported by the NFS client, adjust | 8 | * To change the maximum rsize and wsize supported by the NFS client, adjust |
diff --git a/include/linux/nfsacl.h b/include/linux/nfsacl.h index 43011b69297c..f321b578edeb 100644 --- a/include/linux/nfsacl.h +++ b/include/linux/nfsacl.h | |||
@@ -29,6 +29,7 @@ | |||
29 | #ifdef __KERNEL__ | 29 | #ifdef __KERNEL__ |
30 | 30 | ||
31 | #include <linux/posix_acl.h> | 31 | #include <linux/posix_acl.h> |
32 | #include <linux/sunrpc/xdr.h> | ||
32 | 33 | ||
33 | /* Maximum number of ACL entries over NFS */ | 34 | /* Maximum number of ACL entries over NFS */ |
34 | #define NFS_ACL_MAX_ENTRIES 1024 | 35 | #define NFS_ACL_MAX_ENTRIES 1024 |
diff --git a/include/linux/nfsd/cache.h b/include/linux/nfsd/cache.h deleted file mode 100644 index 3a3f58934f5e..000000000000 --- a/include/linux/nfsd/cache.h +++ /dev/null | |||
@@ -1,86 +0,0 @@ | |||
1 | /* | ||
2 | * include/linux/nfsd/cache.h | ||
3 | * | ||
4 | * Request reply cache. This was heavily inspired by the | ||
5 | * implementation in 4.3BSD/4.4BSD. | ||
6 | * | ||
7 | * Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de> | ||
8 | */ | ||
9 | |||
10 | #ifndef NFSCACHE_H | ||
11 | #define NFSCACHE_H | ||
12 | |||
13 | #include <linux/in.h> | ||
14 | #include <linux/uio.h> | ||
15 | |||
16 | /* | ||
17 | * Representation of a reply cache entry. | ||
18 | */ | ||
19 | struct svc_cacherep { | ||
20 | struct hlist_node c_hash; | ||
21 | struct list_head c_lru; | ||
22 | |||
23 | unsigned char c_state, /* unused, inprog, done */ | ||
24 | c_type, /* status, buffer */ | ||
25 | c_secure : 1; /* req came from port < 1024 */ | ||
26 | struct sockaddr_in c_addr; | ||
27 | __be32 c_xid; | ||
28 | u32 c_prot; | ||
29 | u32 c_proc; | ||
30 | u32 c_vers; | ||
31 | unsigned long c_timestamp; | ||
32 | union { | ||
33 | struct kvec u_vec; | ||
34 | __be32 u_status; | ||
35 | } c_u; | ||
36 | }; | ||
37 | |||
38 | #define c_replvec c_u.u_vec | ||
39 | #define c_replstat c_u.u_status | ||
40 | |||
41 | /* cache entry states */ | ||
42 | enum { | ||
43 | RC_UNUSED, | ||
44 | RC_INPROG, | ||
45 | RC_DONE | ||
46 | }; | ||
47 | |||
48 | /* return values */ | ||
49 | enum { | ||
50 | RC_DROPIT, | ||
51 | RC_REPLY, | ||
52 | RC_DOIT, | ||
53 | RC_INTR | ||
54 | }; | ||
55 | |||
56 | /* | ||
57 | * Cache types. | ||
58 | * We may want to add more types one day, e.g. for diropres and | ||
59 | * attrstat replies. Using cache entries with fixed length instead | ||
60 | * of buffer pointers may be more efficient. | ||
61 | */ | ||
62 | enum { | ||
63 | RC_NOCACHE, | ||
64 | RC_REPLSTAT, | ||
65 | RC_REPLBUFF, | ||
66 | }; | ||
67 | |||
68 | /* | ||
69 | * If requests are retransmitted within this interval, they're dropped. | ||
70 | */ | ||
71 | #define RC_DELAY (HZ/5) | ||
72 | |||
73 | int nfsd_reply_cache_init(void); | ||
74 | void nfsd_reply_cache_shutdown(void); | ||
75 | int nfsd_cache_lookup(struct svc_rqst *, int); | ||
76 | void nfsd_cache_update(struct svc_rqst *, int, __be32 *); | ||
77 | |||
78 | #ifdef CONFIG_NFSD_V4 | ||
79 | void nfsd4_set_statp(struct svc_rqst *rqstp, __be32 *statp); | ||
80 | #else /* CONFIG_NFSD_V4 */ | ||
81 | static inline void nfsd4_set_statp(struct svc_rqst *rqstp, __be32 *statp) | ||
82 | { | ||
83 | } | ||
84 | #endif /* CONFIG_NFSD_V4 */ | ||
85 | |||
86 | #endif /* NFSCACHE_H */ | ||
diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h index a6d9ef2bb34a..8ae78a61eea4 100644 --- a/include/linux/nfsd/export.h +++ b/include/linux/nfsd/export.h | |||
@@ -12,7 +12,7 @@ | |||
12 | 12 | ||
13 | # include <linux/types.h> | 13 | # include <linux/types.h> |
14 | #ifdef __KERNEL__ | 14 | #ifdef __KERNEL__ |
15 | # include <linux/in.h> | 15 | # include <linux/nfsd/nfsfh.h> |
16 | #endif | 16 | #endif |
17 | 17 | ||
18 | /* | 18 | /* |
@@ -39,11 +39,23 @@ | |||
39 | #define NFSEXP_FSID 0x2000 | 39 | #define NFSEXP_FSID 0x2000 |
40 | #define NFSEXP_CROSSMOUNT 0x4000 | 40 | #define NFSEXP_CROSSMOUNT 0x4000 |
41 | #define NFSEXP_NOACL 0x8000 /* reserved for possible ACL related use */ | 41 | #define NFSEXP_NOACL 0x8000 /* reserved for possible ACL related use */ |
42 | #define NFSEXP_ALLFLAGS 0xFE3F | 42 | /* |
43 | * The NFSEXP_V4ROOT flag causes the kernel to give access only to NFSv4 | ||
44 | * clients, and only to the single directory that is the root of the | ||
45 | * export; further lookup and readdir operations are treated as if every | ||
46 | * subdirectory was a mountpoint, and ignored if they are not themselves | ||
47 | * exported. This is used by nfsd and mountd to construct the NFSv4 | ||
48 | * pseudofilesystem, which provides access only to paths leading to each | ||
49 | * exported filesystem. | ||
50 | */ | ||
51 | #define NFSEXP_V4ROOT 0x10000 | ||
52 | /* All flags that we claim to support. (Note we don't support NOACL.) */ | ||
53 | #define NFSEXP_ALLFLAGS 0x17E3F | ||
43 | 54 | ||
44 | /* The flags that may vary depending on security flavor: */ | 55 | /* The flags that may vary depending on security flavor: */ |
45 | #define NFSEXP_SECINFO_FLAGS (NFSEXP_READONLY | NFSEXP_ROOTSQUASH \ | 56 | #define NFSEXP_SECINFO_FLAGS (NFSEXP_READONLY | NFSEXP_ROOTSQUASH \ |
46 | | NFSEXP_ALLSQUASH) | 57 | | NFSEXP_ALLSQUASH \ |
58 | | NFSEXP_INSECURE_PORT) | ||
47 | 59 | ||
48 | #ifdef __KERNEL__ | 60 | #ifdef __KERNEL__ |
49 | 61 | ||
@@ -108,7 +120,6 @@ struct svc_expkey { | |||
108 | struct path ek_path; | 120 | struct path ek_path; |
109 | }; | 121 | }; |
110 | 122 | ||
111 | #define EX_SECURE(exp) (!((exp)->ex_flags & NFSEXP_INSECURE_PORT)) | ||
112 | #define EX_ISSYNC(exp) (!((exp)->ex_flags & NFSEXP_ASYNC)) | 123 | #define EX_ISSYNC(exp) (!((exp)->ex_flags & NFSEXP_ASYNC)) |
113 | #define EX_NOHIDE(exp) ((exp)->ex_flags & NFSEXP_NOHIDE) | 124 | #define EX_NOHIDE(exp) ((exp)->ex_flags & NFSEXP_NOHIDE) |
114 | #define EX_WGATHER(exp) ((exp)->ex_flags & NFSEXP_GATHERED_WRITES) | 125 | #define EX_WGATHER(exp) ((exp)->ex_flags & NFSEXP_GATHERED_WRITES) |
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h deleted file mode 100644 index 510ffdd5020e..000000000000 --- a/include/linux/nfsd/nfsd.h +++ /dev/null | |||
@@ -1,424 +0,0 @@ | |||
1 | /* | ||
2 | * linux/include/linux/nfsd/nfsd.h | ||
3 | * | ||
4 | * Hodge-podge collection of knfsd-related stuff. | ||
5 | * I will sort this out later. | ||
6 | * | ||
7 | * Copyright (C) 1995-1997 Olaf Kirch <okir@monad.swb.de> | ||
8 | */ | ||
9 | |||
10 | #ifndef LINUX_NFSD_NFSD_H | ||
11 | #define LINUX_NFSD_NFSD_H | ||
12 | |||
13 | #include <linux/types.h> | ||
14 | #include <linux/unistd.h> | ||
15 | #include <linux/fs.h> | ||
16 | #include <linux/posix_acl.h> | ||
17 | #include <linux/mount.h> | ||
18 | |||
19 | #include <linux/nfsd/debug.h> | ||
20 | #include <linux/nfsd/nfsfh.h> | ||
21 | #include <linux/nfsd/export.h> | ||
22 | #include <linux/nfsd/stats.h> | ||
23 | /* | ||
24 | * nfsd version | ||
25 | */ | ||
26 | #define NFSD_SUPPORTED_MINOR_VERSION 1 | ||
27 | |||
28 | /* | ||
29 | * Flags for nfsd_permission | ||
30 | */ | ||
31 | #define NFSD_MAY_NOP 0 | ||
32 | #define NFSD_MAY_EXEC 1 /* == MAY_EXEC */ | ||
33 | #define NFSD_MAY_WRITE 2 /* == MAY_WRITE */ | ||
34 | #define NFSD_MAY_READ 4 /* == MAY_READ */ | ||
35 | #define NFSD_MAY_SATTR 8 | ||
36 | #define NFSD_MAY_TRUNC 16 | ||
37 | #define NFSD_MAY_LOCK 32 | ||
38 | #define NFSD_MAY_OWNER_OVERRIDE 64 | ||
39 | #define NFSD_MAY_LOCAL_ACCESS 128 /* IRIX doing local access check on device special file*/ | ||
40 | #define NFSD_MAY_BYPASS_GSS_ON_ROOT 256 | ||
41 | |||
42 | #define NFSD_MAY_CREATE (NFSD_MAY_EXEC|NFSD_MAY_WRITE) | ||
43 | #define NFSD_MAY_REMOVE (NFSD_MAY_EXEC|NFSD_MAY_WRITE|NFSD_MAY_TRUNC) | ||
44 | |||
45 | /* | ||
46 | * Callback function for readdir | ||
47 | */ | ||
48 | struct readdir_cd { | ||
49 | __be32 err; /* 0, nfserr, or nfserr_eof */ | ||
50 | }; | ||
51 | typedef int (*nfsd_dirop_t)(struct inode *, struct dentry *, int, int); | ||
52 | |||
53 | extern struct svc_program nfsd_program; | ||
54 | extern struct svc_version nfsd_version2, nfsd_version3, | ||
55 | nfsd_version4; | ||
56 | extern u32 nfsd_supported_minorversion; | ||
57 | extern struct mutex nfsd_mutex; | ||
58 | extern struct svc_serv *nfsd_serv; | ||
59 | extern spinlock_t nfsd_drc_lock; | ||
60 | extern unsigned int nfsd_drc_max_mem; | ||
61 | extern unsigned int nfsd_drc_mem_used; | ||
62 | |||
63 | extern const struct seq_operations nfs_exports_op; | ||
64 | |||
65 | /* | ||
66 | * Function prototypes. | ||
67 | */ | ||
68 | int nfsd_svc(unsigned short port, int nrservs); | ||
69 | int nfsd_dispatch(struct svc_rqst *rqstp, __be32 *statp); | ||
70 | |||
71 | int nfsd_nrthreads(void); | ||
72 | int nfsd_nrpools(void); | ||
73 | int nfsd_get_nrthreads(int n, int *); | ||
74 | int nfsd_set_nrthreads(int n, int *); | ||
75 | |||
76 | /* nfsd/vfs.c */ | ||
77 | int fh_lock_parent(struct svc_fh *, struct dentry *); | ||
78 | int nfsd_racache_init(int); | ||
79 | void nfsd_racache_shutdown(void); | ||
80 | int nfsd_cross_mnt(struct svc_rqst *rqstp, struct dentry **dpp, | ||
81 | struct svc_export **expp); | ||
82 | __be32 nfsd_lookup(struct svc_rqst *, struct svc_fh *, | ||
83 | const char *, unsigned int, struct svc_fh *); | ||
84 | __be32 nfsd_lookup_dentry(struct svc_rqst *, struct svc_fh *, | ||
85 | const char *, unsigned int, | ||
86 | struct svc_export **, struct dentry **); | ||
87 | __be32 nfsd_setattr(struct svc_rqst *, struct svc_fh *, | ||
88 | struct iattr *, int, time_t); | ||
89 | #ifdef CONFIG_NFSD_V4 | ||
90 | __be32 nfsd4_set_nfs4_acl(struct svc_rqst *, struct svc_fh *, | ||
91 | struct nfs4_acl *); | ||
92 | int nfsd4_get_nfs4_acl(struct svc_rqst *, struct dentry *, struct nfs4_acl **); | ||
93 | #endif /* CONFIG_NFSD_V4 */ | ||
94 | __be32 nfsd_create(struct svc_rqst *, struct svc_fh *, | ||
95 | char *name, int len, struct iattr *attrs, | ||
96 | int type, dev_t rdev, struct svc_fh *res); | ||
97 | #ifdef CONFIG_NFSD_V3 | ||
98 | __be32 nfsd_access(struct svc_rqst *, struct svc_fh *, u32 *, u32 *); | ||
99 | __be32 nfsd_create_v3(struct svc_rqst *, struct svc_fh *, | ||
100 | char *name, int len, struct iattr *attrs, | ||
101 | struct svc_fh *res, int createmode, | ||
102 | u32 *verifier, int *truncp, int *created); | ||
103 | __be32 nfsd_commit(struct svc_rqst *, struct svc_fh *, | ||
104 | loff_t, unsigned long); | ||
105 | #endif /* CONFIG_NFSD_V3 */ | ||
106 | __be32 nfsd_open(struct svc_rqst *, struct svc_fh *, int, | ||
107 | int, struct file **); | ||
108 | void nfsd_close(struct file *); | ||
109 | __be32 nfsd_read(struct svc_rqst *, struct svc_fh *, struct file *, | ||
110 | loff_t, struct kvec *, int, unsigned long *); | ||
111 | __be32 nfsd_write(struct svc_rqst *, struct svc_fh *,struct file *, | ||
112 | loff_t, struct kvec *,int, unsigned long *, int *); | ||
113 | __be32 nfsd_readlink(struct svc_rqst *, struct svc_fh *, | ||
114 | char *, int *); | ||
115 | __be32 nfsd_symlink(struct svc_rqst *, struct svc_fh *, | ||
116 | char *name, int len, char *path, int plen, | ||
117 | struct svc_fh *res, struct iattr *); | ||
118 | __be32 nfsd_link(struct svc_rqst *, struct svc_fh *, | ||
119 | char *, int, struct svc_fh *); | ||
120 | __be32 nfsd_rename(struct svc_rqst *, | ||
121 | struct svc_fh *, char *, int, | ||
122 | struct svc_fh *, char *, int); | ||
123 | __be32 nfsd_remove(struct svc_rqst *, | ||
124 | struct svc_fh *, char *, int); | ||
125 | __be32 nfsd_unlink(struct svc_rqst *, struct svc_fh *, int type, | ||
126 | char *name, int len); | ||
127 | int nfsd_truncate(struct svc_rqst *, struct svc_fh *, | ||
128 | unsigned long size); | ||
129 | __be32 nfsd_readdir(struct svc_rqst *, struct svc_fh *, | ||
130 | loff_t *, struct readdir_cd *, filldir_t); | ||
131 | __be32 nfsd_statfs(struct svc_rqst *, struct svc_fh *, | ||
132 | struct kstatfs *, int access); | ||
133 | |||
134 | int nfsd_notify_change(struct inode *, struct iattr *); | ||
135 | __be32 nfsd_permission(struct svc_rqst *, struct svc_export *, | ||
136 | struct dentry *, int); | ||
137 | int nfsd_sync_dir(struct dentry *dp); | ||
138 | |||
139 | #if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL) | ||
140 | #ifdef CONFIG_NFSD_V2_ACL | ||
141 | extern struct svc_version nfsd_acl_version2; | ||
142 | #else | ||
143 | #define nfsd_acl_version2 NULL | ||
144 | #endif | ||
145 | #ifdef CONFIG_NFSD_V3_ACL | ||
146 | extern struct svc_version nfsd_acl_version3; | ||
147 | #else | ||
148 | #define nfsd_acl_version3 NULL | ||
149 | #endif | ||
150 | struct posix_acl *nfsd_get_posix_acl(struct svc_fh *, int); | ||
151 | int nfsd_set_posix_acl(struct svc_fh *, int, struct posix_acl *); | ||
152 | #endif | ||
153 | |||
154 | enum vers_op {NFSD_SET, NFSD_CLEAR, NFSD_TEST, NFSD_AVAIL }; | ||
155 | int nfsd_vers(int vers, enum vers_op change); | ||
156 | int nfsd_minorversion(u32 minorversion, enum vers_op change); | ||
157 | void nfsd_reset_versions(void); | ||
158 | int nfsd_create_serv(void); | ||
159 | |||
160 | extern int nfsd_max_blksize; | ||
161 | |||
162 | /* | ||
163 | * NFSv4 State | ||
164 | */ | ||
165 | #ifdef CONFIG_NFSD_V4 | ||
166 | extern unsigned int max_delegations; | ||
167 | int nfs4_state_init(void); | ||
168 | void nfsd4_free_slabs(void); | ||
169 | int nfs4_state_start(void); | ||
170 | void nfs4_state_shutdown(void); | ||
171 | time_t nfs4_lease_time(void); | ||
172 | void nfs4_reset_lease(time_t leasetime); | ||
173 | int nfs4_reset_recoverydir(char *recdir); | ||
174 | #else | ||
175 | static inline int nfs4_state_init(void) { return 0; } | ||
176 | static inline void nfsd4_free_slabs(void) { } | ||
177 | static inline int nfs4_state_start(void) { return 0; } | ||
178 | static inline void nfs4_state_shutdown(void) { } | ||
179 | static inline time_t nfs4_lease_time(void) { return 0; } | ||
180 | static inline void nfs4_reset_lease(time_t leasetime) { } | ||
181 | static inline int nfs4_reset_recoverydir(char *recdir) { return 0; } | ||
182 | #endif | ||
183 | |||
184 | /* | ||
185 | * lockd binding | ||
186 | */ | ||
187 | void nfsd_lockd_init(void); | ||
188 | void nfsd_lockd_shutdown(void); | ||
189 | |||
190 | |||
191 | /* | ||
192 | * These macros provide pre-xdr'ed values for faster operation. | ||
193 | */ | ||
194 | #define nfs_ok cpu_to_be32(NFS_OK) | ||
195 | #define nfserr_perm cpu_to_be32(NFSERR_PERM) | ||
196 | #define nfserr_noent cpu_to_be32(NFSERR_NOENT) | ||
197 | #define nfserr_io cpu_to_be32(NFSERR_IO) | ||
198 | #define nfserr_nxio cpu_to_be32(NFSERR_NXIO) | ||
199 | #define nfserr_eagain cpu_to_be32(NFSERR_EAGAIN) | ||
200 | #define nfserr_acces cpu_to_be32(NFSERR_ACCES) | ||
201 | #define nfserr_exist cpu_to_be32(NFSERR_EXIST) | ||
202 | #define nfserr_xdev cpu_to_be32(NFSERR_XDEV) | ||
203 | #define nfserr_nodev cpu_to_be32(NFSERR_NODEV) | ||
204 | #define nfserr_notdir cpu_to_be32(NFSERR_NOTDIR) | ||
205 | #define nfserr_isdir cpu_to_be32(NFSERR_ISDIR) | ||
206 | #define nfserr_inval cpu_to_be32(NFSERR_INVAL) | ||
207 | #define nfserr_fbig cpu_to_be32(NFSERR_FBIG) | ||
208 | #define nfserr_nospc cpu_to_be32(NFSERR_NOSPC) | ||
209 | #define nfserr_rofs cpu_to_be32(NFSERR_ROFS) | ||
210 | #define nfserr_mlink cpu_to_be32(NFSERR_MLINK) | ||
211 | #define nfserr_opnotsupp cpu_to_be32(NFSERR_OPNOTSUPP) | ||
212 | #define nfserr_nametoolong cpu_to_be32(NFSERR_NAMETOOLONG) | ||
213 | #define nfserr_notempty cpu_to_be32(NFSERR_NOTEMPTY) | ||
214 | #define nfserr_dquot cpu_to_be32(NFSERR_DQUOT) | ||
215 | #define nfserr_stale cpu_to_be32(NFSERR_STALE) | ||
216 | #define nfserr_remote cpu_to_be32(NFSERR_REMOTE) | ||
217 | #define nfserr_wflush cpu_to_be32(NFSERR_WFLUSH) | ||
218 | #define nfserr_badhandle cpu_to_be32(NFSERR_BADHANDLE) | ||
219 | #define nfserr_notsync cpu_to_be32(NFSERR_NOT_SYNC) | ||
220 | #define nfserr_badcookie cpu_to_be32(NFSERR_BAD_COOKIE) | ||
221 | #define nfserr_notsupp cpu_to_be32(NFSERR_NOTSUPP) | ||
222 | #define nfserr_toosmall cpu_to_be32(NFSERR_TOOSMALL) | ||
223 | #define nfserr_serverfault cpu_to_be32(NFSERR_SERVERFAULT) | ||
224 | #define nfserr_badtype cpu_to_be32(NFSERR_BADTYPE) | ||
225 | #define nfserr_jukebox cpu_to_be32(NFSERR_JUKEBOX) | ||
226 | #define nfserr_denied cpu_to_be32(NFSERR_DENIED) | ||
227 | #define nfserr_deadlock cpu_to_be32(NFSERR_DEADLOCK) | ||
228 | #define nfserr_expired cpu_to_be32(NFSERR_EXPIRED) | ||
229 | #define nfserr_bad_cookie cpu_to_be32(NFSERR_BAD_COOKIE) | ||
230 | #define nfserr_same cpu_to_be32(NFSERR_SAME) | ||
231 | #define nfserr_clid_inuse cpu_to_be32(NFSERR_CLID_INUSE) | ||
232 | #define nfserr_stale_clientid cpu_to_be32(NFSERR_STALE_CLIENTID) | ||
233 | #define nfserr_resource cpu_to_be32(NFSERR_RESOURCE) | ||
234 | #define nfserr_moved cpu_to_be32(NFSERR_MOVED) | ||
235 | #define nfserr_nofilehandle cpu_to_be32(NFSERR_NOFILEHANDLE) | ||
236 | #define nfserr_minor_vers_mismatch cpu_to_be32(NFSERR_MINOR_VERS_MISMATCH) | ||
237 | #define nfserr_share_denied cpu_to_be32(NFSERR_SHARE_DENIED) | ||
238 | #define nfserr_stale_stateid cpu_to_be32(NFSERR_STALE_STATEID) | ||
239 | #define nfserr_old_stateid cpu_to_be32(NFSERR_OLD_STATEID) | ||
240 | #define nfserr_bad_stateid cpu_to_be32(NFSERR_BAD_STATEID) | ||
241 | #define nfserr_bad_seqid cpu_to_be32(NFSERR_BAD_SEQID) | ||
242 | #define nfserr_symlink cpu_to_be32(NFSERR_SYMLINK) | ||
243 | #define nfserr_not_same cpu_to_be32(NFSERR_NOT_SAME) | ||
244 | #define nfserr_restorefh cpu_to_be32(NFSERR_RESTOREFH) | ||
245 | #define nfserr_attrnotsupp cpu_to_be32(NFSERR_ATTRNOTSUPP) | ||
246 | #define nfserr_bad_xdr cpu_to_be32(NFSERR_BAD_XDR) | ||
247 | #define nfserr_openmode cpu_to_be32(NFSERR_OPENMODE) | ||
248 | #define nfserr_locks_held cpu_to_be32(NFSERR_LOCKS_HELD) | ||
249 | #define nfserr_op_illegal cpu_to_be32(NFSERR_OP_ILLEGAL) | ||
250 | #define nfserr_grace cpu_to_be32(NFSERR_GRACE) | ||
251 | #define nfserr_no_grace cpu_to_be32(NFSERR_NO_GRACE) | ||
252 | #define nfserr_reclaim_bad cpu_to_be32(NFSERR_RECLAIM_BAD) | ||
253 | #define nfserr_badname cpu_to_be32(NFSERR_BADNAME) | ||
254 | #define nfserr_cb_path_down cpu_to_be32(NFSERR_CB_PATH_DOWN) | ||
255 | #define nfserr_locked cpu_to_be32(NFSERR_LOCKED) | ||
256 | #define nfserr_wrongsec cpu_to_be32(NFSERR_WRONGSEC) | ||
257 | #define nfserr_badiomode cpu_to_be32(NFS4ERR_BADIOMODE) | ||
258 | #define nfserr_badlayout cpu_to_be32(NFS4ERR_BADLAYOUT) | ||
259 | #define nfserr_bad_session_digest cpu_to_be32(NFS4ERR_BAD_SESSION_DIGEST) | ||
260 | #define nfserr_badsession cpu_to_be32(NFS4ERR_BADSESSION) | ||
261 | #define nfserr_badslot cpu_to_be32(NFS4ERR_BADSLOT) | ||
262 | #define nfserr_complete_already cpu_to_be32(NFS4ERR_COMPLETE_ALREADY) | ||
263 | #define nfserr_conn_not_bound_to_session cpu_to_be32(NFS4ERR_CONN_NOT_BOUND_TO_SESSION) | ||
264 | #define nfserr_deleg_already_wanted cpu_to_be32(NFS4ERR_DELEG_ALREADY_WANTED) | ||
265 | #define nfserr_back_chan_busy cpu_to_be32(NFS4ERR_BACK_CHAN_BUSY) | ||
266 | #define nfserr_layouttrylater cpu_to_be32(NFS4ERR_LAYOUTTRYLATER) | ||
267 | #define nfserr_layoutunavailable cpu_to_be32(NFS4ERR_LAYOUTUNAVAILABLE) | ||
268 | #define nfserr_nomatching_layout cpu_to_be32(NFS4ERR_NOMATCHING_LAYOUT) | ||
269 | #define nfserr_recallconflict cpu_to_be32(NFS4ERR_RECALLCONFLICT) | ||
270 | #define nfserr_unknown_layouttype cpu_to_be32(NFS4ERR_UNKNOWN_LAYOUTTYPE) | ||
271 | #define nfserr_seq_misordered cpu_to_be32(NFS4ERR_SEQ_MISORDERED) | ||
272 | #define nfserr_sequence_pos cpu_to_be32(NFS4ERR_SEQUENCE_POS) | ||
273 | #define nfserr_req_too_big cpu_to_be32(NFS4ERR_REQ_TOO_BIG) | ||
274 | #define nfserr_rep_too_big cpu_to_be32(NFS4ERR_REP_TOO_BIG) | ||
275 | #define nfserr_rep_too_big_to_cache cpu_to_be32(NFS4ERR_REP_TOO_BIG_TO_CACHE) | ||
276 | #define nfserr_retry_uncached_rep cpu_to_be32(NFS4ERR_RETRY_UNCACHED_REP) | ||
277 | #define nfserr_unsafe_compound cpu_to_be32(NFS4ERR_UNSAFE_COMPOUND) | ||
278 | #define nfserr_too_many_ops cpu_to_be32(NFS4ERR_TOO_MANY_OPS) | ||
279 | #define nfserr_op_not_in_session cpu_to_be32(NFS4ERR_OP_NOT_IN_SESSION) | ||
280 | #define nfserr_hash_alg_unsupp cpu_to_be32(NFS4ERR_HASH_ALG_UNSUPP) | ||
281 | #define nfserr_clientid_busy cpu_to_be32(NFS4ERR_CLIENTID_BUSY) | ||
282 | #define nfserr_pnfs_io_hole cpu_to_be32(NFS4ERR_PNFS_IO_HOLE) | ||
283 | #define nfserr_seq_false_retry cpu_to_be32(NFS4ERR_SEQ_FALSE_RETRY) | ||
284 | #define nfserr_bad_high_slot cpu_to_be32(NFS4ERR_BAD_HIGH_SLOT) | ||
285 | #define nfserr_deadsession cpu_to_be32(NFS4ERR_DEADSESSION) | ||
286 | #define nfserr_encr_alg_unsupp cpu_to_be32(NFS4ERR_ENCR_ALG_UNSUPP) | ||
287 | #define nfserr_pnfs_no_layout cpu_to_be32(NFS4ERR_PNFS_NO_LAYOUT) | ||
288 | #define nfserr_not_only_op cpu_to_be32(NFS4ERR_NOT_ONLY_OP) | ||
289 | #define nfserr_wrong_cred cpu_to_be32(NFS4ERR_WRONG_CRED) | ||
290 | #define nfserr_wrong_type cpu_to_be32(NFS4ERR_WRONG_TYPE) | ||
291 | #define nfserr_dirdeleg_unavail cpu_to_be32(NFS4ERR_DIRDELEG_UNAVAIL) | ||
292 | #define nfserr_reject_deleg cpu_to_be32(NFS4ERR_REJECT_DELEG) | ||
293 | #define nfserr_returnconflict cpu_to_be32(NFS4ERR_RETURNCONFLICT) | ||
294 | #define nfserr_deleg_revoked cpu_to_be32(NFS4ERR_DELEG_REVOKED) | ||
295 | |||
296 | /* error codes for internal use */ | ||
297 | /* if a request fails due to kmalloc failure, it gets dropped. | ||
298 | * Client should resend eventually | ||
299 | */ | ||
300 | #define nfserr_dropit cpu_to_be32(30000) | ||
301 | /* end-of-file indicator in readdir */ | ||
302 | #define nfserr_eof cpu_to_be32(30001) | ||
303 | /* replay detected */ | ||
304 | #define nfserr_replay_me cpu_to_be32(11001) | ||
305 | /* nfs41 replay detected */ | ||
306 | #define nfserr_replay_cache cpu_to_be32(11002) | ||
307 | |||
308 | /* Check for dir entries '.' and '..' */ | ||
309 | #define isdotent(n, l) (l < 3 && n[0] == '.' && (l == 1 || n[1] == '.')) | ||
310 | |||
311 | /* | ||
312 | * Time of server startup | ||
313 | */ | ||
314 | extern struct timeval nfssvc_boot; | ||
315 | |||
316 | #ifdef CONFIG_NFSD_V4 | ||
317 | |||
318 | /* before processing a COMPOUND operation, we have to check that there | ||
319 | * is enough space in the buffer for XDR encode to succeed. otherwise, | ||
320 | * we might process an operation with side effects, and be unable to | ||
321 | * tell the client that the operation succeeded. | ||
322 | * | ||
323 | * COMPOUND_SLACK_SPACE - this is the minimum bytes of buffer space | ||
324 | * needed to encode an "ordinary" _successful_ operation. (GETATTR, | ||
325 | * READ, READDIR, and READLINK have their own buffer checks.) if we | ||
326 | * fall below this level, we fail the next operation with NFS4ERR_RESOURCE. | ||
327 | * | ||
328 | * COMPOUND_ERR_SLACK_SPACE - this is the minimum bytes of buffer space | ||
329 | * needed to encode an operation which has failed with NFS4ERR_RESOURCE. | ||
330 | * care is taken to ensure that we never fall below this level for any | ||
331 | * reason. | ||
332 | */ | ||
333 | #define COMPOUND_SLACK_SPACE 140 /* OP_GETFH */ | ||
334 | #define COMPOUND_ERR_SLACK_SPACE 12 /* OP_SETATTR */ | ||
335 | |||
336 | #define NFSD_LEASE_TIME (nfs4_lease_time()) | ||
337 | #define NFSD_LAUNDROMAT_MINTIMEOUT 10 /* seconds */ | ||
338 | |||
339 | /* | ||
340 | * The following attributes are currently not supported by the NFSv4 server: | ||
341 | * ARCHIVE (deprecated anyway) | ||
342 | * HIDDEN (unlikely to be supported any time soon) | ||
343 | * MIMETYPE (unlikely to be supported any time soon) | ||
344 | * QUOTA_* (will be supported in a forthcoming patch) | ||
345 | * SYSTEM (unlikely to be supported any time soon) | ||
346 | * TIME_BACKUP (unlikely to be supported any time soon) | ||
347 | * TIME_CREATE (unlikely to be supported any time soon) | ||
348 | */ | ||
349 | #define NFSD4_SUPPORTED_ATTRS_WORD0 \ | ||
350 | (FATTR4_WORD0_SUPPORTED_ATTRS | FATTR4_WORD0_TYPE | FATTR4_WORD0_FH_EXPIRE_TYPE \ | ||
351 | | FATTR4_WORD0_CHANGE | FATTR4_WORD0_SIZE | FATTR4_WORD0_LINK_SUPPORT \ | ||
352 | | FATTR4_WORD0_SYMLINK_SUPPORT | FATTR4_WORD0_NAMED_ATTR | FATTR4_WORD0_FSID \ | ||
353 | | FATTR4_WORD0_UNIQUE_HANDLES | FATTR4_WORD0_LEASE_TIME | FATTR4_WORD0_RDATTR_ERROR \ | ||
354 | | FATTR4_WORD0_ACLSUPPORT | FATTR4_WORD0_CANSETTIME | FATTR4_WORD0_CASE_INSENSITIVE \ | ||
355 | | FATTR4_WORD0_CASE_PRESERVING | FATTR4_WORD0_CHOWN_RESTRICTED \ | ||
356 | | FATTR4_WORD0_FILEHANDLE | FATTR4_WORD0_FILEID | FATTR4_WORD0_FILES_AVAIL \ | ||
357 | | FATTR4_WORD0_FILES_FREE | FATTR4_WORD0_FILES_TOTAL | FATTR4_WORD0_FS_LOCATIONS | FATTR4_WORD0_HOMOGENEOUS \ | ||
358 | | FATTR4_WORD0_MAXFILESIZE | FATTR4_WORD0_MAXLINK | FATTR4_WORD0_MAXNAME \ | ||
359 | | FATTR4_WORD0_MAXREAD | FATTR4_WORD0_MAXWRITE | FATTR4_WORD0_ACL) | ||
360 | |||
361 | #define NFSD4_SUPPORTED_ATTRS_WORD1 \ | ||
362 | (FATTR4_WORD1_MODE | FATTR4_WORD1_NO_TRUNC | FATTR4_WORD1_NUMLINKS \ | ||
363 | | FATTR4_WORD1_OWNER | FATTR4_WORD1_OWNER_GROUP | FATTR4_WORD1_RAWDEV \ | ||
364 | | FATTR4_WORD1_SPACE_AVAIL | FATTR4_WORD1_SPACE_FREE | FATTR4_WORD1_SPACE_TOTAL \ | ||
365 | | FATTR4_WORD1_SPACE_USED | FATTR4_WORD1_TIME_ACCESS | FATTR4_WORD1_TIME_ACCESS_SET \ | ||
366 | | FATTR4_WORD1_TIME_DELTA | FATTR4_WORD1_TIME_METADATA \ | ||
367 | | FATTR4_WORD1_TIME_MODIFY | FATTR4_WORD1_TIME_MODIFY_SET | FATTR4_WORD1_MOUNTED_ON_FILEID) | ||
368 | |||
369 | #define NFSD4_SUPPORTED_ATTRS_WORD2 0 | ||
370 | |||
371 | #define NFSD4_1_SUPPORTED_ATTRS_WORD0 \ | ||
372 | NFSD4_SUPPORTED_ATTRS_WORD0 | ||
373 | |||
374 | #define NFSD4_1_SUPPORTED_ATTRS_WORD1 \ | ||
375 | NFSD4_SUPPORTED_ATTRS_WORD1 | ||
376 | |||
377 | #define NFSD4_1_SUPPORTED_ATTRS_WORD2 \ | ||
378 | (NFSD4_SUPPORTED_ATTRS_WORD2 | FATTR4_WORD2_SUPPATTR_EXCLCREAT) | ||
379 | |||
380 | static inline u32 nfsd_suppattrs0(u32 minorversion) | ||
381 | { | ||
382 | return minorversion ? NFSD4_1_SUPPORTED_ATTRS_WORD0 | ||
383 | : NFSD4_SUPPORTED_ATTRS_WORD0; | ||
384 | } | ||
385 | |||
386 | static inline u32 nfsd_suppattrs1(u32 minorversion) | ||
387 | { | ||
388 | return minorversion ? NFSD4_1_SUPPORTED_ATTRS_WORD1 | ||
389 | : NFSD4_SUPPORTED_ATTRS_WORD1; | ||
390 | } | ||
391 | |||
392 | static inline u32 nfsd_suppattrs2(u32 minorversion) | ||
393 | { | ||
394 | return minorversion ? NFSD4_1_SUPPORTED_ATTRS_WORD2 | ||
395 | : NFSD4_SUPPORTED_ATTRS_WORD2; | ||
396 | } | ||
397 | |||
398 | /* These will return ERR_INVAL if specified in GETATTR or READDIR. */ | ||
399 | #define NFSD_WRITEONLY_ATTRS_WORD1 \ | ||
400 | (FATTR4_WORD1_TIME_ACCESS_SET | FATTR4_WORD1_TIME_MODIFY_SET) | ||
401 | |||
402 | /* These are the only attrs allowed in CREATE/OPEN/SETATTR. */ | ||
403 | #define NFSD_WRITEABLE_ATTRS_WORD0 \ | ||
404 | (FATTR4_WORD0_SIZE | FATTR4_WORD0_ACL ) | ||
405 | #define NFSD_WRITEABLE_ATTRS_WORD1 \ | ||
406 | (FATTR4_WORD1_MODE | FATTR4_WORD1_OWNER | FATTR4_WORD1_OWNER_GROUP \ | ||
407 | | FATTR4_WORD1_TIME_ACCESS_SET | FATTR4_WORD1_TIME_MODIFY_SET) | ||
408 | #define NFSD_WRITEABLE_ATTRS_WORD2 0 | ||
409 | |||
410 | #define NFSD_SUPPATTR_EXCLCREAT_WORD0 \ | ||
411 | NFSD_WRITEABLE_ATTRS_WORD0 | ||
412 | /* | ||
413 | * we currently store the exclusive create verifier in the v_{a,m}time | ||
414 | * attributes so the client can't set these at create time using EXCLUSIVE4_1 | ||
415 | */ | ||
416 | #define NFSD_SUPPATTR_EXCLCREAT_WORD1 \ | ||
417 | (NFSD_WRITEABLE_ATTRS_WORD1 & \ | ||
418 | ~(FATTR4_WORD1_TIME_ACCESS_SET | FATTR4_WORD1_TIME_MODIFY_SET)) | ||
419 | #define NFSD_SUPPATTR_EXCLCREAT_WORD2 \ | ||
420 | NFSD_WRITEABLE_ATTRS_WORD2 | ||
421 | |||
422 | #endif /* CONFIG_NFSD_V4 */ | ||
423 | |||
424 | #endif /* LINUX_NFSD_NFSD_H */ | ||
diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h index 8f641c908450..65e333afaee4 100644 --- a/include/linux/nfsd/nfsfh.h +++ b/include/linux/nfsd/nfsfh.h | |||
@@ -16,11 +16,9 @@ | |||
16 | 16 | ||
17 | # include <linux/types.h> | 17 | # include <linux/types.h> |
18 | #ifdef __KERNEL__ | 18 | #ifdef __KERNEL__ |
19 | # include <linux/string.h> | 19 | # include <linux/sunrpc/svc.h> |
20 | # include <linux/fs.h> | ||
21 | #endif | 20 | #endif |
22 | #include <linux/nfsd/const.h> | 21 | #include <linux/nfsd/const.h> |
23 | #include <linux/nfsd/debug.h> | ||
24 | 22 | ||
25 | /* | 23 | /* |
26 | * This is the old "dentry style" Linux NFSv2 file handle. | 24 | * This is the old "dentry style" Linux NFSv2 file handle. |
@@ -164,208 +162,6 @@ typedef struct svc_fh { | |||
164 | 162 | ||
165 | } svc_fh; | 163 | } svc_fh; |
166 | 164 | ||
167 | enum nfsd_fsid { | ||
168 | FSID_DEV = 0, | ||
169 | FSID_NUM, | ||
170 | FSID_MAJOR_MINOR, | ||
171 | FSID_ENCODE_DEV, | ||
172 | FSID_UUID4_INUM, | ||
173 | FSID_UUID8, | ||
174 | FSID_UUID16, | ||
175 | FSID_UUID16_INUM, | ||
176 | }; | ||
177 | |||
178 | enum fsid_source { | ||
179 | FSIDSOURCE_DEV, | ||
180 | FSIDSOURCE_FSID, | ||
181 | FSIDSOURCE_UUID, | ||
182 | }; | ||
183 | extern enum fsid_source fsid_source(struct svc_fh *fhp); | ||
184 | |||
185 | |||
186 | /* This might look a little large to "inline" but in all calls except | ||
187 | * one, 'vers' is constant so moste of the function disappears. | ||
188 | */ | ||
189 | static inline void mk_fsid(int vers, u32 *fsidv, dev_t dev, ino_t ino, | ||
190 | u32 fsid, unsigned char *uuid) | ||
191 | { | ||
192 | u32 *up; | ||
193 | switch(vers) { | ||
194 | case FSID_DEV: | ||
195 | fsidv[0] = htonl((MAJOR(dev)<<16) | | ||
196 | MINOR(dev)); | ||
197 | fsidv[1] = ino_t_to_u32(ino); | ||
198 | break; | ||
199 | case FSID_NUM: | ||
200 | fsidv[0] = fsid; | ||
201 | break; | ||
202 | case FSID_MAJOR_MINOR: | ||
203 | fsidv[0] = htonl(MAJOR(dev)); | ||
204 | fsidv[1] = htonl(MINOR(dev)); | ||
205 | fsidv[2] = ino_t_to_u32(ino); | ||
206 | break; | ||
207 | |||
208 | case FSID_ENCODE_DEV: | ||
209 | fsidv[0] = new_encode_dev(dev); | ||
210 | fsidv[1] = ino_t_to_u32(ino); | ||
211 | break; | ||
212 | |||
213 | case FSID_UUID4_INUM: | ||
214 | /* 4 byte fsid and inode number */ | ||
215 | up = (u32*)uuid; | ||
216 | fsidv[0] = ino_t_to_u32(ino); | ||
217 | fsidv[1] = up[0] ^ up[1] ^ up[2] ^ up[3]; | ||
218 | break; | ||
219 | |||
220 | case FSID_UUID8: | ||
221 | /* 8 byte fsid */ | ||
222 | up = (u32*)uuid; | ||
223 | fsidv[0] = up[0] ^ up[2]; | ||
224 | fsidv[1] = up[1] ^ up[3]; | ||
225 | break; | ||
226 | |||
227 | case FSID_UUID16: | ||
228 | /* 16 byte fsid - NFSv3+ only */ | ||
229 | memcpy(fsidv, uuid, 16); | ||
230 | break; | ||
231 | |||
232 | case FSID_UUID16_INUM: | ||
233 | /* 8 byte inode and 16 byte fsid */ | ||
234 | *(u64*)fsidv = (u64)ino; | ||
235 | memcpy(fsidv+2, uuid, 16); | ||
236 | break; | ||
237 | default: BUG(); | ||
238 | } | ||
239 | } | ||
240 | |||
241 | static inline int key_len(int type) | ||
242 | { | ||
243 | switch(type) { | ||
244 | case FSID_DEV: return 8; | ||
245 | case FSID_NUM: return 4; | ||
246 | case FSID_MAJOR_MINOR: return 12; | ||
247 | case FSID_ENCODE_DEV: return 8; | ||
248 | case FSID_UUID4_INUM: return 8; | ||
249 | case FSID_UUID8: return 8; | ||
250 | case FSID_UUID16: return 16; | ||
251 | case FSID_UUID16_INUM: return 24; | ||
252 | default: return 0; | ||
253 | } | ||
254 | } | ||
255 | |||
256 | /* | ||
257 | * Shorthand for dprintk()'s | ||
258 | */ | ||
259 | extern char * SVCFH_fmt(struct svc_fh *fhp); | ||
260 | |||
261 | /* | ||
262 | * Function prototypes | ||
263 | */ | ||
264 | __be32 fh_verify(struct svc_rqst *, struct svc_fh *, int, int); | ||
265 | __be32 fh_compose(struct svc_fh *, struct svc_export *, struct dentry *, struct svc_fh *); | ||
266 | __be32 fh_update(struct svc_fh *); | ||
267 | void fh_put(struct svc_fh *); | ||
268 | |||
269 | static __inline__ struct svc_fh * | ||
270 | fh_copy(struct svc_fh *dst, struct svc_fh *src) | ||
271 | { | ||
272 | WARN_ON(src->fh_dentry || src->fh_locked); | ||
273 | |||
274 | *dst = *src; | ||
275 | return dst; | ||
276 | } | ||
277 | |||
278 | static inline void | ||
279 | fh_copy_shallow(struct knfsd_fh *dst, struct knfsd_fh *src) | ||
280 | { | ||
281 | dst->fh_size = src->fh_size; | ||
282 | memcpy(&dst->fh_base, &src->fh_base, src->fh_size); | ||
283 | } | ||
284 | |||
285 | static __inline__ struct svc_fh * | ||
286 | fh_init(struct svc_fh *fhp, int maxsize) | ||
287 | { | ||
288 | memset(fhp, 0, sizeof(*fhp)); | ||
289 | fhp->fh_maxsize = maxsize; | ||
290 | return fhp; | ||
291 | } | ||
292 | |||
293 | #ifdef CONFIG_NFSD_V3 | ||
294 | /* | ||
295 | * Fill in the pre_op attr for the wcc data | ||
296 | */ | ||
297 | static inline void | ||
298 | fill_pre_wcc(struct svc_fh *fhp) | ||
299 | { | ||
300 | struct inode *inode; | ||
301 | |||
302 | inode = fhp->fh_dentry->d_inode; | ||
303 | if (!fhp->fh_pre_saved) { | ||
304 | fhp->fh_pre_mtime = inode->i_mtime; | ||
305 | fhp->fh_pre_ctime = inode->i_ctime; | ||
306 | fhp->fh_pre_size = inode->i_size; | ||
307 | fhp->fh_pre_change = inode->i_version; | ||
308 | fhp->fh_pre_saved = 1; | ||
309 | } | ||
310 | } | ||
311 | |||
312 | extern void fill_post_wcc(struct svc_fh *); | ||
313 | #else | ||
314 | #define fill_pre_wcc(ignored) | ||
315 | #define fill_post_wcc(notused) | ||
316 | #endif /* CONFIG_NFSD_V3 */ | ||
317 | |||
318 | |||
319 | /* | ||
320 | * Lock a file handle/inode | ||
321 | * NOTE: both fh_lock and fh_unlock are done "by hand" in | ||
322 | * vfs.c:nfsd_rename as it needs to grab 2 i_mutex's at once | ||
323 | * so, any changes here should be reflected there. | ||
324 | */ | ||
325 | |||
326 | static inline void | ||
327 | fh_lock_nested(struct svc_fh *fhp, unsigned int subclass) | ||
328 | { | ||
329 | struct dentry *dentry = fhp->fh_dentry; | ||
330 | struct inode *inode; | ||
331 | |||
332 | dfprintk(FILEOP, "nfsd: fh_lock(%s) locked = %d\n", | ||
333 | SVCFH_fmt(fhp), fhp->fh_locked); | ||
334 | |||
335 | BUG_ON(!dentry); | ||
336 | |||
337 | if (fhp->fh_locked) { | ||
338 | printk(KERN_WARNING "fh_lock: %s/%s already locked!\n", | ||
339 | dentry->d_parent->d_name.name, dentry->d_name.name); | ||
340 | return; | ||
341 | } | ||
342 | |||
343 | inode = dentry->d_inode; | ||
344 | mutex_lock_nested(&inode->i_mutex, subclass); | ||
345 | fill_pre_wcc(fhp); | ||
346 | fhp->fh_locked = 1; | ||
347 | } | ||
348 | |||
349 | static inline void | ||
350 | fh_lock(struct svc_fh *fhp) | ||
351 | { | ||
352 | fh_lock_nested(fhp, I_MUTEX_NORMAL); | ||
353 | } | ||
354 | |||
355 | /* | ||
356 | * Unlock a file handle/inode | ||
357 | */ | ||
358 | static inline void | ||
359 | fh_unlock(struct svc_fh *fhp) | ||
360 | { | ||
361 | BUG_ON(!fhp->fh_dentry); | ||
362 | |||
363 | if (fhp->fh_locked) { | ||
364 | fill_post_wcc(fhp); | ||
365 | mutex_unlock(&fhp->fh_dentry->d_inode->i_mutex); | ||
366 | fhp->fh_locked = 0; | ||
367 | } | ||
368 | } | ||
369 | #endif /* __KERNEL__ */ | 165 | #endif /* __KERNEL__ */ |
370 | 166 | ||
371 | 167 | ||
diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h deleted file mode 100644 index b38d11324189..000000000000 --- a/include/linux/nfsd/state.h +++ /dev/null | |||
@@ -1,404 +0,0 @@ | |||
1 | /* | ||
2 | * linux/include/nfsd/state.h | ||
3 | * | ||
4 | * Copyright (c) 2001 The Regents of the University of Michigan. | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * Kendrick Smith <kmsmith@umich.edu> | ||
8 | * Andy Adamson <andros@umich.edu> | ||
9 | * | ||
10 | * Redistribution and use in source and binary forms, with or without | ||
11 | * modification, are permitted provided that the following conditions | ||
12 | * are met: | ||
13 | * | ||
14 | * 1. Redistributions of source code must retain the above copyright | ||
15 | * notice, this list of conditions and the following disclaimer. | ||
16 | * 2. Redistributions in binary form must reproduce the above copyright | ||
17 | * notice, this list of conditions and the following disclaimer in the | ||
18 | * documentation and/or other materials provided with the distribution. | ||
19 | * 3. Neither the name of the University nor the names of its | ||
20 | * contributors may be used to endorse or promote products derived | ||
21 | * from this software without specific prior written permission. | ||
22 | * | ||
23 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
24 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
25 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
26 | * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
27 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
28 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
29 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR | ||
30 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
31 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
32 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
33 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
34 | * | ||
35 | */ | ||
36 | |||
37 | #ifndef _NFSD4_STATE_H | ||
38 | #define _NFSD4_STATE_H | ||
39 | |||
40 | #include <linux/list.h> | ||
41 | #include <linux/kref.h> | ||
42 | #include <linux/sunrpc/clnt.h> | ||
43 | |||
44 | typedef struct { | ||
45 | u32 cl_boot; | ||
46 | u32 cl_id; | ||
47 | } clientid_t; | ||
48 | |||
49 | typedef struct { | ||
50 | u32 so_boot; | ||
51 | u32 so_stateownerid; | ||
52 | u32 so_fileid; | ||
53 | } stateid_opaque_t; | ||
54 | |||
55 | typedef struct { | ||
56 | u32 si_generation; | ||
57 | stateid_opaque_t si_opaque; | ||
58 | } stateid_t; | ||
59 | #define si_boot si_opaque.so_boot | ||
60 | #define si_stateownerid si_opaque.so_stateownerid | ||
61 | #define si_fileid si_opaque.so_fileid | ||
62 | |||
63 | struct nfsd4_cb_sequence { | ||
64 | /* args/res */ | ||
65 | u32 cbs_minorversion; | ||
66 | struct nfs4_client *cbs_clp; | ||
67 | }; | ||
68 | |||
69 | struct nfs4_delegation { | ||
70 | struct list_head dl_perfile; | ||
71 | struct list_head dl_perclnt; | ||
72 | struct list_head dl_recall_lru; /* delegation recalled */ | ||
73 | atomic_t dl_count; /* ref count */ | ||
74 | struct nfs4_client *dl_client; | ||
75 | struct nfs4_file *dl_file; | ||
76 | struct file_lock *dl_flock; | ||
77 | struct file *dl_vfs_file; | ||
78 | u32 dl_type; | ||
79 | time_t dl_time; | ||
80 | /* For recall: */ | ||
81 | u32 dl_ident; | ||
82 | stateid_t dl_stateid; | ||
83 | struct knfsd_fh dl_fh; | ||
84 | int dl_retries; | ||
85 | }; | ||
86 | |||
87 | /* client delegation callback info */ | ||
88 | struct nfs4_cb_conn { | ||
89 | /* SETCLIENTID info */ | ||
90 | struct sockaddr_storage cb_addr; | ||
91 | size_t cb_addrlen; | ||
92 | u32 cb_prog; | ||
93 | u32 cb_minorversion; | ||
94 | u32 cb_ident; /* minorversion 0 only */ | ||
95 | /* RPC client info */ | ||
96 | atomic_t cb_set; /* successful CB_NULL call */ | ||
97 | struct rpc_clnt * cb_client; | ||
98 | }; | ||
99 | |||
100 | /* Maximum number of slots per session. 160 is useful for long haul TCP */ | ||
101 | #define NFSD_MAX_SLOTS_PER_SESSION 160 | ||
102 | /* Maximum number of operations per session compound */ | ||
103 | #define NFSD_MAX_OPS_PER_COMPOUND 16 | ||
104 | /* Maximum session per slot cache size */ | ||
105 | #define NFSD_SLOT_CACHE_SIZE 1024 | ||
106 | /* Maximum number of NFSD_SLOT_CACHE_SIZE slots per session */ | ||
107 | #define NFSD_CACHE_SIZE_SLOTS_PER_SESSION 32 | ||
108 | #define NFSD_MAX_MEM_PER_SESSION \ | ||
109 | (NFSD_CACHE_SIZE_SLOTS_PER_SESSION * NFSD_SLOT_CACHE_SIZE) | ||
110 | |||
111 | struct nfsd4_slot { | ||
112 | bool sl_inuse; | ||
113 | bool sl_cachethis; | ||
114 | u16 sl_opcnt; | ||
115 | u32 sl_seqid; | ||
116 | __be32 sl_status; | ||
117 | u32 sl_datalen; | ||
118 | char sl_data[]; | ||
119 | }; | ||
120 | |||
121 | struct nfsd4_channel_attrs { | ||
122 | u32 headerpadsz; | ||
123 | u32 maxreq_sz; | ||
124 | u32 maxresp_sz; | ||
125 | u32 maxresp_cached; | ||
126 | u32 maxops; | ||
127 | u32 maxreqs; | ||
128 | u32 nr_rdma_attrs; | ||
129 | u32 rdma_attrs; | ||
130 | }; | ||
131 | |||
132 | struct nfsd4_create_session { | ||
133 | clientid_t clientid; | ||
134 | struct nfs4_sessionid sessionid; | ||
135 | u32 seqid; | ||
136 | u32 flags; | ||
137 | struct nfsd4_channel_attrs fore_channel; | ||
138 | struct nfsd4_channel_attrs back_channel; | ||
139 | u32 callback_prog; | ||
140 | u32 uid; | ||
141 | u32 gid; | ||
142 | }; | ||
143 | |||
144 | /* The single slot clientid cache structure */ | ||
145 | struct nfsd4_clid_slot { | ||
146 | u32 sl_seqid; | ||
147 | __be32 sl_status; | ||
148 | struct nfsd4_create_session sl_cr_ses; | ||
149 | }; | ||
150 | |||
151 | struct nfsd4_session { | ||
152 | struct kref se_ref; | ||
153 | struct list_head se_hash; /* hash by sessionid */ | ||
154 | struct list_head se_perclnt; | ||
155 | u32 se_flags; | ||
156 | struct nfs4_client *se_client; /* for expire_client */ | ||
157 | struct nfs4_sessionid se_sessionid; | ||
158 | struct nfsd4_channel_attrs se_fchannel; | ||
159 | struct nfsd4_channel_attrs se_bchannel; | ||
160 | struct nfsd4_slot *se_slots[]; /* forward channel slots */ | ||
161 | }; | ||
162 | |||
163 | static inline void | ||
164 | nfsd4_put_session(struct nfsd4_session *ses) | ||
165 | { | ||
166 | extern void free_session(struct kref *kref); | ||
167 | kref_put(&ses->se_ref, free_session); | ||
168 | } | ||
169 | |||
170 | static inline void | ||
171 | nfsd4_get_session(struct nfsd4_session *ses) | ||
172 | { | ||
173 | kref_get(&ses->se_ref); | ||
174 | } | ||
175 | |||
176 | /* formatted contents of nfs4_sessionid */ | ||
177 | struct nfsd4_sessionid { | ||
178 | clientid_t clientid; | ||
179 | u32 sequence; | ||
180 | u32 reserved; | ||
181 | }; | ||
182 | |||
183 | #define HEXDIR_LEN 33 /* hex version of 16 byte md5 of cl_name plus '\0' */ | ||
184 | |||
185 | /* | ||
186 | * struct nfs4_client - one per client. Clientids live here. | ||
187 | * o Each nfs4_client is hashed by clientid. | ||
188 | * | ||
189 | * o Each nfs4_clients is also hashed by name | ||
190 | * (the opaque quantity initially sent by the client to identify itself). | ||
191 | * | ||
192 | * o cl_perclient list is used to ensure no dangling stateowner references | ||
193 | * when we expire the nfs4_client | ||
194 | */ | ||
195 | struct nfs4_client { | ||
196 | struct list_head cl_idhash; /* hash by cl_clientid.id */ | ||
197 | struct list_head cl_strhash; /* hash by cl_name */ | ||
198 | struct list_head cl_openowners; | ||
199 | struct list_head cl_delegations; | ||
200 | struct list_head cl_lru; /* tail queue */ | ||
201 | struct xdr_netobj cl_name; /* id generated by client */ | ||
202 | char cl_recdir[HEXDIR_LEN]; /* recovery dir */ | ||
203 | nfs4_verifier cl_verifier; /* generated by client */ | ||
204 | time_t cl_time; /* time of last lease renewal */ | ||
205 | struct sockaddr_storage cl_addr; /* client ipaddress */ | ||
206 | u32 cl_flavor; /* setclientid pseudoflavor */ | ||
207 | char *cl_principal; /* setclientid principal name */ | ||
208 | struct svc_cred cl_cred; /* setclientid principal */ | ||
209 | clientid_t cl_clientid; /* generated by server */ | ||
210 | nfs4_verifier cl_confirm; /* generated by server */ | ||
211 | struct nfs4_cb_conn cl_cb_conn; /* callback info */ | ||
212 | atomic_t cl_count; /* ref count */ | ||
213 | u32 cl_firststate; /* recovery dir creation */ | ||
214 | |||
215 | /* for nfs41 */ | ||
216 | struct list_head cl_sessions; | ||
217 | struct nfsd4_clid_slot cl_cs_slot; /* create_session slot */ | ||
218 | u32 cl_exchange_flags; | ||
219 | struct nfs4_sessionid cl_sessionid; | ||
220 | |||
221 | /* for nfs41 callbacks */ | ||
222 | /* We currently support a single back channel with a single slot */ | ||
223 | unsigned long cl_cb_slot_busy; | ||
224 | u32 cl_cb_seq_nr; | ||
225 | struct svc_xprt *cl_cb_xprt; /* 4.1 callback transport */ | ||
226 | struct rpc_wait_queue cl_cb_waitq; /* backchannel callers may */ | ||
227 | /* wait here for slots */ | ||
228 | }; | ||
229 | |||
230 | /* struct nfs4_client_reset | ||
231 | * one per old client. Populates reset_str_hashtbl. Filled from conf_id_hashtbl | ||
232 | * upon lease reset, or from upcall to state_daemon (to read in state | ||
233 | * from non-volitile storage) upon reboot. | ||
234 | */ | ||
235 | struct nfs4_client_reclaim { | ||
236 | struct list_head cr_strhash; /* hash by cr_name */ | ||
237 | char cr_recdir[HEXDIR_LEN]; /* recover dir */ | ||
238 | }; | ||
239 | |||
240 | static inline void | ||
241 | update_stateid(stateid_t *stateid) | ||
242 | { | ||
243 | stateid->si_generation++; | ||
244 | } | ||
245 | |||
246 | /* A reasonable value for REPLAY_ISIZE was estimated as follows: | ||
247 | * The OPEN response, typically the largest, requires | ||
248 | * 4(status) + 8(stateid) + 20(changeinfo) + 4(rflags) + 8(verifier) + | ||
249 | * 4(deleg. type) + 8(deleg. stateid) + 4(deleg. recall flag) + | ||
250 | * 20(deleg. space limit) + ~32(deleg. ace) = 112 bytes | ||
251 | */ | ||
252 | |||
253 | #define NFSD4_REPLAY_ISIZE 112 | ||
254 | |||
255 | /* | ||
256 | * Replay buffer, where the result of the last seqid-mutating operation | ||
257 | * is cached. | ||
258 | */ | ||
259 | struct nfs4_replay { | ||
260 | __be32 rp_status; | ||
261 | unsigned int rp_buflen; | ||
262 | char *rp_buf; | ||
263 | unsigned intrp_allocated; | ||
264 | struct knfsd_fh rp_openfh; | ||
265 | char rp_ibuf[NFSD4_REPLAY_ISIZE]; | ||
266 | }; | ||
267 | |||
268 | /* | ||
269 | * nfs4_stateowner can either be an open_owner, or a lock_owner | ||
270 | * | ||
271 | * so_idhash: stateid_hashtbl[] for open owner, lockstateid_hashtbl[] | ||
272 | * for lock_owner | ||
273 | * so_strhash: ownerstr_hashtbl[] for open_owner, lock_ownerstr_hashtbl[] | ||
274 | * for lock_owner | ||
275 | * so_perclient: nfs4_client->cl_perclient entry - used when nfs4_client | ||
276 | * struct is reaped. | ||
277 | * so_perfilestate: heads the list of nfs4_stateid (either open or lock) | ||
278 | * and is used to ensure no dangling nfs4_stateid references when we | ||
279 | * release a stateowner. | ||
280 | * so_perlockowner: (open) nfs4_stateid->st_perlockowner entry - used when | ||
281 | * close is called to reap associated byte-range locks | ||
282 | * so_close_lru: (open) stateowner is placed on this list instead of being | ||
283 | * reaped (when so_perfilestate is empty) to hold the last close replay. | ||
284 | * reaped by laundramat thread after lease period. | ||
285 | */ | ||
286 | struct nfs4_stateowner { | ||
287 | struct kref so_ref; | ||
288 | struct list_head so_idhash; /* hash by so_id */ | ||
289 | struct list_head so_strhash; /* hash by op_name */ | ||
290 | struct list_head so_perclient; | ||
291 | struct list_head so_stateids; | ||
292 | struct list_head so_perstateid; /* for lockowners only */ | ||
293 | struct list_head so_close_lru; /* tail queue */ | ||
294 | time_t so_time; /* time of placement on so_close_lru */ | ||
295 | int so_is_open_owner; /* 1=openowner,0=lockowner */ | ||
296 | u32 so_id; | ||
297 | struct nfs4_client * so_client; | ||
298 | /* after increment in ENCODE_SEQID_OP_TAIL, represents the next | ||
299 | * sequence id expected from the client: */ | ||
300 | u32 so_seqid; | ||
301 | struct xdr_netobj so_owner; /* open owner name */ | ||
302 | int so_confirmed; /* successful OPEN_CONFIRM? */ | ||
303 | struct nfs4_replay so_replay; | ||
304 | }; | ||
305 | |||
306 | /* | ||
307 | * nfs4_file: a file opened by some number of (open) nfs4_stateowners. | ||
308 | * o fi_perfile list is used to search for conflicting | ||
309 | * share_acces, share_deny on the file. | ||
310 | */ | ||
311 | struct nfs4_file { | ||
312 | atomic_t fi_ref; | ||
313 | struct list_head fi_hash; /* hash by "struct inode *" */ | ||
314 | struct list_head fi_stateids; | ||
315 | struct list_head fi_delegations; | ||
316 | struct inode *fi_inode; | ||
317 | u32 fi_id; /* used with stateowner->so_id | ||
318 | * for stateid_hashtbl hash */ | ||
319 | bool fi_had_conflict; | ||
320 | }; | ||
321 | |||
322 | /* | ||
323 | * nfs4_stateid can either be an open stateid or (eventually) a lock stateid | ||
324 | * | ||
325 | * (open)nfs4_stateid: one per (open)nfs4_stateowner, nfs4_file | ||
326 | * | ||
327 | * st_hash: stateid_hashtbl[] entry or lockstateid_hashtbl entry | ||
328 | * st_perfile: file_hashtbl[] entry. | ||
329 | * st_perfile_state: nfs4_stateowner->so_perfilestate | ||
330 | * st_perlockowner: (open stateid) list of lock nfs4_stateowners | ||
331 | * st_access_bmap: used only for open stateid | ||
332 | * st_deny_bmap: used only for open stateid | ||
333 | * st_openstp: open stateid lock stateid was derived from | ||
334 | * | ||
335 | * XXX: open stateids and lock stateids have diverged sufficiently that | ||
336 | * we should consider defining separate structs for the two cases. | ||
337 | */ | ||
338 | |||
339 | struct nfs4_stateid { | ||
340 | struct list_head st_hash; | ||
341 | struct list_head st_perfile; | ||
342 | struct list_head st_perstateowner; | ||
343 | struct list_head st_lockowners; | ||
344 | struct nfs4_stateowner * st_stateowner; | ||
345 | struct nfs4_file * st_file; | ||
346 | stateid_t st_stateid; | ||
347 | struct file * st_vfs_file; | ||
348 | unsigned long st_access_bmap; | ||
349 | unsigned long st_deny_bmap; | ||
350 | struct nfs4_stateid * st_openstp; | ||
351 | }; | ||
352 | |||
353 | /* flags for preprocess_seqid_op() */ | ||
354 | #define HAS_SESSION 0x00000001 | ||
355 | #define CONFIRM 0x00000002 | ||
356 | #define OPEN_STATE 0x00000004 | ||
357 | #define LOCK_STATE 0x00000008 | ||
358 | #define RD_STATE 0x00000010 | ||
359 | #define WR_STATE 0x00000020 | ||
360 | #define CLOSE_STATE 0x00000040 | ||
361 | |||
362 | #define seqid_mutating_err(err) \ | ||
363 | (((err) != nfserr_stale_clientid) && \ | ||
364 | ((err) != nfserr_bad_seqid) && \ | ||
365 | ((err) != nfserr_stale_stateid) && \ | ||
366 | ((err) != nfserr_bad_stateid)) | ||
367 | |||
368 | struct nfsd4_compound_state; | ||
369 | |||
370 | extern __be32 nfs4_preprocess_stateid_op(struct nfsd4_compound_state *cstate, | ||
371 | stateid_t *stateid, int flags, struct file **filp); | ||
372 | extern void nfs4_lock_state(void); | ||
373 | extern void nfs4_unlock_state(void); | ||
374 | extern int nfs4_in_grace(void); | ||
375 | extern __be32 nfs4_check_open_reclaim(clientid_t *clid); | ||
376 | extern void put_nfs4_client(struct nfs4_client *clp); | ||
377 | extern void nfs4_free_stateowner(struct kref *kref); | ||
378 | extern int set_callback_cred(void); | ||
379 | extern void nfsd4_probe_callback(struct nfs4_client *clp); | ||
380 | extern void nfsd4_cb_recall(struct nfs4_delegation *dp); | ||
381 | extern void nfs4_put_delegation(struct nfs4_delegation *dp); | ||
382 | extern __be32 nfs4_make_rec_clidname(char *clidname, struct xdr_netobj *clname); | ||
383 | extern void nfsd4_init_recdir(char *recdir_name); | ||
384 | extern int nfsd4_recdir_load(void); | ||
385 | extern void nfsd4_shutdown_recdir(void); | ||
386 | extern int nfs4_client_to_reclaim(const char *name); | ||
387 | extern int nfs4_has_reclaimed_state(const char *name, bool use_exchange_id); | ||
388 | extern void nfsd4_recdir_purge_old(void); | ||
389 | extern int nfsd4_create_clid_dir(struct nfs4_client *clp); | ||
390 | extern void nfsd4_remove_clid_dir(struct nfs4_client *clp); | ||
391 | |||
392 | static inline void | ||
393 | nfs4_put_stateowner(struct nfs4_stateowner *so) | ||
394 | { | ||
395 | kref_put(&so->so_ref, nfs4_free_stateowner); | ||
396 | } | ||
397 | |||
398 | static inline void | ||
399 | nfs4_get_stateowner(struct nfs4_stateowner *so) | ||
400 | { | ||
401 | kref_get(&so->so_ref); | ||
402 | } | ||
403 | |||
404 | #endif /* NFSD4_STATE_H */ | ||
diff --git a/include/linux/nfsd/syscall.h b/include/linux/nfsd/syscall.h index 7a3b565b898f..812bc1e160dc 100644 --- a/include/linux/nfsd/syscall.h +++ b/include/linux/nfsd/syscall.h | |||
@@ -9,14 +9,8 @@ | |||
9 | #ifndef NFSD_SYSCALL_H | 9 | #ifndef NFSD_SYSCALL_H |
10 | #define NFSD_SYSCALL_H | 10 | #define NFSD_SYSCALL_H |
11 | 11 | ||
12 | # include <linux/types.h> | 12 | #include <linux/types.h> |
13 | #ifdef __KERNEL__ | ||
14 | # include <linux/in.h> | ||
15 | #endif | ||
16 | #include <linux/posix_types.h> | ||
17 | #include <linux/nfsd/const.h> | ||
18 | #include <linux/nfsd/export.h> | 13 | #include <linux/nfsd/export.h> |
19 | #include <linux/nfsd/nfsfh.h> | ||
20 | 14 | ||
21 | /* | 15 | /* |
22 | * Version of the syscall interface | 16 | * Version of the syscall interface |
diff --git a/include/linux/nfsd/xdr.h b/include/linux/nfsd/xdr.h deleted file mode 100644 index a0132ef58f21..000000000000 --- a/include/linux/nfsd/xdr.h +++ /dev/null | |||
@@ -1,177 +0,0 @@ | |||
1 | /* | ||
2 | * linux/include/linux/nfsd/xdr.h | ||
3 | * | ||
4 | * XDR types for nfsd. This is mainly a typing exercise. | ||
5 | */ | ||
6 | |||
7 | #ifndef LINUX_NFSD_H | ||
8 | #define LINUX_NFSD_H | ||
9 | |||
10 | #include <linux/fs.h> | ||
11 | #include <linux/vfs.h> | ||
12 | #include <linux/nfs.h> | ||
13 | |||
14 | struct nfsd_fhandle { | ||
15 | struct svc_fh fh; | ||
16 | }; | ||
17 | |||
18 | struct nfsd_sattrargs { | ||
19 | struct svc_fh fh; | ||
20 | struct iattr attrs; | ||
21 | }; | ||
22 | |||
23 | struct nfsd_diropargs { | ||
24 | struct svc_fh fh; | ||
25 | char * name; | ||
26 | unsigned int len; | ||
27 | }; | ||
28 | |||
29 | struct nfsd_readargs { | ||
30 | struct svc_fh fh; | ||
31 | __u32 offset; | ||
32 | __u32 count; | ||
33 | int vlen; | ||
34 | }; | ||
35 | |||
36 | struct nfsd_writeargs { | ||
37 | svc_fh fh; | ||
38 | __u32 offset; | ||
39 | int len; | ||
40 | int vlen; | ||
41 | }; | ||
42 | |||
43 | struct nfsd_createargs { | ||
44 | struct svc_fh fh; | ||
45 | char * name; | ||
46 | unsigned int len; | ||
47 | struct iattr attrs; | ||
48 | }; | ||
49 | |||
50 | struct nfsd_renameargs { | ||
51 | struct svc_fh ffh; | ||
52 | char * fname; | ||
53 | unsigned int flen; | ||
54 | struct svc_fh tfh; | ||
55 | char * tname; | ||
56 | unsigned int tlen; | ||
57 | }; | ||
58 | |||
59 | struct nfsd_readlinkargs { | ||
60 | struct svc_fh fh; | ||
61 | char * buffer; | ||
62 | }; | ||
63 | |||
64 | struct nfsd_linkargs { | ||
65 | struct svc_fh ffh; | ||
66 | struct svc_fh tfh; | ||
67 | char * tname; | ||
68 | unsigned int tlen; | ||
69 | }; | ||
70 | |||
71 | struct nfsd_symlinkargs { | ||
72 | struct svc_fh ffh; | ||
73 | char * fname; | ||
74 | unsigned int flen; | ||
75 | char * tname; | ||
76 | unsigned int tlen; | ||
77 | struct iattr attrs; | ||
78 | }; | ||
79 | |||
80 | struct nfsd_readdirargs { | ||
81 | struct svc_fh fh; | ||
82 | __u32 cookie; | ||
83 | __u32 count; | ||
84 | __be32 * buffer; | ||
85 | }; | ||
86 | |||
87 | struct nfsd_attrstat { | ||
88 | struct svc_fh fh; | ||
89 | struct kstat stat; | ||
90 | }; | ||
91 | |||
92 | struct nfsd_diropres { | ||
93 | struct svc_fh fh; | ||
94 | struct kstat stat; | ||
95 | }; | ||
96 | |||
97 | struct nfsd_readlinkres { | ||
98 | int len; | ||
99 | }; | ||
100 | |||
101 | struct nfsd_readres { | ||
102 | struct svc_fh fh; | ||
103 | unsigned long count; | ||
104 | struct kstat stat; | ||
105 | }; | ||
106 | |||
107 | struct nfsd_readdirres { | ||
108 | int count; | ||
109 | |||
110 | struct readdir_cd common; | ||
111 | __be32 * buffer; | ||
112 | int buflen; | ||
113 | __be32 * offset; | ||
114 | }; | ||
115 | |||
116 | struct nfsd_statfsres { | ||
117 | struct kstatfs stats; | ||
118 | }; | ||
119 | |||
120 | /* | ||
121 | * Storage requirements for XDR arguments and results. | ||
122 | */ | ||
123 | union nfsd_xdrstore { | ||
124 | struct nfsd_sattrargs sattr; | ||
125 | struct nfsd_diropargs dirop; | ||
126 | struct nfsd_readargs read; | ||
127 | struct nfsd_writeargs write; | ||
128 | struct nfsd_createargs create; | ||
129 | struct nfsd_renameargs rename; | ||
130 | struct nfsd_linkargs link; | ||
131 | struct nfsd_symlinkargs symlink; | ||
132 | struct nfsd_readdirargs readdir; | ||
133 | }; | ||
134 | |||
135 | #define NFS2_SVC_XDRSIZE sizeof(union nfsd_xdrstore) | ||
136 | |||
137 | |||
138 | int nfssvc_decode_void(struct svc_rqst *, __be32 *, void *); | ||
139 | int nfssvc_decode_fhandle(struct svc_rqst *, __be32 *, struct nfsd_fhandle *); | ||
140 | int nfssvc_decode_sattrargs(struct svc_rqst *, __be32 *, | ||
141 | struct nfsd_sattrargs *); | ||
142 | int nfssvc_decode_diropargs(struct svc_rqst *, __be32 *, | ||
143 | struct nfsd_diropargs *); | ||
144 | int nfssvc_decode_readargs(struct svc_rqst *, __be32 *, | ||
145 | struct nfsd_readargs *); | ||
146 | int nfssvc_decode_writeargs(struct svc_rqst *, __be32 *, | ||
147 | struct nfsd_writeargs *); | ||
148 | int nfssvc_decode_createargs(struct svc_rqst *, __be32 *, | ||
149 | struct nfsd_createargs *); | ||
150 | int nfssvc_decode_renameargs(struct svc_rqst *, __be32 *, | ||
151 | struct nfsd_renameargs *); | ||
152 | int nfssvc_decode_readlinkargs(struct svc_rqst *, __be32 *, | ||
153 | struct nfsd_readlinkargs *); | ||
154 | int nfssvc_decode_linkargs(struct svc_rqst *, __be32 *, | ||
155 | struct nfsd_linkargs *); | ||
156 | int nfssvc_decode_symlinkargs(struct svc_rqst *, __be32 *, | ||
157 | struct nfsd_symlinkargs *); | ||
158 | int nfssvc_decode_readdirargs(struct svc_rqst *, __be32 *, | ||
159 | struct nfsd_readdirargs *); | ||
160 | int nfssvc_encode_void(struct svc_rqst *, __be32 *, void *); | ||
161 | int nfssvc_encode_attrstat(struct svc_rqst *, __be32 *, struct nfsd_attrstat *); | ||
162 | int nfssvc_encode_diropres(struct svc_rqst *, __be32 *, struct nfsd_diropres *); | ||
163 | int nfssvc_encode_readlinkres(struct svc_rqst *, __be32 *, struct nfsd_readlinkres *); | ||
164 | int nfssvc_encode_readres(struct svc_rqst *, __be32 *, struct nfsd_readres *); | ||
165 | int nfssvc_encode_statfsres(struct svc_rqst *, __be32 *, struct nfsd_statfsres *); | ||
166 | int nfssvc_encode_readdirres(struct svc_rqst *, __be32 *, struct nfsd_readdirres *); | ||
167 | |||
168 | int nfssvc_encode_entry(void *, const char *name, | ||
169 | int namlen, loff_t offset, u64 ino, unsigned int); | ||
170 | |||
171 | int nfssvc_release_fhandle(struct svc_rqst *, __be32 *, struct nfsd_fhandle *); | ||
172 | |||
173 | /* Helper functions for NFSv2 ACL code */ | ||
174 | __be32 *nfs2svc_encode_fattr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp); | ||
175 | __be32 *nfs2svc_decode_fh(__be32 *p, struct svc_fh *fhp); | ||
176 | |||
177 | #endif /* LINUX_NFSD_H */ | ||
diff --git a/include/linux/nfsd/xdr3.h b/include/linux/nfsd/xdr3.h deleted file mode 100644 index 421eddd65a25..000000000000 --- a/include/linux/nfsd/xdr3.h +++ /dev/null | |||
@@ -1,346 +0,0 @@ | |||
1 | /* | ||
2 | * linux/include/linux/nfsd/xdr3.h | ||
3 | * | ||
4 | * XDR types for NFSv3 in nfsd. | ||
5 | * | ||
6 | * Copyright (C) 1996-1998, Olaf Kirch <okir@monad.swb.de> | ||
7 | */ | ||
8 | |||
9 | #ifndef _LINUX_NFSD_XDR3_H | ||
10 | #define _LINUX_NFSD_XDR3_H | ||
11 | |||
12 | #include <linux/nfsd/xdr.h> | ||
13 | |||
14 | struct nfsd3_sattrargs { | ||
15 | struct svc_fh fh; | ||
16 | struct iattr attrs; | ||
17 | int check_guard; | ||
18 | time_t guardtime; | ||
19 | }; | ||
20 | |||
21 | struct nfsd3_diropargs { | ||
22 | struct svc_fh fh; | ||
23 | char * name; | ||
24 | unsigned int len; | ||
25 | }; | ||
26 | |||
27 | struct nfsd3_accessargs { | ||
28 | struct svc_fh fh; | ||
29 | unsigned int access; | ||
30 | }; | ||
31 | |||
32 | struct nfsd3_readargs { | ||
33 | struct svc_fh fh; | ||
34 | __u64 offset; | ||
35 | __u32 count; | ||
36 | int vlen; | ||
37 | }; | ||
38 | |||
39 | struct nfsd3_writeargs { | ||
40 | svc_fh fh; | ||
41 | __u64 offset; | ||
42 | __u32 count; | ||
43 | int stable; | ||
44 | __u32 len; | ||
45 | int vlen; | ||
46 | }; | ||
47 | |||
48 | struct nfsd3_createargs { | ||
49 | struct svc_fh fh; | ||
50 | char * name; | ||
51 | unsigned int len; | ||
52 | int createmode; | ||
53 | struct iattr attrs; | ||
54 | __be32 * verf; | ||
55 | }; | ||
56 | |||
57 | struct nfsd3_mknodargs { | ||
58 | struct svc_fh fh; | ||
59 | char * name; | ||
60 | unsigned int len; | ||
61 | __u32 ftype; | ||
62 | __u32 major, minor; | ||
63 | struct iattr attrs; | ||
64 | }; | ||
65 | |||
66 | struct nfsd3_renameargs { | ||
67 | struct svc_fh ffh; | ||
68 | char * fname; | ||
69 | unsigned int flen; | ||
70 | struct svc_fh tfh; | ||
71 | char * tname; | ||
72 | unsigned int tlen; | ||
73 | }; | ||
74 | |||
75 | struct nfsd3_readlinkargs { | ||
76 | struct svc_fh fh; | ||
77 | char * buffer; | ||
78 | }; | ||
79 | |||
80 | struct nfsd3_linkargs { | ||
81 | struct svc_fh ffh; | ||
82 | struct svc_fh tfh; | ||
83 | char * tname; | ||
84 | unsigned int tlen; | ||
85 | }; | ||
86 | |||
87 | struct nfsd3_symlinkargs { | ||
88 | struct svc_fh ffh; | ||
89 | char * fname; | ||
90 | unsigned int flen; | ||
91 | char * tname; | ||
92 | unsigned int tlen; | ||
93 | struct iattr attrs; | ||
94 | }; | ||
95 | |||
96 | struct nfsd3_readdirargs { | ||
97 | struct svc_fh fh; | ||
98 | __u64 cookie; | ||
99 | __u32 dircount; | ||
100 | __u32 count; | ||
101 | __be32 * verf; | ||
102 | __be32 * buffer; | ||
103 | }; | ||
104 | |||
105 | struct nfsd3_commitargs { | ||
106 | struct svc_fh fh; | ||
107 | __u64 offset; | ||
108 | __u32 count; | ||
109 | }; | ||
110 | |||
111 | struct nfsd3_getaclargs { | ||
112 | struct svc_fh fh; | ||
113 | int mask; | ||
114 | }; | ||
115 | |||
116 | struct posix_acl; | ||
117 | struct nfsd3_setaclargs { | ||
118 | struct svc_fh fh; | ||
119 | int mask; | ||
120 | struct posix_acl *acl_access; | ||
121 | struct posix_acl *acl_default; | ||
122 | }; | ||
123 | |||
124 | struct nfsd3_attrstat { | ||
125 | __be32 status; | ||
126 | struct svc_fh fh; | ||
127 | struct kstat stat; | ||
128 | }; | ||
129 | |||
130 | /* LOOKUP, CREATE, MKDIR, SYMLINK, MKNOD */ | ||
131 | struct nfsd3_diropres { | ||
132 | __be32 status; | ||
133 | struct svc_fh dirfh; | ||
134 | struct svc_fh fh; | ||
135 | }; | ||
136 | |||
137 | struct nfsd3_accessres { | ||
138 | __be32 status; | ||
139 | struct svc_fh fh; | ||
140 | __u32 access; | ||
141 | }; | ||
142 | |||
143 | struct nfsd3_readlinkres { | ||
144 | __be32 status; | ||
145 | struct svc_fh fh; | ||
146 | __u32 len; | ||
147 | }; | ||
148 | |||
149 | struct nfsd3_readres { | ||
150 | __be32 status; | ||
151 | struct svc_fh fh; | ||
152 | unsigned long count; | ||
153 | int eof; | ||
154 | }; | ||
155 | |||
156 | struct nfsd3_writeres { | ||
157 | __be32 status; | ||
158 | struct svc_fh fh; | ||
159 | unsigned long count; | ||
160 | int committed; | ||
161 | }; | ||
162 | |||
163 | struct nfsd3_renameres { | ||
164 | __be32 status; | ||
165 | struct svc_fh ffh; | ||
166 | struct svc_fh tfh; | ||
167 | }; | ||
168 | |||
169 | struct nfsd3_linkres { | ||
170 | __be32 status; | ||
171 | struct svc_fh tfh; | ||
172 | struct svc_fh fh; | ||
173 | }; | ||
174 | |||
175 | struct nfsd3_readdirres { | ||
176 | __be32 status; | ||
177 | struct svc_fh fh; | ||
178 | int count; | ||
179 | __be32 verf[2]; | ||
180 | |||
181 | struct readdir_cd common; | ||
182 | __be32 * buffer; | ||
183 | int buflen; | ||
184 | __be32 * offset; | ||
185 | __be32 * offset1; | ||
186 | struct svc_rqst * rqstp; | ||
187 | |||
188 | }; | ||
189 | |||
190 | struct nfsd3_fsstatres { | ||
191 | __be32 status; | ||
192 | struct kstatfs stats; | ||
193 | __u32 invarsec; | ||
194 | }; | ||
195 | |||
196 | struct nfsd3_fsinfores { | ||
197 | __be32 status; | ||
198 | __u32 f_rtmax; | ||
199 | __u32 f_rtpref; | ||
200 | __u32 f_rtmult; | ||
201 | __u32 f_wtmax; | ||
202 | __u32 f_wtpref; | ||
203 | __u32 f_wtmult; | ||
204 | __u32 f_dtpref; | ||
205 | __u64 f_maxfilesize; | ||
206 | __u32 f_properties; | ||
207 | }; | ||
208 | |||
209 | struct nfsd3_pathconfres { | ||
210 | __be32 status; | ||
211 | __u32 p_link_max; | ||
212 | __u32 p_name_max; | ||
213 | __u32 p_no_trunc; | ||
214 | __u32 p_chown_restricted; | ||
215 | __u32 p_case_insensitive; | ||
216 | __u32 p_case_preserving; | ||
217 | }; | ||
218 | |||
219 | struct nfsd3_commitres { | ||
220 | __be32 status; | ||
221 | struct svc_fh fh; | ||
222 | }; | ||
223 | |||
224 | struct nfsd3_getaclres { | ||
225 | __be32 status; | ||
226 | struct svc_fh fh; | ||
227 | int mask; | ||
228 | struct posix_acl *acl_access; | ||
229 | struct posix_acl *acl_default; | ||
230 | }; | ||
231 | |||
232 | /* dummy type for release */ | ||
233 | struct nfsd3_fhandle_pair { | ||
234 | __u32 dummy; | ||
235 | struct svc_fh fh1; | ||
236 | struct svc_fh fh2; | ||
237 | }; | ||
238 | |||
239 | /* | ||
240 | * Storage requirements for XDR arguments and results. | ||
241 | */ | ||
242 | union nfsd3_xdrstore { | ||
243 | struct nfsd3_sattrargs sattrargs; | ||
244 | struct nfsd3_diropargs diropargs; | ||
245 | struct nfsd3_readargs readargs; | ||
246 | struct nfsd3_writeargs writeargs; | ||
247 | struct nfsd3_createargs createargs; | ||
248 | struct nfsd3_renameargs renameargs; | ||
249 | struct nfsd3_linkargs linkargs; | ||
250 | struct nfsd3_symlinkargs symlinkargs; | ||
251 | struct nfsd3_readdirargs readdirargs; | ||
252 | struct nfsd3_diropres diropres; | ||
253 | struct nfsd3_accessres accessres; | ||
254 | struct nfsd3_readlinkres readlinkres; | ||
255 | struct nfsd3_readres readres; | ||
256 | struct nfsd3_writeres writeres; | ||
257 | struct nfsd3_renameres renameres; | ||
258 | struct nfsd3_linkres linkres; | ||
259 | struct nfsd3_readdirres readdirres; | ||
260 | struct nfsd3_fsstatres fsstatres; | ||
261 | struct nfsd3_fsinfores fsinfores; | ||
262 | struct nfsd3_pathconfres pathconfres; | ||
263 | struct nfsd3_commitres commitres; | ||
264 | struct nfsd3_getaclres getaclres; | ||
265 | }; | ||
266 | |||
267 | #define NFS3_SVC_XDRSIZE sizeof(union nfsd3_xdrstore) | ||
268 | |||
269 | int nfs3svc_decode_fhandle(struct svc_rqst *, __be32 *, struct nfsd_fhandle *); | ||
270 | int nfs3svc_decode_sattrargs(struct svc_rqst *, __be32 *, | ||
271 | struct nfsd3_sattrargs *); | ||
272 | int nfs3svc_decode_diropargs(struct svc_rqst *, __be32 *, | ||
273 | struct nfsd3_diropargs *); | ||
274 | int nfs3svc_decode_accessargs(struct svc_rqst *, __be32 *, | ||
275 | struct nfsd3_accessargs *); | ||
276 | int nfs3svc_decode_readargs(struct svc_rqst *, __be32 *, | ||
277 | struct nfsd3_readargs *); | ||
278 | int nfs3svc_decode_writeargs(struct svc_rqst *, __be32 *, | ||
279 | struct nfsd3_writeargs *); | ||
280 | int nfs3svc_decode_createargs(struct svc_rqst *, __be32 *, | ||
281 | struct nfsd3_createargs *); | ||
282 | int nfs3svc_decode_mkdirargs(struct svc_rqst *, __be32 *, | ||
283 | struct nfsd3_createargs *); | ||
284 | int nfs3svc_decode_mknodargs(struct svc_rqst *, __be32 *, | ||
285 | struct nfsd3_mknodargs *); | ||
286 | int nfs3svc_decode_renameargs(struct svc_rqst *, __be32 *, | ||
287 | struct nfsd3_renameargs *); | ||
288 | int nfs3svc_decode_readlinkargs(struct svc_rqst *, __be32 *, | ||
289 | struct nfsd3_readlinkargs *); | ||
290 | int nfs3svc_decode_linkargs(struct svc_rqst *, __be32 *, | ||
291 | struct nfsd3_linkargs *); | ||
292 | int nfs3svc_decode_symlinkargs(struct svc_rqst *, __be32 *, | ||
293 | struct nfsd3_symlinkargs *); | ||
294 | int nfs3svc_decode_readdirargs(struct svc_rqst *, __be32 *, | ||
295 | struct nfsd3_readdirargs *); | ||
296 | int nfs3svc_decode_readdirplusargs(struct svc_rqst *, __be32 *, | ||
297 | struct nfsd3_readdirargs *); | ||
298 | int nfs3svc_decode_commitargs(struct svc_rqst *, __be32 *, | ||
299 | struct nfsd3_commitargs *); | ||
300 | int nfs3svc_encode_voidres(struct svc_rqst *, __be32 *, void *); | ||
301 | int nfs3svc_encode_attrstat(struct svc_rqst *, __be32 *, | ||
302 | struct nfsd3_attrstat *); | ||
303 | int nfs3svc_encode_wccstat(struct svc_rqst *, __be32 *, | ||
304 | struct nfsd3_attrstat *); | ||
305 | int nfs3svc_encode_diropres(struct svc_rqst *, __be32 *, | ||
306 | struct nfsd3_diropres *); | ||
307 | int nfs3svc_encode_accessres(struct svc_rqst *, __be32 *, | ||
308 | struct nfsd3_accessres *); | ||
309 | int nfs3svc_encode_readlinkres(struct svc_rqst *, __be32 *, | ||
310 | struct nfsd3_readlinkres *); | ||
311 | int nfs3svc_encode_readres(struct svc_rqst *, __be32 *, struct nfsd3_readres *); | ||
312 | int nfs3svc_encode_writeres(struct svc_rqst *, __be32 *, struct nfsd3_writeres *); | ||
313 | int nfs3svc_encode_createres(struct svc_rqst *, __be32 *, | ||
314 | struct nfsd3_diropres *); | ||
315 | int nfs3svc_encode_renameres(struct svc_rqst *, __be32 *, | ||
316 | struct nfsd3_renameres *); | ||
317 | int nfs3svc_encode_linkres(struct svc_rqst *, __be32 *, | ||
318 | struct nfsd3_linkres *); | ||
319 | int nfs3svc_encode_readdirres(struct svc_rqst *, __be32 *, | ||
320 | struct nfsd3_readdirres *); | ||
321 | int nfs3svc_encode_fsstatres(struct svc_rqst *, __be32 *, | ||
322 | struct nfsd3_fsstatres *); | ||
323 | int nfs3svc_encode_fsinfores(struct svc_rqst *, __be32 *, | ||
324 | struct nfsd3_fsinfores *); | ||
325 | int nfs3svc_encode_pathconfres(struct svc_rqst *, __be32 *, | ||
326 | struct nfsd3_pathconfres *); | ||
327 | int nfs3svc_encode_commitres(struct svc_rqst *, __be32 *, | ||
328 | struct nfsd3_commitres *); | ||
329 | |||
330 | int nfs3svc_release_fhandle(struct svc_rqst *, __be32 *, | ||
331 | struct nfsd3_attrstat *); | ||
332 | int nfs3svc_release_fhandle2(struct svc_rqst *, __be32 *, | ||
333 | struct nfsd3_fhandle_pair *); | ||
334 | int nfs3svc_encode_entry(void *, const char *name, | ||
335 | int namlen, loff_t offset, u64 ino, | ||
336 | unsigned int); | ||
337 | int nfs3svc_encode_entry_plus(void *, const char *name, | ||
338 | int namlen, loff_t offset, u64 ino, | ||
339 | unsigned int); | ||
340 | /* Helper functions for NFSv3 ACL code */ | ||
341 | __be32 *nfs3svc_encode_post_op_attr(struct svc_rqst *rqstp, __be32 *p, | ||
342 | struct svc_fh *fhp); | ||
343 | __be32 *nfs3svc_decode_fh(__be32 *p, struct svc_fh *fhp); | ||
344 | |||
345 | |||
346 | #endif /* _LINUX_NFSD_XDR3_H */ | ||
diff --git a/include/linux/nfsd/xdr4.h b/include/linux/nfsd/xdr4.h deleted file mode 100644 index 73164c2b3d29..000000000000 --- a/include/linux/nfsd/xdr4.h +++ /dev/null | |||
@@ -1,563 +0,0 @@ | |||
1 | /* | ||
2 | * include/linux/nfsd/xdr4.h | ||
3 | * | ||
4 | * Server-side types for NFSv4. | ||
5 | * | ||
6 | * Copyright (c) 2002 The Regents of the University of Michigan. | ||
7 | * All rights reserved. | ||
8 | * | ||
9 | * Kendrick Smith <kmsmith@umich.edu> | ||
10 | * Andy Adamson <andros@umich.edu> | ||
11 | * | ||
12 | * Redistribution and use in source and binary forms, with or without | ||
13 | * modification, are permitted provided that the following conditions | ||
14 | * are met: | ||
15 | * | ||
16 | * 1. Redistributions of source code must retain the above copyright | ||
17 | * notice, this list of conditions and the following disclaimer. | ||
18 | * 2. Redistributions in binary form must reproduce the above copyright | ||
19 | * notice, this list of conditions and the following disclaimer in the | ||
20 | * documentation and/or other materials provided with the distribution. | ||
21 | * 3. Neither the name of the University nor the names of its | ||
22 | * contributors may be used to endorse or promote products derived | ||
23 | * from this software without specific prior written permission. | ||
24 | * | ||
25 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
26 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
27 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
28 | * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
29 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
30 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
31 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR | ||
32 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
33 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
34 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
35 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
36 | * | ||
37 | */ | ||
38 | |||
39 | #ifndef _LINUX_NFSD_XDR4_H | ||
40 | #define _LINUX_NFSD_XDR4_H | ||
41 | |||
42 | #include <linux/nfs4.h> | ||
43 | |||
44 | #define NFSD4_MAX_TAGLEN 128 | ||
45 | #define XDR_LEN(n) (((n) + 3) & ~3) | ||
46 | |||
47 | struct nfsd4_compound_state { | ||
48 | struct svc_fh current_fh; | ||
49 | struct svc_fh save_fh; | ||
50 | struct nfs4_stateowner *replay_owner; | ||
51 | /* For sessions DRC */ | ||
52 | struct nfsd4_session *session; | ||
53 | struct nfsd4_slot *slot; | ||
54 | __be32 *datap; | ||
55 | size_t iovlen; | ||
56 | u32 minorversion; | ||
57 | u32 status; | ||
58 | }; | ||
59 | |||
60 | static inline bool nfsd4_has_session(struct nfsd4_compound_state *cs) | ||
61 | { | ||
62 | return cs->slot != NULL; | ||
63 | } | ||
64 | |||
65 | struct nfsd4_change_info { | ||
66 | u32 atomic; | ||
67 | bool change_supported; | ||
68 | u32 before_ctime_sec; | ||
69 | u32 before_ctime_nsec; | ||
70 | u64 before_change; | ||
71 | u32 after_ctime_sec; | ||
72 | u32 after_ctime_nsec; | ||
73 | u64 after_change; | ||
74 | }; | ||
75 | |||
76 | struct nfsd4_access { | ||
77 | u32 ac_req_access; /* request */ | ||
78 | u32 ac_supported; /* response */ | ||
79 | u32 ac_resp_access; /* response */ | ||
80 | }; | ||
81 | |||
82 | struct nfsd4_close { | ||
83 | u32 cl_seqid; /* request */ | ||
84 | stateid_t cl_stateid; /* request+response */ | ||
85 | struct nfs4_stateowner * cl_stateowner; /* response */ | ||
86 | }; | ||
87 | |||
88 | struct nfsd4_commit { | ||
89 | u64 co_offset; /* request */ | ||
90 | u32 co_count; /* request */ | ||
91 | nfs4_verifier co_verf; /* response */ | ||
92 | }; | ||
93 | |||
94 | struct nfsd4_create { | ||
95 | u32 cr_namelen; /* request */ | ||
96 | char * cr_name; /* request */ | ||
97 | u32 cr_type; /* request */ | ||
98 | union { /* request */ | ||
99 | struct { | ||
100 | u32 namelen; | ||
101 | char *name; | ||
102 | } link; /* NF4LNK */ | ||
103 | struct { | ||
104 | u32 specdata1; | ||
105 | u32 specdata2; | ||
106 | } dev; /* NF4BLK, NF4CHR */ | ||
107 | } u; | ||
108 | u32 cr_bmval[3]; /* request */ | ||
109 | struct iattr cr_iattr; /* request */ | ||
110 | struct nfsd4_change_info cr_cinfo; /* response */ | ||
111 | struct nfs4_acl *cr_acl; | ||
112 | }; | ||
113 | #define cr_linklen u.link.namelen | ||
114 | #define cr_linkname u.link.name | ||
115 | #define cr_specdata1 u.dev.specdata1 | ||
116 | #define cr_specdata2 u.dev.specdata2 | ||
117 | |||
118 | struct nfsd4_delegreturn { | ||
119 | stateid_t dr_stateid; | ||
120 | }; | ||
121 | |||
122 | struct nfsd4_getattr { | ||
123 | u32 ga_bmval[3]; /* request */ | ||
124 | struct svc_fh *ga_fhp; /* response */ | ||
125 | }; | ||
126 | |||
127 | struct nfsd4_link { | ||
128 | u32 li_namelen; /* request */ | ||
129 | char * li_name; /* request */ | ||
130 | struct nfsd4_change_info li_cinfo; /* response */ | ||
131 | }; | ||
132 | |||
133 | struct nfsd4_lock_denied { | ||
134 | clientid_t ld_clientid; | ||
135 | struct nfs4_stateowner *ld_sop; | ||
136 | u64 ld_start; | ||
137 | u64 ld_length; | ||
138 | u32 ld_type; | ||
139 | }; | ||
140 | |||
141 | struct nfsd4_lock { | ||
142 | /* request */ | ||
143 | u32 lk_type; | ||
144 | u32 lk_reclaim; /* boolean */ | ||
145 | u64 lk_offset; | ||
146 | u64 lk_length; | ||
147 | u32 lk_is_new; | ||
148 | union { | ||
149 | struct { | ||
150 | u32 open_seqid; | ||
151 | stateid_t open_stateid; | ||
152 | u32 lock_seqid; | ||
153 | clientid_t clientid; | ||
154 | struct xdr_netobj owner; | ||
155 | } new; | ||
156 | struct { | ||
157 | stateid_t lock_stateid; | ||
158 | u32 lock_seqid; | ||
159 | } old; | ||
160 | } v; | ||
161 | |||
162 | /* response */ | ||
163 | union { | ||
164 | struct { | ||
165 | stateid_t stateid; | ||
166 | } ok; | ||
167 | struct nfsd4_lock_denied denied; | ||
168 | } u; | ||
169 | /* The lk_replay_owner is the open owner in the open_to_lock_owner | ||
170 | * case and the lock owner otherwise: */ | ||
171 | struct nfs4_stateowner *lk_replay_owner; | ||
172 | }; | ||
173 | #define lk_new_open_seqid v.new.open_seqid | ||
174 | #define lk_new_open_stateid v.new.open_stateid | ||
175 | #define lk_new_lock_seqid v.new.lock_seqid | ||
176 | #define lk_new_clientid v.new.clientid | ||
177 | #define lk_new_owner v.new.owner | ||
178 | #define lk_old_lock_stateid v.old.lock_stateid | ||
179 | #define lk_old_lock_seqid v.old.lock_seqid | ||
180 | |||
181 | #define lk_rflags u.ok.rflags | ||
182 | #define lk_resp_stateid u.ok.stateid | ||
183 | #define lk_denied u.denied | ||
184 | |||
185 | |||
186 | struct nfsd4_lockt { | ||
187 | u32 lt_type; | ||
188 | clientid_t lt_clientid; | ||
189 | struct xdr_netobj lt_owner; | ||
190 | u64 lt_offset; | ||
191 | u64 lt_length; | ||
192 | struct nfs4_stateowner * lt_stateowner; | ||
193 | struct nfsd4_lock_denied lt_denied; | ||
194 | }; | ||
195 | |||
196 | |||
197 | struct nfsd4_locku { | ||
198 | u32 lu_type; | ||
199 | u32 lu_seqid; | ||
200 | stateid_t lu_stateid; | ||
201 | u64 lu_offset; | ||
202 | u64 lu_length; | ||
203 | struct nfs4_stateowner *lu_stateowner; | ||
204 | }; | ||
205 | |||
206 | |||
207 | struct nfsd4_lookup { | ||
208 | u32 lo_len; /* request */ | ||
209 | char * lo_name; /* request */ | ||
210 | }; | ||
211 | |||
212 | struct nfsd4_putfh { | ||
213 | u32 pf_fhlen; /* request */ | ||
214 | char *pf_fhval; /* request */ | ||
215 | }; | ||
216 | |||
217 | struct nfsd4_open { | ||
218 | u32 op_claim_type; /* request */ | ||
219 | struct xdr_netobj op_fname; /* request - everything but CLAIM_PREV */ | ||
220 | u32 op_delegate_type; /* request - CLAIM_PREV only */ | ||
221 | stateid_t op_delegate_stateid; /* request - response */ | ||
222 | u32 op_create; /* request */ | ||
223 | u32 op_createmode; /* request */ | ||
224 | u32 op_bmval[3]; /* request */ | ||
225 | struct iattr iattr; /* UNCHECKED4, GUARDED4, EXCLUSIVE4_1 */ | ||
226 | nfs4_verifier verf; /* EXCLUSIVE4 */ | ||
227 | clientid_t op_clientid; /* request */ | ||
228 | struct xdr_netobj op_owner; /* request */ | ||
229 | u32 op_seqid; /* request */ | ||
230 | u32 op_share_access; /* request */ | ||
231 | u32 op_share_deny; /* request */ | ||
232 | stateid_t op_stateid; /* response */ | ||
233 | u32 op_recall; /* recall */ | ||
234 | struct nfsd4_change_info op_cinfo; /* response */ | ||
235 | u32 op_rflags; /* response */ | ||
236 | int op_truncate; /* used during processing */ | ||
237 | struct nfs4_stateowner *op_stateowner; /* used during processing */ | ||
238 | struct nfs4_acl *op_acl; | ||
239 | }; | ||
240 | #define op_iattr iattr | ||
241 | #define op_verf verf | ||
242 | |||
243 | struct nfsd4_open_confirm { | ||
244 | stateid_t oc_req_stateid /* request */; | ||
245 | u32 oc_seqid /* request */; | ||
246 | stateid_t oc_resp_stateid /* response */; | ||
247 | struct nfs4_stateowner * oc_stateowner; /* response */ | ||
248 | }; | ||
249 | |||
250 | struct nfsd4_open_downgrade { | ||
251 | stateid_t od_stateid; | ||
252 | u32 od_seqid; | ||
253 | u32 od_share_access; | ||
254 | u32 od_share_deny; | ||
255 | struct nfs4_stateowner *od_stateowner; | ||
256 | }; | ||
257 | |||
258 | |||
259 | struct nfsd4_read { | ||
260 | stateid_t rd_stateid; /* request */ | ||
261 | u64 rd_offset; /* request */ | ||
262 | u32 rd_length; /* request */ | ||
263 | int rd_vlen; | ||
264 | struct file *rd_filp; | ||
265 | |||
266 | struct svc_rqst *rd_rqstp; /* response */ | ||
267 | struct svc_fh * rd_fhp; /* response */ | ||
268 | }; | ||
269 | |||
270 | struct nfsd4_readdir { | ||
271 | u64 rd_cookie; /* request */ | ||
272 | nfs4_verifier rd_verf; /* request */ | ||
273 | u32 rd_dircount; /* request */ | ||
274 | u32 rd_maxcount; /* request */ | ||
275 | u32 rd_bmval[3]; /* request */ | ||
276 | struct svc_rqst *rd_rqstp; /* response */ | ||
277 | struct svc_fh * rd_fhp; /* response */ | ||
278 | |||
279 | struct readdir_cd common; | ||
280 | __be32 * buffer; | ||
281 | int buflen; | ||
282 | __be32 * offset; | ||
283 | }; | ||
284 | |||
285 | struct nfsd4_release_lockowner { | ||
286 | clientid_t rl_clientid; | ||
287 | struct xdr_netobj rl_owner; | ||
288 | }; | ||
289 | struct nfsd4_readlink { | ||
290 | struct svc_rqst *rl_rqstp; /* request */ | ||
291 | struct svc_fh * rl_fhp; /* request */ | ||
292 | }; | ||
293 | |||
294 | struct nfsd4_remove { | ||
295 | u32 rm_namelen; /* request */ | ||
296 | char * rm_name; /* request */ | ||
297 | struct nfsd4_change_info rm_cinfo; /* response */ | ||
298 | }; | ||
299 | |||
300 | struct nfsd4_rename { | ||
301 | u32 rn_snamelen; /* request */ | ||
302 | char * rn_sname; /* request */ | ||
303 | u32 rn_tnamelen; /* request */ | ||
304 | char * rn_tname; /* request */ | ||
305 | struct nfsd4_change_info rn_sinfo; /* response */ | ||
306 | struct nfsd4_change_info rn_tinfo; /* response */ | ||
307 | }; | ||
308 | |||
309 | struct nfsd4_secinfo { | ||
310 | u32 si_namelen; /* request */ | ||
311 | char *si_name; /* request */ | ||
312 | struct svc_export *si_exp; /* response */ | ||
313 | }; | ||
314 | |||
315 | struct nfsd4_setattr { | ||
316 | stateid_t sa_stateid; /* request */ | ||
317 | u32 sa_bmval[3]; /* request */ | ||
318 | struct iattr sa_iattr; /* request */ | ||
319 | struct nfs4_acl *sa_acl; | ||
320 | }; | ||
321 | |||
322 | struct nfsd4_setclientid { | ||
323 | nfs4_verifier se_verf; /* request */ | ||
324 | u32 se_namelen; /* request */ | ||
325 | char * se_name; /* request */ | ||
326 | u32 se_callback_prog; /* request */ | ||
327 | u32 se_callback_netid_len; /* request */ | ||
328 | char * se_callback_netid_val; /* request */ | ||
329 | u32 se_callback_addr_len; /* request */ | ||
330 | char * se_callback_addr_val; /* request */ | ||
331 | u32 se_callback_ident; /* request */ | ||
332 | clientid_t se_clientid; /* response */ | ||
333 | nfs4_verifier se_confirm; /* response */ | ||
334 | }; | ||
335 | |||
336 | struct nfsd4_setclientid_confirm { | ||
337 | clientid_t sc_clientid; | ||
338 | nfs4_verifier sc_confirm; | ||
339 | }; | ||
340 | |||
341 | /* also used for NVERIFY */ | ||
342 | struct nfsd4_verify { | ||
343 | u32 ve_bmval[3]; /* request */ | ||
344 | u32 ve_attrlen; /* request */ | ||
345 | char * ve_attrval; /* request */ | ||
346 | }; | ||
347 | |||
348 | struct nfsd4_write { | ||
349 | stateid_t wr_stateid; /* request */ | ||
350 | u64 wr_offset; /* request */ | ||
351 | u32 wr_stable_how; /* request */ | ||
352 | u32 wr_buflen; /* request */ | ||
353 | int wr_vlen; | ||
354 | |||
355 | u32 wr_bytes_written; /* response */ | ||
356 | u32 wr_how_written; /* response */ | ||
357 | nfs4_verifier wr_verifier; /* response */ | ||
358 | }; | ||
359 | |||
360 | struct nfsd4_exchange_id { | ||
361 | nfs4_verifier verifier; | ||
362 | struct xdr_netobj clname; | ||
363 | u32 flags; | ||
364 | clientid_t clientid; | ||
365 | u32 seqid; | ||
366 | int spa_how; | ||
367 | }; | ||
368 | |||
369 | struct nfsd4_sequence { | ||
370 | struct nfs4_sessionid sessionid; /* request/response */ | ||
371 | u32 seqid; /* request/response */ | ||
372 | u32 slotid; /* request/response */ | ||
373 | u32 maxslots; /* request/response */ | ||
374 | u32 cachethis; /* request */ | ||
375 | #if 0 | ||
376 | u32 target_maxslots; /* response */ | ||
377 | u32 status_flags; /* response */ | ||
378 | #endif /* not yet */ | ||
379 | }; | ||
380 | |||
381 | struct nfsd4_destroy_session { | ||
382 | struct nfs4_sessionid sessionid; | ||
383 | }; | ||
384 | |||
385 | struct nfsd4_op { | ||
386 | int opnum; | ||
387 | __be32 status; | ||
388 | union { | ||
389 | struct nfsd4_access access; | ||
390 | struct nfsd4_close close; | ||
391 | struct nfsd4_commit commit; | ||
392 | struct nfsd4_create create; | ||
393 | struct nfsd4_delegreturn delegreturn; | ||
394 | struct nfsd4_getattr getattr; | ||
395 | struct svc_fh * getfh; | ||
396 | struct nfsd4_link link; | ||
397 | struct nfsd4_lock lock; | ||
398 | struct nfsd4_lockt lockt; | ||
399 | struct nfsd4_locku locku; | ||
400 | struct nfsd4_lookup lookup; | ||
401 | struct nfsd4_verify nverify; | ||
402 | struct nfsd4_open open; | ||
403 | struct nfsd4_open_confirm open_confirm; | ||
404 | struct nfsd4_open_downgrade open_downgrade; | ||
405 | struct nfsd4_putfh putfh; | ||
406 | struct nfsd4_read read; | ||
407 | struct nfsd4_readdir readdir; | ||
408 | struct nfsd4_readlink readlink; | ||
409 | struct nfsd4_remove remove; | ||
410 | struct nfsd4_rename rename; | ||
411 | clientid_t renew; | ||
412 | struct nfsd4_secinfo secinfo; | ||
413 | struct nfsd4_setattr setattr; | ||
414 | struct nfsd4_setclientid setclientid; | ||
415 | struct nfsd4_setclientid_confirm setclientid_confirm; | ||
416 | struct nfsd4_verify verify; | ||
417 | struct nfsd4_write write; | ||
418 | struct nfsd4_release_lockowner release_lockowner; | ||
419 | |||
420 | /* NFSv4.1 */ | ||
421 | struct nfsd4_exchange_id exchange_id; | ||
422 | struct nfsd4_create_session create_session; | ||
423 | struct nfsd4_destroy_session destroy_session; | ||
424 | struct nfsd4_sequence sequence; | ||
425 | } u; | ||
426 | struct nfs4_replay * replay; | ||
427 | }; | ||
428 | |||
429 | struct nfsd4_compoundargs { | ||
430 | /* scratch variables for XDR decode */ | ||
431 | __be32 * p; | ||
432 | __be32 * end; | ||
433 | struct page ** pagelist; | ||
434 | int pagelen; | ||
435 | __be32 tmp[8]; | ||
436 | __be32 * tmpp; | ||
437 | struct tmpbuf { | ||
438 | struct tmpbuf *next; | ||
439 | void (*release)(const void *); | ||
440 | void *buf; | ||
441 | } *to_free; | ||
442 | |||
443 | struct svc_rqst *rqstp; | ||
444 | |||
445 | u32 taglen; | ||
446 | char * tag; | ||
447 | u32 minorversion; | ||
448 | u32 opcnt; | ||
449 | struct nfsd4_op *ops; | ||
450 | struct nfsd4_op iops[8]; | ||
451 | }; | ||
452 | |||
453 | struct nfsd4_compoundres { | ||
454 | /* scratch variables for XDR encode */ | ||
455 | __be32 * p; | ||
456 | __be32 * end; | ||
457 | struct xdr_buf * xbuf; | ||
458 | struct svc_rqst * rqstp; | ||
459 | |||
460 | u32 taglen; | ||
461 | char * tag; | ||
462 | u32 opcnt; | ||
463 | __be32 * tagp; /* tag, opcount encode location */ | ||
464 | struct nfsd4_compound_state cstate; | ||
465 | }; | ||
466 | |||
467 | static inline bool nfsd4_is_solo_sequence(struct nfsd4_compoundres *resp) | ||
468 | { | ||
469 | struct nfsd4_compoundargs *args = resp->rqstp->rq_argp; | ||
470 | return resp->opcnt == 1 && args->ops[0].opnum == OP_SEQUENCE; | ||
471 | } | ||
472 | |||
473 | static inline bool nfsd4_not_cached(struct nfsd4_compoundres *resp) | ||
474 | { | ||
475 | return !resp->cstate.slot->sl_cachethis || nfsd4_is_solo_sequence(resp); | ||
476 | } | ||
477 | |||
478 | #define NFS4_SVC_XDRSIZE sizeof(struct nfsd4_compoundargs) | ||
479 | |||
480 | static inline void | ||
481 | set_change_info(struct nfsd4_change_info *cinfo, struct svc_fh *fhp) | ||
482 | { | ||
483 | BUG_ON(!fhp->fh_pre_saved || !fhp->fh_post_saved); | ||
484 | cinfo->atomic = 1; | ||
485 | cinfo->change_supported = IS_I_VERSION(fhp->fh_dentry->d_inode); | ||
486 | if (cinfo->change_supported) { | ||
487 | cinfo->before_change = fhp->fh_pre_change; | ||
488 | cinfo->after_change = fhp->fh_post_change; | ||
489 | } else { | ||
490 | cinfo->before_ctime_sec = fhp->fh_pre_ctime.tv_sec; | ||
491 | cinfo->before_ctime_nsec = fhp->fh_pre_ctime.tv_nsec; | ||
492 | cinfo->after_ctime_sec = fhp->fh_post_attr.ctime.tv_sec; | ||
493 | cinfo->after_ctime_nsec = fhp->fh_post_attr.ctime.tv_nsec; | ||
494 | } | ||
495 | } | ||
496 | |||
497 | int nfs4svc_encode_voidres(struct svc_rqst *, __be32 *, void *); | ||
498 | int nfs4svc_decode_compoundargs(struct svc_rqst *, __be32 *, | ||
499 | struct nfsd4_compoundargs *); | ||
500 | int nfs4svc_encode_compoundres(struct svc_rqst *, __be32 *, | ||
501 | struct nfsd4_compoundres *); | ||
502 | void nfsd4_encode_operation(struct nfsd4_compoundres *, struct nfsd4_op *); | ||
503 | void nfsd4_encode_replay(struct nfsd4_compoundres *resp, struct nfsd4_op *op); | ||
504 | __be32 nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp, | ||
505 | struct dentry *dentry, __be32 *buffer, int *countp, | ||
506 | u32 *bmval, struct svc_rqst *, int ignore_crossmnt); | ||
507 | extern __be32 nfsd4_setclientid(struct svc_rqst *rqstp, | ||
508 | struct nfsd4_compound_state *, | ||
509 | struct nfsd4_setclientid *setclid); | ||
510 | extern __be32 nfsd4_setclientid_confirm(struct svc_rqst *rqstp, | ||
511 | struct nfsd4_compound_state *, | ||
512 | struct nfsd4_setclientid_confirm *setclientid_confirm); | ||
513 | extern void nfsd4_store_cache_entry(struct nfsd4_compoundres *resp); | ||
514 | extern __be32 nfsd4_replay_cache_entry(struct nfsd4_compoundres *resp, | ||
515 | struct nfsd4_sequence *seq); | ||
516 | extern __be32 nfsd4_exchange_id(struct svc_rqst *rqstp, | ||
517 | struct nfsd4_compound_state *, | ||
518 | struct nfsd4_exchange_id *); | ||
519 | extern __be32 nfsd4_create_session(struct svc_rqst *, | ||
520 | struct nfsd4_compound_state *, | ||
521 | struct nfsd4_create_session *); | ||
522 | extern __be32 nfsd4_sequence(struct svc_rqst *, | ||
523 | struct nfsd4_compound_state *, | ||
524 | struct nfsd4_sequence *); | ||
525 | extern __be32 nfsd4_destroy_session(struct svc_rqst *, | ||
526 | struct nfsd4_compound_state *, | ||
527 | struct nfsd4_destroy_session *); | ||
528 | extern __be32 nfsd4_process_open1(struct nfsd4_compound_state *, | ||
529 | struct nfsd4_open *open); | ||
530 | extern __be32 nfsd4_process_open2(struct svc_rqst *rqstp, | ||
531 | struct svc_fh *current_fh, struct nfsd4_open *open); | ||
532 | extern __be32 nfsd4_open_confirm(struct svc_rqst *rqstp, | ||
533 | struct nfsd4_compound_state *, struct nfsd4_open_confirm *oc); | ||
534 | extern __be32 nfsd4_close(struct svc_rqst *rqstp, | ||
535 | struct nfsd4_compound_state *, | ||
536 | struct nfsd4_close *close); | ||
537 | extern __be32 nfsd4_open_downgrade(struct svc_rqst *rqstp, | ||
538 | struct nfsd4_compound_state *, | ||
539 | struct nfsd4_open_downgrade *od); | ||
540 | extern __be32 nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *, | ||
541 | struct nfsd4_lock *lock); | ||
542 | extern __be32 nfsd4_lockt(struct svc_rqst *rqstp, | ||
543 | struct nfsd4_compound_state *, | ||
544 | struct nfsd4_lockt *lockt); | ||
545 | extern __be32 nfsd4_locku(struct svc_rqst *rqstp, | ||
546 | struct nfsd4_compound_state *, | ||
547 | struct nfsd4_locku *locku); | ||
548 | extern __be32 | ||
549 | nfsd4_release_lockowner(struct svc_rqst *rqstp, | ||
550 | struct nfsd4_compound_state *, | ||
551 | struct nfsd4_release_lockowner *rlockowner); | ||
552 | extern void nfsd4_release_compoundargs(struct nfsd4_compoundargs *); | ||
553 | extern __be32 nfsd4_delegreturn(struct svc_rqst *rqstp, | ||
554 | struct nfsd4_compound_state *, struct nfsd4_delegreturn *dr); | ||
555 | extern __be32 nfsd4_renew(struct svc_rqst *rqstp, | ||
556 | struct nfsd4_compound_state *, clientid_t *clid); | ||
557 | #endif | ||
558 | |||
559 | /* | ||
560 | * Local variables: | ||
561 | * c-basic-offset: 8 | ||
562 | * End: | ||
563 | */ | ||
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 49e907bd067f..5b59f35dcb8f 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -8,7 +8,7 @@ | |||
8 | #include <linux/types.h> | 8 | #include <linux/types.h> |
9 | #ifndef __GENERATING_BOUNDS_H | 9 | #ifndef __GENERATING_BOUNDS_H |
10 | #include <linux/mm_types.h> | 10 | #include <linux/mm_types.h> |
11 | #include <linux/bounds.h> | 11 | #include <generated/bounds.h> |
12 | #endif /* !__GENERATING_BOUNDS_H */ | 12 | #endif /* !__GENERATING_BOUNDS_H */ |
13 | 13 | ||
14 | /* | 14 | /* |
@@ -275,13 +275,15 @@ PAGEFLAG_FALSE(Uncached) | |||
275 | 275 | ||
276 | #ifdef CONFIG_MEMORY_FAILURE | 276 | #ifdef CONFIG_MEMORY_FAILURE |
277 | PAGEFLAG(HWPoison, hwpoison) | 277 | PAGEFLAG(HWPoison, hwpoison) |
278 | TESTSETFLAG(HWPoison, hwpoison) | 278 | TESTSCFLAG(HWPoison, hwpoison) |
279 | #define __PG_HWPOISON (1UL << PG_hwpoison) | 279 | #define __PG_HWPOISON (1UL << PG_hwpoison) |
280 | #else | 280 | #else |
281 | PAGEFLAG_FALSE(HWPoison) | 281 | PAGEFLAG_FALSE(HWPoison) |
282 | #define __PG_HWPOISON 0 | 282 | #define __PG_HWPOISON 0 |
283 | #endif | 283 | #endif |
284 | 284 | ||
285 | u64 stable_page_flags(struct page *page); | ||
286 | |||
285 | static inline int PageUptodate(struct page *page) | 287 | static inline int PageUptodate(struct page *page) |
286 | { | 288 | { |
287 | int ret = test_bit(PG_uptodate, &(page)->flags); | 289 | int ret = test_bit(PG_uptodate, &(page)->flags); |
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index ed5d7501e181..3c62ed408492 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
@@ -253,6 +253,8 @@ extern struct page * read_cache_page_async(struct address_space *mapping, | |||
253 | extern struct page * read_cache_page(struct address_space *mapping, | 253 | extern struct page * read_cache_page(struct address_space *mapping, |
254 | pgoff_t index, filler_t *filler, | 254 | pgoff_t index, filler_t *filler, |
255 | void *data); | 255 | void *data); |
256 | extern struct page * read_cache_page_gfp(struct address_space *mapping, | ||
257 | pgoff_t index, gfp_t gfp_mask); | ||
256 | extern int read_cache_pages(struct address_space *mapping, | 258 | extern int read_cache_pages(struct address_space *mapping, |
257 | struct list_head *pages, filler_t *filler, void *data); | 259 | struct list_head *pages, filler_t *filler, void *data); |
258 | 260 | ||
diff --git a/include/linux/pci.h b/include/linux/pci.h index bf1e67080849..c1968f464c38 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -243,6 +243,7 @@ struct pci_dev { | |||
243 | unsigned int d2_support:1; /* Low power state D2 is supported */ | 243 | unsigned int d2_support:1; /* Low power state D2 is supported */ |
244 | unsigned int no_d1d2:1; /* Only allow D0 and D3 */ | 244 | unsigned int no_d1d2:1; /* Only allow D0 and D3 */ |
245 | unsigned int wakeup_prepared:1; | 245 | unsigned int wakeup_prepared:1; |
246 | unsigned int d3_delay; /* D3->D0 transition time in ms */ | ||
246 | 247 | ||
247 | #ifdef CONFIG_PCIEASPM | 248 | #ifdef CONFIG_PCIEASPM |
248 | struct pcie_link_state *link_state; /* ASPM link state. */ | 249 | struct pcie_link_state *link_state; /* ASPM link state. */ |
@@ -566,6 +567,9 @@ void pcibios_align_resource(void *, struct resource *, resource_size_t, | |||
566 | resource_size_t); | 567 | resource_size_t); |
567 | void pcibios_update_irq(struct pci_dev *, int irq); | 568 | void pcibios_update_irq(struct pci_dev *, int irq); |
568 | 569 | ||
570 | /* Weak but can be overriden by arch */ | ||
571 | void pci_fixup_cardbus(struct pci_bus *); | ||
572 | |||
569 | /* Generic PCI functions used internally */ | 573 | /* Generic PCI functions used internally */ |
570 | 574 | ||
571 | extern struct pci_bus *pci_find_bus(int domain, int busnr); | 575 | extern struct pci_bus *pci_find_bus(int domain, int busnr); |
@@ -752,6 +756,10 @@ pci_power_t pci_target_state(struct pci_dev *dev); | |||
752 | int pci_prepare_to_sleep(struct pci_dev *dev); | 756 | int pci_prepare_to_sleep(struct pci_dev *dev); |
753 | int pci_back_from_sleep(struct pci_dev *dev); | 757 | int pci_back_from_sleep(struct pci_dev *dev); |
754 | 758 | ||
759 | /* For use by arch with custom probe code */ | ||
760 | void set_pcie_port_type(struct pci_dev *pdev); | ||
761 | void set_pcie_hotplug_bridge(struct pci_dev *pdev); | ||
762 | |||
755 | /* Functions for PCI Hotplug drivers to use */ | 763 | /* Functions for PCI Hotplug drivers to use */ |
756 | int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap); | 764 | int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap); |
757 | #ifdef CONFIG_HOTPLUG | 765 | #ifdef CONFIG_HOTPLUG |
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h deleted file mode 100644 index e3fb25606706..000000000000 --- a/include/linux/perf_counter.h +++ /dev/null | |||
@@ -1,444 +0,0 @@ | |||
1 | /* | ||
2 | * NOTE: this file will be removed in a future kernel release, it is | ||
3 | * provided as a courtesy copy of user-space code that relies on the | ||
4 | * old (pre-rename) symbols and constants. | ||
5 | * | ||
6 | * Performance events: | ||
7 | * | ||
8 | * Copyright (C) 2008-2009, Thomas Gleixner <tglx@linutronix.de> | ||
9 | * Copyright (C) 2008-2009, Red Hat, Inc., Ingo Molnar | ||
10 | * Copyright (C) 2008-2009, Red Hat, Inc., Peter Zijlstra | ||
11 | * | ||
12 | * Data type definitions, declarations, prototypes. | ||
13 | * | ||
14 | * Started by: Thomas Gleixner and Ingo Molnar | ||
15 | * | ||
16 | * For licencing details see kernel-base/COPYING | ||
17 | */ | ||
18 | #ifndef _LINUX_PERF_COUNTER_H | ||
19 | #define _LINUX_PERF_COUNTER_H | ||
20 | |||
21 | #include <linux/types.h> | ||
22 | #include <linux/ioctl.h> | ||
23 | #include <asm/byteorder.h> | ||
24 | |||
25 | /* | ||
26 | * User-space ABI bits: | ||
27 | */ | ||
28 | |||
29 | /* | ||
30 | * attr.type | ||
31 | */ | ||
32 | enum perf_type_id { | ||
33 | PERF_TYPE_HARDWARE = 0, | ||
34 | PERF_TYPE_SOFTWARE = 1, | ||
35 | PERF_TYPE_TRACEPOINT = 2, | ||
36 | PERF_TYPE_HW_CACHE = 3, | ||
37 | PERF_TYPE_RAW = 4, | ||
38 | |||
39 | PERF_TYPE_MAX, /* non-ABI */ | ||
40 | }; | ||
41 | |||
42 | /* | ||
43 | * Generalized performance counter event types, used by the | ||
44 | * attr.event_id parameter of the sys_perf_counter_open() | ||
45 | * syscall: | ||
46 | */ | ||
47 | enum perf_hw_id { | ||
48 | /* | ||
49 | * Common hardware events, generalized by the kernel: | ||
50 | */ | ||
51 | PERF_COUNT_HW_CPU_CYCLES = 0, | ||
52 | PERF_COUNT_HW_INSTRUCTIONS = 1, | ||
53 | PERF_COUNT_HW_CACHE_REFERENCES = 2, | ||
54 | PERF_COUNT_HW_CACHE_MISSES = 3, | ||
55 | PERF_COUNT_HW_BRANCH_INSTRUCTIONS = 4, | ||
56 | PERF_COUNT_HW_BRANCH_MISSES = 5, | ||
57 | PERF_COUNT_HW_BUS_CYCLES = 6, | ||
58 | |||
59 | PERF_COUNT_HW_MAX, /* non-ABI */ | ||
60 | }; | ||
61 | |||
62 | /* | ||
63 | * Generalized hardware cache counters: | ||
64 | * | ||
65 | * { L1-D, L1-I, LLC, ITLB, DTLB, BPU } x | ||
66 | * { read, write, prefetch } x | ||
67 | * { accesses, misses } | ||
68 | */ | ||
69 | enum perf_hw_cache_id { | ||
70 | PERF_COUNT_HW_CACHE_L1D = 0, | ||
71 | PERF_COUNT_HW_CACHE_L1I = 1, | ||
72 | PERF_COUNT_HW_CACHE_LL = 2, | ||
73 | PERF_COUNT_HW_CACHE_DTLB = 3, | ||
74 | PERF_COUNT_HW_CACHE_ITLB = 4, | ||
75 | PERF_COUNT_HW_CACHE_BPU = 5, | ||
76 | |||
77 | PERF_COUNT_HW_CACHE_MAX, /* non-ABI */ | ||
78 | }; | ||
79 | |||
80 | enum perf_hw_cache_op_id { | ||
81 | PERF_COUNT_HW_CACHE_OP_READ = 0, | ||
82 | PERF_COUNT_HW_CACHE_OP_WRITE = 1, | ||
83 | PERF_COUNT_HW_CACHE_OP_PREFETCH = 2, | ||
84 | |||
85 | PERF_COUNT_HW_CACHE_OP_MAX, /* non-ABI */ | ||
86 | }; | ||
87 | |||
88 | enum perf_hw_cache_op_result_id { | ||
89 | PERF_COUNT_HW_CACHE_RESULT_ACCESS = 0, | ||
90 | PERF_COUNT_HW_CACHE_RESULT_MISS = 1, | ||
91 | |||
92 | PERF_COUNT_HW_CACHE_RESULT_MAX, /* non-ABI */ | ||
93 | }; | ||
94 | |||
95 | /* | ||
96 | * Special "software" counters provided by the kernel, even if the hardware | ||
97 | * does not support performance counters. These counters measure various | ||
98 | * physical and sw events of the kernel (and allow the profiling of them as | ||
99 | * well): | ||
100 | */ | ||
101 | enum perf_sw_ids { | ||
102 | PERF_COUNT_SW_CPU_CLOCK = 0, | ||
103 | PERF_COUNT_SW_TASK_CLOCK = 1, | ||
104 | PERF_COUNT_SW_PAGE_FAULTS = 2, | ||
105 | PERF_COUNT_SW_CONTEXT_SWITCHES = 3, | ||
106 | PERF_COUNT_SW_CPU_MIGRATIONS = 4, | ||
107 | PERF_COUNT_SW_PAGE_FAULTS_MIN = 5, | ||
108 | PERF_COUNT_SW_PAGE_FAULTS_MAJ = 6, | ||
109 | PERF_COUNT_SW_ALIGNMENT_FAULTS = 7, | ||
110 | PERF_COUNT_SW_EMULATION_FAULTS = 8, | ||
111 | |||
112 | PERF_COUNT_SW_MAX, /* non-ABI */ | ||
113 | }; | ||
114 | |||
115 | /* | ||
116 | * Bits that can be set in attr.sample_type to request information | ||
117 | * in the overflow packets. | ||
118 | */ | ||
119 | enum perf_counter_sample_format { | ||
120 | PERF_SAMPLE_IP = 1U << 0, | ||
121 | PERF_SAMPLE_TID = 1U << 1, | ||
122 | PERF_SAMPLE_TIME = 1U << 2, | ||
123 | PERF_SAMPLE_ADDR = 1U << 3, | ||
124 | PERF_SAMPLE_READ = 1U << 4, | ||
125 | PERF_SAMPLE_CALLCHAIN = 1U << 5, | ||
126 | PERF_SAMPLE_ID = 1U << 6, | ||
127 | PERF_SAMPLE_CPU = 1U << 7, | ||
128 | PERF_SAMPLE_PERIOD = 1U << 8, | ||
129 | PERF_SAMPLE_STREAM_ID = 1U << 9, | ||
130 | PERF_SAMPLE_RAW = 1U << 10, | ||
131 | |||
132 | PERF_SAMPLE_MAX = 1U << 11, /* non-ABI */ | ||
133 | }; | ||
134 | |||
135 | /* | ||
136 | * The format of the data returned by read() on a perf counter fd, | ||
137 | * as specified by attr.read_format: | ||
138 | * | ||
139 | * struct read_format { | ||
140 | * { u64 value; | ||
141 | * { u64 time_enabled; } && PERF_FORMAT_ENABLED | ||
142 | * { u64 time_running; } && PERF_FORMAT_RUNNING | ||
143 | * { u64 id; } && PERF_FORMAT_ID | ||
144 | * } && !PERF_FORMAT_GROUP | ||
145 | * | ||
146 | * { u64 nr; | ||
147 | * { u64 time_enabled; } && PERF_FORMAT_ENABLED | ||
148 | * { u64 time_running; } && PERF_FORMAT_RUNNING | ||
149 | * { u64 value; | ||
150 | * { u64 id; } && PERF_FORMAT_ID | ||
151 | * } cntr[nr]; | ||
152 | * } && PERF_FORMAT_GROUP | ||
153 | * }; | ||
154 | */ | ||
155 | enum perf_counter_read_format { | ||
156 | PERF_FORMAT_TOTAL_TIME_ENABLED = 1U << 0, | ||
157 | PERF_FORMAT_TOTAL_TIME_RUNNING = 1U << 1, | ||
158 | PERF_FORMAT_ID = 1U << 2, | ||
159 | PERF_FORMAT_GROUP = 1U << 3, | ||
160 | |||
161 | PERF_FORMAT_MAX = 1U << 4, /* non-ABI */ | ||
162 | }; | ||
163 | |||
164 | #define PERF_ATTR_SIZE_VER0 64 /* sizeof first published struct */ | ||
165 | |||
166 | /* | ||
167 | * Hardware event to monitor via a performance monitoring counter: | ||
168 | */ | ||
169 | struct perf_counter_attr { | ||
170 | |||
171 | /* | ||
172 | * Major type: hardware/software/tracepoint/etc. | ||
173 | */ | ||
174 | __u32 type; | ||
175 | |||
176 | /* | ||
177 | * Size of the attr structure, for fwd/bwd compat. | ||
178 | */ | ||
179 | __u32 size; | ||
180 | |||
181 | /* | ||
182 | * Type specific configuration information. | ||
183 | */ | ||
184 | __u64 config; | ||
185 | |||
186 | union { | ||
187 | __u64 sample_period; | ||
188 | __u64 sample_freq; | ||
189 | }; | ||
190 | |||
191 | __u64 sample_type; | ||
192 | __u64 read_format; | ||
193 | |||
194 | __u64 disabled : 1, /* off by default */ | ||
195 | inherit : 1, /* children inherit it */ | ||
196 | pinned : 1, /* must always be on PMU */ | ||
197 | exclusive : 1, /* only group on PMU */ | ||
198 | exclude_user : 1, /* don't count user */ | ||
199 | exclude_kernel : 1, /* ditto kernel */ | ||
200 | exclude_hv : 1, /* ditto hypervisor */ | ||
201 | exclude_idle : 1, /* don't count when idle */ | ||
202 | mmap : 1, /* include mmap data */ | ||
203 | comm : 1, /* include comm data */ | ||
204 | freq : 1, /* use freq, not period */ | ||
205 | inherit_stat : 1, /* per task counts */ | ||
206 | enable_on_exec : 1, /* next exec enables */ | ||
207 | task : 1, /* trace fork/exit */ | ||
208 | watermark : 1, /* wakeup_watermark */ | ||
209 | |||
210 | __reserved_1 : 49; | ||
211 | |||
212 | union { | ||
213 | __u32 wakeup_events; /* wakeup every n events */ | ||
214 | __u32 wakeup_watermark; /* bytes before wakeup */ | ||
215 | }; | ||
216 | __u32 __reserved_2; | ||
217 | |||
218 | __u64 __reserved_3; | ||
219 | }; | ||
220 | |||
221 | /* | ||
222 | * Ioctls that can be done on a perf counter fd: | ||
223 | */ | ||
224 | #define PERF_COUNTER_IOC_ENABLE _IO ('$', 0) | ||
225 | #define PERF_COUNTER_IOC_DISABLE _IO ('$', 1) | ||
226 | #define PERF_COUNTER_IOC_REFRESH _IO ('$', 2) | ||
227 | #define PERF_COUNTER_IOC_RESET _IO ('$', 3) | ||
228 | #define PERF_COUNTER_IOC_PERIOD _IOW('$', 4, u64) | ||
229 | #define PERF_COUNTER_IOC_SET_OUTPUT _IO ('$', 5) | ||
230 | #define PERF_COUNTER_IOC_SET_FILTER _IOW('$', 6, char *) | ||
231 | |||
232 | enum perf_counter_ioc_flags { | ||
233 | PERF_IOC_FLAG_GROUP = 1U << 0, | ||
234 | }; | ||
235 | |||
236 | /* | ||
237 | * Structure of the page that can be mapped via mmap | ||
238 | */ | ||
239 | struct perf_counter_mmap_page { | ||
240 | __u32 version; /* version number of this structure */ | ||
241 | __u32 compat_version; /* lowest version this is compat with */ | ||
242 | |||
243 | /* | ||
244 | * Bits needed to read the hw counters in user-space. | ||
245 | * | ||
246 | * u32 seq; | ||
247 | * s64 count; | ||
248 | * | ||
249 | * do { | ||
250 | * seq = pc->lock; | ||
251 | * | ||
252 | * barrier() | ||
253 | * if (pc->index) { | ||
254 | * count = pmc_read(pc->index - 1); | ||
255 | * count += pc->offset; | ||
256 | * } else | ||
257 | * goto regular_read; | ||
258 | * | ||
259 | * barrier(); | ||
260 | * } while (pc->lock != seq); | ||
261 | * | ||
262 | * NOTE: for obvious reason this only works on self-monitoring | ||
263 | * processes. | ||
264 | */ | ||
265 | __u32 lock; /* seqlock for synchronization */ | ||
266 | __u32 index; /* hardware counter identifier */ | ||
267 | __s64 offset; /* add to hardware counter value */ | ||
268 | __u64 time_enabled; /* time counter active */ | ||
269 | __u64 time_running; /* time counter on cpu */ | ||
270 | |||
271 | /* | ||
272 | * Hole for extension of the self monitor capabilities | ||
273 | */ | ||
274 | |||
275 | __u64 __reserved[123]; /* align to 1k */ | ||
276 | |||
277 | /* | ||
278 | * Control data for the mmap() data buffer. | ||
279 | * | ||
280 | * User-space reading the @data_head value should issue an rmb(), on | ||
281 | * SMP capable platforms, after reading this value -- see | ||
282 | * perf_counter_wakeup(). | ||
283 | * | ||
284 | * When the mapping is PROT_WRITE the @data_tail value should be | ||
285 | * written by userspace to reflect the last read data. In this case | ||
286 | * the kernel will not over-write unread data. | ||
287 | */ | ||
288 | __u64 data_head; /* head in the data section */ | ||
289 | __u64 data_tail; /* user-space written tail */ | ||
290 | }; | ||
291 | |||
292 | #define PERF_EVENT_MISC_CPUMODE_MASK (3 << 0) | ||
293 | #define PERF_EVENT_MISC_CPUMODE_UNKNOWN (0 << 0) | ||
294 | #define PERF_EVENT_MISC_KERNEL (1 << 0) | ||
295 | #define PERF_EVENT_MISC_USER (2 << 0) | ||
296 | #define PERF_EVENT_MISC_HYPERVISOR (3 << 0) | ||
297 | |||
298 | struct perf_event_header { | ||
299 | __u32 type; | ||
300 | __u16 misc; | ||
301 | __u16 size; | ||
302 | }; | ||
303 | |||
304 | enum perf_event_type { | ||
305 | |||
306 | /* | ||
307 | * The MMAP events record the PROT_EXEC mappings so that we can | ||
308 | * correlate userspace IPs to code. They have the following structure: | ||
309 | * | ||
310 | * struct { | ||
311 | * struct perf_event_header header; | ||
312 | * | ||
313 | * u32 pid, tid; | ||
314 | * u64 addr; | ||
315 | * u64 len; | ||
316 | * u64 pgoff; | ||
317 | * char filename[]; | ||
318 | * }; | ||
319 | */ | ||
320 | PERF_EVENT_MMAP = 1, | ||
321 | |||
322 | /* | ||
323 | * struct { | ||
324 | * struct perf_event_header header; | ||
325 | * u64 id; | ||
326 | * u64 lost; | ||
327 | * }; | ||
328 | */ | ||
329 | PERF_EVENT_LOST = 2, | ||
330 | |||
331 | /* | ||
332 | * struct { | ||
333 | * struct perf_event_header header; | ||
334 | * | ||
335 | * u32 pid, tid; | ||
336 | * char comm[]; | ||
337 | * }; | ||
338 | */ | ||
339 | PERF_EVENT_COMM = 3, | ||
340 | |||
341 | /* | ||
342 | * struct { | ||
343 | * struct perf_event_header header; | ||
344 | * u32 pid, ppid; | ||
345 | * u32 tid, ptid; | ||
346 | * u64 time; | ||
347 | * }; | ||
348 | */ | ||
349 | PERF_EVENT_EXIT = 4, | ||
350 | |||
351 | /* | ||
352 | * struct { | ||
353 | * struct perf_event_header header; | ||
354 | * u64 time; | ||
355 | * u64 id; | ||
356 | * u64 stream_id; | ||
357 | * }; | ||
358 | */ | ||
359 | PERF_EVENT_THROTTLE = 5, | ||
360 | PERF_EVENT_UNTHROTTLE = 6, | ||
361 | |||
362 | /* | ||
363 | * struct { | ||
364 | * struct perf_event_header header; | ||
365 | * u32 pid, ppid; | ||
366 | * u32 tid, ptid; | ||
367 | * u64 time; | ||
368 | * }; | ||
369 | */ | ||
370 | PERF_EVENT_FORK = 7, | ||
371 | |||
372 | /* | ||
373 | * struct { | ||
374 | * struct perf_event_header header; | ||
375 | * u32 pid, tid; | ||
376 | * | ||
377 | * struct read_format values; | ||
378 | * }; | ||
379 | */ | ||
380 | PERF_EVENT_READ = 8, | ||
381 | |||
382 | /* | ||
383 | * struct { | ||
384 | * struct perf_event_header header; | ||
385 | * | ||
386 | * { u64 ip; } && PERF_SAMPLE_IP | ||
387 | * { u32 pid, tid; } && PERF_SAMPLE_TID | ||
388 | * { u64 time; } && PERF_SAMPLE_TIME | ||
389 | * { u64 addr; } && PERF_SAMPLE_ADDR | ||
390 | * { u64 id; } && PERF_SAMPLE_ID | ||
391 | * { u64 stream_id;} && PERF_SAMPLE_STREAM_ID | ||
392 | * { u32 cpu, res; } && PERF_SAMPLE_CPU | ||
393 | * { u64 period; } && PERF_SAMPLE_PERIOD | ||
394 | * | ||
395 | * { struct read_format values; } && PERF_SAMPLE_READ | ||
396 | * | ||
397 | * { u64 nr, | ||
398 | * u64 ips[nr]; } && PERF_SAMPLE_CALLCHAIN | ||
399 | * | ||
400 | * # | ||
401 | * # The RAW record below is opaque data wrt the ABI | ||
402 | * # | ||
403 | * # That is, the ABI doesn't make any promises wrt to | ||
404 | * # the stability of its content, it may vary depending | ||
405 | * # on event, hardware, kernel version and phase of | ||
406 | * # the moon. | ||
407 | * # | ||
408 | * # In other words, PERF_SAMPLE_RAW contents are not an ABI. | ||
409 | * # | ||
410 | * | ||
411 | * { u32 size; | ||
412 | * char data[size];}&& PERF_SAMPLE_RAW | ||
413 | * }; | ||
414 | */ | ||
415 | PERF_EVENT_SAMPLE = 9, | ||
416 | |||
417 | PERF_EVENT_MAX, /* non-ABI */ | ||
418 | }; | ||
419 | |||
420 | enum perf_callchain_context { | ||
421 | PERF_CONTEXT_HV = (__u64)-32, | ||
422 | PERF_CONTEXT_KERNEL = (__u64)-128, | ||
423 | PERF_CONTEXT_USER = (__u64)-512, | ||
424 | |||
425 | PERF_CONTEXT_GUEST = (__u64)-2048, | ||
426 | PERF_CONTEXT_GUEST_KERNEL = (__u64)-2176, | ||
427 | PERF_CONTEXT_GUEST_USER = (__u64)-2560, | ||
428 | |||
429 | PERF_CONTEXT_MAX = (__u64)-4095, | ||
430 | }; | ||
431 | |||
432 | #define PERF_FLAG_FD_NO_GROUP (1U << 0) | ||
433 | #define PERF_FLAG_FD_OUTPUT (1U << 1) | ||
434 | |||
435 | /* | ||
436 | * In case some app still references the old symbols: | ||
437 | */ | ||
438 | |||
439 | #define __NR_perf_counter_open __NR_perf_event_open | ||
440 | |||
441 | #define PR_TASK_PERF_COUNTERS_DISABLE PR_TASK_PERF_EVENTS_DISABLE | ||
442 | #define PR_TASK_PERF_COUNTERS_ENABLE PR_TASK_PERF_EVENTS_ENABLE | ||
443 | |||
444 | #endif /* _LINUX_PERF_COUNTER_H */ | ||
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index da7bdc23f279..a177698d95e2 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -211,17 +211,9 @@ struct perf_event_attr { | |||
211 | __u32 wakeup_watermark; /* bytes before wakeup */ | 211 | __u32 wakeup_watermark; /* bytes before wakeup */ |
212 | }; | 212 | }; |
213 | 213 | ||
214 | struct { /* Hardware breakpoint info */ | 214 | __u32 bp_type; |
215 | __u64 bp_addr; | 215 | __u64 bp_addr; |
216 | __u32 bp_type; | 216 | __u64 bp_len; |
217 | __u32 bp_len; | ||
218 | __u64 __bp_reserved_1; | ||
219 | __u64 __bp_reserved_2; | ||
220 | }; | ||
221 | |||
222 | __u32 __reserved_2; | ||
223 | |||
224 | __u64 __reserved_3; | ||
225 | }; | 217 | }; |
226 | 218 | ||
227 | /* | 219 | /* |
@@ -820,9 +812,14 @@ extern int perf_event_overflow(struct perf_event *event, int nmi, | |||
820 | */ | 812 | */ |
821 | static inline int is_software_event(struct perf_event *event) | 813 | static inline int is_software_event(struct perf_event *event) |
822 | { | 814 | { |
823 | return (event->attr.type != PERF_TYPE_RAW) && | 815 | switch (event->attr.type) { |
824 | (event->attr.type != PERF_TYPE_HARDWARE) && | 816 | case PERF_TYPE_SOFTWARE: |
825 | (event->attr.type != PERF_TYPE_HW_CACHE); | 817 | case PERF_TYPE_TRACEPOINT: |
818 | /* for now the breakpoint stuff also works as software event */ | ||
819 | case PERF_TYPE_BREAKPOINT: | ||
820 | return 1; | ||
821 | } | ||
822 | return 0; | ||
826 | } | 823 | } |
827 | 824 | ||
828 | extern atomic_t perf_swevent_enabled[PERF_COUNT_SW_MAX]; | 825 | extern atomic_t perf_swevent_enabled[PERF_COUNT_SW_MAX]; |
diff --git a/include/linux/phy.h b/include/linux/phy.h index b1368b8f6572..6a7eb402165d 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h | |||
@@ -447,6 +447,7 @@ struct phy_device* get_phy_device(struct mii_bus *bus, int addr); | |||
447 | int phy_device_register(struct phy_device *phy); | 447 | int phy_device_register(struct phy_device *phy); |
448 | int phy_clear_interrupt(struct phy_device *phydev); | 448 | int phy_clear_interrupt(struct phy_device *phydev); |
449 | int phy_config_interrupt(struct phy_device *phydev, u32 interrupts); | 449 | int phy_config_interrupt(struct phy_device *phydev, u32 interrupts); |
450 | int phy_init_hw(struct phy_device *phydev); | ||
450 | int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, | 451 | int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, |
451 | u32 flags, phy_interface_t interface); | 452 | u32 flags, phy_interface_t interface); |
452 | struct phy_device * phy_attach(struct net_device *dev, | 453 | struct phy_device * phy_attach(struct net_device *dev, |
@@ -484,6 +485,7 @@ void phy_driver_unregister(struct phy_driver *drv); | |||
484 | int phy_driver_register(struct phy_driver *new_driver); | 485 | int phy_driver_register(struct phy_driver *new_driver); |
485 | void phy_prepare_link(struct phy_device *phydev, | 486 | void phy_prepare_link(struct phy_device *phydev, |
486 | void (*adjust_link)(struct net_device *)); | 487 | void (*adjust_link)(struct net_device *)); |
488 | void phy_state_machine(struct work_struct *work); | ||
487 | void phy_start_machine(struct phy_device *phydev, | 489 | void phy_start_machine(struct phy_device *phydev, |
488 | void (*handler)(struct net_device *)); | 490 | void (*handler)(struct net_device *)); |
489 | void phy_stop_machine(struct phy_device *phydev); | 491 | void phy_stop_machine(struct phy_device *phydev); |
diff --git a/include/linux/pnp.h b/include/linux/pnp.h index fddfafaed024..7c4193eb0072 100644 --- a/include/linux/pnp.h +++ b/include/linux/pnp.h | |||
@@ -334,6 +334,19 @@ extern struct pnp_protocol pnpbios_protocol; | |||
334 | #define pnp_device_is_pnpbios(dev) 0 | 334 | #define pnp_device_is_pnpbios(dev) 0 |
335 | #endif | 335 | #endif |
336 | 336 | ||
337 | #ifdef CONFIG_PNPACPI | ||
338 | extern struct pnp_protocol pnpacpi_protocol; | ||
339 | |||
340 | static inline struct acpi_device *pnp_acpi_device(struct pnp_dev *dev) | ||
341 | { | ||
342 | if (dev->protocol == &pnpacpi_protocol) | ||
343 | return dev->data; | ||
344 | return NULL; | ||
345 | } | ||
346 | #else | ||
347 | #define pnp_acpi_device(dev) 0 | ||
348 | #endif | ||
349 | |||
337 | /* status */ | 350 | /* status */ |
338 | #define PNP_READY 0x0000 | 351 | #define PNP_READY 0x0000 |
339 | #define PNP_ATTACHED 0x0001 | 352 | #define PNP_ATTACHED 0x0001 |
diff --git a/include/linux/poison.h b/include/linux/poison.h index 7fc194aef8c2..2110a81c5e2a 100644 --- a/include/linux/poison.h +++ b/include/linux/poison.h | |||
@@ -2,13 +2,25 @@ | |||
2 | #define _LINUX_POISON_H | 2 | #define _LINUX_POISON_H |
3 | 3 | ||
4 | /********** include/linux/list.h **********/ | 4 | /********** include/linux/list.h **********/ |
5 | |||
6 | /* | ||
7 | * Architectures might want to move the poison pointer offset | ||
8 | * into some well-recognized area such as 0xdead000000000000, | ||
9 | * that is also not mappable by user-space exploits: | ||
10 | */ | ||
11 | #ifdef CONFIG_ILLEGAL_POINTER_VALUE | ||
12 | # define POISON_POINTER_DELTA _AC(CONFIG_ILLEGAL_POINTER_VALUE, UL) | ||
13 | #else | ||
14 | # define POISON_POINTER_DELTA 0 | ||
15 | #endif | ||
16 | |||
5 | /* | 17 | /* |
6 | * These are non-NULL pointers that will result in page faults | 18 | * These are non-NULL pointers that will result in page faults |
7 | * under normal circumstances, used to verify that nobody uses | 19 | * under normal circumstances, used to verify that nobody uses |
8 | * non-initialized list entries. | 20 | * non-initialized list entries. |
9 | */ | 21 | */ |
10 | #define LIST_POISON1 ((void *) 0x00100100) | 22 | #define LIST_POISON1 ((void *) 0x00100100 + POISON_POINTER_DELTA) |
11 | #define LIST_POISON2 ((void *) 0x00200200) | 23 | #define LIST_POISON2 ((void *) 0x00200200 + POISON_POINTER_DELTA) |
12 | 24 | ||
13 | /********** include/linux/timer.h **********/ | 25 | /********** include/linux/timer.h **********/ |
14 | /* | 26 | /* |
diff --git a/include/linux/pwm_backlight.h b/include/linux/pwm_backlight.h index 7a9754c96775..01b3d759f1fc 100644 --- a/include/linux/pwm_backlight.h +++ b/include/linux/pwm_backlight.h | |||
@@ -10,7 +10,7 @@ struct platform_pwm_backlight_data { | |||
10 | unsigned int dft_brightness; | 10 | unsigned int dft_brightness; |
11 | unsigned int pwm_period_ns; | 11 | unsigned int pwm_period_ns; |
12 | int (*init)(struct device *dev); | 12 | int (*init)(struct device *dev); |
13 | int (*notify)(int brightness); | 13 | int (*notify)(struct device *dev, int brightness); |
14 | void (*exit)(struct device *dev); | 14 | void (*exit)(struct device *dev); |
15 | }; | 15 | }; |
16 | 16 | ||
diff --git a/include/linux/quota.h b/include/linux/quota.h index e70e62194243..a6861f117480 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h | |||
@@ -315,8 +315,9 @@ struct dquot_operations { | |||
315 | int (*claim_space) (struct inode *, qsize_t); | 315 | int (*claim_space) (struct inode *, qsize_t); |
316 | /* release rsved quota for delayed alloc */ | 316 | /* release rsved quota for delayed alloc */ |
317 | void (*release_rsv) (struct inode *, qsize_t); | 317 | void (*release_rsv) (struct inode *, qsize_t); |
318 | /* get reserved quota for delayed alloc */ | 318 | /* get reserved quota for delayed alloc, value returned is managed by |
319 | qsize_t (*get_reserved_space) (struct inode *); | 319 | * quota code only */ |
320 | qsize_t *(*get_reserved_space) (struct inode *); | ||
320 | }; | 321 | }; |
321 | 322 | ||
322 | /* Operations handling requests from userspace */ | 323 | /* Operations handling requests from userspace */ |
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h index c4ba9a78721e..96cc307ed9f4 100644 --- a/include/linux/rcutiny.h +++ b/include/linux/rcutiny.h | |||
@@ -101,4 +101,9 @@ static inline void exit_rcu(void) | |||
101 | { | 101 | { |
102 | } | 102 | } |
103 | 103 | ||
104 | static inline int rcu_preempt_depth(void) | ||
105 | { | ||
106 | return 0; | ||
107 | } | ||
108 | |||
104 | #endif /* __LINUX_RCUTINY_H */ | 109 | #endif /* __LINUX_RCUTINY_H */ |
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h index c93eee5911b0..8044b1b94333 100644 --- a/include/linux/rcutree.h +++ b/include/linux/rcutree.h | |||
@@ -45,6 +45,12 @@ extern void __rcu_read_unlock(void); | |||
45 | extern void synchronize_rcu(void); | 45 | extern void synchronize_rcu(void); |
46 | extern void exit_rcu(void); | 46 | extern void exit_rcu(void); |
47 | 47 | ||
48 | /* | ||
49 | * Defined as macro as it is a very low level header | ||
50 | * included from areas that don't even know about current | ||
51 | */ | ||
52 | #define rcu_preempt_depth() (current->rcu_read_lock_nesting) | ||
53 | |||
48 | #else /* #ifdef CONFIG_TREE_PREEMPT_RCU */ | 54 | #else /* #ifdef CONFIG_TREE_PREEMPT_RCU */ |
49 | 55 | ||
50 | static inline void __rcu_read_lock(void) | 56 | static inline void __rcu_read_lock(void) |
@@ -63,6 +69,11 @@ static inline void exit_rcu(void) | |||
63 | { | 69 | { |
64 | } | 70 | } |
65 | 71 | ||
72 | static inline int rcu_preempt_depth(void) | ||
73 | { | ||
74 | return 0; | ||
75 | } | ||
76 | |||
66 | #endif /* #else #ifdef CONFIG_TREE_PREEMPT_RCU */ | 77 | #endif /* #else #ifdef CONFIG_TREE_PREEMPT_RCU */ |
67 | 78 | ||
68 | static inline void __rcu_read_lock_bh(void) | 79 | static inline void __rcu_read_lock_bh(void) |
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index 490c5b37b6d7..030d92255c7a 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h | |||
@@ -35,6 +35,8 @@ | |||
35 | #ifndef __LINUX_REGULATOR_CONSUMER_H_ | 35 | #ifndef __LINUX_REGULATOR_CONSUMER_H_ |
36 | #define __LINUX_REGULATOR_CONSUMER_H_ | 36 | #define __LINUX_REGULATOR_CONSUMER_H_ |
37 | 37 | ||
38 | #include <linux/device.h> | ||
39 | |||
38 | /* | 40 | /* |
39 | * Regulator operating modes. | 41 | * Regulator operating modes. |
40 | * | 42 | * |
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h index 87f5f176d4ef..234a8476cba8 100644 --- a/include/linux/regulator/machine.h +++ b/include/linux/regulator/machine.h | |||
@@ -43,16 +43,20 @@ struct regulator; | |||
43 | /** | 43 | /** |
44 | * struct regulator_state - regulator state during low power system states | 44 | * struct regulator_state - regulator state during low power system states |
45 | * | 45 | * |
46 | * This describes a regulators state during a system wide low power state. | 46 | * This describes a regulators state during a system wide low power |
47 | * state. One of enabled or disabled must be set for the | ||
48 | * configuration to be applied. | ||
47 | * | 49 | * |
48 | * @uV: Operating voltage during suspend. | 50 | * @uV: Operating voltage during suspend. |
49 | * @mode: Operating mode during suspend. | 51 | * @mode: Operating mode during suspend. |
50 | * @enabled: Enabled during suspend. | 52 | * @enabled: Enabled during suspend. |
53 | * @disabled: Disabled during suspend. | ||
51 | */ | 54 | */ |
52 | struct regulator_state { | 55 | struct regulator_state { |
53 | int uV; /* suspend voltage */ | 56 | int uV; /* suspend voltage */ |
54 | unsigned int mode; /* suspend regulator operating mode */ | 57 | unsigned int mode; /* suspend regulator operating mode */ |
55 | int enabled; /* is regulator enabled in this suspend state */ | 58 | int enabled; /* is regulator enabled in this suspend state */ |
59 | int disabled; /* is the regulator disbled in this suspend state */ | ||
56 | }; | 60 | }; |
57 | 61 | ||
58 | /** | 62 | /** |
diff --git a/include/linux/regulator/max8660.h b/include/linux/regulator/max8660.h new file mode 100644 index 000000000000..9936763621c7 --- /dev/null +++ b/include/linux/regulator/max8660.h | |||
@@ -0,0 +1,57 @@ | |||
1 | /* | ||
2 | * max8660.h -- Voltage regulation for the Maxim 8660/8661 | ||
3 | * | ||
4 | * Copyright (C) 2009 Wolfram Sang, Pengutronix e.K. | ||
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; version 2 of the License. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | |||
20 | #ifndef __LINUX_REGULATOR_MAX8660_H | ||
21 | #define __LINUX_REGULATOR_MAX8660_H | ||
22 | |||
23 | #include <linux/regulator/machine.h> | ||
24 | |||
25 | enum { | ||
26 | MAX8660_V3, | ||
27 | MAX8660_V4, | ||
28 | MAX8660_V5, | ||
29 | MAX8660_V6, | ||
30 | MAX8660_V7, | ||
31 | MAX8660_V_END, | ||
32 | }; | ||
33 | |||
34 | /** | ||
35 | * max8660_subdev_data - regulator subdev data | ||
36 | * @id: regulator id | ||
37 | * @name: regulator name | ||
38 | * @platform_data: regulator init data | ||
39 | */ | ||
40 | struct max8660_subdev_data { | ||
41 | int id; | ||
42 | char *name; | ||
43 | struct regulator_init_data *platform_data; | ||
44 | }; | ||
45 | |||
46 | /** | ||
47 | * max8660_platform_data - platform data for max8660 | ||
48 | * @num_subdevs: number of regulators used | ||
49 | * @subdevs: pointer to regulators used | ||
50 | * @en34_is_high: if EN34 is driven high, regulators cannot be en-/disabled. | ||
51 | */ | ||
52 | struct max8660_platform_data { | ||
53 | int num_subdevs; | ||
54 | struct max8660_subdev_data *subdevs; | ||
55 | unsigned en34_is_high:1; | ||
56 | }; | ||
57 | #endif | ||
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index c96c1858fe2c..1ba3cf6edfbb 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h | |||
@@ -62,6 +62,12 @@ void reiserfs_write_unlock(struct super_block *s); | |||
62 | int reiserfs_write_lock_once(struct super_block *s); | 62 | int reiserfs_write_lock_once(struct super_block *s); |
63 | void reiserfs_write_unlock_once(struct super_block *s, int lock_depth); | 63 | void reiserfs_write_unlock_once(struct super_block *s, int lock_depth); |
64 | 64 | ||
65 | #ifdef CONFIG_REISERFS_CHECK | ||
66 | void reiserfs_lock_check_recursive(struct super_block *s); | ||
67 | #else | ||
68 | static inline void reiserfs_lock_check_recursive(struct super_block *s) { } | ||
69 | #endif | ||
70 | |||
65 | /* | 71 | /* |
66 | * Several mutexes depend on the write lock. | 72 | * Several mutexes depend on the write lock. |
67 | * However sometimes we want to relax the write lock while we hold | 73 | * However sometimes we want to relax the write lock while we hold |
@@ -92,11 +98,31 @@ void reiserfs_write_unlock_once(struct super_block *s, int lock_depth); | |||
92 | static inline void reiserfs_mutex_lock_safe(struct mutex *m, | 98 | static inline void reiserfs_mutex_lock_safe(struct mutex *m, |
93 | struct super_block *s) | 99 | struct super_block *s) |
94 | { | 100 | { |
101 | reiserfs_lock_check_recursive(s); | ||
95 | reiserfs_write_unlock(s); | 102 | reiserfs_write_unlock(s); |
96 | mutex_lock(m); | 103 | mutex_lock(m); |
97 | reiserfs_write_lock(s); | 104 | reiserfs_write_lock(s); |
98 | } | 105 | } |
99 | 106 | ||
107 | static inline void | ||
108 | reiserfs_mutex_lock_nested_safe(struct mutex *m, unsigned int subclass, | ||
109 | struct super_block *s) | ||
110 | { | ||
111 | reiserfs_lock_check_recursive(s); | ||
112 | reiserfs_write_unlock(s); | ||
113 | mutex_lock_nested(m, subclass); | ||
114 | reiserfs_write_lock(s); | ||
115 | } | ||
116 | |||
117 | static inline void | ||
118 | reiserfs_down_read_safe(struct rw_semaphore *sem, struct super_block *s) | ||
119 | { | ||
120 | reiserfs_lock_check_recursive(s); | ||
121 | reiserfs_write_unlock(s); | ||
122 | down_read(sem); | ||
123 | reiserfs_write_lock(s); | ||
124 | } | ||
125 | |||
100 | /* | 126 | /* |
101 | * When we schedule, we usually want to also release the write lock, | 127 | * When we schedule, we usually want to also release the write lock, |
102 | * according to the previous bkl based locking scheme of reiserfs. | 128 | * according to the previous bkl based locking scheme of reiserfs. |
diff --git a/include/linux/resource.h b/include/linux/resource.h index 40fc7e626082..f1e914eefeab 100644 --- a/include/linux/resource.h +++ b/include/linux/resource.h | |||
@@ -3,8 +3,6 @@ | |||
3 | 3 | ||
4 | #include <linux/time.h> | 4 | #include <linux/time.h> |
5 | 5 | ||
6 | struct task_struct; | ||
7 | |||
8 | /* | 6 | /* |
9 | * Resource control/accounting header file for linux | 7 | * Resource control/accounting header file for linux |
10 | */ | 8 | */ |
@@ -70,6 +68,12 @@ struct rlimit { | |||
70 | */ | 68 | */ |
71 | #include <asm/resource.h> | 69 | #include <asm/resource.h> |
72 | 70 | ||
71 | #ifdef __KERNEL__ | ||
72 | |||
73 | struct task_struct; | ||
74 | |||
73 | int getrusage(struct task_struct *p, int who, struct rusage __user *ru); | 75 | int getrusage(struct task_struct *p, int who, struct rusage __user *ru); |
74 | 76 | ||
77 | #endif /* __KERNEL__ */ | ||
78 | |||
75 | #endif | 79 | #endif |
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 14fc906ed602..05330fc5b436 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
@@ -368,11 +368,9 @@ enum { | |||
368 | #define RTAX_MAX (__RTAX_MAX - 1) | 368 | #define RTAX_MAX (__RTAX_MAX - 1) |
369 | 369 | ||
370 | #define RTAX_FEATURE_ECN 0x00000001 | 370 | #define RTAX_FEATURE_ECN 0x00000001 |
371 | #define RTAX_FEATURE_NO_SACK 0x00000002 | 371 | #define RTAX_FEATURE_SACK 0x00000002 |
372 | #define RTAX_FEATURE_NO_TSTAMP 0x00000004 | 372 | #define RTAX_FEATURE_TIMESTAMP 0x00000004 |
373 | #define RTAX_FEATURE_ALLFRAG 0x00000008 | 373 | #define RTAX_FEATURE_ALLFRAG 0x00000008 |
374 | #define RTAX_FEATURE_NO_WSCALE 0x00000010 | ||
375 | #define RTAX_FEATURE_NO_DSACK 0x00000020 | ||
376 | 374 | ||
377 | struct rta_session { | 375 | struct rta_session { |
378 | __u8 proto; | 376 | __u8 proto; |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 244c287a5ac1..78efe7c485ac 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -192,6 +192,12 @@ print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq) | |||
192 | #define TASK_DEAD 64 | 192 | #define TASK_DEAD 64 |
193 | #define TASK_WAKEKILL 128 | 193 | #define TASK_WAKEKILL 128 |
194 | #define TASK_WAKING 256 | 194 | #define TASK_WAKING 256 |
195 | #define TASK_STATE_MAX 512 | ||
196 | |||
197 | #define TASK_STATE_TO_CHAR_STR "RSDTtZXxKW" | ||
198 | |||
199 | extern char ___assert_task_state[1 - 2*!!( | ||
200 | sizeof(TASK_STATE_TO_CHAR_STR)-1 != ilog2(TASK_STATE_MAX)+1)]; | ||
195 | 201 | ||
196 | /* Convenience macros for the sake of set_task_state */ | 202 | /* Convenience macros for the sake of set_task_state */ |
197 | #define TASK_KILLABLE (TASK_WAKEKILL | TASK_UNINTERRUPTIBLE) | 203 | #define TASK_KILLABLE (TASK_WAKEKILL | TASK_UNINTERRUPTIBLE) |
@@ -304,6 +310,7 @@ extern void sched_show_task(struct task_struct *p); | |||
304 | #ifdef CONFIG_DETECT_SOFTLOCKUP | 310 | #ifdef CONFIG_DETECT_SOFTLOCKUP |
305 | extern void softlockup_tick(void); | 311 | extern void softlockup_tick(void); |
306 | extern void touch_softlockup_watchdog(void); | 312 | extern void touch_softlockup_watchdog(void); |
313 | extern void touch_softlockup_watchdog_sync(void); | ||
307 | extern void touch_all_softlockup_watchdogs(void); | 314 | extern void touch_all_softlockup_watchdogs(void); |
308 | extern int proc_dosoftlockup_thresh(struct ctl_table *table, int write, | 315 | extern int proc_dosoftlockup_thresh(struct ctl_table *table, int write, |
309 | void __user *buffer, | 316 | void __user *buffer, |
@@ -317,6 +324,9 @@ static inline void softlockup_tick(void) | |||
317 | static inline void touch_softlockup_watchdog(void) | 324 | static inline void touch_softlockup_watchdog(void) |
318 | { | 325 | { |
319 | } | 326 | } |
327 | static inline void touch_softlockup_watchdog_sync(void) | ||
328 | { | ||
329 | } | ||
320 | static inline void touch_all_softlockup_watchdogs(void) | 330 | static inline void touch_all_softlockup_watchdogs(void) |
321 | { | 331 | { |
322 | } | 332 | } |
@@ -371,6 +381,8 @@ extern int sysctl_max_map_count; | |||
371 | 381 | ||
372 | #include <linux/aio.h> | 382 | #include <linux/aio.h> |
373 | 383 | ||
384 | #ifdef CONFIG_MMU | ||
385 | extern void arch_pick_mmap_layout(struct mm_struct *mm); | ||
374 | extern unsigned long | 386 | extern unsigned long |
375 | arch_get_unmapped_area(struct file *, unsigned long, unsigned long, | 387 | arch_get_unmapped_area(struct file *, unsigned long, unsigned long, |
376 | unsigned long, unsigned long); | 388 | unsigned long, unsigned long); |
@@ -380,6 +392,9 @@ arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr, | |||
380 | unsigned long flags); | 392 | unsigned long flags); |
381 | extern void arch_unmap_area(struct mm_struct *, unsigned long); | 393 | extern void arch_unmap_area(struct mm_struct *, unsigned long); |
382 | extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long); | 394 | extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long); |
395 | #else | ||
396 | static inline void arch_pick_mmap_layout(struct mm_struct *mm) {} | ||
397 | #endif | ||
383 | 398 | ||
384 | #if USE_SPLIT_PTLOCKS | 399 | #if USE_SPLIT_PTLOCKS |
385 | /* | 400 | /* |
@@ -1091,7 +1106,8 @@ struct sched_class { | |||
1091 | enum cpu_idle_type idle); | 1106 | enum cpu_idle_type idle); |
1092 | void (*pre_schedule) (struct rq *this_rq, struct task_struct *task); | 1107 | void (*pre_schedule) (struct rq *this_rq, struct task_struct *task); |
1093 | void (*post_schedule) (struct rq *this_rq); | 1108 | void (*post_schedule) (struct rq *this_rq); |
1094 | void (*task_wake_up) (struct rq *this_rq, struct task_struct *task); | 1109 | void (*task_waking) (struct rq *this_rq, struct task_struct *task); |
1110 | void (*task_woken) (struct rq *this_rq, struct task_struct *task); | ||
1095 | 1111 | ||
1096 | void (*set_cpus_allowed)(struct task_struct *p, | 1112 | void (*set_cpus_allowed)(struct task_struct *p, |
1097 | const struct cpumask *newmask); | 1113 | const struct cpumask *newmask); |
@@ -1115,7 +1131,7 @@ struct sched_class { | |||
1115 | struct task_struct *task); | 1131 | struct task_struct *task); |
1116 | 1132 | ||
1117 | #ifdef CONFIG_FAIR_GROUP_SCHED | 1133 | #ifdef CONFIG_FAIR_GROUP_SCHED |
1118 | void (*moved_group) (struct task_struct *p); | 1134 | void (*moved_group) (struct task_struct *p, int on_rq); |
1119 | #endif | 1135 | #endif |
1120 | }; | 1136 | }; |
1121 | 1137 | ||
@@ -1357,7 +1373,7 @@ struct task_struct { | |||
1357 | char comm[TASK_COMM_LEN]; /* executable name excluding path | 1373 | char comm[TASK_COMM_LEN]; /* executable name excluding path |
1358 | - access with [gs]et_task_comm (which lock | 1374 | - access with [gs]et_task_comm (which lock |
1359 | it with task_lock()) | 1375 | it with task_lock()) |
1360 | - initialized normally by flush_old_exec */ | 1376 | - initialized normally by setup_new_exec */ |
1361 | /* file system info */ | 1377 | /* file system info */ |
1362 | int link_count, total_link_count; | 1378 | int link_count, total_link_count; |
1363 | #ifdef CONFIG_SYSVIPC | 1379 | #ifdef CONFIG_SYSVIPC |
@@ -1446,10 +1462,8 @@ struct task_struct { | |||
1446 | gfp_t lockdep_reclaim_gfp; | 1462 | gfp_t lockdep_reclaim_gfp; |
1447 | #endif | 1463 | #endif |
1448 | 1464 | ||
1449 | #ifdef CONFIG_FS_JOURNAL_INFO | ||
1450 | /* journalling filesystem info */ | 1465 | /* journalling filesystem info */ |
1451 | void *journal_info; | 1466 | void *journal_info; |
1452 | #endif | ||
1453 | 1467 | ||
1454 | /* stacked block device info */ | 1468 | /* stacked block device info */ |
1455 | struct bio *bio_list, **bio_tail; | 1469 | struct bio *bio_list, **bio_tail; |
@@ -1555,7 +1569,7 @@ struct task_struct { | |||
1555 | }; | 1569 | }; |
1556 | 1570 | ||
1557 | /* Future-safe accessor for struct task_struct's cpus_allowed. */ | 1571 | /* Future-safe accessor for struct task_struct's cpus_allowed. */ |
1558 | #define tsk_cpumask(tsk) (&(tsk)->cpus_allowed) | 1572 | #define tsk_cpus_allowed(tsk) (&(tsk)->cpus_allowed) |
1559 | 1573 | ||
1560 | /* | 1574 | /* |
1561 | * Priority of a process goes from 0..MAX_PRIO-1, valid RT | 1575 | * Priority of a process goes from 0..MAX_PRIO-1, valid RT |
@@ -2486,8 +2500,6 @@ static inline void set_task_cpu(struct task_struct *p, unsigned int cpu) | |||
2486 | 2500 | ||
2487 | #endif /* CONFIG_SMP */ | 2501 | #endif /* CONFIG_SMP */ |
2488 | 2502 | ||
2489 | extern void arch_pick_mmap_layout(struct mm_struct *mm); | ||
2490 | |||
2491 | #ifdef CONFIG_TRACING | 2503 | #ifdef CONFIG_TRACING |
2492 | extern void | 2504 | extern void |
2493 | __trace_special(void *__tr, void *__data, | 2505 | __trace_special(void *__tr, void *__data, |
@@ -2596,7 +2608,27 @@ static inline void mm_init_owner(struct mm_struct *mm, struct task_struct *p) | |||
2596 | } | 2608 | } |
2597 | #endif /* CONFIG_MM_OWNER */ | 2609 | #endif /* CONFIG_MM_OWNER */ |
2598 | 2610 | ||
2599 | #define TASK_STATE_TO_CHAR_STR "RSDTtZX" | 2611 | static inline unsigned long task_rlimit(const struct task_struct *tsk, |
2612 | unsigned int limit) | ||
2613 | { | ||
2614 | return ACCESS_ONCE(tsk->signal->rlim[limit].rlim_cur); | ||
2615 | } | ||
2616 | |||
2617 | static inline unsigned long task_rlimit_max(const struct task_struct *tsk, | ||
2618 | unsigned int limit) | ||
2619 | { | ||
2620 | return ACCESS_ONCE(tsk->signal->rlim[limit].rlim_max); | ||
2621 | } | ||
2622 | |||
2623 | static inline unsigned long rlimit(unsigned int limit) | ||
2624 | { | ||
2625 | return task_rlimit(current, limit); | ||
2626 | } | ||
2627 | |||
2628 | static inline unsigned long rlimit_max(unsigned int limit) | ||
2629 | { | ||
2630 | return task_rlimit_max(current, limit); | ||
2631 | } | ||
2600 | 2632 | ||
2601 | #endif /* __KERNEL__ */ | 2633 | #endif /* __KERNEL__ */ |
2602 | 2634 | ||
diff --git a/include/linux/security.h b/include/linux/security.h index 466cbadbd1ef..2c627d361c02 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -95,8 +95,13 @@ struct seq_file; | |||
95 | extern int cap_netlink_send(struct sock *sk, struct sk_buff *skb); | 95 | extern int cap_netlink_send(struct sock *sk, struct sk_buff *skb); |
96 | extern int cap_netlink_recv(struct sk_buff *skb, int cap); | 96 | extern int cap_netlink_recv(struct sk_buff *skb, int cap); |
97 | 97 | ||
98 | #ifdef CONFIG_MMU | ||
98 | extern unsigned long mmap_min_addr; | 99 | extern unsigned long mmap_min_addr; |
99 | extern unsigned long dac_mmap_min_addr; | 100 | extern unsigned long dac_mmap_min_addr; |
101 | #else | ||
102 | #define dac_mmap_min_addr 0UL | ||
103 | #endif | ||
104 | |||
100 | /* | 105 | /* |
101 | * Values used in the task_security_ops calls | 106 | * Values used in the task_security_ops calls |
102 | */ | 107 | */ |
@@ -121,6 +126,7 @@ struct request_sock; | |||
121 | #define LSM_UNSAFE_PTRACE 2 | 126 | #define LSM_UNSAFE_PTRACE 2 |
122 | #define LSM_UNSAFE_PTRACE_CAP 4 | 127 | #define LSM_UNSAFE_PTRACE_CAP 4 |
123 | 128 | ||
129 | #ifdef CONFIG_MMU | ||
124 | /* | 130 | /* |
125 | * If a hint addr is less than mmap_min_addr change hint to be as | 131 | * 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 | 132 | * low as possible but still greater than mmap_min_addr |
@@ -135,6 +141,7 @@ static inline unsigned long round_hint_to_min(unsigned long hint) | |||
135 | } | 141 | } |
136 | extern int mmap_min_addr_handler(struct ctl_table *table, int write, | 142 | extern int mmap_min_addr_handler(struct ctl_table *table, int write, |
137 | void __user *buffer, size_t *lenp, loff_t *ppos); | 143 | void __user *buffer, size_t *lenp, loff_t *ppos); |
144 | #endif | ||
138 | 145 | ||
139 | #ifdef CONFIG_SECURITY | 146 | #ifdef CONFIG_SECURITY |
140 | 147 | ||
diff --git a/include/linux/serio.h b/include/linux/serio.h index e2f3044d4a4a..813d26c247ec 100644 --- a/include/linux/serio.h +++ b/include/linux/serio.h | |||
@@ -136,25 +136,6 @@ static inline void serio_continue_rx(struct serio *serio) | |||
136 | spin_unlock_irq(&serio->lock); | 136 | spin_unlock_irq(&serio->lock); |
137 | } | 137 | } |
138 | 138 | ||
139 | /* | ||
140 | * Use the following functions to pin serio's driver in process context | ||
141 | */ | ||
142 | static inline int serio_pin_driver(struct serio *serio) | ||
143 | { | ||
144 | return mutex_lock_interruptible(&serio->drv_mutex); | ||
145 | } | ||
146 | |||
147 | static inline void serio_pin_driver_uninterruptible(struct serio *serio) | ||
148 | { | ||
149 | mutex_lock(&serio->drv_mutex); | ||
150 | } | ||
151 | |||
152 | static inline void serio_unpin_driver(struct serio *serio) | ||
153 | { | ||
154 | mutex_unlock(&serio->drv_mutex); | ||
155 | } | ||
156 | |||
157 | |||
158 | #endif | 139 | #endif |
159 | 140 | ||
160 | /* | 141 | /* |
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h index deee7afd8d66..e164291fb3e7 100644 --- a/include/linux/shmem_fs.h +++ b/include/linux/shmem_fs.h | |||
@@ -41,20 +41,4 @@ static inline struct shmem_inode_info *SHMEM_I(struct inode *inode) | |||
41 | extern int init_tmpfs(void); | 41 | extern int init_tmpfs(void); |
42 | extern int shmem_fill_super(struct super_block *sb, void *data, int silent); | 42 | extern int shmem_fill_super(struct super_block *sb, void *data, int silent); |
43 | 43 | ||
44 | #ifdef CONFIG_TMPFS_POSIX_ACL | ||
45 | int shmem_check_acl(struct inode *, int); | ||
46 | int shmem_acl_init(struct inode *, struct inode *); | ||
47 | |||
48 | extern struct xattr_handler shmem_xattr_acl_access_handler; | ||
49 | extern struct xattr_handler shmem_xattr_acl_default_handler; | ||
50 | |||
51 | extern struct generic_acl_operations shmem_acl_ops; | ||
52 | |||
53 | #else | ||
54 | static inline int shmem_acl_init(struct inode *inode, struct inode *dir) | ||
55 | { | ||
56 | return 0; | ||
57 | } | ||
58 | #endif /* CONFIG_TMPFS_POSIX_ACL */ | ||
59 | |||
60 | #endif | 44 | #endif |
diff --git a/include/linux/sonypi.h b/include/linux/sonypi.h index 34c4475ac4a2..4f95c1aac2fd 100644 --- a/include/linux/sonypi.h +++ b/include/linux/sonypi.h | |||
@@ -111,6 +111,7 @@ | |||
111 | #define SONYPI_EVENT_VOLUME_INC_PRESSED 69 | 111 | #define SONYPI_EVENT_VOLUME_INC_PRESSED 69 |
112 | #define SONYPI_EVENT_VOLUME_DEC_PRESSED 70 | 112 | #define SONYPI_EVENT_VOLUME_DEC_PRESSED 70 |
113 | #define SONYPI_EVENT_BRIGHTNESS_PRESSED 71 | 113 | #define SONYPI_EVENT_BRIGHTNESS_PRESSED 71 |
114 | #define SONYPI_EVENT_MEDIA_PRESSED 72 | ||
114 | 115 | ||
115 | /* get/set brightness */ | 116 | /* get/set brightness */ |
116 | #define SONYPI_IOCGBRT _IOR('v', 0, __u8) | 117 | #define SONYPI_IOCGBRT _IOR('v', 0, __u8) |
diff --git a/include/linux/spi/ad7879.h b/include/linux/spi/ad7879.h index 4231104c9afa..6334cee1a3be 100644 --- a/include/linux/spi/ad7879.h +++ b/include/linux/spi/ad7879.h | |||
@@ -28,8 +28,12 @@ struct ad7879_platform_data { | |||
28 | * 1 = 4, 2 = 8, 3 = 16 (median > averaging) | 28 | * 1 = 4, 2 = 8, 3 = 16 (median > averaging) |
29 | */ | 29 | */ |
30 | u8 median; | 30 | u8 median; |
31 | /* 1 = AUX/VBAT/GPIO set to GPIO Output */ | 31 | /* 1 = AUX/VBAT/GPIO export GPIO to gpiolib |
32 | u8 gpio_output; | 32 | * requires CONFIG_GPIOLIB |
33 | /* Initial GPIO pin state (valid if gpio_output = 1) */ | 33 | */ |
34 | u8 gpio_default; | 34 | bool gpio_export; |
35 | /* identifies the first GPIO number handled by this chip; | ||
36 | * or, if negative, requests dynamic ID allocation. | ||
37 | */ | ||
38 | s32 gpio_base; | ||
35 | }; | 39 | }; |
diff --git a/include/linux/spi/dw_spi.h b/include/linux/spi/dw_spi.h new file mode 100644 index 000000000000..51b3e771a9a3 --- /dev/null +++ b/include/linux/spi/dw_spi.h | |||
@@ -0,0 +1,212 @@ | |||
1 | #ifndef DW_SPI_HEADER_H | ||
2 | #define DW_SPI_HEADER_H | ||
3 | #include <linux/io.h> | ||
4 | |||
5 | /* Bit fields in CTRLR0 */ | ||
6 | #define SPI_DFS_OFFSET 0 | ||
7 | |||
8 | #define SPI_FRF_OFFSET 4 | ||
9 | #define SPI_FRF_SPI 0x0 | ||
10 | #define SPI_FRF_SSP 0x1 | ||
11 | #define SPI_FRF_MICROWIRE 0x2 | ||
12 | #define SPI_FRF_RESV 0x3 | ||
13 | |||
14 | #define SPI_MODE_OFFSET 6 | ||
15 | #define SPI_SCPH_OFFSET 6 | ||
16 | #define SPI_SCOL_OFFSET 7 | ||
17 | #define SPI_TMOD_OFFSET 8 | ||
18 | #define SPI_TMOD_TR 0x0 /* xmit & recv */ | ||
19 | #define SPI_TMOD_TO 0x1 /* xmit only */ | ||
20 | #define SPI_TMOD_RO 0x2 /* recv only */ | ||
21 | #define SPI_TMOD_EPROMREAD 0x3 /* eeprom read mode */ | ||
22 | |||
23 | #define SPI_SLVOE_OFFSET 10 | ||
24 | #define SPI_SRL_OFFSET 11 | ||
25 | #define SPI_CFS_OFFSET 12 | ||
26 | |||
27 | /* Bit fields in SR, 7 bits */ | ||
28 | #define SR_MASK 0x7f /* cover 7 bits */ | ||
29 | #define SR_BUSY (1 << 0) | ||
30 | #define SR_TF_NOT_FULL (1 << 1) | ||
31 | #define SR_TF_EMPT (1 << 2) | ||
32 | #define SR_RF_NOT_EMPT (1 << 3) | ||
33 | #define SR_RF_FULL (1 << 4) | ||
34 | #define SR_TX_ERR (1 << 5) | ||
35 | #define SR_DCOL (1 << 6) | ||
36 | |||
37 | /* Bit fields in ISR, IMR, RISR, 7 bits */ | ||
38 | #define SPI_INT_TXEI (1 << 0) | ||
39 | #define SPI_INT_TXOI (1 << 1) | ||
40 | #define SPI_INT_RXUI (1 << 2) | ||
41 | #define SPI_INT_RXOI (1 << 3) | ||
42 | #define SPI_INT_RXFI (1 << 4) | ||
43 | #define SPI_INT_MSTI (1 << 5) | ||
44 | |||
45 | /* TX RX interrupt level threshhold, max can be 256 */ | ||
46 | #define SPI_INT_THRESHOLD 32 | ||
47 | |||
48 | enum dw_ssi_type { | ||
49 | SSI_MOTO_SPI = 0, | ||
50 | SSI_TI_SSP, | ||
51 | SSI_NS_MICROWIRE, | ||
52 | }; | ||
53 | |||
54 | struct dw_spi_reg { | ||
55 | u32 ctrl0; | ||
56 | u32 ctrl1; | ||
57 | u32 ssienr; | ||
58 | u32 mwcr; | ||
59 | u32 ser; | ||
60 | u32 baudr; | ||
61 | u32 txfltr; | ||
62 | u32 rxfltr; | ||
63 | u32 txflr; | ||
64 | u32 rxflr; | ||
65 | u32 sr; | ||
66 | u32 imr; | ||
67 | u32 isr; | ||
68 | u32 risr; | ||
69 | u32 txoicr; | ||
70 | u32 rxoicr; | ||
71 | u32 rxuicr; | ||
72 | u32 msticr; | ||
73 | u32 icr; | ||
74 | u32 dmacr; | ||
75 | u32 dmatdlr; | ||
76 | u32 dmardlr; | ||
77 | u32 idr; | ||
78 | u32 version; | ||
79 | u32 dr; /* Currently oper as 32 bits, | ||
80 | though only low 16 bits matters */ | ||
81 | } __packed; | ||
82 | |||
83 | struct dw_spi { | ||
84 | struct spi_master *master; | ||
85 | struct spi_device *cur_dev; | ||
86 | struct device *parent_dev; | ||
87 | enum dw_ssi_type type; | ||
88 | |||
89 | void __iomem *regs; | ||
90 | unsigned long paddr; | ||
91 | u32 iolen; | ||
92 | int irq; | ||
93 | u32 max_freq; /* max bus freq supported */ | ||
94 | |||
95 | u16 bus_num; | ||
96 | u16 num_cs; /* supported slave numbers */ | ||
97 | |||
98 | /* Driver message queue */ | ||
99 | struct workqueue_struct *workqueue; | ||
100 | struct work_struct pump_messages; | ||
101 | spinlock_t lock; | ||
102 | struct list_head queue; | ||
103 | int busy; | ||
104 | int run; | ||
105 | |||
106 | /* Message Transfer pump */ | ||
107 | struct tasklet_struct pump_transfers; | ||
108 | |||
109 | /* Current message transfer state info */ | ||
110 | struct spi_message *cur_msg; | ||
111 | struct spi_transfer *cur_transfer; | ||
112 | struct chip_data *cur_chip; | ||
113 | struct chip_data *prev_chip; | ||
114 | size_t len; | ||
115 | void *tx; | ||
116 | void *tx_end; | ||
117 | void *rx; | ||
118 | void *rx_end; | ||
119 | int dma_mapped; | ||
120 | dma_addr_t rx_dma; | ||
121 | dma_addr_t tx_dma; | ||
122 | size_t rx_map_len; | ||
123 | size_t tx_map_len; | ||
124 | u8 n_bytes; /* current is a 1/2 bytes op */ | ||
125 | u8 max_bits_per_word; /* maxim is 16b */ | ||
126 | u32 dma_width; | ||
127 | int cs_change; | ||
128 | int (*write)(struct dw_spi *dws); | ||
129 | int (*read)(struct dw_spi *dws); | ||
130 | irqreturn_t (*transfer_handler)(struct dw_spi *dws); | ||
131 | void (*cs_control)(u32 command); | ||
132 | |||
133 | /* Dma info */ | ||
134 | int dma_inited; | ||
135 | struct dma_chan *txchan; | ||
136 | struct dma_chan *rxchan; | ||
137 | int txdma_done; | ||
138 | int rxdma_done; | ||
139 | u64 tx_param; | ||
140 | u64 rx_param; | ||
141 | struct device *dma_dev; | ||
142 | dma_addr_t dma_addr; | ||
143 | |||
144 | /* Bus interface info */ | ||
145 | void *priv; | ||
146 | #ifdef CONFIG_DEBUG_FS | ||
147 | struct dentry *debugfs; | ||
148 | #endif | ||
149 | }; | ||
150 | |||
151 | #define dw_readl(dw, name) \ | ||
152 | __raw_readl(&(((struct dw_spi_reg *)dw->regs)->name)) | ||
153 | #define dw_writel(dw, name, val) \ | ||
154 | __raw_writel((val), &(((struct dw_spi_reg *)dw->regs)->name)) | ||
155 | #define dw_readw(dw, name) \ | ||
156 | __raw_readw(&(((struct dw_spi_reg *)dw->regs)->name)) | ||
157 | #define dw_writew(dw, name, val) \ | ||
158 | __raw_writew((val), &(((struct dw_spi_reg *)dw->regs)->name)) | ||
159 | |||
160 | static inline void spi_enable_chip(struct dw_spi *dws, int enable) | ||
161 | { | ||
162 | dw_writel(dws, ssienr, (enable ? 1 : 0)); | ||
163 | } | ||
164 | |||
165 | static inline void spi_set_clk(struct dw_spi *dws, u16 div) | ||
166 | { | ||
167 | dw_writel(dws, baudr, div); | ||
168 | } | ||
169 | |||
170 | static inline void spi_chip_sel(struct dw_spi *dws, u16 cs) | ||
171 | { | ||
172 | if (cs > dws->num_cs) | ||
173 | return; | ||
174 | dw_writel(dws, ser, 1 << cs); | ||
175 | } | ||
176 | |||
177 | /* Disable IRQ bits */ | ||
178 | static inline void spi_mask_intr(struct dw_spi *dws, u32 mask) | ||
179 | { | ||
180 | u32 new_mask; | ||
181 | |||
182 | new_mask = dw_readl(dws, imr) & ~mask; | ||
183 | dw_writel(dws, imr, new_mask); | ||
184 | } | ||
185 | |||
186 | /* Enable IRQ bits */ | ||
187 | static inline void spi_umask_intr(struct dw_spi *dws, u32 mask) | ||
188 | { | ||
189 | u32 new_mask; | ||
190 | |||
191 | new_mask = dw_readl(dws, imr) | mask; | ||
192 | dw_writel(dws, imr, new_mask); | ||
193 | } | ||
194 | |||
195 | /* | ||
196 | * Each SPI slave device to work with dw_api controller should | ||
197 | * has such a structure claiming its working mode (PIO/DMA etc), | ||
198 | * which can be save in the "controller_data" member of the | ||
199 | * struct spi_device | ||
200 | */ | ||
201 | struct dw_spi_chip { | ||
202 | u8 poll_mode; /* 0 for contoller polling mode */ | ||
203 | u8 type; /* SPI/SSP/Micrwire */ | ||
204 | u8 enable_dma; | ||
205 | void (*cs_control)(u32 command); | ||
206 | }; | ||
207 | |||
208 | extern int dw_spi_add_host(struct dw_spi *dws); | ||
209 | extern void dw_spi_remove_host(struct dw_spi *dws); | ||
210 | extern int dw_spi_suspend_host(struct dw_spi *dws); | ||
211 | extern int dw_spi_resume_host(struct dw_spi *dws); | ||
212 | #endif /* DW_SPI_HEADER_H */ | ||
diff --git a/include/linux/string.h b/include/linux/string.h index 651839a2a755..a716ee2a8adb 100644 --- a/include/linux/string.h +++ b/include/linux/string.h | |||
@@ -72,7 +72,10 @@ static inline __must_check char *strstrip(char *str) | |||
72 | } | 72 | } |
73 | 73 | ||
74 | #ifndef __HAVE_ARCH_STRSTR | 74 | #ifndef __HAVE_ARCH_STRSTR |
75 | extern char * strstr(const char *,const char *); | 75 | extern char * strstr(const char *, const char *); |
76 | #endif | ||
77 | #ifndef __HAVE_ARCH_STRNSTR | ||
78 | extern char * strnstr(const char *, const char *, size_t); | ||
76 | #endif | 79 | #endif |
77 | #ifndef __HAVE_ARCH_STRLEN | 80 | #ifndef __HAVE_ARCH_STRLEN |
78 | extern __kernel_size_t strlen(const char *); | 81 | extern __kernel_size_t strlen(const char *); |
diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h index 10709cbe96fd..c2786f20016f 100644 --- a/include/linux/sunrpc/debug.h +++ b/include/linux/sunrpc/debug.h | |||
@@ -28,9 +28,6 @@ | |||
28 | 28 | ||
29 | #ifdef __KERNEL__ | 29 | #ifdef __KERNEL__ |
30 | 30 | ||
31 | #include <linux/timer.h> | ||
32 | #include <linux/workqueue.h> | ||
33 | |||
34 | /* | 31 | /* |
35 | * Enable RPC debugging/profiling. | 32 | * Enable RPC debugging/profiling. |
36 | */ | 33 | */ |
diff --git a/include/linux/sunrpc/rpc_rdma.h b/include/linux/sunrpc/rpc_rdma.h index 87b895d5c786..b78f16b1dea3 100644 --- a/include/linux/sunrpc/rpc_rdma.h +++ b/include/linux/sunrpc/rpc_rdma.h | |||
@@ -40,6 +40,8 @@ | |||
40 | #ifndef _LINUX_SUNRPC_RPC_RDMA_H | 40 | #ifndef _LINUX_SUNRPC_RPC_RDMA_H |
41 | #define _LINUX_SUNRPC_RPC_RDMA_H | 41 | #define _LINUX_SUNRPC_RPC_RDMA_H |
42 | 42 | ||
43 | #include <linux/types.h> | ||
44 | |||
43 | struct rpcrdma_segment { | 45 | struct rpcrdma_segment { |
44 | __be32 rs_handle; /* Registered memory handle */ | 46 | __be32 rs_handle; /* Registered memory handle */ |
45 | __be32 rs_length; /* Length of the chunk in bytes */ | 47 | __be32 rs_length; /* Length of the chunk in bytes */ |
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index 1906782ec86b..7bc7fd5291ce 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h | |||
@@ -173,7 +173,8 @@ struct rpc_task_setup { | |||
173 | #define RPC_PRIORITY_LOW (-1) | 173 | #define RPC_PRIORITY_LOW (-1) |
174 | #define RPC_PRIORITY_NORMAL (0) | 174 | #define RPC_PRIORITY_NORMAL (0) |
175 | #define RPC_PRIORITY_HIGH (1) | 175 | #define RPC_PRIORITY_HIGH (1) |
176 | #define RPC_NR_PRIORITY (1 + RPC_PRIORITY_HIGH - RPC_PRIORITY_LOW) | 176 | #define RPC_PRIORITY_PRIVILEGED (2) |
177 | #define RPC_NR_PRIORITY (1 + RPC_PRIORITY_PRIVILEGED - RPC_PRIORITY_LOW) | ||
177 | 178 | ||
178 | struct rpc_timer { | 179 | struct rpc_timer { |
179 | struct timer_list timer; | 180 | struct timer_list timer; |
@@ -229,6 +230,7 @@ void rpc_wake_up_queued_task(struct rpc_wait_queue *, | |||
229 | void rpc_wake_up(struct rpc_wait_queue *); | 230 | void rpc_wake_up(struct rpc_wait_queue *); |
230 | struct rpc_task *rpc_wake_up_next(struct rpc_wait_queue *); | 231 | struct rpc_task *rpc_wake_up_next(struct rpc_wait_queue *); |
231 | void rpc_wake_up_status(struct rpc_wait_queue *, int); | 232 | void rpc_wake_up_status(struct rpc_wait_queue *, int); |
233 | int rpc_queue_empty(struct rpc_wait_queue *); | ||
232 | void rpc_delay(struct rpc_task *, unsigned long); | 234 | void rpc_delay(struct rpc_task *, unsigned long); |
233 | void * rpc_malloc(struct rpc_task *, size_t); | 235 | void * rpc_malloc(struct rpc_task *, size_t); |
234 | void rpc_free(void *); | 236 | void rpc_free(void *); |
@@ -254,6 +256,16 @@ static inline int rpc_wait_for_completion_task(struct rpc_task *task) | |||
254 | return __rpc_wait_for_completion_task(task, NULL); | 256 | return __rpc_wait_for_completion_task(task, NULL); |
255 | } | 257 | } |
256 | 258 | ||
259 | static inline void rpc_task_set_priority(struct rpc_task *task, unsigned char prio) | ||
260 | { | ||
261 | task->tk_priority = prio - RPC_PRIORITY_LOW; | ||
262 | } | ||
263 | |||
264 | static inline int rpc_task_has_priority(struct rpc_task *task, unsigned char prio) | ||
265 | { | ||
266 | return (task->tk_priority + RPC_PRIORITY_LOW == prio); | ||
267 | } | ||
268 | |||
257 | #ifdef RPC_DEBUG | 269 | #ifdef RPC_DEBUG |
258 | static inline const char * rpc_qname(struct rpc_wait_queue *q) | 270 | static inline const char * rpc_qname(struct rpc_wait_queue *q) |
259 | { | 271 | { |
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 52e8cb0a7569..5a3085b9b394 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
@@ -29,7 +29,6 @@ struct svc_pool_stats { | |||
29 | unsigned long packets; | 29 | unsigned long packets; |
30 | unsigned long sockets_queued; | 30 | unsigned long sockets_queued; |
31 | unsigned long threads_woken; | 31 | unsigned long threads_woken; |
32 | unsigned long overloads_avoided; | ||
33 | unsigned long threads_timedout; | 32 | unsigned long threads_timedout; |
34 | }; | 33 | }; |
35 | 34 | ||
@@ -50,7 +49,6 @@ struct svc_pool { | |||
50 | struct list_head sp_sockets; /* pending sockets */ | 49 | struct list_head sp_sockets; /* pending sockets */ |
51 | unsigned int sp_nrthreads; /* # of threads in pool */ | 50 | unsigned int sp_nrthreads; /* # of threads in pool */ |
52 | struct list_head sp_all_threads; /* all server threads */ | 51 | struct list_head sp_all_threads; /* all server threads */ |
53 | int sp_nwaking; /* number of threads woken but not yet active */ | ||
54 | struct svc_pool_stats sp_stats; /* statistics on pool operation */ | 52 | struct svc_pool_stats sp_stats; /* statistics on pool operation */ |
55 | } ____cacheline_aligned_in_smp; | 53 | } ____cacheline_aligned_in_smp; |
56 | 54 | ||
@@ -275,16 +273,11 @@ struct svc_rqst { | |||
275 | struct auth_domain * rq_client; /* RPC peer info */ | 273 | struct auth_domain * rq_client; /* RPC peer info */ |
276 | struct auth_domain * rq_gssclient; /* "gss/"-style peer info */ | 274 | struct auth_domain * rq_gssclient; /* "gss/"-style peer info */ |
277 | struct svc_cacherep * rq_cacherep; /* cache info */ | 275 | struct svc_cacherep * rq_cacherep; /* cache info */ |
278 | struct knfsd_fh * rq_reffh; /* Referrence filehandle, used to | ||
279 | * determine what device number | ||
280 | * to report (real or virtual) | ||
281 | */ | ||
282 | int rq_splice_ok; /* turned off in gss privacy | 276 | int rq_splice_ok; /* turned off in gss privacy |
283 | * to prevent encrypting page | 277 | * to prevent encrypting page |
284 | * cache pages */ | 278 | * cache pages */ |
285 | wait_queue_head_t rq_wait; /* synchronization */ | 279 | wait_queue_head_t rq_wait; /* synchronization */ |
286 | struct task_struct *rq_task; /* service thread */ | 280 | struct task_struct *rq_task; /* service thread */ |
287 | int rq_waking; /* 1 if thread is being woken */ | ||
288 | }; | 281 | }; |
289 | 282 | ||
290 | /* | 283 | /* |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 939a61507ac5..207466a49f3d 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -102,12 +102,10 @@ struct perf_event_attr; | |||
102 | #ifdef CONFIG_EVENT_PROFILE | 102 | #ifdef CONFIG_EVENT_PROFILE |
103 | 103 | ||
104 | #define TRACE_SYS_ENTER_PROFILE_INIT(sname) \ | 104 | #define TRACE_SYS_ENTER_PROFILE_INIT(sname) \ |
105 | .profile_count = ATOMIC_INIT(-1), \ | ||
106 | .profile_enable = prof_sysenter_enable, \ | 105 | .profile_enable = prof_sysenter_enable, \ |
107 | .profile_disable = prof_sysenter_disable, | 106 | .profile_disable = prof_sysenter_disable, |
108 | 107 | ||
109 | #define TRACE_SYS_EXIT_PROFILE_INIT(sname) \ | 108 | #define TRACE_SYS_EXIT_PROFILE_INIT(sname) \ |
110 | .profile_count = ATOMIC_INIT(-1), \ | ||
111 | .profile_enable = prof_sysexit_enable, \ | 109 | .profile_enable = prof_sysexit_enable, \ |
112 | .profile_disable = prof_sysexit_disable, | 110 | .profile_disable = prof_sysexit_disable, |
113 | #else | 111 | #else |
@@ -145,7 +143,7 @@ struct perf_event_attr; | |||
145 | .name = "sys_enter"#sname, \ | 143 | .name = "sys_enter"#sname, \ |
146 | .system = "syscalls", \ | 144 | .system = "syscalls", \ |
147 | .event = &enter_syscall_print_##sname, \ | 145 | .event = &enter_syscall_print_##sname, \ |
148 | .raw_init = init_syscall_trace, \ | 146 | .raw_init = trace_event_raw_init, \ |
149 | .show_format = syscall_enter_format, \ | 147 | .show_format = syscall_enter_format, \ |
150 | .define_fields = syscall_enter_define_fields, \ | 148 | .define_fields = syscall_enter_define_fields, \ |
151 | .regfunc = reg_event_syscall_enter, \ | 149 | .regfunc = reg_event_syscall_enter, \ |
@@ -167,7 +165,7 @@ struct perf_event_attr; | |||
167 | .name = "sys_exit"#sname, \ | 165 | .name = "sys_exit"#sname, \ |
168 | .system = "syscalls", \ | 166 | .system = "syscalls", \ |
169 | .event = &exit_syscall_print_##sname, \ | 167 | .event = &exit_syscall_print_##sname, \ |
170 | .raw_init = init_syscall_trace, \ | 168 | .raw_init = trace_event_raw_init, \ |
171 | .show_format = syscall_exit_format, \ | 169 | .show_format = syscall_exit_format, \ |
172 | .define_fields = syscall_exit_define_fields, \ | 170 | .define_fields = syscall_exit_define_fields, \ |
173 | .regfunc = reg_event_syscall_exit, \ | 171 | .regfunc = reg_event_syscall_exit, \ |
@@ -197,7 +195,7 @@ struct perf_event_attr; | |||
197 | static const struct syscall_metadata __used \ | 195 | static const struct syscall_metadata __used \ |
198 | __attribute__((__aligned__(4))) \ | 196 | __attribute__((__aligned__(4))) \ |
199 | __attribute__((section("__syscalls_metadata"))) \ | 197 | __attribute__((section("__syscalls_metadata"))) \ |
200 | __syscall_meta_##sname = { \ | 198 | __syscall_meta__##sname = { \ |
201 | .name = "sys_"#sname, \ | 199 | .name = "sys_"#sname, \ |
202 | .nb_args = 0, \ | 200 | .nb_args = 0, \ |
203 | .enter_event = &event_enter__##sname, \ | 201 | .enter_event = &event_enter__##sname, \ |
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 877ba039e6a4..bd27fbc9db62 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
@@ -482,6 +482,7 @@ enum | |||
482 | NET_IPV4_CONF_ARP_ACCEPT=21, | 482 | NET_IPV4_CONF_ARP_ACCEPT=21, |
483 | NET_IPV4_CONF_ARP_NOTIFY=22, | 483 | NET_IPV4_CONF_ARP_NOTIFY=22, |
484 | NET_IPV4_CONF_ACCEPT_LOCAL=23, | 484 | NET_IPV4_CONF_ACCEPT_LOCAL=23, |
485 | NET_IPV4_CONF_SRC_VMARK=24, | ||
485 | __NET_IPV4_CONF_MAX | 486 | __NET_IPV4_CONF_MAX |
486 | }; | 487 | }; |
487 | 488 | ||
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index 9d68fed50f11..cfa83083a2d4 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
@@ -99,8 +99,9 @@ int __must_check sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, | |||
99 | void sysfs_remove_file(struct kobject *kobj, const struct attribute *attr); | 99 | void sysfs_remove_file(struct kobject *kobj, const struct attribute *attr); |
100 | 100 | ||
101 | int __must_check sysfs_create_bin_file(struct kobject *kobj, | 101 | int __must_check sysfs_create_bin_file(struct kobject *kobj, |
102 | struct bin_attribute *attr); | 102 | const struct bin_attribute *attr); |
103 | void sysfs_remove_bin_file(struct kobject *kobj, struct bin_attribute *attr); | 103 | void sysfs_remove_bin_file(struct kobject *kobj, |
104 | const struct bin_attribute *attr); | ||
104 | 105 | ||
105 | int __must_check sysfs_create_link(struct kobject *kobj, struct kobject *target, | 106 | int __must_check sysfs_create_link(struct kobject *kobj, struct kobject *target, |
106 | const char *name); | 107 | const char *name); |
@@ -175,13 +176,13 @@ static inline void sysfs_remove_file(struct kobject *kobj, | |||
175 | } | 176 | } |
176 | 177 | ||
177 | static inline int sysfs_create_bin_file(struct kobject *kobj, | 178 | static inline int sysfs_create_bin_file(struct kobject *kobj, |
178 | struct bin_attribute *attr) | 179 | const struct bin_attribute *attr) |
179 | { | 180 | { |
180 | return 0; | 181 | return 0; |
181 | } | 182 | } |
182 | 183 | ||
183 | static inline void sysfs_remove_bin_file(struct kobject *kobj, | 184 | static inline void sysfs_remove_bin_file(struct kobject *kobj, |
184 | struct bin_attribute *attr) | 185 | const struct bin_attribute *attr) |
185 | { | 186 | { |
186 | } | 187 | } |
187 | 188 | ||
diff --git a/include/linux/topology.h b/include/linux/topology.h index 57e63579bfdd..5b81156780b1 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h | |||
@@ -99,7 +99,7 @@ int arch_update_cpu_topology(void); | |||
99 | | 1*SD_WAKE_AFFINE \ | 99 | | 1*SD_WAKE_AFFINE \ |
100 | | 1*SD_SHARE_CPUPOWER \ | 100 | | 1*SD_SHARE_CPUPOWER \ |
101 | | 0*SD_POWERSAVINGS_BALANCE \ | 101 | | 0*SD_POWERSAVINGS_BALANCE \ |
102 | | 0*SD_SHARE_PKG_RESOURCES \ | 102 | | 1*SD_SHARE_PKG_RESOURCES \ |
103 | | 0*SD_SERIALIZE \ | 103 | | 0*SD_SERIALIZE \ |
104 | | 0*SD_PREFER_SIBLING \ | 104 | | 0*SD_PREFER_SIBLING \ |
105 | , \ | 105 | , \ |
diff --git a/include/linux/tty.h b/include/linux/tty.h index ef3a2947b102..6abfcf5b5887 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -464,7 +464,7 @@ extern int tty_port_alloc_xmit_buf(struct tty_port *port); | |||
464 | extern void tty_port_free_xmit_buf(struct tty_port *port); | 464 | extern void tty_port_free_xmit_buf(struct tty_port *port); |
465 | extern void tty_port_put(struct tty_port *port); | 465 | extern void tty_port_put(struct tty_port *port); |
466 | 466 | ||
467 | extern inline struct tty_port *tty_port_get(struct tty_port *port) | 467 | static inline struct tty_port *tty_port_get(struct tty_port *port) |
468 | { | 468 | { |
469 | if (port) | 469 | if (port) |
470 | kref_get(&port->kref); | 470 | kref_get(&port->kref); |
@@ -486,7 +486,7 @@ extern void tty_port_close(struct tty_port *port, | |||
486 | struct tty_struct *tty, struct file *filp); | 486 | struct tty_struct *tty, struct file *filp); |
487 | extern int tty_port_open(struct tty_port *port, | 487 | extern int tty_port_open(struct tty_port *port, |
488 | struct tty_struct *tty, struct file *filp); | 488 | struct tty_struct *tty, struct file *filp); |
489 | extern inline int tty_port_users(struct tty_port *port) | 489 | static inline int tty_port_users(struct tty_port *port) |
490 | { | 490 | { |
491 | return port->count + port->blocked_open; | 491 | return port->count + port->blocked_open; |
492 | } | 492 | } |
diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h index 6b58367d145e..d512d98dfb7d 100644 --- a/include/linux/uaccess.h +++ b/include/linux/uaccess.h | |||
@@ -94,6 +94,7 @@ static inline unsigned long __copy_from_user_nocache(void *to, | |||
94 | * happens, handle that and return -EFAULT. | 94 | * happens, handle that and return -EFAULT. |
95 | */ | 95 | */ |
96 | extern long probe_kernel_read(void *dst, void *src, size_t size); | 96 | extern long probe_kernel_read(void *dst, void *src, size_t size); |
97 | extern long __probe_kernel_read(void *dst, void *src, size_t size); | ||
97 | 98 | ||
98 | /* | 99 | /* |
99 | * probe_kernel_write(): safely attempt to write to a location | 100 | * probe_kernel_write(): safely attempt to write to a location |
@@ -104,6 +105,7 @@ extern long probe_kernel_read(void *dst, void *src, size_t size); | |||
104 | * Safely write to address @dst from the buffer at @src. If a kernel fault | 105 | * Safely write to address @dst from the buffer at @src. If a kernel fault |
105 | * happens, handle that and return -EFAULT. | 106 | * happens, handle that and return -EFAULT. |
106 | */ | 107 | */ |
107 | extern long probe_kernel_write(void *dst, void *src, size_t size); | 108 | extern long notrace probe_kernel_write(void *dst, void *src, size_t size); |
109 | extern long notrace __probe_kernel_write(void *dst, void *src, size_t size); | ||
108 | 110 | ||
109 | #endif /* __LINUX_UACCESS_H__ */ | 111 | #endif /* __LINUX_UACCESS_H__ */ |
diff --git a/include/linux/usb.h b/include/linux/usb.h index e101a2d04d75..d7ace1b80f09 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -192,6 +192,7 @@ struct usb_interface { | |||
192 | unsigned needs_altsetting0:1; /* switch to altsetting 0 is pending */ | 192 | unsigned needs_altsetting0:1; /* switch to altsetting 0 is pending */ |
193 | unsigned needs_binding:1; /* needs delayed unbind/rebind */ | 193 | unsigned needs_binding:1; /* needs delayed unbind/rebind */ |
194 | unsigned reset_running:1; | 194 | unsigned reset_running:1; |
195 | unsigned resetting_device:1; /* true: bandwidth alloc after reset */ | ||
195 | 196 | ||
196 | struct device dev; /* interface specific device info */ | 197 | struct device dev; /* interface specific device info */ |
197 | struct device *usb_dev; | 198 | struct device *usb_dev; |
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index acf6e457c04b..1819396ed501 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/kref.h> | 16 | #include <linux/kref.h> |
17 | #include <linux/mutex.h> | 17 | #include <linux/mutex.h> |
18 | #include <linux/sysrq.h> | 18 | #include <linux/sysrq.h> |
19 | #include <linux/kfifo.h> | ||
19 | 20 | ||
20 | #define SERIAL_TTY_MAJOR 188 /* Nice legal number now */ | 21 | #define SERIAL_TTY_MAJOR 188 /* Nice legal number now */ |
21 | #define SERIAL_TTY_MINORS 254 /* loads of devices :) */ | 22 | #define SERIAL_TTY_MINORS 254 /* loads of devices :) */ |
@@ -94,7 +95,7 @@ struct usb_serial_port { | |||
94 | unsigned char *bulk_out_buffer; | 95 | unsigned char *bulk_out_buffer; |
95 | int bulk_out_size; | 96 | int bulk_out_size; |
96 | struct urb *write_urb; | 97 | struct urb *write_urb; |
97 | struct kfifo *write_fifo; | 98 | struct kfifo write_fifo; |
98 | int write_urb_busy; | 99 | int write_urb_busy; |
99 | __u8 bulk_out_endpointAddress; | 100 | __u8 bulk_out_endpointAddress; |
100 | 101 | ||
diff --git a/include/linux/vermagic.h b/include/linux/vermagic.h index 79b9837d9ca0..cf97b5b9d1fe 100644 --- a/include/linux/vermagic.h +++ b/include/linux/vermagic.h | |||
@@ -1,4 +1,4 @@ | |||
1 | #include <linux/utsrelease.h> | 1 | #include <generated/utsrelease.h> |
2 | #include <linux/module.h> | 2 | #include <linux/module.h> |
3 | 3 | ||
4 | /* Simply sanity version stamp for modules. */ | 4 | /* Simply sanity version stamp for modules. */ |
diff --git a/include/linux/vt.h b/include/linux/vt.h index 3fb9944e50a6..d5dd0bc408fd 100644 --- a/include/linux/vt.h +++ b/include/linux/vt.h | |||
@@ -84,6 +84,8 @@ struct vt_setactivate { | |||
84 | 84 | ||
85 | #define VT_SETACTIVATE 0x560F /* Activate and set the mode of a console */ | 85 | #define VT_SETACTIVATE 0x560F /* Activate and set the mode of a console */ |
86 | 86 | ||
87 | #ifdef __KERNEL__ | ||
88 | |||
87 | #ifdef CONFIG_VT_CONSOLE | 89 | #ifdef CONFIG_VT_CONSOLE |
88 | 90 | ||
89 | extern int vt_kmsg_redirect(int new); | 91 | extern int vt_kmsg_redirect(int new); |
@@ -97,6 +99,8 @@ static inline int vt_kmsg_redirect(int new) | |||
97 | 99 | ||
98 | #endif | 100 | #endif |
99 | 101 | ||
102 | #endif /* __KERNEL__ */ | ||
103 | |||
100 | #define vt_get_kmsg_redirect() vt_kmsg_redirect(-1) | 104 | #define vt_get_kmsg_redirect() vt_kmsg_redirect(-1) |
101 | 105 | ||
102 | #endif /* _LINUX_VT_H */ | 106 | #endif /* _LINUX_VT_H */ |
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index 705f01fe413a..76e8903cd204 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
@@ -70,6 +70,7 @@ struct writeback_control { | |||
70 | struct bdi_writeback; | 70 | struct bdi_writeback; |
71 | int inode_wait(void *); | 71 | int inode_wait(void *); |
72 | void writeback_inodes_sb(struct super_block *); | 72 | void writeback_inodes_sb(struct super_block *); |
73 | int writeback_inodes_sb_if_idle(struct super_block *); | ||
73 | void sync_inodes_sb(struct super_block *); | 74 | void sync_inodes_sb(struct super_block *); |
74 | void writeback_inodes_wbc(struct writeback_control *wbc); | 75 | void writeback_inodes_wbc(struct writeback_control *wbc); |
75 | long wb_do_writeback(struct bdi_writeback *wb, int force_wait); | 76 | long wb_do_writeback(struct bdi_writeback *wb, int force_wait); |
@@ -79,8 +80,7 @@ void wakeup_flusher_threads(long nr_pages); | |||
79 | static inline void wait_on_inode(struct inode *inode) | 80 | static inline void wait_on_inode(struct inode *inode) |
80 | { | 81 | { |
81 | might_sleep(); | 82 | might_sleep(); |
82 | wait_on_bit(&inode->i_state, __I_LOCK, inode_wait, | 83 | wait_on_bit(&inode->i_state, __I_NEW, inode_wait, TASK_UNINTERRUPTIBLE); |
83 | TASK_UNINTERRUPTIBLE); | ||
84 | } | 84 | } |
85 | static inline void inode_sync_wait(struct inode *inode) | 85 | static inline void inode_sync_wait(struct inode *inode) |
86 | { | 86 | { |
diff --git a/include/linux/xattr.h b/include/linux/xattr.h index 5c84af8c5f6f..fb9b7e6e1e2d 100644 --- a/include/linux/xattr.h +++ b/include/linux/xattr.h | |||
@@ -38,12 +38,13 @@ struct dentry; | |||
38 | 38 | ||
39 | struct xattr_handler { | 39 | struct xattr_handler { |
40 | char *prefix; | 40 | char *prefix; |
41 | size_t (*list)(struct inode *inode, char *list, size_t list_size, | 41 | int flags; /* fs private flags passed back to the handlers */ |
42 | const char *name, size_t name_len); | 42 | size_t (*list)(struct dentry *dentry, char *list, size_t list_size, |
43 | int (*get)(struct inode *inode, const char *name, void *buffer, | 43 | const char *name, size_t name_len, int handler_flags); |
44 | size_t size); | 44 | int (*get)(struct dentry *dentry, const char *name, void *buffer, |
45 | int (*set)(struct inode *inode, const char *name, const void *buffer, | 45 | size_t size, int handler_flags); |
46 | size_t size, int flags); | 46 | int (*set)(struct dentry *dentry, const char *name, const void *buffer, |
47 | size_t size, int flags, int handler_flags); | ||
47 | }; | 48 | }; |
48 | 49 | ||
49 | ssize_t xattr_getsecurity(struct inode *, const char *, void *, size_t); | 50 | ssize_t xattr_getsecurity(struct inode *, const char *, void *, size_t); |
diff --git a/include/net/dst.h b/include/net/dst.h index 387cb3cfde7e..39c4a5963e12 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
@@ -113,7 +113,7 @@ dst_metric(const struct dst_entry *dst, int metric) | |||
113 | static inline u32 | 113 | static inline u32 |
114 | dst_feature(const struct dst_entry *dst, u32 feature) | 114 | dst_feature(const struct dst_entry *dst, u32 feature) |
115 | { | 115 | { |
116 | return (dst ? dst_metric(dst, RTAX_FEATURES) & feature : 0); | 116 | return dst_metric(dst, RTAX_FEATURES) & feature; |
117 | } | 117 | } |
118 | 118 | ||
119 | static inline u32 dst_mtu(const struct dst_entry *dst) | 119 | static inline u32 dst_mtu(const struct dst_entry *dst) |
diff --git a/include/net/ip.h b/include/net/ip.h index e6b9d12d5f62..fb63371c07a8 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -326,6 +326,22 @@ static __inline__ void inet_reset_saddr(struct sock *sk) | |||
326 | 326 | ||
327 | #endif | 327 | #endif |
328 | 328 | ||
329 | static inline int sk_mc_loop(struct sock *sk) | ||
330 | { | ||
331 | if (!sk) | ||
332 | return 1; | ||
333 | switch (sk->sk_family) { | ||
334 | case AF_INET: | ||
335 | return inet_sk(sk)->mc_loop; | ||
336 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | ||
337 | case AF_INET6: | ||
338 | return inet6_sk(sk)->mc_loop; | ||
339 | #endif | ||
340 | } | ||
341 | WARN_ON(1); | ||
342 | return 1; | ||
343 | } | ||
344 | |||
329 | extern int ip_call_ra_chain(struct sk_buff *skb); | 345 | extern int ip_call_ra_chain(struct sk_buff *skb); |
330 | 346 | ||
331 | /* | 347 | /* |
@@ -337,6 +353,7 @@ enum ip_defrag_users { | |||
337 | IP_DEFRAG_CALL_RA_CHAIN, | 353 | IP_DEFRAG_CALL_RA_CHAIN, |
338 | IP_DEFRAG_CONNTRACK_IN, | 354 | IP_DEFRAG_CONNTRACK_IN, |
339 | IP_DEFRAG_CONNTRACK_OUT, | 355 | IP_DEFRAG_CONNTRACK_OUT, |
356 | IP_DEFRAG_CONNTRACK_BRIDGE_IN, | ||
340 | IP_DEFRAG_VS_IN, | 357 | IP_DEFRAG_VS_IN, |
341 | IP_DEFRAG_VS_OUT, | 358 | IP_DEFRAG_VS_OUT, |
342 | IP_DEFRAG_VS_FWD | 359 | IP_DEFRAG_VS_FWD |
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 92db8617d188..ccab5946c830 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
@@ -350,8 +350,16 @@ static inline int ipv6_prefix_equal(const struct in6_addr *a1, | |||
350 | 350 | ||
351 | struct inet_frag_queue; | 351 | struct inet_frag_queue; |
352 | 352 | ||
353 | enum ip6_defrag_users { | ||
354 | IP6_DEFRAG_LOCAL_DELIVER, | ||
355 | IP6_DEFRAG_CONNTRACK_IN, | ||
356 | IP6_DEFRAG_CONNTRACK_OUT, | ||
357 | IP6_DEFRAG_CONNTRACK_BRIDGE_IN, | ||
358 | }; | ||
359 | |||
353 | struct ip6_create_arg { | 360 | struct ip6_create_arg { |
354 | __be32 id; | 361 | __be32 id; |
362 | u32 user; | ||
355 | struct in6_addr *src; | 363 | struct in6_addr *src; |
356 | struct in6_addr *dst; | 364 | struct in6_addr *dst; |
357 | }; | 365 | }; |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 2aff4906b2ae..0bf369752274 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -547,7 +547,6 @@ enum mac80211_rx_flags { | |||
547 | * unspecified depending on the hardware capabilities flags | 547 | * unspecified depending on the hardware capabilities flags |
548 | * @IEEE80211_HW_SIGNAL_* | 548 | * @IEEE80211_HW_SIGNAL_* |
549 | * @noise: noise when receiving this frame, in dBm. | 549 | * @noise: noise when receiving this frame, in dBm. |
550 | * @qual: overall signal quality indication, in percent (0-100). | ||
551 | * @antenna: antenna used | 550 | * @antenna: antenna used |
552 | * @rate_idx: index of data rate into band's supported rates or MCS index if | 551 | * @rate_idx: index of data rate into band's supported rates or MCS index if |
553 | * HT rates are use (RX_FLAG_HT) | 552 | * HT rates are use (RX_FLAG_HT) |
@@ -559,7 +558,6 @@ struct ieee80211_rx_status { | |||
559 | int freq; | 558 | int freq; |
560 | int signal; | 559 | int signal; |
561 | int noise; | 560 | int noise; |
562 | int __deprecated qual; | ||
563 | int antenna; | 561 | int antenna; |
564 | int rate_idx; | 562 | int rate_idx; |
565 | int flag; | 563 | int flag; |
@@ -1737,6 +1735,12 @@ static inline void ieee80211_rx_ni(struct ieee80211_hw *hw, | |||
1737 | local_bh_enable(); | 1735 | local_bh_enable(); |
1738 | } | 1736 | } |
1739 | 1737 | ||
1738 | /* | ||
1739 | * The TX headroom reserved by mac80211 for its own tx_status functions. | ||
1740 | * This is enough for the radiotap header. | ||
1741 | */ | ||
1742 | #define IEEE80211_TX_STATUS_HEADROOM 13 | ||
1743 | |||
1740 | /** | 1744 | /** |
1741 | * ieee80211_tx_status - transmit status callback | 1745 | * ieee80211_tx_status - transmit status callback |
1742 | * | 1746 | * |
diff --git a/include/net/netfilter/ipv6/nf_conntrack_ipv6.h b/include/net/netfilter/ipv6/nf_conntrack_ipv6.h index abc55ad75c2b..1ee717eb5b09 100644 --- a/include/net/netfilter/ipv6/nf_conntrack_ipv6.h +++ b/include/net/netfilter/ipv6/nf_conntrack_ipv6.h | |||
@@ -9,7 +9,7 @@ extern struct nf_conntrack_l4proto nf_conntrack_l4proto_icmpv6; | |||
9 | 9 | ||
10 | extern int nf_ct_frag6_init(void); | 10 | extern int nf_ct_frag6_init(void); |
11 | extern void nf_ct_frag6_cleanup(void); | 11 | extern void nf_ct_frag6_cleanup(void); |
12 | extern struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb); | 12 | extern struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb, u32 user); |
13 | extern void nf_ct_frag6_output(unsigned int hooknum, struct sk_buff *skb, | 13 | extern void nf_ct_frag6_output(unsigned int hooknum, struct sk_buff *skb, |
14 | struct net_device *in, | 14 | struct net_device *in, |
15 | struct net_device *out, | 15 | struct net_device *out, |
diff --git a/include/net/netns/conntrack.h b/include/net/netns/conntrack.h index ba1ba0c5efd1..63d449807d9b 100644 --- a/include/net/netns/conntrack.h +++ b/include/net/netns/conntrack.h | |||
@@ -11,6 +11,8 @@ struct nf_conntrack_ecache; | |||
11 | struct netns_ct { | 11 | struct netns_ct { |
12 | atomic_t count; | 12 | atomic_t count; |
13 | unsigned int expect_count; | 13 | unsigned int expect_count; |
14 | unsigned int htable_size; | ||
15 | struct kmem_cache *nf_conntrack_cachep; | ||
14 | struct hlist_nulls_head *hash; | 16 | struct hlist_nulls_head *hash; |
15 | struct hlist_head *expect_hash; | 17 | struct hlist_head *expect_hash; |
16 | struct hlist_nulls_head unconfirmed; | 18 | struct hlist_nulls_head unconfirmed; |
@@ -28,5 +30,6 @@ struct netns_ct { | |||
28 | #endif | 30 | #endif |
29 | int hash_vmalloc; | 31 | int hash_vmalloc; |
30 | int expect_vmalloc; | 32 | int expect_vmalloc; |
33 | char *slabname; | ||
31 | }; | 34 | }; |
32 | #endif | 35 | #endif |
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h index 2eb3814d6258..9a4b8b714079 100644 --- a/include/net/netns/ipv4.h +++ b/include/net/netns/ipv4.h | |||
@@ -40,6 +40,7 @@ struct netns_ipv4 { | |||
40 | struct xt_table *iptable_security; | 40 | struct xt_table *iptable_security; |
41 | struct xt_table *nat_table; | 41 | struct xt_table *nat_table; |
42 | struct hlist_head *nat_bysource; | 42 | struct hlist_head *nat_bysource; |
43 | unsigned int nat_htable_size; | ||
43 | int nat_vmalloced; | 44 | int nat_vmalloced; |
44 | #endif | 45 | #endif |
45 | 46 | ||
diff --git a/include/net/netns/xfrm.h b/include/net/netns/xfrm.h index 56f8e5585df7..74f119a2829a 100644 --- a/include/net/netns/xfrm.h +++ b/include/net/netns/xfrm.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <linux/wait.h> | 5 | #include <linux/wait.h> |
6 | #include <linux/workqueue.h> | 6 | #include <linux/workqueue.h> |
7 | #include <linux/xfrm.h> | 7 | #include <linux/xfrm.h> |
8 | #include <net/dst_ops.h> | ||
8 | 9 | ||
9 | struct ctl_table_header; | 10 | struct ctl_table_header; |
10 | 11 | ||
@@ -42,6 +43,11 @@ struct netns_xfrm { | |||
42 | unsigned int policy_count[XFRM_POLICY_MAX * 2]; | 43 | unsigned int policy_count[XFRM_POLICY_MAX * 2]; |
43 | struct work_struct policy_hash_work; | 44 | struct work_struct policy_hash_work; |
44 | 45 | ||
46 | struct dst_ops xfrm4_dst_ops; | ||
47 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | ||
48 | struct dst_ops xfrm6_dst_ops; | ||
49 | #endif | ||
50 | |||
45 | struct sock *nlsk; | 51 | struct sock *nlsk; |
46 | struct sock *nlsk_stash; | 52 | struct sock *nlsk_stash; |
47 | 53 | ||
diff --git a/include/net/netrom.h b/include/net/netrom.h index 15696b1fd30f..ab170a60e7d3 100644 --- a/include/net/netrom.h +++ b/include/net/netrom.h | |||
@@ -132,6 +132,8 @@ static __inline__ void nr_node_put(struct nr_node *nr_node) | |||
132 | static __inline__ void nr_neigh_put(struct nr_neigh *nr_neigh) | 132 | static __inline__ void nr_neigh_put(struct nr_neigh *nr_neigh) |
133 | { | 133 | { |
134 | if (atomic_dec_and_test(&nr_neigh->refcount)) { | 134 | if (atomic_dec_and_test(&nr_neigh->refcount)) { |
135 | if (nr_neigh->ax25) | ||
136 | ax25_cb_put(nr_neigh->ax25); | ||
135 | kfree(nr_neigh->digipeat); | 137 | kfree(nr_neigh->digipeat); |
136 | kfree(nr_neigh); | 138 | kfree(nr_neigh); |
137 | } | 139 | } |
diff --git a/include/net/tcp.h b/include/net/tcp.h index 1b6f7d348cee..34f5cc24d903 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -408,8 +408,7 @@ extern int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, | |||
408 | extern void tcp_parse_options(struct sk_buff *skb, | 408 | extern void tcp_parse_options(struct sk_buff *skb, |
409 | struct tcp_options_received *opt_rx, | 409 | struct tcp_options_received *opt_rx, |
410 | u8 **hvpp, | 410 | u8 **hvpp, |
411 | int estab, | 411 | int estab); |
412 | struct dst_entry *dst); | ||
413 | 412 | ||
414 | extern u8 *tcp_parse_md5sig_option(struct tcphdr *th); | 413 | extern u8 *tcp_parse_md5sig_option(struct tcphdr *th); |
415 | 414 | ||
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 6d85861ab990..60c27706e7b9 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -1367,8 +1367,8 @@ struct xfrmk_spdinfo { | |||
1367 | extern struct xfrm_state *xfrm_find_acq_byseq(struct net *net, u32 seq); | 1367 | extern struct xfrm_state *xfrm_find_acq_byseq(struct net *net, u32 seq); |
1368 | extern int xfrm_state_delete(struct xfrm_state *x); | 1368 | extern int xfrm_state_delete(struct xfrm_state *x); |
1369 | extern int xfrm_state_flush(struct net *net, u8 proto, struct xfrm_audit *audit_info); | 1369 | extern int xfrm_state_flush(struct net *net, u8 proto, struct xfrm_audit *audit_info); |
1370 | extern void xfrm_sad_getinfo(struct xfrmk_sadinfo *si); | 1370 | extern void xfrm_sad_getinfo(struct net *net, struct xfrmk_sadinfo *si); |
1371 | extern void xfrm_spd_getinfo(struct xfrmk_spdinfo *si); | 1371 | extern void xfrm_spd_getinfo(struct net *net, struct xfrmk_spdinfo *si); |
1372 | extern int xfrm_replay_check(struct xfrm_state *x, | 1372 | extern int xfrm_replay_check(struct xfrm_state *x, |
1373 | struct sk_buff *skb, __be32 seq); | 1373 | struct sk_buff *skb, __be32 seq); |
1374 | extern void xfrm_replay_advance(struct xfrm_state *x, __be32 seq); | 1374 | extern void xfrm_replay_advance(struct xfrm_state *x, __be32 seq); |
diff --git a/include/rdma/ib_addr.h b/include/rdma/ib_addr.h index 483057b2f4b4..fa0d52b8e622 100644 --- a/include/rdma/ib_addr.h +++ b/include/rdma/ib_addr.h | |||
@@ -36,6 +36,7 @@ | |||
36 | 36 | ||
37 | #include <linux/in.h> | 37 | #include <linux/in.h> |
38 | #include <linux/in6.h> | 38 | #include <linux/in6.h> |
39 | #include <linux/if_arp.h> | ||
39 | #include <linux/netdevice.h> | 40 | #include <linux/netdevice.h> |
40 | #include <linux/socket.h> | 41 | #include <linux/socket.h> |
41 | #include <rdma/ib_verbs.h> | 42 | #include <rdma/ib_verbs.h> |
@@ -60,8 +61,8 @@ struct rdma_dev_addr { | |||
60 | unsigned char src_dev_addr[MAX_ADDR_LEN]; | 61 | unsigned char src_dev_addr[MAX_ADDR_LEN]; |
61 | unsigned char dst_dev_addr[MAX_ADDR_LEN]; | 62 | unsigned char dst_dev_addr[MAX_ADDR_LEN]; |
62 | unsigned char broadcast[MAX_ADDR_LEN]; | 63 | unsigned char broadcast[MAX_ADDR_LEN]; |
63 | enum rdma_node_type dev_type; | 64 | unsigned short dev_type; |
64 | struct net_device *src_dev; | 65 | int bound_dev_if; |
65 | }; | 66 | }; |
66 | 67 | ||
67 | /** | 68 | /** |
@@ -121,40 +122,29 @@ static inline void ib_addr_get_mgid(struct rdma_dev_addr *dev_addr, | |||
121 | memcpy(gid, dev_addr->broadcast + 4, sizeof *gid); | 122 | memcpy(gid, dev_addr->broadcast + 4, sizeof *gid); |
122 | } | 123 | } |
123 | 124 | ||
124 | static inline void ib_addr_get_sgid(struct rdma_dev_addr *dev_addr, | 125 | static inline int rdma_addr_gid_offset(struct rdma_dev_addr *dev_addr) |
125 | union ib_gid *gid) | ||
126 | { | 126 | { |
127 | memcpy(gid, dev_addr->src_dev_addr + 4, sizeof *gid); | 127 | return dev_addr->dev_type == ARPHRD_INFINIBAND ? 4 : 0; |
128 | } | 128 | } |
129 | 129 | ||
130 | static inline void ib_addr_set_sgid(struct rdma_dev_addr *dev_addr, | 130 | static inline void rdma_addr_get_sgid(struct rdma_dev_addr *dev_addr, union ib_gid *gid) |
131 | union ib_gid *gid) | ||
132 | { | 131 | { |
133 | memcpy(dev_addr->src_dev_addr + 4, gid, sizeof *gid); | 132 | memcpy(gid, dev_addr->src_dev_addr + rdma_addr_gid_offset(dev_addr), sizeof *gid); |
134 | } | 133 | } |
135 | 134 | ||
136 | static inline void ib_addr_get_dgid(struct rdma_dev_addr *dev_addr, | 135 | static inline void rdma_addr_set_sgid(struct rdma_dev_addr *dev_addr, union ib_gid *gid) |
137 | union ib_gid *gid) | ||
138 | { | 136 | { |
139 | memcpy(gid, dev_addr->dst_dev_addr + 4, sizeof *gid); | 137 | memcpy(dev_addr->src_dev_addr + rdma_addr_gid_offset(dev_addr), gid, sizeof *gid); |
140 | } | 138 | } |
141 | 139 | ||
142 | static inline void ib_addr_set_dgid(struct rdma_dev_addr *dev_addr, | 140 | static inline void rdma_addr_get_dgid(struct rdma_dev_addr *dev_addr, union ib_gid *gid) |
143 | union ib_gid *gid) | ||
144 | { | 141 | { |
145 | memcpy(dev_addr->dst_dev_addr + 4, gid, sizeof *gid); | 142 | memcpy(gid, dev_addr->dst_dev_addr + rdma_addr_gid_offset(dev_addr), sizeof *gid); |
146 | } | 143 | } |
147 | 144 | ||
148 | static inline void iw_addr_get_sgid(struct rdma_dev_addr *dev_addr, | 145 | static inline void rdma_addr_set_dgid(struct rdma_dev_addr *dev_addr, union ib_gid *gid) |
149 | union ib_gid *gid) | ||
150 | { | ||
151 | memcpy(gid, dev_addr->src_dev_addr, sizeof *gid); | ||
152 | } | ||
153 | |||
154 | static inline void iw_addr_get_dgid(struct rdma_dev_addr *dev_addr, | ||
155 | union ib_gid *gid) | ||
156 | { | 146 | { |
157 | memcpy(gid, dev_addr->dst_dev_addr, sizeof *gid); | 147 | memcpy(dev_addr->dst_dev_addr + rdma_addr_gid_offset(dev_addr), gid, sizeof *gid); |
158 | } | 148 | } |
159 | 149 | ||
160 | #endif /* IB_ADDR_H */ | 150 | #endif /* IB_ADDR_H */ |
diff --git a/include/rdma/ib_sa.h b/include/rdma/ib_sa.h index 3841c1aff692..1082afaed158 100644 --- a/include/rdma/ib_sa.h +++ b/include/rdma/ib_sa.h | |||
@@ -379,4 +379,10 @@ int ib_init_ah_from_path(struct ib_device *device, u8 port_num, | |||
379 | struct ib_sa_path_rec *rec, | 379 | struct ib_sa_path_rec *rec, |
380 | struct ib_ah_attr *ah_attr); | 380 | struct ib_ah_attr *ah_attr); |
381 | 381 | ||
382 | /** | ||
383 | * ib_sa_unpack_path - Convert a path record from MAD format to struct | ||
384 | * ib_sa_path_rec. | ||
385 | */ | ||
386 | void ib_sa_unpack_path(void *attribute, struct ib_sa_path_rec *rec); | ||
387 | |||
382 | #endif /* IB_SA_H */ | 388 | #endif /* IB_SA_H */ |
diff --git a/include/rdma/ib_user_sa.h b/include/rdma/ib_user_sa.h index 659120157e14..cfc7c9ba781e 100644 --- a/include/rdma/ib_user_sa.h +++ b/include/rdma/ib_user_sa.h | |||
@@ -35,6 +35,22 @@ | |||
35 | 35 | ||
36 | #include <linux/types.h> | 36 | #include <linux/types.h> |
37 | 37 | ||
38 | enum { | ||
39 | IB_PATH_GMP = 1, | ||
40 | IB_PATH_PRIMARY = (1<<1), | ||
41 | IB_PATH_ALTERNATE = (1<<2), | ||
42 | IB_PATH_OUTBOUND = (1<<3), | ||
43 | IB_PATH_INBOUND = (1<<4), | ||
44 | IB_PATH_INBOUND_REVERSE = (1<<5), | ||
45 | IB_PATH_BIDIRECTIONAL = IB_PATH_OUTBOUND | IB_PATH_INBOUND_REVERSE | ||
46 | }; | ||
47 | |||
48 | struct ib_path_rec_data { | ||
49 | __u32 flags; | ||
50 | __u32 reserved; | ||
51 | __u32 path_rec[16]; | ||
52 | }; | ||
53 | |||
38 | struct ib_user_path_rec { | 54 | struct ib_user_path_rec { |
39 | __u8 dgid[16]; | 55 | __u8 dgid[16]; |
40 | __u8 sgid[16]; | 56 | __u8 sgid[16]; |
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index c179318edd92..09509edb1c5f 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h | |||
@@ -1425,6 +1425,11 @@ int ib_destroy_qp(struct ib_qp *qp); | |||
1425 | * @send_wr: A list of work requests to post on the send queue. | 1425 | * @send_wr: A list of work requests to post on the send queue. |
1426 | * @bad_send_wr: On an immediate failure, this parameter will reference | 1426 | * @bad_send_wr: On an immediate failure, this parameter will reference |
1427 | * the work request that failed to be posted on the QP. | 1427 | * the work request that failed to be posted on the QP. |
1428 | * | ||
1429 | * While IBA Vol. 1 section 11.4.1.1 specifies that if an immediate | ||
1430 | * error is returned, the QP state shall not be affected, | ||
1431 | * ib_post_send() will return an immediate error after queueing any | ||
1432 | * earlier work requests in the list. | ||
1428 | */ | 1433 | */ |
1429 | static inline int ib_post_send(struct ib_qp *qp, | 1434 | static inline int ib_post_send(struct ib_qp *qp, |
1430 | struct ib_send_wr *send_wr, | 1435 | struct ib_send_wr *send_wr, |
diff --git a/include/rdma/rdma_user_cm.h b/include/rdma/rdma_user_cm.h index c55705460b87..1d165022c02d 100644 --- a/include/rdma/rdma_user_cm.h +++ b/include/rdma/rdma_user_cm.h | |||
@@ -215,12 +215,14 @@ struct rdma_ucm_event_resp { | |||
215 | 215 | ||
216 | /* Option levels */ | 216 | /* Option levels */ |
217 | enum { | 217 | enum { |
218 | RDMA_OPTION_ID = 0 | 218 | RDMA_OPTION_ID = 0, |
219 | RDMA_OPTION_IB = 1 | ||
219 | }; | 220 | }; |
220 | 221 | ||
221 | /* Option details */ | 222 | /* Option details */ |
222 | enum { | 223 | enum { |
223 | RDMA_OPTION_ID_TOS = 0 | 224 | RDMA_OPTION_ID_TOS = 0, |
225 | RDMA_OPTION_IB_PATH = 1 | ||
224 | }; | 226 | }; |
225 | 227 | ||
226 | struct rdma_ucm_set_option { | 228 | struct rdma_ucm_set_option { |
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h index 7394e3bc8f4b..ff92b46f5153 100644 --- a/include/scsi/libiscsi.h +++ b/include/scsi/libiscsi.h | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/mutex.h> | 28 | #include <linux/mutex.h> |
29 | #include <linux/timer.h> | 29 | #include <linux/timer.h> |
30 | #include <linux/workqueue.h> | 30 | #include <linux/workqueue.h> |
31 | #include <linux/kfifo.h> | ||
31 | #include <scsi/iscsi_proto.h> | 32 | #include <scsi/iscsi_proto.h> |
32 | #include <scsi/iscsi_if.h> | 33 | #include <scsi/iscsi_if.h> |
33 | #include <scsi/scsi_transport_iscsi.h> | 34 | #include <scsi/scsi_transport_iscsi.h> |
@@ -231,7 +232,7 @@ struct iscsi_conn { | |||
231 | }; | 232 | }; |
232 | 233 | ||
233 | struct iscsi_pool { | 234 | struct iscsi_pool { |
234 | struct kfifo *queue; /* FIFO Queue */ | 235 | struct kfifo queue; /* FIFO Queue */ |
235 | void **pool; /* Pool of elements */ | 236 | void **pool; /* Pool of elements */ |
236 | int max; /* Max number of elements */ | 237 | int max; /* Max number of elements */ |
237 | }; | 238 | }; |
diff --git a/include/scsi/libiscsi_tcp.h b/include/scsi/libiscsi_tcp.h index 9e3182e659db..741ae7ed4394 100644 --- a/include/scsi/libiscsi_tcp.h +++ b/include/scsi/libiscsi_tcp.h | |||
@@ -80,7 +80,7 @@ struct iscsi_tcp_task { | |||
80 | int data_offset; | 80 | int data_offset; |
81 | struct iscsi_r2t_info *r2t; /* in progress solict R2T */ | 81 | struct iscsi_r2t_info *r2t; /* in progress solict R2T */ |
82 | struct iscsi_pool r2tpool; | 82 | struct iscsi_pool r2tpool; |
83 | struct kfifo *r2tqueue; | 83 | struct kfifo r2tqueue; |
84 | void *dd_data; | 84 | void *dd_data; |
85 | }; | 85 | }; |
86 | 86 | ||
diff --git a/include/scsi/libsrp.h b/include/scsi/libsrp.h index ba615e4c1d7c..f4105c91af53 100644 --- a/include/scsi/libsrp.h +++ b/include/scsi/libsrp.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define __LIBSRP_H__ | 2 | #define __LIBSRP_H__ |
3 | 3 | ||
4 | #include <linux/list.h> | 4 | #include <linux/list.h> |
5 | #include <linux/kfifo.h> | ||
5 | #include <scsi/scsi_cmnd.h> | 6 | #include <scsi/scsi_cmnd.h> |
6 | #include <scsi/scsi_host.h> | 7 | #include <scsi/scsi_host.h> |
7 | #include <scsi/srp.h> | 8 | #include <scsi/srp.h> |
@@ -21,7 +22,7 @@ struct srp_buf { | |||
21 | struct srp_queue { | 22 | struct srp_queue { |
22 | void *pool; | 23 | void *pool; |
23 | void *items; | 24 | void *items; |
24 | struct kfifo *queue; | 25 | struct kfifo queue; |
25 | spinlock_t lock; | 26 | spinlock_t lock; |
26 | }; | 27 | }; |
27 | 28 | ||
diff --git a/include/scsi/osd_initiator.h b/include/scsi/osd_initiator.h index 39d6d1097153..a8f370126632 100644 --- a/include/scsi/osd_initiator.h +++ b/include/scsi/osd_initiator.h | |||
@@ -142,6 +142,7 @@ struct osd_request { | |||
142 | struct _osd_io_info { | 142 | struct _osd_io_info { |
143 | struct bio *bio; | 143 | struct bio *bio; |
144 | u64 total_bytes; | 144 | u64 total_bytes; |
145 | u64 residual; | ||
145 | struct request *req; | 146 | struct request *req; |
146 | struct _osd_req_data_segment *last_seg; | 147 | struct _osd_req_data_segment *last_seg; |
147 | u8 *pad_buff; | 148 | u8 *pad_buff; |
@@ -150,12 +151,14 @@ struct osd_request { | |||
150 | gfp_t alloc_flags; | 151 | gfp_t alloc_flags; |
151 | unsigned timeout; | 152 | unsigned timeout; |
152 | unsigned retries; | 153 | unsigned retries; |
154 | unsigned sense_len; | ||
153 | u8 sense[OSD_MAX_SENSE_LEN]; | 155 | u8 sense[OSD_MAX_SENSE_LEN]; |
154 | enum osd_attributes_mode attributes_mode; | 156 | enum osd_attributes_mode attributes_mode; |
155 | 157 | ||
156 | osd_req_done_fn *async_done; | 158 | osd_req_done_fn *async_done; |
157 | void *async_private; | 159 | void *async_private; |
158 | int async_error; | 160 | int async_error; |
161 | int req_errors; | ||
159 | }; | 162 | }; |
160 | 163 | ||
161 | static inline bool osd_req_is_ver1(struct osd_request *or) | 164 | static inline bool osd_req_is_ver1(struct osd_request *or) |
@@ -297,8 +300,6 @@ enum osd_err_priority { | |||
297 | }; | 300 | }; |
298 | 301 | ||
299 | struct osd_sense_info { | 302 | struct osd_sense_info { |
300 | u64 out_resid; /* Zero on success otherwise out residual */ | ||
301 | u64 in_resid; /* Zero on success otherwise in residual */ | ||
302 | enum osd_err_priority osd_err_pri; | 303 | enum osd_err_priority osd_err_pri; |
303 | 304 | ||
304 | int key; /* one of enum scsi_sense_keys */ | 305 | int key; /* one of enum scsi_sense_keys */ |
diff --git a/include/scsi/scsi_bsg_fc.h b/include/scsi/scsi_bsg_fc.h index a4b233318179..91a4e4ff9a9b 100644 --- a/include/scsi/scsi_bsg_fc.h +++ b/include/scsi/scsi_bsg_fc.h | |||
@@ -292,7 +292,7 @@ struct fc_bsg_request { | |||
292 | struct fc_bsg_rport_els r_els; | 292 | struct fc_bsg_rport_els r_els; |
293 | struct fc_bsg_rport_ct r_ct; | 293 | struct fc_bsg_rport_ct r_ct; |
294 | } rqst_data; | 294 | } rqst_data; |
295 | }; | 295 | } __attribute__((packed)); |
296 | 296 | ||
297 | 297 | ||
298 | /* response (request sense data) structure of the sg_io_v4 */ | 298 | /* response (request sense data) structure of the sg_io_v4 */ |
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index d1b3de9c1a71..c6fe03e902ca 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
@@ -414,7 +414,8 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \ | |||
414 | BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \ | 414 | BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \ |
415 | ret = trace_define_field(event_call, #type "[" #len "]", #item, \ | 415 | ret = trace_define_field(event_call, #type "[" #len "]", #item, \ |
416 | offsetof(typeof(field), item), \ | 416 | offsetof(typeof(field), item), \ |
417 | sizeof(field.item), 0, FILTER_OTHER); \ | 417 | sizeof(field.item), \ |
418 | is_signed_type(type), FILTER_OTHER); \ | ||
418 | if (ret) \ | 419 | if (ret) \ |
419 | return ret; | 420 | return ret; |
420 | 421 | ||
@@ -422,8 +423,8 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \ | |||
422 | #define __dynamic_array(type, item, len) \ | 423 | #define __dynamic_array(type, item, len) \ |
423 | ret = trace_define_field(event_call, "__data_loc " #type "[]", #item, \ | 424 | ret = trace_define_field(event_call, "__data_loc " #type "[]", #item, \ |
424 | offsetof(typeof(field), __data_loc_##item), \ | 425 | offsetof(typeof(field), __data_loc_##item), \ |
425 | sizeof(field.__data_loc_##item), 0, \ | 426 | sizeof(field.__data_loc_##item), \ |
426 | FILTER_OTHER); | 427 | is_signed_type(type), FILTER_OTHER); |
427 | 428 | ||
428 | #undef __string | 429 | #undef __string |
429 | #define __string(item, src) __dynamic_array(char, item, -1) | 430 | #define __string(item, src) __dynamic_array(char, item, -1) |
@@ -436,10 +437,6 @@ ftrace_define_fields_##call(struct ftrace_event_call *event_call) \ | |||
436 | struct ftrace_raw_##call field; \ | 437 | struct ftrace_raw_##call field; \ |
437 | int ret; \ | 438 | int ret; \ |
438 | \ | 439 | \ |
439 | ret = trace_define_common_fields(event_call); \ | ||
440 | if (ret) \ | ||
441 | return ret; \ | ||
442 | \ | ||
443 | tstruct; \ | 440 | tstruct; \ |
444 | \ | 441 | \ |
445 | return ret; \ | 442 | return ret; \ |
@@ -559,13 +556,7 @@ static void ftrace_profile_disable_##name(struct ftrace_event_call *unused)\ | |||
559 | * | 556 | * |
560 | * static int ftrace_reg_event_<call>(struct ftrace_event_call *unused) | 557 | * static int ftrace_reg_event_<call>(struct ftrace_event_call *unused) |
561 | * { | 558 | * { |
562 | * int ret; | 559 | * return register_trace_<call>(ftrace_event_<call>); |
563 | * | ||
564 | * ret = register_trace_<call>(ftrace_event_<call>); | ||
565 | * if (!ret) | ||
566 | * pr_info("event trace: Could not activate trace point " | ||
567 | * "probe to <call>"); | ||
568 | * return ret; | ||
569 | * } | 560 | * } |
570 | * | 561 | * |
571 | * static void ftrace_unreg_event_<call>(struct ftrace_event_call *unused) | 562 | * static void ftrace_unreg_event_<call>(struct ftrace_event_call *unused) |
@@ -623,23 +614,12 @@ static void ftrace_profile_disable_##name(struct ftrace_event_call *unused)\ | |||
623 | * .trace = ftrace_raw_output_<call>, <-- stage 2 | 614 | * .trace = ftrace_raw_output_<call>, <-- stage 2 |
624 | * }; | 615 | * }; |
625 | * | 616 | * |
626 | * static int ftrace_raw_init_event_<call>(struct ftrace_event_call *unused) | ||
627 | * { | ||
628 | * int id; | ||
629 | * | ||
630 | * id = register_ftrace_event(&ftrace_event_type_<call>); | ||
631 | * if (!id) | ||
632 | * return -ENODEV; | ||
633 | * event_<call>.id = id; | ||
634 | * return 0; | ||
635 | * } | ||
636 | * | ||
637 | * static struct ftrace_event_call __used | 617 | * static struct ftrace_event_call __used |
638 | * __attribute__((__aligned__(4))) | 618 | * __attribute__((__aligned__(4))) |
639 | * __attribute__((section("_ftrace_events"))) event_<call> = { | 619 | * __attribute__((section("_ftrace_events"))) event_<call> = { |
640 | * .name = "<call>", | 620 | * .name = "<call>", |
641 | * .system = "<system>", | 621 | * .system = "<system>", |
642 | * .raw_init = ftrace_raw_init_event_<call>, | 622 | * .raw_init = trace_event_raw_init, |
643 | * .regfunc = ftrace_reg_event_<call>, | 623 | * .regfunc = ftrace_reg_event_<call>, |
644 | * .unregfunc = ftrace_unreg_event_<call>, | 624 | * .unregfunc = ftrace_unreg_event_<call>, |
645 | * .show_format = ftrace_format_<call>, | 625 | * .show_format = ftrace_format_<call>, |
@@ -647,13 +627,9 @@ static void ftrace_profile_disable_##name(struct ftrace_event_call *unused)\ | |||
647 | * | 627 | * |
648 | */ | 628 | */ |
649 | 629 | ||
650 | #undef TP_FMT | ||
651 | #define TP_FMT(fmt, args...) fmt "\n", ##args | ||
652 | |||
653 | #ifdef CONFIG_EVENT_PROFILE | 630 | #ifdef CONFIG_EVENT_PROFILE |
654 | 631 | ||
655 | #define _TRACE_PROFILE_INIT(call) \ | 632 | #define _TRACE_PROFILE_INIT(call) \ |
656 | .profile_count = ATOMIC_INIT(-1), \ | ||
657 | .profile_enable = ftrace_profile_enable_##call, \ | 633 | .profile_enable = ftrace_profile_enable_##call, \ |
658 | .profile_disable = ftrace_profile_disable_##call, | 634 | .profile_disable = ftrace_profile_disable_##call, |
659 | 635 | ||
@@ -728,13 +704,7 @@ static void ftrace_raw_event_##call(proto) \ | |||
728 | \ | 704 | \ |
729 | static int ftrace_raw_reg_event_##call(struct ftrace_event_call *unused)\ | 705 | static int ftrace_raw_reg_event_##call(struct ftrace_event_call *unused)\ |
730 | { \ | 706 | { \ |
731 | int ret; \ | 707 | return register_trace_##call(ftrace_raw_event_##call); \ |
732 | \ | ||
733 | ret = register_trace_##call(ftrace_raw_event_##call); \ | ||
734 | if (ret) \ | ||
735 | pr_info("event trace: Could not activate trace point " \ | ||
736 | "probe to " #call "\n"); \ | ||
737 | return ret; \ | ||
738 | } \ | 708 | } \ |
739 | \ | 709 | \ |
740 | static void ftrace_raw_unreg_event_##call(struct ftrace_event_call *unused)\ | 710 | static void ftrace_raw_unreg_event_##call(struct ftrace_event_call *unused)\ |
@@ -744,19 +714,7 @@ static void ftrace_raw_unreg_event_##call(struct ftrace_event_call *unused)\ | |||
744 | \ | 714 | \ |
745 | static struct trace_event ftrace_event_type_##call = { \ | 715 | static struct trace_event ftrace_event_type_##call = { \ |
746 | .trace = ftrace_raw_output_##call, \ | 716 | .trace = ftrace_raw_output_##call, \ |
747 | }; \ | 717 | }; |
748 | \ | ||
749 | static int ftrace_raw_init_event_##call(struct ftrace_event_call *unused)\ | ||
750 | { \ | ||
751 | int id; \ | ||
752 | \ | ||
753 | id = register_ftrace_event(&ftrace_event_type_##call); \ | ||
754 | if (!id) \ | ||
755 | return -ENODEV; \ | ||
756 | event_##call.id = id; \ | ||
757 | INIT_LIST_HEAD(&event_##call.fields); \ | ||
758 | return 0; \ | ||
759 | } | ||
760 | 718 | ||
761 | #undef DEFINE_EVENT_PRINT | 719 | #undef DEFINE_EVENT_PRINT |
762 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ | 720 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ |
@@ -776,7 +734,7 @@ __attribute__((section("_ftrace_events"))) event_##call = { \ | |||
776 | .name = #call, \ | 734 | .name = #call, \ |
777 | .system = __stringify(TRACE_SYSTEM), \ | 735 | .system = __stringify(TRACE_SYSTEM), \ |
778 | .event = &ftrace_event_type_##call, \ | 736 | .event = &ftrace_event_type_##call, \ |
779 | .raw_init = ftrace_raw_init_event_##call, \ | 737 | .raw_init = trace_event_raw_init, \ |
780 | .regfunc = ftrace_raw_reg_event_##call, \ | 738 | .regfunc = ftrace_raw_reg_event_##call, \ |
781 | .unregfunc = ftrace_raw_unreg_event_##call, \ | 739 | .unregfunc = ftrace_raw_unreg_event_##call, \ |
782 | .show_format = ftrace_format_##template, \ | 740 | .show_format = ftrace_format_##template, \ |
@@ -793,7 +751,7 @@ __attribute__((section("_ftrace_events"))) event_##call = { \ | |||
793 | .name = #call, \ | 751 | .name = #call, \ |
794 | .system = __stringify(TRACE_SYSTEM), \ | 752 | .system = __stringify(TRACE_SYSTEM), \ |
795 | .event = &ftrace_event_type_##call, \ | 753 | .event = &ftrace_event_type_##call, \ |
796 | .raw_init = ftrace_raw_init_event_##call, \ | 754 | .raw_init = trace_event_raw_init, \ |
797 | .regfunc = ftrace_raw_reg_event_##call, \ | 755 | .regfunc = ftrace_raw_reg_event_##call, \ |
798 | .unregfunc = ftrace_raw_unreg_event_##call, \ | 756 | .unregfunc = ftrace_raw_unreg_event_##call, \ |
799 | .show_format = ftrace_format_##call, \ | 757 | .show_format = ftrace_format_##call, \ |
@@ -953,7 +911,6 @@ end: \ | |||
953 | perf_swevent_put_recursion_context(rctx); \ | 911 | perf_swevent_put_recursion_context(rctx); \ |
954 | end_recursion: \ | 912 | end_recursion: \ |
955 | local_irq_restore(irq_flags); \ | 913 | local_irq_restore(irq_flags); \ |
956 | \ | ||
957 | } | 914 | } |
958 | 915 | ||
959 | #undef DEFINE_EVENT | 916 | #undef DEFINE_EVENT |
diff --git a/include/video/sh_mobile_lcdc.h b/include/video/sh_mobile_lcdc.h index 25144ab22b95..288205457713 100644 --- a/include/video/sh_mobile_lcdc.h +++ b/include/video/sh_mobile_lcdc.h | |||
@@ -50,6 +50,8 @@ struct sh_mobile_lcdc_board_cfg { | |||
50 | void *board_data; | 50 | void *board_data; |
51 | int (*setup_sys)(void *board_data, void *sys_ops_handle, | 51 | int (*setup_sys)(void *board_data, void *sys_ops_handle, |
52 | struct sh_mobile_lcdc_sys_bus_ops *sys_ops); | 52 | struct sh_mobile_lcdc_sys_bus_ops *sys_ops); |
53 | void (*start_transfer)(void *board_data, void *sys_ops_handle, | ||
54 | struct sh_mobile_lcdc_sys_bus_ops *sys_ops); | ||
53 | void (*display_on)(void *board_data); | 55 | void (*display_on)(void *board_data); |
54 | void (*display_off)(void *board_data); | 56 | void (*display_off)(void *board_data); |
55 | }; | 57 | }; |