aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acpi_bus.h7
-rw-r--r--include/acpi/acpi_drivers.h13
-rw-r--r--include/acpi/processor.h1
-rw-r--r--include/acpi/video.h4
-rw-r--r--include/asm-generic/hardirq.h13
-rw-r--r--include/asm-generic/pgtable.h4
-rw-r--r--include/asm-generic/uaccess.h14
-rw-r--r--include/asm-generic/unistd.h7
-rw-r--r--include/asm-generic/vmlinux.lds.h2
-rw-r--r--include/linux/acpi.h6
-rw-r--r--include/linux/audit.h3
-rw-r--r--include/linux/cpu.h5
-rw-r--r--include/linux/dma_remapping.h9
-rw-r--r--include/linux/dmar.h20
-rw-r--r--include/linux/ext3_fs_i.h4
-rw-r--r--include/linux/falloc.h21
-rw-r--r--include/linux/firewire.h87
-rw-r--r--include/linux/fs.h14
-rw-r--r--include/linux/hugetlb.h4
-rw-r--r--include/linux/icmpv6.h6
-rw-r--r--include/linux/intel-iommu.h35
-rw-r--r--include/linux/ioport.h2
-rw-r--r--include/linux/lockd/lockd.h2
-rw-r--r--include/linux/lockdep.h15
-rw-r--r--include/linux/mnt_namespace.h10
-rw-r--r--include/linux/mtd/nand.h16
-rw-r--r--include/linux/mtd/onenand.h24
-rw-r--r--include/linux/mtd/onenand_regs.h20
-rw-r--r--include/linux/mtd/partitions.h1
-rw-r--r--include/linux/nfs.h5
-rw-r--r--include/linux/nfs2.h7
-rw-r--r--include/linux/nfs3.h5
-rw-r--r--include/linux/nfs4.h18
-rw-r--r--include/linux/nfs_fs_sb.h67
-rw-r--r--include/linux/nfs_xdr.h171
-rw-r--r--include/linux/nfsd/cache.h3
-rw-r--r--include/linux/nfsd/nfsfh.h7
-rw-r--r--include/linux/nfsd/state.h45
-rw-r--r--include/linux/nfsd/xdr4.h28
-rw-r--r--include/linux/pci-acpi.h4
-rw-r--r--include/linux/pci.h37
-rw-r--r--include/linux/pci_hotplug.h24
-rw-r--r--include/linux/pci_regs.h14
-rw-r--r--include/linux/posix_acl.h64
-rw-r--r--include/linux/reiserfs_acl.h17
-rw-r--r--include/linux/reiserfs_fs_i.h4
-rw-r--r--include/linux/rfkill.h33
-rw-r--r--include/linux/rmap.h9
-rw-r--r--include/linux/serial_core.h3
-rw-r--r--include/linux/serial_reg.h1
-rw-r--r--include/linux/shmem_fs.h8
-rw-r--r--include/linux/sunrpc/bc_xprt.h49
-rw-r--r--include/linux/sunrpc/clnt.h1
-rw-r--r--include/linux/sunrpc/sched.h3
-rw-r--r--include/linux/sunrpc/svc.h11
-rw-r--r--include/linux/sunrpc/svc_xprt.h7
-rw-r--r--include/linux/sunrpc/svcsock.h9
-rw-r--r--include/linux/sunrpc/xprt.h38
-rw-r--r--include/linux/swap.h12
-rw-r--r--include/linux/videodev2.h4
-rw-r--r--include/media/ir-common.h2
-rw-r--r--include/media/v4l2-common.h26
-rw-r--r--include/media/v4l2-i2c-drv.h5
-rw-r--r--include/media/v4l2-subdev.h7
-rw-r--r--include/mtd/Kbuild1
-rw-r--r--include/mtd/jffs2-user.h34
-rw-r--r--include/mtd/mtd-abi.h15
-rw-r--r--include/net/iucv/af_iucv.h2
-rw-r--r--include/net/protocol.h2
-rw-r--r--include/net/rawv6.h2
-rw-r--r--include/net/sctp/sctp.h1
-rw-r--r--include/net/sock.h2
-rw-r--r--include/net/xfrm.h2
-rw-r--r--include/scsi/fc_encode.h2
-rw-r--r--include/scsi/libfc.h77
-rw-r--r--include/scsi/libiscsi.h4
-rw-r--r--include/scsi/scsi_driver.h1
77 files changed, 1007 insertions, 255 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index c34b11022908..c65e4ce6c3af 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -114,10 +114,13 @@ struct acpi_device_ops {
114 acpi_op_notify notify; 114 acpi_op_notify notify;
115}; 115};
116 116
117#define ACPI_DRIVER_ALL_NOTIFY_EVENTS 0x1 /* system AND device events */
118
117struct acpi_driver { 119struct acpi_driver {
118 char name[80]; 120 char name[80];
119 char class[80]; 121 char class[80];
120 const struct acpi_device_id *ids; /* Supported Hardware IDs */ 122 const struct acpi_device_id *ids; /* Supported Hardware IDs */
123 unsigned int flags;
121 struct acpi_device_ops ops; 124 struct acpi_device_ops ops;
122 struct device_driver drv; 125 struct device_driver drv;
123 struct module *owner; 126 struct module *owner;
@@ -168,7 +171,7 @@ struct acpi_device_dir {
168 171
169/* Plug and Play */ 172/* Plug and Play */
170 173
171typedef char acpi_bus_id[5]; 174typedef char acpi_bus_id[8];
172typedef unsigned long acpi_bus_address; 175typedef unsigned long acpi_bus_address;
173typedef char acpi_hardware_id[15]; 176typedef char acpi_hardware_id[15];
174typedef char acpi_unique_id[9]; 177typedef char acpi_unique_id[9];
@@ -365,10 +368,10 @@ struct acpi_bus_type {
365int register_acpi_bus_type(struct acpi_bus_type *); 368int register_acpi_bus_type(struct acpi_bus_type *);
366int unregister_acpi_bus_type(struct acpi_bus_type *); 369int unregister_acpi_bus_type(struct acpi_bus_type *);
367struct device *acpi_get_physical_device(acpi_handle); 370struct device *acpi_get_physical_device(acpi_handle);
368struct device *acpi_get_physical_pci_device(acpi_handle);
369 371
370/* helper */ 372/* helper */
371acpi_handle acpi_get_child(acpi_handle, acpi_integer); 373acpi_handle acpi_get_child(acpi_handle, acpi_integer);
374int acpi_is_root_bridge(acpi_handle);
372acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int); 375acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int);
373#define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->archdata.acpi_handle)) 376#define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->archdata.acpi_handle))
374 377
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h
index 0352c8f0b05b..f4906f6568d4 100644
--- a/include/acpi/acpi_drivers.h
+++ b/include/acpi/acpi_drivers.h
@@ -57,8 +57,7 @@
57 */ 57 */
58 58
59#define ACPI_POWER_HID "LNXPOWER" 59#define ACPI_POWER_HID "LNXPOWER"
60#define ACPI_PROCESSOR_OBJECT_HID "ACPI_CPU" 60#define ACPI_PROCESSOR_OBJECT_HID "LNXCPU"
61#define ACPI_PROCESSOR_HID "ACPI0007"
62#define ACPI_SYSTEM_HID "LNXSYSTM" 61#define ACPI_SYSTEM_HID "LNXSYSTM"
63#define ACPI_THERMAL_HID "LNXTHERM" 62#define ACPI_THERMAL_HID "LNXTHERM"
64#define ACPI_BUTTON_HID_POWERF "LNXPWRBN" 63#define ACPI_BUTTON_HID_POWERF "LNXPWRBN"
@@ -91,17 +90,15 @@ int acpi_pci_link_free_irq(acpi_handle handle);
91 90
92/* ACPI PCI Interrupt Routing (pci_irq.c) */ 91/* ACPI PCI Interrupt Routing (pci_irq.c) */
93 92
94int acpi_pci_irq_add_prt(acpi_handle handle, int segment, int bus); 93int acpi_pci_irq_add_prt(acpi_handle handle, struct pci_bus *bus);
95void acpi_pci_irq_del_prt(int segment, int bus); 94void acpi_pci_irq_del_prt(struct pci_bus *bus);
96 95
97/* ACPI PCI Device Binding (pci_bind.c) */ 96/* ACPI PCI Device Binding (pci_bind.c) */
98 97
99struct pci_bus; 98struct pci_bus;
100 99
101acpi_status acpi_get_pci_id(acpi_handle handle, struct acpi_pci_id *id); 100struct pci_dev *acpi_get_pci_dev(acpi_handle);
102int acpi_pci_bind(struct acpi_device *device); 101int acpi_pci_bind_root(struct acpi_device *device);
103int acpi_pci_bind_root(struct acpi_device *device, struct acpi_pci_id *id,
104 struct pci_bus *bus);
105 102
106/* Arch-defined function to add a bus to the system */ 103/* Arch-defined function to add a bus to the system */
107 104
diff --git a/include/acpi/processor.h b/include/acpi/processor.h
index 4927c063347c..baf1e0a9a7ee 100644
--- a/include/acpi/processor.h
+++ b/include/acpi/processor.h
@@ -258,6 +258,7 @@ DECLARE_PER_CPU(struct acpi_processor *, processors);
258extern struct acpi_processor_errata errata; 258extern struct acpi_processor_errata errata;
259 259
260void arch_acpi_processor_init_pdc(struct acpi_processor *pr); 260void arch_acpi_processor_init_pdc(struct acpi_processor *pr);
261void arch_acpi_processor_cleanup_pdc(struct acpi_processor *pr);
261 262
262#ifdef ARCH_HAS_POWER_INIT 263#ifdef ARCH_HAS_POWER_INIT
263void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags, 264void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags,
diff --git a/include/acpi/video.h b/include/acpi/video.h
index af6fe95fd3d0..cf7be3dd157b 100644
--- a/include/acpi/video.h
+++ b/include/acpi/video.h
@@ -3,10 +3,10 @@
3 3
4#if (defined CONFIG_ACPI_VIDEO || defined CONFIG_ACPI_VIDEO_MODULE) 4#if (defined CONFIG_ACPI_VIDEO || defined CONFIG_ACPI_VIDEO_MODULE)
5extern int acpi_video_register(void); 5extern int acpi_video_register(void);
6extern int acpi_video_exit(void); 6extern void acpi_video_unregister(void);
7#else 7#else
8static inline int acpi_video_register(void) { return 0; } 8static inline int acpi_video_register(void) { return 0; }
9static inline void acpi_video_exit(void) { return; } 9static inline void acpi_video_unregister(void) { return; }
10#endif 10#endif
11 11
12#endif 12#endif
diff --git a/include/asm-generic/hardirq.h b/include/asm-generic/hardirq.h
index 3d5d2c906ab3..23bb4dad4962 100644
--- a/include/asm-generic/hardirq.h
+++ b/include/asm-generic/hardirq.h
@@ -11,19 +11,6 @@ typedef struct {
11 11
12#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */ 12#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
13 13
14#ifndef HARDIRQ_BITS
15#define HARDIRQ_BITS 8
16#endif
17
18/*
19 * The hardirq mask has to be large enough to have
20 * space for potentially all IRQ sources in the system
21 * nesting on a single CPU:
22 */
23#if (1 << HARDIRQ_BITS) < NR_IRQS
24# error HARDIRQ_BITS is too low!
25#endif
26
27#ifndef ack_bad_irq 14#ifndef ack_bad_irq
28static inline void ack_bad_irq(unsigned int irq) 15static inline void ack_bad_irq(unsigned int irq)
29{ 16{
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
index e410f602cab1..e2bd73e8f9c0 100644
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -129,6 +129,10 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addres
129#define move_pte(pte, prot, old_addr, new_addr) (pte) 129#define move_pte(pte, prot, old_addr, new_addr) (pte)
130#endif 130#endif
131 131
132#ifndef pgprot_noncached
133#define pgprot_noncached(prot) (prot)
134#endif
135
132#ifndef pgprot_writecombine 136#ifndef pgprot_writecombine
133#define pgprot_writecombine pgprot_noncached 137#define pgprot_writecombine pgprot_noncached
134#endif 138#endif
diff --git a/include/asm-generic/uaccess.h b/include/asm-generic/uaccess.h
index 6d8cab22e294..b218b8513d04 100644
--- a/include/asm-generic/uaccess.h
+++ b/include/asm-generic/uaccess.h
@@ -163,7 +163,7 @@ static inline __must_check long __copy_to_user(void __user *to,
163#define put_user(x, ptr) \ 163#define put_user(x, ptr) \
164({ \ 164({ \
165 might_sleep(); \ 165 might_sleep(); \
166 __access_ok(ptr, sizeof (*ptr)) ? \ 166 access_ok(VERIFY_WRITE, ptr, sizeof(*ptr)) ? \
167 __put_user(x, ptr) : \ 167 __put_user(x, ptr) : \
168 -EFAULT; \ 168 -EFAULT; \
169}) 169})
@@ -219,7 +219,7 @@ extern int __put_user_bad(void) __attribute__((noreturn));
219#define get_user(x, ptr) \ 219#define get_user(x, ptr) \
220({ \ 220({ \
221 might_sleep(); \ 221 might_sleep(); \
222 __access_ok(ptr, sizeof (*ptr)) ? \ 222 access_ok(VERIFY_READ, ptr, sizeof(*ptr)) ? \
223 __get_user(x, ptr) : \ 223 __get_user(x, ptr) : \
224 -EFAULT; \ 224 -EFAULT; \
225}) 225})
@@ -244,7 +244,7 @@ static inline long copy_from_user(void *to,
244 const void __user * from, unsigned long n) 244 const void __user * from, unsigned long n)
245{ 245{
246 might_sleep(); 246 might_sleep();
247 if (__access_ok(from, n)) 247 if (access_ok(VERIFY_READ, from, n))
248 return __copy_from_user(to, from, n); 248 return __copy_from_user(to, from, n);
249 else 249 else
250 return n; 250 return n;
@@ -254,7 +254,7 @@ static inline long copy_to_user(void __user *to,
254 const void *from, unsigned long n) 254 const void *from, unsigned long n)
255{ 255{
256 might_sleep(); 256 might_sleep();
257 if (__access_ok(to, n)) 257 if (access_ok(VERIFY_WRITE, to, n))
258 return __copy_to_user(to, from, n); 258 return __copy_to_user(to, from, n);
259 else 259 else
260 return n; 260 return n;
@@ -278,7 +278,7 @@ __strncpy_from_user(char *dst, const char __user *src, long count)
278static inline long 278static inline long
279strncpy_from_user(char *dst, const char __user *src, long count) 279strncpy_from_user(char *dst, const char __user *src, long count)
280{ 280{
281 if (!__access_ok(src, 1)) 281 if (!access_ok(VERIFY_READ, src, 1))
282 return -EFAULT; 282 return -EFAULT;
283 return __strncpy_from_user(dst, src, count); 283 return __strncpy_from_user(dst, src, count);
284} 284}
@@ -291,6 +291,8 @@ strncpy_from_user(char *dst, const char __user *src, long count)
291#ifndef strnlen_user 291#ifndef strnlen_user
292static inline long strnlen_user(const char __user *src, long n) 292static inline long strnlen_user(const char __user *src, long n)
293{ 293{
294 if (!access_ok(VERIFY_READ, src, 1))
295 return 0;
294 return strlen((void * __force)src) + 1; 296 return strlen((void * __force)src) + 1;
295} 297}
296#endif 298#endif
@@ -316,7 +318,7 @@ static inline __must_check unsigned long
316clear_user(void __user *to, unsigned long n) 318clear_user(void __user *to, unsigned long n)
317{ 319{
318 might_sleep(); 320 might_sleep();
319 if (!__access_ok(to, n)) 321 if (!access_ok(VERIFY_WRITE, to, n))
320 return n; 322 return n;
321 323
322 return __clear_user(to, n); 324 return __clear_user(to, n);
diff --git a/include/asm-generic/unistd.h b/include/asm-generic/unistd.h
index 5b34b6233d6d..1125e5a1ee5d 100644
--- a/include/asm-generic/unistd.h
+++ b/include/asm-generic/unistd.h
@@ -618,8 +618,13 @@ __SYSCALL(__NR_migrate_pages, sys_migrate_pages)
618__SYSCALL(__NR_move_pages, sys_move_pages) 618__SYSCALL(__NR_move_pages, sys_move_pages)
619#endif 619#endif
620 620
621#define __NR_rt_tgsigqueueinfo 240
622__SYSCALL(__NR_rt_tgsigqueueinfo, sys_rt_tgsigqueueinfo)
623#define __NR_perf_counter_open 241
624__SYSCALL(__NR_perf_counter_open, sys_perf_counter_open)
625
621#undef __NR_syscalls 626#undef __NR_syscalls
622#define __NR_syscalls 240 627#define __NR_syscalls 242
623 628
624/* 629/*
625 * All syscalls below here should go away really, 630 * All syscalls below here should go away really,
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 55413e568f07..92b73b6140ff 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -625,7 +625,7 @@
625 *(.init.ramfs) \ 625 *(.init.ramfs) \
626 VMLINUX_SYMBOL(__initramfs_end) = .; 626 VMLINUX_SYMBOL(__initramfs_end) = .;
627#else 627#else
628#define INITRAMFS 628#define INIT_RAM_FS
629#endif 629#endif
630 630
631/** 631/**
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 51b4b0a5ce8c..34321cfffeab 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -113,9 +113,6 @@ void acpi_irq_stats_init(void);
113extern u32 acpi_irq_handled; 113extern u32 acpi_irq_handled;
114extern u32 acpi_irq_not_handled; 114extern u32 acpi_irq_not_handled;
115 115
116extern struct acpi_mcfg_allocation *pci_mmcfg_config;
117extern int pci_mmcfg_config_num;
118
119extern int sbf_port; 116extern int sbf_port;
120extern unsigned long acpi_realmode_flags; 117extern unsigned long acpi_realmode_flags;
121 118
@@ -293,7 +290,10 @@ void __init acpi_s4_no_nvs(void);
293 OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL) 290 OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL)
294 291
295extern acpi_status acpi_pci_osc_control_set(acpi_handle handle, u32 flags); 292extern acpi_status acpi_pci_osc_control_set(acpi_handle handle, u32 flags);
293extern void acpi_early_init(void);
294
296#else /* CONFIG_ACPI */ 295#else /* CONFIG_ACPI */
296static inline void acpi_early_init(void) { }
297 297
298static inline int early_acpi_boot_init(void) 298static inline int early_acpi_boot_init(void)
299{ 299{
diff --git a/include/linux/audit.h b/include/linux/audit.h
index 4fa2810b675e..3c7a358241a7 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -599,6 +599,8 @@ extern void audit_log_untrustedstring(struct audit_buffer *ab,
599extern void audit_log_d_path(struct audit_buffer *ab, 599extern void audit_log_d_path(struct audit_buffer *ab,
600 const char *prefix, 600 const char *prefix,
601 struct path *path); 601 struct path *path);
602extern void audit_log_key(struct audit_buffer *ab,
603 char *key);
602extern void audit_log_lost(const char *message); 604extern void audit_log_lost(const char *message);
603extern int audit_update_lsm_rules(void); 605extern int audit_update_lsm_rules(void);
604 606
@@ -621,6 +623,7 @@ extern int audit_enabled;
621#define audit_log_n_untrustedstring(a,n,s) do { ; } while (0) 623#define audit_log_n_untrustedstring(a,n,s) do { ; } while (0)
622#define audit_log_untrustedstring(a,s) do { ; } while (0) 624#define audit_log_untrustedstring(a,s) do { ; } while (0)
623#define audit_log_d_path(b, p, d) do { ; } while (0) 625#define audit_log_d_path(b, p, d) do { ; } while (0)
626#define audit_log_key(b, k) do { ; } while (0)
624#define audit_enabled 0 627#define audit_enabled 0
625#endif 628#endif
626#endif 629#endif
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index 2643d848df90..4d668e05d458 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -69,7 +69,6 @@ static inline void unregister_cpu_notifier(struct notifier_block *nb)
69 69
70int cpu_up(unsigned int cpu); 70int cpu_up(unsigned int cpu);
71void notify_cpu_starting(unsigned int cpu); 71void notify_cpu_starting(unsigned int cpu);
72extern void cpu_hotplug_init(void);
73extern void cpu_maps_update_begin(void); 72extern void cpu_maps_update_begin(void);
74extern void cpu_maps_update_done(void); 73extern void cpu_maps_update_done(void);
75 74
@@ -84,10 +83,6 @@ static inline void unregister_cpu_notifier(struct notifier_block *nb)
84{ 83{
85} 84}
86 85
87static inline void cpu_hotplug_init(void)
88{
89}
90
91static inline void cpu_maps_update_begin(void) 86static inline void cpu_maps_update_begin(void)
92{ 87{
93} 88}
diff --git a/include/linux/dma_remapping.h b/include/linux/dma_remapping.h
index 1a455f1f86d7..5619f8522738 100644
--- a/include/linux/dma_remapping.h
+++ b/include/linux/dma_remapping.h
@@ -13,6 +13,10 @@
13#define DMA_PTE_WRITE (2) 13#define DMA_PTE_WRITE (2)
14#define DMA_PTE_SNP (1 << 11) 14#define DMA_PTE_SNP (1 << 11)
15 15
16#define CONTEXT_TT_MULTI_LEVEL 0
17#define CONTEXT_TT_DEV_IOTLB 1
18#define CONTEXT_TT_PASS_THROUGH 2
19
16struct intel_iommu; 20struct intel_iommu;
17struct dmar_domain; 21struct dmar_domain;
18struct root_entry; 22struct root_entry;
@@ -21,11 +25,16 @@ extern void free_dmar_iommu(struct intel_iommu *iommu);
21 25
22#ifdef CONFIG_DMAR 26#ifdef CONFIG_DMAR
23extern int iommu_calculate_agaw(struct intel_iommu *iommu); 27extern int iommu_calculate_agaw(struct intel_iommu *iommu);
28extern int iommu_calculate_max_sagaw(struct intel_iommu *iommu);
24#else 29#else
25static inline int iommu_calculate_agaw(struct intel_iommu *iommu) 30static inline int iommu_calculate_agaw(struct intel_iommu *iommu)
26{ 31{
27 return 0; 32 return 0;
28} 33}
34static inline int iommu_calculate_max_sagaw(struct intel_iommu *iommu)
35{
36 return 0;
37}
29#endif 38#endif
30 39
31extern int dmar_disabled; 40extern int dmar_disabled;
diff --git a/include/linux/dmar.h b/include/linux/dmar.h
index 10ff5c498824..4a2b162c256a 100644
--- a/include/linux/dmar.h
+++ b/include/linux/dmar.h
@@ -126,6 +126,8 @@ extern int free_irte(int irq);
126extern int irq_remapped(int irq); 126extern int irq_remapped(int irq);
127extern struct intel_iommu *map_dev_to_ir(struct pci_dev *dev); 127extern struct intel_iommu *map_dev_to_ir(struct pci_dev *dev);
128extern struct intel_iommu *map_ioapic_to_ir(int apic); 128extern struct intel_iommu *map_ioapic_to_ir(int apic);
129extern int set_ioapic_sid(struct irte *irte, int apic);
130extern int set_msi_sid(struct irte *irte, struct pci_dev *dev);
129#else 131#else
130static inline int alloc_irte(struct intel_iommu *iommu, int irq, u16 count) 132static inline int alloc_irte(struct intel_iommu *iommu, int irq, u16 count)
131{ 133{
@@ -156,6 +158,15 @@ static inline struct intel_iommu *map_ioapic_to_ir(int apic)
156{ 158{
157 return NULL; 159 return NULL;
158} 160}
161static inline int set_ioapic_sid(struct irte *irte, int apic)
162{
163 return 0;
164}
165static inline int set_msi_sid(struct irte *irte, struct pci_dev *dev)
166{
167 return 0;
168}
169
159#define irq_remapped(irq) (0) 170#define irq_remapped(irq) (0)
160#define enable_intr_remapping(mode) (-1) 171#define enable_intr_remapping(mode) (-1)
161#define disable_intr_remapping() (0) 172#define disable_intr_remapping() (0)
@@ -188,6 +199,15 @@ struct dmar_rmrr_unit {
188 199
189#define for_each_rmrr_units(rmrr) \ 200#define for_each_rmrr_units(rmrr) \
190 list_for_each_entry(rmrr, &dmar_rmrr_units, list) 201 list_for_each_entry(rmrr, &dmar_rmrr_units, list)
202
203struct dmar_atsr_unit {
204 struct list_head list; /* list of ATSR units */
205 struct acpi_dmar_header *hdr; /* ACPI header */
206 struct pci_dev **devices; /* target devices */
207 int devices_cnt; /* target device count */
208 u8 include_all:1; /* include all ports */
209};
210
191/* Intel DMAR initialization functions */ 211/* Intel DMAR initialization functions */
192extern int intel_iommu_init(void); 212extern int intel_iommu_init(void);
193#else 213#else
diff --git a/include/linux/ext3_fs_i.h b/include/linux/ext3_fs_i.h
index 7894dd0f3b77..ca1bfe90004f 100644
--- a/include/linux/ext3_fs_i.h
+++ b/include/linux/ext3_fs_i.h
@@ -103,10 +103,6 @@ struct ext3_inode_info {
103 */ 103 */
104 struct rw_semaphore xattr_sem; 104 struct rw_semaphore xattr_sem;
105#endif 105#endif
106#ifdef CONFIG_EXT3_FS_POSIX_ACL
107 struct posix_acl *i_acl;
108 struct posix_acl *i_default_acl;
109#endif
110 106
111 struct list_head i_orphan; /* unlinked but open inodes */ 107 struct list_head i_orphan; /* unlinked but open inodes */
112 108
diff --git a/include/linux/falloc.h b/include/linux/falloc.h
index 8e912ab6a072..3c155107d61f 100644
--- a/include/linux/falloc.h
+++ b/include/linux/falloc.h
@@ -3,4 +3,25 @@
3 3
4#define FALLOC_FL_KEEP_SIZE 0x01 /* default is extend size */ 4#define FALLOC_FL_KEEP_SIZE 0x01 /* default is extend size */
5 5
6#ifdef __KERNEL__
7
8/*
9 * Space reservation ioctls and argument structure
10 * are designed to be compatible with the legacy XFS ioctls.
11 */
12struct space_resv {
13 __s16 l_type;
14 __s16 l_whence;
15 __s64 l_start;
16 __s64 l_len; /* len == 0 means until end of file */
17 __s32 l_sysid;
18 __u32 l_pid;
19 __s32 l_pad[4]; /* reserved area */
20};
21
22#define FS_IOC_RESVSP _IOW('X', 40, struct space_resv)
23#define FS_IOC_RESVSP64 _IOW('X', 42, struct space_resv)
24
25#endif /* __KERNEL__ */
26
6#endif /* _FALLOC_H_ */ 27#endif /* _FALLOC_H_ */
diff --git a/include/linux/firewire.h b/include/linux/firewire.h
index e584b7215e8b..9823946adbc5 100644
--- a/include/linux/firewire.h
+++ b/include/linux/firewire.h
@@ -3,6 +3,7 @@
3 3
4#include <linux/completion.h> 4#include <linux/completion.h>
5#include <linux/device.h> 5#include <linux/device.h>
6#include <linux/dma-mapping.h>
6#include <linux/kernel.h> 7#include <linux/kernel.h>
7#include <linux/kref.h> 8#include <linux/kref.h>
8#include <linux/list.h> 9#include <linux/list.h>
@@ -355,4 +356,90 @@ int fw_run_transaction(struct fw_card *card, int tcode, int destination_id,
355 int generation, int speed, unsigned long long offset, 356 int generation, int speed, unsigned long long offset,
356 void *payload, size_t length); 357 void *payload, size_t length);
357 358
359static inline int fw_stream_packet_destination_id(int tag, int channel, int sy)
360{
361 return tag << 14 | channel << 8 | sy;
362}
363
364struct fw_descriptor {
365 struct list_head link;
366 size_t length;
367 u32 immediate;
368 u32 key;
369 const u32 *data;
370};
371
372int fw_core_add_descriptor(struct fw_descriptor *desc);
373void fw_core_remove_descriptor(struct fw_descriptor *desc);
374
375/*
376 * The iso packet format allows for an immediate header/payload part
377 * stored in 'header' immediately after the packet info plus an
378 * indirect payload part that is pointer to by the 'payload' field.
379 * Applications can use one or the other or both to implement simple
380 * low-bandwidth streaming (e.g. audio) or more advanced
381 * scatter-gather streaming (e.g. assembling video frame automatically).
382 */
383struct fw_iso_packet {
384 u16 payload_length; /* Length of indirect payload. */
385 u32 interrupt:1; /* Generate interrupt on this packet */
386 u32 skip:1; /* Set to not send packet at all. */
387 u32 tag:2;
388 u32 sy:4;
389 u32 header_length:8; /* Length of immediate header. */
390 u32 header[0];
391};
392
393#define FW_ISO_CONTEXT_TRANSMIT 0
394#define FW_ISO_CONTEXT_RECEIVE 1
395
396#define FW_ISO_CONTEXT_MATCH_TAG0 1
397#define FW_ISO_CONTEXT_MATCH_TAG1 2
398#define FW_ISO_CONTEXT_MATCH_TAG2 4
399#define FW_ISO_CONTEXT_MATCH_TAG3 8
400#define FW_ISO_CONTEXT_MATCH_ALL_TAGS 15
401
402/*
403 * An iso buffer is just a set of pages mapped for DMA in the
404 * specified direction. Since the pages are to be used for DMA, they
405 * are not mapped into the kernel virtual address space. We store the
406 * DMA address in the page private. The helper function
407 * fw_iso_buffer_map() will map the pages into a given vma.
408 */
409struct fw_iso_buffer {
410 enum dma_data_direction direction;
411 struct page **pages;
412 int page_count;
413};
414
415int fw_iso_buffer_init(struct fw_iso_buffer *buffer, struct fw_card *card,
416 int page_count, enum dma_data_direction direction);
417void fw_iso_buffer_destroy(struct fw_iso_buffer *buffer, struct fw_card *card);
418
419struct fw_iso_context;
420typedef void (*fw_iso_callback_t)(struct fw_iso_context *context,
421 u32 cycle, size_t header_length,
422 void *header, void *data);
423struct fw_iso_context {
424 struct fw_card *card;
425 int type;
426 int channel;
427 int speed;
428 size_t header_size;
429 fw_iso_callback_t callback;
430 void *callback_data;
431};
432
433struct fw_iso_context *fw_iso_context_create(struct fw_card *card,
434 int type, int channel, int speed, size_t header_size,
435 fw_iso_callback_t callback, void *callback_data);
436int fw_iso_context_queue(struct fw_iso_context *ctx,
437 struct fw_iso_packet *packet,
438 struct fw_iso_buffer *buffer,
439 unsigned long payload);
440int fw_iso_context_start(struct fw_iso_context *ctx,
441 int cycle, int sync, int tags);
442int fw_iso_context_stop(struct fw_iso_context *ctx);
443void fw_iso_context_destroy(struct fw_iso_context *ctx);
444
358#endif /* _LINUX_FIREWIRE_H */ 445#endif /* _LINUX_FIREWIRE_H */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 74a57938c880..0872372184fe 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -710,6 +710,9 @@ static inline int mapping_writably_mapped(struct address_space *mapping)
710#define i_size_ordered_init(inode) do { } while (0) 710#define i_size_ordered_init(inode) do { } while (0)
711#endif 711#endif
712 712
713struct posix_acl;
714#define ACL_NOT_CACHED ((void *)(-1))
715
713struct inode { 716struct inode {
714 struct hlist_node i_hash; 717 struct hlist_node i_hash;
715 struct list_head i_list; 718 struct list_head i_list;
@@ -773,6 +776,10 @@ struct inode {
773#ifdef CONFIG_SECURITY 776#ifdef CONFIG_SECURITY
774 void *i_security; 777 void *i_security;
775#endif 778#endif
779#ifdef CONFIG_FS_POSIX_ACL
780 struct posix_acl *i_acl;
781 struct posix_acl *i_default_acl;
782#endif
776 void *i_private; /* fs or device private pointer */ 783 void *i_private; /* fs or device private pointer */
777}; 784};
778 785
@@ -1107,6 +1114,7 @@ extern void locks_copy_lock(struct file_lock *, struct file_lock *);
1107extern void __locks_copy_lock(struct file_lock *, const struct file_lock *); 1114extern void __locks_copy_lock(struct file_lock *, const struct file_lock *);
1108extern void locks_remove_posix(struct file *, fl_owner_t); 1115extern void locks_remove_posix(struct file *, fl_owner_t);
1109extern void locks_remove_flock(struct file *); 1116extern void locks_remove_flock(struct file *);
1117extern void locks_release_private(struct file_lock *);
1110extern void posix_test_lock(struct file *, struct file_lock *); 1118extern void posix_test_lock(struct file *, struct file_lock *);
1111extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *); 1119extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *);
1112extern int posix_lock_file_wait(struct file *, struct file_lock *); 1120extern int posix_lock_file_wait(struct file *, struct file_lock *);
@@ -1905,6 +1913,8 @@ static inline int break_lease(struct inode *inode, unsigned int mode)
1905 1913
1906extern int do_truncate(struct dentry *, loff_t start, unsigned int time_attrs, 1914extern int do_truncate(struct dentry *, loff_t start, unsigned int time_attrs,
1907 struct file *filp); 1915 struct file *filp);
1916extern int do_fallocate(struct file *file, int mode, loff_t offset,
1917 loff_t len);
1908extern long do_sys_open(int dfd, const char __user *filename, int flags, 1918extern long do_sys_open(int dfd, const char __user *filename, int flags,
1909 int mode); 1919 int mode);
1910extern struct file *filp_open(const char *, int, int); 1920extern struct file *filp_open(const char *, int, int);
@@ -1913,6 +1923,10 @@ extern struct file * dentry_open(struct dentry *, struct vfsmount *, int,
1913extern int filp_close(struct file *, fl_owner_t id); 1923extern int filp_close(struct file *, fl_owner_t id);
1914extern char * getname(const char __user *); 1924extern char * getname(const char __user *);
1915 1925
1926/* fs/ioctl.c */
1927
1928extern int ioctl_preallocate(struct file *filp, void __user *argp);
1929
1916/* fs/dcache.c */ 1930/* fs/dcache.c */
1917extern void __init vfs_caches_init_early(void); 1931extern void __init vfs_caches_init_early(void);
1918extern void __init vfs_caches_init(unsigned long); 1932extern void __init vfs_caches_init(unsigned long);
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index a05a5ef33391..2723513a5651 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -33,7 +33,7 @@ void hugetlb_report_meminfo(struct seq_file *);
33int hugetlb_report_node_meminfo(int, char *); 33int hugetlb_report_node_meminfo(int, char *);
34unsigned long hugetlb_total_pages(void); 34unsigned long hugetlb_total_pages(void);
35int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, 35int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
36 unsigned long address, int write_access); 36 unsigned long address, unsigned int flags);
37int hugetlb_reserve_pages(struct inode *inode, long from, long to, 37int hugetlb_reserve_pages(struct inode *inode, long from, long to,
38 struct vm_area_struct *vma, 38 struct vm_area_struct *vma,
39 int acctflags); 39 int acctflags);
@@ -98,7 +98,7 @@ static inline void hugetlb_report_meminfo(struct seq_file *m)
98#define pud_huge(x) 0 98#define pud_huge(x) 0
99#define is_hugepage_only_range(mm, addr, len) 0 99#define is_hugepage_only_range(mm, addr, len) 0
100#define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; }) 100#define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; })
101#define hugetlb_fault(mm, vma, addr, write) ({ BUG(); 0; }) 101#define hugetlb_fault(mm, vma, addr, flags) ({ BUG(); 0; })
102 102
103#define hugetlb_change_protection(vma, address, end, newprot) 103#define hugetlb_change_protection(vma, address, end, newprot)
104 104
diff --git a/include/linux/icmpv6.h b/include/linux/icmpv6.h
index 10d701eec484..b6a85183c333 100644
--- a/include/linux/icmpv6.h
+++ b/include/linux/icmpv6.h
@@ -175,16 +175,16 @@ struct icmp6_filter {
175 175
176 176
177extern void icmpv6_send(struct sk_buff *skb, 177extern void icmpv6_send(struct sk_buff *skb,
178 int type, int code, 178 u8 type, u8 code,
179 __u32 info, 179 __u32 info,
180 struct net_device *dev); 180 struct net_device *dev);
181 181
182extern int icmpv6_init(void); 182extern int icmpv6_init(void);
183extern int icmpv6_err_convert(int type, int code, 183extern int icmpv6_err_convert(u8 type, u8 code,
184 int *err); 184 int *err);
185extern void icmpv6_cleanup(void); 185extern void icmpv6_cleanup(void);
186extern void icmpv6_param_prob(struct sk_buff *skb, 186extern void icmpv6_param_prob(struct sk_buff *skb,
187 int code, int pos); 187 u8 code, int pos);
188 188
189struct flowi; 189struct flowi;
190struct in6_addr; 190struct in6_addr;
diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h
index aa8c53171233..482dc91fd53a 100644
--- a/include/linux/intel-iommu.h
+++ b/include/linux/intel-iommu.h
@@ -53,6 +53,7 @@
53#define DMAR_PHMLIMIT_REG 0x78 /* pmrr high limit */ 53#define DMAR_PHMLIMIT_REG 0x78 /* pmrr high limit */
54#define DMAR_IQH_REG 0x80 /* Invalidation queue head register */ 54#define DMAR_IQH_REG 0x80 /* Invalidation queue head register */
55#define DMAR_IQT_REG 0x88 /* Invalidation queue tail register */ 55#define DMAR_IQT_REG 0x88 /* Invalidation queue tail register */
56#define DMAR_IQ_SHIFT 4 /* Invalidation queue head/tail shift */
56#define DMAR_IQA_REG 0x90 /* Invalidation queue addr register */ 57#define DMAR_IQA_REG 0x90 /* Invalidation queue addr register */
57#define DMAR_ICS_REG 0x98 /* Invalidation complete status register */ 58#define DMAR_ICS_REG 0x98 /* Invalidation complete status register */
58#define DMAR_IRTA_REG 0xb8 /* Interrupt remapping table addr register */ 59#define DMAR_IRTA_REG 0xb8 /* Interrupt remapping table addr register */
@@ -120,8 +121,10 @@ static inline void dmar_writeq(void __iomem *addr, u64 val)
120 (ecap_iotlb_offset(e) + ecap_niotlb_iunits(e) * 16) 121 (ecap_iotlb_offset(e) + ecap_niotlb_iunits(e) * 16)
121#define ecap_coherent(e) ((e) & 0x1) 122#define ecap_coherent(e) ((e) & 0x1)
122#define ecap_qis(e) ((e) & 0x2) 123#define ecap_qis(e) ((e) & 0x2)
124#define ecap_pass_through(e) ((e >> 6) & 0x1)
123#define ecap_eim_support(e) ((e >> 4) & 0x1) 125#define ecap_eim_support(e) ((e >> 4) & 0x1)
124#define ecap_ir_support(e) ((e >> 3) & 0x1) 126#define ecap_ir_support(e) ((e >> 3) & 0x1)
127#define ecap_dev_iotlb_support(e) (((e) >> 2) & 0x1)
125#define ecap_max_handle_mask(e) ((e >> 20) & 0xf) 128#define ecap_max_handle_mask(e) ((e >> 20) & 0xf)
126#define ecap_sc_support(e) ((e >> 7) & 0x1) /* Snooping Control */ 129#define ecap_sc_support(e) ((e >> 7) & 0x1) /* Snooping Control */
127 130
@@ -197,6 +200,8 @@ static inline void dmar_writeq(void __iomem *addr, u64 val)
197#define DMA_FSTS_PPF ((u32)2) 200#define DMA_FSTS_PPF ((u32)2)
198#define DMA_FSTS_PFO ((u32)1) 201#define DMA_FSTS_PFO ((u32)1)
199#define DMA_FSTS_IQE (1 << 4) 202#define DMA_FSTS_IQE (1 << 4)
203#define DMA_FSTS_ICE (1 << 5)
204#define DMA_FSTS_ITE (1 << 6)
200#define dma_fsts_fault_record_index(s) (((s) >> 8) & 0xff) 205#define dma_fsts_fault_record_index(s) (((s) >> 8) & 0xff)
201 206
202/* FRCD_REG, 32 bits access */ 207/* FRCD_REG, 32 bits access */
@@ -225,7 +230,8 @@ do { \
225enum { 230enum {
226 QI_FREE, 231 QI_FREE,
227 QI_IN_USE, 232 QI_IN_USE,
228 QI_DONE 233 QI_DONE,
234 QI_ABORT
229}; 235};
230 236
231#define QI_CC_TYPE 0x1 237#define QI_CC_TYPE 0x1
@@ -254,6 +260,12 @@ enum {
254#define QI_CC_DID(did) (((u64)did) << 16) 260#define QI_CC_DID(did) (((u64)did) << 16)
255#define QI_CC_GRAN(gran) (((u64)gran) >> (DMA_CCMD_INVL_GRANU_OFFSET-4)) 261#define QI_CC_GRAN(gran) (((u64)gran) >> (DMA_CCMD_INVL_GRANU_OFFSET-4))
256 262
263#define QI_DEV_IOTLB_SID(sid) ((u64)((sid) & 0xffff) << 32)
264#define QI_DEV_IOTLB_QDEP(qdep) (((qdep) & 0x1f) << 16)
265#define QI_DEV_IOTLB_ADDR(addr) ((u64)(addr) & VTD_PAGE_MASK)
266#define QI_DEV_IOTLB_SIZE 1
267#define QI_DEV_IOTLB_MAX_INVS 32
268
257struct qi_desc { 269struct qi_desc {
258 u64 low, high; 270 u64 low, high;
259}; 271};
@@ -280,10 +292,10 @@ struct ir_table {
280#endif 292#endif
281 293
282struct iommu_flush { 294struct iommu_flush {
283 int (*flush_context)(struct intel_iommu *iommu, u16 did, u16 sid, u8 fm, 295 void (*flush_context)(struct intel_iommu *iommu, u16 did, u16 sid,
284 u64 type, int non_present_entry_flush); 296 u8 fm, u64 type);
285 int (*flush_iotlb)(struct intel_iommu *iommu, u16 did, u64 addr, 297 void (*flush_iotlb)(struct intel_iommu *iommu, u16 did, u64 addr,
286 unsigned int size_order, u64 type, int non_present_entry_flush); 298 unsigned int size_order, u64 type);
287}; 299};
288 300
289enum { 301enum {
@@ -302,6 +314,7 @@ struct intel_iommu {
302 spinlock_t register_lock; /* protect register handling */ 314 spinlock_t register_lock; /* protect register handling */
303 int seq_id; /* sequence id of the iommu */ 315 int seq_id; /* sequence id of the iommu */
304 int agaw; /* agaw of this iommu */ 316 int agaw; /* agaw of this iommu */
317 int msagaw; /* max sagaw of this iommu */
305 unsigned int irq; 318 unsigned int irq;
306 unsigned char name[13]; /* Device Name */ 319 unsigned char name[13]; /* Device Name */
307 320
@@ -329,6 +342,7 @@ static inline void __iommu_flush_cache(
329} 342}
330 343
331extern struct dmar_drhd_unit * dmar_find_matched_drhd_unit(struct pci_dev *dev); 344extern struct dmar_drhd_unit * dmar_find_matched_drhd_unit(struct pci_dev *dev);
345extern int dmar_find_matched_atsr_unit(struct pci_dev *dev);
332 346
333extern int alloc_iommu(struct dmar_drhd_unit *drhd); 347extern int alloc_iommu(struct dmar_drhd_unit *drhd);
334extern void free_iommu(struct intel_iommu *iommu); 348extern void free_iommu(struct intel_iommu *iommu);
@@ -337,11 +351,12 @@ extern void dmar_disable_qi(struct intel_iommu *iommu);
337extern int dmar_reenable_qi(struct intel_iommu *iommu); 351extern int dmar_reenable_qi(struct intel_iommu *iommu);
338extern void qi_global_iec(struct intel_iommu *iommu); 352extern void qi_global_iec(struct intel_iommu *iommu);
339 353
340extern int qi_flush_context(struct intel_iommu *iommu, u16 did, u16 sid, 354extern void qi_flush_context(struct intel_iommu *iommu, u16 did, u16 sid,
341 u8 fm, u64 type, int non_present_entry_flush); 355 u8 fm, u64 type);
342extern int qi_flush_iotlb(struct intel_iommu *iommu, u16 did, u64 addr, 356extern void qi_flush_iotlb(struct intel_iommu *iommu, u16 did, u64 addr,
343 unsigned int size_order, u64 type, 357 unsigned int size_order, u64 type);
344 int non_present_entry_flush); 358extern void qi_flush_dev_iotlb(struct intel_iommu *iommu, u16 sid, u16 qdep,
359 u64 addr, unsigned mask);
345 360
346extern int qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu); 361extern int qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu);
347 362
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index 32e4b2f72294..786e7b8cece9 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -49,6 +49,8 @@ struct resource_list {
49#define IORESOURCE_SIZEALIGN 0x00020000 /* size indicates alignment */ 49#define IORESOURCE_SIZEALIGN 0x00020000 /* size indicates alignment */
50#define IORESOURCE_STARTALIGN 0x00040000 /* start field is alignment */ 50#define IORESOURCE_STARTALIGN 0x00040000 /* start field is alignment */
51 51
52#define IORESOURCE_MEM_64 0x00100000
53
52#define IORESOURCE_EXCLUSIVE 0x08000000 /* Userland may not map this resource */ 54#define IORESOURCE_EXCLUSIVE 0x08000000 /* Userland may not map this resource */
53#define IORESOURCE_DISABLED 0x10000000 55#define IORESOURCE_DISABLED 0x10000000
54#define IORESOURCE_UNSET 0x20000000 56#define IORESOURCE_UNSET 0x20000000
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index 51855dfd8adb..c325b187966b 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
@@ -195,7 +195,7 @@ extern struct svc_procedure nlmsvc_procedures4[];
195extern int nlmsvc_grace_period; 195extern int nlmsvc_grace_period;
196extern unsigned long nlmsvc_timeout; 196extern unsigned long nlmsvc_timeout;
197extern int nsm_use_hostnames; 197extern int nsm_use_hostnames;
198extern int nsm_local_state; 198extern u32 nsm_local_state;
199 199
200/* 200/*
201 * Lockd client functions 201 * Lockd client functions
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
index da5a5a1f4cd2..b25d1b53df0d 100644
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
@@ -258,6 +258,16 @@ extern void lockdep_init_map(struct lockdep_map *lock, const char *name,
258#define lockdep_set_subclass(lock, sub) \ 258#define lockdep_set_subclass(lock, sub) \
259 lockdep_init_map(&(lock)->dep_map, #lock, \ 259 lockdep_init_map(&(lock)->dep_map, #lock, \
260 (lock)->dep_map.key, sub) 260 (lock)->dep_map.key, sub)
261/*
262 * Compare locking classes
263 */
264#define lockdep_match_class(lock, key) lockdep_match_key(&(lock)->dep_map, key)
265
266static inline int lockdep_match_key(struct lockdep_map *lock,
267 struct lock_class_key *key)
268{
269 return lock->key == key;
270}
261 271
262/* 272/*
263 * Acquire a lock. 273 * Acquire a lock.
@@ -326,6 +336,11 @@ static inline void lockdep_on(void)
326#define lockdep_set_class_and_subclass(lock, key, sub) \ 336#define lockdep_set_class_and_subclass(lock, key, sub) \
327 do { (void)(key); } while (0) 337 do { (void)(key); } while (0)
328#define lockdep_set_subclass(lock, sub) do { } while (0) 338#define lockdep_set_subclass(lock, sub) do { } while (0)
339/*
340 * We don't define lockdep_match_class() and lockdep_match_key() for !LOCKDEP
341 * case since the result is not well defined and the caller should rather
342 * #ifdef the call himself.
343 */
329 344
330# define INIT_LOCKDEP 345# define INIT_LOCKDEP
331# define lockdep_reset() do { debug_locks = 1; } while (0) 346# define lockdep_reset() do { debug_locks = 1; } while (0)
diff --git a/include/linux/mnt_namespace.h b/include/linux/mnt_namespace.h
index 3a059298cc19..3beb2592b03f 100644
--- a/include/linux/mnt_namespace.h
+++ b/include/linux/mnt_namespace.h
@@ -24,16 +24,10 @@ struct proc_mounts {
24 24
25struct fs_struct; 25struct fs_struct;
26 26
27extern struct mnt_namespace *create_mnt_ns(struct vfsmount *mnt);
27extern struct mnt_namespace *copy_mnt_ns(unsigned long, struct mnt_namespace *, 28extern struct mnt_namespace *copy_mnt_ns(unsigned long, struct mnt_namespace *,
28 struct fs_struct *); 29 struct fs_struct *);
29extern void __put_mnt_ns(struct mnt_namespace *ns); 30extern void put_mnt_ns(struct mnt_namespace *ns);
30
31static inline void put_mnt_ns(struct mnt_namespace *ns)
32{
33 if (atomic_dec_and_lock(&ns->count, &vfsmount_lock))
34 /* releases vfsmount_lock */
35 __put_mnt_ns(ns);
36}
37 31
38static inline void exit_mnt_ns(struct task_struct *p) 32static inline void exit_mnt_ns(struct task_struct *p)
39{ 33{
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 7efb9be34662..4030ebada49e 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -563,6 +563,7 @@ extern int nand_do_read(struct mtd_info *mtd, loff_t from, size_t len,
563 * @options: Option flags, e.g. 16bit buswidth 563 * @options: Option flags, e.g. 16bit buswidth
564 * @ecclayout: ecc layout info structure 564 * @ecclayout: ecc layout info structure
565 * @part_probe_types: NULL-terminated array of probe types 565 * @part_probe_types: NULL-terminated array of probe types
566 * @set_parts: platform specific function to set partitions
566 * @priv: hardware controller specific settings 567 * @priv: hardware controller specific settings
567 */ 568 */
568struct platform_nand_chip { 569struct platform_nand_chip {
@@ -574,26 +575,41 @@ struct platform_nand_chip {
574 int chip_delay; 575 int chip_delay;
575 unsigned int options; 576 unsigned int options;
576 const char **part_probe_types; 577 const char **part_probe_types;
578 void (*set_parts)(uint64_t size,
579 struct platform_nand_chip *chip);
577 void *priv; 580 void *priv;
578}; 581};
579 582
583/* Keep gcc happy */
584struct platform_device;
585
580/** 586/**
581 * struct platform_nand_ctrl - controller level device structure 587 * struct platform_nand_ctrl - controller level device structure
588 * @probe: platform specific function to probe/setup hardware
589 * @remove: platform specific function to remove/teardown hardware
582 * @hwcontrol: platform specific hardware control structure 590 * @hwcontrol: platform specific hardware control structure
583 * @dev_ready: platform specific function to read ready/busy pin 591 * @dev_ready: platform specific function to read ready/busy pin
584 * @select_chip: platform specific chip select function 592 * @select_chip: platform specific chip select function
585 * @cmd_ctrl: platform specific function for controlling 593 * @cmd_ctrl: platform specific function for controlling
586 * ALE/CLE/nCE. Also used to write command and address 594 * ALE/CLE/nCE. Also used to write command and address
595 * @write_buf: platform specific function for write buffer
596 * @read_buf: platform specific function for read buffer
587 * @priv: private data to transport driver specific settings 597 * @priv: private data to transport driver specific settings
588 * 598 *
589 * All fields are optional and depend on the hardware driver requirements 599 * All fields are optional and depend on the hardware driver requirements
590 */ 600 */
591struct platform_nand_ctrl { 601struct platform_nand_ctrl {
602 int (*probe)(struct platform_device *pdev);
603 void (*remove)(struct platform_device *pdev);
592 void (*hwcontrol)(struct mtd_info *mtd, int cmd); 604 void (*hwcontrol)(struct mtd_info *mtd, int cmd);
593 int (*dev_ready)(struct mtd_info *mtd); 605 int (*dev_ready)(struct mtd_info *mtd);
594 void (*select_chip)(struct mtd_info *mtd, int chip); 606 void (*select_chip)(struct mtd_info *mtd, int chip);
595 void (*cmd_ctrl)(struct mtd_info *mtd, int dat, 607 void (*cmd_ctrl)(struct mtd_info *mtd, int dat,
596 unsigned int ctrl); 608 unsigned int ctrl);
609 void (*write_buf)(struct mtd_info *mtd,
610 const uint8_t *buf, int len);
611 void (*read_buf)(struct mtd_info *mtd,
612 uint8_t *buf, int len);
597 void *priv; 613 void *priv;
598}; 614};
599 615
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h
index 9aa2a9149b58..8ed873374381 100644
--- a/include/linux/mtd/onenand.h
+++ b/include/linux/mtd/onenand.h
@@ -17,6 +17,7 @@
17#include <linux/mtd/onenand_regs.h> 17#include <linux/mtd/onenand_regs.h>
18#include <linux/mtd/bbm.h> 18#include <linux/mtd/bbm.h>
19 19
20#define MAX_DIES 2
20#define MAX_BUFFERRAM 2 21#define MAX_BUFFERRAM 2
21 22
22/* Scan and identify a OneNAND device */ 23/* Scan and identify a OneNAND device */
@@ -51,7 +52,12 @@ struct onenand_bufferram {
51/** 52/**
52 * struct onenand_chip - OneNAND Private Flash Chip Data 53 * struct onenand_chip - OneNAND Private Flash Chip Data
53 * @base: [BOARDSPECIFIC] address to access OneNAND 54 * @base: [BOARDSPECIFIC] address to access OneNAND
55 * @dies: [INTERN][FLEX-ONENAND] number of dies on chip
56 * @boundary: [INTERN][FLEX-ONENAND] Boundary of the dies
57 * @diesize: [INTERN][FLEX-ONENAND] Size of the dies
54 * @chipsize: [INTERN] the size of one chip for multichip arrays 58 * @chipsize: [INTERN] the size of one chip for multichip arrays
59 * FIXME For Flex-OneNAND, chipsize holds maximum possible
60 * device size ie when all blocks are considered MLC
55 * @device_id: [INTERN] device ID 61 * @device_id: [INTERN] device ID
56 * @density_mask: chip density, used for DDP devices 62 * @density_mask: chip density, used for DDP devices
57 * @verstion_id: [INTERN] version ID 63 * @verstion_id: [INTERN] version ID
@@ -68,6 +74,8 @@ struct onenand_bufferram {
68 * @command: [REPLACEABLE] hardware specific function for writing 74 * @command: [REPLACEABLE] hardware specific function for writing
69 * commands to the chip 75 * commands to the chip
70 * @wait: [REPLACEABLE] hardware specific function for wait on ready 76 * @wait: [REPLACEABLE] hardware specific function for wait on ready
77 * @bbt_wait: [REPLACEABLE] hardware specific function for bbt wait on ready
78 * @unlock_all: [REPLACEABLE] hardware specific function for unlock all
71 * @read_bufferram: [REPLACEABLE] hardware specific function for BufferRAM Area 79 * @read_bufferram: [REPLACEABLE] hardware specific function for BufferRAM Area
72 * @write_bufferram: [REPLACEABLE] hardware specific function for BufferRAM Area 80 * @write_bufferram: [REPLACEABLE] hardware specific function for BufferRAM Area
73 * @read_word: [REPLACEABLE] hardware specific function for read 81 * @read_word: [REPLACEABLE] hardware specific function for read
@@ -92,9 +100,13 @@ struct onenand_bufferram {
92 */ 100 */
93struct onenand_chip { 101struct onenand_chip {
94 void __iomem *base; 102 void __iomem *base;
103 unsigned dies;
104 unsigned boundary[MAX_DIES];
105 loff_t diesize[MAX_DIES];
95 unsigned int chipsize; 106 unsigned int chipsize;
96 unsigned int device_id; 107 unsigned int device_id;
97 unsigned int version_id; 108 unsigned int version_id;
109 unsigned int technology;
98 unsigned int density_mask; 110 unsigned int density_mask;
99 unsigned int options; 111 unsigned int options;
100 112
@@ -108,6 +120,8 @@ struct onenand_chip {
108 120
109 int (*command)(struct mtd_info *mtd, int cmd, loff_t address, size_t len); 121 int (*command)(struct mtd_info *mtd, int cmd, loff_t address, size_t len);
110 int (*wait)(struct mtd_info *mtd, int state); 122 int (*wait)(struct mtd_info *mtd, int state);
123 int (*bbt_wait)(struct mtd_info *mtd, int state);
124 void (*unlock_all)(struct mtd_info *mtd);
111 int (*read_bufferram)(struct mtd_info *mtd, int area, 125 int (*read_bufferram)(struct mtd_info *mtd, int area,
112 unsigned char *buffer, int offset, size_t count); 126 unsigned char *buffer, int offset, size_t count);
113 int (*write_bufferram)(struct mtd_info *mtd, int area, 127 int (*write_bufferram)(struct mtd_info *mtd, int area,
@@ -145,6 +159,8 @@ struct onenand_chip {
145#define ONENAND_SET_BUFFERRAM0(this) (this->bufferram_index = 0) 159#define ONENAND_SET_BUFFERRAM0(this) (this->bufferram_index = 0)
146#define ONENAND_SET_BUFFERRAM1(this) (this->bufferram_index = 1) 160#define ONENAND_SET_BUFFERRAM1(this) (this->bufferram_index = 1)
147 161
162#define FLEXONENAND(this) \
163 (this->device_id & DEVICE_IS_FLEXONENAND)
148#define ONENAND_GET_SYS_CFG1(this) \ 164#define ONENAND_GET_SYS_CFG1(this) \
149 (this->read_word(this->base + ONENAND_REG_SYS_CFG1)) 165 (this->read_word(this->base + ONENAND_REG_SYS_CFG1))
150#define ONENAND_SET_SYS_CFG1(v, this) \ 166#define ONENAND_SET_SYS_CFG1(v, this) \
@@ -153,6 +169,9 @@ struct onenand_chip {
153#define ONENAND_IS_DDP(this) \ 169#define ONENAND_IS_DDP(this) \
154 (this->device_id & ONENAND_DEVICE_IS_DDP) 170 (this->device_id & ONENAND_DEVICE_IS_DDP)
155 171
172#define ONENAND_IS_MLC(this) \
173 (this->technology & ONENAND_TECHNOLOGY_IS_MLC)
174
156#ifdef CONFIG_MTD_ONENAND_2X_PROGRAM 175#ifdef CONFIG_MTD_ONENAND_2X_PROGRAM
157#define ONENAND_IS_2PLANE(this) \ 176#define ONENAND_IS_2PLANE(this) \
158 (this->options & ONENAND_HAS_2PLANE) 177 (this->options & ONENAND_HAS_2PLANE)
@@ -169,6 +188,7 @@ struct onenand_chip {
169#define ONENAND_HAS_CONT_LOCK (0x0001) 188#define ONENAND_HAS_CONT_LOCK (0x0001)
170#define ONENAND_HAS_UNLOCK_ALL (0x0002) 189#define ONENAND_HAS_UNLOCK_ALL (0x0002)
171#define ONENAND_HAS_2PLANE (0x0004) 190#define ONENAND_HAS_2PLANE (0x0004)
191#define ONENAND_SKIP_UNLOCK_CHECK (0x0100)
172#define ONENAND_PAGEBUF_ALLOC (0x1000) 192#define ONENAND_PAGEBUF_ALLOC (0x1000)
173#define ONENAND_OOBBUF_ALLOC (0x2000) 193#define ONENAND_OOBBUF_ALLOC (0x2000)
174 194
@@ -176,6 +196,7 @@ struct onenand_chip {
176 * OneNAND Flash Manufacturer ID Codes 196 * OneNAND Flash Manufacturer ID Codes
177 */ 197 */
178#define ONENAND_MFR_SAMSUNG 0xec 198#define ONENAND_MFR_SAMSUNG 0xec
199#define ONENAND_MFR_NUMONYX 0x20
179 200
180/** 201/**
181 * struct onenand_manufacturers - NAND Flash Manufacturer ID Structure 202 * struct onenand_manufacturers - NAND Flash Manufacturer ID Structure
@@ -189,5 +210,8 @@ struct onenand_manufacturers {
189 210
190int onenand_bbt_read_oob(struct mtd_info *mtd, loff_t from, 211int onenand_bbt_read_oob(struct mtd_info *mtd, loff_t from,
191 struct mtd_oob_ops *ops); 212 struct mtd_oob_ops *ops);
213unsigned onenand_block(struct onenand_chip *this, loff_t addr);
214loff_t onenand_addr(struct onenand_chip *this, int block);
215int flexonenand_region(struct mtd_info *mtd, loff_t addr);
192 216
193#endif /* __LINUX_MTD_ONENAND_H */ 217#endif /* __LINUX_MTD_ONENAND_H */
diff --git a/include/linux/mtd/onenand_regs.h b/include/linux/mtd/onenand_regs.h
index 0c6bbe28f38c..86a6bbef6465 100644
--- a/include/linux/mtd/onenand_regs.h
+++ b/include/linux/mtd/onenand_regs.h
@@ -67,6 +67,9 @@
67/* 67/*
68 * Device ID Register F001h (R) 68 * Device ID Register F001h (R)
69 */ 69 */
70#define DEVICE_IS_FLEXONENAND (1 << 9)
71#define FLEXONENAND_PI_MASK (0x3ff)
72#define FLEXONENAND_PI_UNLOCK_SHIFT (14)
70#define ONENAND_DEVICE_DENSITY_MASK (0xf) 73#define ONENAND_DEVICE_DENSITY_MASK (0xf)
71#define ONENAND_DEVICE_DENSITY_SHIFT (4) 74#define ONENAND_DEVICE_DENSITY_SHIFT (4)
72#define ONENAND_DEVICE_IS_DDP (1 << 3) 75#define ONENAND_DEVICE_IS_DDP (1 << 3)
@@ -84,6 +87,11 @@
84#define ONENAND_VERSION_PROCESS_SHIFT (8) 87#define ONENAND_VERSION_PROCESS_SHIFT (8)
85 88
86/* 89/*
90 * Technology Register F006h (R)
91 */
92#define ONENAND_TECHNOLOGY_IS_MLC (1 << 0)
93
94/*
87 * Start Address 1 F100h (R/W) & Start Address 2 F101h (R/W) 95 * Start Address 1 F100h (R/W) & Start Address 2 F101h (R/W)
88 */ 96 */
89#define ONENAND_DDP_SHIFT (15) 97#define ONENAND_DDP_SHIFT (15)
@@ -93,7 +101,8 @@
93/* 101/*
94 * Start Address 8 F107h (R/W) 102 * Start Address 8 F107h (R/W)
95 */ 103 */
96#define ONENAND_FPA_MASK (0x3f) 104/* Note: It's actually 0x3f in case of SLC */
105#define ONENAND_FPA_MASK (0x7f)
97#define ONENAND_FPA_SHIFT (2) 106#define ONENAND_FPA_SHIFT (2)
98#define ONENAND_FSA_MASK (0x03) 107#define ONENAND_FSA_MASK (0x03)
99 108
@@ -105,7 +114,8 @@
105#define ONENAND_BSA_BOOTRAM (0 << 2) 114#define ONENAND_BSA_BOOTRAM (0 << 2)
106#define ONENAND_BSA_DATARAM0 (2 << 2) 115#define ONENAND_BSA_DATARAM0 (2 << 2)
107#define ONENAND_BSA_DATARAM1 (3 << 2) 116#define ONENAND_BSA_DATARAM1 (3 << 2)
108#define ONENAND_BSC_MASK (0x03) 117/* Note: It's actually 0x03 in case of SLC */
118#define ONENAND_BSC_MASK (0x07)
109 119
110/* 120/*
111 * Command Register F220h (R/W) 121 * Command Register F220h (R/W)
@@ -124,9 +134,13 @@
124#define ONENAND_CMD_RESET (0xF0) 134#define ONENAND_CMD_RESET (0xF0)
125#define ONENAND_CMD_OTP_ACCESS (0x65) 135#define ONENAND_CMD_OTP_ACCESS (0x65)
126#define ONENAND_CMD_READID (0x90) 136#define ONENAND_CMD_READID (0x90)
137#define FLEXONENAND_CMD_PI_UPDATE (0x05)
138#define FLEXONENAND_CMD_PI_ACCESS (0x66)
139#define FLEXONENAND_CMD_RECOVER_LSB (0x05)
127 140
128/* NOTE: Those are not *REAL* commands */ 141/* NOTE: Those are not *REAL* commands */
129#define ONENAND_CMD_BUFFERRAM (0x1978) 142#define ONENAND_CMD_BUFFERRAM (0x1978)
143#define FLEXONENAND_CMD_READ_PI (0x1985)
130 144
131/* 145/*
132 * System Configuration 1 Register F221h (R, R/W) 146 * System Configuration 1 Register F221h (R, R/W)
@@ -192,10 +206,12 @@
192#define ONENAND_ECC_1BIT_ALL (0x5555) 206#define ONENAND_ECC_1BIT_ALL (0x5555)
193#define ONENAND_ECC_2BIT (1 << 1) 207#define ONENAND_ECC_2BIT (1 << 1)
194#define ONENAND_ECC_2BIT_ALL (0xAAAA) 208#define ONENAND_ECC_2BIT_ALL (0xAAAA)
209#define FLEXONENAND_UNCORRECTABLE_ERROR (0x1010)
195 210
196/* 211/*
197 * One-Time Programmable (OTP) 212 * One-Time Programmable (OTP)
198 */ 213 */
214#define FLEXONENAND_OTP_LOCK_OFFSET (2048)
199#define ONENAND_OTP_LOCK_OFFSET (14) 215#define ONENAND_OTP_LOCK_OFFSET (14)
200 216
201#endif /* __ONENAND_REG_H */ 217#endif /* __ONENAND_REG_H */
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h
index 7535a74083b9..af6dcb992bc3 100644
--- a/include/linux/mtd/partitions.h
+++ b/include/linux/mtd/partitions.h
@@ -40,7 +40,6 @@ struct mtd_partition {
40 uint64_t offset; /* offset within the master MTD space */ 40 uint64_t offset; /* offset within the master MTD space */
41 uint32_t mask_flags; /* master MTD flags to mask out for this partition */ 41 uint32_t mask_flags; /* master MTD flags to mask out for this partition */
42 struct nand_ecclayout *ecclayout; /* out of band layout for this partition (NAND only)*/ 42 struct nand_ecclayout *ecclayout; /* out of band layout for this partition (NAND only)*/
43 struct mtd_info **mtdp; /* pointer to store the MTD object */
44}; 43};
45 44
46#define MTDPART_OFS_NXTBLK (-2) 45#define MTDPART_OFS_NXTBLK (-2)
diff --git a/include/linux/nfs.h b/include/linux/nfs.h
index 214d499718f7..f387919bbc59 100644
--- a/include/linux/nfs.h
+++ b/include/linux/nfs.h
@@ -25,8 +25,9 @@
25#define NFSMODE_SOCK 0140000 25#define NFSMODE_SOCK 0140000
26#define NFSMODE_FIFO 0010000 26#define NFSMODE_FIFO 0010000
27 27
28#define NFS_MNT_PROGRAM 100005 28#define NFS_MNT_PROGRAM 100005
29#define NFS_MNT_PORT 627 29#define NFS_MNT_VERSION 1
30#define NFS_MNT3_VERSION 3
30 31
31/* 32/*
32 * NFS stats. The good thing with these values is that NFSv3 errors are 33 * NFS stats. The good thing with these values is that NFSv3 errors are
diff --git a/include/linux/nfs2.h b/include/linux/nfs2.h
index 0ed9517138fc..fde24b30cc9e 100644
--- a/include/linux/nfs2.h
+++ b/include/linux/nfs2.h
@@ -64,11 +64,4 @@ struct nfs2_fh {
64#define NFSPROC_READDIR 16 64#define NFSPROC_READDIR 16
65#define NFSPROC_STATFS 17 65#define NFSPROC_STATFS 17
66 66
67#define NFS_MNT_PROGRAM 100005
68#define NFS_MNT_VERSION 1
69#define MNTPROC_NULL 0
70#define MNTPROC_MNT 1
71#define MNTPROC_UMNT 3
72#define MNTPROC_UMNTALL 4
73
74#endif /* _LINUX_NFS2_H */ 67#endif /* _LINUX_NFS2_H */
diff --git a/include/linux/nfs3.h b/include/linux/nfs3.h
index 539f3b550eab..ac33806ec7f9 100644
--- a/include/linux/nfs3.h
+++ b/include/linux/nfs3.h
@@ -88,12 +88,7 @@ struct nfs3_fh {
88#define NFS3PROC_PATHCONF 20 88#define NFS3PROC_PATHCONF 20
89#define NFS3PROC_COMMIT 21 89#define NFS3PROC_COMMIT 21
90 90
91#define NFS_MNT3_PROGRAM 100005
92#define NFS_MNT3_VERSION 3 91#define NFS_MNT3_VERSION 3
93#define MOUNTPROC3_NULL 0
94#define MOUNTPROC3_MNT 1
95#define MOUNTPROC3_UMNT 3
96#define MOUNTPROC3_UMNTALL 4
97 92
98 93
99#if defined(__KERNEL__) 94#if defined(__KERNEL__)
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h
index e3f0cbcbd0db..bd2eba530667 100644
--- a/include/linux/nfs4.h
+++ b/include/linux/nfs4.h
@@ -21,6 +21,7 @@
21#define NFS4_FHSIZE 128 21#define NFS4_FHSIZE 128
22#define NFS4_MAXPATHLEN PATH_MAX 22#define NFS4_MAXPATHLEN PATH_MAX
23#define NFS4_MAXNAMLEN NAME_MAX 23#define NFS4_MAXNAMLEN NAME_MAX
24#define NFS4_OPAQUE_LIMIT 1024
24#define NFS4_MAX_SESSIONID_LEN 16 25#define NFS4_MAX_SESSIONID_LEN 16
25 26
26#define NFS4_ACCESS_READ 0x0001 27#define NFS4_ACCESS_READ 0x0001
@@ -130,6 +131,16 @@
130 131
131#define NFS4_MAX_UINT64 (~(u64)0) 132#define NFS4_MAX_UINT64 (~(u64)0)
132 133
134/* An NFS4 sessions server must support at least NFS4_MAX_OPS operations.
135 * If a compound requires more operations, adjust NFS4_MAX_OPS accordingly.
136 */
137#define NFS4_MAX_OPS 8
138
139/* Our NFS4 client back channel server only wants the cb_sequene and the
140 * actual operation per compound
141 */
142#define NFS4_MAX_BACK_CHANNEL_OPS 2
143
133enum nfs4_acl_whotype { 144enum nfs4_acl_whotype {
134 NFS4_ACL_WHO_NAMED = 0, 145 NFS4_ACL_WHO_NAMED = 0,
135 NFS4_ACL_WHO_OWNER, 146 NFS4_ACL_WHO_OWNER,
@@ -462,6 +473,13 @@ enum lock_type4 {
462#define NFSPROC4_NULL 0 473#define NFSPROC4_NULL 0
463#define NFSPROC4_COMPOUND 1 474#define NFSPROC4_COMPOUND 1
464#define NFS4_MINOR_VERSION 0 475#define NFS4_MINOR_VERSION 0
476
477#if defined(CONFIG_NFS_V4_1)
478#define NFS4_MAX_MINOR_VERSION 1
479#else
480#define NFS4_MAX_MINOR_VERSION 0
481#endif /* CONFIG_NFS_V4_1 */
482
465#define NFS4_DEBUG 1 483#define NFS4_DEBUG 1
466 484
467/* Index of predefined Linux client operations */ 485/* Index of predefined Linux client operations */
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index 6ad75948cbf7..19fe15d12042 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -4,11 +4,17 @@
4#include <linux/list.h> 4#include <linux/list.h>
5#include <linux/backing-dev.h> 5#include <linux/backing-dev.h>
6#include <linux/wait.h> 6#include <linux/wait.h>
7#include <linux/nfs_xdr.h>
8#include <linux/sunrpc/xprt.h>
7 9
8#include <asm/atomic.h> 10#include <asm/atomic.h>
9 11
12struct nfs4_session;
10struct nfs_iostats; 13struct nfs_iostats;
11struct nlm_host; 14struct nlm_host;
15struct nfs4_sequence_args;
16struct nfs4_sequence_res;
17struct nfs_server;
12 18
13/* 19/*
14 * The nfs_client identifies our client state to the server. 20 * The nfs_client identifies our client state to the server.
@@ -18,6 +24,7 @@ struct nfs_client {
18 int cl_cons_state; /* current construction state (-ve: init error) */ 24 int cl_cons_state; /* current construction state (-ve: init error) */
19#define NFS_CS_READY 0 /* ready to be used */ 25#define NFS_CS_READY 0 /* ready to be used */
20#define NFS_CS_INITING 1 /* busy initialising */ 26#define NFS_CS_INITING 1 /* busy initialising */
27#define NFS_CS_SESSION_INITING 2 /* busy initialising session */
21 unsigned long cl_res_state; /* NFS resources state */ 28 unsigned long cl_res_state; /* NFS resources state */
22#define NFS_CS_CALLBACK 1 /* - callback started */ 29#define NFS_CS_CALLBACK 1 /* - callback started */
23#define NFS_CS_IDMAP 2 /* - idmap started */ 30#define NFS_CS_IDMAP 2 /* - idmap started */
@@ -32,6 +39,7 @@ struct nfs_client {
32 const struct nfs_rpc_ops *rpc_ops; /* NFS protocol vector */ 39 const struct nfs_rpc_ops *rpc_ops; /* NFS protocol vector */
33 int cl_proto; /* Network transport protocol */ 40 int cl_proto; /* Network transport protocol */
34 41
42 u32 cl_minorversion;/* NFSv4 minorversion */
35 struct rpc_cred *cl_machine_cred; 43 struct rpc_cred *cl_machine_cred;
36 44
37#ifdef CONFIG_NFS_V4 45#ifdef CONFIG_NFS_V4
@@ -63,7 +71,22 @@ struct nfs_client {
63 */ 71 */
64 char cl_ipaddr[48]; 72 char cl_ipaddr[48];
65 unsigned char cl_id_uniquifier; 73 unsigned char cl_id_uniquifier;
66#endif 74 int (* cl_call_sync)(struct nfs_server *server,
75 struct rpc_message *msg,
76 struct nfs4_sequence_args *args,
77 struct nfs4_sequence_res *res,
78 int cache_reply);
79#endif /* CONFIG_NFS_V4 */
80
81#ifdef CONFIG_NFS_V4_1
82 /* clientid returned from EXCHANGE_ID, used by session operations */
83 u64 cl_ex_clid;
84 /* The sequence id to use for the next CREATE_SESSION */
85 u32 cl_seqid;
86 /* The flags used for obtaining the clientid during EXCHANGE_ID */
87 u32 cl_exchange_flags;
88 struct nfs4_session *cl_session; /* sharred session */
89#endif /* CONFIG_NFS_V4_1 */
67 90
68#ifdef CONFIG_NFS_FSCACHE 91#ifdef CONFIG_NFS_FSCACHE
69 struct fscache_cookie *fscache; /* client index cache cookie */ 92 struct fscache_cookie *fscache; /* client index cache cookie */
@@ -145,4 +168,46 @@ struct nfs_server {
145#define NFS_CAP_ACLS (1U << 3) 168#define NFS_CAP_ACLS (1U << 3)
146#define NFS_CAP_ATOMIC_OPEN (1U << 4) 169#define NFS_CAP_ATOMIC_OPEN (1U << 4)
147 170
171
172/* maximum number of slots to use */
173#define NFS4_MAX_SLOT_TABLE RPC_MAX_SLOT_TABLE
174
175#if defined(CONFIG_NFS_V4_1)
176
177/* Sessions */
178#define SLOT_TABLE_SZ (NFS4_MAX_SLOT_TABLE/(8*sizeof(long)))
179struct nfs4_slot_table {
180 struct nfs4_slot *slots; /* seqid per slot */
181 unsigned long used_slots[SLOT_TABLE_SZ]; /* used/unused bitmap */
182 spinlock_t slot_tbl_lock;
183 struct rpc_wait_queue slot_tbl_waitq; /* allocators may wait here */
184 int max_slots; /* # slots in table */
185 int highest_used_slotid; /* sent to server on each SEQ.
186 * op for dynamic resizing */
187};
188
189static inline int slot_idx(struct nfs4_slot_table *tbl, struct nfs4_slot *sp)
190{
191 return sp - tbl->slots;
192}
193
194/*
195 * Session related parameters
196 */
197struct nfs4_session {
198 struct nfs4_sessionid sess_id;
199 u32 flags;
200 unsigned long session_state;
201 u32 hash_alg;
202 u32 ssv_len;
203
204 /* The fore and back channel */
205 struct nfs4_channel_attrs fc_attrs;
206 struct nfs4_slot_table fc_slot_table;
207 struct nfs4_channel_attrs bc_attrs;
208 struct nfs4_slot_table bc_slot_table;
209 struct nfs_client *clp;
210};
211
212#endif /* CONFIG_NFS_V4_1 */
148#endif 213#endif
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index b89c34e40bc2..62f63fb0c4c8 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -145,6 +145,44 @@ struct nfs4_change_info {
145}; 145};
146 146
147struct nfs_seqid; 147struct nfs_seqid;
148
149/* nfs41 sessions channel attributes */
150struct nfs4_channel_attrs {
151 u32 headerpadsz;
152 u32 max_rqst_sz;
153 u32 max_resp_sz;
154 u32 max_resp_sz_cached;
155 u32 max_ops;
156 u32 max_reqs;
157};
158
159/* nfs41 sessions slot seqid */
160struct nfs4_slot {
161 u32 seq_nr;
162};
163
164struct nfs4_sequence_args {
165 struct nfs4_session *sa_session;
166 u8 sa_slotid;
167 u8 sa_cache_this;
168};
169
170struct nfs4_sequence_res {
171 struct nfs4_session *sr_session;
172 u8 sr_slotid; /* slot used to send request */
173 unsigned long sr_renewal_time;
174 int sr_status; /* sequence operation status */
175};
176
177struct nfs4_get_lease_time_args {
178 struct nfs4_sequence_args la_seq_args;
179};
180
181struct nfs4_get_lease_time_res {
182 struct nfs_fsinfo *lr_fsinfo;
183 struct nfs4_sequence_res lr_seq_res;
184};
185
148/* 186/*
149 * Arguments to the open call. 187 * Arguments to the open call.
150 */ 188 */
@@ -165,6 +203,7 @@ struct nfs_openargs {
165 const struct nfs_server *server; /* Needed for ID mapping */ 203 const struct nfs_server *server; /* Needed for ID mapping */
166 const u32 * bitmask; 204 const u32 * bitmask;
167 __u32 claim; 205 __u32 claim;
206 struct nfs4_sequence_args seq_args;
168}; 207};
169 208
170struct nfs_openres { 209struct nfs_openres {
@@ -181,6 +220,7 @@ struct nfs_openres {
181 __u32 do_recall; 220 __u32 do_recall;
182 __u64 maxsize; 221 __u64 maxsize;
183 __u32 attrset[NFS4_BITMAP_SIZE]; 222 __u32 attrset[NFS4_BITMAP_SIZE];
223 struct nfs4_sequence_res seq_res;
184}; 224};
185 225
186/* 226/*
@@ -206,6 +246,7 @@ struct nfs_closeargs {
206 struct nfs_seqid * seqid; 246 struct nfs_seqid * seqid;
207 fmode_t fmode; 247 fmode_t fmode;
208 const u32 * bitmask; 248 const u32 * bitmask;
249 struct nfs4_sequence_args seq_args;
209}; 250};
210 251
211struct nfs_closeres { 252struct nfs_closeres {
@@ -213,6 +254,7 @@ struct nfs_closeres {
213 struct nfs_fattr * fattr; 254 struct nfs_fattr * fattr;
214 struct nfs_seqid * seqid; 255 struct nfs_seqid * seqid;
215 const struct nfs_server *server; 256 const struct nfs_server *server;
257 struct nfs4_sequence_res seq_res;
216}; 258};
217/* 259/*
218 * * Arguments to the lock,lockt, and locku call. 260 * * Arguments to the lock,lockt, and locku call.
@@ -233,12 +275,14 @@ struct nfs_lock_args {
233 unsigned char block : 1; 275 unsigned char block : 1;
234 unsigned char reclaim : 1; 276 unsigned char reclaim : 1;
235 unsigned char new_lock_owner : 1; 277 unsigned char new_lock_owner : 1;
278 struct nfs4_sequence_args seq_args;
236}; 279};
237 280
238struct nfs_lock_res { 281struct nfs_lock_res {
239 nfs4_stateid stateid; 282 nfs4_stateid stateid;
240 struct nfs_seqid * lock_seqid; 283 struct nfs_seqid * lock_seqid;
241 struct nfs_seqid * open_seqid; 284 struct nfs_seqid * open_seqid;
285 struct nfs4_sequence_res seq_res;
242}; 286};
243 287
244struct nfs_locku_args { 288struct nfs_locku_args {
@@ -246,32 +290,38 @@ struct nfs_locku_args {
246 struct file_lock * fl; 290 struct file_lock * fl;
247 struct nfs_seqid * seqid; 291 struct nfs_seqid * seqid;
248 nfs4_stateid * stateid; 292 nfs4_stateid * stateid;
293 struct nfs4_sequence_args seq_args;
249}; 294};
250 295
251struct nfs_locku_res { 296struct nfs_locku_res {
252 nfs4_stateid stateid; 297 nfs4_stateid stateid;
253 struct nfs_seqid * seqid; 298 struct nfs_seqid * seqid;
299 struct nfs4_sequence_res seq_res;
254}; 300};
255 301
256struct nfs_lockt_args { 302struct nfs_lockt_args {
257 struct nfs_fh * fh; 303 struct nfs_fh * fh;
258 struct file_lock * fl; 304 struct file_lock * fl;
259 struct nfs_lowner lock_owner; 305 struct nfs_lowner lock_owner;
306 struct nfs4_sequence_args seq_args;
260}; 307};
261 308
262struct nfs_lockt_res { 309struct nfs_lockt_res {
263 struct file_lock * denied; /* LOCK, LOCKT failed */ 310 struct file_lock * denied; /* LOCK, LOCKT failed */
311 struct nfs4_sequence_res seq_res;
264}; 312};
265 313
266struct nfs4_delegreturnargs { 314struct nfs4_delegreturnargs {
267 const struct nfs_fh *fhandle; 315 const struct nfs_fh *fhandle;
268 const nfs4_stateid *stateid; 316 const nfs4_stateid *stateid;
269 const u32 * bitmask; 317 const u32 * bitmask;
318 struct nfs4_sequence_args seq_args;
270}; 319};
271 320
272struct nfs4_delegreturnres { 321struct nfs4_delegreturnres {
273 struct nfs_fattr * fattr; 322 struct nfs_fattr * fattr;
274 const struct nfs_server *server; 323 const struct nfs_server *server;
324 struct nfs4_sequence_res seq_res;
275}; 325};
276 326
277/* 327/*
@@ -284,12 +334,14 @@ struct nfs_readargs {
284 __u32 count; 334 __u32 count;
285 unsigned int pgbase; 335 unsigned int pgbase;
286 struct page ** pages; 336 struct page ** pages;
337 struct nfs4_sequence_args seq_args;
287}; 338};
288 339
289struct nfs_readres { 340struct nfs_readres {
290 struct nfs_fattr * fattr; 341 struct nfs_fattr * fattr;
291 __u32 count; 342 __u32 count;
292 int eof; 343 int eof;
344 struct nfs4_sequence_res seq_res;
293}; 345};
294 346
295/* 347/*
@@ -304,6 +356,7 @@ struct nfs_writeargs {
304 unsigned int pgbase; 356 unsigned int pgbase;
305 struct page ** pages; 357 struct page ** pages;
306 const u32 * bitmask; 358 const u32 * bitmask;
359 struct nfs4_sequence_args seq_args;
307}; 360};
308 361
309struct nfs_writeverf { 362struct nfs_writeverf {
@@ -316,6 +369,7 @@ struct nfs_writeres {
316 struct nfs_writeverf * verf; 369 struct nfs_writeverf * verf;
317 __u32 count; 370 __u32 count;
318 const struct nfs_server *server; 371 const struct nfs_server *server;
372 struct nfs4_sequence_res seq_res;
319}; 373};
320 374
321/* 375/*
@@ -325,12 +379,14 @@ struct nfs_removeargs {
325 const struct nfs_fh *fh; 379 const struct nfs_fh *fh;
326 struct qstr name; 380 struct qstr name;
327 const u32 * bitmask; 381 const u32 * bitmask;
382 struct nfs4_sequence_args seq_args;
328}; 383};
329 384
330struct nfs_removeres { 385struct nfs_removeres {
331 const struct nfs_server *server; 386 const struct nfs_server *server;
332 struct nfs4_change_info cinfo; 387 struct nfs4_change_info cinfo;
333 struct nfs_fattr dir_attr; 388 struct nfs_fattr dir_attr;
389 struct nfs4_sequence_res seq_res;
334}; 390};
335 391
336/* 392/*
@@ -383,6 +439,7 @@ struct nfs_setattrargs {
383 struct iattr * iap; 439 struct iattr * iap;
384 const struct nfs_server * server; /* Needed for name mapping */ 440 const struct nfs_server * server; /* Needed for name mapping */
385 const u32 * bitmask; 441 const u32 * bitmask;
442 struct nfs4_sequence_args seq_args;
386}; 443};
387 444
388struct nfs_setaclargs { 445struct nfs_setaclargs {
@@ -390,6 +447,11 @@ struct nfs_setaclargs {
390 size_t acl_len; 447 size_t acl_len;
391 unsigned int acl_pgbase; 448 unsigned int acl_pgbase;
392 struct page ** acl_pages; 449 struct page ** acl_pages;
450 struct nfs4_sequence_args seq_args;
451};
452
453struct nfs_setaclres {
454 struct nfs4_sequence_res seq_res;
393}; 455};
394 456
395struct nfs_getaclargs { 457struct nfs_getaclargs {
@@ -397,11 +459,18 @@ struct nfs_getaclargs {
397 size_t acl_len; 459 size_t acl_len;
398 unsigned int acl_pgbase; 460 unsigned int acl_pgbase;
399 struct page ** acl_pages; 461 struct page ** acl_pages;
462 struct nfs4_sequence_args seq_args;
463};
464
465struct nfs_getaclres {
466 size_t acl_len;
467 struct nfs4_sequence_res seq_res;
400}; 468};
401 469
402struct nfs_setattrres { 470struct nfs_setattrres {
403 struct nfs_fattr * fattr; 471 struct nfs_fattr * fattr;
404 const struct nfs_server * server; 472 const struct nfs_server * server;
473 struct nfs4_sequence_res seq_res;
405}; 474};
406 475
407struct nfs_linkargs { 476struct nfs_linkargs {
@@ -583,6 +652,7 @@ struct nfs4_accessargs {
583 const struct nfs_fh * fh; 652 const struct nfs_fh * fh;
584 const u32 * bitmask; 653 const u32 * bitmask;
585 u32 access; 654 u32 access;
655 struct nfs4_sequence_args seq_args;
586}; 656};
587 657
588struct nfs4_accessres { 658struct nfs4_accessres {
@@ -590,6 +660,7 @@ struct nfs4_accessres {
590 struct nfs_fattr * fattr; 660 struct nfs_fattr * fattr;
591 u32 supported; 661 u32 supported;
592 u32 access; 662 u32 access;
663 struct nfs4_sequence_res seq_res;
593}; 664};
594 665
595struct nfs4_create_arg { 666struct nfs4_create_arg {
@@ -609,6 +680,7 @@ struct nfs4_create_arg {
609 const struct iattr * attrs; 680 const struct iattr * attrs;
610 const struct nfs_fh * dir_fh; 681 const struct nfs_fh * dir_fh;
611 const u32 * bitmask; 682 const u32 * bitmask;
683 struct nfs4_sequence_args seq_args;
612}; 684};
613 685
614struct nfs4_create_res { 686struct nfs4_create_res {
@@ -617,21 +689,30 @@ struct nfs4_create_res {
617 struct nfs_fattr * fattr; 689 struct nfs_fattr * fattr;
618 struct nfs4_change_info dir_cinfo; 690 struct nfs4_change_info dir_cinfo;
619 struct nfs_fattr * dir_fattr; 691 struct nfs_fattr * dir_fattr;
692 struct nfs4_sequence_res seq_res;
620}; 693};
621 694
622struct nfs4_fsinfo_arg { 695struct nfs4_fsinfo_arg {
623 const struct nfs_fh * fh; 696 const struct nfs_fh * fh;
624 const u32 * bitmask; 697 const u32 * bitmask;
698 struct nfs4_sequence_args seq_args;
699};
700
701struct nfs4_fsinfo_res {
702 struct nfs_fsinfo *fsinfo;
703 struct nfs4_sequence_res seq_res;
625}; 704};
626 705
627struct nfs4_getattr_arg { 706struct nfs4_getattr_arg {
628 const struct nfs_fh * fh; 707 const struct nfs_fh * fh;
629 const u32 * bitmask; 708 const u32 * bitmask;
709 struct nfs4_sequence_args seq_args;
630}; 710};
631 711
632struct nfs4_getattr_res { 712struct nfs4_getattr_res {
633 const struct nfs_server * server; 713 const struct nfs_server * server;
634 struct nfs_fattr * fattr; 714 struct nfs_fattr * fattr;
715 struct nfs4_sequence_res seq_res;
635}; 716};
636 717
637struct nfs4_link_arg { 718struct nfs4_link_arg {
@@ -639,6 +720,7 @@ struct nfs4_link_arg {
639 const struct nfs_fh * dir_fh; 720 const struct nfs_fh * dir_fh;
640 const struct qstr * name; 721 const struct qstr * name;
641 const u32 * bitmask; 722 const u32 * bitmask;
723 struct nfs4_sequence_args seq_args;
642}; 724};
643 725
644struct nfs4_link_res { 726struct nfs4_link_res {
@@ -646,6 +728,7 @@ struct nfs4_link_res {
646 struct nfs_fattr * fattr; 728 struct nfs_fattr * fattr;
647 struct nfs4_change_info cinfo; 729 struct nfs4_change_info cinfo;
648 struct nfs_fattr * dir_attr; 730 struct nfs_fattr * dir_attr;
731 struct nfs4_sequence_res seq_res;
649}; 732};
650 733
651 734
@@ -653,21 +736,30 @@ struct nfs4_lookup_arg {
653 const struct nfs_fh * dir_fh; 736 const struct nfs_fh * dir_fh;
654 const struct qstr * name; 737 const struct qstr * name;
655 const u32 * bitmask; 738 const u32 * bitmask;
739 struct nfs4_sequence_args seq_args;
656}; 740};
657 741
658struct nfs4_lookup_res { 742struct nfs4_lookup_res {
659 const struct nfs_server * server; 743 const struct nfs_server * server;
660 struct nfs_fattr * fattr; 744 struct nfs_fattr * fattr;
661 struct nfs_fh * fh; 745 struct nfs_fh * fh;
746 struct nfs4_sequence_res seq_res;
662}; 747};
663 748
664struct nfs4_lookup_root_arg { 749struct nfs4_lookup_root_arg {
665 const u32 * bitmask; 750 const u32 * bitmask;
751 struct nfs4_sequence_args seq_args;
666}; 752};
667 753
668struct nfs4_pathconf_arg { 754struct nfs4_pathconf_arg {
669 const struct nfs_fh * fh; 755 const struct nfs_fh * fh;
670 const u32 * bitmask; 756 const u32 * bitmask;
757 struct nfs4_sequence_args seq_args;
758};
759
760struct nfs4_pathconf_res {
761 struct nfs_pathconf *pathconf;
762 struct nfs4_sequence_res seq_res;
671}; 763};
672 764
673struct nfs4_readdir_arg { 765struct nfs4_readdir_arg {
@@ -678,11 +770,13 @@ struct nfs4_readdir_arg {
678 struct page ** pages; /* zero-copy data */ 770 struct page ** pages; /* zero-copy data */
679 unsigned int pgbase; /* zero-copy data */ 771 unsigned int pgbase; /* zero-copy data */
680 const u32 * bitmask; 772 const u32 * bitmask;
773 struct nfs4_sequence_args seq_args;
681}; 774};
682 775
683struct nfs4_readdir_res { 776struct nfs4_readdir_res {
684 nfs4_verifier verifier; 777 nfs4_verifier verifier;
685 unsigned int pgbase; 778 unsigned int pgbase;
779 struct nfs4_sequence_res seq_res;
686}; 780};
687 781
688struct nfs4_readlink { 782struct nfs4_readlink {
@@ -690,6 +784,11 @@ struct nfs4_readlink {
690 unsigned int pgbase; 784 unsigned int pgbase;
691 unsigned int pglen; /* zero-copy data */ 785 unsigned int pglen; /* zero-copy data */
692 struct page ** pages; /* zero-copy data */ 786 struct page ** pages; /* zero-copy data */
787 struct nfs4_sequence_args seq_args;
788};
789
790struct nfs4_readlink_res {
791 struct nfs4_sequence_res seq_res;
693}; 792};
694 793
695struct nfs4_rename_arg { 794struct nfs4_rename_arg {
@@ -698,6 +797,7 @@ struct nfs4_rename_arg {
698 const struct qstr * old_name; 797 const struct qstr * old_name;
699 const struct qstr * new_name; 798 const struct qstr * new_name;
700 const u32 * bitmask; 799 const u32 * bitmask;
800 struct nfs4_sequence_args seq_args;
701}; 801};
702 802
703struct nfs4_rename_res { 803struct nfs4_rename_res {
@@ -706,6 +806,7 @@ struct nfs4_rename_res {
706 struct nfs_fattr * old_fattr; 806 struct nfs_fattr * old_fattr;
707 struct nfs4_change_info new_cinfo; 807 struct nfs4_change_info new_cinfo;
708 struct nfs_fattr * new_fattr; 808 struct nfs_fattr * new_fattr;
809 struct nfs4_sequence_res seq_res;
709}; 810};
710 811
711#define NFS4_SETCLIENTID_NAMELEN (127) 812#define NFS4_SETCLIENTID_NAMELEN (127)
@@ -724,6 +825,17 @@ struct nfs4_setclientid {
724struct nfs4_statfs_arg { 825struct nfs4_statfs_arg {
725 const struct nfs_fh * fh; 826 const struct nfs_fh * fh;
726 const u32 * bitmask; 827 const u32 * bitmask;
828 struct nfs4_sequence_args seq_args;
829};
830
831struct nfs4_statfs_res {
832 struct nfs_fsstat *fsstat;
833 struct nfs4_sequence_res seq_res;
834};
835
836struct nfs4_server_caps_arg {
837 struct nfs_fh *fhandle;
838 struct nfs4_sequence_args seq_args;
727}; 839};
728 840
729struct nfs4_server_caps_res { 841struct nfs4_server_caps_res {
@@ -731,6 +843,7 @@ struct nfs4_server_caps_res {
731 u32 acl_bitmask; 843 u32 acl_bitmask;
732 u32 has_links; 844 u32 has_links;
733 u32 has_symlinks; 845 u32 has_symlinks;
846 struct nfs4_sequence_res seq_res;
734}; 847};
735 848
736struct nfs4_string { 849struct nfs4_string {
@@ -765,10 +878,68 @@ struct nfs4_fs_locations_arg {
765 const struct qstr *name; 878 const struct qstr *name;
766 struct page *page; 879 struct page *page;
767 const u32 *bitmask; 880 const u32 *bitmask;
881 struct nfs4_sequence_args seq_args;
882};
883
884struct nfs4_fs_locations_res {
885 struct nfs4_fs_locations *fs_locations;
886 struct nfs4_sequence_res seq_res;
768}; 887};
769 888
770#endif /* CONFIG_NFS_V4 */ 889#endif /* CONFIG_NFS_V4 */
771 890
891struct nfstime4 {
892 u64 seconds;
893 u32 nseconds;
894};
895
896#ifdef CONFIG_NFS_V4_1
897struct nfs_impl_id4 {
898 u32 domain_len;
899 char *domain;
900 u32 name_len;
901 char *name;
902 struct nfstime4 date;
903};
904
905#define NFS4_EXCHANGE_ID_LEN (48)
906struct nfs41_exchange_id_args {
907 struct nfs_client *client;
908 nfs4_verifier *verifier;
909 unsigned int id_len;
910 char id[NFS4_EXCHANGE_ID_LEN];
911 u32 flags;
912};
913
914struct server_owner {
915 uint64_t minor_id;
916 uint32_t major_id_sz;
917 char major_id[NFS4_OPAQUE_LIMIT];
918};
919
920struct server_scope {
921 uint32_t server_scope_sz;
922 char server_scope[NFS4_OPAQUE_LIMIT];
923};
924
925struct nfs41_exchange_id_res {
926 struct nfs_client *client;
927 u32 flags;
928};
929
930struct nfs41_create_session_args {
931 struct nfs_client *client;
932 uint32_t flags;
933 uint32_t cb_program;
934 struct nfs4_channel_attrs fc_attrs; /* Fore Channel */
935 struct nfs4_channel_attrs bc_attrs; /* Back Channel */
936};
937
938struct nfs41_create_session_res {
939 struct nfs_client *client;
940};
941#endif /* CONFIG_NFS_V4_1 */
942
772struct nfs_page; 943struct nfs_page;
773 944
774#define NFS_PAGEVEC_SIZE (8U) 945#define NFS_PAGEVEC_SIZE (8U)
diff --git a/include/linux/nfsd/cache.h b/include/linux/nfsd/cache.h
index 5bccaab81056..3a3f58934f5e 100644
--- a/include/linux/nfsd/cache.h
+++ b/include/linux/nfsd/cache.h
@@ -14,8 +14,7 @@
14#include <linux/uio.h> 14#include <linux/uio.h>
15 15
16/* 16/*
17 * Representation of a reply cache entry. The first two members *must* 17 * Representation of a reply cache entry.
18 * be hash_next and hash_prev.
19 */ 18 */
20struct svc_cacherep { 19struct svc_cacherep {
21 struct hlist_node c_hash; 20 struct hlist_node c_hash;
diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h
index afa19016c4a8..8f641c908450 100644
--- a/include/linux/nfsd/nfsfh.h
+++ b/include/linux/nfsd/nfsfh.h
@@ -151,9 +151,15 @@ typedef struct svc_fh {
151 __u64 fh_pre_size; /* size before operation */ 151 __u64 fh_pre_size; /* size before operation */
152 struct timespec fh_pre_mtime; /* mtime before oper */ 152 struct timespec fh_pre_mtime; /* mtime before oper */
153 struct timespec fh_pre_ctime; /* ctime before oper */ 153 struct timespec fh_pre_ctime; /* ctime before oper */
154 /*
155 * pre-op nfsv4 change attr: note must check IS_I_VERSION(inode)
156 * to find out if it is valid.
157 */
158 u64 fh_pre_change;
154 159
155 /* Post-op attributes saved in fh_unlock */ 160 /* Post-op attributes saved in fh_unlock */
156 struct kstat fh_post_attr; /* full attrs after operation */ 161 struct kstat fh_post_attr; /* full attrs after operation */
162 u64 fh_post_change; /* nfsv4 change; see above */
157#endif /* CONFIG_NFSD_V3 */ 163#endif /* CONFIG_NFSD_V3 */
158 164
159} svc_fh; 165} svc_fh;
@@ -298,6 +304,7 @@ fill_pre_wcc(struct svc_fh *fhp)
298 fhp->fh_pre_mtime = inode->i_mtime; 304 fhp->fh_pre_mtime = inode->i_mtime;
299 fhp->fh_pre_ctime = inode->i_ctime; 305 fhp->fh_pre_ctime = inode->i_ctime;
300 fhp->fh_pre_size = inode->i_size; 306 fhp->fh_pre_size = inode->i_size;
307 fhp->fh_pre_change = inode->i_version;
301 fhp->fh_pre_saved = 1; 308 fhp->fh_pre_saved = 1;
302 } 309 }
303} 310}
diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h
index 4d61c873feed..57ab2ed08459 100644
--- a/include/linux/nfsd/state.h
+++ b/include/linux/nfsd/state.h
@@ -41,7 +41,6 @@
41#include <linux/kref.h> 41#include <linux/kref.h>
42#include <linux/sunrpc/clnt.h> 42#include <linux/sunrpc/clnt.h>
43 43
44#define NFS4_OPAQUE_LIMIT 1024
45typedef struct { 44typedef struct {
46 u32 cl_boot; 45 u32 cl_boot;
47 u32 cl_id; 46 u32 cl_id;
@@ -61,15 +60,6 @@ typedef struct {
61#define si_stateownerid si_opaque.so_stateownerid 60#define si_stateownerid si_opaque.so_stateownerid
62#define si_fileid si_opaque.so_fileid 61#define si_fileid si_opaque.so_fileid
63 62
64
65struct nfs4_cb_recall {
66 u32 cbr_ident;
67 int cbr_trunc;
68 stateid_t cbr_stateid;
69 struct knfsd_fh cbr_fh;
70 struct nfs4_delegation *cbr_dp;
71};
72
73struct nfs4_delegation { 63struct nfs4_delegation {
74 struct list_head dl_perfile; 64 struct list_head dl_perfile;
75 struct list_head dl_perclnt; 65 struct list_head dl_perclnt;
@@ -81,22 +71,25 @@ struct nfs4_delegation {
81 struct file *dl_vfs_file; 71 struct file *dl_vfs_file;
82 u32 dl_type; 72 u32 dl_type;
83 time_t dl_time; 73 time_t dl_time;
84 struct nfs4_cb_recall dl_recall; 74/* For recall: */
75 u32 dl_ident;
76 stateid_t dl_stateid;
77 struct knfsd_fh dl_fh;
78 int dl_retries;
85}; 79};
86 80
87#define dl_stateid dl_recall.cbr_stateid
88#define dl_fh dl_recall.cbr_fh
89
90/* client delegation callback info */ 81/* client delegation callback info */
91struct nfs4_callback { 82struct nfs4_cb_conn {
92 /* SETCLIENTID info */ 83 /* SETCLIENTID info */
93 u32 cb_addr; 84 u32 cb_addr;
94 unsigned short cb_port; 85 unsigned short cb_port;
95 u32 cb_prog; 86 u32 cb_prog;
96 u32 cb_ident; 87 u32 cb_minorversion;
88 u32 cb_ident; /* minorversion 0 only */
97 /* RPC client info */ 89 /* RPC client info */
98 atomic_t cb_set; /* successful CB_NULL call */ 90 atomic_t cb_set; /* successful CB_NULL call */
99 struct rpc_clnt * cb_client; 91 struct rpc_clnt * cb_client;
92 struct rpc_cred * cb_cred;
100}; 93};
101 94
102/* Maximum number of slots per session. 128 is useful for long haul TCP */ 95/* Maximum number of slots per session. 128 is useful for long haul TCP */
@@ -122,6 +115,17 @@ struct nfsd4_slot {
122 struct nfsd4_cache_entry sl_cache_entry; 115 struct nfsd4_cache_entry sl_cache_entry;
123}; 116};
124 117
118struct nfsd4_channel_attrs {
119 u32 headerpadsz;
120 u32 maxreq_sz;
121 u32 maxresp_sz;
122 u32 maxresp_cached;
123 u32 maxops;
124 u32 maxreqs;
125 u32 nr_rdma_attrs;
126 u32 rdma_attrs;
127};
128
125struct nfsd4_session { 129struct nfsd4_session {
126 struct kref se_ref; 130 struct kref se_ref;
127 struct list_head se_hash; /* hash by sessionid */ 131 struct list_head se_hash; /* hash by sessionid */
@@ -129,11 +133,8 @@ struct nfsd4_session {
129 u32 se_flags; 133 u32 se_flags;
130 struct nfs4_client *se_client; /* for expire_client */ 134 struct nfs4_client *se_client; /* for expire_client */
131 struct nfs4_sessionid se_sessionid; 135 struct nfs4_sessionid se_sessionid;
132 u32 se_fmaxreq_sz; 136 struct nfsd4_channel_attrs se_fchannel;
133 u32 se_fmaxresp_sz; 137 struct nfsd4_channel_attrs se_bchannel;
134 u32 se_fmaxresp_cached;
135 u32 se_fmaxops;
136 u32 se_fnumslots;
137 struct nfsd4_slot se_slots[]; /* forward channel slots */ 138 struct nfsd4_slot se_slots[]; /* forward channel slots */
138}; 139};
139 140
@@ -185,7 +186,7 @@ struct nfs4_client {
185 struct svc_cred cl_cred; /* setclientid principal */ 186 struct svc_cred cl_cred; /* setclientid principal */
186 clientid_t cl_clientid; /* generated by server */ 187 clientid_t cl_clientid; /* generated by server */
187 nfs4_verifier cl_confirm; /* generated by server */ 188 nfs4_verifier cl_confirm; /* generated by server */
188 struct nfs4_callback cl_callback; /* callback info */ 189 struct nfs4_cb_conn cl_cb_conn; /* callback info */
189 atomic_t cl_count; /* ref count */ 190 atomic_t cl_count; /* ref count */
190 u32 cl_firststate; /* recovery dir creation */ 191 u32 cl_firststate; /* recovery dir creation */
191 192
diff --git a/include/linux/nfsd/xdr4.h b/include/linux/nfsd/xdr4.h
index f80d6013fdc3..2bacf7535069 100644
--- a/include/linux/nfsd/xdr4.h
+++ b/include/linux/nfsd/xdr4.h
@@ -64,10 +64,13 @@ static inline bool nfsd4_has_session(struct nfsd4_compound_state *cs)
64 64
65struct nfsd4_change_info { 65struct nfsd4_change_info {
66 u32 atomic; 66 u32 atomic;
67 bool change_supported;
67 u32 before_ctime_sec; 68 u32 before_ctime_sec;
68 u32 before_ctime_nsec; 69 u32 before_ctime_nsec;
70 u64 before_change;
69 u32 after_ctime_sec; 71 u32 after_ctime_sec;
70 u32 after_ctime_nsec; 72 u32 after_ctime_nsec;
73 u64 after_change;
71}; 74};
72 75
73struct nfsd4_access { 76struct nfsd4_access {
@@ -363,17 +366,6 @@ struct nfsd4_exchange_id {
363 int spa_how; 366 int spa_how;
364}; 367};
365 368
366struct nfsd4_channel_attrs {
367 u32 headerpadsz;
368 u32 maxreq_sz;
369 u32 maxresp_sz;
370 u32 maxresp_cached;
371 u32 maxops;
372 u32 maxreqs;
373 u32 nr_rdma_attrs;
374 u32 rdma_attrs;
375};
376
377struct nfsd4_create_session { 369struct nfsd4_create_session {
378 clientid_t clientid; 370 clientid_t clientid;
379 struct nfs4_sessionid sessionid; 371 struct nfs4_sessionid sessionid;
@@ -503,10 +495,16 @@ set_change_info(struct nfsd4_change_info *cinfo, struct svc_fh *fhp)
503{ 495{
504 BUG_ON(!fhp->fh_pre_saved || !fhp->fh_post_saved); 496 BUG_ON(!fhp->fh_pre_saved || !fhp->fh_post_saved);
505 cinfo->atomic = 1; 497 cinfo->atomic = 1;
506 cinfo->before_ctime_sec = fhp->fh_pre_ctime.tv_sec; 498 cinfo->change_supported = IS_I_VERSION(fhp->fh_dentry->d_inode);
507 cinfo->before_ctime_nsec = fhp->fh_pre_ctime.tv_nsec; 499 if (cinfo->change_supported) {
508 cinfo->after_ctime_sec = fhp->fh_post_attr.ctime.tv_sec; 500 cinfo->before_change = fhp->fh_pre_change;
509 cinfo->after_ctime_nsec = fhp->fh_post_attr.ctime.tv_nsec; 501 cinfo->after_change = fhp->fh_post_change;
502 } else {
503 cinfo->before_ctime_sec = fhp->fh_pre_ctime.tv_sec;
504 cinfo->before_ctime_nsec = fhp->fh_pre_ctime.tv_nsec;
505 cinfo->after_ctime_sec = fhp->fh_post_attr.ctime.tv_sec;
506 cinfo->after_ctime_nsec = fhp->fh_post_attr.ctime.tv_nsec;
507 }
510} 508}
511 509
512int nfs4svc_encode_voidres(struct svc_rqst *, __be32 *, void *); 510int nfs4svc_encode_voidres(struct svc_rqst *, __be32 *, void *);
diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h
index 092e82e0048c..93a7c08f869d 100644
--- a/include/linux/pci-acpi.h
+++ b/include/linux/pci-acpi.h
@@ -15,7 +15,7 @@ static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev)
15{ 15{
16 struct pci_bus *pbus = pdev->bus; 16 struct pci_bus *pbus = pdev->bus;
17 /* Find a PCI root bus */ 17 /* Find a PCI root bus */
18 while (pbus->parent) 18 while (!pci_is_root_bus(pbus))
19 pbus = pbus->parent; 19 pbus = pbus->parent;
20 return acpi_get_pci_rootbridge_handle(pci_domain_nr(pbus), 20 return acpi_get_pci_rootbridge_handle(pci_domain_nr(pbus),
21 pbus->number); 21 pbus->number);
@@ -23,7 +23,7 @@ static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev)
23 23
24static inline acpi_handle acpi_pci_get_bridge_handle(struct pci_bus *pbus) 24static inline acpi_handle acpi_pci_get_bridge_handle(struct pci_bus *pbus)
25{ 25{
26 if (pbus->parent) 26 if (!pci_is_root_bus(pbus))
27 return DEVICE_ACPI_HANDLE(&(pbus->self->dev)); 27 return DEVICE_ACPI_HANDLE(&(pbus->self->dev));
28 return acpi_get_pci_rootbridge_handle(pci_domain_nr(pbus), 28 return acpi_get_pci_rootbridge_handle(pci_domain_nr(pbus),
29 pbus->number); 29 pbus->number);
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 8e366bb0705f..d304ddf412d0 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -196,6 +196,7 @@ struct pci_cap_saved_state {
196struct pcie_link_state; 196struct pcie_link_state;
197struct pci_vpd; 197struct pci_vpd;
198struct pci_sriov; 198struct pci_sriov;
199struct pci_ats;
199 200
200/* 201/*
201 * The pci_dev structure is used to describe PCI devices. 202 * The pci_dev structure is used to describe PCI devices.
@@ -293,6 +294,7 @@ struct pci_dev {
293 struct pci_sriov *sriov; /* SR-IOV capability related */ 294 struct pci_sriov *sriov; /* SR-IOV capability related */
294 struct pci_dev *physfn; /* the PF this VF is associated with */ 295 struct pci_dev *physfn; /* the PF this VF is associated with */
295 }; 296 };
297 struct pci_ats *ats; /* Address Translation Service */
296#endif 298#endif
297}; 299};
298 300
@@ -607,8 +609,6 @@ extern void pci_sort_breadthfirst(void);
607struct pci_dev __deprecated *pci_find_device(unsigned int vendor, 609struct pci_dev __deprecated *pci_find_device(unsigned int vendor,
608 unsigned int device, 610 unsigned int device,
609 struct pci_dev *from); 611 struct pci_dev *from);
610struct pci_dev __deprecated *pci_find_slot(unsigned int bus,
611 unsigned int devfn);
612#endif /* CONFIG_PCI_LEGACY */ 612#endif /* CONFIG_PCI_LEGACY */
613 613
614enum pci_lost_interrupt_reason { 614enum pci_lost_interrupt_reason {
@@ -647,6 +647,7 @@ int pci_bus_write_config_word(struct pci_bus *bus, unsigned int devfn,
647 int where, u16 val); 647 int where, u16 val);
648int pci_bus_write_config_dword(struct pci_bus *bus, unsigned int devfn, 648int pci_bus_write_config_dword(struct pci_bus *bus, unsigned int devfn,
649 int where, u32 val); 649 int where, u32 val);
650struct pci_ops *pci_bus_set_ops(struct pci_bus *bus, struct pci_ops *ops);
650 651
651static inline int pci_read_config_byte(struct pci_dev *dev, int where, u8 *val) 652static inline int pci_read_config_byte(struct pci_dev *dev, int where, u8 *val)
652{ 653{
@@ -711,8 +712,8 @@ int pcix_get_mmrbc(struct pci_dev *dev);
711int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc); 712int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc);
712int pcie_get_readrq(struct pci_dev *dev); 713int pcie_get_readrq(struct pci_dev *dev);
713int pcie_set_readrq(struct pci_dev *dev, int rq); 714int pcie_set_readrq(struct pci_dev *dev, int rq);
715int __pci_reset_function(struct pci_dev *dev);
714int pci_reset_function(struct pci_dev *dev); 716int pci_reset_function(struct pci_dev *dev);
715int pci_execute_reset_function(struct pci_dev *dev);
716void pci_update_resource(struct pci_dev *dev, int resno); 717void pci_update_resource(struct pci_dev *dev, int resno);
717int __must_check pci_assign_resource(struct pci_dev *dev, int i); 718int __must_check pci_assign_resource(struct pci_dev *dev, int i);
718int pci_select_bars(struct pci_dev *dev, unsigned long flags); 719int pci_select_bars(struct pci_dev *dev, unsigned long flags);
@@ -732,7 +733,7 @@ int pci_set_power_state(struct pci_dev *dev, pci_power_t state);
732pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); 733pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state);
733bool pci_pme_capable(struct pci_dev *dev, pci_power_t state); 734bool pci_pme_capable(struct pci_dev *dev, pci_power_t state);
734void pci_pme_active(struct pci_dev *dev, bool enable); 735void pci_pme_active(struct pci_dev *dev, bool enable);
735int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable); 736int pci_enable_wake(struct pci_dev *dev, pci_power_t state, bool enable);
736int pci_wake_from_d3(struct pci_dev *dev, bool enable); 737int pci_wake_from_d3(struct pci_dev *dev, bool enable);
737pci_power_t pci_target_state(struct pci_dev *dev); 738pci_power_t pci_target_state(struct pci_dev *dev);
738int pci_prepare_to_sleep(struct pci_dev *dev); 739int pci_prepare_to_sleep(struct pci_dev *dev);
@@ -798,7 +799,7 @@ const struct pci_device_id *pci_match_id(const struct pci_device_id *ids,
798int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, 799int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max,
799 int pass); 800 int pass);
800 801
801void pci_walk_bus(struct pci_bus *top, void (*cb)(struct pci_dev *, void *), 802void pci_walk_bus(struct pci_bus *top, int (*cb)(struct pci_dev *, void *),
802 void *userdata); 803 void *userdata);
803int pci_cfg_space_size_ext(struct pci_dev *dev); 804int pci_cfg_space_size_ext(struct pci_dev *dev);
804int pci_cfg_space_size(struct pci_dev *dev); 805int pci_cfg_space_size(struct pci_dev *dev);
@@ -888,6 +889,17 @@ static inline int pcie_aspm_enabled(void)
888extern int pcie_aspm_enabled(void); 889extern int pcie_aspm_enabled(void);
889#endif 890#endif
890 891
892#ifndef CONFIG_PCIE_ECRC
893static inline void pcie_set_ecrc_checking(struct pci_dev *dev)
894{
895 return;
896}
897static inline void pcie_ecrc_get_policy(char *str) {};
898#else
899extern void pcie_set_ecrc_checking(struct pci_dev *dev);
900extern void pcie_ecrc_get_policy(char *str);
901#endif
902
891#define pci_enable_msi(pdev) pci_enable_msi_block(pdev, 1) 903#define pci_enable_msi(pdev) pci_enable_msi_block(pdev, 1)
892 904
893#ifdef CONFIG_HT_IRQ 905#ifdef CONFIG_HT_IRQ
@@ -944,12 +956,6 @@ static inline struct pci_dev *pci_find_device(unsigned int vendor,
944 return NULL; 956 return NULL;
945} 957}
946 958
947static inline struct pci_dev *pci_find_slot(unsigned int bus,
948 unsigned int devfn)
949{
950 return NULL;
951}
952
953static inline struct pci_dev *pci_get_device(unsigned int vendor, 959static inline struct pci_dev *pci_get_device(unsigned int vendor,
954 unsigned int device, 960 unsigned int device,
955 struct pci_dev *from) 961 struct pci_dev *from)
@@ -1105,6 +1111,10 @@ static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus,
1105 1111
1106#include <asm/pci.h> 1112#include <asm/pci.h>
1107 1113
1114#ifndef PCIBIOS_MAX_MEM_32
1115#define PCIBIOS_MAX_MEM_32 (-1)
1116#endif
1117
1108/* these helpers provide future and backwards compatibility 1118/* these helpers provide future and backwards compatibility
1109 * for accessing popular PCI BAR info */ 1119 * for accessing popular PCI BAR info */
1110#define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start) 1120#define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start)
@@ -1261,5 +1271,10 @@ static inline irqreturn_t pci_sriov_migration(struct pci_dev *dev)
1261} 1271}
1262#endif 1272#endif
1263 1273
1274#if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE)
1275extern void pci_hp_create_module_link(struct pci_slot *pci_slot);
1276extern void pci_hp_remove_module_link(struct pci_slot *pci_slot);
1277#endif
1278
1264#endif /* __KERNEL__ */ 1279#endif /* __KERNEL__ */
1265#endif /* LINUX_PCI_H */ 1280#endif /* LINUX_PCI_H */
diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h
index 20998746518e..4391741b99dc 100644
--- a/include/linux/pci_hotplug.h
+++ b/include/linux/pci_hotplug.h
@@ -66,17 +66,10 @@ enum pcie_link_speed {
66 PCIE_LNK_SPEED_UNKNOWN = 0xFF, 66 PCIE_LNK_SPEED_UNKNOWN = 0xFF,
67}; 67};
68 68
69struct hotplug_slot;
70struct hotplug_slot_attribute {
71 struct attribute attr;
72 ssize_t (*show)(struct hotplug_slot *, char *);
73 ssize_t (*store)(struct hotplug_slot *, const char *, size_t);
74};
75#define to_hotplug_attr(n) container_of(n, struct hotplug_slot_attribute, attr);
76
77/** 69/**
78 * struct hotplug_slot_ops -the callbacks that the hotplug pci core can use 70 * struct hotplug_slot_ops -the callbacks that the hotplug pci core can use
79 * @owner: The module owner of this structure 71 * @owner: The module owner of this structure
72 * @mod_name: The module name (KBUILD_MODNAME) of this structure
80 * @enable_slot: Called when the user wants to enable a specific pci slot 73 * @enable_slot: Called when the user wants to enable a specific pci slot
81 * @disable_slot: Called when the user wants to disable a specific pci slot 74 * @disable_slot: Called when the user wants to disable a specific pci slot
82 * @set_attention_status: Called to set the specific slot's attention LED to 75 * @set_attention_status: Called to set the specific slot's attention LED to
@@ -109,6 +102,7 @@ struct hotplug_slot_attribute {
109 */ 102 */
110struct hotplug_slot_ops { 103struct hotplug_slot_ops {
111 struct module *owner; 104 struct module *owner;
105 const char *mod_name;
112 int (*enable_slot) (struct hotplug_slot *slot); 106 int (*enable_slot) (struct hotplug_slot *slot);
113 int (*disable_slot) (struct hotplug_slot *slot); 107 int (*disable_slot) (struct hotplug_slot *slot);
114 int (*set_attention_status) (struct hotplug_slot *slot, u8 value); 108 int (*set_attention_status) (struct hotplug_slot *slot, u8 value);
@@ -167,12 +161,21 @@ static inline const char *hotplug_slot_name(const struct hotplug_slot *slot)
167 return pci_slot_name(slot->pci_slot); 161 return pci_slot_name(slot->pci_slot);
168} 162}
169 163
170extern int pci_hp_register(struct hotplug_slot *, struct pci_bus *, int nr, 164extern int __pci_hp_register(struct hotplug_slot *slot, struct pci_bus *pbus,
171 const char *name); 165 int nr, const char *name,
166 struct module *owner, const char *mod_name);
172extern int pci_hp_deregister(struct hotplug_slot *slot); 167extern int pci_hp_deregister(struct hotplug_slot *slot);
173extern int __must_check pci_hp_change_slot_info (struct hotplug_slot *slot, 168extern int __must_check pci_hp_change_slot_info (struct hotplug_slot *slot,
174 struct hotplug_slot_info *info); 169 struct hotplug_slot_info *info);
175 170
171static inline int pci_hp_register(struct hotplug_slot *slot,
172 struct pci_bus *pbus,
173 int devnr, const char *name)
174{
175 return __pci_hp_register(slot, pbus, devnr, name,
176 THIS_MODULE, KBUILD_MODNAME);
177}
178
176/* PCI Setting Record (Type 0) */ 179/* PCI Setting Record (Type 0) */
177struct hpp_type0 { 180struct hpp_type0 {
178 u32 revision; 181 u32 revision;
@@ -226,7 +229,6 @@ struct hotplug_params {
226extern acpi_status acpi_get_hp_params_from_firmware(struct pci_bus *bus, 229extern acpi_status acpi_get_hp_params_from_firmware(struct pci_bus *bus,
227 struct hotplug_params *hpp); 230 struct hotplug_params *hpp);
228int acpi_get_hp_hw_control_from_firmware(struct pci_dev *dev, u32 flags); 231int acpi_get_hp_hw_control_from_firmware(struct pci_dev *dev, u32 flags);
229int acpi_root_bridge(acpi_handle handle);
230int acpi_pci_check_ejectable(struct pci_bus *pbus, acpi_handle handle); 232int acpi_pci_check_ejectable(struct pci_bus *pbus, acpi_handle handle);
231int acpi_pci_detect_ejectable(struct pci_bus *pbus); 233int acpi_pci_detect_ejectable(struct pci_bus *pbus);
232#endif 234#endif
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h
index 616bf8b3c8b5..fcaee42c7ac2 100644
--- a/include/linux/pci_regs.h
+++ b/include/linux/pci_regs.h
@@ -295,8 +295,9 @@
295#define PCI_MSI_ADDRESS_LO 4 /* Lower 32 bits */ 295#define PCI_MSI_ADDRESS_LO 4 /* Lower 32 bits */
296#define PCI_MSI_ADDRESS_HI 8 /* Upper 32 bits (if PCI_MSI_FLAGS_64BIT set) */ 296#define PCI_MSI_ADDRESS_HI 8 /* Upper 32 bits (if PCI_MSI_FLAGS_64BIT set) */
297#define PCI_MSI_DATA_32 8 /* 16 bits of data for 32-bit devices */ 297#define PCI_MSI_DATA_32 8 /* 16 bits of data for 32-bit devices */
298#define PCI_MSI_MASK_32 12 /* Mask bits register for 32-bit devices */
298#define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */ 299#define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */
299#define PCI_MSI_MASK_BIT 16 /* Mask bits register */ 300#define PCI_MSI_MASK_64 16 /* Mask bits register for 64-bit devices */
300 301
301/* MSI-X registers (these are at offset PCI_MSIX_FLAGS) */ 302/* MSI-X registers (these are at offset PCI_MSIX_FLAGS) */
302#define PCI_MSIX_FLAGS 2 303#define PCI_MSIX_FLAGS 2
@@ -304,7 +305,6 @@
304#define PCI_MSIX_FLAGS_ENABLE (1 << 15) 305#define PCI_MSIX_FLAGS_ENABLE (1 << 15)
305#define PCI_MSIX_FLAGS_MASKALL (1 << 14) 306#define PCI_MSIX_FLAGS_MASKALL (1 << 14)
306#define PCI_MSIX_FLAGS_BIRMASK (7 << 0) 307#define PCI_MSIX_FLAGS_BIRMASK (7 << 0)
307#define PCI_MSIX_FLAGS_BITMASK (1 << 0)
308 308
309/* CompactPCI Hotswap Register */ 309/* CompactPCI Hotswap Register */
310 310
@@ -502,6 +502,7 @@
502#define PCI_EXT_CAP_ID_DSN 3 502#define PCI_EXT_CAP_ID_DSN 3
503#define PCI_EXT_CAP_ID_PWR 4 503#define PCI_EXT_CAP_ID_PWR 4
504#define PCI_EXT_CAP_ID_ARI 14 504#define PCI_EXT_CAP_ID_ARI 14
505#define PCI_EXT_CAP_ID_ATS 15
505#define PCI_EXT_CAP_ID_SRIOV 16 506#define PCI_EXT_CAP_ID_SRIOV 16
506 507
507/* Advanced Error Reporting */ 508/* Advanced Error Reporting */
@@ -620,6 +621,15 @@
620#define PCI_ARI_CTRL_ACS 0x0002 /* ACS Function Groups Enable */ 621#define PCI_ARI_CTRL_ACS 0x0002 /* ACS Function Groups Enable */
621#define PCI_ARI_CTRL_FG(x) (((x) >> 4) & 7) /* Function Group */ 622#define PCI_ARI_CTRL_FG(x) (((x) >> 4) & 7) /* Function Group */
622 623
624/* Address Translation Service */
625#define PCI_ATS_CAP 0x04 /* ATS Capability Register */
626#define PCI_ATS_CAP_QDEP(x) ((x) & 0x1f) /* Invalidate Queue Depth */
627#define PCI_ATS_MAX_QDEP 32 /* Max Invalidate Queue Depth */
628#define PCI_ATS_CTRL 0x06 /* ATS Control Register */
629#define PCI_ATS_CTRL_ENABLE 0x8000 /* ATS Enable */
630#define PCI_ATS_CTRL_STU(x) ((x) & 0x1f) /* Smallest Translation Unit */
631#define PCI_ATS_MIN_STU 12 /* shift of minimum STU block */
632
623/* Single Root I/O Virtualization */ 633/* Single Root I/O Virtualization */
624#define PCI_SRIOV_CAP 0x04 /* SR-IOV Capabilities */ 634#define PCI_SRIOV_CAP 0x04 /* SR-IOV Capabilities */
625#define PCI_SRIOV_CAP_VFM 0x01 /* VF Migration Capable */ 635#define PCI_SRIOV_CAP_VFM 0x01 /* VF Migration Capable */
diff --git a/include/linux/posix_acl.h b/include/linux/posix_acl.h
index 4bc241290c24..0cdba01b7756 100644
--- a/include/linux/posix_acl.h
+++ b/include/linux/posix_acl.h
@@ -83,4 +83,68 @@ extern int posix_acl_chmod_masq(struct posix_acl *, mode_t);
83extern struct posix_acl *get_posix_acl(struct inode *, int); 83extern struct posix_acl *get_posix_acl(struct inode *, int);
84extern int set_posix_acl(struct inode *, int, struct posix_acl *); 84extern int set_posix_acl(struct inode *, int, struct posix_acl *);
85 85
86static inline struct posix_acl *get_cached_acl(struct inode *inode, int type)
87{
88 struct posix_acl **p, *acl;
89 switch (type) {
90 case ACL_TYPE_ACCESS:
91 p = &inode->i_acl;
92 break;
93 case ACL_TYPE_DEFAULT:
94 p = &inode->i_default_acl;
95 break;
96 default:
97 return ERR_PTR(-EINVAL);
98 }
99 acl = ACCESS_ONCE(*p);
100 if (acl) {
101 spin_lock(&inode->i_lock);
102 acl = *p;
103 if (acl != ACL_NOT_CACHED)
104 acl = posix_acl_dup(acl);
105 spin_unlock(&inode->i_lock);
106 }
107 return acl;
108}
109
110static inline void set_cached_acl(struct inode *inode,
111 int type,
112 struct posix_acl *acl)
113{
114 struct posix_acl *old = NULL;
115 spin_lock(&inode->i_lock);
116 switch (type) {
117 case ACL_TYPE_ACCESS:
118 old = inode->i_acl;
119 inode->i_acl = posix_acl_dup(acl);
120 break;
121 case ACL_TYPE_DEFAULT:
122 old = inode->i_default_acl;
123 inode->i_default_acl = posix_acl_dup(acl);
124 break;
125 }
126 spin_unlock(&inode->i_lock);
127 if (old != ACL_NOT_CACHED)
128 posix_acl_release(old);
129}
130
131static inline void forget_cached_acl(struct inode *inode, int type)
132{
133 struct posix_acl *old = NULL;
134 spin_lock(&inode->i_lock);
135 switch (type) {
136 case ACL_TYPE_ACCESS:
137 old = inode->i_acl;
138 inode->i_acl = ACL_NOT_CACHED;
139 break;
140 case ACL_TYPE_DEFAULT:
141 old = inode->i_default_acl;
142 inode->i_default_acl = ACL_NOT_CACHED;
143 break;
144 }
145 spin_unlock(&inode->i_lock);
146 if (old != ACL_NOT_CACHED)
147 posix_acl_release(old);
148}
149
86#endif /* __LINUX_POSIX_ACL_H */ 150#endif /* __LINUX_POSIX_ACL_H */
diff --git a/include/linux/reiserfs_acl.h b/include/linux/reiserfs_acl.h
index 8cc65757e47a..b4448853900e 100644
--- a/include/linux/reiserfs_acl.h
+++ b/include/linux/reiserfs_acl.h
@@ -56,15 +56,6 @@ int reiserfs_cache_default_acl(struct inode *dir);
56extern struct xattr_handler reiserfs_posix_acl_default_handler; 56extern struct xattr_handler reiserfs_posix_acl_default_handler;
57extern struct xattr_handler reiserfs_posix_acl_access_handler; 57extern struct xattr_handler reiserfs_posix_acl_access_handler;
58 58
59static inline void reiserfs_init_acl_access(struct inode *inode)
60{
61 REISERFS_I(inode)->i_acl_access = NULL;
62}
63
64static inline void reiserfs_init_acl_default(struct inode *inode)
65{
66 REISERFS_I(inode)->i_acl_default = NULL;
67}
68#else 59#else
69 60
70#define reiserfs_cache_default_acl(inode) 0 61#define reiserfs_cache_default_acl(inode) 0
@@ -86,12 +77,4 @@ reiserfs_inherit_default_acl(struct reiserfs_transaction_handle *th,
86{ 77{
87 return 0; 78 return 0;
88} 79}
89
90static inline void reiserfs_init_acl_access(struct inode *inode)
91{
92}
93
94static inline void reiserfs_init_acl_default(struct inode *inode)
95{
96}
97#endif 80#endif
diff --git a/include/linux/reiserfs_fs_i.h b/include/linux/reiserfs_fs_i.h
index 76360b36ac33..89f4d3abbf5a 100644
--- a/include/linux/reiserfs_fs_i.h
+++ b/include/linux/reiserfs_fs_i.h
@@ -54,10 +54,6 @@ struct reiserfs_inode_info {
54 unsigned int i_trans_id; 54 unsigned int i_trans_id;
55 struct reiserfs_journal_list *i_jl; 55 struct reiserfs_journal_list *i_jl;
56 struct mutex i_mmap; 56 struct mutex i_mmap;
57#ifdef CONFIG_REISERFS_FS_POSIX_ACL
58 struct posix_acl *i_acl_access;
59 struct posix_acl *i_acl_default;
60#endif
61#ifdef CONFIG_REISERFS_FS_XATTR 57#ifdef CONFIG_REISERFS_FS_XATTR
62 struct rw_semaphore i_xattr_sem; 58 struct rw_semaphore i_xattr_sem;
63#endif 59#endif
diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h
index 16e39c7a67fc..e73e2429a1b1 100644
--- a/include/linux/rfkill.h
+++ b/include/linux/rfkill.h
@@ -160,8 +160,9 @@ struct rfkill * __must_check rfkill_alloc(const char *name,
160 * the rfkill structure. Before calling this function the driver needs 160 * the rfkill structure. Before calling this function the driver needs
161 * to be ready to service method calls from rfkill. 161 * to be ready to service method calls from rfkill.
162 * 162 *
163 * If the software blocked state is not set before registration, 163 * If rfkill_init_sw_state() is not called before registration,
164 * set_block will be called to initialize it to a default value. 164 * set_block() will be called to initialize the software blocked state
165 * to a default value.
165 * 166 *
166 * If the hardware blocked state is not set before registration, 167 * If the hardware blocked state is not set before registration,
167 * it is assumed to be unblocked. 168 * it is assumed to be unblocked.
@@ -234,9 +235,11 @@ bool __must_check rfkill_set_hw_state(struct rfkill *rfkill, bool blocked);
234 * rfkill drivers that get events when the soft-blocked state changes 235 * rfkill drivers that get events when the soft-blocked state changes
235 * (yes, some platforms directly act on input but allow changing again) 236 * (yes, some platforms directly act on input but allow changing again)
236 * use this function to notify the rfkill core (and through that also 237 * use this function to notify the rfkill core (and through that also
237 * userspace) of the current state. It is not necessary to notify on 238 * userspace) of the current state.
238 * resume; since hibernation can always change the soft-blocked state, 239 *
239 * the rfkill core will unconditionally restore the previous state. 240 * Drivers should also call this function after resume if the state has
241 * been changed by the user. This only makes sense for "persistent"
242 * devices (see rfkill_init_sw_state()).
240 * 243 *
241 * This function can be called in any context, even from within rfkill 244 * This function can be called in any context, even from within rfkill
242 * callbacks. 245 * callbacks.
@@ -247,6 +250,22 @@ bool __must_check rfkill_set_hw_state(struct rfkill *rfkill, bool blocked);
247bool rfkill_set_sw_state(struct rfkill *rfkill, bool blocked); 250bool rfkill_set_sw_state(struct rfkill *rfkill, bool blocked);
248 251
249/** 252/**
253 * rfkill_init_sw_state - Initialize persistent software block state
254 * @rfkill: pointer to the rfkill class to modify.
255 * @state: the current software block state to set
256 *
257 * rfkill drivers that preserve their software block state over power off
258 * use this function to notify the rfkill core (and through that also
259 * userspace) of their initial state. It should only be used before
260 * registration.
261 *
262 * In addition, it marks the device as "persistent", an attribute which
263 * can be read by userspace. Persistent devices are expected to preserve
264 * their own state when suspended.
265 */
266void rfkill_init_sw_state(struct rfkill *rfkill, bool blocked);
267
268/**
250 * rfkill_set_states - Set the internal rfkill block states 269 * rfkill_set_states - Set the internal rfkill block states
251 * @rfkill: pointer to the rfkill class to modify. 270 * @rfkill: pointer to the rfkill class to modify.
252 * @sw: the current software block state to set 271 * @sw: the current software block state to set
@@ -307,6 +326,10 @@ static inline bool rfkill_set_sw_state(struct rfkill *rfkill, bool blocked)
307 return blocked; 326 return blocked;
308} 327}
309 328
329static inline void rfkill_init_sw_state(struct rfkill *rfkill, bool blocked)
330{
331}
332
310static inline void rfkill_set_states(struct rfkill *rfkill, bool sw, bool hw) 333static inline void rfkill_set_states(struct rfkill *rfkill, bool sw, bool hw)
311{ 334{
312} 335}
diff --git a/include/linux/rmap.h b/include/linux/rmap.h
index 216d024f830d..bf116d0dbf23 100644
--- a/include/linux/rmap.h
+++ b/include/linux/rmap.h
@@ -118,7 +118,14 @@ int try_to_munlock(struct page *);
118#define anon_vma_prepare(vma) (0) 118#define anon_vma_prepare(vma) (0)
119#define anon_vma_link(vma) do {} while (0) 119#define anon_vma_link(vma) do {} while (0)
120 120
121#define page_referenced(page, locked, cnt, flags) TestClearPageReferenced(page) 121static inline int page_referenced(struct page *page, int is_locked,
122 struct mem_cgroup *cnt,
123 unsigned long *vm_flags)
124{
125 *vm_flags = 0;
126 return TestClearPageReferenced(page);
127}
128
122#define try_to_unmap(page, refs) SWAP_FAIL 129#define try_to_unmap(page, refs) SWAP_FAIL
123 130
124static inline int page_mkclean(struct page *page) 131static inline int page_mkclean(struct page *page)
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 6fd80c4243f1..23d2fb051f97 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -171,6 +171,9 @@
171/* Timberdale UART */ 171/* Timberdale UART */
172#define PORT_TIMBUART 87 172#define PORT_TIMBUART 87
173 173
174/* Qualcomm MSM SoCs */
175#define PORT_MSM 88
176
174#ifdef __KERNEL__ 177#ifdef __KERNEL__
175 178
176#include <linux/compiler.h> 179#include <linux/compiler.h>
diff --git a/include/linux/serial_reg.h b/include/linux/serial_reg.h
index 96c0d93fc2ca..850db2e80510 100644
--- a/include/linux/serial_reg.h
+++ b/include/linux/serial_reg.h
@@ -323,6 +323,7 @@
323#define UART_OMAP_MVER 0x14 /* Module version register */ 323#define UART_OMAP_MVER 0x14 /* Module version register */
324#define UART_OMAP_SYSC 0x15 /* System configuration register */ 324#define UART_OMAP_SYSC 0x15 /* System configuration register */
325#define UART_OMAP_SYSS 0x16 /* System status register */ 325#define UART_OMAP_SYSS 0x16 /* System status register */
326#define UART_OMAP_WER 0x17 /* Wake-up enable register */
326 327
327#endif /* _LINUX_SERIAL_REG_H */ 328#endif /* _LINUX_SERIAL_REG_H */
328 329
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h
index fd83f2584b15..abff6c9b413c 100644
--- a/include/linux/shmem_fs.h
+++ b/include/linux/shmem_fs.h
@@ -19,10 +19,6 @@ struct shmem_inode_info {
19 swp_entry_t i_direct[SHMEM_NR_DIRECT]; /* first blocks */ 19 swp_entry_t i_direct[SHMEM_NR_DIRECT]; /* first blocks */
20 struct list_head swaplist; /* chain of maybes on swap */ 20 struct list_head swaplist; /* chain of maybes on swap */
21 struct inode vfs_inode; 21 struct inode vfs_inode;
22#ifdef CONFIG_TMPFS_POSIX_ACL
23 struct posix_acl *i_acl;
24 struct posix_acl *i_default_acl;
25#endif
26}; 22};
27 23
28struct shmem_sb_info { 24struct shmem_sb_info {
@@ -45,7 +41,6 @@ static inline struct shmem_inode_info *SHMEM_I(struct inode *inode)
45#ifdef CONFIG_TMPFS_POSIX_ACL 41#ifdef CONFIG_TMPFS_POSIX_ACL
46int shmem_permission(struct inode *, int); 42int shmem_permission(struct inode *, int);
47int shmem_acl_init(struct inode *, struct inode *); 43int shmem_acl_init(struct inode *, struct inode *);
48void shmem_acl_destroy_inode(struct inode *);
49 44
50extern struct xattr_handler shmem_xattr_acl_access_handler; 45extern struct xattr_handler shmem_xattr_acl_access_handler;
51extern struct xattr_handler shmem_xattr_acl_default_handler; 46extern struct xattr_handler shmem_xattr_acl_default_handler;
@@ -57,9 +52,6 @@ static inline int shmem_acl_init(struct inode *inode, struct inode *dir)
57{ 52{
58 return 0; 53 return 0;
59} 54}
60static inline void shmem_acl_destroy_inode(struct inode *inode)
61{
62}
63#endif /* CONFIG_TMPFS_POSIX_ACL */ 55#endif /* CONFIG_TMPFS_POSIX_ACL */
64 56
65#endif 57#endif
diff --git a/include/linux/sunrpc/bc_xprt.h b/include/linux/sunrpc/bc_xprt.h
new file mode 100644
index 000000000000..6508f0dc0eff
--- /dev/null
+++ b/include/linux/sunrpc/bc_xprt.h
@@ -0,0 +1,49 @@
1/******************************************************************************
2
3(c) 2008 NetApp. All Rights Reserved.
4
5NetApp provides this source code under the GPL v2 License.
6The GPL v2 license is available at
7http://opensource.org/licenses/gpl-license.php.
8
9THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
10"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
11LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
12A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
13CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
14EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
15PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
16PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
17LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
18NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
19SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
20
21******************************************************************************/
22
23/*
24 * Functions to create and manage the backchannel
25 */
26
27#ifndef _LINUX_SUNRPC_BC_XPRT_H
28#define _LINUX_SUNRPC_BC_XPRT_H
29
30#include <linux/sunrpc/svcsock.h>
31#include <linux/sunrpc/xprt.h>
32#include <linux/sunrpc/sched.h>
33
34#ifdef CONFIG_NFS_V4_1
35struct rpc_rqst *xprt_alloc_bc_request(struct rpc_xprt *xprt);
36void xprt_free_bc_request(struct rpc_rqst *req);
37int xprt_setup_backchannel(struct rpc_xprt *, unsigned int min_reqs);
38void xprt_destroy_backchannel(struct rpc_xprt *, int max_reqs);
39void bc_release_request(struct rpc_task *);
40int bc_send(struct rpc_rqst *req);
41#else /* CONFIG_NFS_V4_1 */
42static inline int xprt_setup_backchannel(struct rpc_xprt *xprt,
43 unsigned int min_reqs)
44{
45 return 0;
46}
47#endif /* CONFIG_NFS_V4_1 */
48#endif /* _LINUX_SUNRPC_BC_XPRT_H */
49
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
index c39a21040dcb..37881f1a0bd7 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -143,6 +143,7 @@ int rpc_call_sync(struct rpc_clnt *clnt,
143 const struct rpc_message *msg, int flags); 143 const struct rpc_message *msg, int flags);
144struct rpc_task *rpc_call_null(struct rpc_clnt *clnt, struct rpc_cred *cred, 144struct rpc_task *rpc_call_null(struct rpc_clnt *clnt, struct rpc_cred *cred,
145 int flags); 145 int flags);
146void rpc_restart_call_prepare(struct rpc_task *);
146void rpc_restart_call(struct rpc_task *); 147void rpc_restart_call(struct rpc_task *);
147void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int); 148void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int);
148size_t rpc_max_payload(struct rpc_clnt *); 149size_t rpc_max_payload(struct rpc_clnt *);
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
index 64981a2f1cae..401097781fc0 100644
--- a/include/linux/sunrpc/sched.h
+++ b/include/linux/sunrpc/sched.h
@@ -210,6 +210,8 @@ struct rpc_wait_queue {
210 */ 210 */
211struct rpc_task *rpc_new_task(const struct rpc_task_setup *); 211struct rpc_task *rpc_new_task(const struct rpc_task_setup *);
212struct rpc_task *rpc_run_task(const struct rpc_task_setup *); 212struct rpc_task *rpc_run_task(const struct rpc_task_setup *);
213struct rpc_task *rpc_run_bc_task(struct rpc_rqst *req,
214 const struct rpc_call_ops *ops);
213void rpc_put_task(struct rpc_task *); 215void rpc_put_task(struct rpc_task *);
214void rpc_exit_task(struct rpc_task *); 216void rpc_exit_task(struct rpc_task *);
215void rpc_release_calldata(const struct rpc_call_ops *, void *); 217void rpc_release_calldata(const struct rpc_call_ops *, void *);
@@ -237,6 +239,7 @@ void rpc_show_tasks(void);
237int rpc_init_mempool(void); 239int rpc_init_mempool(void);
238void rpc_destroy_mempool(void); 240void rpc_destroy_mempool(void);
239extern struct workqueue_struct *rpciod_workqueue; 241extern struct workqueue_struct *rpciod_workqueue;
242void rpc_prepare_task(struct rpc_task *task);
240 243
241static inline void rpc_exit(struct rpc_task *task, int status) 244static inline void rpc_exit(struct rpc_task *task, int status)
242{ 245{
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 2a30775959e9..ea8009695c69 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -96,6 +96,15 @@ struct svc_serv {
96 svc_thread_fn sv_function; /* main function for threads */ 96 svc_thread_fn sv_function; /* main function for threads */
97 unsigned int sv_drc_max_pages; /* Total pages for DRC */ 97 unsigned int sv_drc_max_pages; /* Total pages for DRC */
98 unsigned int sv_drc_pages_used;/* DRC pages used */ 98 unsigned int sv_drc_pages_used;/* DRC pages used */
99#if defined(CONFIG_NFS_V4_1)
100 struct list_head sv_cb_list; /* queue for callback requests
101 * that arrive over the same
102 * connection */
103 spinlock_t sv_cb_lock; /* protects the svc_cb_list */
104 wait_queue_head_t sv_cb_waitq; /* sleep here if there are no
105 * entries in the svc_cb_list */
106 struct svc_xprt *bc_xprt;
107#endif /* CONFIG_NFS_V4_1 */
99}; 108};
100 109
101/* 110/*
@@ -411,6 +420,8 @@ int svc_set_num_threads(struct svc_serv *, struct svc_pool *, int);
411int svc_pool_stats_open(struct svc_serv *serv, struct file *file); 420int svc_pool_stats_open(struct svc_serv *serv, struct file *file);
412void svc_destroy(struct svc_serv *); 421void svc_destroy(struct svc_serv *);
413int svc_process(struct svc_rqst *); 422int svc_process(struct svc_rqst *);
423int bc_svc_process(struct svc_serv *, struct rpc_rqst *,
424 struct svc_rqst *);
414int svc_register(const struct svc_serv *, const int, 425int svc_register(const struct svc_serv *, const int,
415 const unsigned short, const unsigned short); 426 const unsigned short, const unsigned short);
416 427
diff --git a/include/linux/sunrpc/svc_xprt.h b/include/linux/sunrpc/svc_xprt.h
index 0d9cb6ef28b0..2223ae0b5ed5 100644
--- a/include/linux/sunrpc/svc_xprt.h
+++ b/include/linux/sunrpc/svc_xprt.h
@@ -83,7 +83,7 @@ int svc_port_is_privileged(struct sockaddr *sin);
83int svc_print_xprts(char *buf, int maxlen); 83int svc_print_xprts(char *buf, int maxlen);
84struct svc_xprt *svc_find_xprt(struct svc_serv *serv, const char *xcl_name, 84struct svc_xprt *svc_find_xprt(struct svc_serv *serv, const char *xcl_name,
85 const sa_family_t af, const unsigned short port); 85 const sa_family_t af, const unsigned short port);
86int svc_xprt_names(struct svc_serv *serv, char *buf, int buflen); 86int svc_xprt_names(struct svc_serv *serv, char *buf, const int buflen);
87 87
88static inline void svc_xprt_get(struct svc_xprt *xprt) 88static inline void svc_xprt_get(struct svc_xprt *xprt)
89{ 89{
@@ -118,7 +118,7 @@ static inline unsigned short svc_addr_port(const struct sockaddr *sa)
118 return 0; 118 return 0;
119} 119}
120 120
121static inline size_t svc_addr_len(struct sockaddr *sa) 121static inline size_t svc_addr_len(const struct sockaddr *sa)
122{ 122{
123 switch (sa->sa_family) { 123 switch (sa->sa_family) {
124 case AF_INET: 124 case AF_INET:
@@ -126,7 +126,8 @@ static inline size_t svc_addr_len(struct sockaddr *sa)
126 case AF_INET6: 126 case AF_INET6:
127 return sizeof(struct sockaddr_in6); 127 return sizeof(struct sockaddr_in6);
128 } 128 }
129 return -EAFNOSUPPORT; 129
130 return 0;
130} 131}
131 132
132static inline unsigned short svc_xprt_local_port(const struct svc_xprt *xprt) 133static inline unsigned short svc_xprt_local_port(const struct svc_xprt *xprt)
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h
index 483e10380aae..04dba23c59f2 100644
--- a/include/linux/sunrpc/svcsock.h
+++ b/include/linux/sunrpc/svcsock.h
@@ -38,10 +38,15 @@ int svc_recv(struct svc_rqst *, long);
38int svc_send(struct svc_rqst *); 38int svc_send(struct svc_rqst *);
39void svc_drop(struct svc_rqst *); 39void svc_drop(struct svc_rqst *);
40void svc_sock_update_bufs(struct svc_serv *serv); 40void svc_sock_update_bufs(struct svc_serv *serv);
41int svc_sock_names(char *buf, struct svc_serv *serv, char *toclose); 41int svc_sock_names(struct svc_serv *serv, char *buf,
42int svc_addsock(struct svc_serv *serv, int fd, char *name_return); 42 const size_t buflen,
43 const char *toclose);
44int svc_addsock(struct svc_serv *serv, const int fd,
45 char *name_return, const size_t len);
43void svc_init_xprt_sock(void); 46void svc_init_xprt_sock(void);
44void svc_cleanup_xprt_sock(void); 47void svc_cleanup_xprt_sock(void);
48struct svc_xprt *svc_sock_create(struct svc_serv *serv, int prot);
49void svc_sock_destroy(struct svc_xprt *);
45 50
46/* 51/*
47 * svc_makesock socket characteristics 52 * svc_makesock socket characteristics
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index 08afe43118f4..1175d58efc2e 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -67,7 +67,8 @@ struct rpc_rqst {
67 struct rpc_task * rq_task; /* RPC task data */ 67 struct rpc_task * rq_task; /* RPC task data */
68 __be32 rq_xid; /* request XID */ 68 __be32 rq_xid; /* request XID */
69 int rq_cong; /* has incremented xprt->cong */ 69 int rq_cong; /* has incremented xprt->cong */
70 int rq_received; /* receive completed */ 70 int rq_reply_bytes_recvd; /* number of reply */
71 /* bytes received */
71 u32 rq_seqno; /* gss seq no. used on req. */ 72 u32 rq_seqno; /* gss seq no. used on req. */
72 int rq_enc_pages_num; 73 int rq_enc_pages_num;
73 struct page **rq_enc_pages; /* scratch pages for use by 74 struct page **rq_enc_pages; /* scratch pages for use by
@@ -97,6 +98,12 @@ struct rpc_rqst {
97 98
98 unsigned long rq_xtime; /* when transmitted */ 99 unsigned long rq_xtime; /* when transmitted */
99 int rq_ntrans; 100 int rq_ntrans;
101
102#if defined(CONFIG_NFS_V4_1)
103 struct list_head rq_bc_list; /* Callback service list */
104 unsigned long rq_bc_pa_state; /* Backchannel prealloc state */
105 struct list_head rq_bc_pa_list; /* Backchannel prealloc list */
106#endif /* CONFIG_NFS_V4_1 */
100}; 107};
101#define rq_svec rq_snd_buf.head 108#define rq_svec rq_snd_buf.head
102#define rq_slen rq_snd_buf.len 109#define rq_slen rq_snd_buf.len
@@ -174,6 +181,15 @@ struct rpc_xprt {
174 spinlock_t reserve_lock; /* lock slot table */ 181 spinlock_t reserve_lock; /* lock slot table */
175 u32 xid; /* Next XID value to use */ 182 u32 xid; /* Next XID value to use */
176 struct rpc_task * snd_task; /* Task blocked in send */ 183 struct rpc_task * snd_task; /* Task blocked in send */
184#if defined(CONFIG_NFS_V4_1)
185 struct svc_serv *bc_serv; /* The RPC service which will */
186 /* process the callback */
187 unsigned int bc_alloc_count; /* Total number of preallocs */
188 spinlock_t bc_pa_lock; /* Protects the preallocated
189 * items */
190 struct list_head bc_pa_list; /* List of preallocated
191 * backchannel rpc_rqst's */
192#endif /* CONFIG_NFS_V4_1 */
177 struct list_head recv; 193 struct list_head recv;
178 194
179 struct { 195 struct {
@@ -192,6 +208,26 @@ struct rpc_xprt {
192 const char *address_strings[RPC_DISPLAY_MAX]; 208 const char *address_strings[RPC_DISPLAY_MAX];
193}; 209};
194 210
211#if defined(CONFIG_NFS_V4_1)
212/*
213 * Backchannel flags
214 */
215#define RPC_BC_PA_IN_USE 0x0001 /* Preallocated backchannel */
216 /* buffer in use */
217#endif /* CONFIG_NFS_V4_1 */
218
219#if defined(CONFIG_NFS_V4_1)
220static inline int bc_prealloc(struct rpc_rqst *req)
221{
222 return test_bit(RPC_BC_PA_IN_USE, &req->rq_bc_pa_state);
223}
224#else
225static inline int bc_prealloc(struct rpc_rqst *req)
226{
227 return 0;
228}
229#endif /* CONFIG_NFS_V4_1 */
230
195struct xprt_create { 231struct xprt_create {
196 int ident; /* XPRT_TRANSPORT identifier */ 232 int ident; /* XPRT_TRANSPORT identifier */
197 struct sockaddr * srcaddr; /* optional local address */ 233 struct sockaddr * srcaddr; /* optional local address */
diff --git a/include/linux/swap.h b/include/linux/swap.h
index c88b36665f79..7c15334f3ff2 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -298,8 +298,8 @@ extern int try_to_free_swap(struct page *);
298struct backing_dev_info; 298struct backing_dev_info;
299 299
300/* linux/mm/thrash.c */ 300/* linux/mm/thrash.c */
301extern struct mm_struct * swap_token_mm; 301extern struct mm_struct *swap_token_mm;
302extern void grab_swap_token(void); 302extern void grab_swap_token(struct mm_struct *);
303extern void __put_swap_token(struct mm_struct *); 303extern void __put_swap_token(struct mm_struct *);
304 304
305static inline int has_swap_token(struct mm_struct *mm) 305static inline int has_swap_token(struct mm_struct *mm)
@@ -419,10 +419,10 @@ static inline swp_entry_t get_swap_page(void)
419} 419}
420 420
421/* linux/mm/thrash.c */ 421/* linux/mm/thrash.c */
422#define put_swap_token(x) do { } while(0) 422#define put_swap_token(mm) do { } while (0)
423#define grab_swap_token() do { } while(0) 423#define grab_swap_token(mm) do { } while (0)
424#define has_swap_token(x) 0 424#define has_swap_token(mm) 0
425#define disable_swap_token() do { } while(0) 425#define disable_swap_token() do { } while (0)
426 426
427static inline void 427static inline void
428mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent) 428mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent)
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index f24eceecc5a6..8a025d510904 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -348,6 +348,7 @@ struct v4l2_pix_format {
348#define V4L2_PIX_FMT_SQ905C v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */ 348#define V4L2_PIX_FMT_SQ905C v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */
349#define V4L2_PIX_FMT_PJPG v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */ 349#define V4L2_PIX_FMT_PJPG v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */
350#define V4L2_PIX_FMT_YVYU v4l2_fourcc('Y', 'V', 'Y', 'U') /* 16 YVU 4:2:2 */ 350#define V4L2_PIX_FMT_YVYU v4l2_fourcc('Y', 'V', 'Y', 'U') /* 16 YVU 4:2:2 */
351#define V4L2_PIX_FMT_OV511 v4l2_fourcc('O', '5', '1', '1') /* ov511 JPEG */
351#define V4L2_PIX_FMT_OV518 v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */ 352#define V4L2_PIX_FMT_OV518 v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */
352 353
353/* 354/*
@@ -894,9 +895,10 @@ enum v4l2_colorfx {
894 V4L2_COLORFX_BW = 1, 895 V4L2_COLORFX_BW = 1,
895 V4L2_COLORFX_SEPIA = 2, 896 V4L2_COLORFX_SEPIA = 2,
896}; 897};
898#define V4L2_CID_AUTOBRIGHTNESS (V4L2_CID_BASE+32)
897 899
898/* last CID + 1 */ 900/* last CID + 1 */
899#define V4L2_CID_LASTP1 (V4L2_CID_BASE+32) 901#define V4L2_CID_LASTP1 (V4L2_CID_BASE+33)
900 902
901/* MPEG-class control IDs defined by V4L2 */ 903/* MPEG-class control IDs defined by V4L2 */
902#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) 904#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)
diff --git a/include/media/ir-common.h b/include/media/ir-common.h
index 7b5b91f60425..9dcb632f6083 100644
--- a/include/media/ir-common.h
+++ b/include/media/ir-common.h
@@ -162,6 +162,8 @@ extern IR_KEYTAB_TYPE ir_codes_ati_tv_wonder_hd_600[IR_KEYTAB_SIZE];
162extern IR_KEYTAB_TYPE ir_codes_kworld_plus_tv_analog[IR_KEYTAB_SIZE]; 162extern IR_KEYTAB_TYPE ir_codes_kworld_plus_tv_analog[IR_KEYTAB_SIZE];
163extern IR_KEYTAB_TYPE ir_codes_kaiomy[IR_KEYTAB_SIZE]; 163extern IR_KEYTAB_TYPE ir_codes_kaiomy[IR_KEYTAB_SIZE];
164extern IR_KEYTAB_TYPE ir_codes_dm1105_nec[IR_KEYTAB_SIZE]; 164extern IR_KEYTAB_TYPE ir_codes_dm1105_nec[IR_KEYTAB_SIZE];
165extern IR_KEYTAB_TYPE ir_codes_evga_indtube[IR_KEYTAB_SIZE];
166
165#endif 167#endif
166 168
167/* 169/*
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h
index c48c24e4d0fa..33a18426ab9b 100644
--- a/include/media/v4l2-common.h
+++ b/include/media/v4l2-common.h
@@ -153,6 +153,22 @@ struct v4l2_subdev *v4l2_i2c_new_probed_subdev(struct v4l2_device *v4l2_dev,
153struct v4l2_subdev *v4l2_i2c_new_probed_subdev_addr(struct v4l2_device *v4l2_dev, 153struct v4l2_subdev *v4l2_i2c_new_probed_subdev_addr(struct v4l2_device *v4l2_dev,
154 struct i2c_adapter *adapter, 154 struct i2c_adapter *adapter,
155 const char *module_name, const char *client_type, u8 addr); 155 const char *module_name, const char *client_type, u8 addr);
156
157/* Load an i2c module and return an initialized v4l2_subdev struct.
158 Only call request_module if module_name != NULL.
159 The client_type argument is the name of the chip that's on the adapter. */
160struct v4l2_subdev *v4l2_i2c_new_subdev_cfg(struct v4l2_device *v4l2_dev,
161 struct i2c_adapter *adapter,
162 const char *module_name, const char *client_type,
163 int irq, void *platform_data,
164 u8 addr, const unsigned short *probe_addrs);
165
166struct i2c_board_info;
167
168struct v4l2_subdev *v4l2_i2c_new_subdev_board(struct v4l2_device *v4l2_dev,
169 struct i2c_adapter *adapter, const char *module_name,
170 struct i2c_board_info *info, const unsigned short *probe_addrs);
171
156/* Initialize an v4l2_subdev with data from an i2c_client struct */ 172/* Initialize an v4l2_subdev with data from an i2c_client struct */
157void v4l2_i2c_subdev_init(struct v4l2_subdev *sd, struct i2c_client *client, 173void v4l2_i2c_subdev_init(struct v4l2_subdev *sd, struct i2c_client *client,
158 const struct v4l2_subdev_ops *ops); 174 const struct v4l2_subdev_ops *ops);
@@ -193,4 +209,14 @@ struct v4l2_routing {
193 u32 output; 209 u32 output;
194}; 210};
195 211
212/* ------------------------------------------------------------------------- */
213
214/* Miscellaneous helper functions */
215
216void v4l_bound_align_image(unsigned int *w, unsigned int wmin,
217 unsigned int wmax, unsigned int walign,
218 unsigned int *h, unsigned int hmin,
219 unsigned int hmax, unsigned int halign,
220 unsigned int salign);
221
196#endif /* V4L2_COMMON_H_ */ 222#endif /* V4L2_COMMON_H_ */
diff --git a/include/media/v4l2-i2c-drv.h b/include/media/v4l2-i2c-drv.h
index 10a2882c3cbf..74bf741d1a9b 100644
--- a/include/media/v4l2-i2c-drv.h
+++ b/include/media/v4l2-i2c-drv.h
@@ -22,7 +22,7 @@
22 */ 22 */
23 23
24/* NOTE: the full version of this header is in the v4l-dvb repository 24/* NOTE: the full version of this header is in the v4l-dvb repository
25 * and allows v4l i2c drivers to be compiled on older kernels as well. 25 * and allows v4l i2c drivers to be compiled on pre-2.6.26 kernels.
26 * The version of this header as it appears in the kernel is a stripped 26 * The version of this header as it appears in the kernel is a stripped
27 * version (without all the backwards compatibility stuff) and so it 27 * version (without all the backwards compatibility stuff) and so it
28 * looks a bit odd. 28 * looks a bit odd.
@@ -30,6 +30,9 @@
30 * If you look at the full version then you will understand the reason 30 * If you look at the full version then you will understand the reason
31 * for introducing this header since you really don't want to have all 31 * for introducing this header since you really don't want to have all
32 * the tricky backwards compatibility code in each and every i2c driver. 32 * the tricky backwards compatibility code in each and every i2c driver.
33 *
34 * If the i2c driver will never be compiled for pre-2.6.26 kernels, then
35 * DO NOT USE this header! Just write it as a regular i2c driver.
33 */ 36 */
34 37
35#ifndef __V4L2_I2C_DRV_H__ 38#ifndef __V4L2_I2C_DRV_H__
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index a503e1cee78b..5dcb36785529 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -79,7 +79,11 @@ struct v4l2_decode_vbi_line {
79 not yet implemented) since ops provide proper type-checking. 79 not yet implemented) since ops provide proper type-checking.
80 */ 80 */
81 81
82/* init: initialize the sensor registors to some sort of reasonable default 82/* s_config: if set, then it is always called by the v4l2_i2c_new_subdev*
83 functions after the v4l2_subdev was registered. It is used to pass
84 platform data to the subdev which can be used during initialization.
85
86 init: initialize the sensor registors to some sort of reasonable default
83 values. Do not use for new drivers and should be removed in existing 87 values. Do not use for new drivers and should be removed in existing
84 drivers. 88 drivers.
85 89
@@ -96,6 +100,7 @@ struct v4l2_decode_vbi_line {
96struct v4l2_subdev_core_ops { 100struct v4l2_subdev_core_ops {
97 int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip); 101 int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip);
98 int (*log_status)(struct v4l2_subdev *sd); 102 int (*log_status)(struct v4l2_subdev *sd);
103 int (*s_config)(struct v4l2_subdev *sd, int irq, void *platform_data);
99 int (*init)(struct v4l2_subdev *sd, u32 val); 104 int (*init)(struct v4l2_subdev *sd, u32 val);
100 int (*load_fw)(struct v4l2_subdev *sd); 105 int (*load_fw)(struct v4l2_subdev *sd);
101 int (*reset)(struct v4l2_subdev *sd, u32 val); 106 int (*reset)(struct v4l2_subdev *sd, u32 val);
diff --git a/include/mtd/Kbuild b/include/mtd/Kbuild
index 8eb018f96002..192f8fb7d546 100644
--- a/include/mtd/Kbuild
+++ b/include/mtd/Kbuild
@@ -1,5 +1,4 @@
1header-y += inftl-user.h 1header-y += inftl-user.h
2header-y += jffs2-user.h
3header-y += mtd-abi.h 2header-y += mtd-abi.h
4header-y += mtd-user.h 3header-y += mtd-user.h
5header-y += nftl-user.h 4header-y += nftl-user.h
diff --git a/include/mtd/jffs2-user.h b/include/mtd/jffs2-user.h
deleted file mode 100644
index fa94b0eb67c1..000000000000
--- a/include/mtd/jffs2-user.h
+++ /dev/null
@@ -1,34 +0,0 @@
1/*
2 * JFFS2 definitions for use in user space only
3 */
4
5#ifndef __JFFS2_USER_H__
6#define __JFFS2_USER_H__
7
8/* This file is blessed for inclusion by userspace */
9#include <linux/jffs2.h>
10#include <linux/types.h>
11#include <endian.h>
12#include <byteswap.h>
13
14#undef cpu_to_je16
15#undef cpu_to_je32
16#undef cpu_to_jemode
17#undef je16_to_cpu
18#undef je32_to_cpu
19#undef jemode_to_cpu
20
21extern int target_endian;
22
23#define t16(x) ({ __u16 __b = (x); (target_endian==__BYTE_ORDER)?__b:bswap_16(__b); })
24#define t32(x) ({ __u32 __b = (x); (target_endian==__BYTE_ORDER)?__b:bswap_32(__b); })
25
26#define cpu_to_je16(x) ((jint16_t){t16(x)})
27#define cpu_to_je32(x) ((jint32_t){t32(x)})
28#define cpu_to_jemode(x) ((jmode_t){t32(x)})
29
30#define je16_to_cpu(x) (t16((x).v16))
31#define je32_to_cpu(x) (t32((x).v32))
32#define jemode_to_cpu(x) (t32((x).m))
33
34#endif /* __JFFS2_USER_H__ */
diff --git a/include/mtd/mtd-abi.h b/include/mtd/mtd-abi.h
index b6595b3c68b6..be51ae2bd0ff 100644
--- a/include/mtd/mtd-abi.h
+++ b/include/mtd/mtd-abi.h
@@ -12,12 +12,24 @@ struct erase_info_user {
12 __u32 length; 12 __u32 length;
13}; 13};
14 14
15struct erase_info_user64 {
16 __u64 start;
17 __u64 length;
18};
19
15struct mtd_oob_buf { 20struct mtd_oob_buf {
16 __u32 start; 21 __u32 start;
17 __u32 length; 22 __u32 length;
18 unsigned char __user *ptr; 23 unsigned char __user *ptr;
19}; 24};
20 25
26struct mtd_oob_buf64 {
27 __u64 start;
28 __u32 pad;
29 __u32 length;
30 __u64 usr_ptr;
31};
32
21#define MTD_ABSENT 0 33#define MTD_ABSENT 0
22#define MTD_RAM 1 34#define MTD_RAM 1
23#define MTD_ROM 2 35#define MTD_ROM 2
@@ -95,6 +107,9 @@ struct otp_info {
95#define ECCGETLAYOUT _IOR('M', 17, struct nand_ecclayout) 107#define ECCGETLAYOUT _IOR('M', 17, struct nand_ecclayout)
96#define ECCGETSTATS _IOR('M', 18, struct mtd_ecc_stats) 108#define ECCGETSTATS _IOR('M', 18, struct mtd_ecc_stats)
97#define MTDFILEMODE _IO('M', 19) 109#define MTDFILEMODE _IO('M', 19)
110#define MEMERASE64 _IOW('M', 20, struct erase_info_user64)
111#define MEMWRITEOOB64 _IOWR('M', 21, struct mtd_oob_buf64)
112#define MEMREADOOB64 _IOWR('M', 22, struct mtd_oob_buf64)
98 113
99/* 114/*
100 * Obsolete legacy interface. Keep it in order not to break userspace 115 * Obsolete legacy interface. Keep it in order not to break userspace
diff --git a/include/net/iucv/af_iucv.h b/include/net/iucv/af_iucv.h
index 21ee49ffcbaf..f82a1e877372 100644
--- a/include/net/iucv/af_iucv.h
+++ b/include/net/iucv/af_iucv.h
@@ -94,8 +94,6 @@ unsigned int iucv_sock_poll(struct file *file, struct socket *sock,
94 poll_table *wait); 94 poll_table *wait);
95void iucv_sock_link(struct iucv_sock_list *l, struct sock *s); 95void iucv_sock_link(struct iucv_sock_list *l, struct sock *s);
96void iucv_sock_unlink(struct iucv_sock_list *l, struct sock *s); 96void iucv_sock_unlink(struct iucv_sock_list *l, struct sock *s);
97int iucv_sock_wait_state(struct sock *sk, int state, int state2,
98 unsigned long timeo);
99int iucv_sock_wait_cnt(struct sock *sk, unsigned long timeo); 97int iucv_sock_wait_cnt(struct sock *sk, unsigned long timeo);
100void iucv_accept_enqueue(struct sock *parent, struct sock *sk); 98void iucv_accept_enqueue(struct sock *parent, struct sock *sk);
101void iucv_accept_unlink(struct sock *sk); 99void iucv_accept_unlink(struct sock *sk);
diff --git a/include/net/protocol.h b/include/net/protocol.h
index ffa5b8b1f1df..1089d5aabd49 100644
--- a/include/net/protocol.h
+++ b/include/net/protocol.h
@@ -53,7 +53,7 @@ struct inet6_protocol
53 53
54 void (*err_handler)(struct sk_buff *skb, 54 void (*err_handler)(struct sk_buff *skb,
55 struct inet6_skb_parm *opt, 55 struct inet6_skb_parm *opt,
56 int type, int code, int offset, 56 u8 type, u8 code, int offset,
57 __be32 info); 57 __be32 info);
58 58
59 int (*gso_send_check)(struct sk_buff *skb); 59 int (*gso_send_check)(struct sk_buff *skb);
diff --git a/include/net/rawv6.h b/include/net/rawv6.h
index 8a22599f26ba..f6b9b830df8c 100644
--- a/include/net/rawv6.h
+++ b/include/net/rawv6.h
@@ -6,7 +6,7 @@
6#include <net/protocol.h> 6#include <net/protocol.h>
7 7
8void raw6_icmp_error(struct sk_buff *, int nexthdr, 8void raw6_icmp_error(struct sk_buff *, int nexthdr,
9 int type, int code, int inner_offset, __be32); 9 u8 type, u8 code, int inner_offset, __be32);
10int raw6_local_deliver(struct sk_buff *, int); 10int raw6_local_deliver(struct sk_buff *, int);
11 11
12extern int rawv6_rcv(struct sock *sk, 12extern int rawv6_rcv(struct sock *sk,
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index 9f80a7668289..d16a304cbed4 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -448,6 +448,7 @@ static inline void sctp_skb_set_owner_r(struct sk_buff *skb, struct sock *sk)
448{ 448{
449 struct sctp_ulpevent *event = sctp_skb2event(skb); 449 struct sctp_ulpevent *event = sctp_skb2event(skb);
450 450
451 skb_orphan(skb);
451 skb->sk = sk; 452 skb->sk = sk;
452 skb->destructor = sctp_sock_rfree; 453 skb->destructor = sctp_sock_rfree;
453 atomic_add(event->rmem_len, &sk->sk_rmem_alloc); 454 atomic_add(event->rmem_len, &sk->sk_rmem_alloc);
diff --git a/include/net/sock.h b/include/net/sock.h
index 07133c5e9868..352f06bbd7a9 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1252,6 +1252,7 @@ static inline int sk_has_allocations(const struct sock *sk)
1252 1252
1253static inline void skb_set_owner_w(struct sk_buff *skb, struct sock *sk) 1253static inline void skb_set_owner_w(struct sk_buff *skb, struct sock *sk)
1254{ 1254{
1255 skb_orphan(skb);
1255 skb->sk = sk; 1256 skb->sk = sk;
1256 skb->destructor = sock_wfree; 1257 skb->destructor = sock_wfree;
1257 /* 1258 /*
@@ -1264,6 +1265,7 @@ static inline void skb_set_owner_w(struct sk_buff *skb, struct sock *sk)
1264 1265
1265static inline void skb_set_owner_r(struct sk_buff *skb, struct sock *sk) 1266static inline void skb_set_owner_r(struct sk_buff *skb, struct sock *sk)
1266{ 1267{
1268 skb_orphan(skb);
1267 skb->sk = sk; 1269 skb->sk = sk;
1268 skb->destructor = sock_rfree; 1270 skb->destructor = sock_rfree;
1269 atomic_add(skb->truesize, &sk->sk_rmem_alloc); 1271 atomic_add(skb->truesize, &sk->sk_rmem_alloc);
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 736bca450886..9e3a3f4c1f60 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -1274,7 +1274,7 @@ struct xfrm_tunnel {
1274struct xfrm6_tunnel { 1274struct xfrm6_tunnel {
1275 int (*handler)(struct sk_buff *skb); 1275 int (*handler)(struct sk_buff *skb);
1276 int (*err_handler)(struct sk_buff *skb, struct inet6_skb_parm *opt, 1276 int (*err_handler)(struct sk_buff *skb, struct inet6_skb_parm *opt,
1277 int type, int code, int offset, __be32 info); 1277 u8 type, u8 code, int offset, __be32 info);
1278 struct xfrm6_tunnel *next; 1278 struct xfrm6_tunnel *next;
1279 int priority; 1279 int priority;
1280}; 1280};
diff --git a/include/scsi/fc_encode.h b/include/scsi/fc_encode.h
index 6300f556bce5..a0ff61c3e935 100644
--- a/include/scsi/fc_encode.h
+++ b/include/scsi/fc_encode.h
@@ -107,7 +107,6 @@ static inline int fc_ct_fill(struct fc_lport *lport, struct fc_frame *fp,
107 break; 107 break;
108 108
109 default: 109 default:
110 FC_DBG("Invalid op code %x \n", op);
111 return -EINVAL; 110 return -EINVAL;
112 } 111 }
113 *r_ctl = FC_RCTL_DD_UNSOL_CTL; 112 *r_ctl = FC_RCTL_DD_UNSOL_CTL;
@@ -298,7 +297,6 @@ static inline int fc_els_fill(struct fc_lport *lport, struct fc_rport *rport,
298 break; 297 break;
299 298
300 default: 299 default:
301 FC_DBG("Invalid op code %x \n", op);
302 return -EINVAL; 300 return -EINVAL;
303 } 301 }
304 302
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index ebdd9f4cf070..b92584a8843a 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -34,17 +34,72 @@
34 34
35#include <scsi/fc_frame.h> 35#include <scsi/fc_frame.h>
36 36
37#define LIBFC_DEBUG 37#define FC_LIBFC_LOGGING 0x01 /* General logging, not categorized */
38 38#define FC_LPORT_LOGGING 0x02 /* lport layer logging */
39#ifdef LIBFC_DEBUG 39#define FC_DISC_LOGGING 0x04 /* discovery layer logging */
40/* Log messages */ 40#define FC_RPORT_LOGGING 0x08 /* rport layer logging */
41#define FC_DBG(fmt, args...) \ 41#define FC_FCP_LOGGING 0x10 /* I/O path logging */
42 do { \ 42#define FC_EM_LOGGING 0x20 /* Exchange Manager logging */
43 printk(KERN_INFO "%s " fmt, __func__, ##args); \ 43#define FC_EXCH_LOGGING 0x40 /* Exchange/Sequence logging */
44 } while (0) 44#define FC_SCSI_LOGGING 0x80 /* SCSI logging (mostly error handling) */
45#else 45
46#define FC_DBG(fmt, args...) 46extern unsigned int fc_debug_logging;
47#endif 47
48#define FC_CHECK_LOGGING(LEVEL, CMD) \
49do { \
50 if (unlikely(fc_debug_logging & LEVEL)) \
51 do { \
52 CMD; \
53 } while (0); \
54} while (0);
55
56#define FC_LIBFC_DBG(fmt, args...) \
57 FC_CHECK_LOGGING(FC_LIBFC_LOGGING, \
58 printk(KERN_INFO "libfc: " fmt, ##args);)
59
60#define FC_LPORT_DBG(lport, fmt, args...) \
61 FC_CHECK_LOGGING(FC_LPORT_LOGGING, \
62 printk(KERN_INFO "lport: %6x: " fmt, \
63 fc_host_port_id(lport->host), ##args);)
64
65#define FC_DISC_DBG(disc, fmt, args...) \
66 FC_CHECK_LOGGING(FC_DISC_LOGGING, \
67 printk(KERN_INFO "disc: %6x: " fmt, \
68 fc_host_port_id(disc->lport->host), \
69 ##args);)
70
71#define FC_RPORT_DBG(rport, fmt, args...) \
72do { \
73 struct fc_rport_libfc_priv *rdata = rport->dd_data; \
74 struct fc_lport *lport = rdata->local_port; \
75 FC_CHECK_LOGGING(FC_RPORT_LOGGING, \
76 printk(KERN_INFO "rport: %6x: %6x: " fmt, \
77 fc_host_port_id(lport->host), \
78 rport->port_id, ##args);) \
79} while (0);
80
81#define FC_FCP_DBG(pkt, fmt, args...) \
82 FC_CHECK_LOGGING(FC_FCP_LOGGING, \
83 printk(KERN_INFO "fcp: %6x: %6x: " fmt, \
84 fc_host_port_id(pkt->lp->host), \
85 pkt->rport->port_id, ##args);)
86
87#define FC_EM_DBG(em, fmt, args...) \
88 FC_CHECK_LOGGING(FC_EM_LOGGING, \
89 printk(KERN_INFO "em: %6x: " fmt, \
90 fc_host_port_id(em->lp->host), \
91 ##args);)
92
93#define FC_EXCH_DBG(exch, fmt, args...) \
94 FC_CHECK_LOGGING(FC_EXCH_LOGGING, \
95 printk(KERN_INFO "exch: %6x: %4x: " fmt, \
96 fc_host_port_id(exch->lp->host), \
97 exch->xid, ##args);)
98
99#define FC_SCSI_DBG(lport, fmt, args...) \
100 FC_CHECK_LOGGING(FC_SCSI_LOGGING, \
101 printk(KERN_INFO "scsi: %6x: " fmt, \
102 fc_host_port_id(lport->host), ##args);)
48 103
49/* 104/*
50 * libfc error codes 105 * libfc error codes
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h
index 196525cd402f..61afeb59a836 100644
--- a/include/scsi/libiscsi.h
+++ b/include/scsi/libiscsi.h
@@ -125,6 +125,10 @@ struct iscsi_task {
125 struct scsi_cmnd *sc; /* associated SCSI cmd*/ 125 struct scsi_cmnd *sc; /* associated SCSI cmd*/
126 struct iscsi_conn *conn; /* used connection */ 126 struct iscsi_conn *conn; /* used connection */
127 127
128 /* data processing tracking */
129 unsigned long last_xfer;
130 unsigned long last_timeout;
131 bool have_checked_conn;
128 /* state set/tested under session->lock */ 132 /* state set/tested under session->lock */
129 int state; 133 int state;
130 atomic_t refcount; 134 atomic_t refcount;
diff --git a/include/scsi/scsi_driver.h b/include/scsi/scsi_driver.h
index 1f5ca7f62116..9fd6702f02e2 100644
--- a/include/scsi/scsi_driver.h
+++ b/include/scsi/scsi_driver.h
@@ -32,5 +32,6 @@ int scsi_setup_blk_pc_cmnd(struct scsi_device *sdev, struct request *req);
32int scsi_setup_fs_cmnd(struct scsi_device *sdev, struct request *req); 32int scsi_setup_fs_cmnd(struct scsi_device *sdev, struct request *req);
33int scsi_prep_state_check(struct scsi_device *sdev, struct request *req); 33int scsi_prep_state_check(struct scsi_device *sdev, struct request *req);
34int scsi_prep_return(struct request_queue *q, struct request *req, int ret); 34int scsi_prep_return(struct request_queue *q, struct request *req, int ret);
35int scsi_prep_fn(struct request_queue *, struct request *);
35 36
36#endif /* _SCSI_SCSI_DRIVER_H */ 37#endif /* _SCSI_SCSI_DRIVER_H */