aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/Kbuild5
-rw-r--r--include/linux/a.out.h20
-rw-r--r--include/linux/ac97_codec.h7
-rw-r--r--include/linux/acct.h4
-rw-r--r--include/linux/acpi.h62
-rw-r--r--include/linux/async_tx.h13
-rw-r--r--include/linux/ata_platform.h (renamed from include/linux/pata_platform.h)13
-rw-r--r--include/linux/atmel_pwm.h70
-rw-r--r--include/linux/blkdev.h4
-rw-r--r--include/linux/bootmem.h17
-rw-r--r--include/linux/byteorder/generic.h30
-rw-r--r--include/linux/cgroup.h16
-rw-r--r--include/linux/cgroup_subsys.h5
-rw-r--r--include/linux/compat.h8
-rw-r--r--include/linux/compiler-gcc4.h9
-rw-r--r--include/linux/cpufreq.h4
-rw-r--r--include/linux/cpuidle.h15
-rw-r--r--include/linux/cpuset.h9
-rw-r--r--include/linux/dca.h2
-rw-r--r--include/linux/device-mapper.h18
-rw-r--r--include/linux/dm-ioctl.h34
-rw-r--r--include/linux/dmaengine.h29
-rw-r--r--include/linux/dmar.h2
-rw-r--r--include/linux/dmi.h10
-rw-r--r--include/linux/ds1wm.h1
-rw-r--r--include/linux/efs_fs.h2
-rw-r--r--include/linux/elf-em.h3
-rw-r--r--include/linux/elf.h3
-rw-r--r--include/linux/elfcore.h4
-rw-r--r--include/linux/enclosure.h129
-rw-r--r--include/linux/err.h13
-rw-r--r--include/linux/ext3_fs.h2
-rw-r--r--include/linux/ext4_fs.h9
-rw-r--r--include/linux/fs.h62
-rw-r--r--include/linux/fsnotify.h22
-rw-r--r--include/linux/genhd.h153
-rw-r--r--include/linux/hash.h42
-rw-r--r--include/linux/hayesesp.h4
-rw-r--r--include/linux/hdlc.h25
-rw-r--r--include/linux/hrtimer.h9
-rw-r--r--include/linux/hugetlb.h1
-rw-r--r--include/linux/i2c-id.h36
-rw-r--r--include/linux/i2c/pca953x.h (renamed from include/linux/i2c/pca9539.h)2
-rw-r--r--include/linux/ide.h11
-rw-r--r--include/linux/if_vlan.h7
-rw-r--r--include/linux/init.h1
-rw-r--r--include/linux/input.h7
-rw-r--r--include/linux/interrupt.h2
-rw-r--r--include/linux/ipc.h52
-rw-r--r--include/linux/ipc_namespace.h81
-rw-r--r--include/linux/irq.h19
-rw-r--r--include/linux/isdn.h1
-rw-r--r--include/linux/isicom.h2
-rw-r--r--include/linux/istallion.h1
-rw-r--r--include/linux/jbd.h3
-rw-r--r--include/linux/jiffies.h6
-rw-r--r--include/linux/kernel.h30
-rw-r--r--include/linux/kexec.h12
-rw-r--r--include/linux/kprobes.h3
-rw-r--r--include/linux/ktime.h3
-rw-r--r--include/linux/leds.h5
-rw-r--r--include/linux/libata.h2
-rw-r--r--include/linux/log2.h16
-rw-r--r--include/linux/loop.h1
-rw-r--r--include/linux/lp.h4
-rw-r--r--include/linux/memcontrol.h188
-rw-r--r--include/linux/memstick.h299
-rw-r--r--include/linux/mfd/asic3.h497
-rw-r--r--include/linux/mlx4/device.h19
-rw-r--r--include/linux/mlx4/qp.h4
-rw-r--r--include/linux/mm.h14
-rw-r--r--include/linux/mm_types.h11
-rw-r--r--include/linux/module.h4
-rw-r--r--include/linux/mtd/cfi.h12
-rw-r--r--include/linux/mtd/mtd.h9
-rw-r--r--include/linux/mtd/mtdram.h8
-rw-r--r--include/linux/mtd/onenand_regs.h1
-rw-r--r--include/linux/mtd/partitions.h9
-rw-r--r--include/linux/mtd/ubi.h18
-rw-r--r--include/linux/mutex.h12
-rw-r--r--include/linux/nbd.h1
-rw-r--r--include/linux/of.h1
-rw-r--r--include/linux/pci.h16
-rw-r--r--include/linux/pci_ids.h1
-rw-r--r--include/linux/percpu.h2
-rw-r--r--include/linux/pfkeyv2.h1
-rw-r--r--include/linux/pid.h22
-rw-r--r--include/linux/pid_namespace.h6
-rw-r--r--include/linux/pkt_cls.h1
-rw-r--r--include/linux/pnp.h1
-rw-r--r--include/linux/power_supply.h1
-rw-r--r--include/linux/preempt.h4
-rw-r--r--include/linux/proc_fs.h16
-rw-r--r--include/linux/ptrace.h36
-rw-r--r--include/linux/qnx4_fs.h1
-rw-r--r--include/linux/raid/bitmap.h3
-rw-r--r--include/linux/raid/md_k.h23
-rw-r--r--include/linux/rcupdate.h11
-rw-r--r--include/linux/rcupreempt.h4
-rw-r--r--include/linux/reiserfs_fs.h2
-rw-r--r--include/linux/res_counter.h127
-rw-r--r--include/linux/rmap.h5
-rw-r--r--include/linux/sched.h14
-rw-r--r--include/linux/sctp.h4
-rw-r--r--include/linux/serial167.h14
-rw-r--r--include/linux/serial_core.h4
-rw-r--r--include/linux/shm.h8
-rw-r--r--include/linux/shmem_fs.h5
-rw-r--r--include/linux/signal.h3
-rw-r--r--include/linux/slub_def.h23
-rw-r--r--include/linux/sm501.h2
-rw-r--r--include/linux/sonypi.h2
-rw-r--r--include/linux/spinlock.h2
-rw-r--r--include/linux/ssb/ssb.h9
-rw-r--r--include/linux/stallion.h1
-rw-r--r--include/linux/swap.h4
-rw-r--r--include/linux/swapops.h2
-rw-r--r--include/linux/thermal.h111
-rw-r--r--include/linux/tifm.h4
-rw-r--r--include/linux/time.h2
-rw-r--r--include/linux/timer.h6
-rw-r--r--include/linux/timex.h11
-rw-r--r--include/linux/tty.h8
-rw-r--r--include/linux/types.h6
-rw-r--r--include/linux/udf_fs.h7
-rw-r--r--include/linux/udf_fs_sb.h12
-rw-r--r--include/linux/ufs_fs.h953
-rw-r--r--include/linux/utsname.h21
-rw-r--r--include/linux/vt_kern.h1
-rw-r--r--include/linux/w1-gpio.h23
130 files changed, 2411 insertions, 1438 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 93631229fd5c..5cae9b5960ea 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -18,7 +18,6 @@ header-y += usb/
18 18
19header-y += affs_hardblocks.h 19header-y += affs_hardblocks.h
20header-y += aio_abi.h 20header-y += aio_abi.h
21header-y += a.out.h
22header-y += arcfb.h 21header-y += arcfb.h
23header-y += atmapi.h 22header-y += atmapi.h
24header-y += atmbr2684.h 23header-y += atmbr2684.h
@@ -60,7 +59,6 @@ header-y += dqblk_v2.h
60header-y += dqblk_xfs.h 59header-y += dqblk_xfs.h
61header-y += efs_fs_sb.h 60header-y += efs_fs_sb.h
62header-y += elf-fdpic.h 61header-y += elf-fdpic.h
63header-y += elf.h
64header-y += elf-em.h 62header-y += elf-em.h
65header-y += fadvise.h 63header-y += fadvise.h
66header-y += fd.h 64header-y += fd.h
@@ -190,6 +188,7 @@ unifdef-y += dccp.h
190unifdef-y += dirent.h 188unifdef-y += dirent.h
191unifdef-y += dlm.h 189unifdef-y += dlm.h
192unifdef-y += edd.h 190unifdef-y += edd.h
191unifdef-y += elf.h
193unifdef-y += elfcore.h 192unifdef-y += elfcore.h
194unifdef-y += errno.h 193unifdef-y += errno.h
195unifdef-y += errqueue.h 194unifdef-y += errqueue.h
@@ -339,12 +338,10 @@ unifdef-y += tty.h
339unifdef-y += types.h 338unifdef-y += types.h
340unifdef-y += udf_fs_i.h 339unifdef-y += udf_fs_i.h
341unifdef-y += udp.h 340unifdef-y += udp.h
342unifdef-y += ufs_fs.h
343unifdef-y += uinput.h 341unifdef-y += uinput.h
344unifdef-y += uio.h 342unifdef-y += uio.h
345unifdef-y += unistd.h 343unifdef-y += unistd.h
346unifdef-y += usbdevice_fs.h 344unifdef-y += usbdevice_fs.h
347unifdef-y += user.h
348unifdef-y += utsname.h 345unifdef-y += utsname.h
349unifdef-y += videodev2.h 346unifdef-y += videodev2.h
350unifdef-y += videodev.h 347unifdef-y += videodev.h
diff --git a/include/linux/a.out.h b/include/linux/a.out.h
index f913cc3e1b0d..208f4e8ed304 100644
--- a/include/linux/a.out.h
+++ b/include/linux/a.out.h
@@ -1,6 +1,8 @@
1#ifndef __A_OUT_GNU_H__ 1#ifndef __A_OUT_GNU_H__
2#define __A_OUT_GNU_H__ 2#define __A_OUT_GNU_H__
3 3
4#ifdef CONFIG_ARCH_SUPPORTS_AOUT
5
4#define __GNU_EXEC_MACROS__ 6#define __GNU_EXEC_MACROS__
5 7
6#ifndef __STRUCT_EXEC_OVERRIDE__ 8#ifndef __STRUCT_EXEC_OVERRIDE__
@@ -9,6 +11,8 @@
9 11
10#endif /* __STRUCT_EXEC_OVERRIDE__ */ 12#endif /* __STRUCT_EXEC_OVERRIDE__ */
11 13
14#ifndef __ASSEMBLY__
15
12/* these go in the N_MACHTYPE field */ 16/* these go in the N_MACHTYPE field */
13enum machine_type { 17enum machine_type {
14#if defined (M_OLDSUN2) 18#if defined (M_OLDSUN2)
@@ -128,12 +132,20 @@ enum machine_type {
128#endif 132#endif
129 133
130#ifdef linux 134#ifdef linux
135#ifdef __KERNEL__
131#include <asm/page.h> 136#include <asm/page.h>
137#else
138#include <unistd.h>
139#endif
132#if defined(__i386__) || defined(__mc68000__) 140#if defined(__i386__) || defined(__mc68000__)
133#define SEGMENT_SIZE 1024 141#define SEGMENT_SIZE 1024
134#else 142#else
135#ifndef SEGMENT_SIZE 143#ifndef SEGMENT_SIZE
144#ifdef __KERNEL__
136#define SEGMENT_SIZE PAGE_SIZE 145#define SEGMENT_SIZE PAGE_SIZE
146#else
147#define SEGMENT_SIZE getpagesize()
148#endif
137#endif 149#endif
138#endif 150#endif
139#endif 151#endif
@@ -264,5 +276,11 @@ struct relocation_info
264}; 276};
265#endif /* no N_RELOCATION_INFO_DECLARED. */ 277#endif /* no N_RELOCATION_INFO_DECLARED. */
266 278
267 279#endif /*__ASSEMBLY__ */
280#else /* CONFIG_ARCH_SUPPORTS_AOUT */
281#ifndef __ASSEMBLY__
282struct exec {
283};
284#endif
285#endif /* CONFIG_ARCH_SUPPORTS_AOUT */
268#endif /* __A_OUT_GNU_H__ */ 286#endif /* __A_OUT_GNU_H__ */
diff --git a/include/linux/ac97_codec.h b/include/linux/ac97_codec.h
index 22eb9367235a..0260c3e79fdd 100644
--- a/include/linux/ac97_codec.h
+++ b/include/linux/ac97_codec.h
@@ -326,11 +326,7 @@ struct ac97_ops
326#define AC97_DEFAULT_POWER_OFF 4 /* Needs warm reset to power up */ 326#define AC97_DEFAULT_POWER_OFF 4 /* Needs warm reset to power up */
327}; 327};
328 328
329extern int ac97_read_proc (char *page_out, char **start, off_t off,
330 int count, int *eof, void *data);
331extern int ac97_probe_codec(struct ac97_codec *); 329extern int ac97_probe_codec(struct ac97_codec *);
332extern unsigned int ac97_set_adc_rate(struct ac97_codec *codec, unsigned int rate);
333extern unsigned int ac97_set_dac_rate(struct ac97_codec *codec, unsigned int rate);
334 330
335extern struct ac97_codec *ac97_alloc_codec(void); 331extern struct ac97_codec *ac97_alloc_codec(void);
336extern void ac97_release_codec(struct ac97_codec *codec); 332extern void ac97_release_codec(struct ac97_codec *codec);
@@ -363,7 +359,4 @@ struct ac97_quirk {
363 int type; /* quirk type above */ 359 int type; /* quirk type above */
364}; 360};
365 361
366struct pci_dev;
367extern int ac97_tune_hardware(struct pci_dev *pdev, struct ac97_quirk *quirk, int override);
368
369#endif /* _AC97_CODEC_H_ */ 362#endif /* _AC97_CODEC_H_ */
diff --git a/include/linux/acct.h b/include/linux/acct.h
index 302eb727ecb8..e8cae54e8d88 100644
--- a/include/linux/acct.h
+++ b/include/linux/acct.h
@@ -173,7 +173,11 @@ typedef struct acct acct_t;
173static inline u32 jiffies_to_AHZ(unsigned long x) 173static inline u32 jiffies_to_AHZ(unsigned long x)
174{ 174{
175#if (TICK_NSEC % (NSEC_PER_SEC / AHZ)) == 0 175#if (TICK_NSEC % (NSEC_PER_SEC / AHZ)) == 0
176# if HZ < AHZ
177 return x * (AHZ / HZ);
178# else
176 return x / (HZ / AHZ); 179 return x / (HZ / AHZ);
180# endif
177#else 181#else
178 u64 tmp = (u64)x * TICK_NSEC; 182 u64 tmp = (u64)x * TICK_NSEC;
179 do_div(tmp, (NSEC_PER_SEC / AHZ)); 183 do_div(tmp, (NSEC_PER_SEC / AHZ));
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 63f2e6ed698f..ddbe7efe590e 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -25,6 +25,7 @@
25#ifndef _LINUX_ACPI_H 25#ifndef _LINUX_ACPI_H
26#define _LINUX_ACPI_H 26#define _LINUX_ACPI_H
27 27
28#include <linux/ioport.h> /* for struct resource */
28 29
29#ifdef CONFIG_ACPI 30#ifdef CONFIG_ACPI
30 31
@@ -43,8 +44,6 @@
43#include <linux/dmi.h> 44#include <linux/dmi.h>
44 45
45 46
46#ifdef CONFIG_ACPI
47
48enum acpi_irq_model_id { 47enum acpi_irq_model_id {
49 ACPI_IRQ_MODEL_PIC = 0, 48 ACPI_IRQ_MODEL_PIC = 0,
50 ACPI_IRQ_MODEL_IOAPIC, 49 ACPI_IRQ_MODEL_IOAPIC,
@@ -80,7 +79,6 @@ typedef int (*acpi_table_handler) (struct acpi_table_header *table);
80typedef int (*acpi_table_entry_handler) (struct acpi_subtable_header *header, const unsigned long end); 79typedef int (*acpi_table_entry_handler) (struct acpi_subtable_header *header, const unsigned long end);
81 80
82char * __acpi_map_table (unsigned long phys_addr, unsigned long size); 81char * __acpi_map_table (unsigned long phys_addr, unsigned long size);
83unsigned long acpi_find_rsdp (void);
84int acpi_boot_init (void); 82int acpi_boot_init (void);
85int acpi_boot_table_init (void); 83int acpi_boot_table_init (void);
86int acpi_numa_init (void); 84int acpi_numa_init (void);
@@ -115,8 +113,8 @@ int acpi_unmap_lsapic(int cpu);
115 113
116int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base); 114int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base);
117int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base); 115int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base);
118 116void acpi_irq_stats_init(void);
119extern int acpi_mp_config; 117extern u32 acpi_irq_handled;
120 118
121extern struct acpi_mcfg_allocation *pci_mmcfg_config; 119extern struct acpi_mcfg_allocation *pci_mmcfg_config;
122extern int pci_mmcfg_config_num; 120extern int pci_mmcfg_config_num;
@@ -124,12 +122,6 @@ extern int pci_mmcfg_config_num;
124extern int sbf_port; 122extern int sbf_port;
125extern unsigned long acpi_realmode_flags; 123extern unsigned long acpi_realmode_flags;
126 124
127#else /* !CONFIG_ACPI */
128
129#define acpi_mp_config 0
130
131#endif /* !CONFIG_ACPI */
132
133int acpi_register_gsi (u32 gsi, int triggering, int polarity); 125int acpi_register_gsi (u32 gsi, int triggering, int polarity);
134int acpi_gsi_to_irq (u32 gsi, unsigned int *irq); 126int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
135 127
@@ -145,8 +137,6 @@ extern int acpi_get_override_irq(int bus_irq, int *trigger, int *polarity);
145 */ 137 */
146void acpi_unregister_gsi (u32 gsi); 138void acpi_unregister_gsi (u32 gsi);
147 139
148#ifdef CONFIG_ACPI
149
150struct acpi_prt_entry { 140struct acpi_prt_entry {
151 struct list_head node; 141 struct list_head node;
152 struct acpi_pci_id id; 142 struct acpi_pci_id id;
@@ -179,8 +169,6 @@ struct acpi_pci_driver {
179int acpi_pci_register_driver(struct acpi_pci_driver *driver); 169int acpi_pci_register_driver(struct acpi_pci_driver *driver);
180void acpi_pci_unregister_driver(struct acpi_pci_driver *driver); 170void acpi_pci_unregister_driver(struct acpi_pci_driver *driver);
181 171
182#endif /* CONFIG_ACPI */
183
184#ifdef CONFIG_ACPI_EC 172#ifdef CONFIG_ACPI_EC
185 173
186extern int ec_read(u8 addr, u8 *val); 174extern int ec_read(u8 addr, u8 *val);
@@ -192,6 +180,26 @@ extern int ec_transaction(u8 command,
192 180
193#endif /*CONFIG_ACPI_EC*/ 181#endif /*CONFIG_ACPI_EC*/
194 182
183#if defined(CONFIG_ACPI_WMI) || defined(CONFIG_ACPI_WMI_MODULE)
184
185typedef void (*wmi_notify_handler) (u32 value, void *context);
186
187extern acpi_status wmi_evaluate_method(const char *guid, u8 instance,
188 u32 method_id,
189 const struct acpi_buffer *in,
190 struct acpi_buffer *out);
191extern acpi_status wmi_query_block(const char *guid, u8 instance,
192 struct acpi_buffer *out);
193extern acpi_status wmi_set_block(const char *guid, u8 instance,
194 const struct acpi_buffer *in);
195extern acpi_status wmi_install_notify_handler(const char *guid,
196 wmi_notify_handler handler, void *data);
197extern acpi_status wmi_remove_notify_handler(const char *guid);
198extern acpi_status wmi_get_event_data(u32 event, struct acpi_buffer *out);
199extern bool wmi_has_guid(const char *guid);
200
201#endif /* CONFIG_ACPI_WMI */
202
195extern int acpi_blacklisted(void); 203extern int acpi_blacklisted(void);
196#ifdef CONFIG_DMI 204#ifdef CONFIG_DMI
197extern void acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d); 205extern void acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d);
@@ -217,6 +225,13 @@ extern int pnpacpi_disabled;
217#define PXM_INVAL (-1) 225#define PXM_INVAL (-1)
218#define NID_INVAL (-1) 226#define NID_INVAL (-1)
219 227
228int acpi_check_resource_conflict(struct resource *res);
229
230int acpi_check_region(resource_size_t start, resource_size_t n,
231 const char *name);
232int acpi_check_mem_region(resource_size_t start, resource_size_t n,
233 const char *name);
234
220#else /* CONFIG_ACPI */ 235#else /* CONFIG_ACPI */
221 236
222static inline int acpi_boot_init(void) 237static inline int acpi_boot_init(void)
@@ -229,5 +244,22 @@ static inline int acpi_boot_table_init(void)
229 return 0; 244 return 0;
230} 245}
231 246
247static inline int acpi_check_resource_conflict(struct resource *res)
248{
249 return 0;
250}
251
252static inline int acpi_check_region(resource_size_t start, resource_size_t n,
253 const char *name)
254{
255 return 0;
256}
257
258static inline int acpi_check_mem_region(resource_size_t start,
259 resource_size_t n, const char *name)
260{
261 return 0;
262}
263
232#endif /* !CONFIG_ACPI */ 264#endif /* !CONFIG_ACPI */
233#endif /*_LINUX_ACPI_H*/ 265#endif /*_LINUX_ACPI_H*/
diff --git a/include/linux/async_tx.h b/include/linux/async_tx.h
index bdca3f1b3213..eb640f0acfac 100644
--- a/include/linux/async_tx.h
+++ b/include/linux/async_tx.h
@@ -47,7 +47,6 @@ struct dma_chan_ref {
47 * address is an implied source, whereas the asynchronous case it must be listed 47 * address is an implied source, whereas the asynchronous case it must be listed
48 * as a source. The destination address must be the first address in the source 48 * as a source. The destination address must be the first address in the source
49 * array. 49 * array.
50 * @ASYNC_TX_ASSUME_COHERENT: skip cache maintenance operations
51 * @ASYNC_TX_ACK: immediately ack the descriptor, precludes setting up a 50 * @ASYNC_TX_ACK: immediately ack the descriptor, precludes setting up a
52 * dependency chain 51 * dependency chain
53 * @ASYNC_TX_DEP_ACK: ack the dependency descriptor. Useful for chaining. 52 * @ASYNC_TX_DEP_ACK: ack the dependency descriptor. Useful for chaining.
@@ -55,7 +54,6 @@ struct dma_chan_ref {
55enum async_tx_flags { 54enum async_tx_flags {
56 ASYNC_TX_XOR_ZERO_DST = (1 << 0), 55 ASYNC_TX_XOR_ZERO_DST = (1 << 0),
57 ASYNC_TX_XOR_DROP_DST = (1 << 1), 56 ASYNC_TX_XOR_DROP_DST = (1 << 1),
58 ASYNC_TX_ASSUME_COHERENT = (1 << 2),
59 ASYNC_TX_ACK = (1 << 3), 57 ASYNC_TX_ACK = (1 << 3),
60 ASYNC_TX_DEP_ACK = (1 << 4), 58 ASYNC_TX_DEP_ACK = (1 << 4),
61}; 59};
@@ -64,9 +62,15 @@ enum async_tx_flags {
64void async_tx_issue_pending_all(void); 62void async_tx_issue_pending_all(void);
65enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx); 63enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx);
66void async_tx_run_dependencies(struct dma_async_tx_descriptor *tx); 64void async_tx_run_dependencies(struct dma_async_tx_descriptor *tx);
65#ifdef CONFIG_ARCH_HAS_ASYNC_TX_FIND_CHANNEL
66#include <asm/async_tx.h>
67#else
68#define async_tx_find_channel(dep, type, dst, dst_count, src, src_count, len) \
69 __async_tx_find_channel(dep, type)
67struct dma_chan * 70struct dma_chan *
68async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx, 71__async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx,
69 enum dma_transaction_type tx_type); 72 enum dma_transaction_type tx_type);
73#endif /* CONFIG_ARCH_HAS_ASYNC_TX_FIND_CHANNEL */
70#else 74#else
71static inline void async_tx_issue_pending_all(void) 75static inline void async_tx_issue_pending_all(void)
72{ 76{
@@ -88,7 +92,8 @@ async_tx_run_dependencies(struct dma_async_tx_descriptor *tx,
88 92
89static inline struct dma_chan * 93static inline struct dma_chan *
90async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx, 94async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx,
91 enum dma_transaction_type tx_type) 95 enum dma_transaction_type tx_type, struct page **dst, int dst_count,
96 struct page **src, int src_count, size_t len)
92{ 97{
93 return NULL; 98 return NULL;
94} 99}
diff --git a/include/linux/pata_platform.h b/include/linux/ata_platform.h
index 6a7a92db294c..b856a2a590d9 100644
--- a/include/linux/pata_platform.h
+++ b/include/linux/ata_platform.h
@@ -1,5 +1,5 @@
1#ifndef __LINUX_PATA_PLATFORM_H 1#ifndef __LINUX_ATA_PLATFORM_H
2#define __LINUX_PATA_PLATFORM_H 2#define __LINUX_ATA_PLATFORM_H
3 3
4struct pata_platform_info { 4struct pata_platform_info {
5 /* 5 /*
@@ -24,4 +24,11 @@ extern int __devinit __pata_platform_probe(struct device *dev,
24 24
25extern int __devexit __pata_platform_remove(struct device *dev); 25extern int __devexit __pata_platform_remove(struct device *dev);
26 26
27#endif /* __LINUX_PATA_PLATFORM_H */ 27/*
28 * Marvell SATA private data
29 */
30struct mv_sata_platform_data {
31 int n_ports; /* number of sata ports */
32};
33
34#endif /* __LINUX_ATA_PLATFORM_H */
diff --git a/include/linux/atmel_pwm.h b/include/linux/atmel_pwm.h
new file mode 100644
index 000000000000..ea04abb3db8e
--- /dev/null
+++ b/include/linux/atmel_pwm.h
@@ -0,0 +1,70 @@
1#ifndef __LINUX_ATMEL_PWM_H
2#define __LINUX_ATMEL_PWM_H
3
4/**
5 * struct pwm_channel - driver handle to a PWM channel
6 * @regs: base of this channel's registers
7 * @index: number of this channel (0..31)
8 * @mck: base clock rate, which can be prescaled and maybe subdivided
9 *
10 * Drivers initialize a pwm_channel structure using pwm_channel_alloc().
11 * Then they configure its clock rate (derived from MCK), alignment,
12 * polarity, and duty cycle by writing directly to the channel registers,
13 * before enabling the channel by calling pwm_channel_enable().
14 *
15 * After emitting a PWM signal for the desired length of time, drivers
16 * may then pwm_channel_disable() or pwm_channel_free(). Both of these
17 * disable the channel, but when it's freed the IRQ is deconfigured and
18 * the channel must later be re-allocated and reconfigured.
19 *
20 * Note that if the period or duty cycle need to be changed while the
21 * PWM channel is operating, drivers must use the PWM_CUPD double buffer
22 * mechanism, either polling until they change or getting implicitly
23 * notified through a once-per-period interrupt handler.
24 */
25struct pwm_channel {
26 void __iomem *regs;
27 unsigned index;
28 unsigned long mck;
29};
30
31extern int pwm_channel_alloc(int index, struct pwm_channel *ch);
32extern int pwm_channel_free(struct pwm_channel *ch);
33
34extern int pwm_clk_alloc(unsigned prescale, unsigned div);
35extern void pwm_clk_free(unsigned clk);
36
37extern int __pwm_channel_onoff(struct pwm_channel *ch, int enabled);
38
39#define pwm_channel_enable(ch) __pwm_channel_onoff((ch), 1)
40#define pwm_channel_disable(ch) __pwm_channel_onoff((ch), 0)
41
42/* periodic interrupts, mostly for CUPD changes to period or cycle */
43extern int pwm_channel_handler(struct pwm_channel *ch,
44 void (*handler)(struct pwm_channel *ch));
45
46/* per-channel registers (banked at pwm_channel->regs) */
47#define PWM_CMR 0x00 /* mode register */
48#define PWM_CPR_CPD (1 << 10) /* set: CUPD modifies period */
49#define PWM_CPR_CPOL (1 << 9) /* set: idle high */
50#define PWM_CPR_CALG (1 << 8) /* set: center align */
51#define PWM_CPR_CPRE (0xf << 0) /* mask: rate is mck/(2^pre) */
52#define PWM_CPR_CLKA (0xb << 0) /* rate CLKA */
53#define PWM_CPR_CLKB (0xc << 0) /* rate CLKB */
54#define PWM_CDTY 0x04 /* duty cycle (max of CPRD) */
55#define PWM_CPRD 0x08 /* period (count up from zero) */
56#define PWM_CCNT 0x0c /* counter (20 bits?) */
57#define PWM_CUPD 0x10 /* update CPRD (or CDTY) next period */
58
59static inline void
60pwm_channel_writel(struct pwm_channel *pwmc, unsigned offset, u32 val)
61{
62 __raw_writel(val, pwmc->regs + offset);
63}
64
65static inline u32 pwm_channel_readl(struct pwm_channel *pwmc, unsigned offset)
66{
67 return __raw_readl(pwmc->regs + offset);
68}
69
70#endif /* __LINUX_ATMEL_PWM_H */
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 90392a9d7a9c..e1888cc5b8ae 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -137,7 +137,9 @@ enum rq_flag_bits {
137#define BLK_MAX_CDB 16 137#define BLK_MAX_CDB 16
138 138
139/* 139/*
140 * try to put the fields that are referenced together in the same cacheline 140 * try to put the fields that are referenced together in the same cacheline.
141 * if you modify this structure, be sure to check block/blk-core.c:rq_init()
142 * as well!
141 */ 143 */
142struct request { 144struct request {
143 struct list_head queuelist; 145 struct list_head queuelist;
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
index 0365ec9fc0c9..4e4e340592fb 100644
--- a/include/linux/bootmem.h
+++ b/include/linux/bootmem.h
@@ -60,8 +60,20 @@ extern void *__alloc_bootmem_core(struct bootmem_data *bdata,
60 unsigned long goal, 60 unsigned long goal,
61 unsigned long limit); 61 unsigned long limit);
62 62
63/*
64 * flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE,
65 * the architecture-specific code should honor this)
66 */
67#define BOOTMEM_DEFAULT 0
68#define BOOTMEM_EXCLUSIVE (1<<0)
69
63#ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE 70#ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE
64extern void reserve_bootmem(unsigned long addr, unsigned long size); 71/*
72 * If flags is 0, then the return value is always 0 (success). If
73 * flags contains BOOTMEM_EXCLUSIVE, then -EBUSY is returned if the
74 * memory already was reserved.
75 */
76extern int reserve_bootmem(unsigned long addr, unsigned long size, int flags);
65#define alloc_bootmem(x) \ 77#define alloc_bootmem(x) \
66 __alloc_bootmem(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) 78 __alloc_bootmem(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS))
67#define alloc_bootmem_low(x) \ 79#define alloc_bootmem_low(x) \
@@ -84,7 +96,8 @@ extern unsigned long init_bootmem_node(pg_data_t *pgdat,
84 unsigned long endpfn); 96 unsigned long endpfn);
85extern void reserve_bootmem_node(pg_data_t *pgdat, 97extern void reserve_bootmem_node(pg_data_t *pgdat,
86 unsigned long physaddr, 98 unsigned long physaddr,
87 unsigned long size); 99 unsigned long size,
100 int flags);
88extern void free_bootmem_node(pg_data_t *pgdat, 101extern void free_bootmem_node(pg_data_t *pgdat,
89 unsigned long addr, 102 unsigned long addr,
90 unsigned long size); 103 unsigned long size);
diff --git a/include/linux/byteorder/generic.h b/include/linux/byteorder/generic.h
index 3dc715b02500..d3771551fdd9 100644
--- a/include/linux/byteorder/generic.h
+++ b/include/linux/byteorder/generic.h
@@ -146,6 +146,36 @@
146#define htons(x) ___htons(x) 146#define htons(x) ___htons(x)
147#define ntohs(x) ___ntohs(x) 147#define ntohs(x) ___ntohs(x)
148 148
149static inline void le16_add_cpu(__le16 *var, u16 val)
150{
151 *var = cpu_to_le16(le16_to_cpu(*var) + val);
152}
153
154static inline void le32_add_cpu(__le32 *var, u32 val)
155{
156 *var = cpu_to_le32(le32_to_cpu(*var) + val);
157}
158
159static inline void le64_add_cpu(__le64 *var, u64 val)
160{
161 *var = cpu_to_le64(le64_to_cpu(*var) + val);
162}
163
164static inline void be16_add_cpu(__be16 *var, u16 val)
165{
166 *var = cpu_to_be16(be16_to_cpu(*var) + val);
167}
168
169static inline void be32_add_cpu(__be32 *var, u32 val)
170{
171 *var = cpu_to_be32(be32_to_cpu(*var) + val);
172}
173
174static inline void be64_add_cpu(__be64 *var, u64 val)
175{
176 *var = cpu_to_be64(be64_to_cpu(*var) + val);
177}
178
149#endif /* KERNEL */ 179#endif /* KERNEL */
150 180
151#endif /* _LINUX_BYTEORDER_GENERIC_H */ 181#endif /* _LINUX_BYTEORDER_GENERIC_H */
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 87479328d46d..ff9055fc3d2a 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -14,6 +14,7 @@
14#include <linux/nodemask.h> 14#include <linux/nodemask.h>
15#include <linux/rcupdate.h> 15#include <linux/rcupdate.h>
16#include <linux/cgroupstats.h> 16#include <linux/cgroupstats.h>
17#include <linux/prio_heap.h>
17 18
18#ifdef CONFIG_CGROUPS 19#ifdef CONFIG_CGROUPS
19 20
@@ -207,6 +208,14 @@ struct cftype {
207 int (*release) (struct inode *inode, struct file *file); 208 int (*release) (struct inode *inode, struct file *file);
208}; 209};
209 210
211struct cgroup_scanner {
212 struct cgroup *cg;
213 int (*test_task)(struct task_struct *p, struct cgroup_scanner *scan);
214 void (*process_task)(struct task_struct *p,
215 struct cgroup_scanner *scan);
216 struct ptr_heap *heap;
217};
218
210/* Add a new file to the given cgroup directory. Should only be 219/* Add a new file to the given cgroup directory. Should only be
211 * called by subsystems from within a populate() method */ 220 * called by subsystems from within a populate() method */
212int cgroup_add_file(struct cgroup *cont, struct cgroup_subsys *subsys, 221int cgroup_add_file(struct cgroup *cont, struct cgroup_subsys *subsys,
@@ -233,6 +242,7 @@ int cgroup_is_descendant(const struct cgroup *cont);
233struct cgroup_subsys { 242struct cgroup_subsys {
234 struct cgroup_subsys_state *(*create)(struct cgroup_subsys *ss, 243 struct cgroup_subsys_state *(*create)(struct cgroup_subsys *ss,
235 struct cgroup *cont); 244 struct cgroup *cont);
245 void (*pre_destroy)(struct cgroup_subsys *ss, struct cgroup *cont);
236 void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cont); 246 void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cont);
237 int (*can_attach)(struct cgroup_subsys *ss, 247 int (*can_attach)(struct cgroup_subsys *ss,
238 struct cgroup *cont, struct task_struct *tsk); 248 struct cgroup *cont, struct task_struct *tsk);
@@ -298,11 +308,17 @@ struct cgroup_iter {
298 * returns NULL or until you want to end the iteration 308 * returns NULL or until you want to end the iteration
299 * 309 *
300 * 3) call cgroup_iter_end() to destroy the iterator. 310 * 3) call cgroup_iter_end() to destroy the iterator.
311 *
312 * Or, call cgroup_scan_tasks() to iterate through every task in a cpuset.
313 * - cgroup_scan_tasks() holds the css_set_lock when calling the test_task()
314 * callback, but not while calling the process_task() callback.
301 */ 315 */
302void cgroup_iter_start(struct cgroup *cont, struct cgroup_iter *it); 316void cgroup_iter_start(struct cgroup *cont, struct cgroup_iter *it);
303struct task_struct *cgroup_iter_next(struct cgroup *cont, 317struct task_struct *cgroup_iter_next(struct cgroup *cont,
304 struct cgroup_iter *it); 318 struct cgroup_iter *it);
305void cgroup_iter_end(struct cgroup *cont, struct cgroup_iter *it); 319void cgroup_iter_end(struct cgroup *cont, struct cgroup_iter *it);
320int cgroup_scan_tasks(struct cgroup_scanner *scan);
321int cgroup_attach_task(struct cgroup *, struct task_struct *);
306 322
307#else /* !CONFIG_CGROUPS */ 323#else /* !CONFIG_CGROUPS */
308 324
diff --git a/include/linux/cgroup_subsys.h b/include/linux/cgroup_subsys.h
index 9ec43186ba80..228235c5ae53 100644
--- a/include/linux/cgroup_subsys.h
+++ b/include/linux/cgroup_subsys.h
@@ -37,3 +37,8 @@ SUBSYS(cpuacct)
37 37
38/* */ 38/* */
39 39
40#ifdef CONFIG_CGROUP_MEM_CONT
41SUBSYS(mem_cgroup)
42#endif
43
44/* */
diff --git a/include/linux/compat.h b/include/linux/compat.h
index ae0a483bef9b..a671dbff7a1f 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -257,16 +257,8 @@ asmlinkage long compat_sys_ptrace(compat_long_t request, compat_long_t pid,
257/* 257/*
258 * epoll (fs/eventpoll.c) compat bits follow ... 258 * epoll (fs/eventpoll.c) compat bits follow ...
259 */ 259 */
260#ifndef CONFIG_HAS_COMPAT_EPOLL_EVENT
261struct epoll_event; 260struct epoll_event;
262#define compat_epoll_event epoll_event 261#define compat_epoll_event epoll_event
263#else
264asmlinkage long compat_sys_epoll_ctl(int epfd, int op, int fd,
265 struct compat_epoll_event __user *event);
266asmlinkage long compat_sys_epoll_wait(int epfd,
267 struct compat_epoll_event __user *events,
268 int maxevents, int timeout);
269#endif
270asmlinkage long compat_sys_epoll_pwait(int epfd, 262asmlinkage long compat_sys_epoll_pwait(int epfd,
271 struct compat_epoll_event __user *events, 263 struct compat_epoll_event __user *events,
272 int maxevents, int timeout, 264 int maxevents, int timeout,
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h
index 0ab3a3232330..974f5b7bb205 100644
--- a/include/linux/compiler-gcc4.h
+++ b/include/linux/compiler-gcc4.h
@@ -5,15 +5,6 @@
5/* These definitions are for GCC v4.x. */ 5/* These definitions are for GCC v4.x. */
6#include <linux/compiler-gcc.h> 6#include <linux/compiler-gcc.h>
7 7
8#ifdef CONFIG_FORCED_INLINING
9# undef inline
10# undef __inline__
11# undef __inline
12# define inline inline __attribute__((always_inline))
13# define __inline__ __inline__ __attribute__((always_inline))
14# define __inline __inline __attribute__((always_inline))
15#endif
16
17#define __used __attribute__((__used__)) 8#define __used __attribute__((__used__))
18#define __must_check __attribute__((warn_unused_result)) 9#define __must_check __attribute__((warn_unused_result))
19#define __compiler_offsetof(a,b) __builtin_offsetof(a,b) 10#define __compiler_offsetof(a,b) __builtin_offsetof(a,b)
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 23932d7741a9..ddd8652fc3f3 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -167,6 +167,10 @@ struct cpufreq_governor {
167 char name[CPUFREQ_NAME_LEN]; 167 char name[CPUFREQ_NAME_LEN];
168 int (*governor) (struct cpufreq_policy *policy, 168 int (*governor) (struct cpufreq_policy *policy,
169 unsigned int event); 169 unsigned int event);
170 ssize_t (*show_setspeed) (struct cpufreq_policy *policy,
171 char *buf);
172 int (*store_setspeed) (struct cpufreq_policy *policy,
173 unsigned int freq);
170 unsigned int max_transition_latency; /* HW must be able to switch to 174 unsigned int max_transition_latency; /* HW must be able to switch to
171 next freq faster than this value in nano secs or we 175 next freq faster than this value in nano secs or we
172 will fallback to performance governor */ 176 will fallback to performance governor */
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
index c4e00161a247..385d45b616db 100644
--- a/include/linux/cpuidle.h
+++ b/include/linux/cpuidle.h
@@ -46,9 +46,10 @@ struct cpuidle_state {
46/* Idle State Flags */ 46/* Idle State Flags */
47#define CPUIDLE_FLAG_TIME_VALID (0x01) /* is residency time measurable? */ 47#define CPUIDLE_FLAG_TIME_VALID (0x01) /* is residency time measurable? */
48#define CPUIDLE_FLAG_CHECK_BM (0x02) /* BM activity will exit state */ 48#define CPUIDLE_FLAG_CHECK_BM (0x02) /* BM activity will exit state */
49#define CPUIDLE_FLAG_SHALLOW (0x10) /* low latency, minimal savings */ 49#define CPUIDLE_FLAG_POLL (0x10) /* no latency, no savings */
50#define CPUIDLE_FLAG_BALANCED (0x20) /* medium latency, moderate savings */ 50#define CPUIDLE_FLAG_SHALLOW (0x20) /* low latency, minimal savings */
51#define CPUIDLE_FLAG_DEEP (0x40) /* high latency, large savings */ 51#define CPUIDLE_FLAG_BALANCED (0x40) /* medium latency, moderate savings */
52#define CPUIDLE_FLAG_DEEP (0x80) /* high latency, large savings */
52 53
53#define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000) 54#define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000)
54 55
@@ -79,7 +80,7 @@ struct cpuidle_state_kobj {
79}; 80};
80 81
81struct cpuidle_device { 82struct cpuidle_device {
82 int enabled:1; 83 unsigned int enabled:1;
83 unsigned int cpu; 84 unsigned int cpu;
84 85
85 int last_residency; 86 int last_residency;
@@ -178,4 +179,10 @@ static inline void cpuidle_unregister_governor(struct cpuidle_governor *gov) { }
178 179
179#endif 180#endif
180 181
182#ifdef CONFIG_ARCH_HAS_CPU_RELAX
183#define CPUIDLE_DRIVER_STATE_START 1
184#else
185#define CPUIDLE_DRIVER_STATE_START 0
186#endif
187
181#endif /* _LINUX_CPUIDLE_H */ 188#endif /* _LINUX_CPUIDLE_H */
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h
index ecae585ec3da..f8c9a2752f06 100644
--- a/include/linux/cpuset.h
+++ b/include/linux/cpuset.h
@@ -57,7 +57,9 @@ extern int cpuset_memory_pressure_enabled;
57extern void __cpuset_memory_pressure_bump(void); 57extern void __cpuset_memory_pressure_bump(void);
58 58
59extern const struct file_operations proc_cpuset_operations; 59extern const struct file_operations proc_cpuset_operations;
60extern char *cpuset_task_status_allowed(struct task_struct *task, char *buffer); 60struct seq_file;
61extern void cpuset_task_status_allowed(struct seq_file *m,
62 struct task_struct *task);
61 63
62extern void cpuset_lock(void); 64extern void cpuset_lock(void);
63extern void cpuset_unlock(void); 65extern void cpuset_unlock(void);
@@ -126,10 +128,9 @@ static inline int cpuset_mems_allowed_intersects(const struct task_struct *tsk1,
126 128
127static inline void cpuset_memory_pressure_bump(void) {} 129static inline void cpuset_memory_pressure_bump(void) {}
128 130
129static inline char *cpuset_task_status_allowed(struct task_struct *task, 131static inline void cpuset_task_status_allowed(struct seq_file *m,
130 char *buffer) 132 struct task_struct *task)
131{ 133{
132 return buffer;
133} 134}
134 135
135static inline void cpuset_lock(void) {} 136static inline void cpuset_lock(void) {}
diff --git a/include/linux/dca.h b/include/linux/dca.h
index 83eaecc6f8ab..af61cd1f37e9 100644
--- a/include/linux/dca.h
+++ b/include/linux/dca.h
@@ -11,7 +11,7 @@ void dca_unregister_notify(struct notifier_block *nb);
11 11
12struct dca_provider { 12struct dca_provider {
13 struct dca_ops *ops; 13 struct dca_ops *ops;
14 struct class_device *cd; 14 struct device *cd;
15 int id; 15 int id;
16}; 16};
17 17
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index e765e191663d..cb784579956b 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -110,15 +110,15 @@ struct target_type {
110}; 110};
111 111
112struct io_restrictions { 112struct io_restrictions {
113 unsigned int max_sectors; 113 unsigned long bounce_pfn;
114 unsigned short max_phys_segments; 114 unsigned long seg_boundary_mask;
115 unsigned short max_hw_segments; 115 unsigned max_hw_sectors;
116 unsigned short hardsect_size; 116 unsigned max_sectors;
117 unsigned int max_segment_size; 117 unsigned max_segment_size;
118 unsigned int max_hw_sectors; 118 unsigned short hardsect_size;
119 unsigned long seg_boundary_mask; 119 unsigned short max_hw_segments;
120 unsigned long bounce_pfn; 120 unsigned short max_phys_segments;
121 unsigned char no_cluster; /* inverted so that 0 is default */ 121 unsigned char no_cluster; /* inverted so that 0 is default */
122}; 122};
123 123
124struct dm_target { 124struct dm_target {
diff --git a/include/linux/dm-ioctl.h b/include/linux/dm-ioctl.h
index 523281c5b7f5..b03c41bbfa14 100644
--- a/include/linux/dm-ioctl.h
+++ b/include/linux/dm-ioctl.h
@@ -232,36 +232,6 @@ enum {
232 DM_DEV_SET_GEOMETRY_CMD 232 DM_DEV_SET_GEOMETRY_CMD
233}; 233};
234 234
235/*
236 * The dm_ioctl struct passed into the ioctl is just the header
237 * on a larger chunk of memory. On x86-64 and other
238 * architectures the dm-ioctl struct will be padded to an 8 byte
239 * boundary so the size will be different, which would change the
240 * ioctl code - yes I really messed up. This hack forces these
241 * architectures to have the correct ioctl code.
242 */
243#ifdef CONFIG_COMPAT
244typedef char ioctl_struct[308];
245#define DM_VERSION_32 _IOWR(DM_IOCTL, DM_VERSION_CMD, ioctl_struct)
246#define DM_REMOVE_ALL_32 _IOWR(DM_IOCTL, DM_REMOVE_ALL_CMD, ioctl_struct)
247#define DM_LIST_DEVICES_32 _IOWR(DM_IOCTL, DM_LIST_DEVICES_CMD, ioctl_struct)
248
249#define DM_DEV_CREATE_32 _IOWR(DM_IOCTL, DM_DEV_CREATE_CMD, ioctl_struct)
250#define DM_DEV_REMOVE_32 _IOWR(DM_IOCTL, DM_DEV_REMOVE_CMD, ioctl_struct)
251#define DM_DEV_RENAME_32 _IOWR(DM_IOCTL, DM_DEV_RENAME_CMD, ioctl_struct)
252#define DM_DEV_SUSPEND_32 _IOWR(DM_IOCTL, DM_DEV_SUSPEND_CMD, ioctl_struct)
253#define DM_DEV_STATUS_32 _IOWR(DM_IOCTL, DM_DEV_STATUS_CMD, ioctl_struct)
254#define DM_DEV_WAIT_32 _IOWR(DM_IOCTL, DM_DEV_WAIT_CMD, ioctl_struct)
255
256#define DM_TABLE_LOAD_32 _IOWR(DM_IOCTL, DM_TABLE_LOAD_CMD, ioctl_struct)
257#define DM_TABLE_CLEAR_32 _IOWR(DM_IOCTL, DM_TABLE_CLEAR_CMD, ioctl_struct)
258#define DM_TABLE_DEPS_32 _IOWR(DM_IOCTL, DM_TABLE_DEPS_CMD, ioctl_struct)
259#define DM_TABLE_STATUS_32 _IOWR(DM_IOCTL, DM_TABLE_STATUS_CMD, ioctl_struct)
260#define DM_LIST_VERSIONS_32 _IOWR(DM_IOCTL, DM_LIST_VERSIONS_CMD, ioctl_struct)
261#define DM_TARGET_MSG_32 _IOWR(DM_IOCTL, DM_TARGET_MSG_CMD, ioctl_struct)
262#define DM_DEV_SET_GEOMETRY_32 _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, ioctl_struct)
263#endif
264
265#define DM_IOCTL 0xfd 235#define DM_IOCTL 0xfd
266 236
267#define DM_VERSION _IOWR(DM_IOCTL, DM_VERSION_CMD, struct dm_ioctl) 237#define DM_VERSION _IOWR(DM_IOCTL, DM_VERSION_CMD, struct dm_ioctl)
@@ -286,9 +256,9 @@ typedef char ioctl_struct[308];
286#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) 256#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)
287 257
288#define DM_VERSION_MAJOR 4 258#define DM_VERSION_MAJOR 4
289#define DM_VERSION_MINOR 12 259#define DM_VERSION_MINOR 13
290#define DM_VERSION_PATCHLEVEL 0 260#define DM_VERSION_PATCHLEVEL 0
291#define DM_VERSION_EXTRA "-ioctl (2007-10-02)" 261#define DM_VERSION_EXTRA "-ioctl (2007-10-18)"
292 262
293/* Status bits */ 263/* Status bits */
294#define DM_READONLY_FLAG (1 << 0) /* In/Out */ 264#define DM_READONLY_FLAG (1 << 0) /* In/Out */
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 5c84bf897593..acbb364674ff 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -95,6 +95,15 @@ enum dma_transaction_type {
95#define DMA_TX_TYPE_END (DMA_INTERRUPT + 1) 95#define DMA_TX_TYPE_END (DMA_INTERRUPT + 1)
96 96
97/** 97/**
98 * enum dma_prep_flags - DMA flags to augment operation preparation
99 * @DMA_PREP_INTERRUPT - trigger an interrupt (callback) upon completion of
100 * this transaction
101 */
102enum dma_prep_flags {
103 DMA_PREP_INTERRUPT = (1 << 0),
104};
105
106/**
98 * dma_cap_mask_t - capabilities bitmap modeled after cpumask_t. 107 * dma_cap_mask_t - capabilities bitmap modeled after cpumask_t.
99 * See linux/cpumask.h 108 * See linux/cpumask.h
100 */ 109 */
@@ -209,8 +218,6 @@ typedef void (*dma_async_tx_callback)(void *dma_async_param);
209 * descriptors 218 * descriptors
210 * @chan: target channel for this operation 219 * @chan: target channel for this operation
211 * @tx_submit: set the prepared descriptor(s) to be executed by the engine 220 * @tx_submit: set the prepared descriptor(s) to be executed by the engine
212 * @tx_set_dest: set a destination address in a hardware descriptor
213 * @tx_set_src: set a source address in a hardware descriptor
214 * @callback: routine to call after this operation is complete 221 * @callback: routine to call after this operation is complete
215 * @callback_param: general parameter to pass to the callback routine 222 * @callback_param: general parameter to pass to the callback routine
216 * ---async_tx api specific fields--- 223 * ---async_tx api specific fields---
@@ -227,10 +234,6 @@ struct dma_async_tx_descriptor {
227 struct list_head tx_list; 234 struct list_head tx_list;
228 struct dma_chan *chan; 235 struct dma_chan *chan;
229 dma_cookie_t (*tx_submit)(struct dma_async_tx_descriptor *tx); 236 dma_cookie_t (*tx_submit)(struct dma_async_tx_descriptor *tx);
230 void (*tx_set_dest)(dma_addr_t addr,
231 struct dma_async_tx_descriptor *tx, int index);
232 void (*tx_set_src)(dma_addr_t addr,
233 struct dma_async_tx_descriptor *tx, int index);
234 dma_async_tx_callback callback; 237 dma_async_tx_callback callback;
235 void *callback_param; 238 void *callback_param;
236 struct list_head depend_list; 239 struct list_head depend_list;
@@ -279,15 +282,17 @@ struct dma_device {
279 void (*device_free_chan_resources)(struct dma_chan *chan); 282 void (*device_free_chan_resources)(struct dma_chan *chan);
280 283
281 struct dma_async_tx_descriptor *(*device_prep_dma_memcpy)( 284 struct dma_async_tx_descriptor *(*device_prep_dma_memcpy)(
282 struct dma_chan *chan, size_t len, int int_en); 285 struct dma_chan *chan, dma_addr_t dest, dma_addr_t src,
286 size_t len, unsigned long flags);
283 struct dma_async_tx_descriptor *(*device_prep_dma_xor)( 287 struct dma_async_tx_descriptor *(*device_prep_dma_xor)(
284 struct dma_chan *chan, unsigned int src_cnt, size_t len, 288 struct dma_chan *chan, dma_addr_t dest, dma_addr_t *src,
285 int int_en); 289 unsigned int src_cnt, size_t len, unsigned long flags);
286 struct dma_async_tx_descriptor *(*device_prep_dma_zero_sum)( 290 struct dma_async_tx_descriptor *(*device_prep_dma_zero_sum)(
287 struct dma_chan *chan, unsigned int src_cnt, size_t len, 291 struct dma_chan *chan, dma_addr_t *src, unsigned int src_cnt,
288 u32 *result, int int_en); 292 size_t len, u32 *result, unsigned long flags);
289 struct dma_async_tx_descriptor *(*device_prep_dma_memset)( 293 struct dma_async_tx_descriptor *(*device_prep_dma_memset)(
290 struct dma_chan *chan, int value, size_t len, int int_en); 294 struct dma_chan *chan, dma_addr_t dest, int value, size_t len,
295 unsigned long flags);
291 struct dma_async_tx_descriptor *(*device_prep_dma_interrupt)( 296 struct dma_async_tx_descriptor *(*device_prep_dma_interrupt)(
292 struct dma_chan *chan); 297 struct dma_chan *chan);
293 298
diff --git a/include/linux/dmar.h b/include/linux/dmar.h
index ffb6439cb5e6..56c73b847551 100644
--- a/include/linux/dmar.h
+++ b/include/linux/dmar.h
@@ -28,7 +28,7 @@
28#ifdef CONFIG_DMAR 28#ifdef CONFIG_DMAR
29struct intel_iommu; 29struct intel_iommu;
30 30
31extern char *dmar_get_fault_reason(u8 fault_reason); 31extern const char *dmar_get_fault_reason(u8 fault_reason);
32 32
33/* Can't use the common MSI interrupt functions 33/* Can't use the common MSI interrupt functions
34 * since DMAR is not a pci device 34 * since DMAR is not a pci device
diff --git a/include/linux/dmi.h b/include/linux/dmi.h
index 5b42a659a308..325acdf5c462 100644
--- a/include/linux/dmi.h
+++ b/include/linux/dmi.h
@@ -35,8 +35,11 @@ enum dmi_device_type {
35 DMI_DEV_TYPE_ETHERNET, 35 DMI_DEV_TYPE_ETHERNET,
36 DMI_DEV_TYPE_TOKENRING, 36 DMI_DEV_TYPE_TOKENRING,
37 DMI_DEV_TYPE_SOUND, 37 DMI_DEV_TYPE_SOUND,
38 DMI_DEV_TYPE_PATA,
39 DMI_DEV_TYPE_SATA,
40 DMI_DEV_TYPE_SAS,
38 DMI_DEV_TYPE_IPMI = -1, 41 DMI_DEV_TYPE_IPMI = -1,
39 DMI_DEV_TYPE_OEM_STRING = -2 42 DMI_DEV_TYPE_OEM_STRING = -2,
40}; 43};
41 44
42struct dmi_header { 45struct dmi_header {
@@ -79,7 +82,7 @@ extern void dmi_scan_machine(void);
79extern int dmi_get_year(int field); 82extern int dmi_get_year(int field);
80extern int dmi_name_in_vendors(const char *str); 83extern int dmi_name_in_vendors(const char *str);
81extern int dmi_available; 84extern int dmi_available;
82extern char *dmi_get_slot(int slot); 85extern int dmi_walk(void (*decode)(const struct dmi_header *));
83 86
84#else 87#else
85 88
@@ -90,7 +93,8 @@ static inline const struct dmi_device * dmi_find_device(int type, const char *na
90static inline int dmi_get_year(int year) { return 0; } 93static inline int dmi_get_year(int year) { return 0; }
91static inline int dmi_name_in_vendors(const char *s) { return 0; } 94static inline int dmi_name_in_vendors(const char *s) { return 0; }
92#define dmi_available 0 95#define dmi_available 0
93static inline char *dmi_get_slot(int slot) { return NULL; } 96static inline int dmi_walk(void (*decode)(const struct dmi_header *))
97 { return -1; }
94 98
95#endif 99#endif
96 100
diff --git a/include/linux/ds1wm.h b/include/linux/ds1wm.h
index 31f6e3c427fb..d3c65e48a2e7 100644
--- a/include/linux/ds1wm.h
+++ b/include/linux/ds1wm.h
@@ -6,6 +6,7 @@ struct ds1wm_platform_data {
6 * e.g. on h5xxx and h2200 this is 2 6 * e.g. on h5xxx and h2200 this is 2
7 * (registers aligned to 4-byte boundaries), 7 * (registers aligned to 4-byte boundaries),
8 * while on hx4700 this is 1 */ 8 * while on hx4700 this is 1 */
9 int active_high;
9 void (*enable)(struct platform_device *pdev); 10 void (*enable)(struct platform_device *pdev);
10 void (*disable)(struct platform_device *pdev); 11 void (*disable)(struct platform_device *pdev);
11}; 12};
diff --git a/include/linux/efs_fs.h b/include/linux/efs_fs.h
index dd57fe523e97..a695d63a07af 100644
--- a/include/linux/efs_fs.h
+++ b/include/linux/efs_fs.h
@@ -41,7 +41,7 @@ extern const struct inode_operations efs_dir_inode_operations;
41extern const struct file_operations efs_dir_operations; 41extern const struct file_operations efs_dir_operations;
42extern const struct address_space_operations efs_symlink_aops; 42extern const struct address_space_operations efs_symlink_aops;
43 43
44extern void efs_read_inode(struct inode *); 44extern struct inode *efs_iget(struct super_block *, unsigned long);
45extern efs_block_t efs_map_block(struct inode *, efs_block_t); 45extern efs_block_t efs_map_block(struct inode *, efs_block_t);
46extern int efs_get_block(struct inode *, sector_t, struct buffer_head *, int); 46extern int efs_get_block(struct inode *, sector_t, struct buffer_head *, int);
47 47
diff --git a/include/linux/elf-em.h b/include/linux/elf-em.h
index 5834e843a946..18bea78fe47b 100644
--- a/include/linux/elf-em.h
+++ b/include/linux/elf-em.h
@@ -31,6 +31,7 @@
31#define EM_V850 87 /* NEC v850 */ 31#define EM_V850 87 /* NEC v850 */
32#define EM_M32R 88 /* Renesas M32R */ 32#define EM_M32R 88 /* Renesas M32R */
33#define EM_H8_300 46 /* Renesas H8/300,300H,H8S */ 33#define EM_H8_300 46 /* Renesas H8/300,300H,H8S */
34#define EM_MN10300 89 /* Panasonic/MEI MN10300, AM33 */
34#define EM_BLACKFIN 106 /* ADI Blackfin Processor */ 35#define EM_BLACKFIN 106 /* ADI Blackfin Processor */
35#define EM_FRV 0x5441 /* Fujitsu FR-V */ 36#define EM_FRV 0x5441 /* Fujitsu FR-V */
36#define EM_AVR32 0x18ad /* Atmel AVR32 */ 37#define EM_AVR32 0x18ad /* Atmel AVR32 */
@@ -47,6 +48,8 @@
47#define EM_CYGNUS_M32R 0x9041 48#define EM_CYGNUS_M32R 0x9041
48/* This is the old interim value for S/390 architecture */ 49/* This is the old interim value for S/390 architecture */
49#define EM_S390_OLD 0xA390 50#define EM_S390_OLD 0xA390
51/* Also Panasonic/MEI MN10300, AM33 */
52#define EM_CYGNUS_MN10300 0xbeef
50 53
51 54
52#endif /* _LINUX_ELF_EM_H */ 55#endif /* _LINUX_ELF_EM_H */
diff --git a/include/linux/elf.h b/include/linux/elf.h
index 7ceb24d87c1a..bad1b16ec49a 100644
--- a/include/linux/elf.h
+++ b/include/linux/elf.h
@@ -3,7 +3,9 @@
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/elf-em.h> 5#include <linux/elf-em.h>
6#ifdef __KERNEL__
6#include <asm/elf.h> 7#include <asm/elf.h>
8#endif
7 9
8struct file; 10struct file;
9 11
@@ -355,6 +357,7 @@ typedef struct elf64_shdr {
355#define NT_AUXV 6 357#define NT_AUXV 6
356#define NT_PRXFPREG 0x46e62b7f /* copied from gdb5.1/include/elf/common.h */ 358#define NT_PRXFPREG 0x46e62b7f /* copied from gdb5.1/include/elf/common.h */
357#define NT_PPC_VMX 0x100 /* PowerPC Altivec/VMX registers */ 359#define NT_PPC_VMX 0x100 /* PowerPC Altivec/VMX registers */
360#define NT_PPC_SPE 0x101 /* PowerPC SPE/EVR registers */
358#define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */ 361#define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */
359 362
360 363
diff --git a/include/linux/elfcore.h b/include/linux/elfcore.h
index 9631dddae348..5ca54d77079f 100644
--- a/include/linux/elfcore.h
+++ b/include/linux/elfcore.h
@@ -4,7 +4,9 @@
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/signal.h> 5#include <linux/signal.h>
6#include <linux/time.h> 6#include <linux/time.h>
7#ifdef __KERNEL__
7#include <linux/user.h> 8#include <linux/user.h>
9#endif
8#include <linux/ptrace.h> 10#include <linux/ptrace.h>
9 11
10struct elf_siginfo 12struct elf_siginfo
@@ -14,7 +16,9 @@ struct elf_siginfo
14 int si_errno; /* errno */ 16 int si_errno; /* errno */
15}; 17};
16 18
19#ifdef __KERNEL__
17#include <asm/elf.h> 20#include <asm/elf.h>
21#endif
18 22
19#ifndef __KERNEL__ 23#ifndef __KERNEL__
20typedef elf_greg_t greg_t; 24typedef elf_greg_t greg_t;
diff --git a/include/linux/enclosure.h b/include/linux/enclosure.h
new file mode 100644
index 000000000000..a5978f18ca40
--- /dev/null
+++ b/include/linux/enclosure.h
@@ -0,0 +1,129 @@
1/*
2 * Enclosure Services
3 *
4 * Copyright (C) 2008 James Bottomley <James.Bottomley@HansenPartnership.com>
5 *
6**-----------------------------------------------------------------------------
7**
8** This program is free software; you can redistribute it and/or
9** modify it under the terms of the GNU General Public License
10** version 2 as published by the Free Software Foundation.
11**
12** This program is distributed in the hope that it will be useful,
13** but WITHOUT ANY WARRANTY; without even the implied warranty of
14** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15** GNU General Public License for more details.
16**
17** You should have received a copy of the GNU General Public License
18** along with this program; if not, write to the Free Software
19** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20**
21**-----------------------------------------------------------------------------
22*/
23#ifndef _LINUX_ENCLOSURE_H_
24#define _LINUX_ENCLOSURE_H_
25
26#include <linux/device.h>
27#include <linux/list.h>
28
29/* A few generic types ... taken from ses-2 */
30enum enclosure_component_type {
31 ENCLOSURE_COMPONENT_DEVICE = 0x01,
32 ENCLOSURE_COMPONENT_ARRAY_DEVICE = 0x17,
33};
34
35/* ses-2 common element status */
36enum enclosure_status {
37 ENCLOSURE_STATUS_UNSUPPORTED = 0,
38 ENCLOSURE_STATUS_OK,
39 ENCLOSURE_STATUS_CRITICAL,
40 ENCLOSURE_STATUS_NON_CRITICAL,
41 ENCLOSURE_STATUS_UNRECOVERABLE,
42 ENCLOSURE_STATUS_NOT_INSTALLED,
43 ENCLOSURE_STATUS_UNKNOWN,
44 ENCLOSURE_STATUS_UNAVAILABLE,
45};
46
47/* SFF-8485 activity light settings */
48enum enclosure_component_setting {
49 ENCLOSURE_SETTING_DISABLED = 0,
50 ENCLOSURE_SETTING_ENABLED = 1,
51 ENCLOSURE_SETTING_BLINK_A_ON_OFF = 2,
52 ENCLOSURE_SETTING_BLINK_A_OFF_ON = 3,
53 ENCLOSURE_SETTING_BLINK_B_ON_OFF = 6,
54 ENCLOSURE_SETTING_BLINK_B_OFF_ON = 7,
55};
56
57struct enclosure_device;
58struct enclosure_component;
59struct enclosure_component_callbacks {
60 void (*get_status)(struct enclosure_device *,
61 struct enclosure_component *);
62 int (*set_status)(struct enclosure_device *,
63 struct enclosure_component *,
64 enum enclosure_status);
65 void (*get_fault)(struct enclosure_device *,
66 struct enclosure_component *);
67 int (*set_fault)(struct enclosure_device *,
68 struct enclosure_component *,
69 enum enclosure_component_setting);
70 void (*get_active)(struct enclosure_device *,
71 struct enclosure_component *);
72 int (*set_active)(struct enclosure_device *,
73 struct enclosure_component *,
74 enum enclosure_component_setting);
75 void (*get_locate)(struct enclosure_device *,
76 struct enclosure_component *);
77 int (*set_locate)(struct enclosure_device *,
78 struct enclosure_component *,
79 enum enclosure_component_setting);
80};
81
82
83struct enclosure_component {
84 void *scratch;
85 struct class_device cdev;
86 enum enclosure_component_type type;
87 int number;
88 int fault;
89 int active;
90 int locate;
91 enum enclosure_status status;
92};
93
94struct enclosure_device {
95 void *scratch;
96 struct list_head node;
97 struct class_device cdev;
98 struct enclosure_component_callbacks *cb;
99 int components;
100 struct enclosure_component component[0];
101};
102
103static inline struct enclosure_device *
104to_enclosure_device(struct class_device *dev)
105{
106 return container_of(dev, struct enclosure_device, cdev);
107}
108
109static inline struct enclosure_component *
110to_enclosure_component(struct class_device *dev)
111{
112 return container_of(dev, struct enclosure_component, cdev);
113}
114
115struct enclosure_device *
116enclosure_register(struct device *, const char *, int,
117 struct enclosure_component_callbacks *);
118void enclosure_unregister(struct enclosure_device *);
119struct enclosure_component *
120enclosure_component_register(struct enclosure_device *, unsigned int,
121 enum enclosure_component_type, const char *);
122int enclosure_add_device(struct enclosure_device *enclosure, int component,
123 struct device *dev);
124int enclosure_remove_device(struct enclosure_device *enclosure, int component);
125struct enclosure_device *enclosure_find(struct device *dev);
126int enclosure_for_each_device(int (*fn)(struct enclosure_device *, void *),
127 void *data);
128
129#endif /* _LINUX_ENCLOSURE_H_ */
diff --git a/include/linux/err.h b/include/linux/err.h
index 1ab1d44f8d3b..ec87f3142bf3 100644
--- a/include/linux/err.h
+++ b/include/linux/err.h
@@ -34,6 +34,19 @@ static inline long IS_ERR(const void *ptr)
34 return IS_ERR_VALUE((unsigned long)ptr); 34 return IS_ERR_VALUE((unsigned long)ptr);
35} 35}
36 36
37/**
38 * ERR_CAST - Explicitly cast an error-valued pointer to another pointer type
39 * @ptr: The pointer to cast.
40 *
41 * Explicitly cast an error-valued pointer to another pointer type in such a
42 * way as to make it clear that's what's going on.
43 */
44static inline void *ERR_CAST(const void *ptr)
45{
46 /* cast away the const */
47 return (void *) ptr;
48}
49
37#endif 50#endif
38 51
39#endif /* _LINUX_ERR_H */ 52#endif /* _LINUX_ERR_H */
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index 241c01cb92b2..36c540396377 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -823,7 +823,7 @@ int ext3_get_blocks_handle(handle_t *handle, struct inode *inode,
823 sector_t iblock, unsigned long maxblocks, struct buffer_head *bh_result, 823 sector_t iblock, unsigned long maxblocks, struct buffer_head *bh_result,
824 int create, int extend_disksize); 824 int create, int extend_disksize);
825 825
826extern void ext3_read_inode (struct inode *); 826extern struct inode *ext3_iget(struct super_block *, unsigned long);
827extern int ext3_write_inode (struct inode *, int); 827extern int ext3_write_inode (struct inode *, int);
828extern int ext3_setattr (struct dentry *, struct iattr *); 828extern int ext3_setattr (struct dentry *, struct iattr *);
829extern void ext3_delete_inode (struct inode *); 829extern void ext3_delete_inode (struct inode *);
diff --git a/include/linux/ext4_fs.h b/include/linux/ext4_fs.h
index 1852313fc7c7..250032548597 100644
--- a/include/linux/ext4_fs.h
+++ b/include/linux/ext4_fs.h
@@ -490,6 +490,13 @@ do { \
490#define EXT4_ORPHAN_FS 0x0004 /* Orphans being recovered */ 490#define EXT4_ORPHAN_FS 0x0004 /* Orphans being recovered */
491 491
492/* 492/*
493 * Misc. filesystem flags
494 */
495#define EXT2_FLAGS_SIGNED_HASH 0x0001 /* Signed dirhash in use */
496#define EXT2_FLAGS_UNSIGNED_HASH 0x0002 /* Unsigned dirhash in use */
497#define EXT2_FLAGS_TEST_FILESYS 0x0004 /* to test development code */
498
499/*
493 * Mount flags 500 * Mount flags
494 */ 501 */
495#define EXT4_MOUNT_CHECK 0x00001 /* Do mount-time checks */ 502#define EXT4_MOUNT_CHECK 0x00001 /* Do mount-time checks */
@@ -1024,7 +1031,7 @@ int ext4_get_blocks_handle(handle_t *handle, struct inode *inode,
1024 struct buffer_head *bh_result, 1031 struct buffer_head *bh_result,
1025 int create, int extend_disksize); 1032 int create, int extend_disksize);
1026 1033
1027extern void ext4_read_inode (struct inode *); 1034extern struct inode *ext4_iget(struct super_block *, unsigned long);
1028extern int ext4_write_inode (struct inode *, int); 1035extern int ext4_write_inode (struct inode *, int);
1029extern int ext4_setattr (struct dentry *, struct iattr *); 1036extern int ext4_setattr (struct dentry *, struct iattr *);
1030extern void ext4_delete_inode (struct inode *); 1037extern void ext4_delete_inode (struct inode *);
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 56bd421c1208..18cfbf76ec5b 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -21,7 +21,7 @@
21 21
22/* Fixed constants first: */ 22/* Fixed constants first: */
23#undef NR_OPEN 23#undef NR_OPEN
24#define NR_OPEN (1024*1024) /* Absolute upper limit on fd num */ 24extern int sysctl_nr_open;
25#define INR_OPEN 1024 /* Initial setting for nfile rlimits */ 25#define INR_OPEN 1024 /* Initial setting for nfile rlimits */
26 26
27#define BLOCK_SIZE_BITS 10 27#define BLOCK_SIZE_BITS 10
@@ -977,7 +977,6 @@ extern int send_sigurg(struct fown_struct *fown);
977extern struct list_head super_blocks; 977extern struct list_head super_blocks;
978extern spinlock_t sb_lock; 978extern spinlock_t sb_lock;
979 979
980#define sb_entry(list) list_entry((list), struct super_block, s_list)
981#define S_BIAS (1<<30) 980#define S_BIAS (1<<30)
982struct super_block { 981struct super_block {
983 struct list_head s_list; /* Keep this first */ 982 struct list_head s_list; /* Keep this first */
@@ -1039,6 +1038,12 @@ struct super_block {
1039 * in /proc/mounts will be "type.subtype" 1038 * in /proc/mounts will be "type.subtype"
1040 */ 1039 */
1041 char *s_subtype; 1040 char *s_subtype;
1041
1042 /*
1043 * Saved mount options for lazy filesystems using
1044 * generic_show_options()
1045 */
1046 char *s_options;
1042}; 1047};
1043 1048
1044extern struct timespec current_fs_time(struct super_block *sb); 1049extern struct timespec current_fs_time(struct super_block *sb);
@@ -1242,8 +1247,6 @@ struct super_operations {
1242 struct inode *(*alloc_inode)(struct super_block *sb); 1247 struct inode *(*alloc_inode)(struct super_block *sb);
1243 void (*destroy_inode)(struct inode *); 1248 void (*destroy_inode)(struct inode *);
1244 1249
1245 void (*read_inode) (struct inode *);
1246
1247 void (*dirty_inode) (struct inode *); 1250 void (*dirty_inode) (struct inode *);
1248 int (*write_inode) (struct inode *, int); 1251 int (*write_inode) (struct inode *, int);
1249 void (*put_inode) (struct inode *); 1252 void (*put_inode) (struct inode *);
@@ -1279,8 +1282,10 @@ struct super_operations {
1279 * 1282 *
1280 * Two bits are used for locking and completion notification, I_LOCK and I_SYNC. 1283 * Two bits are used for locking and completion notification, I_LOCK and I_SYNC.
1281 * 1284 *
1282 * I_DIRTY_SYNC Inode itself is dirty. 1285 * I_DIRTY_SYNC Inode is dirty, but doesn't have to be written on
1283 * I_DIRTY_DATASYNC Data-related inode changes pending 1286 * fdatasync(). i_atime is the usual cause.
1287 * I_DIRTY_DATASYNC Inode is dirty and must be written on fdatasync(), f.e.
1288 * because i_size changed.
1284 * I_DIRTY_PAGES Inode has dirty pages. Inode itself may be clean. 1289 * I_DIRTY_PAGES Inode has dirty pages. Inode itself may be clean.
1285 * I_NEW get_new_inode() sets i_state to I_LOCK|I_NEW. Both 1290 * I_NEW get_new_inode() sets i_state to I_LOCK|I_NEW. Both
1286 * are cleared by unlock_new_inode(), called from iget(). 1291 * are cleared by unlock_new_inode(), called from iget().
@@ -1312,8 +1317,6 @@ struct super_operations {
1312 * purpose reduces latency and prevents some filesystem- 1317 * purpose reduces latency and prevents some filesystem-
1313 * specific deadlocks. 1318 * specific deadlocks.
1314 * 1319 *
1315 * Q: Why does I_DIRTY_DATASYNC exist? It appears as if it could be replaced
1316 * by (I_DIRTY_SYNC|I_DIRTY_PAGES).
1317 * Q: What is the difference between I_WILL_FREE and I_FREEING? 1320 * Q: What is the difference between I_WILL_FREE and I_FREEING?
1318 * Q: igrab() only checks on (I_FREEING|I_WILL_FREE). Should it also check on 1321 * Q: igrab() only checks on (I_FREEING|I_WILL_FREE). Should it also check on
1319 * I_CLEAR? If not, why? 1322 * I_CLEAR? If not, why?
@@ -1621,7 +1624,6 @@ extern int register_chrdev(unsigned int, const char *,
1621 const struct file_operations *); 1624 const struct file_operations *);
1622extern void unregister_chrdev(unsigned int, const char *); 1625extern void unregister_chrdev(unsigned int, const char *);
1623extern void unregister_chrdev_region(dev_t, unsigned); 1626extern void unregister_chrdev_region(dev_t, unsigned);
1624extern int chrdev_open(struct inode *, struct file *);
1625extern void chrdev_show(struct seq_file *,off_t); 1627extern void chrdev_show(struct seq_file *,off_t);
1626 1628
1627/* fs/block_dev.c */ 1629/* fs/block_dev.c */
@@ -1768,19 +1770,8 @@ extern struct inode * iget5_locked(struct super_block *, unsigned long, int (*te
1768extern struct inode * iget_locked(struct super_block *, unsigned long); 1770extern struct inode * iget_locked(struct super_block *, unsigned long);
1769extern void unlock_new_inode(struct inode *); 1771extern void unlock_new_inode(struct inode *);
1770 1772
1771static inline struct inode *iget(struct super_block *sb, unsigned long ino)
1772{
1773 struct inode *inode = iget_locked(sb, ino);
1774
1775 if (inode && (inode->i_state & I_NEW)) {
1776 sb->s_op->read_inode(inode);
1777 unlock_new_inode(inode);
1778 }
1779
1780 return inode;
1781}
1782
1783extern void __iget(struct inode * inode); 1773extern void __iget(struct inode * inode);
1774extern void iget_failed(struct inode *);
1784extern void clear_inode(struct inode *); 1775extern void clear_inode(struct inode *);
1785extern void destroy_inode(struct inode *); 1776extern void destroy_inode(struct inode *);
1786extern struct inode *new_inode(struct super_block *); 1777extern struct inode *new_inode(struct super_block *);
@@ -1821,9 +1812,6 @@ extern ssize_t generic_file_buffered_write(struct kiocb *, const struct iovec *,
1821 unsigned long, loff_t, loff_t *, size_t, ssize_t); 1812 unsigned long, loff_t, loff_t *, size_t, ssize_t);
1822extern ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos); 1813extern ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos);
1823extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos); 1814extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos);
1824extern void do_generic_mapping_read(struct address_space *mapping,
1825 struct file_ra_state *, struct file *,
1826 loff_t *, read_descriptor_t *, read_actor_t);
1827extern int generic_segment_checks(const struct iovec *iov, 1815extern int generic_segment_checks(const struct iovec *iov,
1828 unsigned long *nr_segs, size_t *count, int access_flags); 1816 unsigned long *nr_segs, size_t *count, int access_flags);
1829 1817
@@ -1861,18 +1849,6 @@ static inline int xip_truncate_page(struct address_space *mapping, loff_t from)
1861} 1849}
1862#endif 1850#endif
1863 1851
1864static inline void do_generic_file_read(struct file * filp, loff_t *ppos,
1865 read_descriptor_t * desc,
1866 read_actor_t actor)
1867{
1868 do_generic_mapping_read(filp->f_mapping,
1869 &filp->f_ra,
1870 filp,
1871 ppos,
1872 desc,
1873 actor);
1874}
1875
1876#ifdef CONFIG_BLOCK 1852#ifdef CONFIG_BLOCK
1877ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, 1853ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
1878 struct block_device *bdev, const struct iovec *iov, loff_t offset, 1854 struct block_device *bdev, const struct iovec *iov, loff_t offset,
@@ -1942,7 +1918,9 @@ extern int vfs_stat_fd(int dfd, char __user *, struct kstat *);
1942extern int vfs_lstat_fd(int dfd, char __user *, struct kstat *); 1918extern int vfs_lstat_fd(int dfd, char __user *, struct kstat *);
1943extern int vfs_fstat(unsigned int, struct kstat *); 1919extern int vfs_fstat(unsigned int, struct kstat *);
1944 1920
1945extern int vfs_ioctl(struct file *, unsigned int, unsigned int, unsigned long); 1921extern long vfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
1922extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd,
1923 unsigned long arg);
1946 1924
1947extern void get_filesystem(struct file_system_type *fs); 1925extern void get_filesystem(struct file_system_type *fs);
1948extern void put_filesystem(struct file_system_type *fs); 1926extern void put_filesystem(struct file_system_type *fs);
@@ -1997,6 +1975,9 @@ extern int __must_check inode_setattr(struct inode *, struct iattr *);
1997 1975
1998extern void file_update_time(struct file *file); 1976extern void file_update_time(struct file *file);
1999 1977
1978extern int generic_show_options(struct seq_file *m, struct vfsmount *mnt);
1979extern void save_mount_options(struct super_block *sb, char *options);
1980
2000static inline ino_t parent_ino(struct dentry *dentry) 1981static inline ino_t parent_ino(struct dentry *dentry)
2001{ 1982{
2002 ino_t res; 1983 ino_t res;
@@ -2068,7 +2049,7 @@ static int __fops ## _open(struct inode *inode, struct file *file) \
2068static struct file_operations __fops = { \ 2049static struct file_operations __fops = { \
2069 .owner = THIS_MODULE, \ 2050 .owner = THIS_MODULE, \
2070 .open = __fops ## _open, \ 2051 .open = __fops ## _open, \
2071 .release = simple_attr_close, \ 2052 .release = simple_attr_release, \
2072 .read = simple_attr_read, \ 2053 .read = simple_attr_read, \
2073 .write = simple_attr_write, \ 2054 .write = simple_attr_write, \
2074}; 2055};
@@ -2080,9 +2061,9 @@ __simple_attr_check_format(const char *fmt, ...)
2080} 2061}
2081 2062
2082int simple_attr_open(struct inode *inode, struct file *file, 2063int simple_attr_open(struct inode *inode, struct file *file,
2083 u64 (*get)(void *), void (*set)(void *, u64), 2064 int (*get)(void *, u64 *), int (*set)(void *, u64),
2084 const char *fmt); 2065 const char *fmt);
2085int simple_attr_close(struct inode *inode, struct file *file); 2066int simple_attr_release(struct inode *inode, struct file *file);
2086ssize_t simple_attr_read(struct file *file, char __user *buf, 2067ssize_t simple_attr_read(struct file *file, char __user *buf,
2087 size_t len, loff_t *ppos); 2068 size_t len, loff_t *ppos);
2088ssize_t simple_attr_write(struct file *file, const char __user *buf, 2069ssize_t simple_attr_write(struct file *file, const char __user *buf,
@@ -2113,6 +2094,7 @@ struct ctl_table;
2113int proc_nr_files(struct ctl_table *table, int write, struct file *filp, 2094int proc_nr_files(struct ctl_table *table, int write, struct file *filp,
2114 void __user *buffer, size_t *lenp, loff_t *ppos); 2095 void __user *buffer, size_t *lenp, loff_t *ppos);
2115 2096
2097int get_filesystem_list(char * buf);
2116 2098
2117#endif /* __KERNEL__ */ 2099#endif /* __KERNEL__ */
2118#endif /* _LINUX_FS_H */ 2100#endif /* _LINUX_FS_H */
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h
index 2bd31fa623b6..d4b7c4ac72e6 100644
--- a/include/linux/fsnotify.h
+++ b/include/linux/fsnotify.h
@@ -92,6 +92,14 @@ static inline void fsnotify_inoderemove(struct inode *inode)
92} 92}
93 93
94/* 94/*
95 * fsnotify_link_count - inode's link count changed
96 */
97static inline void fsnotify_link_count(struct inode *inode)
98{
99 inotify_inode_queue_event(inode, IN_ATTRIB, 0, NULL, NULL);
100}
101
102/*
95 * fsnotify_create - 'name' was linked in 103 * fsnotify_create - 'name' was linked in
96 */ 104 */
97static inline void fsnotify_create(struct inode *inode, struct dentry *dentry) 105static inline void fsnotify_create(struct inode *inode, struct dentry *dentry)
@@ -103,6 +111,20 @@ static inline void fsnotify_create(struct inode *inode, struct dentry *dentry)
103} 111}
104 112
105/* 113/*
114 * fsnotify_link - new hardlink in 'inode' directory
115 * Note: We have to pass also the linked inode ptr as some filesystems leave
116 * new_dentry->d_inode NULL and instantiate inode pointer later
117 */
118static inline void fsnotify_link(struct inode *dir, struct inode *inode, struct dentry *new_dentry)
119{
120 inode_dir_notify(dir, DN_CREATE);
121 inotify_inode_queue_event(dir, IN_CREATE, 0, new_dentry->d_name.name,
122 inode);
123 fsnotify_link_count(inode);
124 audit_inode_child(new_dentry->d_name.name, new_dentry, dir);
125}
126
127/*
106 * fsnotify_mkdir - directory 'name' was created 128 * fsnotify_mkdir - directory 'name' was created
107 */ 129 */
108static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry) 130static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry)
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 1dbea0ac5693..09a3b18918c7 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -91,16 +91,31 @@ struct partition {
91 __le32 nr_sects; /* nr of sectors in partition */ 91 __le32 nr_sects; /* nr of sectors in partition */
92} __attribute__((packed)); 92} __attribute__((packed));
93 93
94struct disk_stats {
95 unsigned long sectors[2]; /* READs and WRITEs */
96 unsigned long ios[2];
97 unsigned long merges[2];
98 unsigned long ticks[2];
99 unsigned long io_ticks;
100 unsigned long time_in_queue;
101};
102
94struct hd_struct { 103struct hd_struct {
95 sector_t start_sect; 104 sector_t start_sect;
96 sector_t nr_sects; 105 sector_t nr_sects;
97 struct device dev; 106 struct device dev;
98 struct kobject *holder_dir; 107 struct kobject *holder_dir;
99 unsigned ios[2], sectors[2]; /* READs and WRITEs */
100 int policy, partno; 108 int policy, partno;
101#ifdef CONFIG_FAIL_MAKE_REQUEST 109#ifdef CONFIG_FAIL_MAKE_REQUEST
102 int make_it_fail; 110 int make_it_fail;
103#endif 111#endif
112 unsigned long stamp;
113 int in_flight;
114#ifdef CONFIG_SMP
115 struct disk_stats *dkstats;
116#else
117 struct disk_stats dkstats;
118#endif
104}; 119};
105 120
106#define GENHD_FL_REMOVABLE 1 121#define GENHD_FL_REMOVABLE 1
@@ -111,15 +126,7 @@ struct hd_struct {
111#define GENHD_FL_SUPPRESS_PARTITION_INFO 32 126#define GENHD_FL_SUPPRESS_PARTITION_INFO 32
112#define GENHD_FL_FAIL 64 127#define GENHD_FL_FAIL 64
113 128
114struct disk_stats { 129
115 unsigned long sectors[2]; /* READs and WRITEs */
116 unsigned long ios[2];
117 unsigned long merges[2];
118 unsigned long ticks[2];
119 unsigned long io_ticks;
120 unsigned long time_in_queue;
121};
122
123struct gendisk { 130struct gendisk {
124 int major; /* major number of driver */ 131 int major; /* major number of driver */
125 int first_minor; 132 int first_minor;
@@ -158,6 +165,20 @@ struct gendisk {
158 * The __ variants should only be called in critical sections. The full 165 * The __ variants should only be called in critical sections. The full
159 * variants disable/enable preemption. 166 * variants disable/enable preemption.
160 */ 167 */
168static inline struct hd_struct *get_part(struct gendisk *gendiskp,
169 sector_t sector)
170{
171 struct hd_struct *part;
172 int i;
173 for (i = 0; i < gendiskp->minors - 1; i++) {
174 part = gendiskp->part[i];
175 if (part && part->start_sect <= sector
176 && sector < part->start_sect + part->nr_sects)
177 return part;
178 }
179 return NULL;
180}
181
161#ifdef CONFIG_SMP 182#ifdef CONFIG_SMP
162#define __disk_stat_add(gendiskp, field, addnd) \ 183#define __disk_stat_add(gendiskp, field, addnd) \
163 (per_cpu_ptr(gendiskp->dkstats, smp_processor_id())->field += addnd) 184 (per_cpu_ptr(gendiskp->dkstats, smp_processor_id())->field += addnd)
@@ -177,15 +198,62 @@ static inline void disk_stat_set_all(struct gendisk *gendiskp, int value) {
177 memset(per_cpu_ptr(gendiskp->dkstats, i), value, 198 memset(per_cpu_ptr(gendiskp->dkstats, i), value,
178 sizeof (struct disk_stats)); 199 sizeof (struct disk_stats));
179} 200}
201
202#define __part_stat_add(part, field, addnd) \
203 (per_cpu_ptr(part->dkstats, smp_processor_id())->field += addnd)
204
205#define __all_stat_add(gendiskp, field, addnd, sector) \
206({ \
207 struct hd_struct *part = get_part(gendiskp, sector); \
208 if (part) \
209 __part_stat_add(part, field, addnd); \
210 __disk_stat_add(gendiskp, field, addnd); \
211})
212
213#define part_stat_read(part, field) \
214({ \
215 typeof(part->dkstats->field) res = 0; \
216 int i; \
217 for_each_possible_cpu(i) \
218 res += per_cpu_ptr(part->dkstats, i)->field; \
219 res; \
220})
221
222static inline void part_stat_set_all(struct hd_struct *part, int value) {
223 int i;
224 for_each_possible_cpu(i)
225 memset(per_cpu_ptr(part->dkstats, i), value,
226 sizeof(struct disk_stats));
227}
180 228
181#else 229#else
182#define __disk_stat_add(gendiskp, field, addnd) \ 230#define __disk_stat_add(gendiskp, field, addnd) \
183 (gendiskp->dkstats.field += addnd) 231 (gendiskp->dkstats.field += addnd)
184#define disk_stat_read(gendiskp, field) (gendiskp->dkstats.field) 232#define disk_stat_read(gendiskp, field) (gendiskp->dkstats.field)
185 233
186static inline void disk_stat_set_all(struct gendisk *gendiskp, int value) { 234static inline void disk_stat_set_all(struct gendisk *gendiskp, int value)
235{
187 memset(&gendiskp->dkstats, value, sizeof (struct disk_stats)); 236 memset(&gendiskp->dkstats, value, sizeof (struct disk_stats));
188} 237}
238
239#define __part_stat_add(part, field, addnd) \
240 (part->dkstats.field += addnd)
241
242#define __all_stat_add(gendiskp, field, addnd, sector) \
243({ \
244 struct hd_struct *part = get_part(gendiskp, sector); \
245 if (part) \
246 part->dkstats.field += addnd; \
247 __disk_stat_add(gendiskp, field, addnd); \
248})
249
250#define part_stat_read(part, field) (part->dkstats.field)
251
252static inline void part_stat_set_all(struct hd_struct *part, int value)
253{
254 memset(&part->dkstats, value, sizeof(struct disk_stats));
255}
256
189#endif 257#endif
190 258
191#define disk_stat_add(gendiskp, field, addnd) \ 259#define disk_stat_add(gendiskp, field, addnd) \
@@ -206,6 +274,45 @@ static inline void disk_stat_set_all(struct gendisk *gendiskp, int value) {
206#define disk_stat_sub(gendiskp, field, subnd) \ 274#define disk_stat_sub(gendiskp, field, subnd) \
207 disk_stat_add(gendiskp, field, -subnd) 275 disk_stat_add(gendiskp, field, -subnd)
208 276
277#define part_stat_add(gendiskp, field, addnd) \
278 do { \
279 preempt_disable(); \
280 __part_stat_add(gendiskp, field, addnd);\
281 preempt_enable(); \
282 } while (0)
283
284#define __part_stat_dec(gendiskp, field) __part_stat_add(gendiskp, field, -1)
285#define part_stat_dec(gendiskp, field) part_stat_add(gendiskp, field, -1)
286
287#define __part_stat_inc(gendiskp, field) __part_stat_add(gendiskp, field, 1)
288#define part_stat_inc(gendiskp, field) part_stat_add(gendiskp, field, 1)
289
290#define __part_stat_sub(gendiskp, field, subnd) \
291 __part_stat_add(gendiskp, field, -subnd)
292#define part_stat_sub(gendiskp, field, subnd) \
293 part_stat_add(gendiskp, field, -subnd)
294
295#define all_stat_add(gendiskp, field, addnd, sector) \
296 do { \
297 preempt_disable(); \
298 __all_stat_add(gendiskp, field, addnd, sector); \
299 preempt_enable(); \
300 } while (0)
301
302#define __all_stat_dec(gendiskp, field, sector) \
303 __all_stat_add(gendiskp, field, -1, sector)
304#define all_stat_dec(gendiskp, field, sector) \
305 all_stat_add(gendiskp, field, -1, sector)
306
307#define __all_stat_inc(gendiskp, field, sector) \
308 __all_stat_add(gendiskp, field, 1, sector)
309#define all_stat_inc(gendiskp, field, sector) \
310 all_stat_add(gendiskp, field, 1, sector)
311
312#define __all_stat_sub(gendiskp, field, subnd, sector) \
313 __all_stat_add(gendiskp, field, -subnd, sector)
314#define all_stat_sub(gendiskp, field, subnd, sector) \
315 all_stat_add(gendiskp, field, -subnd, sector)
209 316
210/* Inlines to alloc and free disk stats in struct gendisk */ 317/* Inlines to alloc and free disk stats in struct gendisk */
211#ifdef CONFIG_SMP 318#ifdef CONFIG_SMP
@@ -221,6 +328,20 @@ static inline void free_disk_stats(struct gendisk *disk)
221{ 328{
222 free_percpu(disk->dkstats); 329 free_percpu(disk->dkstats);
223} 330}
331
332static inline int init_part_stats(struct hd_struct *part)
333{
334 part->dkstats = alloc_percpu(struct disk_stats);
335 if (!part->dkstats)
336 return 0;
337 return 1;
338}
339
340static inline void free_part_stats(struct hd_struct *part)
341{
342 free_percpu(part->dkstats);
343}
344
224#else /* CONFIG_SMP */ 345#else /* CONFIG_SMP */
225static inline int init_disk_stats(struct gendisk *disk) 346static inline int init_disk_stats(struct gendisk *disk)
226{ 347{
@@ -230,10 +351,20 @@ static inline int init_disk_stats(struct gendisk *disk)
230static inline void free_disk_stats(struct gendisk *disk) 351static inline void free_disk_stats(struct gendisk *disk)
231{ 352{
232} 353}
354
355static inline int init_part_stats(struct hd_struct *part)
356{
357 return 1;
358}
359
360static inline void free_part_stats(struct hd_struct *part)
361{
362}
233#endif /* CONFIG_SMP */ 363#endif /* CONFIG_SMP */
234 364
235/* drivers/block/ll_rw_blk.c */ 365/* drivers/block/ll_rw_blk.c */
236extern void disk_round_stats(struct gendisk *disk); 366extern void disk_round_stats(struct gendisk *disk);
367extern void part_round_stats(struct hd_struct *part);
237 368
238/* drivers/block/genhd.c */ 369/* drivers/block/genhd.c */
239extern int get_blkdev_list(char *, int); 370extern int get_blkdev_list(char *, int);
diff --git a/include/linux/hash.h b/include/linux/hash.h
index acf17bb8e7f9..06d25c189cc5 100644
--- a/include/linux/hash.h
+++ b/include/linux/hash.h
@@ -1,6 +1,6 @@
1#ifndef _LINUX_HASH_H 1#ifndef _LINUX_HASH_H
2#define _LINUX_HASH_H 2#define _LINUX_HASH_H
3/* Fast hashing routine for a long. 3/* Fast hashing routine for ints, longs and pointers.
4 (C) 2002 William Lee Irwin III, IBM */ 4 (C) 2002 William Lee Irwin III, IBM */
5 5
6/* 6/*
@@ -13,23 +13,30 @@
13 * them can use shifts and additions instead of multiplications for 13 * them can use shifts and additions instead of multiplications for
14 * machines where multiplications are slow. 14 * machines where multiplications are slow.
15 */ 15 */
16#if BITS_PER_LONG == 32 16
17#include <asm/types.h>
18
17/* 2^31 + 2^29 - 2^25 + 2^22 - 2^19 - 2^16 + 1 */ 19/* 2^31 + 2^29 - 2^25 + 2^22 - 2^19 - 2^16 + 1 */
18#define GOLDEN_RATIO_PRIME 0x9e370001UL 20#define GOLDEN_RATIO_PRIME_32 0x9e370001UL
19#elif BITS_PER_LONG == 64
20/* 2^63 + 2^61 - 2^57 + 2^54 - 2^51 - 2^18 + 1 */ 21/* 2^63 + 2^61 - 2^57 + 2^54 - 2^51 - 2^18 + 1 */
21#define GOLDEN_RATIO_PRIME 0x9e37fffffffc0001UL 22#define GOLDEN_RATIO_PRIME_64 0x9e37fffffffc0001UL
23
24#if BITS_PER_LONG == 32
25#define GOLDEN_RATIO_PRIME GOLDEN_RATIO_PRIME_32
26#define hash_long(val, bits) hash_32(val, bits)
27#elif BITS_PER_LONG == 64
28#define hash_long(val, bits) hash_64(val, bits)
29#define GOLDEN_RATIO_PRIME GOLDEN_RATIO_PRIME_64
22#else 30#else
23#error Define GOLDEN_RATIO_PRIME for your wordsize. 31#error Wordsize not 32 or 64
24#endif 32#endif
25 33
26static inline unsigned long hash_long(unsigned long val, unsigned int bits) 34static inline u64 hash_64(u64 val, unsigned int bits)
27{ 35{
28 unsigned long hash = val; 36 u64 hash = val;
29 37
30#if BITS_PER_LONG == 64
31 /* Sigh, gcc can't optimise this alone like it does for 32 bits. */ 38 /* Sigh, gcc can't optimise this alone like it does for 32 bits. */
32 unsigned long n = hash; 39 u64 n = hash;
33 n <<= 18; 40 n <<= 18;
34 hash -= n; 41 hash -= n;
35 n <<= 33; 42 n <<= 33;
@@ -42,15 +49,20 @@ static inline unsigned long hash_long(unsigned long val, unsigned int bits)
42 hash += n; 49 hash += n;
43 n <<= 2; 50 n <<= 2;
44 hash += n; 51 hash += n;
45#else 52
53 /* High bits are more random, so use them. */
54 return hash >> (64 - bits);
55}
56
57static inline u32 hash_32(u32 val, unsigned int bits)
58{
46 /* On some cpus multiply is faster, on others gcc will do shifts */ 59 /* On some cpus multiply is faster, on others gcc will do shifts */
47 hash *= GOLDEN_RATIO_PRIME; 60 u32 hash = val * GOLDEN_RATIO_PRIME_32;
48#endif
49 61
50 /* High bits are more random, so use them. */ 62 /* High bits are more random, so use them. */
51 return hash >> (BITS_PER_LONG - bits); 63 return hash >> (32 - bits);
52} 64}
53 65
54static inline unsigned long hash_ptr(void *ptr, unsigned int bits) 66static inline unsigned long hash_ptr(void *ptr, unsigned int bits)
55{ 67{
56 return hash_long((unsigned long)ptr, bits); 68 return hash_long((unsigned long)ptr, bits);
diff --git a/include/linux/hayesesp.h b/include/linux/hayesesp.h
index b436be7a7fff..2177ee5b2fe2 100644
--- a/include/linux/hayesesp.h
+++ b/include/linux/hayesesp.h
@@ -71,7 +71,6 @@ struct hayes_esp_config {
71#define ESP_STAT_NEVER_DMA 0x08 71#define ESP_STAT_NEVER_DMA 0x08
72#define ESP_STAT_USE_PIO 0x10 72#define ESP_STAT_USE_PIO 0x10
73 73
74#define ESP_EVENT_WRITE_WAKEUP 0
75#define ESP_MAGIC 0x53ee 74#define ESP_MAGIC 0x53ee
76#define ESP_XMIT_SIZE 4096 75#define ESP_XMIT_SIZE 4096
77 76
@@ -92,7 +91,6 @@ struct esp_struct {
92 unsigned short closing_wait2; 91 unsigned short closing_wait2;
93 int IER; /* Interrupt Enable Register */ 92 int IER; /* Interrupt Enable Register */
94 int MCR; /* Modem control register */ 93 int MCR; /* Modem control register */
95 unsigned long event;
96 unsigned long last_active; 94 unsigned long last_active;
97 int line; 95 int line;
98 int count; /* # of fd on device */ 96 int count; /* # of fd on device */
@@ -101,8 +99,6 @@ struct esp_struct {
101 int xmit_head; 99 int xmit_head;
102 int xmit_tail; 100 int xmit_tail;
103 int xmit_cnt; 101 int xmit_cnt;
104 struct work_struct tqueue;
105 struct work_struct tqueue_hangup;
106 wait_queue_head_t open_wait; 102 wait_queue_head_t open_wait;
107 wait_queue_head_t close_wait; 103 wait_queue_head_t close_wait;
108 wait_queue_head_t delta_msr_wait; 104 wait_queue_head_t delta_msr_wait;
diff --git a/include/linux/hdlc.h b/include/linux/hdlc.h
index db390c511ada..6115545a5b9c 100644
--- a/include/linux/hdlc.h
+++ b/include/linux/hdlc.h
@@ -26,13 +26,6 @@
26#include <linux/netdevice.h> 26#include <linux/netdevice.h>
27#include <linux/hdlc/ioctl.h> 27#include <linux/hdlc/ioctl.h>
28 28
29
30/* Used by all network devices here, pointed to by netdev_priv(dev) */
31struct hdlc_device_desc {
32 int (*netif_rx)(struct sk_buff *skb);
33 struct net_device_stats stats;
34};
35
36/* This structure is a private property of HDLC protocols. 29/* This structure is a private property of HDLC protocols.
37 Hardware drivers have no interest here */ 30 Hardware drivers have no interest here */
38 31
@@ -44,12 +37,15 @@ struct hdlc_proto {
44 void (*detach)(struct net_device *dev); 37 void (*detach)(struct net_device *dev);
45 int (*ioctl)(struct net_device *dev, struct ifreq *ifr); 38 int (*ioctl)(struct net_device *dev, struct ifreq *ifr);
46 __be16 (*type_trans)(struct sk_buff *skb, struct net_device *dev); 39 __be16 (*type_trans)(struct sk_buff *skb, struct net_device *dev);
40 int (*netif_rx)(struct sk_buff *skb);
47 struct module *module; 41 struct module *module;
48 struct hdlc_proto *next; /* next protocol in the list */ 42 struct hdlc_proto *next; /* next protocol in the list */
49}; 43};
50 44
51 45
46/* Pointed to by dev->priv */
52typedef struct hdlc_device { 47typedef struct hdlc_device {
48 struct net_device_stats stats;
53 /* used by HDLC layer to take control over HDLC device from hw driver*/ 49 /* used by HDLC layer to take control over HDLC device from hw driver*/
54 int (*attach)(struct net_device *dev, 50 int (*attach)(struct net_device *dev,
55 unsigned short encoding, unsigned short parity); 51 unsigned short encoding, unsigned short parity);
@@ -83,18 +79,11 @@ void unregister_hdlc_protocol(struct hdlc_proto *proto);
83 79
84struct net_device *alloc_hdlcdev(void *priv); 80struct net_device *alloc_hdlcdev(void *priv);
85 81
86 82static inline struct hdlc_device* dev_to_hdlc(struct net_device *dev)
87static __inline__ struct hdlc_device_desc* dev_to_desc(struct net_device *dev)
88{
89 return netdev_priv(dev);
90}
91
92static __inline__ hdlc_device* dev_to_hdlc(struct net_device *dev)
93{ 83{
94 return netdev_priv(dev) + sizeof(struct hdlc_device_desc); 84 return dev->priv;
95} 85}
96 86
97
98static __inline__ void debug_frame(const struct sk_buff *skb) 87static __inline__ void debug_frame(const struct sk_buff *skb)
99{ 88{
100 int i; 89 int i;
@@ -116,13 +105,13 @@ int hdlc_open(struct net_device *dev);
116void hdlc_close(struct net_device *dev); 105void hdlc_close(struct net_device *dev);
117 106
118int attach_hdlc_protocol(struct net_device *dev, struct hdlc_proto *proto, 107int attach_hdlc_protocol(struct net_device *dev, struct hdlc_proto *proto,
119 int (*rx)(struct sk_buff *skb), size_t size); 108 size_t size);
120/* May be used by hardware driver to gain control over HDLC device */ 109/* May be used by hardware driver to gain control over HDLC device */
121void detach_hdlc_protocol(struct net_device *dev); 110void detach_hdlc_protocol(struct net_device *dev);
122 111
123static __inline__ struct net_device_stats *hdlc_stats(struct net_device *dev) 112static __inline__ struct net_device_stats *hdlc_stats(struct net_device *dev)
124{ 113{
125 return &dev_to_desc(dev)->stats; 114 return &dev_to_hdlc(dev)->stats;
126} 115}
127 116
128 117
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index 8371b664b41f..1ad56a7b2f74 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -78,7 +78,7 @@ enum hrtimer_cb_mode {
78 * as otherwise the timer could be removed before the softirq code finishes the 78 * as otherwise the timer could be removed before the softirq code finishes the
79 * the handling of the timer. 79 * the handling of the timer.
80 * 80 *
81 * The HRTIMER_STATE_ENQUEUE bit is always or'ed to the current state to 81 * The HRTIMER_STATE_ENQUEUED bit is always or'ed to the current state to
82 * preserve the HRTIMER_STATE_CALLBACK bit in the above scenario. 82 * preserve the HRTIMER_STATE_CALLBACK bit in the above scenario.
83 * 83 *
84 * All state transitions are protected by cpu_base->lock. 84 * All state transitions are protected by cpu_base->lock.
@@ -225,11 +225,14 @@ static inline int hrtimer_is_hres_active(struct hrtimer *timer)
225 * idea of the (in)accuracy of timers. Timer values are rounded up to 225 * idea of the (in)accuracy of timers. Timer values are rounded up to
226 * this resolution values. 226 * this resolution values.
227 */ 227 */
228# define KTIME_HIGH_RES (ktime_t) { .tv64 = 1 } 228# define HIGH_RES_NSEC 1
229# define KTIME_HIGH_RES (ktime_t) { .tv64 = HIGH_RES_NSEC }
230# define MONOTONIC_RES_NSEC HIGH_RES_NSEC
229# define KTIME_MONOTONIC_RES KTIME_HIGH_RES 231# define KTIME_MONOTONIC_RES KTIME_HIGH_RES
230 232
231#else 233#else
232 234
235# define MONOTONIC_RES_NSEC LOW_RES_NSEC
233# define KTIME_MONOTONIC_RES KTIME_LOW_RES 236# define KTIME_MONOTONIC_RES KTIME_LOW_RES
234 237
235/* 238/*
@@ -313,7 +316,7 @@ static inline u64 hrtimer_forward_now(struct hrtimer *timer,
313 316
314/* Precise sleep: */ 317/* Precise sleep: */
315extern long hrtimer_nanosleep(struct timespec *rqtp, 318extern long hrtimer_nanosleep(struct timespec *rqtp,
316 struct timespec *rmtp, 319 struct timespec __user *rmtp,
317 const enum hrtimer_mode mode, 320 const enum hrtimer_mode mode,
318 const clockid_t clockid); 321 const clockid_t clockid);
319extern long hrtimer_nanosleep_restart(struct restart_block *restart_block); 322extern long hrtimer_nanosleep_restart(struct restart_block *restart_block);
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 30d606afcafe..7ca198b379af 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -17,6 +17,7 @@ static inline int is_vm_hugetlb_page(struct vm_area_struct *vma)
17} 17}
18 18
19int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); 19int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *);
20int hugetlb_overcommit_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *);
20int hugetlb_treat_movable_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); 21int hugetlb_treat_movable_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *);
21int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *); 22int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *);
22int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, struct page **, struct vm_area_struct **, unsigned long *, int *, int, int); 23int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, struct page **, struct vm_area_struct **, unsigned long *, int *, int, int);
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h
index f922b060158b..b979112f74e0 100644
--- a/include/linux/i2c-id.h
+++ b/include/linux/i2c-id.h
@@ -96,42 +96,6 @@
96 96
97#define I2C_DRIVERID_I2CDEV 900 97#define I2C_DRIVERID_I2CDEV 900
98 98
99/* IDs -- Use DRIVERIDs 1000-1999 for sensors.
100 These were originally in sensors.h in the lm_sensors package */
101#define I2C_DRIVERID_LM78 1002
102#define I2C_DRIVERID_LM75 1003
103#define I2C_DRIVERID_GL518 1004
104#define I2C_DRIVERID_EEPROM 1005
105#define I2C_DRIVERID_W83781D 1006
106#define I2C_DRIVERID_LM80 1007
107#define I2C_DRIVERID_ADM1021 1008
108#define I2C_DRIVERID_ADM9240 1009
109#define I2C_DRIVERID_LTC1710 1010
110#define I2C_DRIVERID_BT869 1013
111#define I2C_DRIVERID_MAXILIFE 1014
112#define I2C_DRIVERID_MATORB 1015
113#define I2C_DRIVERID_GL520 1016
114#define I2C_DRIVERID_THMC50 1017
115#define I2C_DRIVERID_ADM1025 1020
116#define I2C_DRIVERID_LM87 1021
117#define I2C_DRIVERID_PCF8574 1022
118#define I2C_DRIVERID_MTP008 1023
119#define I2C_DRIVERID_DS1621 1024
120#define I2C_DRIVERID_ADM1024 1025
121#define I2C_DRIVERID_CH700X 1027 /* single driver for CH7003-7009 digital pc to tv encoders */
122#define I2C_DRIVERID_FSCPOS 1028
123#define I2C_DRIVERID_FSCSCY 1029
124#define I2C_DRIVERID_PCF8591 1030
125#define I2C_DRIVERID_LM92 1033
126#define I2C_DRIVERID_SMARTBATT 1035
127#define I2C_DRIVERID_BMCSENSORS 1036
128#define I2C_DRIVERID_FS451 1037
129#define I2C_DRIVERID_LM85 1039
130#define I2C_DRIVERID_LM83 1040
131#define I2C_DRIVERID_LM90 1042
132#define I2C_DRIVERID_ASB100 1043
133#define I2C_DRIVERID_FSCHER 1046
134#define I2C_DRIVERID_W83L785TS 1047
135#define I2C_DRIVERID_OV7670 1048 /* Omnivision 7670 camera */ 99#define I2C_DRIVERID_OV7670 1048 /* Omnivision 7670 camera */
136 100
137/* 101/*
diff --git a/include/linux/i2c/pca9539.h b/include/linux/i2c/pca953x.h
index 611d84ab7a30..3c7361217df8 100644
--- a/include/linux/i2c/pca9539.h
+++ b/include/linux/i2c/pca953x.h
@@ -1,6 +1,6 @@
1/* platform data for the PCA9539 16-bit I/O expander driver */ 1/* platform data for the PCA9539 16-bit I/O expander driver */
2 2
3struct pca9539_platform_data { 3struct pca953x_platform_data {
4 /* number of the first GPIO */ 4 /* number of the first GPIO */
5 unsigned gpio_base; 5 unsigned gpio_base;
6 6
diff --git a/include/linux/ide.h b/include/linux/ide.h
index acec99da832d..23fad89292df 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -906,6 +906,8 @@ enum {
906 IDE_TFLAG_IN_DEVICE, 906 IDE_TFLAG_IN_DEVICE,
907 /* force 16-bit I/O operations */ 907 /* force 16-bit I/O operations */
908 IDE_TFLAG_IO_16BIT = (1 << 30), 908 IDE_TFLAG_IO_16BIT = (1 << 30),
909 /* ide_task_t was allocated using kmalloc() */
910 IDE_TFLAG_DYN = (1 << 31),
909}; 911};
910 912
911struct ide_taskfile { 913struct ide_taskfile {
@@ -998,8 +1000,7 @@ extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *o
998void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int, u8 *); 1000void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int, u8 *);
999void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *); 1001void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *);
1000 1002
1001/* FIXME: palm_bk3710 uses BLK_DEV_IDEDMA_PCI without BLK_DEV_IDEPCI! */ 1003#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
1002#if defined(CONFIG_BLK_DEV_IDEPCI) && defined(CONFIG_BLK_DEV_IDEDMA_PCI)
1003void ide_hwif_setup_dma(ide_hwif_t *, const struct ide_port_info *); 1004void ide_hwif_setup_dma(ide_hwif_t *, const struct ide_port_info *);
1004#else 1005#else
1005static inline void ide_hwif_setup_dma(ide_hwif_t *hwif, 1006static inline void ide_hwif_setup_dma(ide_hwif_t *hwif,
@@ -1146,7 +1147,7 @@ ide_startstop_t ide_dma_intr(ide_drive_t *);
1146int ide_build_sglist(ide_drive_t *, struct request *); 1147int ide_build_sglist(ide_drive_t *, struct request *);
1147void ide_destroy_dmatable(ide_drive_t *); 1148void ide_destroy_dmatable(ide_drive_t *);
1148 1149
1149#ifdef CONFIG_BLK_DEV_IDEDMA_PCI 1150#ifdef CONFIG_BLK_DEV_IDEDMA_SFF
1150extern int ide_build_dmatable(ide_drive_t *, struct request *); 1151extern int ide_build_dmatable(ide_drive_t *, struct request *);
1151extern int ide_release_dma(ide_hwif_t *); 1152extern int ide_release_dma(ide_hwif_t *);
1152extern void ide_setup_dma(ide_hwif_t *, unsigned long); 1153extern void ide_setup_dma(ide_hwif_t *, unsigned long);
@@ -1157,7 +1158,7 @@ extern void ide_dma_start(ide_drive_t *);
1157extern int __ide_dma_end(ide_drive_t *); 1158extern int __ide_dma_end(ide_drive_t *);
1158extern void ide_dma_lost_irq(ide_drive_t *); 1159extern void ide_dma_lost_irq(ide_drive_t *);
1159extern void ide_dma_timeout(ide_drive_t *); 1160extern void ide_dma_timeout(ide_drive_t *);
1160#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */ 1161#endif /* CONFIG_BLK_DEV_IDEDMA_SFF */
1161 1162
1162#else 1163#else
1163static inline int ide_id_dma_bug(ide_drive_t *drive) { return 0; } 1164static inline int ide_id_dma_bug(ide_drive_t *drive) { return 0; }
@@ -1171,7 +1172,7 @@ static inline int ide_set_dma(ide_drive_t *drive) { return 1; }
1171static inline void ide_check_dma_crc(ide_drive_t *drive) { ; } 1172static inline void ide_check_dma_crc(ide_drive_t *drive) { ; }
1172#endif /* CONFIG_BLK_DEV_IDEDMA */ 1173#endif /* CONFIG_BLK_DEV_IDEDMA */
1173 1174
1174#ifndef CONFIG_BLK_DEV_IDEDMA_PCI 1175#ifndef CONFIG_BLK_DEV_IDEDMA_SFF
1175static inline void ide_release_dma(ide_hwif_t *drive) {;} 1176static inline void ide_release_dma(ide_hwif_t *drive) {;}
1176#endif 1177#endif
1177 1178
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 34f40efc7607..79504b22a932 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -327,7 +327,7 @@ static inline struct sk_buff *vlan_put_tag(struct sk_buff *skb, unsigned short t
327 * 327 *
328 * Returns error if the skb is not of VLAN type 328 * Returns error if the skb is not of VLAN type
329 */ 329 */
330static inline int __vlan_get_tag(struct sk_buff *skb, unsigned short *tag) 330static inline int __vlan_get_tag(const struct sk_buff *skb, unsigned short *tag)
331{ 331{
332 struct vlan_ethhdr *veth = (struct vlan_ethhdr *)skb->data; 332 struct vlan_ethhdr *veth = (struct vlan_ethhdr *)skb->data;
333 333
@@ -347,7 +347,8 @@ static inline int __vlan_get_tag(struct sk_buff *skb, unsigned short *tag)
347 * 347 *
348 * Returns error if @skb->cb[] is not set correctly 348 * Returns error if @skb->cb[] is not set correctly
349 */ 349 */
350static inline int __vlan_hwaccel_get_tag(struct sk_buff *skb, unsigned short *tag) 350static inline int __vlan_hwaccel_get_tag(const struct sk_buff *skb,
351 unsigned short *tag)
351{ 352{
352 struct vlan_skb_tx_cookie *cookie; 353 struct vlan_skb_tx_cookie *cookie;
353 354
@@ -370,7 +371,7 @@ static inline int __vlan_hwaccel_get_tag(struct sk_buff *skb, unsigned short *ta
370 * 371 *
371 * Returns error if the skb is not VLAN tagged 372 * Returns error if the skb is not VLAN tagged
372 */ 373 */
373static inline int vlan_get_tag(struct sk_buff *skb, unsigned short *tag) 374static inline int vlan_get_tag(const struct sk_buff *skb, unsigned short *tag)
374{ 375{
375 if (skb->dev->features & NETIF_F_HW_VLAN_TX) { 376 if (skb->dev->features & NETIF_F_HW_VLAN_TX) {
376 return __vlan_hwaccel_get_tag(skb, tag); 377 return __vlan_hwaccel_get_tag(skb, tag);
diff --git a/include/linux/init.h b/include/linux/init.h
index 90cdbbbbe077..a404a0055dd7 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -110,6 +110,7 @@
110#define __FINIT .previous 110#define __FINIT .previous
111 111
112#define __INITDATA .section ".init.data","aw" 112#define __INITDATA .section ".init.data","aw"
113#define __FINITDATA .previous
113 114
114#define __DEVINIT .section ".devinit.text", "ax" 115#define __DEVINIT .section ".devinit.text", "ax"
115#define __DEVINITDATA .section ".devinit.data", "aw" 116#define __DEVINITDATA .section ".devinit.data", "aw"
diff --git a/include/linux/input.h b/include/linux/input.h
index 056a17a4f34f..1bdc39a8c76c 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -1020,7 +1020,6 @@ struct ff_effect {
1020 * @going_away: marks devices that are in a middle of unregistering and 1020 * @going_away: marks devices that are in a middle of unregistering and
1021 * causes input_open_device*() fail with -ENODEV. 1021 * causes input_open_device*() fail with -ENODEV.
1022 * @dev: driver model's view of this device 1022 * @dev: driver model's view of this device
1023 * @cdev: union for struct device pointer
1024 * @h_list: list of input handles associated with the device. When 1023 * @h_list: list of input handles associated with the device. When
1025 * accessing the list dev->mutex must be held 1024 * accessing the list dev->mutex must be held
1026 * @node: used to place the device onto input_dev_list 1025 * @node: used to place the device onto input_dev_list
@@ -1085,9 +1084,6 @@ struct input_dev {
1085 int going_away; 1084 int going_away;
1086 1085
1087 struct device dev; 1086 struct device dev;
1088 union { /* temporarily so while we switching to struct device */
1089 struct device *dev;
1090 } cdev;
1091 1087
1092 struct list_head h_list; 1088 struct list_head h_list;
1093 struct list_head node; 1089 struct list_head node;
@@ -1311,6 +1307,9 @@ static inline void input_set_abs_params(struct input_dev *dev, int axis, int min
1311 dev->absbit[BIT_WORD(axis)] |= BIT_MASK(axis); 1307 dev->absbit[BIT_WORD(axis)] |= BIT_MASK(axis);
1312} 1308}
1313 1309
1310int input_get_keycode(struct input_dev *dev, int scancode, int *keycode);
1311int input_set_keycode(struct input_dev *dev, int scancode, int keycode);
1312
1314extern struct class input_class; 1313extern struct class input_class;
1315 1314
1316/** 1315/**
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index c3db4a00f1fa..dea7598aeff4 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -444,4 +444,6 @@ static inline void init_irq_proc(void)
444} 444}
445#endif 445#endif
446 446
447int show_interrupts(struct seq_file *p, void *v);
448
447#endif 449#endif
diff --git a/include/linux/ipc.h b/include/linux/ipc.h
index 408696ea5189..b8826107b518 100644
--- a/include/linux/ipc.h
+++ b/include/linux/ipc.h
@@ -100,58 +100,6 @@ struct kern_ipc_perm
100 void *security; 100 void *security;
101}; 101};
102 102
103struct ipc_ids;
104struct ipc_namespace {
105 struct kref kref;
106 struct ipc_ids *ids[3];
107
108 int sem_ctls[4];
109 int used_sems;
110
111 int msg_ctlmax;
112 int msg_ctlmnb;
113 int msg_ctlmni;
114 atomic_t msg_bytes;
115 atomic_t msg_hdrs;
116
117 size_t shm_ctlmax;
118 size_t shm_ctlall;
119 int shm_ctlmni;
120 int shm_tot;
121};
122
123extern struct ipc_namespace init_ipc_ns;
124
125#ifdef CONFIG_SYSVIPC
126#define INIT_IPC_NS(ns) .ns = &init_ipc_ns,
127extern void free_ipc_ns(struct kref *kref);
128extern struct ipc_namespace *copy_ipcs(unsigned long flags,
129 struct ipc_namespace *ns);
130#else
131#define INIT_IPC_NS(ns)
132static inline struct ipc_namespace *copy_ipcs(unsigned long flags,
133 struct ipc_namespace *ns)
134{
135 return ns;
136}
137#endif
138
139static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns)
140{
141#ifdef CONFIG_SYSVIPC
142 if (ns)
143 kref_get(&ns->kref);
144#endif
145 return ns;
146}
147
148static inline void put_ipc_ns(struct ipc_namespace *ns)
149{
150#ifdef CONFIG_SYSVIPC
151 kref_put(&ns->kref, free_ipc_ns);
152#endif
153}
154
155#endif /* __KERNEL__ */ 103#endif /* __KERNEL__ */
156 104
157#endif /* _LINUX_IPC_H */ 105#endif /* _LINUX_IPC_H */
diff --git a/include/linux/ipc_namespace.h b/include/linux/ipc_namespace.h
new file mode 100644
index 000000000000..e4451d1da753
--- /dev/null
+++ b/include/linux/ipc_namespace.h
@@ -0,0 +1,81 @@
1#ifndef __IPC_NAMESPACE_H__
2#define __IPC_NAMESPACE_H__
3
4#include <linux/err.h>
5#include <linux/idr.h>
6#include <linux/rwsem.h>
7
8struct ipc_ids {
9 int in_use;
10 unsigned short seq;
11 unsigned short seq_max;
12 struct rw_semaphore rw_mutex;
13 struct idr ipcs_idr;
14};
15
16struct ipc_namespace {
17 struct kref kref;
18 struct ipc_ids ids[3];
19
20 int sem_ctls[4];
21 int used_sems;
22
23 int msg_ctlmax;
24 int msg_ctlmnb;
25 int msg_ctlmni;
26 atomic_t msg_bytes;
27 atomic_t msg_hdrs;
28
29 size_t shm_ctlmax;
30 size_t shm_ctlall;
31 int shm_ctlmni;
32 int shm_tot;
33};
34
35extern struct ipc_namespace init_ipc_ns;
36
37#ifdef CONFIG_SYSVIPC
38#define INIT_IPC_NS(ns) .ns = &init_ipc_ns,
39#else
40#define INIT_IPC_NS(ns)
41#endif
42
43#if defined(CONFIG_SYSVIPC) && defined(CONFIG_IPC_NS)
44extern void free_ipc_ns(struct kref *kref);
45extern struct ipc_namespace *copy_ipcs(unsigned long flags,
46 struct ipc_namespace *ns);
47extern void free_ipcs(struct ipc_namespace *ns, struct ipc_ids *ids,
48 void (*free)(struct ipc_namespace *,
49 struct kern_ipc_perm *));
50
51static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns)
52{
53 if (ns)
54 kref_get(&ns->kref);
55 return ns;
56}
57
58static inline void put_ipc_ns(struct ipc_namespace *ns)
59{
60 kref_put(&ns->kref, free_ipc_ns);
61}
62#else
63static inline struct ipc_namespace *copy_ipcs(unsigned long flags,
64 struct ipc_namespace *ns)
65{
66 if (flags & CLONE_NEWIPC)
67 return ERR_PTR(-EINVAL);
68
69 return ns;
70}
71
72static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns)
73{
74 return ns;
75}
76
77static inline void put_ipc_ns(struct ipc_namespace *ns)
78{
79}
80#endif
81#endif
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 4669be080617..bfd9efb5cb49 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -25,7 +25,7 @@
25#include <asm/irq_regs.h> 25#include <asm/irq_regs.h>
26 26
27struct irq_desc; 27struct irq_desc;
28typedef void fastcall (*irq_flow_handler_t)(unsigned int irq, 28typedef void (*irq_flow_handler_t)(unsigned int irq,
29 struct irq_desc *desc); 29 struct irq_desc *desc);
30 30
31 31
@@ -276,19 +276,19 @@ extern int handle_IRQ_event(unsigned int irq, struct irqaction *action);
276 * Built-in IRQ handlers for various IRQ types, 276 * Built-in IRQ handlers for various IRQ types,
277 * callable via desc->chip->handle_irq() 277 * callable via desc->chip->handle_irq()
278 */ 278 */
279extern void fastcall handle_level_irq(unsigned int irq, struct irq_desc *desc); 279extern void handle_level_irq(unsigned int irq, struct irq_desc *desc);
280extern void fastcall handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc); 280extern void handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc);
281extern void fastcall handle_edge_irq(unsigned int irq, struct irq_desc *desc); 281extern void handle_edge_irq(unsigned int irq, struct irq_desc *desc);
282extern void fastcall handle_simple_irq(unsigned int irq, struct irq_desc *desc); 282extern void handle_simple_irq(unsigned int irq, struct irq_desc *desc);
283extern void fastcall handle_percpu_irq(unsigned int irq, struct irq_desc *desc); 283extern void handle_percpu_irq(unsigned int irq, struct irq_desc *desc);
284extern void fastcall handle_bad_irq(unsigned int irq, struct irq_desc *desc); 284extern void handle_bad_irq(unsigned int irq, struct irq_desc *desc);
285 285
286/* 286/*
287 * Monolithic do_IRQ implementation. 287 * Monolithic do_IRQ implementation.
288 * (is an explicit fastcall, because i386 4KSTACKS calls it from assembly) 288 * (is an explicit fastcall, because i386 4KSTACKS calls it from assembly)
289 */ 289 */
290#ifndef CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ 290#ifndef CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ
291extern fastcall unsigned int __do_IRQ(unsigned int irq); 291extern unsigned int __do_IRQ(unsigned int irq);
292#endif 292#endif
293 293
294/* 294/*
@@ -367,6 +367,9 @@ set_irq_chained_handler(unsigned int irq,
367 __set_irq_handler(irq, handle, 1, NULL); 367 __set_irq_handler(irq, handle, 1, NULL);
368} 368}
369 369
370extern void set_irq_noprobe(unsigned int irq);
371extern void set_irq_probe(unsigned int irq);
372
370/* Handle dynamic irq creation and destruction */ 373/* Handle dynamic irq creation and destruction */
371extern int create_irq(void); 374extern int create_irq(void);
372extern void destroy_irq(unsigned int irq); 375extern void destroy_irq(unsigned int irq);
diff --git a/include/linux/isdn.h b/include/linux/isdn.h
index d0ecc8eebfbf..9cb2855bb170 100644
--- a/include/linux/isdn.h
+++ b/include/linux/isdn.h
@@ -507,7 +507,6 @@ typedef struct modem_info {
507 struct ktermios normal_termios; /* For saving termios structs */ 507 struct ktermios normal_termios; /* For saving termios structs */
508 struct ktermios callout_termios; 508 struct ktermios callout_termios;
509 wait_queue_head_t open_wait, close_wait; 509 wait_queue_head_t open_wait, close_wait;
510 struct semaphore write_sem;
511 spinlock_t readlock; 510 spinlock_t readlock;
512} modem_info; 511} modem_info;
513 512
diff --git a/include/linux/isicom.h b/include/linux/isicom.h
index 45b3d48f0978..8f4c71759d73 100644
--- a/include/linux/isicom.h
+++ b/include/linux/isicom.h
@@ -37,8 +37,6 @@
37#define BOARD_COUNT 4 37#define BOARD_COUNT 4
38#define PORT_COUNT (BOARD_COUNT*16) 38#define PORT_COUNT (BOARD_COUNT*16)
39 39
40#define SERIAL_TYPE_NORMAL 1
41
42/* character sizes */ 40/* character sizes */
43 41
44#define ISICOM_CS5 0x0000 42#define ISICOM_CS5 0x0000
diff --git a/include/linux/istallion.h b/include/linux/istallion.h
index 106a5e85e5c4..5a84fe944b74 100644
--- a/include/linux/istallion.h
+++ b/include/linux/istallion.h
@@ -71,7 +71,6 @@ struct stliport {
71 wait_queue_head_t open_wait; 71 wait_queue_head_t open_wait;
72 wait_queue_head_t close_wait; 72 wait_queue_head_t close_wait;
73 wait_queue_head_t raw_wait; 73 wait_queue_head_t raw_wait;
74 struct work_struct tqhangup;
75 struct asysigs asig; 74 struct asysigs asig;
76 unsigned long addr; 75 unsigned long addr;
77 unsigned long rxoffset; 76 unsigned long rxoffset;
diff --git a/include/linux/jbd.h b/include/linux/jbd.h
index d9ecd13393b0..b18fd3b9b835 100644
--- a/include/linux/jbd.h
+++ b/include/linux/jbd.h
@@ -33,7 +33,6 @@
33#include <linux/lockdep.h> 33#include <linux/lockdep.h>
34 34
35#include <asm/semaphore.h> 35#include <asm/semaphore.h>
36#endif
37 36
38#define journal_oom_retry 1 37#define journal_oom_retry 1
39 38
@@ -84,7 +83,6 @@ static inline void jbd_free(void *ptr, size_t size)
84 83
85#define JFS_MIN_JOURNAL_BLOCKS 1024 84#define JFS_MIN_JOURNAL_BLOCKS 1024
86 85
87#ifdef __KERNEL__
88 86
89/** 87/**
90 * typedef handle_t - The handle_t type represents a single atomic update being performed by some process. 88 * typedef handle_t - The handle_t type represents a single atomic update being performed by some process.
@@ -924,7 +922,6 @@ extern int journal_recover (journal_t *journal);
924extern int journal_wipe (journal_t *, int); 922extern int journal_wipe (journal_t *, int);
925extern int journal_skip_recovery (journal_t *); 923extern int journal_skip_recovery (journal_t *);
926extern void journal_update_superblock (journal_t *, int); 924extern void journal_update_superblock (journal_t *, int);
927extern void __journal_abort_hard (journal_t *);
928extern void journal_abort (journal_t *, int); 925extern void journal_abort (journal_t *, int);
929extern int journal_errno (journal_t *); 926extern int journal_errno (journal_t *);
930extern void journal_ack_err (journal_t *); 927extern void journal_ack_err (journal_t *);
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h
index 7ba9e47bf061..e0b5b684d83f 100644
--- a/include/linux/jiffies.h
+++ b/include/linux/jiffies.h
@@ -42,7 +42,7 @@
42/* LATCH is used in the interval timer and ftape setup. */ 42/* LATCH is used in the interval timer and ftape setup. */
43#define LATCH ((CLOCK_TICK_RATE + HZ/2) / HZ) /* For divider */ 43#define LATCH ((CLOCK_TICK_RATE + HZ/2) / HZ) /* For divider */
44 44
45/* Suppose we want to devide two numbers NOM and DEN: NOM/DEN, the we can 45/* Suppose we want to devide two numbers NOM and DEN: NOM/DEN, then we can
46 * improve accuracy by shifting LSH bits, hence calculating: 46 * improve accuracy by shifting LSH bits, hence calculating:
47 * (NOM << LSH) / DEN 47 * (NOM << LSH) / DEN
48 * This however means trouble for large NOM, because (NOM << LSH) may no 48 * This however means trouble for large NOM, because (NOM << LSH) may no
@@ -160,7 +160,7 @@ extern unsigned long preset_lpj;
160 * We want to do realistic conversions of time so we need to use the same 160 * We want to do realistic conversions of time so we need to use the same
161 * values the update wall clock code uses as the jiffies size. This value 161 * values the update wall clock code uses as the jiffies size. This value
162 * is: TICK_NSEC (which is defined in timex.h). This 162 * is: TICK_NSEC (which is defined in timex.h). This
163 * is a constant and is in nanoseconds. We will used scaled math 163 * is a constant and is in nanoseconds. We will use scaled math
164 * with a set of scales defined here as SEC_JIFFIE_SC, USEC_JIFFIE_SC and 164 * with a set of scales defined here as SEC_JIFFIE_SC, USEC_JIFFIE_SC and
165 * NSEC_JIFFIE_SC. Note that these defines contain nothing but 165 * NSEC_JIFFIE_SC. Note that these defines contain nothing but
166 * constants and so are computed at compile time. SHIFT_HZ (computed in 166 * constants and so are computed at compile time. SHIFT_HZ (computed in
@@ -204,7 +204,7 @@ extern unsigned long preset_lpj;
204 * operator if the result is a long long AND at least one of the 204 * operator if the result is a long long AND at least one of the
205 * operands is cast to long long (usually just prior to the "*" so as 205 * operands is cast to long long (usually just prior to the "*" so as
206 * not to confuse it into thinking it really has a 64-bit operand, 206 * not to confuse it into thinking it really has a 64-bit operand,
207 * which, buy the way, it can do, but it take more code and at least 2 207 * which, buy the way, it can do, but it takes more code and at least 2
208 * mpys). 208 * mpys).
209 209
210 * We also need to be aware that one second in nanoseconds is only a 210 * We also need to be aware that one second in nanoseconds is only a
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index ff356b2ee478..2df44e773270 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -35,7 +35,7 @@ extern const char linux_proc_banner[];
35#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1) 35#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1)
36#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask)) 36#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
37#define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a))) 37#define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a)))
38#define IS_ALIGNED(x,a) (((x) % ((typeof(x))(a))) == 0) 38#define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0)
39 39
40#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr)) 40#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
41 41
@@ -133,7 +133,7 @@ NORET_TYPE void panic(const char * fmt, ...)
133extern void oops_enter(void); 133extern void oops_enter(void);
134extern void oops_exit(void); 134extern void oops_exit(void);
135extern int oops_may_print(void); 135extern int oops_may_print(void);
136fastcall NORET_TYPE void do_exit(long error_code) 136NORET_TYPE void do_exit(long error_code)
137 ATTRIB_NORET; 137 ATTRIB_NORET;
138NORET_TYPE void complete_and_exit(struct completion *, long) 138NORET_TYPE void complete_and_exit(struct completion *, long)
139 ATTRIB_NORET; 139 ATTRIB_NORET;
@@ -141,6 +141,10 @@ extern unsigned long simple_strtoul(const char *,char **,unsigned int);
141extern long simple_strtol(const char *,char **,unsigned int); 141extern long simple_strtol(const char *,char **,unsigned int);
142extern unsigned long long simple_strtoull(const char *,char **,unsigned int); 142extern unsigned long long simple_strtoull(const char *,char **,unsigned int);
143extern long long simple_strtoll(const char *,char **,unsigned int); 143extern long long simple_strtoll(const char *,char **,unsigned int);
144extern int strict_strtoul(const char *, unsigned int, unsigned long *);
145extern int strict_strtol(const char *, unsigned int, long *);
146extern int strict_strtoull(const char *, unsigned int, unsigned long long *);
147extern int strict_strtoll(const char *, unsigned int, long long *);
144extern int sprintf(char * buf, const char * fmt, ...) 148extern int sprintf(char * buf, const char * fmt, ...)
145 __attribute__ ((format (printf, 2, 3))); 149 __attribute__ ((format (printf, 2, 3)));
146extern int vsprintf(char *buf, const char *, va_list) 150extern int vsprintf(char *buf, const char *, va_list)
@@ -172,8 +176,6 @@ extern int kernel_text_address(unsigned long addr);
172struct pid; 176struct pid;
173extern struct pid *session_of_pgrp(struct pid *pgrp); 177extern struct pid *session_of_pgrp(struct pid *pgrp);
174 178
175extern void dump_thread(struct pt_regs *regs, struct user *dump);
176
177#ifdef CONFIG_PRINTK 179#ifdef CONFIG_PRINTK
178asmlinkage int vprintk(const char *fmt, va_list args) 180asmlinkage int vprintk(const char *fmt, va_list args)
179 __attribute__ ((format (printf, 1, 0))); 181 __attribute__ ((format (printf, 1, 0)));
@@ -182,6 +184,13 @@ asmlinkage int printk(const char * fmt, ...)
182extern int log_buf_get_len(void); 184extern int log_buf_get_len(void);
183extern int log_buf_read(int idx); 185extern int log_buf_read(int idx);
184extern int log_buf_copy(char *dest, int idx, int len); 186extern int log_buf_copy(char *dest, int idx, int len);
187
188extern int printk_ratelimit_jiffies;
189extern int printk_ratelimit_burst;
190extern int printk_ratelimit(void);
191extern int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst);
192extern bool printk_timed_ratelimit(unsigned long *caller_jiffies,
193 unsigned int interval_msec);
185#else 194#else
186static inline int vprintk(const char *s, va_list args) 195static inline int vprintk(const char *s, va_list args)
187 __attribute__ ((format (printf, 1, 0))); 196 __attribute__ ((format (printf, 1, 0)));
@@ -192,6 +201,12 @@ static inline int __cold printk(const char *s, ...) { return 0; }
192static inline int log_buf_get_len(void) { return 0; } 201static inline int log_buf_get_len(void) { return 0; }
193static inline int log_buf_read(int idx) { return 0; } 202static inline int log_buf_read(int idx) { return 0; }
194static inline int log_buf_copy(char *dest, int idx, int len) { return 0; } 203static inline int log_buf_copy(char *dest, int idx, int len) { return 0; }
204static inline int printk_ratelimit(void) { return 0; }
205static inline int __printk_ratelimit(int ratelimit_jiffies, \
206 int ratelimit_burst) { return 0; }
207static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, \
208 unsigned int interval_msec) \
209 { return false; }
195#endif 210#endif
196 211
197extern void __attribute__((format(printf, 1, 2))) 212extern void __attribute__((format(printf, 1, 2)))
@@ -199,11 +214,6 @@ extern void __attribute__((format(printf, 1, 2)))
199 214
200unsigned long int_sqrt(unsigned long); 215unsigned long int_sqrt(unsigned long);
201 216
202extern int printk_ratelimit(void);
203extern int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst);
204extern bool printk_timed_ratelimit(unsigned long *caller_jiffies,
205 unsigned int interval_msec);
206
207static inline void console_silent(void) 217static inline void console_silent(void)
208{ 218{
209 console_loglevel = 0; 219 console_loglevel = 0;
@@ -224,6 +234,7 @@ extern int panic_on_unrecovered_nmi;
224extern int tainted; 234extern int tainted;
225extern const char *print_tainted(void); 235extern const char *print_tainted(void);
226extern void add_taint(unsigned); 236extern void add_taint(unsigned);
237extern int root_mountflags;
227 238
228/* Values used for system_state */ 239/* Values used for system_state */
229extern enum system_states { 240extern enum system_states {
@@ -243,6 +254,7 @@ extern enum system_states {
243#define TAINT_BAD_PAGE (1<<5) 254#define TAINT_BAD_PAGE (1<<5)
244#define TAINT_USER (1<<6) 255#define TAINT_USER (1<<6)
245#define TAINT_DIE (1<<7) 256#define TAINT_DIE (1<<7)
257#define TAINT_OVERRIDDEN_ACPI_TABLE (1<<8)
246 258
247extern void dump_stack(void) __cold; 259extern void dump_stack(void) __cold;
248 260
diff --git a/include/linux/kexec.h b/include/linux/kexec.h
index 2d9c448d8c52..3265968cd2cd 100644
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -127,17 +127,21 @@ void vmcoreinfo_append_str(const char *fmt, ...)
127 __attribute__ ((format (printf, 1, 2))); 127 __attribute__ ((format (printf, 1, 2)));
128unsigned long paddr_vmcoreinfo_note(void); 128unsigned long paddr_vmcoreinfo_note(void);
129 129
130#define VMCOREINFO_OSRELEASE(name) \
131 vmcoreinfo_append_str("OSRELEASE=%s\n", #name)
132#define VMCOREINFO_PAGESIZE(value) \
133 vmcoreinfo_append_str("PAGESIZE=%ld\n", value)
130#define VMCOREINFO_SYMBOL(name) \ 134#define VMCOREINFO_SYMBOL(name) \
131 vmcoreinfo_append_str("SYMBOL(%s)=%lx\n", #name, (unsigned long)&name) 135 vmcoreinfo_append_str("SYMBOL(%s)=%lx\n", #name, (unsigned long)&name)
132#define VMCOREINFO_SIZE(name) \ 136#define VMCOREINFO_SIZE(name) \
133 vmcoreinfo_append_str("SIZE(%s)=%lu\n", #name, \ 137 vmcoreinfo_append_str("SIZE(%s)=%lu\n", #name, \
134 (unsigned long)sizeof(struct name))
135#define VMCOREINFO_TYPEDEF_SIZE(name) \
136 vmcoreinfo_append_str("SIZE(%s)=%lu\n", #name, \
137 (unsigned long)sizeof(name)) 138 (unsigned long)sizeof(name))
139#define VMCOREINFO_STRUCT_SIZE(name) \
140 vmcoreinfo_append_str("SIZE(%s)=%lu\n", #name, \
141 (unsigned long)sizeof(struct name))
138#define VMCOREINFO_OFFSET(name, field) \ 142#define VMCOREINFO_OFFSET(name, field) \
139 vmcoreinfo_append_str("OFFSET(%s.%s)=%lu\n", #name, #field, \ 143 vmcoreinfo_append_str("OFFSET(%s.%s)=%lu\n", #name, #field, \
140 (unsigned long)&(((struct name *)0)->field)) 144 (unsigned long)offsetof(struct name, field))
141#define VMCOREINFO_LENGTH(name, value) \ 145#define VMCOREINFO_LENGTH(name, value) \
142 vmcoreinfo_append_str("LENGTH(%s)=%lu\n", #name, (unsigned long)value) 146 vmcoreinfo_append_str("LENGTH(%s)=%lu\n", #name, (unsigned long)value)
143#define VMCOREINFO_NUMBER(name) \ 147#define VMCOREINFO_NUMBER(name) \
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
index 6168c0a44172..4a6ce82ba039 100644
--- a/include/linux/kprobes.h
+++ b/include/linux/kprobes.h
@@ -152,8 +152,10 @@ static inline int arch_trampoline_kprobe(struct kprobe *p)
152struct kretprobe { 152struct kretprobe {
153 struct kprobe kp; 153 struct kprobe kp;
154 kretprobe_handler_t handler; 154 kretprobe_handler_t handler;
155 kretprobe_handler_t entry_handler;
155 int maxactive; 156 int maxactive;
156 int nmissed; 157 int nmissed;
158 size_t data_size;
157 struct hlist_head free_instances; 159 struct hlist_head free_instances;
158 struct hlist_head used_instances; 160 struct hlist_head used_instances;
159}; 161};
@@ -164,6 +166,7 @@ struct kretprobe_instance {
164 struct kretprobe *rp; 166 struct kretprobe *rp;
165 kprobe_opcode_t *ret_addr; 167 kprobe_opcode_t *ret_addr;
166 struct task_struct *task; 168 struct task_struct *task;
169 char data[0];
167}; 170};
168 171
169struct kretprobe_blackpoint { 172struct kretprobe_blackpoint {
diff --git a/include/linux/ktime.h b/include/linux/ktime.h
index a6ddec141f96..36c542b70c6d 100644
--- a/include/linux/ktime.h
+++ b/include/linux/ktime.h
@@ -316,7 +316,8 @@ static inline ktime_t ktime_sub_us(const ktime_t kt, const u64 usec)
316 * idea of the (in)accuracy of timers. Timer values are rounded up to 316 * idea of the (in)accuracy of timers. Timer values are rounded up to
317 * this resolution values. 317 * this resolution values.
318 */ 318 */
319#define KTIME_LOW_RES (ktime_t){ .tv64 = TICK_NSEC } 319#define LOW_RES_NSEC TICK_NSEC
320#define KTIME_LOW_RES (ktime_t){ .tv64 = LOW_RES_NSEC }
320 321
321/* Get the monotonic time in timespec format: */ 322/* Get the monotonic time in timespec format: */
322extern void ktime_get_ts(struct timespec *ts); 323extern void ktime_get_ts(struct timespec *ts);
diff --git a/include/linux/leds.h b/include/linux/leds.h
index 00f89fd6c52a..0201f6f51cea 100644
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -38,6 +38,11 @@ struct led_classdev {
38 void (*brightness_set)(struct led_classdev *led_cdev, 38 void (*brightness_set)(struct led_classdev *led_cdev,
39 enum led_brightness brightness); 39 enum led_brightness brightness);
40 40
41 /* Activate hardware accelerated blink */
42 int (*blink_set)(struct led_classdev *led_cdev,
43 unsigned long *delay_on,
44 unsigned long *delay_off);
45
41 struct device *dev; 46 struct device *dev;
42 struct list_head node; /* LED Device list */ 47 struct list_head node; /* LED Device list */
43 char *default_trigger; /* Trigger to use */ 48 char *default_trigger; /* Trigger to use */
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 4374c4277780..bc5a8d0c7090 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -457,7 +457,6 @@ struct ata_queued_cmd {
457 unsigned long flags; /* ATA_QCFLAG_xxx */ 457 unsigned long flags; /* ATA_QCFLAG_xxx */
458 unsigned int tag; 458 unsigned int tag;
459 unsigned int n_elem; 459 unsigned int n_elem;
460 unsigned int n_iter;
461 unsigned int mapped_n_elem; 460 unsigned int mapped_n_elem;
462 461
463 int dma_dir; 462 int dma_dir;
@@ -1367,7 +1366,6 @@ static inline void ata_qc_reinit(struct ata_queued_cmd *qc)
1367 qc->nbytes = qc->raw_nbytes = qc->curbytes = 0; 1366 qc->nbytes = qc->raw_nbytes = qc->curbytes = 0;
1368 qc->n_elem = 0; 1367 qc->n_elem = 0;
1369 qc->mapped_n_elem = 0; 1368 qc->mapped_n_elem = 0;
1370 qc->n_iter = 0;
1371 qc->err_mask = 0; 1369 qc->err_mask = 0;
1372 qc->pad_len = 0; 1370 qc->pad_len = 0;
1373 qc->last_sg = NULL; 1371 qc->last_sg = NULL;
diff --git a/include/linux/log2.h b/include/linux/log2.h
index c8cf5e8ef171..25b808631cd9 100644
--- a/include/linux/log2.h
+++ b/include/linux/log2.h
@@ -190,4 +190,20 @@ unsigned long __rounddown_pow_of_two(unsigned long n)
190 __rounddown_pow_of_two(n) \ 190 __rounddown_pow_of_two(n) \
191 ) 191 )
192 192
193/**
194 * order_base_2 - calculate the (rounded up) base 2 order of the argument
195 * @n: parameter
196 *
197 * The first few values calculated by this routine:
198 * ob2(0) = 0
199 * ob2(1) = 0
200 * ob2(2) = 1
201 * ob2(3) = 2
202 * ob2(4) = 2
203 * ob2(5) = 3
204 * ... and so on.
205 */
206
207#define order_base_2(n) ilog2(roundup_pow_of_two(n))
208
193#endif /* _LINUX_LOG2_H */ 209#endif /* _LINUX_LOG2_H */
diff --git a/include/linux/loop.h b/include/linux/loop.h
index 26a0a103898f..46169a7b559b 100644
--- a/include/linux/loop.h
+++ b/include/linux/loop.h
@@ -76,6 +76,7 @@ struct loop_device {
76enum { 76enum {
77 LO_FLAGS_READ_ONLY = 1, 77 LO_FLAGS_READ_ONLY = 1,
78 LO_FLAGS_USE_AOPS = 2, 78 LO_FLAGS_USE_AOPS = 2,
79 LO_FLAGS_AUTOCLEAR = 4,
79}; 80};
80 81
81#include <asm/posix_types.h> /* for __kernel_old_dev_t */ 82#include <asm/posix_types.h> /* for __kernel_old_dev_t */
diff --git a/include/linux/lp.h b/include/linux/lp.h
index 7059b6b9878a..0df024bfd6f0 100644
--- a/include/linux/lp.h
+++ b/include/linux/lp.h
@@ -99,7 +99,7 @@
99#ifdef __KERNEL__ 99#ifdef __KERNEL__
100 100
101#include <linux/wait.h> 101#include <linux/wait.h>
102#include <asm/semaphore.h> 102#include <linux/mutex.h>
103 103
104/* Magic numbers for defining port-device mappings */ 104/* Magic numbers for defining port-device mappings */
105#define LP_PARPORT_UNSPEC -4 105#define LP_PARPORT_UNSPEC -4
@@ -145,7 +145,7 @@ struct lp_struct {
145#endif 145#endif
146 wait_queue_head_t waitq; 146 wait_queue_head_t waitq;
147 unsigned int last_error; 147 unsigned int last_error;
148 struct semaphore port_mutex; 148 struct mutex port_mutex;
149 wait_queue_head_t dataq; 149 wait_queue_head_t dataq;
150 long timeout; 150 long timeout;
151 unsigned int best_mode; 151 unsigned int best_mode;
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
new file mode 100644
index 000000000000..925d57b236aa
--- /dev/null
+++ b/include/linux/memcontrol.h
@@ -0,0 +1,188 @@
1/* memcontrol.h - Memory Controller
2 *
3 * Copyright IBM Corporation, 2007
4 * Author Balbir Singh <balbir@linux.vnet.ibm.com>
5 *
6 * Copyright 2007 OpenVZ SWsoft Inc
7 * Author: Pavel Emelianov <xemul@openvz.org>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 */
19
20#ifndef _LINUX_MEMCONTROL_H
21#define _LINUX_MEMCONTROL_H
22
23#include <linux/rcupdate.h>
24#include <linux/mm.h>
25
26struct mem_cgroup;
27struct page_cgroup;
28struct page;
29struct mm_struct;
30
31#ifdef CONFIG_CGROUP_MEM_CONT
32
33extern void mm_init_cgroup(struct mm_struct *mm, struct task_struct *p);
34extern void mm_free_cgroup(struct mm_struct *mm);
35extern void page_assign_page_cgroup(struct page *page,
36 struct page_cgroup *pc);
37extern struct page_cgroup *page_get_page_cgroup(struct page *page);
38extern int mem_cgroup_charge(struct page *page, struct mm_struct *mm,
39 gfp_t gfp_mask);
40extern void mem_cgroup_uncharge(struct page_cgroup *pc);
41extern void mem_cgroup_uncharge_page(struct page *page);
42extern void mem_cgroup_move_lists(struct page_cgroup *pc, bool active);
43extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan,
44 struct list_head *dst,
45 unsigned long *scanned, int order,
46 int mode, struct zone *z,
47 struct mem_cgroup *mem_cont,
48 int active);
49extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask);
50extern int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm,
51 gfp_t gfp_mask);
52int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem);
53
54#define vm_match_cgroup(mm, cgroup) \
55 ((cgroup) == rcu_dereference((mm)->mem_cgroup))
56
57extern int mem_cgroup_prepare_migration(struct page *page);
58extern void mem_cgroup_end_migration(struct page *page);
59extern void mem_cgroup_page_migration(struct page *page, struct page *newpage);
60
61/*
62 * For memory reclaim.
63 */
64extern int mem_cgroup_calc_mapped_ratio(struct mem_cgroup *mem);
65extern long mem_cgroup_reclaim_imbalance(struct mem_cgroup *mem);
66
67extern int mem_cgroup_get_reclaim_priority(struct mem_cgroup *mem);
68extern void mem_cgroup_note_reclaim_priority(struct mem_cgroup *mem,
69 int priority);
70extern void mem_cgroup_record_reclaim_priority(struct mem_cgroup *mem,
71 int priority);
72
73extern long mem_cgroup_calc_reclaim_active(struct mem_cgroup *mem,
74 struct zone *zone, int priority);
75extern long mem_cgroup_calc_reclaim_inactive(struct mem_cgroup *mem,
76 struct zone *zone, int priority);
77
78#else /* CONFIG_CGROUP_MEM_CONT */
79static inline void mm_init_cgroup(struct mm_struct *mm,
80 struct task_struct *p)
81{
82}
83
84static inline void mm_free_cgroup(struct mm_struct *mm)
85{
86}
87
88static inline void page_assign_page_cgroup(struct page *page,
89 struct page_cgroup *pc)
90{
91}
92
93static inline struct page_cgroup *page_get_page_cgroup(struct page *page)
94{
95 return NULL;
96}
97
98static inline int mem_cgroup_charge(struct page *page, struct mm_struct *mm,
99 gfp_t gfp_mask)
100{
101 return 0;
102}
103
104static inline void mem_cgroup_uncharge(struct page_cgroup *pc)
105{
106}
107
108static inline void mem_cgroup_uncharge_page(struct page *page)
109{
110}
111
112static inline void mem_cgroup_move_lists(struct page_cgroup *pc,
113 bool active)
114{
115}
116
117static inline int mem_cgroup_cache_charge(struct page *page,
118 struct mm_struct *mm,
119 gfp_t gfp_mask)
120{
121 return 0;
122}
123
124static inline int vm_match_cgroup(struct mm_struct *mm, struct mem_cgroup *mem)
125{
126 return 1;
127}
128
129static inline int task_in_mem_cgroup(struct task_struct *task,
130 const struct mem_cgroup *mem)
131{
132 return 1;
133}
134
135static inline int mem_cgroup_prepare_migration(struct page *page)
136{
137 return 0;
138}
139
140static inline void mem_cgroup_end_migration(struct page *page)
141{
142}
143
144static inline void
145mem_cgroup_page_migration(struct page *page, struct page *newpage)
146{
147}
148
149static inline int mem_cgroup_calc_mapped_ratio(struct mem_cgroup *mem)
150{
151 return 0;
152}
153
154static inline int mem_cgroup_reclaim_imbalance(struct mem_cgroup *mem)
155{
156 return 0;
157}
158
159static inline int mem_cgroup_get_reclaim_priority(struct mem_cgroup *mem)
160{
161 return 0;
162}
163
164static inline void mem_cgroup_note_reclaim_priority(struct mem_cgroup *mem,
165 int priority)
166{
167}
168
169static inline void mem_cgroup_record_reclaim_priority(struct mem_cgroup *mem,
170 int priority)
171{
172}
173
174static inline long mem_cgroup_calc_reclaim_active(struct mem_cgroup *mem,
175 struct zone *zone, int priority)
176{
177 return 0;
178}
179
180static inline long mem_cgroup_calc_reclaim_inactive(struct mem_cgroup *mem,
181 struct zone *zone, int priority)
182{
183 return 0;
184}
185#endif /* CONFIG_CGROUP_MEM_CONT */
186
187#endif /* _LINUX_MEMCONTROL_H */
188
diff --git a/include/linux/memstick.h b/include/linux/memstick.h
new file mode 100644
index 000000000000..334d059d6794
--- /dev/null
+++ b/include/linux/memstick.h
@@ -0,0 +1,299 @@
1/*
2 * Sony MemoryStick support
3 *
4 * Copyright (C) 2007 Alex Dubov <oakad@yahoo.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 */
11
12#ifndef _MEMSTICK_H
13#define _MEMSTICK_H
14
15#include <linux/workqueue.h>
16#include <linux/scatterlist.h>
17#include <linux/device.h>
18
19/*** Hardware based structures ***/
20
21struct ms_status_register {
22 unsigned char reserved;
23 unsigned char interrupt;
24#define MEMSTICK_INT_CMDNAK 0x0001
25#define MEMSTICK_INT_BREQ 0x0020
26#define MEMSTICK_INT_ERR 0x0040
27#define MEMSTICK_INT_CED 0x0080
28
29 unsigned char status0;
30#define MEMSTICK_STATUS0_WP 0x0001
31#define MEMSTICK_STATUS0_SL 0x0002
32#define MEMSTICK_STATUS0_BF 0x0010
33#define MEMSTICK_STATUS0_BE 0x0020
34#define MEMSTICK_STATUS0_FB0 0x0040
35#define MEMSTICK_STATUS0_MB 0x0080
36
37 unsigned char status1;
38#define MEMSTICK_STATUS1_UCFG 0x0001
39#define MEMSTICK_STATUS1_FGER 0x0002
40#define MEMSTICK_STATUS1_UCEX 0x0004
41#define MEMSTICK_STATUS1_EXER 0x0008
42#define MEMSTICK_STATUS1_UCDT 0x0010
43#define MEMSTICK_STATUS1_DTER 0x0020
44#define MEMSTICK_STATUS1_FBI 0x0040
45#define MEMSTICK_STATUS1_MB 0x0080
46} __attribute__((packed));
47
48struct ms_id_register {
49 unsigned char type;
50 unsigned char reserved;
51 unsigned char category;
52 unsigned char class;
53} __attribute__((packed));
54
55struct ms_param_register {
56 unsigned char system;
57 unsigned char block_address_msb;
58 unsigned short block_address;
59 unsigned char cp;
60#define MEMSTICK_CP_BLOCK 0x0000
61#define MEMSTICK_CP_PAGE 0x0020
62#define MEMSTICK_CP_EXTRA 0x0040
63#define MEMSTICK_CP_OVERWRITE 0x0080
64
65 unsigned char page_address;
66} __attribute__((packed));
67
68struct ms_extra_data_register {
69 unsigned char overwrite_flag;
70#define MEMSTICK_OVERWRITE_UPDATA 0x0010
71#define MEMSTICK_OVERWRITE_PAGE 0x0060
72#define MEMSTICK_OVERWRITE_BLOCK 0x0080
73
74 unsigned char management_flag;
75#define MEMSTICK_MANAGEMENT_SYSTEM 0x0004
76#define MEMSTICK_MANAGEMENT_TRANS_TABLE 0x0008
77#define MEMSTICK_MANAGEMENT_COPY 0x0010
78#define MEMSTICK_MANAGEMENT_ACCESS 0x0020
79
80 unsigned short logical_address;
81} __attribute__((packed));
82
83struct ms_register {
84 struct ms_status_register status;
85 struct ms_id_register id;
86 unsigned char reserved[8];
87 struct ms_param_register param;
88 struct ms_extra_data_register extra_data;
89} __attribute__((packed));
90
91struct mspro_param_register {
92 unsigned char system;
93 unsigned short data_count;
94 unsigned int data_address;
95 unsigned char cmd_param;
96} __attribute__((packed));
97
98struct mspro_register {
99 struct ms_status_register status;
100 struct ms_id_register id;
101 unsigned char reserved[8];
102 struct mspro_param_register param;
103} __attribute__((packed));
104
105struct ms_register_addr {
106 unsigned char r_offset;
107 unsigned char r_length;
108 unsigned char w_offset;
109 unsigned char w_length;
110} __attribute__((packed));
111
112enum {
113 MS_TPC_READ_LONG_DATA = 0x02,
114 MS_TPC_READ_SHORT_DATA = 0x03,
115 MS_TPC_READ_REG = 0x04,
116 MS_TPC_READ_IO_DATA = 0x05, /* unverified */
117 MS_TPC_GET_INT = 0x07,
118 MS_TPC_SET_RW_REG_ADRS = 0x08,
119 MS_TPC_EX_SET_CMD = 0x09,
120 MS_TPC_WRITE_IO_DATA = 0x0a, /* unverified */
121 MS_TPC_WRITE_REG = 0x0b,
122 MS_TPC_WRITE_SHORT_DATA = 0x0c,
123 MS_TPC_WRITE_LONG_DATA = 0x0d,
124 MS_TPC_SET_CMD = 0x0e
125};
126
127enum {
128 MS_CMD_BLOCK_END = 0x33,
129 MS_CMD_RESET = 0x3c,
130 MS_CMD_BLOCK_WRITE = 0x55,
131 MS_CMD_SLEEP = 0x5a,
132 MS_CMD_BLOCK_ERASE = 0x99,
133 MS_CMD_BLOCK_READ = 0xaa,
134 MS_CMD_CLEAR_BUF = 0xc3,
135 MS_CMD_FLASH_STOP = 0xcc,
136 MSPRO_CMD_FORMAT = 0x10,
137 MSPRO_CMD_SLEEP = 0x11,
138 MSPRO_CMD_READ_DATA = 0x20,
139 MSPRO_CMD_WRITE_DATA = 0x21,
140 MSPRO_CMD_READ_ATRB = 0x24,
141 MSPRO_CMD_STOP = 0x25,
142 MSPRO_CMD_ERASE = 0x26,
143 MSPRO_CMD_SET_IBA = 0x46,
144 MSPRO_CMD_SET_IBD = 0x47
145/*
146 MSPRO_CMD_RESET
147 MSPRO_CMD_WAKEUP
148 MSPRO_CMD_IN_IO_DATA
149 MSPRO_CMD_OUT_IO_DATA
150 MSPRO_CMD_READ_IO_ATRB
151 MSPRO_CMD_IN_IO_FIFO
152 MSPRO_CMD_OUT_IO_FIFO
153 MSPRO_CMD_IN_IOM
154 MSPRO_CMD_OUT_IOM
155*/
156};
157
158/*** Driver structures and functions ***/
159
160#define MEMSTICK_PART_SHIFT 3
161
162enum memstick_param { MEMSTICK_POWER = 1, MEMSTICK_INTERFACE };
163
164#define MEMSTICK_POWER_OFF 0
165#define MEMSTICK_POWER_ON 1
166
167#define MEMSTICK_SERIAL 0
168#define MEMSTICK_PARALLEL 1
169
170struct memstick_host;
171struct memstick_driver;
172
173#define MEMSTICK_MATCH_ALL 0x01
174
175#define MEMSTICK_TYPE_LEGACY 0xff
176#define MEMSTICK_TYPE_DUO 0x00
177#define MEMSTICK_TYPE_PRO 0x01
178
179#define MEMSTICK_CATEGORY_STORAGE 0xff
180#define MEMSTICK_CATEGORY_STORAGE_DUO 0x00
181
182#define MEMSTICK_CLASS_GENERIC 0xff
183#define MEMSTICK_CLASS_GENERIC_DUO 0x00
184
185
186struct memstick_device_id {
187 unsigned char match_flags;
188 unsigned char type;
189 unsigned char category;
190 unsigned char class;
191};
192
193struct memstick_request {
194 unsigned char tpc;
195 unsigned char data_dir:1,
196 need_card_int:1,
197 get_int_reg:1,
198 io_type:2;
199#define MEMSTICK_IO_NONE 0
200#define MEMSTICK_IO_VAL 1
201#define MEMSTICK_IO_SG 2
202
203 unsigned char int_reg;
204 int error;
205 union {
206 struct scatterlist sg;
207 struct {
208 unsigned char data_len;
209 unsigned char data[15];
210 };
211 };
212};
213
214struct memstick_dev {
215 struct memstick_device_id id;
216 struct memstick_host *host;
217 struct ms_register_addr reg_addr;
218 struct completion mrq_complete;
219 struct memstick_request current_mrq;
220
221 /* Check that media driver is still willing to operate the device. */
222 int (*check)(struct memstick_dev *card);
223 /* Get next request from the media driver. */
224 int (*next_request)(struct memstick_dev *card,
225 struct memstick_request **mrq);
226
227 struct device dev;
228};
229
230struct memstick_host {
231 struct mutex lock;
232 unsigned int id;
233 unsigned int caps;
234#define MEMSTICK_CAP_PARALLEL 1
235#define MEMSTICK_CAP_AUTO_GET_INT 2
236
237 struct work_struct media_checker;
238 struct class_device cdev;
239
240 struct memstick_dev *card;
241 unsigned int retries;
242
243 /* Notify the host that some requests are pending. */
244 void (*request)(struct memstick_host *host);
245 /* Set host IO parameters (power, clock, etc). */
246 void (*set_param)(struct memstick_host *host,
247 enum memstick_param param,
248 int value);
249 unsigned long private[0] ____cacheline_aligned;
250};
251
252struct memstick_driver {
253 struct memstick_device_id *id_table;
254 int (*probe)(struct memstick_dev *card);
255 void (*remove)(struct memstick_dev *card);
256 int (*suspend)(struct memstick_dev *card,
257 pm_message_t state);
258 int (*resume)(struct memstick_dev *card);
259
260 struct device_driver driver;
261};
262
263int memstick_register_driver(struct memstick_driver *drv);
264void memstick_unregister_driver(struct memstick_driver *drv);
265
266struct memstick_host *memstick_alloc_host(unsigned int extra,
267 struct device *dev);
268
269int memstick_add_host(struct memstick_host *host);
270void memstick_remove_host(struct memstick_host *host);
271void memstick_free_host(struct memstick_host *host);
272void memstick_detect_change(struct memstick_host *host);
273
274void memstick_init_req_sg(struct memstick_request *mrq, unsigned char tpc,
275 struct scatterlist *sg);
276void memstick_init_req(struct memstick_request *mrq, unsigned char tpc,
277 void *buf, size_t length);
278int memstick_next_req(struct memstick_host *host,
279 struct memstick_request **mrq);
280void memstick_new_req(struct memstick_host *host);
281
282int memstick_set_rw_addr(struct memstick_dev *card);
283
284static inline void *memstick_priv(struct memstick_host *host)
285{
286 return (void *)host->private;
287}
288
289static inline void *memstick_get_drvdata(struct memstick_dev *card)
290{
291 return dev_get_drvdata(&card->dev);
292}
293
294static inline void memstick_set_drvdata(struct memstick_dev *card, void *data)
295{
296 dev_set_drvdata(&card->dev, data);
297}
298
299#endif
diff --git a/include/linux/mfd/asic3.h b/include/linux/mfd/asic3.h
new file mode 100644
index 000000000000..4ab2162db13b
--- /dev/null
+++ b/include/linux/mfd/asic3.h
@@ -0,0 +1,497 @@
1/*
2 * include/linux/mfd/asic3.h
3 *
4 * Compaq ASIC3 headers.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * Copyright 2001 Compaq Computer Corporation.
11 * Copyright 2007 OpendHand.
12 */
13
14#ifndef __ASIC3_H__
15#define __ASIC3_H__
16
17#include <linux/types.h>
18
19struct asic3 {
20 void __iomem *mapping;
21 unsigned int bus_shift;
22 unsigned int irq_nr;
23 unsigned int irq_base;
24 spinlock_t lock;
25 u16 irq_bothedge[4];
26 struct device *dev;
27};
28
29struct asic3_platform_data {
30 struct {
31 u32 dir;
32 u32 init;
33 u32 sleep_mask;
34 u32 sleep_out;
35 u32 batt_fault_out;
36 u32 sleep_conf;
37 u32 alt_function;
38 } gpio_a, gpio_b, gpio_c, gpio_d;
39
40 unsigned int bus_shift;
41
42 unsigned int irq_base;
43
44 struct platform_device **children;
45 unsigned int n_children;
46};
47
48int asic3_gpio_get_value(struct asic3 *asic, unsigned gpio);
49void asic3_gpio_set_value(struct asic3 *asic, unsigned gpio, int val);
50
51#define ASIC3_NUM_GPIO_BANKS 4
52#define ASIC3_GPIOS_PER_BANK 16
53#define ASIC3_NUM_GPIOS 64
54#define ASIC3_NR_IRQS ASIC3_NUM_GPIOS + 6
55
56#define ASIC3_GPIO_BANK_A 0
57#define ASIC3_GPIO_BANK_B 1
58#define ASIC3_GPIO_BANK_C 2
59#define ASIC3_GPIO_BANK_D 3
60
61#define ASIC3_GPIO(bank, gpio) \
62 ((ASIC3_GPIOS_PER_BANK * ASIC3_GPIO_BANK_##bank) + (gpio))
63#define ASIC3_GPIO_bit(gpio) (1 << (gpio & 0xf))
64/* All offsets below are specified with this address bus shift */
65#define ASIC3_DEFAULT_ADDR_SHIFT 2
66
67#define ASIC3_OFFSET(base, reg) (ASIC3_##base##_Base + ASIC3_##base##_##reg)
68#define ASIC3_GPIO_OFFSET(base, reg) \
69 (ASIC3_GPIO_##base##_Base + ASIC3_GPIO_##reg)
70
71#define ASIC3_GPIO_A_Base 0x0000
72#define ASIC3_GPIO_B_Base 0x0100
73#define ASIC3_GPIO_C_Base 0x0200
74#define ASIC3_GPIO_D_Base 0x0300
75
76#define ASIC3_GPIO_Mask 0x00 /* R/W 0:don't mask */
77#define ASIC3_GPIO_Direction 0x04 /* R/W 0:input */
78#define ASIC3_GPIO_Out 0x08 /* R/W 0:output low */
79#define ASIC3_GPIO_TriggerType 0x0c /* R/W 0:level */
80#define ASIC3_GPIO_EdgeTrigger 0x10 /* R/W 0:falling */
81#define ASIC3_GPIO_LevelTrigger 0x14 /* R/W 0:low level detect */
82#define ASIC3_GPIO_SleepMask 0x18 /* R/W 0:don't mask in sleep mode */
83#define ASIC3_GPIO_SleepOut 0x1c /* R/W level 0:low in sleep mode */
84#define ASIC3_GPIO_BattFaultOut 0x20 /* R/W level 0:low in batt_fault */
85#define ASIC3_GPIO_IntStatus 0x24 /* R/W 0:none, 1:detect */
86#define ASIC3_GPIO_AltFunction 0x28 /* R/W 1:LED register control */
87#define ASIC3_GPIO_SleepConf 0x2c /*
88 * R/W bit 1: autosleep
89 * 0: disable gposlpout in normal mode,
90 * enable gposlpout in sleep mode.
91 */
92#define ASIC3_GPIO_Status 0x30 /* R Pin status */
93
94#define ASIC3_SPI_Base 0x0400
95#define ASIC3_SPI_Control 0x0000
96#define ASIC3_SPI_TxData 0x0004
97#define ASIC3_SPI_RxData 0x0008
98#define ASIC3_SPI_Int 0x000c
99#define ASIC3_SPI_Status 0x0010
100
101#define SPI_CONTROL_SPR(clk) ((clk) & 0x0f) /* Clock rate */
102
103#define ASIC3_PWM_0_Base 0x0500
104#define ASIC3_PWM_1_Base 0x0600
105#define ASIC3_PWM_TimeBase 0x0000
106#define ASIC3_PWM_PeriodTime 0x0004
107#define ASIC3_PWM_DutyTime 0x0008
108
109#define PWM_TIMEBASE_VALUE(x) ((x)&0xf) /* Low 4 bits sets time base */
110#define PWM_TIMEBASE_ENABLE (1 << 4) /* Enable clock */
111
112#define ASIC3_LED_0_Base 0x0700
113#define ASIC3_LED_1_Base 0x0800
114#define ASIC3_LED_2_Base 0x0900
115#define ASIC3_LED_TimeBase 0x0000 /* R/W 7 bits */
116#define ASIC3_LED_PeriodTime 0x0004 /* R/W 12 bits */
117#define ASIC3_LED_DutyTime 0x0008 /* R/W 12 bits */
118#define ASIC3_LED_AutoStopCount 0x000c /* R/W 16 bits */
119
120/* LED TimeBase bits - match ASIC2 */
121#define LED_TBS 0x0f /* Low 4 bits sets time base, max = 13 */
122 /* Note: max = 5 on hx4700 */
123 /* 0: maximum time base */
124 /* 1: maximum time base / 2 */
125 /* n: maximum time base / 2^n */
126
127#define LED_EN (1 << 4) /* LED ON/OFF 0:off, 1:on */
128#define LED_AUTOSTOP (1 << 5) /* LED ON/OFF auto stop 0:disable, 1:enable */
129#define LED_ALWAYS (1 << 6) /* LED Interrupt Mask 0:No mask, 1:mask */
130
131#define ASIC3_CLOCK_Base 0x0A00
132#define ASIC3_CLOCK_CDEX 0x00
133#define ASIC3_CLOCK_SEL 0x04
134
135#define CLOCK_CDEX_SOURCE (1 << 0) /* 2 bits */
136#define CLOCK_CDEX_SOURCE0 (1 << 0)
137#define CLOCK_CDEX_SOURCE1 (1 << 1)
138#define CLOCK_CDEX_SPI (1 << 2)
139#define CLOCK_CDEX_OWM (1 << 3)
140#define CLOCK_CDEX_PWM0 (1 << 4)
141#define CLOCK_CDEX_PWM1 (1 << 5)
142#define CLOCK_CDEX_LED0 (1 << 6)
143#define CLOCK_CDEX_LED1 (1 << 7)
144#define CLOCK_CDEX_LED2 (1 << 8)
145
146/* Clocks settings: 1 for 24.576 MHz, 0 for 12.288Mhz */
147#define CLOCK_CDEX_SD_HOST (1 << 9) /* R/W: SD host clock source */
148#define CLOCK_CDEX_SD_BUS (1 << 10) /* R/W: SD bus clock source ctrl */
149#define CLOCK_CDEX_SMBUS (1 << 11)
150#define CLOCK_CDEX_CONTROL_CX (1 << 12)
151
152#define CLOCK_CDEX_EX0 (1 << 13) /* R/W: 32.768 kHz crystal */
153#define CLOCK_CDEX_EX1 (1 << 14) /* R/W: 24.576 MHz crystal */
154
155#define CLOCK_SEL_SD_HCLK_SEL (1 << 0) /* R/W: SDIO host clock select */
156#define CLOCK_SEL_SD_BCLK_SEL (1 << 1) /* R/W: SDIO bus clock select */
157
158/* R/W: INT clock source control (32.768 kHz) */
159#define CLOCK_SEL_CX (1 << 2)
160
161
162#define ASIC3_INTR_Base 0x0B00
163
164#define ASIC3_INTR_IntMask 0x00 /* Interrupt mask control */
165#define ASIC3_INTR_PIntStat 0x04 /* Peripheral interrupt status */
166#define ASIC3_INTR_IntCPS 0x08 /* Interrupt timer clock pre-scale */
167#define ASIC3_INTR_IntTBS 0x0c /* Interrupt timer set */
168
169#define ASIC3_INTMASK_GINTMASK (1 << 0) /* Global INTs mask 1:enable */
170#define ASIC3_INTMASK_GINTEL (1 << 1) /* 1: rising edge, 0: hi level */
171#define ASIC3_INTMASK_MASK0 (1 << 2)
172#define ASIC3_INTMASK_MASK1 (1 << 3)
173#define ASIC3_INTMASK_MASK2 (1 << 4)
174#define ASIC3_INTMASK_MASK3 (1 << 5)
175#define ASIC3_INTMASK_MASK4 (1 << 6)
176#define ASIC3_INTMASK_MASK5 (1 << 7)
177
178#define ASIC3_INTR_PERIPHERAL_A (1 << 0)
179#define ASIC3_INTR_PERIPHERAL_B (1 << 1)
180#define ASIC3_INTR_PERIPHERAL_C (1 << 2)
181#define ASIC3_INTR_PERIPHERAL_D (1 << 3)
182#define ASIC3_INTR_LED0 (1 << 4)
183#define ASIC3_INTR_LED1 (1 << 5)
184#define ASIC3_INTR_LED2 (1 << 6)
185#define ASIC3_INTR_SPI (1 << 7)
186#define ASIC3_INTR_SMBUS (1 << 8)
187#define ASIC3_INTR_OWM (1 << 9)
188
189#define ASIC3_INTR_CPS(x) ((x)&0x0f) /* 4 bits, max 14 */
190#define ASIC3_INTR_CPS_SET (1 << 4) /* Time base enable */
191
192
193/* Basic control of the SD ASIC */
194#define ASIC3_SDHWCTRL_Base 0x0E00
195#define ASIC3_SDHWCTRL_SDConf 0x00
196
197#define ASIC3_SDHWCTRL_SUSPEND (1 << 0) /* 1=suspend all SD operations */
198#define ASIC3_SDHWCTRL_CLKSEL (1 << 1) /* 1=SDICK, 0=HCLK */
199#define ASIC3_SDHWCTRL_PCLR (1 << 2) /* All registers of SDIO cleared */
200#define ASIC3_SDHWCTRL_LEVCD (1 << 3) /* SD card detection: 0:low */
201
202/* SD card write protection: 0=high */
203#define ASIC3_SDHWCTRL_LEVWP (1 << 4)
204#define ASIC3_SDHWCTRL_SDLED (1 << 5) /* SD card LED signal 0=disable */
205
206/* SD card power supply ctrl 1=enable */
207#define ASIC3_SDHWCTRL_SDPWR (1 << 6)
208
209#define ASIC3_EXTCF_Base 0x1100
210
211#define ASIC3_EXTCF_Select 0x00
212#define ASIC3_EXTCF_Reset 0x04
213
214#define ASIC3_EXTCF_SMOD0 (1 << 0) /* slot number of mode 0 */
215#define ASIC3_EXTCF_SMOD1 (1 << 1) /* slot number of mode 1 */
216#define ASIC3_EXTCF_SMOD2 (1 << 2) /* slot number of mode 2 */
217#define ASIC3_EXTCF_OWM_EN (1 << 4) /* enable onewire module */
218#define ASIC3_EXTCF_OWM_SMB (1 << 5) /* OWM bus selection */
219#define ASIC3_EXTCF_OWM_RESET (1 << 6) /* ?? used by OWM and CF */
220#define ASIC3_EXTCF_CF0_SLEEP_MODE (1 << 7) /* CF0 sleep state */
221#define ASIC3_EXTCF_CF1_SLEEP_MODE (1 << 8) /* CF1 sleep state */
222#define ASIC3_EXTCF_CF0_PWAIT_EN (1 << 10) /* CF0 PWAIT_n control */
223#define ASIC3_EXTCF_CF1_PWAIT_EN (1 << 11) /* CF1 PWAIT_n control */
224#define ASIC3_EXTCF_CF0_BUF_EN (1 << 12) /* CF0 buffer control */
225#define ASIC3_EXTCF_CF1_BUF_EN (1 << 13) /* CF1 buffer control */
226#define ASIC3_EXTCF_SD_MEM_ENABLE (1 << 14)
227#define ASIC3_EXTCF_CF_SLEEP (1 << 15) /* CF sleep mode control */
228
229/*********************************************
230 * The Onewire interface registers
231 *
232 * OWM_CMD
233 * OWM_DAT
234 * OWM_INTR
235 * OWM_INTEN
236 * OWM_CLKDIV
237 *
238 *********************************************/
239
240#define ASIC3_OWM_Base 0xC00
241
242#define ASIC3_OWM_CMD 0x00
243#define ASIC3_OWM_DAT 0x04
244#define ASIC3_OWM_INTR 0x08
245#define ASIC3_OWM_INTEN 0x0C
246#define ASIC3_OWM_CLKDIV 0x10
247
248#define ASIC3_OWM_CMD_ONEWR (1 << 0)
249#define ASIC3_OWM_CMD_SRA (1 << 1)
250#define ASIC3_OWM_CMD_DQO (1 << 2)
251#define ASIC3_OWM_CMD_DQI (1 << 3)
252
253#define ASIC3_OWM_INTR_PD (1 << 0)
254#define ASIC3_OWM_INTR_PDR (1 << 1)
255#define ASIC3_OWM_INTR_TBE (1 << 2)
256#define ASIC3_OWM_INTR_TEMP (1 << 3)
257#define ASIC3_OWM_INTR_RBF (1 << 4)
258
259#define ASIC3_OWM_INTEN_EPD (1 << 0)
260#define ASIC3_OWM_INTEN_IAS (1 << 1)
261#define ASIC3_OWM_INTEN_ETBE (1 << 2)
262#define ASIC3_OWM_INTEN_ETMT (1 << 3)
263#define ASIC3_OWM_INTEN_ERBF (1 << 4)
264
265#define ASIC3_OWM_CLKDIV_PRE (3 << 0) /* two bits wide at bit 0 */
266#define ASIC3_OWM_CLKDIV_DIV (7 << 2) /* 3 bits wide at bit 2 */
267
268
269/*****************************************************************************
270 * The SD configuration registers are at a completely different location
271 * in memory. They are divided into three sets of registers:
272 *
273 * SD_CONFIG Core configuration register
274 * SD_CTRL Control registers for SD operations
275 * SDIO_CTRL Control registers for SDIO operations
276 *
277 *****************************************************************************/
278#define ASIC3_SD_CONFIG_Base 0x0400 /* Assumes 32 bit addressing */
279
280#define ASIC3_SD_CONFIG_Command 0x08 /* R/W: Command */
281
282/* [0:8] SD Control Register Base Address */
283#define ASIC3_SD_CONFIG_Addr0 0x20
284
285/* [9:31] SD Control Register Base Address */
286#define ASIC3_SD_CONFIG_Addr1 0x24
287
288/* R/O: interrupt assigned to pin */
289#define ASIC3_SD_CONFIG_IntPin 0x78
290
291/*
292 * Set to 0x1f to clock SD controller, 0 otherwise.
293 * At 0x82 - Gated Clock Ctrl
294 */
295#define ASIC3_SD_CONFIG_ClkStop 0x80
296
297/* Control clock of SD controller */
298#define ASIC3_SD_CONFIG_ClockMode 0x84
299#define ASIC3_SD_CONFIG_SDHC_PinStatus 0x88 /* R/0: SD pins status */
300#define ASIC3_SD_CONFIG_SDHC_Power1 0x90 /* Power1 - manual pwr ctrl */
301
302/* auto power up after card inserted */
303#define ASIC3_SD_CONFIG_SDHC_Power2 0x92
304
305/* auto power down when card removed */
306#define ASIC3_SD_CONFIG_SDHC_Power3 0x94
307#define ASIC3_SD_CONFIG_SDHC_CardDetect 0x98
308#define ASIC3_SD_CONFIG_SDHC_Slot 0xA0 /* R/O: support slot number */
309#define ASIC3_SD_CONFIG_SDHC_ExtGateClk1 0x1E0 /* Not used */
310#define ASIC3_SD_CONFIG_SDHC_ExtGateClk2 0x1E2 /* Not used*/
311
312/* GPIO Output Reg. , at 0x1EA - GPIO Output Enable Reg. */
313#define ASIC3_SD_CONFIG_SDHC_GPIO_OutAndEnable 0x1E8
314#define ASIC3_SD_CONFIG_SDHC_GPIO_Status 0x1EC /* GPIO Status Reg. */
315
316/* Bit 1: double buffer/single buffer */
317#define ASIC3_SD_CONFIG_SDHC_ExtGateClk3 0x1F0
318
319/* Memory access enable (set to 1 to access SD Controller) */
320#define SD_CONFIG_COMMAND_MAE (1<<1)
321
322#define SD_CONFIG_CLK_ENABLE_ALL 0x1f
323
324#define SD_CONFIG_POWER1_PC_33V 0x0200 /* Set for 3.3 volts */
325#define SD_CONFIG_POWER1_PC_OFF 0x0000 /* Turn off power */
326
327 /* two bits - number of cycles for card detection */
328#define SD_CONFIG_CARDDETECTMODE_CLK ((x) & 0x3)
329
330
331#define ASIC3_SD_CTRL_Base 0x1000
332
333#define ASIC3_SD_CTRL_Cmd 0x00
334#define ASIC3_SD_CTRL_Arg0 0x08
335#define ASIC3_SD_CTRL_Arg1 0x0C
336#define ASIC3_SD_CTRL_StopInternal 0x10
337#define ASIC3_SD_CTRL_TransferSectorCount 0x14
338#define ASIC3_SD_CTRL_Response0 0x18
339#define ASIC3_SD_CTRL_Response1 0x1C
340#define ASIC3_SD_CTRL_Response2 0x20
341#define ASIC3_SD_CTRL_Response3 0x24
342#define ASIC3_SD_CTRL_Response4 0x28
343#define ASIC3_SD_CTRL_Response5 0x2C
344#define ASIC3_SD_CTRL_Response6 0x30
345#define ASIC3_SD_CTRL_Response7 0x34
346#define ASIC3_SD_CTRL_CardStatus 0x38
347#define ASIC3_SD_CTRL_BufferCtrl 0x3C
348#define ASIC3_SD_CTRL_IntMaskCard 0x40
349#define ASIC3_SD_CTRL_IntMaskBuffer 0x44
350#define ASIC3_SD_CTRL_CardClockCtrl 0x48
351#define ASIC3_SD_CTRL_MemCardXferDataLen 0x4C
352#define ASIC3_SD_CTRL_MemCardOptionSetup 0x50
353#define ASIC3_SD_CTRL_ErrorStatus0 0x58
354#define ASIC3_SD_CTRL_ErrorStatus1 0x5C
355#define ASIC3_SD_CTRL_DataPort 0x60
356#define ASIC3_SD_CTRL_TransactionCtrl 0x68
357#define ASIC3_SD_CTRL_SoftwareReset 0x1C0
358
359#define SD_CTRL_SOFTWARE_RESET_CLEAR (1<<0)
360
361#define SD_CTRL_TRANSACTIONCONTROL_SET (1<<8)
362
363#define SD_CTRL_CARDCLOCKCONTROL_FOR_SD_CARD (1<<15)
364#define SD_CTRL_CARDCLOCKCONTROL_ENABLE_CLOCK (1<<8)
365#define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_512 (1<<7)
366#define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_256 (1<<6)
367#define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_128 (1<<5)
368#define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_64 (1<<4)
369#define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_32 (1<<3)
370#define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_16 (1<<2)
371#define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_8 (1<<1)
372#define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_4 (1<<0)
373#define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_2 (0<<0)
374
375#define MEM_CARD_OPTION_REQUIRED 0x000e
376#define MEM_CARD_OPTION_DATA_RESPONSE_TIMEOUT(x) (((x) & 0x0f) << 4)
377#define MEM_CARD_OPTION_C2_MODULE_NOT_PRESENT (1<<14)
378#define MEM_CARD_OPTION_DATA_XFR_WIDTH_1 (1<<15)
379#define MEM_CARD_OPTION_DATA_XFR_WIDTH_4 0
380
381#define SD_CTRL_COMMAND_INDEX(x) ((x) & 0x3f)
382#define SD_CTRL_COMMAND_TYPE_CMD (0 << 6)
383#define SD_CTRL_COMMAND_TYPE_ACMD (1 << 6)
384#define SD_CTRL_COMMAND_TYPE_AUTHENTICATION (2 << 6)
385#define SD_CTRL_COMMAND_RESPONSE_TYPE_NORMAL (0 << 8)
386#define SD_CTRL_COMMAND_RESPONSE_TYPE_EXT_R1 (4 << 8)
387#define SD_CTRL_COMMAND_RESPONSE_TYPE_EXT_R1B (5 << 8)
388#define SD_CTRL_COMMAND_RESPONSE_TYPE_EXT_R2 (6 << 8)
389#define SD_CTRL_COMMAND_RESPONSE_TYPE_EXT_R3 (7 << 8)
390#define SD_CTRL_COMMAND_DATA_PRESENT (1 << 11)
391#define SD_CTRL_COMMAND_TRANSFER_READ (1 << 12)
392#define SD_CTRL_COMMAND_TRANSFER_WRITE (0 << 12)
393#define SD_CTRL_COMMAND_MULTI_BLOCK (1 << 13)
394#define SD_CTRL_COMMAND_SECURITY_CMD (1 << 14)
395
396#define SD_CTRL_STOP_INTERNAL_ISSSUE_CMD12 (1 << 0)
397#define SD_CTRL_STOP_INTERNAL_AUTO_ISSUE_CMD12 (1 << 8)
398
399#define SD_CTRL_CARDSTATUS_RESPONSE_END (1 << 0)
400#define SD_CTRL_CARDSTATUS_RW_END (1 << 2)
401#define SD_CTRL_CARDSTATUS_CARD_REMOVED_0 (1 << 3)
402#define SD_CTRL_CARDSTATUS_CARD_INSERTED_0 (1 << 4)
403#define SD_CTRL_CARDSTATUS_SIGNAL_STATE_PRESENT_0 (1 << 5)
404#define SD_CTRL_CARDSTATUS_WRITE_PROTECT (1 << 7)
405#define SD_CTRL_CARDSTATUS_CARD_REMOVED_3 (1 << 8)
406#define SD_CTRL_CARDSTATUS_CARD_INSERTED_3 (1 << 9)
407#define SD_CTRL_CARDSTATUS_SIGNAL_STATE_PRESENT_3 (1 << 10)
408
409#define SD_CTRL_BUFFERSTATUS_CMD_INDEX_ERROR (1 << 0)
410#define SD_CTRL_BUFFERSTATUS_CRC_ERROR (1 << 1)
411#define SD_CTRL_BUFFERSTATUS_STOP_BIT_END_ERROR (1 << 2)
412#define SD_CTRL_BUFFERSTATUS_DATA_TIMEOUT (1 << 3)
413#define SD_CTRL_BUFFERSTATUS_BUFFER_OVERFLOW (1 << 4)
414#define SD_CTRL_BUFFERSTATUS_BUFFER_UNDERFLOW (1 << 5)
415#define SD_CTRL_BUFFERSTATUS_CMD_TIMEOUT (1 << 6)
416#define SD_CTRL_BUFFERSTATUS_UNK7 (1 << 7)
417#define SD_CTRL_BUFFERSTATUS_BUFFER_READ_ENABLE (1 << 8)
418#define SD_CTRL_BUFFERSTATUS_BUFFER_WRITE_ENABLE (1 << 9)
419#define SD_CTRL_BUFFERSTATUS_ILLEGAL_FUNCTION (1 << 13)
420#define SD_CTRL_BUFFERSTATUS_CMD_BUSY (1 << 14)
421#define SD_CTRL_BUFFERSTATUS_ILLEGAL_ACCESS (1 << 15)
422
423#define SD_CTRL_INTMASKCARD_RESPONSE_END (1 << 0)
424#define SD_CTRL_INTMASKCARD_RW_END (1 << 2)
425#define SD_CTRL_INTMASKCARD_CARD_REMOVED_0 (1 << 3)
426#define SD_CTRL_INTMASKCARD_CARD_INSERTED_0 (1 << 4)
427#define SD_CTRL_INTMASKCARD_SIGNAL_STATE_PRESENT_0 (1 << 5)
428#define SD_CTRL_INTMASKCARD_UNK6 (1 << 6)
429#define SD_CTRL_INTMASKCARD_WRITE_PROTECT (1 << 7)
430#define SD_CTRL_INTMASKCARD_CARD_REMOVED_3 (1 << 8)
431#define SD_CTRL_INTMASKCARD_CARD_INSERTED_3 (1 << 9)
432#define SD_CTRL_INTMASKCARD_SIGNAL_STATE_PRESENT_3 (1 << 10)
433
434#define SD_CTRL_INTMASKBUFFER_CMD_INDEX_ERROR (1 << 0)
435#define SD_CTRL_INTMASKBUFFER_CRC_ERROR (1 << 1)
436#define SD_CTRL_INTMASKBUFFER_STOP_BIT_END_ERROR (1 << 2)
437#define SD_CTRL_INTMASKBUFFER_DATA_TIMEOUT (1 << 3)
438#define SD_CTRL_INTMASKBUFFER_BUFFER_OVERFLOW (1 << 4)
439#define SD_CTRL_INTMASKBUFFER_BUFFER_UNDERFLOW (1 << 5)
440#define SD_CTRL_INTMASKBUFFER_CMD_TIMEOUT (1 << 6)
441#define SD_CTRL_INTMASKBUFFER_UNK7 (1 << 7)
442#define SD_CTRL_INTMASKBUFFER_BUFFER_READ_ENABLE (1 << 8)
443#define SD_CTRL_INTMASKBUFFER_BUFFER_WRITE_ENABLE (1 << 9)
444#define SD_CTRL_INTMASKBUFFER_ILLEGAL_FUNCTION (1 << 13)
445#define SD_CTRL_INTMASKBUFFER_CMD_BUSY (1 << 14)
446#define SD_CTRL_INTMASKBUFFER_ILLEGAL_ACCESS (1 << 15)
447
448#define SD_CTRL_DETAIL0_RESPONSE_CMD_ERROR (1 << 0)
449#define SD_CTRL_DETAIL0_END_BIT_ERROR_FOR_RESPONSE_NON_CMD12 (1 << 2)
450#define SD_CTRL_DETAIL0_END_BIT_ERROR_FOR_RESPONSE_CMD12 (1 << 3)
451#define SD_CTRL_DETAIL0_END_BIT_ERROR_FOR_READ_DATA (1 << 4)
452#define SD_CTRL_DETAIL0_END_BIT_ERROR_FOR_WRITE_CRC_STATUS (1 << 5)
453#define SD_CTRL_DETAIL0_CRC_ERROR_FOR_RESPONSE_NON_CMD12 (1 << 8)
454#define SD_CTRL_DETAIL0_CRC_ERROR_FOR_RESPONSE_CMD12 (1 << 9)
455#define SD_CTRL_DETAIL0_CRC_ERROR_FOR_READ_DATA (1 << 10)
456#define SD_CTRL_DETAIL0_CRC_ERROR_FOR_WRITE_CMD (1 << 11)
457
458#define SD_CTRL_DETAIL1_NO_CMD_RESPONSE (1 << 0)
459#define SD_CTRL_DETAIL1_TIMEOUT_READ_DATA (1 << 4)
460#define SD_CTRL_DETAIL1_TIMEOUT_CRS_STATUS (1 << 5)
461#define SD_CTRL_DETAIL1_TIMEOUT_CRC_BUSY (1 << 6)
462
463#define ASIC3_SDIO_CTRL_Base 0x1200
464
465#define ASIC3_SDIO_CTRL_Cmd 0x00
466#define ASIC3_SDIO_CTRL_CardPortSel 0x04
467#define ASIC3_SDIO_CTRL_Arg0 0x08
468#define ASIC3_SDIO_CTRL_Arg1 0x0C
469#define ASIC3_SDIO_CTRL_TransferBlockCount 0x14
470#define ASIC3_SDIO_CTRL_Response0 0x18
471#define ASIC3_SDIO_CTRL_Response1 0x1C
472#define ASIC3_SDIO_CTRL_Response2 0x20
473#define ASIC3_SDIO_CTRL_Response3 0x24
474#define ASIC3_SDIO_CTRL_Response4 0x28
475#define ASIC3_SDIO_CTRL_Response5 0x2C
476#define ASIC3_SDIO_CTRL_Response6 0x30
477#define ASIC3_SDIO_CTRL_Response7 0x34
478#define ASIC3_SDIO_CTRL_CardStatus 0x38
479#define ASIC3_SDIO_CTRL_BufferCtrl 0x3C
480#define ASIC3_SDIO_CTRL_IntMaskCard 0x40
481#define ASIC3_SDIO_CTRL_IntMaskBuffer 0x44
482#define ASIC3_SDIO_CTRL_CardXferDataLen 0x4C
483#define ASIC3_SDIO_CTRL_CardOptionSetup 0x50
484#define ASIC3_SDIO_CTRL_ErrorStatus0 0x54
485#define ASIC3_SDIO_CTRL_ErrorStatus1 0x58
486#define ASIC3_SDIO_CTRL_DataPort 0x60
487#define ASIC3_SDIO_CTRL_TransactionCtrl 0x68
488#define ASIC3_SDIO_CTRL_CardIntCtrl 0x6C
489#define ASIC3_SDIO_CTRL_ClocknWaitCtrl 0x70
490#define ASIC3_SDIO_CTRL_HostInformation 0x74
491#define ASIC3_SDIO_CTRL_ErrorCtrl 0x78
492#define ASIC3_SDIO_CTRL_LEDCtrl 0x7C
493#define ASIC3_SDIO_CTRL_SoftwareReset 0x1C0
494
495#define ASIC3_MAP_SIZE 0x2000
496
497#endif /* __ASIC3_H__ */
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 222815d91c40..6cdf813cd478 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -133,6 +133,11 @@ enum {
133 MLX4_STAT_RATE_OFFSET = 5 133 MLX4_STAT_RATE_OFFSET = 5
134}; 134};
135 135
136static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor)
137{
138 return (major << 32) | (minor << 16) | subminor;
139}
140
136struct mlx4_caps { 141struct mlx4_caps {
137 u64 fw_ver; 142 u64 fw_ver;
138 int num_ports; 143 int num_ports;
@@ -189,10 +194,8 @@ struct mlx4_buf_list {
189}; 194};
190 195
191struct mlx4_buf { 196struct mlx4_buf {
192 union { 197 struct mlx4_buf_list direct;
193 struct mlx4_buf_list direct; 198 struct mlx4_buf_list *page_list;
194 struct mlx4_buf_list *page_list;
195 } u;
196 int nbufs; 199 int nbufs;
197 int npages; 200 int npages;
198 int page_shift; 201 int page_shift;
@@ -308,6 +311,14 @@ struct mlx4_init_port_param {
308int mlx4_buf_alloc(struct mlx4_dev *dev, int size, int max_direct, 311int mlx4_buf_alloc(struct mlx4_dev *dev, int size, int max_direct,
309 struct mlx4_buf *buf); 312 struct mlx4_buf *buf);
310void mlx4_buf_free(struct mlx4_dev *dev, int size, struct mlx4_buf *buf); 313void mlx4_buf_free(struct mlx4_dev *dev, int size, struct mlx4_buf *buf);
314static inline void *mlx4_buf_offset(struct mlx4_buf *buf, int offset)
315{
316 if (BITS_PER_LONG == 64 || buf->nbufs == 1)
317 return buf->direct.buf + offset;
318 else
319 return buf->page_list[offset >> PAGE_SHIFT].buf +
320 (offset & (PAGE_SIZE - 1));
321}
311 322
312int mlx4_pd_alloc(struct mlx4_dev *dev, u32 *pdn); 323int mlx4_pd_alloc(struct mlx4_dev *dev, u32 *pdn);
313void mlx4_pd_free(struct mlx4_dev *dev, u32 pdn); 324void mlx4_pd_free(struct mlx4_dev *dev, u32 pdn);
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h
index 3968b943259a..09a2230923f2 100644
--- a/include/linux/mlx4/qp.h
+++ b/include/linux/mlx4/qp.h
@@ -154,7 +154,11 @@ struct mlx4_qp_context {
154 u32 reserved5[10]; 154 u32 reserved5[10];
155}; 155};
156 156
157/* Which firmware version adds support for NEC (NoErrorCompletion) bit */
158#define MLX4_FW_VER_WQE_CTRL_NEC mlx4_fw_ver(2, 2, 232)
159
157enum { 160enum {
161 MLX4_WQE_CTRL_NEC = 1 << 29,
158 MLX4_WQE_CTRL_FENCE = 1 << 6, 162 MLX4_WQE_CTRL_FENCE = 1 << 6,
159 MLX4_WQE_CTRL_CQ_UPDATE = 3 << 2, 163 MLX4_WQE_CTRL_CQ_UPDATE = 3 << 2,
160 MLX4_WQE_CTRL_SOLICITED = 1 << 1, 164 MLX4_WQE_CTRL_SOLICITED = 1 << 1,
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 89d7c691b93a..e8abb3814209 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -894,6 +894,18 @@ static inline pmd_t *pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long a
894#define pte_lockptr(mm, pmd) ({(void)(pmd); &(mm)->page_table_lock;}) 894#define pte_lockptr(mm, pmd) ({(void)(pmd); &(mm)->page_table_lock;})
895#endif /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */ 895#endif /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */
896 896
897static inline void pgtable_page_ctor(struct page *page)
898{
899 pte_lock_init(page);
900 inc_zone_page_state(page, NR_PAGETABLE);
901}
902
903static inline void pgtable_page_dtor(struct page *page)
904{
905 pte_lock_deinit(page);
906 dec_zone_page_state(page, NR_PAGETABLE);
907}
908
897#define pte_offset_map_lock(mm, pmd, address, ptlp) \ 909#define pte_offset_map_lock(mm, pmd, address, ptlp) \
898({ \ 910({ \
899 spinlock_t *__ptl = pte_lockptr(mm, pmd); \ 911 spinlock_t *__ptl = pte_lockptr(mm, pmd); \
@@ -1136,7 +1148,7 @@ struct page *follow_page(struct vm_area_struct *, unsigned long address,
1136#define FOLL_GET 0x04 /* do get_page on page */ 1148#define FOLL_GET 0x04 /* do get_page on page */
1137#define FOLL_ANON 0x08 /* give ZERO_PAGE if no pgtable */ 1149#define FOLL_ANON 0x08 /* give ZERO_PAGE if no pgtable */
1138 1150
1139typedef int (*pte_fn_t)(pte_t *pte, struct page *pmd_page, unsigned long addr, 1151typedef int (*pte_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr,
1140 void *data); 1152 void *data);
1141extern int apply_to_page_range(struct mm_struct *mm, unsigned long address, 1153extern int apply_to_page_range(struct mm_struct *mm, unsigned long address,
1142 unsigned long size, pte_fn_t fn, void *data); 1154 unsigned long size, pte_fn_t fn, void *data);
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index f4c03e0b355e..bfee0bd1d435 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -64,7 +64,10 @@ struct page {
64#if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS 64#if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS
65 spinlock_t ptl; 65 spinlock_t ptl;
66#endif 66#endif
67 struct kmem_cache *slab; /* SLUB: Pointer to slab */ 67 struct {
68 struct kmem_cache *slab; /* SLUB: Pointer to slab */
69 void *end; /* SLUB: end marker */
70 };
68 struct page *first_page; /* Compound tail pages */ 71 struct page *first_page; /* Compound tail pages */
69 }; 72 };
70 union { 73 union {
@@ -88,6 +91,9 @@ struct page {
88 void *virtual; /* Kernel virtual address (NULL if 91 void *virtual; /* Kernel virtual address (NULL if
89 not kmapped, ie. highmem) */ 92 not kmapped, ie. highmem) */
90#endif /* WANT_PAGE_VIRTUAL */ 93#endif /* WANT_PAGE_VIRTUAL */
94#ifdef CONFIG_CGROUP_MEM_CONT
95 unsigned long page_cgroup;
96#endif
91}; 97};
92 98
93/* 99/*
@@ -219,6 +225,9 @@ struct mm_struct {
219 /* aio bits */ 225 /* aio bits */
220 rwlock_t ioctx_list_lock; 226 rwlock_t ioctx_list_lock;
221 struct kioctx *ioctx_list; 227 struct kioctx *ioctx_list;
228#ifdef CONFIG_CGROUP_MEM_CONT
229 struct mem_cgroup *mem_cgroup;
230#endif
222}; 231};
223 232
224#endif /* _LINUX_MM_TYPES_H */ 233#endif /* _LINUX_MM_TYPES_H */
diff --git a/include/linux/module.h b/include/linux/module.h
index ac481e2094fd..ac28e8761e84 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -449,7 +449,7 @@ static inline void __module_get(struct module *module)
449/* For kallsyms to ask for address resolution. namebuf should be at 449/* For kallsyms to ask for address resolution. namebuf should be at
450 * least KSYM_NAME_LEN long: a pointer to namebuf is returned if 450 * least KSYM_NAME_LEN long: a pointer to namebuf is returned if
451 * found, otherwise NULL. */ 451 * found, otherwise NULL. */
452char *module_address_lookup(unsigned long addr, 452const char *module_address_lookup(unsigned long addr,
453 unsigned long *symbolsize, 453 unsigned long *symbolsize,
454 unsigned long *offset, 454 unsigned long *offset,
455 char **modname, 455 char **modname,
@@ -519,7 +519,7 @@ static inline void module_put(struct module *module)
519#define module_name(mod) "kernel" 519#define module_name(mod) "kernel"
520 520
521/* For kallsyms to ask for address resolution. NULL means not found. */ 521/* For kallsyms to ask for address resolution. NULL means not found. */
522static inline char *module_address_lookup(unsigned long addr, 522static inline const char *module_address_lookup(unsigned long addr,
523 unsigned long *symbolsize, 523 unsigned long *symbolsize,
524 unsigned long *offset, 524 unsigned long *offset,
525 char **modname, 525 char **modname,
diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h
index e17c5343cf51..b0ddf4b25862 100644
--- a/include/linux/mtd/cfi.h
+++ b/include/linux/mtd/cfi.h
@@ -98,6 +98,18 @@ static inline int cfi_interleave_supported(int i)
98#define CFI_DEVICETYPE_X32 (32 / 8) 98#define CFI_DEVICETYPE_X32 (32 / 8)
99#define CFI_DEVICETYPE_X64 (64 / 8) 99#define CFI_DEVICETYPE_X64 (64 / 8)
100 100
101
102/* Device Interface Code Assignments from the "Common Flash Memory Interface
103 * Publication 100" dated December 1, 2001.
104 */
105#define CFI_INTERFACE_X8_ASYNC 0x0000
106#define CFI_INTERFACE_X16_ASYNC 0x0001
107#define CFI_INTERFACE_X8_BY_X16_ASYNC 0x0002
108#define CFI_INTERFACE_X32_ASYNC 0x0003
109#define CFI_INTERFACE_X16_BY_X32_ASYNC 0x0005
110#define CFI_INTERFACE_NOT_ALLOWED 0xffff
111
112
101/* NB: We keep these structures in memory in HOST byteorder, except 113/* NB: We keep these structures in memory in HOST byteorder, except
102 * where individually noted. 114 * where individually noted.
103 */ 115 */
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 783fc983417c..0a13bb35f044 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -152,6 +152,15 @@ struct mtd_info {
152 int (*read) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); 152 int (*read) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);
153 int (*write) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf); 153 int (*write) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf);
154 154
155 /* In blackbox flight recorder like scenarios we want to make successful
156 writes in interrupt context. panic_write() is only intended to be
157 called when its known the kernel is about to panic and we need the
158 write to succeed. Since the kernel is not going to be running for much
159 longer, this function can break locks and delay to ensure the write
160 succeeds (but not sleep). */
161
162 int (*panic_write) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf);
163
155 int (*read_oob) (struct mtd_info *mtd, loff_t from, 164 int (*read_oob) (struct mtd_info *mtd, loff_t from,
156 struct mtd_oob_ops *ops); 165 struct mtd_oob_ops *ops);
157 int (*write_oob) (struct mtd_info *mtd, loff_t to, 166 int (*write_oob) (struct mtd_info *mtd, loff_t to,
diff --git a/include/linux/mtd/mtdram.h b/include/linux/mtd/mtdram.h
new file mode 100644
index 000000000000..04fdc07b7353
--- /dev/null
+++ b/include/linux/mtd/mtdram.h
@@ -0,0 +1,8 @@
1#ifndef __MTD_MTDRAM_H__
2#define __MTD_MTDRAM_H__
3
4#include <linux/mtd/mtd.h>
5int mtdram_init_device(struct mtd_info *mtd, void *mapped_address,
6 unsigned long size, char *name);
7
8#endif /* __MTD_MTDRAM_H__ */
diff --git a/include/linux/mtd/onenand_regs.h b/include/linux/mtd/onenand_regs.h
index c46161f4eee3..d1b310c92eb4 100644
--- a/include/linux/mtd/onenand_regs.h
+++ b/include/linux/mtd/onenand_regs.h
@@ -67,6 +67,7 @@
67/* 67/*
68 * Device ID Register F001h (R) 68 * Device ID Register F001h (R)
69 */ 69 */
70#define ONENAND_DEVICE_DENSITY_MASK (0xf)
70#define ONENAND_DEVICE_DENSITY_SHIFT (4) 71#define ONENAND_DEVICE_DENSITY_SHIFT (4)
71#define ONENAND_DEVICE_IS_DDP (1 << 3) 72#define ONENAND_DEVICE_IS_DDP (1 << 3)
72#define ONENAND_DEVICE_IS_DEMUX (1 << 2) 73#define ONENAND_DEVICE_IS_DEMUX (1 << 2)
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h
index da6b3d6f12a7..7c37d7e55abc 100644
--- a/include/linux/mtd/partitions.h
+++ b/include/linux/mtd/partitions.h
@@ -71,5 +71,12 @@ extern int parse_mtd_partitions(struct mtd_info *master, const char **types,
71 71
72#define put_partition_parser(p) do { module_put((p)->owner); } while(0) 72#define put_partition_parser(p) do { module_put((p)->owner); } while(0)
73 73
74#endif 74struct device;
75struct device_node;
76
77int __devinit of_mtd_parse_partitions(struct device *dev,
78 struct mtd_info *mtd,
79 struct device_node *node,
80 struct mtd_partition **pparts);
75 81
82#endif
diff --git a/include/linux/mtd/ubi.h b/include/linux/mtd/ubi.h
index 3d967b6b120a..f71201d0f3e7 100644
--- a/include/linux/mtd/ubi.h
+++ b/include/linux/mtd/ubi.h
@@ -26,23 +26,6 @@
26#include <mtd/ubi-user.h> 26#include <mtd/ubi-user.h>
27 27
28/* 28/*
29 * UBI data type hint constants.
30 *
31 * UBI_LONGTERM: long-term data
32 * UBI_SHORTTERM: short-term data
33 * UBI_UNKNOWN: data persistence is unknown
34 *
35 * These constants are used when data is written to UBI volumes in order to
36 * help the UBI wear-leveling unit to find more appropriate physical
37 * eraseblocks.
38 */
39enum {
40 UBI_LONGTERM = 1,
41 UBI_SHORTTERM,
42 UBI_UNKNOWN
43};
44
45/*
46 * enum ubi_open_mode - UBI volume open mode constants. 29 * enum ubi_open_mode - UBI volume open mode constants.
47 * 30 *
48 * UBI_READONLY: read-only mode 31 * UBI_READONLY: read-only mode
@@ -167,6 +150,7 @@ int ubi_leb_change(struct ubi_volume_desc *desc, int lnum, const void *buf,
167 int len, int dtype); 150 int len, int dtype);
168int ubi_leb_erase(struct ubi_volume_desc *desc, int lnum); 151int ubi_leb_erase(struct ubi_volume_desc *desc, int lnum);
169int ubi_leb_unmap(struct ubi_volume_desc *desc, int lnum); 152int ubi_leb_unmap(struct ubi_volume_desc *desc, int lnum);
153int ubi_leb_map(struct ubi_volume_desc *desc, int lnum, int dtype);
170int ubi_is_mapped(struct ubi_volume_desc *desc, int lnum); 154int ubi_is_mapped(struct ubi_volume_desc *desc, int lnum);
171 155
172/* 156/*
diff --git a/include/linux/mutex.h b/include/linux/mutex.h
index 05c590352dd7..bc6da10ceee0 100644
--- a/include/linux/mutex.h
+++ b/include/linux/mutex.h
@@ -112,7 +112,7 @@ extern void __mutex_init(struct mutex *lock, const char *name,
112 * 112 *
113 * Returns 1 if the mutex is locked, 0 if unlocked. 113 * Returns 1 if the mutex is locked, 0 if unlocked.
114 */ 114 */
115static inline int fastcall mutex_is_locked(struct mutex *lock) 115static inline int mutex_is_locked(struct mutex *lock)
116{ 116{
117 return atomic_read(&lock->count) != 1; 117 return atomic_read(&lock->count) != 1;
118} 118}
@@ -132,9 +132,9 @@ extern int __must_check mutex_lock_killable_nested(struct mutex *lock,
132#define mutex_lock_interruptible(lock) mutex_lock_interruptible_nested(lock, 0) 132#define mutex_lock_interruptible(lock) mutex_lock_interruptible_nested(lock, 0)
133#define mutex_lock_killable(lock) mutex_lock_killable_nested(lock, 0) 133#define mutex_lock_killable(lock) mutex_lock_killable_nested(lock, 0)
134#else 134#else
135extern void fastcall mutex_lock(struct mutex *lock); 135extern void mutex_lock(struct mutex *lock);
136extern int __must_check fastcall mutex_lock_interruptible(struct mutex *lock); 136extern int __must_check mutex_lock_interruptible(struct mutex *lock);
137extern int __must_check fastcall mutex_lock_killable(struct mutex *lock); 137extern int __must_check mutex_lock_killable(struct mutex *lock);
138 138
139# define mutex_lock_nested(lock, subclass) mutex_lock(lock) 139# define mutex_lock_nested(lock, subclass) mutex_lock(lock)
140# define mutex_lock_interruptible_nested(lock, subclass) mutex_lock_interruptible(lock) 140# define mutex_lock_interruptible_nested(lock, subclass) mutex_lock_interruptible(lock)
@@ -145,7 +145,7 @@ extern int __must_check fastcall mutex_lock_killable(struct mutex *lock);
145 * NOTE: mutex_trylock() follows the spin_trylock() convention, 145 * NOTE: mutex_trylock() follows the spin_trylock() convention,
146 * not the down_trylock() convention! 146 * not the down_trylock() convention!
147 */ 147 */
148extern int fastcall mutex_trylock(struct mutex *lock); 148extern int mutex_trylock(struct mutex *lock);
149extern void fastcall mutex_unlock(struct mutex *lock); 149extern void mutex_unlock(struct mutex *lock);
150 150
151#endif 151#endif
diff --git a/include/linux/nbd.h b/include/linux/nbd.h
index cc2b47240a8f..986572081e19 100644
--- a/include/linux/nbd.h
+++ b/include/linux/nbd.h
@@ -35,7 +35,6 @@ enum {
35}; 35};
36 36
37#define nbd_cmd(req) ((req)->cmd[0]) 37#define nbd_cmd(req) ((req)->cmd[0])
38#define MAX_NBD 128
39 38
40/* userspace doesn't need the nbd_device structure */ 39/* userspace doesn't need the nbd_device structure */
41#ifdef __KERNEL__ 40#ifdef __KERNEL__
diff --git a/include/linux/of.h b/include/linux/of.h
index b5f33efcb8e2..6981016dcc25 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -50,6 +50,7 @@ extern struct device_node *of_find_matching_node(struct device_node *from,
50extern struct device_node *of_find_node_by_path(const char *path); 50extern struct device_node *of_find_node_by_path(const char *path);
51extern struct device_node *of_find_node_by_phandle(phandle handle); 51extern struct device_node *of_find_node_by_phandle(phandle handle);
52extern struct device_node *of_get_parent(const struct device_node *node); 52extern struct device_node *of_get_parent(const struct device_node *node);
53extern struct device_node *of_get_next_parent(struct device_node *node);
53extern struct device_node *of_get_next_child(const struct device_node *node, 54extern struct device_node *of_get_next_child(const struct device_node *node,
54 struct device_node *prev); 55 struct device_node *prev);
55#define for_each_child_of_node(parent, child) \ 56#define for_each_child_of_node(parent, child) \
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 7215d3b1f4af..87195b62de52 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -301,14 +301,14 @@ struct pci_ops {
301 int (*write)(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 val); 301 int (*write)(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 val);
302}; 302};
303 303
304struct pci_raw_ops { 304/*
305 int (*read)(unsigned int domain, unsigned int bus, unsigned int devfn, 305 * ACPI needs to be able to access PCI config space before we've done a
306 int reg, int len, u32 *val); 306 * PCI bus scan and created pci_bus structures.
307 int (*write)(unsigned int domain, unsigned int bus, unsigned int devfn, 307 */
308 int reg, int len, u32 val); 308extern int raw_pci_read(unsigned int domain, unsigned int bus,
309}; 309 unsigned int devfn, int reg, int len, u32 *val);
310 310extern int raw_pci_write(unsigned int domain, unsigned int bus,
311extern struct pci_raw_ops *raw_pci_ops; 311 unsigned int devfn, int reg, int len, u32 val);
312 312
313struct pci_bus_region { 313struct pci_bus_region {
314 resource_size_t start; 314 resource_size_t start;
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 39d32837265b..df6dd79a0d3b 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -1765,6 +1765,7 @@
1765#define PCI_DEVICE_ID_QUATECH_DSC100 0x0020 1765#define PCI_DEVICE_ID_QUATECH_DSC100 0x0020
1766#define PCI_DEVICE_ID_QUATECH_ESC100D 0x0050 1766#define PCI_DEVICE_ID_QUATECH_ESC100D 0x0050
1767#define PCI_DEVICE_ID_QUATECH_ESC100M 0x0060 1767#define PCI_DEVICE_ID_QUATECH_ESC100M 0x0060
1768#define PCI_DEVICE_ID_QUATECH_SPPXP_100 0x0278
1768 1769
1769#define PCI_VENDOR_ID_SEALEVEL 0x135e 1770#define PCI_VENDOR_ID_SEALEVEL 0x135e
1770#define PCI_DEVICE_ID_SEALEVEL_U530 0x7101 1771#define PCI_DEVICE_ID_SEALEVEL_U530 0x7101
diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index 50faa0ea28e4..1ac969724bb2 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -54,7 +54,7 @@
54#ifdef CONFIG_SMP 54#ifdef CONFIG_SMP
55 55
56struct percpu_data { 56struct percpu_data {
57 void *ptrs[NR_CPUS]; 57 void *ptrs[1];
58}; 58};
59 59
60#define __percpu_disguise(pdata) (struct percpu_data *)~(unsigned long)(pdata) 60#define __percpu_disguise(pdata) (struct percpu_data *)~(unsigned long)(pdata)
diff --git a/include/linux/pfkeyv2.h b/include/linux/pfkeyv2.h
index 6db69ff5d83e..700725ddcaae 100644
--- a/include/linux/pfkeyv2.h
+++ b/include/linux/pfkeyv2.h
@@ -298,6 +298,7 @@ struct sadb_x_sec_ctx {
298#define SADB_X_EALG_BLOWFISHCBC 7 298#define SADB_X_EALG_BLOWFISHCBC 7
299#define SADB_EALG_NULL 11 299#define SADB_EALG_NULL 11
300#define SADB_X_EALG_AESCBC 12 300#define SADB_X_EALG_AESCBC 12
301#define SADB_X_EALG_AESCTR 13
301#define SADB_X_EALG_AES_CCM_ICV8 14 302#define SADB_X_EALG_AES_CCM_ICV8 14
302#define SADB_X_EALG_AES_CCM_ICV12 15 303#define SADB_X_EALG_AES_CCM_ICV12 15
303#define SADB_X_EALG_AES_CCM_ICV16 16 304#define SADB_X_EALG_AES_CCM_ICV16 16
diff --git a/include/linux/pid.h b/include/linux/pid.h
index e29a900a8499..f84d532b5d23 100644
--- a/include/linux/pid.h
+++ b/include/linux/pid.h
@@ -118,18 +118,17 @@ extern struct pid *find_pid(int nr);
118 */ 118 */
119extern struct pid *find_get_pid(int nr); 119extern struct pid *find_get_pid(int nr);
120extern struct pid *find_ge_pid(int nr, struct pid_namespace *); 120extern struct pid *find_ge_pid(int nr, struct pid_namespace *);
121int next_pidmap(struct pid_namespace *pid_ns, int last);
121 122
122extern struct pid *alloc_pid(struct pid_namespace *ns); 123extern struct pid *alloc_pid(struct pid_namespace *ns);
123extern void FASTCALL(free_pid(struct pid *pid)); 124extern void FASTCALL(free_pid(struct pid *pid));
124extern void zap_pid_ns_processes(struct pid_namespace *pid_ns);
125 125
126/* 126/*
127 * the helpers to get the pid's id seen from different namespaces 127 * the helpers to get the pid's id seen from different namespaces
128 * 128 *
129 * pid_nr() : global id, i.e. the id seen from the init namespace; 129 * pid_nr() : global id, i.e. the id seen from the init namespace;
130 * pid_vnr() : virtual id, i.e. the id seen from the namespace this pid 130 * pid_vnr() : virtual id, i.e. the id seen from the pid namespace of
131 * belongs to. this only makes sence when called in the 131 * current.
132 * context of the task that belongs to the same namespace;
133 * pid_nr_ns() : id seen from the ns specified. 132 * pid_nr_ns() : id seen from the ns specified.
134 * 133 *
135 * see also task_xid_nr() etc in include/linux/sched.h 134 * see also task_xid_nr() etc in include/linux/sched.h
@@ -144,14 +143,7 @@ static inline pid_t pid_nr(struct pid *pid)
144} 143}
145 144
146pid_t pid_nr_ns(struct pid *pid, struct pid_namespace *ns); 145pid_t pid_nr_ns(struct pid *pid, struct pid_namespace *ns);
147 146pid_t pid_vnr(struct pid *pid);
148static inline pid_t pid_vnr(struct pid *pid)
149{
150 pid_t nr = 0;
151 if (pid)
152 nr = pid->numbers[pid->level].nr;
153 return nr;
154}
155 147
156#define do_each_pid_task(pid, type, task) \ 148#define do_each_pid_task(pid, type, task) \
157 do { \ 149 do { \
@@ -160,7 +152,13 @@ static inline pid_t pid_vnr(struct pid *pid)
160 hlist_for_each_entry_rcu((task), pos___, \ 152 hlist_for_each_entry_rcu((task), pos___, \
161 &pid->tasks[type], pids[type].node) { 153 &pid->tasks[type], pids[type].node) {
162 154
155 /*
156 * Both old and new leaders may be attached to
157 * the same pid in the middle of de_thread().
158 */
163#define while_each_pid_task(pid, type, task) \ 159#define while_each_pid_task(pid, type, task) \
160 if (type == PIDTYPE_PID) \
161 break; \
164 } \ 162 } \
165 } while (0) 163 } while (0)
166 164
diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h
index 1689e28483e4..fcd61fa2c833 100644
--- a/include/linux/pid_namespace.h
+++ b/include/linux/pid_namespace.h
@@ -39,6 +39,7 @@ static inline struct pid_namespace *get_pid_ns(struct pid_namespace *ns)
39 39
40extern struct pid_namespace *copy_pid_ns(unsigned long flags, struct pid_namespace *ns); 40extern struct pid_namespace *copy_pid_ns(unsigned long flags, struct pid_namespace *ns);
41extern void free_pid_ns(struct kref *kref); 41extern void free_pid_ns(struct kref *kref);
42extern void zap_pid_ns_processes(struct pid_namespace *pid_ns);
42 43
43static inline void put_pid_ns(struct pid_namespace *ns) 44static inline void put_pid_ns(struct pid_namespace *ns)
44{ 45{
@@ -66,6 +67,11 @@ static inline void put_pid_ns(struct pid_namespace *ns)
66{ 67{
67} 68}
68 69
70
71static inline void zap_pid_ns_processes(struct pid_namespace *ns)
72{
73 BUG();
74}
69#endif /* CONFIG_PID_NS */ 75#endif /* CONFIG_PID_NS */
70 76
71static inline struct pid_namespace *task_active_pid_ns(struct task_struct *tsk) 77static inline struct pid_namespace *task_active_pid_ns(struct task_struct *tsk)
diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h
index 40fac8c4559d..28dfc61cf79e 100644
--- a/include/linux/pkt_cls.h
+++ b/include/linux/pkt_cls.h
@@ -348,6 +348,7 @@ enum
348 FLOW_KEY_RTCLASSID, 348 FLOW_KEY_RTCLASSID,
349 FLOW_KEY_SKUID, 349 FLOW_KEY_SKUID,
350 FLOW_KEY_SKGID, 350 FLOW_KEY_SKGID,
351 FLOW_KEY_VLAN_TAG,
351 __FLOW_KEY_MAX, 352 __FLOW_KEY_MAX,
352}; 353};
353 354
diff --git a/include/linux/pnp.h b/include/linux/pnp.h
index b9339d8b95bc..cd6332b88829 100644
--- a/include/linux/pnp.h
+++ b/include/linux/pnp.h
@@ -258,6 +258,7 @@ extern struct pnp_protocol isapnp_protocol;
258#else 258#else
259#define pnp_device_is_isapnp(dev) 0 259#define pnp_device_is_isapnp(dev) 0
260#endif 260#endif
261extern struct mutex pnp_res_mutex;
261 262
262#ifdef CONFIG_PNPBIOS 263#ifdef CONFIG_PNPBIOS
263extern struct pnp_protocol pnpbios_protocol; 264extern struct pnp_protocol pnpbios_protocol;
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 5cbf3e371012..68ed19ccf1f7 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -94,6 +94,7 @@ enum power_supply_property {
94 /* Properties of type `const char *' */ 94 /* Properties of type `const char *' */
95 POWER_SUPPLY_PROP_MODEL_NAME, 95 POWER_SUPPLY_PROP_MODEL_NAME,
96 POWER_SUPPLY_PROP_MANUFACTURER, 96 POWER_SUPPLY_PROP_MANUFACTURER,
97 POWER_SUPPLY_PROP_SERIAL_NUMBER,
97}; 98};
98 99
99enum power_supply_type { 100enum power_supply_type {
diff --git a/include/linux/preempt.h b/include/linux/preempt.h
index 484988ed301e..23f0c54175cd 100644
--- a/include/linux/preempt.h
+++ b/include/linux/preempt.h
@@ -11,8 +11,8 @@
11#include <linux/list.h> 11#include <linux/list.h>
12 12
13#ifdef CONFIG_DEBUG_PREEMPT 13#ifdef CONFIG_DEBUG_PREEMPT
14 extern void fastcall add_preempt_count(int val); 14 extern void add_preempt_count(int val);
15 extern void fastcall sub_preempt_count(int val); 15 extern void sub_preempt_count(int val);
16#else 16#else
17# define add_preempt_count(val) do { preempt_count() += (val); } while (0) 17# define add_preempt_count(val) do { preempt_count() += (val); } while (0)
18# define sub_preempt_count(val) do { preempt_count() -= (val); } while (0) 18# define sub_preempt_count(val) do { preempt_count() -= (val); } while (0)
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index e43551516831..d6a4f69bdc92 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -118,13 +118,17 @@ struct dentry *proc_pid_lookup(struct inode *dir, struct dentry * dentry, struct
118int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir); 118int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir);
119unsigned long task_vsize(struct mm_struct *); 119unsigned long task_vsize(struct mm_struct *);
120int task_statm(struct mm_struct *, int *, int *, int *, int *); 120int task_statm(struct mm_struct *, int *, int *, int *, int *);
121char *task_mem(struct mm_struct *, char *); 121void task_mem(struct seq_file *, struct mm_struct *);
122void clear_refs_smap(struct mm_struct *mm);
122 123
123struct proc_dir_entry *de_get(struct proc_dir_entry *de); 124struct proc_dir_entry *de_get(struct proc_dir_entry *de);
124void de_put(struct proc_dir_entry *de); 125void de_put(struct proc_dir_entry *de);
125 126
126extern struct proc_dir_entry *create_proc_entry(const char *name, mode_t mode, 127extern struct proc_dir_entry *create_proc_entry(const char *name, mode_t mode,
127 struct proc_dir_entry *parent); 128 struct proc_dir_entry *parent);
129struct proc_dir_entry *proc_create(const char *name, mode_t mode,
130 struct proc_dir_entry *parent,
131 const struct file_operations *proc_fops);
128extern void remove_proc_entry(const char *name, struct proc_dir_entry *parent); 132extern void remove_proc_entry(const char *name, struct proc_dir_entry *parent);
129 133
130extern struct vfsmount *proc_mnt; 134extern struct vfsmount *proc_mnt;
@@ -219,7 +223,12 @@ static inline void proc_flush_task(struct task_struct *task)
219 223
220static inline struct proc_dir_entry *create_proc_entry(const char *name, 224static inline struct proc_dir_entry *create_proc_entry(const char *name,
221 mode_t mode, struct proc_dir_entry *parent) { return NULL; } 225 mode_t mode, struct proc_dir_entry *parent) { return NULL; }
222 226static inline struct proc_dir_entry *proc_create(const char *name,
227 mode_t mode, struct proc_dir_entry *parent,
228 const struct file_operations *proc_fops)
229{
230 return NULL;
231}
223#define remove_proc_entry(name, parent) do {} while (0) 232#define remove_proc_entry(name, parent) do {} while (0)
224 233
225static inline struct proc_dir_entry *proc_symlink(const char *name, 234static inline struct proc_dir_entry *proc_symlink(const char *name,
@@ -262,6 +271,9 @@ extern void kclist_add(struct kcore_list *, void *, size_t);
262union proc_op { 271union proc_op {
263 int (*proc_get_link)(struct inode *, struct dentry **, struct vfsmount **); 272 int (*proc_get_link)(struct inode *, struct dentry **, struct vfsmount **);
264 int (*proc_read)(struct task_struct *task, char *page); 273 int (*proc_read)(struct task_struct *task, char *page);
274 int (*proc_show)(struct seq_file *m,
275 struct pid_namespace *ns, struct pid *pid,
276 struct task_struct *task);
265}; 277};
266 278
267struct proc_inode { 279struct proc_inode {
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index 515bff053de8..ebe0c17039cf 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
@@ -67,7 +67,6 @@
67#define PT_TRACE_EXEC 0x00000080 67#define PT_TRACE_EXEC 0x00000080
68#define PT_TRACE_VFORK_DONE 0x00000100 68#define PT_TRACE_VFORK_DONE 0x00000100
69#define PT_TRACE_EXIT 0x00000200 69#define PT_TRACE_EXIT 0x00000200
70#define PT_ATTACHED 0x00000400 /* parent != real_parent */
71 70
72#define PT_TRACE_MASK 0x000003f4 71#define PT_TRACE_MASK 0x000003f4
73 72
@@ -204,6 +203,41 @@ static inline void user_enable_block_step(struct task_struct *task)
204} 203}
205#endif /* arch_has_block_step */ 204#endif /* arch_has_block_step */
206 205
206#ifndef arch_ptrace_stop_needed
207/**
208 * arch_ptrace_stop_needed - Decide whether arch_ptrace_stop() should be called
209 * @code: current->exit_code value ptrace will stop with
210 * @info: siginfo_t pointer (or %NULL) for signal ptrace will stop with
211 *
212 * This is called with the siglock held, to decide whether or not it's
213 * necessary to release the siglock and call arch_ptrace_stop() with the
214 * same @code and @info arguments. It can be defined to a constant if
215 * arch_ptrace_stop() is never required, or always is. On machines where
216 * this makes sense, it should be defined to a quick test to optimize out
217 * calling arch_ptrace_stop() when it would be superfluous. For example,
218 * if the thread has not been back to user mode since the last stop, the
219 * thread state might indicate that nothing needs to be done.
220 */
221#define arch_ptrace_stop_needed(code, info) (0)
222#endif
223
224#ifndef arch_ptrace_stop
225/**
226 * arch_ptrace_stop - Do machine-specific work before stopping for ptrace
227 * @code: current->exit_code value ptrace will stop with
228 * @info: siginfo_t pointer (or %NULL) for signal ptrace will stop with
229 *
230 * This is called with no locks held when arch_ptrace_stop_needed() has
231 * just returned nonzero. It is allowed to block, e.g. for user memory
232 * access. The arch can have machine-specific work to be done before
233 * ptrace stops. On ia64, register backing store gets written back to user
234 * memory here. Since this can be costly (requires dropping the siglock),
235 * we only do it when the arch requires it for this particular stop, as
236 * indicated by arch_ptrace_stop_needed().
237 */
238#define arch_ptrace_stop(code, info) do { } while (0)
239#endif
240
207#endif 241#endif
208 242
209#endif 243#endif
diff --git a/include/linux/qnx4_fs.h b/include/linux/qnx4_fs.h
index 19bc9b8b6191..34a196ee7941 100644
--- a/include/linux/qnx4_fs.h
+++ b/include/linux/qnx4_fs.h
@@ -110,6 +110,7 @@ struct qnx4_inode_info {
110 struct inode vfs_inode; 110 struct inode vfs_inode;
111}; 111};
112 112
113extern struct inode *qnx4_iget(struct super_block *, unsigned long);
113extern struct dentry *qnx4_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd); 114extern struct dentry *qnx4_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd);
114extern unsigned long qnx4_count_free_blocks(struct super_block *sb); 115extern unsigned long qnx4_count_free_blocks(struct super_block *sb);
115extern unsigned long qnx4_block_map(struct inode *inode, long iblock); 116extern unsigned long qnx4_block_map(struct inode *inode, long iblock);
diff --git a/include/linux/raid/bitmap.h b/include/linux/raid/bitmap.h
index 306a1d1a5af0..e51b531cd0b2 100644
--- a/include/linux/raid/bitmap.h
+++ b/include/linux/raid/bitmap.h
@@ -244,6 +244,8 @@ struct bitmap {
244 */ 244 */
245 unsigned long daemon_lastrun; /* jiffies of last run */ 245 unsigned long daemon_lastrun; /* jiffies of last run */
246 unsigned long daemon_sleep; /* how many seconds between updates? */ 246 unsigned long daemon_sleep; /* how many seconds between updates? */
247 unsigned long last_end_sync; /* when we lasted called end_sync to
248 * update bitmap with resync progress */
247 249
248 atomic_t pending_writes; /* pending writes to the bitmap file */ 250 atomic_t pending_writes; /* pending writes to the bitmap file */
249 wait_queue_head_t write_wait; 251 wait_queue_head_t write_wait;
@@ -275,6 +277,7 @@ void bitmap_endwrite(struct bitmap *bitmap, sector_t offset,
275int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int degraded); 277int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int degraded);
276void bitmap_end_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int aborted); 278void bitmap_end_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int aborted);
277void bitmap_close_sync(struct bitmap *bitmap); 279void bitmap_close_sync(struct bitmap *bitmap);
280void bitmap_cond_end_sync(struct bitmap *bitmap, sector_t sector);
278 281
279void bitmap_unplug(struct bitmap *bitmap); 282void bitmap_unplug(struct bitmap *bitmap);
280void bitmap_daemon_work(struct bitmap *bitmap); 283void bitmap_daemon_work(struct bitmap *bitmap);
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h
index dcb729244f47..85a068bab625 100644
--- a/include/linux/raid/md_k.h
+++ b/include/linux/raid/md_k.h
@@ -81,6 +81,8 @@ struct mdk_rdev_s
81#define In_sync 2 /* device is in_sync with rest of array */ 81#define In_sync 2 /* device is in_sync with rest of array */
82#define WriteMostly 4 /* Avoid reading if at all possible */ 82#define WriteMostly 4 /* Avoid reading if at all possible */
83#define BarriersNotsupp 5 /* BIO_RW_BARRIER is not supported */ 83#define BarriersNotsupp 5 /* BIO_RW_BARRIER is not supported */
84#define AllReserved 6 /* If whole device is reserved for
85 * one array */
84 86
85 int desc_nr; /* descriptor index in the superblock */ 87 int desc_nr; /* descriptor index in the superblock */
86 int raid_disk; /* role of device in array */ 88 int raid_disk; /* role of device in array */
@@ -130,6 +132,9 @@ struct mddev_s
130 minor_version, 132 minor_version,
131 patch_version; 133 patch_version;
132 int persistent; 134 int persistent;
135 int external; /* metadata is
136 * managed externally */
137 char metadata_type[17]; /* externally set*/
133 int chunk_size; 138 int chunk_size;
134 time_t ctime, utime; 139 time_t ctime, utime;
135 int level, layout; 140 int level, layout;
@@ -216,6 +221,8 @@ struct mddev_s
216 atomic_t recovery_active; /* blocks scheduled, but not written */ 221 atomic_t recovery_active; /* blocks scheduled, but not written */
217 wait_queue_head_t recovery_wait; 222 wait_queue_head_t recovery_wait;
218 sector_t recovery_cp; 223 sector_t recovery_cp;
224 sector_t resync_max; /* resync should pause
225 * when it gets here */
219 226
220 spinlock_t write_lock; 227 spinlock_t write_lock;
221 wait_queue_head_t sb_wait; /* for waiting on superblock updates */ 228 wait_queue_head_t sb_wait; /* for waiting on superblock updates */
@@ -306,23 +313,17 @@ static inline char * mdname (mddev_t * mddev)
306 * iterates through some rdev ringlist. It's safe to remove the 313 * iterates through some rdev ringlist. It's safe to remove the
307 * current 'rdev'. Dont touch 'tmp' though. 314 * current 'rdev'. Dont touch 'tmp' though.
308 */ 315 */
309#define ITERATE_RDEV_GENERIC(head,rdev,tmp) \ 316#define rdev_for_each_list(rdev, tmp, list) \
310 \ 317 \
311 for ((tmp) = (head).next; \ 318 for ((tmp) = (list).next; \
312 (rdev) = (list_entry((tmp), mdk_rdev_t, same_set)), \ 319 (rdev) = (list_entry((tmp), mdk_rdev_t, same_set)), \
313 (tmp) = (tmp)->next, (tmp)->prev != &(head) \ 320 (tmp) = (tmp)->next, (tmp)->prev != &(list) \
314 ; ) 321 ; )
315/* 322/*
316 * iterates through the 'same array disks' ringlist 323 * iterates through the 'same array disks' ringlist
317 */ 324 */
318#define ITERATE_RDEV(mddev,rdev,tmp) \ 325#define rdev_for_each(rdev, tmp, mddev) \
319 ITERATE_RDEV_GENERIC((mddev)->disks,rdev,tmp) 326 rdev_for_each_list(rdev, tmp, (mddev)->disks)
320
321/*
322 * Iterates through 'pending RAID disks'
323 */
324#define ITERATE_RDEV_PENDING(rdev,tmp) \
325 ITERATE_RDEV_GENERIC(pending_raid_disks,rdev,tmp)
326 327
327typedef struct mdk_thread_s { 328typedef struct mdk_thread_s {
328 void (*run) (mddev_t *mddev); 329 void (*run) (mddev_t *mddev);
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index d32c14de270e..37a642c54871 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -174,10 +174,13 @@ struct rcu_head {
174 * code. 174 * code.
175 */ 175 */
176 176
177#define rcu_assign_pointer(p, v) ({ \ 177#define rcu_assign_pointer(p, v) \
178 smp_wmb(); \ 178 ({ \
179 (p) = (v); \ 179 if (!__builtin_constant_p(v) || \
180 }) 180 ((v) != NULL)) \
181 smp_wmb(); \
182 (p) = (v); \
183 })
181 184
182/** 185/**
183 * synchronize_sched - block until all CPUs have exited any non-preemptive 186 * synchronize_sched - block until all CPUs have exited any non-preemptive
diff --git a/include/linux/rcupreempt.h b/include/linux/rcupreempt.h
index ece8eb3e4151..60c2a033b19e 100644
--- a/include/linux/rcupreempt.h
+++ b/include/linux/rcupreempt.h
@@ -46,8 +46,8 @@
46#define rcu_bh_qsctr_inc(cpu) 46#define rcu_bh_qsctr_inc(cpu)
47#define call_rcu_bh(head, rcu) call_rcu(head, rcu) 47#define call_rcu_bh(head, rcu) call_rcu(head, rcu)
48 48
49extern void __rcu_read_lock(void); 49extern void __rcu_read_lock(void) __acquires(RCU);
50extern void __rcu_read_unlock(void); 50extern void __rcu_read_unlock(void) __releases(RCU);
51extern int rcu_pending(int cpu); 51extern int rcu_pending(int cpu);
52extern int rcu_needs_cpu(int cpu); 52extern int rcu_needs_cpu(int cpu);
53 53
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index 422eab4958a6..8e7eff2cd0ab 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -287,7 +287,7 @@ static inline struct reiserfs_sb_info *REISERFS_SB(const struct super_block *sb)
287 287
288/* Don't trust REISERFS_SB(sb)->s_bmap_nr, it's a u16 288/* Don't trust REISERFS_SB(sb)->s_bmap_nr, it's a u16
289 * which overflows on large file systems. */ 289 * which overflows on large file systems. */
290static inline u32 reiserfs_bmap_count(struct super_block *sb) 290static inline __u32 reiserfs_bmap_count(struct super_block *sb)
291{ 291{
292 return (SB_BLOCK_COUNT(sb) - 1) / (sb->s_blocksize * 8) + 1; 292 return (SB_BLOCK_COUNT(sb) - 1) / (sb->s_blocksize * 8) + 1;
293} 293}
diff --git a/include/linux/res_counter.h b/include/linux/res_counter.h
new file mode 100644
index 000000000000..61363ce896d5
--- /dev/null
+++ b/include/linux/res_counter.h
@@ -0,0 +1,127 @@
1#ifndef __RES_COUNTER_H__
2#define __RES_COUNTER_H__
3
4/*
5 * Resource Counters
6 * Contain common data types and routines for resource accounting
7 *
8 * Copyright 2007 OpenVZ SWsoft Inc
9 *
10 * Author: Pavel Emelianov <xemul@openvz.org>
11 *
12 */
13
14#include <linux/cgroup.h>
15
16/*
17 * The core object. the cgroup that wishes to account for some
18 * resource may include this counter into its structures and use
19 * the helpers described beyond
20 */
21
22struct res_counter {
23 /*
24 * the current resource consumption level
25 */
26 unsigned long long usage;
27 /*
28 * the limit that usage cannot exceed
29 */
30 unsigned long long limit;
31 /*
32 * the number of unsuccessful attempts to consume the resource
33 */
34 unsigned long long failcnt;
35 /*
36 * the lock to protect all of the above.
37 * the routines below consider this to be IRQ-safe
38 */
39 spinlock_t lock;
40};
41
42/*
43 * Helpers to interact with userspace
44 * res_counter_read/_write - put/get the specified fields from the
45 * res_counter struct to/from the user
46 *
47 * @counter: the counter in question
48 * @member: the field to work with (see RES_xxx below)
49 * @buf: the buffer to opeate on,...
50 * @nbytes: its size...
51 * @pos: and the offset.
52 */
53
54ssize_t res_counter_read(struct res_counter *counter, int member,
55 const char __user *buf, size_t nbytes, loff_t *pos,
56 int (*read_strategy)(unsigned long long val, char *s));
57ssize_t res_counter_write(struct res_counter *counter, int member,
58 const char __user *buf, size_t nbytes, loff_t *pos,
59 int (*write_strategy)(char *buf, unsigned long long *val));
60
61/*
62 * the field descriptors. one for each member of res_counter
63 */
64
65enum {
66 RES_USAGE,
67 RES_LIMIT,
68 RES_FAILCNT,
69};
70
71/*
72 * helpers for accounting
73 */
74
75void res_counter_init(struct res_counter *counter);
76
77/*
78 * charge - try to consume more resource.
79 *
80 * @counter: the counter
81 * @val: the amount of the resource. each controller defines its own
82 * units, e.g. numbers, bytes, Kbytes, etc
83 *
84 * returns 0 on success and <0 if the counter->usage will exceed the
85 * counter->limit _locked call expects the counter->lock to be taken
86 */
87
88int res_counter_charge_locked(struct res_counter *counter, unsigned long val);
89int res_counter_charge(struct res_counter *counter, unsigned long val);
90
91/*
92 * uncharge - tell that some portion of the resource is released
93 *
94 * @counter: the counter
95 * @val: the amount of the resource
96 *
97 * these calls check for usage underflow and show a warning on the console
98 * _locked call expects the counter->lock to be taken
99 */
100
101void res_counter_uncharge_locked(struct res_counter *counter, unsigned long val);
102void res_counter_uncharge(struct res_counter *counter, unsigned long val);
103
104static inline bool res_counter_limit_check_locked(struct res_counter *cnt)
105{
106 if (cnt->usage < cnt->limit)
107 return true;
108
109 return false;
110}
111
112/*
113 * Helper function to detect if the cgroup is within it's limit or
114 * not. It's currently called from cgroup_rss_prepare()
115 */
116static inline bool res_counter_check_under_limit(struct res_counter *cnt)
117{
118 bool ret;
119 unsigned long flags;
120
121 spin_lock_irqsave(&cnt->lock, flags);
122 ret = res_counter_limit_check_locked(cnt);
123 spin_unlock_irqrestore(&cnt->lock, flags);
124 return ret;
125}
126
127#endif
diff --git a/include/linux/rmap.h b/include/linux/rmap.h
index 97347f22fc20..1383692ac5bd 100644
--- a/include/linux/rmap.h
+++ b/include/linux/rmap.h
@@ -8,6 +8,7 @@
8#include <linux/slab.h> 8#include <linux/slab.h>
9#include <linux/mm.h> 9#include <linux/mm.h>
10#include <linux/spinlock.h> 10#include <linux/spinlock.h>
11#include <linux/memcontrol.h>
11 12
12/* 13/*
13 * The anon_vma heads a list of private "related" vmas, to scan if 14 * The anon_vma heads a list of private "related" vmas, to scan if
@@ -86,7 +87,7 @@ static inline void page_dup_rmap(struct page *page, struct vm_area_struct *vma,
86/* 87/*
87 * Called from mm/vmscan.c to handle paging out 88 * Called from mm/vmscan.c to handle paging out
88 */ 89 */
89int page_referenced(struct page *, int is_locked); 90int page_referenced(struct page *, int is_locked, struct mem_cgroup *cnt);
90int try_to_unmap(struct page *, int ignore_refs); 91int try_to_unmap(struct page *, int ignore_refs);
91 92
92/* 93/*
@@ -114,7 +115,7 @@ int page_mkclean(struct page *);
114#define anon_vma_prepare(vma) (0) 115#define anon_vma_prepare(vma) (0)
115#define anon_vma_link(vma) do {} while (0) 116#define anon_vma_link(vma) do {} while (0)
116 117
117#define page_referenced(page,l) TestClearPageReferenced(page) 118#define page_referenced(page,l,cnt) TestClearPageReferenced(page)
118#define try_to_unmap(page, refs) SWAP_FAIL 119#define try_to_unmap(page, refs) SWAP_FAIL
119 120
120static inline int page_mkclean(struct page *page) 121static inline int page_mkclean(struct page *page)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 9c13be3a21e8..00e144117326 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -92,6 +92,7 @@ struct sched_param {
92 92
93#include <asm/processor.h> 93#include <asm/processor.h>
94 94
95struct mem_cgroup;
95struct exec_domain; 96struct exec_domain;
96struct futex_pi_state; 97struct futex_pi_state;
97struct robust_list_head; 98struct robust_list_head;
@@ -459,7 +460,7 @@ struct signal_struct {
459 460
460 /* ITIMER_REAL timer for the process */ 461 /* ITIMER_REAL timer for the process */
461 struct hrtimer real_timer; 462 struct hrtimer real_timer;
462 struct task_struct *tsk; 463 struct pid *leader_pid;
463 ktime_t it_real_incr; 464 ktime_t it_real_incr;
464 465
465 /* ITIMER_PROF and ITIMER_VIRTUAL timers for the process */ 466 /* ITIMER_PROF and ITIMER_VIRTUAL timers for the process */
@@ -810,7 +811,7 @@ static inline int above_background_load(void)
810 811
811struct io_context; /* See blkdev.h */ 812struct io_context; /* See blkdev.h */
812#define NGROUPS_SMALL 32 813#define NGROUPS_SMALL 32
813#define NGROUPS_PER_BLOCK ((int)(PAGE_SIZE / sizeof(gid_t))) 814#define NGROUPS_PER_BLOCK ((unsigned int)(PAGE_SIZE / sizeof(gid_t)))
814struct group_info { 815struct group_info {
815 int ngroups; 816 int ngroups;
816 atomic_t usage; 817 atomic_t usage;
@@ -1331,9 +1332,8 @@ struct pid_namespace;
1331 * from various namespaces 1332 * from various namespaces
1332 * 1333 *
1333 * task_xid_nr() : global id, i.e. the id seen from the init namespace; 1334 * task_xid_nr() : global id, i.e. the id seen from the init namespace;
1334 * task_xid_vnr() : virtual id, i.e. the id seen from the namespace the task 1335 * task_xid_vnr() : virtual id, i.e. the id seen from the pid namespace of
1335 * belongs to. this only makes sence when called in the 1336 * current.
1336 * context of the task that belongs to the same namespace;
1337 * task_xid_nr_ns() : id seen from the ns specified; 1337 * task_xid_nr_ns() : id seen from the ns specified;
1338 * 1338 *
1339 * set_task_vxid() : assigns a virtual id to a task; 1339 * set_task_vxid() : assigns a virtual id to a task;
@@ -1631,7 +1631,7 @@ extern struct task_struct *find_task_by_vpid(pid_t nr);
1631extern struct task_struct *find_task_by_pid_ns(pid_t nr, 1631extern struct task_struct *find_task_by_pid_ns(pid_t nr,
1632 struct pid_namespace *ns); 1632 struct pid_namespace *ns);
1633 1633
1634extern void __set_special_pids(pid_t session, pid_t pgrp); 1634extern void __set_special_pids(struct pid *pid);
1635 1635
1636/* per-UID process charging. */ 1636/* per-UID process charging. */
1637extern struct user_struct * alloc_uid(struct user_namespace *, uid_t); 1637extern struct user_struct * alloc_uid(struct user_namespace *, uid_t);
@@ -1686,11 +1686,9 @@ extern void block_all_signals(int (*notifier)(void *priv), void *priv,
1686extern void unblock_all_signals(void); 1686extern void unblock_all_signals(void);
1687extern void release_task(struct task_struct * p); 1687extern void release_task(struct task_struct * p);
1688extern int send_sig_info(int, struct siginfo *, struct task_struct *); 1688extern int send_sig_info(int, struct siginfo *, struct task_struct *);
1689extern int send_group_sig_info(int, struct siginfo *, struct task_struct *);
1690extern int force_sigsegv(int, struct task_struct *); 1689extern int force_sigsegv(int, struct task_struct *);
1691extern int force_sig_info(int, struct siginfo *, struct task_struct *); 1690extern int force_sig_info(int, struct siginfo *, struct task_struct *);
1692extern int __kill_pgrp_info(int sig, struct siginfo *info, struct pid *pgrp); 1691extern int __kill_pgrp_info(int sig, struct siginfo *info, struct pid *pgrp);
1693extern int kill_pgrp_info(int sig, struct siginfo *info, struct pid *pgrp);
1694extern int kill_pid_info(int sig, struct siginfo *info, struct pid *pid); 1692extern int kill_pid_info(int sig, struct siginfo *info, struct pid *pid);
1695extern int kill_pid_info_as_uid(int, struct siginfo *, struct pid *, uid_t, uid_t, u32); 1693extern int kill_pid_info_as_uid(int, struct siginfo *, struct pid *, uid_t, uid_t, u32);
1696extern int kill_pgrp(struct pid *pid, int sig, int priv); 1694extern int kill_pgrp(struct pid *pid, int sig, int priv);
diff --git a/include/linux/sctp.h b/include/linux/sctp.h
index 5eb38cc0e5a4..8ba1c320f975 100644
--- a/include/linux/sctp.h
+++ b/include/linux/sctp.h
@@ -10,13 +10,13 @@
10 * 10 *
11 * Various protocol defined structures. 11 * Various protocol defined structures.
12 * 12 *
13 * The SCTP reference implementation is free software; 13 * This SCTP implementation is free software;
14 * you can redistribute it and/or modify it under the terms of 14 * you can redistribute it and/or modify it under the terms of
15 * the GNU General Public License as published by 15 * the GNU General Public License as published by
16 * the Free Software Foundation; either version 2, or (at your option) 16 * the Free Software Foundation; either version 2, or (at your option)
17 * any later version. 17 * any later version.
18 * 18 *
19 * The SCTP reference implementation is distributed in the hope that it 19 * This SCTP implementation is distributed in the hope that it
20 * will be useful, but WITHOUT ANY WARRANTY; without even the implied 20 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
21 * ************************ 21 * ************************
22 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 22 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/include/linux/serial167.h b/include/linux/serial167.h
index 71b6df2516a6..59c81b708562 100644
--- a/include/linux/serial167.h
+++ b/include/linux/serial167.h
@@ -37,7 +37,6 @@ struct cyclades_port {
37 int ignore_status_mask; 37 int ignore_status_mask;
38 int close_delay; 38 int close_delay;
39 int IER; /* Interrupt Enable Register */ 39 int IER; /* Interrupt Enable Register */
40 unsigned long event;
41 unsigned long last_active; 40 unsigned long last_active;
42 int count; /* # of fd on device */ 41 int count; /* # of fd on device */
43 int x_char; /* to be pushed out ASAP */ 42 int x_char; /* to be pushed out ASAP */
@@ -49,7 +48,6 @@ struct cyclades_port {
49 int xmit_cnt; 48 int xmit_cnt;
50 int default_threshold; 49 int default_threshold;
51 int default_timeout; 50 int default_timeout;
52 struct work_struct tqueue;
53 wait_queue_head_t open_wait; 51 wait_queue_head_t open_wait;
54 wait_queue_head_t close_wait; 52 wait_queue_head_t close_wait;
55 struct cyclades_monitor mon; 53 struct cyclades_monitor mon;
@@ -67,18 +65,6 @@ struct cyclades_port {
67#define CYGETDEFTIMEOUT 0x435908 65#define CYGETDEFTIMEOUT 0x435908
68#define CYSETDEFTIMEOUT 0x435909 66#define CYSETDEFTIMEOUT 0x435909
69 67
70/*
71 * Events are used to schedule things to happen at timer-interrupt
72 * time, instead of at cy interrupt time.
73 */
74#define Cy_EVENT_READ_PROCESS 0
75#define Cy_EVENT_WRITE_WAKEUP 1
76#define Cy_EVENT_HANGUP 2
77#define Cy_EVENT_BREAK 3
78#define Cy_EVENT_OPEN_WAKEUP 4
79
80
81
82#define CyMaxChipsPerCard 1 68#define CyMaxChipsPerCard 1
83 69
84/**** cd2401 registers ****/ 70/**** cd2401 registers ****/
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 9963f81fea9a..1a0b6cf83ff1 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -150,6 +150,10 @@
150#define PORT_MCF 78 150#define PORT_MCF 78
151 151
152 152
153/* MN10300 on-chip UART numbers */
154#define PORT_MN10300 80
155#define PORT_MN10300_CTS 81
156
153#ifdef __KERNEL__ 157#ifdef __KERNEL__
154 158
155#include <linux/compiler.h> 159#include <linux/compiler.h>
diff --git a/include/linux/shm.h b/include/linux/shm.h
index eeaed921a1dc..eca6235a46c0 100644
--- a/include/linux/shm.h
+++ b/include/linux/shm.h
@@ -3,7 +3,11 @@
3 3
4#include <linux/ipc.h> 4#include <linux/ipc.h>
5#include <linux/errno.h> 5#include <linux/errno.h>
6#ifdef __KERNEL__
6#include <asm/page.h> 7#include <asm/page.h>
8#else
9#include <unistd.h>
10#endif
7 11
8/* 12/*
9 * SHMMAX, SHMMNI and SHMALL are upper limits are defaults which can 13 * SHMMAX, SHMMNI and SHMALL are upper limits are defaults which can
@@ -13,7 +17,11 @@
13#define SHMMAX 0x2000000 /* max shared seg size (bytes) */ 17#define SHMMAX 0x2000000 /* max shared seg size (bytes) */
14#define SHMMIN 1 /* min shared seg size (bytes) */ 18#define SHMMIN 1 /* min shared seg size (bytes) */
15#define SHMMNI 4096 /* max num of segs system wide */ 19#define SHMMNI 4096 /* max num of segs system wide */
20#ifdef __KERNEL__
16#define SHMALL (SHMMAX/PAGE_SIZE*(SHMMNI/16)) /* max shm system wide (pages) */ 21#define SHMALL (SHMMAX/PAGE_SIZE*(SHMMNI/16)) /* max shm system wide (pages) */
22#else
23#define SHMALL (SHMMAX/getpagesize()*(SHMMNI/16))
24#endif
17#define SHMSEG SHMMNI /* max shared segs per process */ 25#define SHMSEG SHMMNI /* max shared segs per process */
18 26
19#ifdef __KERNEL__ 27#ifdef __KERNEL__
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h
index f3c51899117f..8d5fb36ea047 100644
--- a/include/linux/shmem_fs.h
+++ b/include/linux/shmem_fs.h
@@ -30,9 +30,12 @@ struct shmem_sb_info {
30 unsigned long free_blocks; /* How many are left for allocation */ 30 unsigned long free_blocks; /* How many are left for allocation */
31 unsigned long max_inodes; /* How many inodes are allowed */ 31 unsigned long max_inodes; /* How many inodes are allowed */
32 unsigned long free_inodes; /* How many are left for allocation */ 32 unsigned long free_inodes; /* How many are left for allocation */
33 spinlock_t stat_lock; /* Serialize shmem_sb_info changes */
34 uid_t uid; /* Mount uid for root directory */
35 gid_t gid; /* Mount gid for root directory */
36 mode_t mode; /* Mount mode for root directory */
33 int policy; /* Default NUMA memory alloc policy */ 37 int policy; /* Default NUMA memory alloc policy */
34 nodemask_t policy_nodes; /* nodemask for preferred and bind */ 38 nodemask_t policy_nodes; /* nodemask for preferred and bind */
35 spinlock_t stat_lock;
36}; 39};
37 40
38static inline struct shmem_inode_info *SHMEM_I(struct inode *inode) 41static inline struct shmem_inode_info *SHMEM_I(struct inode *inode)
diff --git a/include/linux/signal.h b/include/linux/signal.h
index 0ae338866240..42d2e0a948f4 100644
--- a/include/linux/signal.h
+++ b/include/linux/signal.h
@@ -241,6 +241,7 @@ extern int show_unhandled_signals;
241 241
242struct pt_regs; 242struct pt_regs;
243extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie); 243extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie);
244extern void exit_signals(struct task_struct *tsk);
244 245
245extern struct kmem_cache *sighand_cachep; 246extern struct kmem_cache *sighand_cachep;
246 247
@@ -371,6 +372,8 @@ int unhandled_signal(struct task_struct *tsk, int sig);
371 (!siginmask(signr, SIG_KERNEL_IGNORE_MASK|SIG_KERNEL_STOP_MASK) && \ 372 (!siginmask(signr, SIG_KERNEL_IGNORE_MASK|SIG_KERNEL_STOP_MASK) && \
372 (t)->sighand->action[(signr)-1].sa.sa_handler == SIG_DFL) 373 (t)->sighand->action[(signr)-1].sa.sa_handler == SIG_DFL)
373 374
375void signals_init(void);
376
374#endif /* __KERNEL__ */ 377#endif /* __KERNEL__ */
375 378
376#endif /* _LINUX_SIGNAL_H */ 379#endif /* _LINUX_SIGNAL_H */
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index ddb1a706b144..5e6d3d634d5b 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -11,12 +11,35 @@
11#include <linux/workqueue.h> 11#include <linux/workqueue.h>
12#include <linux/kobject.h> 12#include <linux/kobject.h>
13 13
14enum stat_item {
15 ALLOC_FASTPATH, /* Allocation from cpu slab */
16 ALLOC_SLOWPATH, /* Allocation by getting a new cpu slab */
17 FREE_FASTPATH, /* Free to cpu slub */
18 FREE_SLOWPATH, /* Freeing not to cpu slab */
19 FREE_FROZEN, /* Freeing to frozen slab */
20 FREE_ADD_PARTIAL, /* Freeing moves slab to partial list */
21 FREE_REMOVE_PARTIAL, /* Freeing removes last object */
22 ALLOC_FROM_PARTIAL, /* Cpu slab acquired from partial list */
23 ALLOC_SLAB, /* Cpu slab acquired from page allocator */
24 ALLOC_REFILL, /* Refill cpu slab from slab freelist */
25 FREE_SLAB, /* Slab freed to the page allocator */
26 CPUSLAB_FLUSH, /* Abandoning of the cpu slab */
27 DEACTIVATE_FULL, /* Cpu slab was full when deactivated */
28 DEACTIVATE_EMPTY, /* Cpu slab was empty when deactivated */
29 DEACTIVATE_TO_HEAD, /* Cpu slab was moved to the head of partials */
30 DEACTIVATE_TO_TAIL, /* Cpu slab was moved to the tail of partials */
31 DEACTIVATE_REMOTE_FREES,/* Slab contained remotely freed objects */
32 NR_SLUB_STAT_ITEMS };
33
14struct kmem_cache_cpu { 34struct kmem_cache_cpu {
15 void **freelist; /* Pointer to first free per cpu object */ 35 void **freelist; /* Pointer to first free per cpu object */
16 struct page *page; /* The slab from which we are allocating */ 36 struct page *page; /* The slab from which we are allocating */
17 int node; /* The node of the page (or -1 for debug) */ 37 int node; /* The node of the page (or -1 for debug) */
18 unsigned int offset; /* Freepointer offset (in word units) */ 38 unsigned int offset; /* Freepointer offset (in word units) */
19 unsigned int objsize; /* Size of an object (from kmem_cache) */ 39 unsigned int objsize; /* Size of an object (from kmem_cache) */
40#ifdef CONFIG_SLUB_STATS
41 unsigned stat[NR_SLUB_STAT_ITEMS];
42#endif
20}; 43};
21 44
22struct kmem_cache_node { 45struct kmem_cache_node {
diff --git a/include/linux/sm501.h b/include/linux/sm501.h
index 9e3aaad6fe4d..932a9efee8a5 100644
--- a/include/linux/sm501.h
+++ b/include/linux/sm501.h
@@ -70,6 +70,8 @@ extern unsigned long sm501_gpio_get(struct device *dev,
70#define SM501FB_FLAG_DISABLE_AT_EXIT (1<<1) 70#define SM501FB_FLAG_DISABLE_AT_EXIT (1<<1)
71#define SM501FB_FLAG_USE_HWCURSOR (1<<2) 71#define SM501FB_FLAG_USE_HWCURSOR (1<<2)
72#define SM501FB_FLAG_USE_HWACCEL (1<<3) 72#define SM501FB_FLAG_USE_HWACCEL (1<<3)
73#define SM501FB_FLAG_PANEL_USE_FPEN (1<<4)
74#define SM501FB_FLAG_PANEL_USE_VBIASEN (1<<5)
73 75
74struct sm501_platdata_fbsub { 76struct sm501_platdata_fbsub {
75 struct fb_videomode *def_mode; 77 struct fb_videomode *def_mode;
diff --git a/include/linux/sonypi.h b/include/linux/sonypi.h
index 40c7b5d993b9..f41ffd7c2dd9 100644
--- a/include/linux/sonypi.h
+++ b/include/linux/sonypi.h
@@ -101,6 +101,8 @@
101#define SONYPI_EVENT_FNKEY_RELEASED 59 101#define SONYPI_EVENT_FNKEY_RELEASED 59
102#define SONYPI_EVENT_WIRELESS_ON 60 102#define SONYPI_EVENT_WIRELESS_ON 60
103#define SONYPI_EVENT_WIRELESS_OFF 61 103#define SONYPI_EVENT_WIRELESS_OFF 61
104#define SONYPI_EVENT_ZOOM_IN_PRESSED 62
105#define SONYPI_EVENT_ZOOM_OUT_PRESSED 63
104 106
105/* get/set brightness */ 107/* get/set brightness */
106#define SONYPI_IOCGBRT _IOR('v', 0, __u8) 108#define SONYPI_IOCGBRT _IOR('v', 0, __u8)
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
index 124449733c55..576a5f77d3bd 100644
--- a/include/linux/spinlock.h
+++ b/include/linux/spinlock.h
@@ -71,7 +71,7 @@
71#define LOCK_SECTION_END \ 71#define LOCK_SECTION_END \
72 ".previous\n\t" 72 ".previous\n\t"
73 73
74#define __lockfunc fastcall __attribute__((section(".spinlock.text"))) 74#define __lockfunc __attribute__((section(".spinlock.text")))
75 75
76/* 76/*
77 * Pull the raw_spinlock_t and raw_rwlock_t definitions: 77 * Pull the raw_spinlock_t and raw_rwlock_t definitions:
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h
index e18f5c23b930..9d5da8b2ccf9 100644
--- a/include/linux/ssb/ssb.h
+++ b/include/linux/ssb/ssb.h
@@ -373,6 +373,15 @@ void ssb_pcihost_set_power_state(struct ssb_device *sdev, pci_power_t state)
373 if (sdev->bus->bustype == SSB_BUSTYPE_PCI) 373 if (sdev->bus->bustype == SSB_BUSTYPE_PCI)
374 pci_set_power_state(sdev->bus->host_pci, state); 374 pci_set_power_state(sdev->bus->host_pci, state);
375} 375}
376#else
377static inline void ssb_pcihost_unregister(struct pci_driver *driver)
378{
379}
380
381static inline
382void ssb_pcihost_set_power_state(struct ssb_device *sdev, pci_power_t state)
383{
384}
376#endif /* CONFIG_SSB_PCIHOST */ 385#endif /* CONFIG_SSB_PCIHOST */
377 386
378 387
diff --git a/include/linux/stallion.h b/include/linux/stallion.h
index 94b4a10b912f..0424d75a5aaa 100644
--- a/include/linux/stallion.h
+++ b/include/linux/stallion.h
@@ -95,7 +95,6 @@ struct stlport {
95 struct tty_struct *tty; 95 struct tty_struct *tty;
96 wait_queue_head_t open_wait; 96 wait_queue_head_t open_wait;
97 wait_queue_head_t close_wait; 97 wait_queue_head_t close_wait;
98 struct work_struct tqueue;
99 comstats_t stats; 98 comstats_t stats;
100 struct stlrq tx; 99 struct stlrq tx;
101}; 100};
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 353153ea0bd5..3ca5c4bd6d3f 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -5,6 +5,7 @@
5#include <linux/linkage.h> 5#include <linux/linkage.h>
6#include <linux/mmzone.h> 6#include <linux/mmzone.h>
7#include <linux/list.h> 7#include <linux/list.h>
8#include <linux/memcontrol.h>
8#include <linux/sched.h> 9#include <linux/sched.h>
9 10
10#include <asm/atomic.h> 11#include <asm/atomic.h>
@@ -182,6 +183,9 @@ extern void swap_setup(void);
182/* linux/mm/vmscan.c */ 183/* linux/mm/vmscan.c */
183extern unsigned long try_to_free_pages(struct zone **zones, int order, 184extern unsigned long try_to_free_pages(struct zone **zones, int order,
184 gfp_t gfp_mask); 185 gfp_t gfp_mask);
186extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem,
187 gfp_t gfp_mask);
188extern int __isolate_lru_page(struct page *page, int mode);
185extern unsigned long shrink_all_memory(unsigned long nr_pages); 189extern unsigned long shrink_all_memory(unsigned long nr_pages);
186extern int vm_swappiness; 190extern int vm_swappiness;
187extern int remove_mapping(struct address_space *mapping, struct page *page); 191extern int remove_mapping(struct address_space *mapping, struct page *page);
diff --git a/include/linux/swapops.h b/include/linux/swapops.h
index 7bf2d149d209..6ec39ab27b4b 100644
--- a/include/linux/swapops.h
+++ b/include/linux/swapops.h
@@ -42,11 +42,13 @@ static inline pgoff_t swp_offset(swp_entry_t entry)
42 return entry.val & SWP_OFFSET_MASK(entry); 42 return entry.val & SWP_OFFSET_MASK(entry);
43} 43}
44 44
45#ifdef CONFIG_MMU
45/* check whether a pte points to a swap entry */ 46/* check whether a pte points to a swap entry */
46static inline int is_swap_pte(pte_t pte) 47static inline int is_swap_pte(pte_t pte)
47{ 48{
48 return !pte_none(pte) && !pte_present(pte) && !pte_file(pte); 49 return !pte_none(pte) && !pte_present(pte) && !pte_file(pte);
49} 50}
51#endif
50 52
51/* 53/*
52 * Convert the arch-dependent pte representation of a swp_entry_t into an 54 * Convert the arch-dependent pte representation of a swp_entry_t into an
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
new file mode 100644
index 000000000000..818ca1cf0b6d
--- /dev/null
+++ b/include/linux/thermal.h
@@ -0,0 +1,111 @@
1/*
2 * thermal.h ($Revision: 0 $)
3 *
4 * Copyright (C) 2008 Intel Corp
5 * Copyright (C) 2008 Zhang Rui <rui.zhang@intel.com>
6 * Copyright (C) 2008 Sujith Thomas <sujith.thomas@intel.com>
7 *
8 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; version 2 of the License.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
21 *
22 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23 */
24
25#ifndef __THERMAL_H__
26#define __THERMAL_H__
27
28#include <linux/idr.h>
29#include <linux/device.h>
30
31struct thermal_zone_device;
32struct thermal_cooling_device;
33
34struct thermal_zone_device_ops {
35 int (*bind) (struct thermal_zone_device *,
36 struct thermal_cooling_device *);
37 int (*unbind) (struct thermal_zone_device *,
38 struct thermal_cooling_device *);
39 int (*get_temp) (struct thermal_zone_device *, char *);
40 int (*get_mode) (struct thermal_zone_device *, char *);
41 int (*set_mode) (struct thermal_zone_device *, const char *);
42 int (*get_trip_type) (struct thermal_zone_device *, int, char *);
43 int (*get_trip_temp) (struct thermal_zone_device *, int, char *);
44};
45
46struct thermal_cooling_device_ops {
47 int (*get_max_state) (struct thermal_cooling_device *, char *);
48 int (*get_cur_state) (struct thermal_cooling_device *, char *);
49 int (*set_cur_state) (struct thermal_cooling_device *, unsigned int);
50};
51
52#define THERMAL_TRIPS_NONE -1
53#define THERMAL_MAX_TRIPS 10
54#define THERMAL_NAME_LENGTH 20
55struct thermal_cooling_device {
56 int id;
57 char type[THERMAL_NAME_LENGTH];
58 struct device device;
59 void *devdata;
60 struct thermal_cooling_device_ops *ops;
61 struct list_head node;
62};
63
64#define KELVIN_TO_CELSIUS(t) (long)(((long)t-2732 >= 0) ? \
65 ((long)t-2732+5)/10 : ((long)t-2732-5)/10)
66#define CELSIUS_TO_KELVIN(t) ((t)*10+2732)
67
68struct thermal_zone_device {
69 int id;
70 char type[THERMAL_NAME_LENGTH];
71 struct device device;
72 void *devdata;
73 int trips;
74 struct thermal_zone_device_ops *ops;
75 struct list_head cooling_devices;
76 struct idr idr;
77 struct mutex lock; /* protect cooling devices list */
78 struct list_head node;
79};
80
81struct thermal_zone_device *thermal_zone_device_register(char *, int, void *,
82 struct
83 thermal_zone_device_ops
84 *);
85void thermal_zone_device_unregister(struct thermal_zone_device *);
86
87int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int,
88 struct thermal_cooling_device *);
89int thermal_zone_unbind_cooling_device(struct thermal_zone_device *, int,
90 struct thermal_cooling_device *);
91
92#ifdef CONFIG_THERMAL
93struct thermal_cooling_device *thermal_cooling_device_register(char *, void *,
94 struct
95 thermal_cooling_device_ops
96 *);
97void thermal_cooling_device_unregister(struct thermal_cooling_device *);
98#else
99static inline struct thermal_cooling_device
100*thermal_cooling_device_register(char *c, void *v,
101 struct thermal_cooling_device_ops *t)
102{
103 return NULL;
104}
105static inline
106 void thermal_cooling_device_unregister(struct thermal_cooling_device *t)
107{
108};
109#endif
110
111#endif /* __THERMAL_H__ */
diff --git a/include/linux/tifm.h b/include/linux/tifm.h
index 2096b76d0cee..da76ed85f595 100644
--- a/include/linux/tifm.h
+++ b/include/linux/tifm.h
@@ -72,6 +72,7 @@ enum {
72#define TIFM_FIFO_READY 0x00000001 72#define TIFM_FIFO_READY 0x00000001
73#define TIFM_FIFO_INT_SETALL 0x0000ffff 73#define TIFM_FIFO_INT_SETALL 0x0000ffff
74#define TIFM_FIFO_INTMASK 0x00000005 74#define TIFM_FIFO_INTMASK 0x00000005
75#define TIFM_FIFO_SIZE 0x00000200
75 76
76#define TIFM_DMA_RESET 0x00000002 77#define TIFM_DMA_RESET 0x00000002
77#define TIFM_DMA_TX 0x00008000 78#define TIFM_DMA_TX 0x00008000
@@ -124,6 +125,8 @@ struct tifm_adapter {
124 125
125 void (*eject)(struct tifm_adapter *fm, 126 void (*eject)(struct tifm_adapter *fm,
126 struct tifm_dev *sock); 127 struct tifm_dev *sock);
128 int (*has_ms_pif)(struct tifm_adapter *fm,
129 struct tifm_dev *sock);
127 130
128 struct tifm_dev *sockets[0]; 131 struct tifm_dev *sockets[0];
129}; 132};
@@ -141,6 +144,7 @@ struct tifm_dev *tifm_alloc_device(struct tifm_adapter *fm, unsigned int id,
141int tifm_register_driver(struct tifm_driver *drv); 144int tifm_register_driver(struct tifm_driver *drv);
142void tifm_unregister_driver(struct tifm_driver *drv); 145void tifm_unregister_driver(struct tifm_driver *drv);
143void tifm_eject(struct tifm_dev *sock); 146void tifm_eject(struct tifm_dev *sock);
147int tifm_has_ms_pif(struct tifm_dev *sock);
144int tifm_map_sg(struct tifm_dev *sock, struct scatterlist *sg, int nents, 148int tifm_map_sg(struct tifm_dev *sock, struct scatterlist *sg, int nents,
145 int direction); 149 int direction);
146void tifm_unmap_sg(struct tifm_dev *sock, struct scatterlist *sg, int nents, 150void tifm_unmap_sg(struct tifm_dev *sock, struct scatterlist *sg, int nents,
diff --git a/include/linux/time.h b/include/linux/time.h
index ceaab9fff155..2091a19f1655 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -120,7 +120,7 @@ extern void getboottime(struct timespec *ts);
120extern void monotonic_to_bootbased(struct timespec *ts); 120extern void monotonic_to_bootbased(struct timespec *ts);
121 121
122extern struct timespec timespec_trunc(struct timespec t, unsigned gran); 122extern struct timespec timespec_trunc(struct timespec t, unsigned gran);
123extern int timekeeping_is_continuous(void); 123extern int timekeeping_valid_for_hres(void);
124extern void update_wall_time(void); 124extern void update_wall_time(void);
125extern void update_xtime_cache(u64 nsec); 125extern void update_xtime_cache(u64 nsec);
126 126
diff --git a/include/linux/timer.h b/include/linux/timer.h
index de0e71359ede..979fefdeb862 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -35,8 +35,8 @@ extern struct tvec_base boot_tvec_bases;
35 struct timer_list _name = \ 35 struct timer_list _name = \
36 TIMER_INITIALIZER(_function, _expires, _data) 36 TIMER_INITIALIZER(_function, _expires, _data)
37 37
38void fastcall init_timer(struct timer_list * timer); 38void init_timer(struct timer_list *timer);
39void fastcall init_timer_deferrable(struct timer_list *timer); 39void init_timer_deferrable(struct timer_list *timer);
40 40
41static inline void setup_timer(struct timer_list * timer, 41static inline void setup_timer(struct timer_list * timer,
42 void (*function)(unsigned long), 42 void (*function)(unsigned long),
@@ -124,8 +124,6 @@ static inline void timer_stats_timer_clear_start_info(struct timer_list *timer)
124} 124}
125#endif 125#endif
126 126
127extern void delayed_work_timer_fn(unsigned long __data);
128
129/** 127/**
130 * add_timer - start a timer 128 * add_timer - start a timer
131 * @timer: the timer to be added 129 * @timer: the timer to be added
diff --git a/include/linux/timex.h b/include/linux/timex.h
index 24c6a2b59511..c3f374786a43 100644
--- a/include/linux/timex.h
+++ b/include/linux/timex.h
@@ -232,7 +232,14 @@ static inline int ntp_synced(void)
232#else 232#else
233#define NTP_INTERVAL_FREQ (HZ) 233#define NTP_INTERVAL_FREQ (HZ)
234#endif 234#endif
235#define NTP_INTERVAL_LENGTH (NSEC_PER_SEC/NTP_INTERVAL_FREQ) 235
236#define CLOCK_TICK_OVERFLOW (LATCH * HZ - CLOCK_TICK_RATE)
237#define CLOCK_TICK_ADJUST (((s64)CLOCK_TICK_OVERFLOW * NSEC_PER_SEC) / \
238 (s64)CLOCK_TICK_RATE)
239
240/* Because using NSEC_PER_SEC would be too easy */
241#define NTP_INTERVAL_LENGTH ((((s64)TICK_USEC * NSEC_PER_USEC * USER_HZ) + \
242 CLOCK_TICK_ADJUST) / NTP_INTERVAL_FREQ)
236 243
237/* Returns how long ticks are at present, in ns / 2^(SHIFT_SCALE-10). */ 244/* Returns how long ticks are at present, in ns / 2^(SHIFT_SCALE-10). */
238extern u64 current_tick_length(void); 245extern u64 current_tick_length(void);
@@ -244,6 +251,8 @@ extern int do_adjtimex(struct timex *);
244/* Don't use! Compatibility define for existing users. */ 251/* Don't use! Compatibility define for existing users. */
245#define tickadj (500/HZ ? : 1) 252#define tickadj (500/HZ ? : 1)
246 253
254int read_current_timer(unsigned long *timer_val);
255
247#endif /* KERNEL */ 256#endif /* KERNEL */
248 257
249#endif /* LINUX_TIMEX_H */ 258#endif /* LINUX_TIMEX_H */
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 402de892b3ed..dd8e08fe8855 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -53,13 +53,6 @@
53 */ 53 */
54#define __DISABLED_CHAR '\0' 54#define __DISABLED_CHAR '\0'
55 55
56/*
57 * This is the flip buffer used for the tty driver. The buffer is
58 * located in the tty structure, and is used as a high speed interface
59 * between the tty driver and the tty line discipline.
60 */
61#define TTY_FLIPBUF_SIZE 512
62
63struct tty_buffer { 56struct tty_buffer {
64 struct tty_buffer *next; 57 struct tty_buffer *next;
65 char *char_buf_ptr; 58 char *char_buf_ptr;
@@ -74,7 +67,6 @@ struct tty_buffer {
74 67
75struct tty_bufhead { 68struct tty_bufhead {
76 struct delayed_work work; 69 struct delayed_work work;
77 struct semaphore pty_sem;
78 spinlock_t lock; 70 spinlock_t lock;
79 struct tty_buffer *head; /* Queue head */ 71 struct tty_buffer *head; /* Queue head */
80 struct tty_buffer *tail; /* Active buffer */ 72 struct tty_buffer *tail; /* Active buffer */
diff --git a/include/linux/types.h b/include/linux/types.h
index b94c0e4efe24..9dc2346627b4 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -53,7 +53,7 @@ typedef __kernel_uid_t uid_t;
53typedef __kernel_gid_t gid_t; 53typedef __kernel_gid_t gid_t;
54#endif /* __KERNEL__ */ 54#endif /* __KERNEL__ */
55 55
56#if defined(__GNUC__) && !defined(__STRICT_ANSI__) 56#if defined(__GNUC__)
57typedef __kernel_loff_t loff_t; 57typedef __kernel_loff_t loff_t;
58#endif 58#endif
59 59
@@ -119,7 +119,7 @@ typedef __u8 uint8_t;
119typedef __u16 uint16_t; 119typedef __u16 uint16_t;
120typedef __u32 uint32_t; 120typedef __u32 uint32_t;
121 121
122#if defined(__GNUC__) && !defined(__STRICT_ANSI__) 122#if defined(__GNUC__)
123typedef __u64 uint64_t; 123typedef __u64 uint64_t;
124typedef __u64 u_int64_t; 124typedef __u64 u_int64_t;
125typedef __s64 int64_t; 125typedef __s64 int64_t;
@@ -181,7 +181,7 @@ typedef __u16 __bitwise __le16;
181typedef __u16 __bitwise __be16; 181typedef __u16 __bitwise __be16;
182typedef __u32 __bitwise __le32; 182typedef __u32 __bitwise __le32;
183typedef __u32 __bitwise __be32; 183typedef __u32 __bitwise __be32;
184#if defined(__GNUC__) && !defined(__STRICT_ANSI__) 184#if defined(__GNUC__)
185typedef __u64 __bitwise __le64; 185typedef __u64 __bitwise __le64;
186typedef __u64 __bitwise __be64; 186typedef __u64 __bitwise __be64;
187#endif 187#endif
diff --git a/include/linux/udf_fs.h b/include/linux/udf_fs.h
index 36c684e1b110..aa88654eb76b 100644
--- a/include/linux/udf_fs.h
+++ b/include/linux/udf_fs.h
@@ -32,18 +32,15 @@
32#define UDF_PREALLOCATE 32#define UDF_PREALLOCATE
33#define UDF_DEFAULT_PREALLOC_BLOCKS 8 33#define UDF_DEFAULT_PREALLOC_BLOCKS 8
34 34
35#define UDFFS_DATE "2004/29/09"
36#define UDFFS_VERSION "0.9.8.1"
37
38#undef UDFFS_DEBUG 35#undef UDFFS_DEBUG
39 36
40#ifdef UDFFS_DEBUG 37#ifdef UDFFS_DEBUG
41#define udf_debug(f, a...) \ 38#define udf_debug(f, a...) \
42 { \ 39 do { \
43 printk (KERN_DEBUG "UDF-fs DEBUG %s:%d:%s: ", \ 40 printk (KERN_DEBUG "UDF-fs DEBUG %s:%d:%s: ", \
44 __FILE__, __LINE__, __FUNCTION__); \ 41 __FILE__, __LINE__, __FUNCTION__); \
45 printk (f, ##a); \ 42 printk (f, ##a); \
46 } 43 } while (0)
47#else 44#else
48#define udf_debug(f, a...) /**/ 45#define udf_debug(f, a...) /**/
49#endif 46#endif
diff --git a/include/linux/udf_fs_sb.h b/include/linux/udf_fs_sb.h
index 80ae9ef940dc..9bc47352b6b4 100644
--- a/include/linux/udf_fs_sb.h
+++ b/include/linux/udf_fs_sb.h
@@ -75,7 +75,7 @@ struct udf_part_map
75struct udf_sb_info 75struct udf_sb_info
76{ 76{
77 struct udf_part_map *s_partmaps; 77 struct udf_part_map *s_partmaps;
78 __u8 s_volident[32]; 78 __u8 s_volume_ident[32];
79 79
80 /* Overall info */ 80 /* Overall info */
81 __u16 s_partitions; 81 __u16 s_partitions;
@@ -84,9 +84,9 @@ struct udf_sb_info
84 /* Sector headers */ 84 /* Sector headers */
85 __s32 s_session; 85 __s32 s_session;
86 __u32 s_anchor[4]; 86 __u32 s_anchor[4];
87 __u32 s_lastblock; 87 __u32 s_last_block;
88 88
89 struct buffer_head *s_lvidbh; 89 struct buffer_head *s_lvid_bh;
90 90
91 /* Default permissions */ 91 /* Default permissions */
92 mode_t s_umask; 92 mode_t s_umask;
@@ -94,10 +94,10 @@ struct udf_sb_info
94 uid_t s_uid; 94 uid_t s_uid;
95 95
96 /* Root Info */ 96 /* Root Info */
97 struct timespec s_recordtime; 97 struct timespec s_record_time;
98 98
99 /* Fileset Info */ 99 /* Fileset Info */
100 __u16 s_serialnum; 100 __u16 s_serial_number;
101 101
102 /* highest UDF revision we have recorded to this media */ 102 /* highest UDF revision we have recorded to this media */
103 __u16 s_udfrev; 103 __u16 s_udfrev;
@@ -109,7 +109,7 @@ struct udf_sb_info
109 struct nls_table *s_nls_map; 109 struct nls_table *s_nls_map;
110 110
111 /* VAT inode */ 111 /* VAT inode */
112 struct inode *s_vat; 112 struct inode *s_vat_inode;
113 113
114 struct mutex s_alloc_mutex; 114 struct mutex s_alloc_mutex;
115}; 115};
diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h
deleted file mode 100644
index 10b854d3561f..000000000000
--- a/include/linux/ufs_fs.h
+++ /dev/null
@@ -1,953 +0,0 @@
1/*
2 * linux/include/linux/ufs_fs.h
3 *
4 * Copyright (C) 1996
5 * Adrian Rodriguez (adrian@franklins-tower.rutgers.edu)
6 * Laboratory for Computer Science Research Computing Facility
7 * Rutgers, The State University of New Jersey
8 *
9 * Clean swab support by Fare <fare@tunes.org>
10 * just hope no one is using NNUUXXI on __?64 structure elements
11 * 64-bit clean thanks to Maciej W. Rozycki <macro@ds2.pg.gda.pl>
12 *
13 * 4.4BSD (FreeBSD) support added on February 1st 1998 by
14 * Niels Kristian Bech Jensen <nkbj@image.dk> partially based
15 * on code by Martin von Loewis <martin@mira.isdn.cs.tu-berlin.de>.
16 *
17 * NeXTstep support added on February 5th 1998 by
18 * Niels Kristian Bech Jensen <nkbj@image.dk>.
19 *
20 * Write support by Daniel Pirkl <daniel.pirkl@email.cz>
21 *
22 * HP/UX hfs filesystem support added by
23 * Martin K. Petersen <mkp@mkp.net>, August 1999
24 *
25 * UFS2 (of FreeBSD 5.x) support added by
26 * Niraj Kumar <niraj17@iitbombay.org> , Jan 2004
27 *
28 */
29
30#ifndef __LINUX_UFS_FS_H
31#define __LINUX_UFS_FS_H
32
33#include <linux/types.h>
34#include <linux/kernel.h>
35#include <linux/stat.h>
36#include <linux/fs.h>
37
38#ifndef __KERNEL__
39typedef __u64 __fs64;
40typedef __u32 __fs32;
41typedef __u16 __fs16;
42#else
43#include <asm/div64.h>
44typedef __u64 __bitwise __fs64;
45typedef __u32 __bitwise __fs32;
46typedef __u16 __bitwise __fs16;
47#endif
48
49#define UFS_BBLOCK 0
50#define UFS_BBSIZE 8192
51#define UFS_SBLOCK 8192
52#define UFS_SBSIZE 8192
53
54#define UFS_SECTOR_SIZE 512
55#define UFS_SECTOR_BITS 9
56#define UFS_MAGIC 0x00011954
57#define UFS2_MAGIC 0x19540119
58#define UFS_CIGAM 0x54190100 /* byteswapped MAGIC */
59
60/* Copied from FreeBSD */
61/*
62 * Each disk drive contains some number of filesystems.
63 * A filesystem consists of a number of cylinder groups.
64 * Each cylinder group has inodes and data.
65 *
66 * A filesystem is described by its super-block, which in turn
67 * describes the cylinder groups. The super-block is critical
68 * data and is replicated in each cylinder group to protect against
69 * catastrophic loss. This is done at `newfs' time and the critical
70 * super-block data does not change, so the copies need not be
71 * referenced further unless disaster strikes.
72 *
73 * For filesystem fs, the offsets of the various blocks of interest
74 * are given in the super block as:
75 * [fs->fs_sblkno] Super-block
76 * [fs->fs_cblkno] Cylinder group block
77 * [fs->fs_iblkno] Inode blocks
78 * [fs->fs_dblkno] Data blocks
79 * The beginning of cylinder group cg in fs, is given by
80 * the ``cgbase(fs, cg)'' macro.
81 *
82 * Depending on the architecture and the media, the superblock may
83 * reside in any one of four places. For tiny media where every block
84 * counts, it is placed at the very front of the partition. Historically,
85 * UFS1 placed it 8K from the front to leave room for the disk label and
86 * a small bootstrap. For UFS2 it got moved to 64K from the front to leave
87 * room for the disk label and a bigger bootstrap, and for really piggy
88 * systems we check at 256K from the front if the first three fail. In
89 * all cases the size of the superblock will be SBLOCKSIZE. All values are
90 * given in byte-offset form, so they do not imply a sector size. The
91 * SBLOCKSEARCH specifies the order in which the locations should be searched.
92 */
93#define SBLOCK_FLOPPY 0
94#define SBLOCK_UFS1 8192
95#define SBLOCK_UFS2 65536
96#define SBLOCK_PIGGY 262144
97#define SBLOCKSIZE 8192
98#define SBLOCKSEARCH \
99 { SBLOCK_UFS2, SBLOCK_UFS1, SBLOCK_FLOPPY, SBLOCK_PIGGY, -1 }
100
101
102/* HP specific MAGIC values */
103
104#define UFS_MAGIC_LFN 0x00095014 /* fs supports filenames > 14 chars */
105#define UFS_CIGAM_LFN 0x14500900 /* srahc 41 < semanelif stroppus sf */
106
107#define UFS_MAGIC_SEC 0x00612195 /* B1 security fs */
108#define UFS_CIGAM_SEC 0x95216100
109
110#define UFS_MAGIC_FEA 0x00195612 /* fs_featurebits supported */
111#define UFS_CIGAM_FEA 0x12561900
112
113#define UFS_MAGIC_4GB 0x05231994 /* fs > 4 GB && fs_featurebits */
114#define UFS_CIGAM_4GB 0x94192305
115
116/* Seems somebody at HP goofed here. B1 and lfs are both 0x2 !?! */
117#define UFS_FSF_LFN 0x00000001 /* long file names */
118#define UFS_FSF_B1 0x00000002 /* B1 security */
119#define UFS_FSF_LFS 0x00000002 /* large files */
120#define UFS_FSF_LUID 0x00000004 /* large UIDs */
121
122/* End of HP stuff */
123
124
125#define UFS_BSIZE 8192
126#define UFS_MINBSIZE 4096
127#define UFS_FSIZE 1024
128#define UFS_MAXFRAG (UFS_BSIZE / UFS_FSIZE)
129
130#define UFS_NDADDR 12
131#define UFS_NINDIR 3
132
133#define UFS_IND_BLOCK (UFS_NDADDR + 0)
134#define UFS_DIND_BLOCK (UFS_NDADDR + 1)
135#define UFS_TIND_BLOCK (UFS_NDADDR + 2)
136
137#define UFS_NDIR_FRAGMENT (UFS_NDADDR << uspi->s_fpbshift)
138#define UFS_IND_FRAGMENT (UFS_IND_BLOCK << uspi->s_fpbshift)
139#define UFS_DIND_FRAGMENT (UFS_DIND_BLOCK << uspi->s_fpbshift)
140#define UFS_TIND_FRAGMENT (UFS_TIND_BLOCK << uspi->s_fpbshift)
141
142#define UFS_ROOTINO 2
143#define UFS_FIRST_INO (UFS_ROOTINO + 1)
144
145#define UFS_USEEFT ((__u16)65535)
146
147#define UFS_FSOK 0x7c269d38
148#define UFS_FSACTIVE ((__s8)0x00)
149#define UFS_FSCLEAN ((__s8)0x01)
150#define UFS_FSSTABLE ((__s8)0x02)
151#define UFS_FSOSF1 ((__s8)0x03) /* is this correct for DEC OSF/1? */
152#define UFS_FSBAD ((__s8)0xff)
153
154/* From here to next blank line, s_flags for ufs_sb_info */
155/* directory entry encoding */
156#define UFS_DE_MASK 0x00000010 /* mask for the following */
157#define UFS_DE_OLD 0x00000000
158#define UFS_DE_44BSD 0x00000010
159/* uid encoding */
160#define UFS_UID_MASK 0x00000060 /* mask for the following */
161#define UFS_UID_OLD 0x00000000
162#define UFS_UID_44BSD 0x00000020
163#define UFS_UID_EFT 0x00000040
164/* superblock state encoding */
165#define UFS_ST_MASK 0x00000700 /* mask for the following */
166#define UFS_ST_OLD 0x00000000
167#define UFS_ST_44BSD 0x00000100
168#define UFS_ST_SUN 0x00000200 /* Solaris */
169#define UFS_ST_SUNOS 0x00000300
170#define UFS_ST_SUNx86 0x00000400 /* Solaris x86 */
171/*cylinder group encoding */
172#define UFS_CG_MASK 0x00003000 /* mask for the following */
173#define UFS_CG_OLD 0x00000000
174#define UFS_CG_44BSD 0x00002000
175#define UFS_CG_SUN 0x00001000
176/* filesystem type encoding */
177#define UFS_TYPE_MASK 0x00010000 /* mask for the following */
178#define UFS_TYPE_UFS1 0x00000000
179#define UFS_TYPE_UFS2 0x00010000
180
181
182/* fs_inodefmt options */
183#define UFS_42INODEFMT -1
184#define UFS_44INODEFMT 2
185
186/*
187 * MINFREE gives the minimum acceptable percentage of file system
188 * blocks which may be free. If the freelist drops below this level
189 * only the superuser may continue to allocate blocks. This may
190 * be set to 0 if no reserve of free blocks is deemed necessary,
191 * however throughput drops by fifty percent if the file system
192 * is run at between 95% and 100% full; thus the minimum default
193 * value of fs_minfree is 5%. However, to get good clustering
194 * performance, 10% is a better choice. hence we use 10% as our
195 * default value. With 10% free space, fragmentation is not a
196 * problem, so we choose to optimize for time.
197 */
198#define UFS_MINFREE 5
199#define UFS_DEFAULTOPT UFS_OPTTIME
200
201/*
202 * Turn file system block numbers into disk block addresses.
203 * This maps file system blocks to device size blocks.
204 */
205#define ufs_fsbtodb(uspi, b) ((b) << (uspi)->s_fsbtodb)
206#define ufs_dbtofsb(uspi, b) ((b) >> (uspi)->s_fsbtodb)
207
208/*
209 * Cylinder group macros to locate things in cylinder groups.
210 * They calc file system addresses of cylinder group data structures.
211 */
212#define ufs_cgbase(c) (uspi->s_fpg * (c))
213#define ufs_cgstart(c) ((uspi)->fs_magic == UFS2_MAGIC ? ufs_cgbase(c) : \
214 (ufs_cgbase(c) + uspi->s_cgoffset * ((c) & ~uspi->s_cgmask)))
215#define ufs_cgsblock(c) (ufs_cgstart(c) + uspi->s_sblkno) /* super blk */
216#define ufs_cgcmin(c) (ufs_cgstart(c) + uspi->s_cblkno) /* cg block */
217#define ufs_cgimin(c) (ufs_cgstart(c) + uspi->s_iblkno) /* inode blk */
218#define ufs_cgdmin(c) (ufs_cgstart(c) + uspi->s_dblkno) /* 1st data */
219
220/*
221 * Macros for handling inode numbers:
222 * inode number to file system block offset.
223 * inode number to cylinder group number.
224 * inode number to file system block address.
225 */
226#define ufs_inotocg(x) ((x) / uspi->s_ipg)
227#define ufs_inotocgoff(x) ((x) % uspi->s_ipg)
228#define ufs_inotofsba(x) (((u64)ufs_cgimin(ufs_inotocg(x))) + ufs_inotocgoff(x) / uspi->s_inopf)
229#define ufs_inotofsbo(x) ((x) % uspi->s_inopf)
230
231/*
232 * Compute the cylinder and rotational position of a cyl block addr.
233 */
234#define ufs_cbtocylno(bno) \
235 ((bno) * uspi->s_nspf / uspi->s_spc)
236#define ufs_cbtorpos(bno) \
237 ((((bno) * uspi->s_nspf % uspi->s_spc / uspi->s_nsect \
238 * uspi->s_trackskew + (bno) * uspi->s_nspf % uspi->s_spc \
239 % uspi->s_nsect * uspi->s_interleave) % uspi->s_nsect \
240 * uspi->s_nrpos) / uspi->s_npsect)
241
242/*
243 * The following macros optimize certain frequently calculated
244 * quantities by using shifts and masks in place of divisions
245 * modulos and multiplications.
246 */
247#define ufs_blkoff(loc) ((loc) & uspi->s_qbmask)
248#define ufs_fragoff(loc) ((loc) & uspi->s_qfmask)
249#define ufs_lblktosize(blk) ((blk) << uspi->s_bshift)
250#define ufs_lblkno(loc) ((loc) >> uspi->s_bshift)
251#define ufs_numfrags(loc) ((loc) >> uspi->s_fshift)
252#define ufs_blkroundup(size) (((size) + uspi->s_qbmask) & uspi->s_bmask)
253#define ufs_fragroundup(size) (((size) + uspi->s_qfmask) & uspi->s_fmask)
254#define ufs_fragstoblks(frags) ((frags) >> uspi->s_fpbshift)
255#define ufs_blkstofrags(blks) ((blks) << uspi->s_fpbshift)
256#define ufs_fragnum(fsb) ((fsb) & uspi->s_fpbmask)
257#define ufs_blknum(fsb) ((fsb) & ~uspi->s_fpbmask)
258
259#define UFS_MAXNAMLEN 255
260#define UFS_MAXMNTLEN 512
261#define UFS2_MAXMNTLEN 468
262#define UFS2_MAXVOLLEN 32
263#define UFS_MAXCSBUFS 31
264#define UFS_LINK_MAX 32000
265/*
266#define UFS2_NOCSPTRS ((128 / sizeof(void *)) - 4)
267*/
268#define UFS2_NOCSPTRS 28
269
270/*
271 * UFS_DIR_PAD defines the directory entries boundaries
272 * (must be a multiple of 4)
273 */
274#define UFS_DIR_PAD 4
275#define UFS_DIR_ROUND (UFS_DIR_PAD - 1)
276#define UFS_DIR_REC_LEN(name_len) (((name_len) + 1 + 8 + UFS_DIR_ROUND) & ~UFS_DIR_ROUND)
277
278struct ufs_timeval {
279 __fs32 tv_sec;
280 __fs32 tv_usec;
281};
282
283struct ufs_dir_entry {
284 __fs32 d_ino; /* inode number of this entry */
285 __fs16 d_reclen; /* length of this entry */
286 union {
287 __fs16 d_namlen; /* actual length of d_name */
288 struct {
289 __u8 d_type; /* file type */
290 __u8 d_namlen; /* length of string in d_name */
291 } d_44;
292 } d_u;
293 __u8 d_name[UFS_MAXNAMLEN + 1]; /* file name */
294};
295
296struct ufs_csum {
297 __fs32 cs_ndir; /* number of directories */
298 __fs32 cs_nbfree; /* number of free blocks */
299 __fs32 cs_nifree; /* number of free inodes */
300 __fs32 cs_nffree; /* number of free frags */
301};
302struct ufs2_csum_total {
303 __fs64 cs_ndir; /* number of directories */
304 __fs64 cs_nbfree; /* number of free blocks */
305 __fs64 cs_nifree; /* number of free inodes */
306 __fs64 cs_nffree; /* number of free frags */
307 __fs64 cs_numclusters; /* number of free clusters */
308 __fs64 cs_spare[3]; /* future expansion */
309};
310
311struct ufs_csum_core {
312 __u64 cs_ndir; /* number of directories */
313 __u64 cs_nbfree; /* number of free blocks */
314 __u64 cs_nifree; /* number of free inodes */
315 __u64 cs_nffree; /* number of free frags */
316 __u64 cs_numclusters; /* number of free clusters */
317};
318
319/*
320 * File system flags
321 */
322#define UFS_UNCLEAN 0x01 /* file system not clean at mount (unused) */
323#define UFS_DOSOFTDEP 0x02 /* file system using soft dependencies */
324#define UFS_NEEDSFSCK 0x04 /* needs sync fsck (FreeBSD compat, unused) */
325#define UFS_INDEXDIRS 0x08 /* kernel supports indexed directories */
326#define UFS_ACLS 0x10 /* file system has ACLs enabled */
327#define UFS_MULTILABEL 0x20 /* file system is MAC multi-label */
328#define UFS_FLAGS_UPDATED 0x80 /* flags have been moved to new location */
329
330#if 0
331/*
332 * This is the actual superblock, as it is laid out on the disk.
333 * Do NOT use this structure, because of sizeof(ufs_super_block) > 512 and
334 * it may occupy several blocks, use
335 * struct ufs_super_block_(first,second,third) instead.
336 */
337struct ufs_super_block {
338 union {
339 struct {
340 __fs32 fs_link; /* UNUSED */
341 } fs_42;
342 struct {
343 __fs32 fs_state; /* file system state flag */
344 } fs_sun;
345 } fs_u0;
346 __fs32 fs_rlink; /* UNUSED */
347 __fs32 fs_sblkno; /* addr of super-block in filesys */
348 __fs32 fs_cblkno; /* offset of cyl-block in filesys */
349 __fs32 fs_iblkno; /* offset of inode-blocks in filesys */
350 __fs32 fs_dblkno; /* offset of first data after cg */
351 __fs32 fs_cgoffset; /* cylinder group offset in cylinder */
352 __fs32 fs_cgmask; /* used to calc mod fs_ntrak */
353 __fs32 fs_time; /* last time written -- time_t */
354 __fs32 fs_size; /* number of blocks in fs */
355 __fs32 fs_dsize; /* number of data blocks in fs */
356 __fs32 fs_ncg; /* number of cylinder groups */
357 __fs32 fs_bsize; /* size of basic blocks in fs */
358 __fs32 fs_fsize; /* size of frag blocks in fs */
359 __fs32 fs_frag; /* number of frags in a block in fs */
360/* these are configuration parameters */
361 __fs32 fs_minfree; /* minimum percentage of free blocks */
362 __fs32 fs_rotdelay; /* num of ms for optimal next block */
363 __fs32 fs_rps; /* disk revolutions per second */
364/* these fields can be computed from the others */
365 __fs32 fs_bmask; /* ``blkoff'' calc of blk offsets */
366 __fs32 fs_fmask; /* ``fragoff'' calc of frag offsets */
367 __fs32 fs_bshift; /* ``lblkno'' calc of logical blkno */
368 __fs32 fs_fshift; /* ``numfrags'' calc number of frags */
369/* these are configuration parameters */
370 __fs32 fs_maxcontig; /* max number of contiguous blks */
371 __fs32 fs_maxbpg; /* max number of blks per cyl group */
372/* these fields can be computed from the others */
373 __fs32 fs_fragshift; /* block to frag shift */
374 __fs32 fs_fsbtodb; /* fsbtodb and dbtofsb shift constant */
375 __fs32 fs_sbsize; /* actual size of super block */
376 __fs32 fs_csmask; /* csum block offset */
377 __fs32 fs_csshift; /* csum block number */
378 __fs32 fs_nindir; /* value of NINDIR */
379 __fs32 fs_inopb; /* value of INOPB */
380 __fs32 fs_nspf; /* value of NSPF */
381/* yet another configuration parameter */
382 __fs32 fs_optim; /* optimization preference, see below */
383/* these fields are derived from the hardware */
384 union {
385 struct {
386 __fs32 fs_npsect; /* # sectors/track including spares */
387 } fs_sun;
388 struct {
389 __fs32 fs_state; /* file system state time stamp */
390 } fs_sunx86;
391 } fs_u1;
392 __fs32 fs_interleave; /* hardware sector interleave */
393 __fs32 fs_trackskew; /* sector 0 skew, per track */
394/* a unique id for this filesystem (currently unused and unmaintained) */
395/* In 4.3 Tahoe this space is used by fs_headswitch and fs_trkseek */
396/* Neither of those fields is used in the Tahoe code right now but */
397/* there could be problems if they are. */
398 __fs32 fs_id[2]; /* file system id */
399/* sizes determined by number of cylinder groups and their sizes */
400 __fs32 fs_csaddr; /* blk addr of cyl grp summary area */
401 __fs32 fs_cssize; /* size of cyl grp summary area */
402 __fs32 fs_cgsize; /* cylinder group size */
403/* these fields are derived from the hardware */
404 __fs32 fs_ntrak; /* tracks per cylinder */
405 __fs32 fs_nsect; /* sectors per track */
406 __fs32 fs_spc; /* sectors per cylinder */
407/* this comes from the disk driver partitioning */
408 __fs32 fs_ncyl; /* cylinders in file system */
409/* these fields can be computed from the others */
410 __fs32 fs_cpg; /* cylinders per group */
411 __fs32 fs_ipg; /* inodes per cylinder group */
412 __fs32 fs_fpg; /* blocks per group * fs_frag */
413/* this data must be re-computed after crashes */
414 struct ufs_csum fs_cstotal; /* cylinder summary information */
415/* these fields are cleared at mount time */
416 __s8 fs_fmod; /* super block modified flag */
417 __s8 fs_clean; /* file system is clean flag */
418 __s8 fs_ronly; /* mounted read-only flag */
419 __s8 fs_flags;
420 union {
421 struct {
422 __s8 fs_fsmnt[UFS_MAXMNTLEN];/* name mounted on */
423 __fs32 fs_cgrotor; /* last cg searched */
424 __fs32 fs_csp[UFS_MAXCSBUFS];/*list of fs_cs info buffers */
425 __fs32 fs_maxcluster;
426 __fs32 fs_cpc; /* cyl per cycle in postbl */
427 __fs16 fs_opostbl[16][8]; /* old rotation block list head */
428 } fs_u1;
429 struct {
430 __s8 fs_fsmnt[UFS2_MAXMNTLEN]; /* name mounted on */
431 __u8 fs_volname[UFS2_MAXVOLLEN]; /* volume name */
432 __fs64 fs_swuid; /* system-wide uid */
433 __fs32 fs_pad; /* due to alignment of fs_swuid */
434 __fs32 fs_cgrotor; /* last cg searched */
435 __fs32 fs_ocsp[UFS2_NOCSPTRS]; /*list of fs_cs info buffers */
436 __fs32 fs_contigdirs;/*# of contiguously allocated dirs */
437 __fs32 fs_csp; /* cg summary info buffer for fs_cs */
438 __fs32 fs_maxcluster;
439 __fs32 fs_active;/* used by snapshots to track fs */
440 __fs32 fs_old_cpc; /* cyl per cycle in postbl */
441 __fs32 fs_maxbsize;/*maximum blocking factor permitted */
442 __fs64 fs_sparecon64[17];/*old rotation block list head */
443 __fs64 fs_sblockloc; /* byte offset of standard superblock */
444 struct ufs2_csum_total fs_cstotal;/*cylinder summary information*/
445 struct ufs_timeval fs_time; /* last time written */
446 __fs64 fs_size; /* number of blocks in fs */
447 __fs64 fs_dsize; /* number of data blocks in fs */
448 __fs64 fs_csaddr; /* blk addr of cyl grp summary area */
449 __fs64 fs_pendingblocks;/* blocks in process of being freed */
450 __fs32 fs_pendinginodes;/*inodes in process of being freed */
451 } fs_u2;
452 } fs_u11;
453 union {
454 struct {
455 __fs32 fs_sparecon[53];/* reserved for future constants */
456 __fs32 fs_reclaim;
457 __fs32 fs_sparecon2[1];
458 __fs32 fs_state; /* file system state time stamp */
459 __fs32 fs_qbmask[2]; /* ~usb_bmask */
460 __fs32 fs_qfmask[2]; /* ~usb_fmask */
461 } fs_sun;
462 struct {
463 __fs32 fs_sparecon[53];/* reserved for future constants */
464 __fs32 fs_reclaim;
465 __fs32 fs_sparecon2[1];
466 __fs32 fs_npsect; /* # sectors/track including spares */
467 __fs32 fs_qbmask[2]; /* ~usb_bmask */
468 __fs32 fs_qfmask[2]; /* ~usb_fmask */
469 } fs_sunx86;
470 struct {
471 __fs32 fs_sparecon[50];/* reserved for future constants */
472 __fs32 fs_contigsumsize;/* size of cluster summary array */
473 __fs32 fs_maxsymlinklen;/* max length of an internal symlink */
474 __fs32 fs_inodefmt; /* format of on-disk inodes */
475 __fs32 fs_maxfilesize[2]; /* max representable file size */
476 __fs32 fs_qbmask[2]; /* ~usb_bmask */
477 __fs32 fs_qfmask[2]; /* ~usb_fmask */
478 __fs32 fs_state; /* file system state time stamp */
479 } fs_44;
480 } fs_u2;
481 __fs32 fs_postblformat; /* format of positional layout tables */
482 __fs32 fs_nrpos; /* number of rotational positions */
483 __fs32 fs_postbloff; /* (__s16) rotation block list head */
484 __fs32 fs_rotbloff; /* (__u8) blocks for each rotation */
485 __fs32 fs_magic; /* magic number */
486 __u8 fs_space[1]; /* list of blocks for each rotation */
487};
488#endif/*struct ufs_super_block*/
489
490/*
491 * Preference for optimization.
492 */
493#define UFS_OPTTIME 0 /* minimize allocation time */
494#define UFS_OPTSPACE 1 /* minimize disk fragmentation */
495
496/*
497 * Rotational layout table format types
498 */
499#define UFS_42POSTBLFMT -1 /* 4.2BSD rotational table format */
500#define UFS_DYNAMICPOSTBLFMT 1 /* dynamic rotational table format */
501
502/*
503 * Convert cylinder group to base address of its global summary info.
504 */
505#define fs_cs(indx) s_csp[(indx)]
506
507/*
508 * Cylinder group block for a file system.
509 *
510 * Writable fields in the cylinder group are protected by the associated
511 * super block lock fs->fs_lock.
512 */
513#define CG_MAGIC 0x090255
514#define ufs_cg_chkmagic(sb, ucg) \
515 (fs32_to_cpu((sb), (ucg)->cg_magic) == CG_MAGIC)
516/*
517 * Macros for access to old cylinder group array structures
518 */
519#define ufs_ocg_blktot(sb, ucg) fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_btot)
520#define ufs_ocg_blks(sb, ucg, cylno) fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_b[cylno])
521#define ufs_ocg_inosused(sb, ucg) fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_iused)
522#define ufs_ocg_blksfree(sb, ucg) fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_free)
523#define ufs_ocg_chkmagic(sb, ucg) \
524 (fs32_to_cpu((sb), ((struct ufs_old_cylinder_group *)(ucg))->cg_magic) == CG_MAGIC)
525
526/*
527 * size of this structure is 172 B
528 */
529struct ufs_cylinder_group {
530 __fs32 cg_link; /* linked list of cyl groups */
531 __fs32 cg_magic; /* magic number */
532 __fs32 cg_time; /* time last written */
533 __fs32 cg_cgx; /* we are the cgx'th cylinder group */
534 __fs16 cg_ncyl; /* number of cyl's this cg */
535 __fs16 cg_niblk; /* number of inode blocks this cg */
536 __fs32 cg_ndblk; /* number of data blocks this cg */
537 struct ufs_csum cg_cs; /* cylinder summary information */
538 __fs32 cg_rotor; /* position of last used block */
539 __fs32 cg_frotor; /* position of last used frag */
540 __fs32 cg_irotor; /* position of last used inode */
541 __fs32 cg_frsum[UFS_MAXFRAG]; /* counts of available frags */
542 __fs32 cg_btotoff; /* (__u32) block totals per cylinder */
543 __fs32 cg_boff; /* (short) free block positions */
544 __fs32 cg_iusedoff; /* (char) used inode map */
545 __fs32 cg_freeoff; /* (u_char) free block map */
546 __fs32 cg_nextfreeoff; /* (u_char) next available space */
547 union {
548 struct {
549 __fs32 cg_clustersumoff; /* (u_int32) counts of avail clusters */
550 __fs32 cg_clusteroff; /* (u_int8) free cluster map */
551 __fs32 cg_nclusterblks; /* number of clusters this cg */
552 __fs32 cg_sparecon[13]; /* reserved for future use */
553 } cg_44;
554 struct {
555 __fs32 cg_clustersumoff;/* (u_int32) counts of avail clusters */
556 __fs32 cg_clusteroff; /* (u_int8) free cluster map */
557 __fs32 cg_nclusterblks;/* number of clusters this cg */
558 __fs32 cg_niblk; /* number of inode blocks this cg */
559 __fs32 cg_initediblk; /* last initialized inode */
560 __fs32 cg_sparecon32[3];/* reserved for future use */
561 __fs64 cg_time; /* time last written */
562 __fs64 cg_sparecon[3]; /* reserved for future use */
563 } cg_u2;
564 __fs32 cg_sparecon[16]; /* reserved for future use */
565 } cg_u;
566 __u8 cg_space[1]; /* space for cylinder group maps */
567/* actually longer */
568};
569
570/* Historic Cylinder group info */
571struct ufs_old_cylinder_group {
572 __fs32 cg_link; /* linked list of cyl groups */
573 __fs32 cg_rlink; /* for incore cyl groups */
574 __fs32 cg_time; /* time last written */
575 __fs32 cg_cgx; /* we are the cgx'th cylinder group */
576 __fs16 cg_ncyl; /* number of cyl's this cg */
577 __fs16 cg_niblk; /* number of inode blocks this cg */
578 __fs32 cg_ndblk; /* number of data blocks this cg */
579 struct ufs_csum cg_cs; /* cylinder summary information */
580 __fs32 cg_rotor; /* position of last used block */
581 __fs32 cg_frotor; /* position of last used frag */
582 __fs32 cg_irotor; /* position of last used inode */
583 __fs32 cg_frsum[8]; /* counts of available frags */
584 __fs32 cg_btot[32]; /* block totals per cylinder */
585 __fs16 cg_b[32][8]; /* positions of free blocks */
586 __u8 cg_iused[256]; /* used inode map */
587 __fs32 cg_magic; /* magic number */
588 __u8 cg_free[1]; /* free block map */
589/* actually longer */
590};
591
592/*
593 * structure of an on-disk inode
594 */
595struct ufs_inode {
596 __fs16 ui_mode; /* 0x0 */
597 __fs16 ui_nlink; /* 0x2 */
598 union {
599 struct {
600 __fs16 ui_suid; /* 0x4 */
601 __fs16 ui_sgid; /* 0x6 */
602 } oldids;
603 __fs32 ui_inumber; /* 0x4 lsf: inode number */
604 __fs32 ui_author; /* 0x4 GNU HURD: author */
605 } ui_u1;
606 __fs64 ui_size; /* 0x8 */
607 struct ufs_timeval ui_atime; /* 0x10 access */
608 struct ufs_timeval ui_mtime; /* 0x18 modification */
609 struct ufs_timeval ui_ctime; /* 0x20 creation */
610 union {
611 struct {
612 __fs32 ui_db[UFS_NDADDR];/* 0x28 data blocks */
613 __fs32 ui_ib[UFS_NINDIR];/* 0x58 indirect blocks */
614 } ui_addr;
615 __u8 ui_symlink[4*(UFS_NDADDR+UFS_NINDIR)];/* 0x28 fast symlink */
616 } ui_u2;
617 __fs32 ui_flags; /* 0x64 immutable, append-only... */
618 __fs32 ui_blocks; /* 0x68 blocks in use */
619 __fs32 ui_gen; /* 0x6c like ext2 i_version, for NFS support */
620 union {
621 struct {
622 __fs32 ui_shadow; /* 0x70 shadow inode with security data */
623 __fs32 ui_uid; /* 0x74 long EFT version of uid */
624 __fs32 ui_gid; /* 0x78 long EFT version of gid */
625 __fs32 ui_oeftflag; /* 0x7c reserved */
626 } ui_sun;
627 struct {
628 __fs32 ui_uid; /* 0x70 File owner */
629 __fs32 ui_gid; /* 0x74 File group */
630 __fs32 ui_spare[2]; /* 0x78 reserved */
631 } ui_44;
632 struct {
633 __fs32 ui_uid; /* 0x70 */
634 __fs32 ui_gid; /* 0x74 */
635 __fs16 ui_modeh; /* 0x78 mode high bits */
636 __fs16 ui_spare; /* 0x7A unused */
637 __fs32 ui_trans; /* 0x7c filesystem translator */
638 } ui_hurd;
639 } ui_u3;
640};
641
642#define UFS_NXADDR 2 /* External addresses in inode. */
643struct ufs2_inode {
644 __fs16 ui_mode; /* 0: IFMT, permissions; see below. */
645 __fs16 ui_nlink; /* 2: File link count. */
646 __fs32 ui_uid; /* 4: File owner. */
647 __fs32 ui_gid; /* 8: File group. */
648 __fs32 ui_blksize; /* 12: Inode blocksize. */
649 __fs64 ui_size; /* 16: File byte count. */
650 __fs64 ui_blocks; /* 24: Bytes actually held. */
651 __fs64 ui_atime; /* 32: Last access time. */
652 __fs64 ui_mtime; /* 40: Last modified time. */
653 __fs64 ui_ctime; /* 48: Last inode change time. */
654 __fs64 ui_birthtime; /* 56: Inode creation time. */
655 __fs32 ui_mtimensec; /* 64: Last modified time. */
656 __fs32 ui_atimensec; /* 68: Last access time. */
657 __fs32 ui_ctimensec; /* 72: Last inode change time. */
658 __fs32 ui_birthnsec; /* 76: Inode creation time. */
659 __fs32 ui_gen; /* 80: Generation number. */
660 __fs32 ui_kernflags; /* 84: Kernel flags. */
661 __fs32 ui_flags; /* 88: Status flags (chflags). */
662 __fs32 ui_extsize; /* 92: External attributes block. */
663 __fs64 ui_extb[UFS_NXADDR];/* 96: External attributes block. */
664 union {
665 struct {
666 __fs64 ui_db[UFS_NDADDR]; /* 112: Direct disk blocks. */
667 __fs64 ui_ib[UFS_NINDIR];/* 208: Indirect disk blocks.*/
668 } ui_addr;
669 __u8 ui_symlink[2*4*(UFS_NDADDR+UFS_NINDIR)];/* 0x28 fast symlink */
670 } ui_u2;
671 __fs64 ui_spare[3]; /* 232: Reserved; currently unused */
672};
673
674
675/* FreeBSD has these in sys/stat.h */
676/* ui_flags that can be set by a file owner */
677#define UFS_UF_SETTABLE 0x0000ffff
678#define UFS_UF_NODUMP 0x00000001 /* do not dump */
679#define UFS_UF_IMMUTABLE 0x00000002 /* immutable (can't "change") */
680#define UFS_UF_APPEND 0x00000004 /* append-only */
681#define UFS_UF_OPAQUE 0x00000008 /* directory is opaque (unionfs) */
682#define UFS_UF_NOUNLINK 0x00000010 /* can't be removed or renamed */
683/* ui_flags that only root can set */
684#define UFS_SF_SETTABLE 0xffff0000
685#define UFS_SF_ARCHIVED 0x00010000 /* archived */
686#define UFS_SF_IMMUTABLE 0x00020000 /* immutable (can't "change") */
687#define UFS_SF_APPEND 0x00040000 /* append-only */
688#define UFS_SF_NOUNLINK 0x00100000 /* can't be removed or renamed */
689
690/*
691 * This structure is used for reading disk structures larger
692 * than the size of fragment.
693 */
694struct ufs_buffer_head {
695 __u64 fragment; /* first fragment */
696 __u64 count; /* number of fragments */
697 struct buffer_head * bh[UFS_MAXFRAG]; /* buffers */
698};
699
700struct ufs_cg_private_info {
701 struct ufs_buffer_head c_ubh;
702 __u32 c_cgx; /* number of cylidner group */
703 __u16 c_ncyl; /* number of cyl's this cg */
704 __u16 c_niblk; /* number of inode blocks this cg */
705 __u32 c_ndblk; /* number of data blocks this cg */
706 __u32 c_rotor; /* position of last used block */
707 __u32 c_frotor; /* position of last used frag */
708 __u32 c_irotor; /* position of last used inode */
709 __u32 c_btotoff; /* (__u32) block totals per cylinder */
710 __u32 c_boff; /* (short) free block positions */
711 __u32 c_iusedoff; /* (char) used inode map */
712 __u32 c_freeoff; /* (u_char) free block map */
713 __u32 c_nextfreeoff; /* (u_char) next available space */
714 __u32 c_clustersumoff;/* (u_int32) counts of avail clusters */
715 __u32 c_clusteroff; /* (u_int8) free cluster map */
716 __u32 c_nclusterblks; /* number of clusters this cg */
717};
718
719
720struct ufs_sb_private_info {
721 struct ufs_buffer_head s_ubh; /* buffer containing super block */
722 struct ufs_csum_core cs_total;
723 __u32 s_sblkno; /* offset of super-blocks in filesys */
724 __u32 s_cblkno; /* offset of cg-block in filesys */
725 __u32 s_iblkno; /* offset of inode-blocks in filesys */
726 __u32 s_dblkno; /* offset of first data after cg */
727 __u32 s_cgoffset; /* cylinder group offset in cylinder */
728 __u32 s_cgmask; /* used to calc mod fs_ntrak */
729 __u32 s_size; /* number of blocks (fragments) in fs */
730 __u32 s_dsize; /* number of data blocks in fs */
731 __u64 s_u2_size; /* ufs2: number of blocks (fragments) in fs */
732 __u64 s_u2_dsize; /*ufs2: number of data blocks in fs */
733 __u32 s_ncg; /* number of cylinder groups */
734 __u32 s_bsize; /* size of basic blocks */
735 __u32 s_fsize; /* size of fragments */
736 __u32 s_fpb; /* fragments per block */
737 __u32 s_minfree; /* minimum percentage of free blocks */
738 __u32 s_bmask; /* `blkoff'' calc of blk offsets */
739 __u32 s_fmask; /* s_fsize mask */
740 __u32 s_bshift; /* `lblkno'' calc of logical blkno */
741 __u32 s_fshift; /* s_fsize shift */
742 __u32 s_fpbshift; /* fragments per block shift */
743 __u32 s_fsbtodb; /* fsbtodb and dbtofsb shift constant */
744 __u32 s_sbsize; /* actual size of super block */
745 __u32 s_csmask; /* csum block offset */
746 __u32 s_csshift; /* csum block number */
747 __u32 s_nindir; /* value of NINDIR */
748 __u32 s_inopb; /* value of INOPB */
749 __u32 s_nspf; /* value of NSPF */
750 __u32 s_npsect; /* # sectors/track including spares */
751 __u32 s_interleave; /* hardware sector interleave */
752 __u32 s_trackskew; /* sector 0 skew, per track */
753 __u64 s_csaddr; /* blk addr of cyl grp summary area */
754 __u32 s_cssize; /* size of cyl grp summary area */
755 __u32 s_cgsize; /* cylinder group size */
756 __u32 s_ntrak; /* tracks per cylinder */
757 __u32 s_nsect; /* sectors per track */
758 __u32 s_spc; /* sectors per cylinder */
759 __u32 s_ipg; /* inodes per cylinder group */
760 __u32 s_fpg; /* fragments per group */
761 __u32 s_cpc; /* cyl per cycle in postbl */
762 __s32 s_contigsumsize;/* size of cluster summary array, 44bsd */
763 __s64 s_qbmask; /* ~usb_bmask */
764 __s64 s_qfmask; /* ~usb_fmask */
765 __s32 s_postblformat; /* format of positional layout tables */
766 __s32 s_nrpos; /* number of rotational positions */
767 __s32 s_postbloff; /* (__s16) rotation block list head */
768 __s32 s_rotbloff; /* (__u8) blocks for each rotation */
769
770 __u32 s_fpbmask; /* fragments per block mask */
771 __u32 s_apb; /* address per block */
772 __u32 s_2apb; /* address per block^2 */
773 __u32 s_3apb; /* address per block^3 */
774 __u32 s_apbmask; /* address per block mask */
775 __u32 s_apbshift; /* address per block shift */
776 __u32 s_2apbshift; /* address per block shift * 2 */
777 __u32 s_3apbshift; /* address per block shift * 3 */
778 __u32 s_nspfshift; /* number of sector per fragment shift */
779 __u32 s_nspb; /* number of sector per block */
780 __u32 s_inopf; /* inodes per fragment */
781 __u32 s_sbbase; /* offset of NeXTstep superblock */
782 __u32 s_bpf; /* bits per fragment */
783 __u32 s_bpfshift; /* bits per fragment shift*/
784 __u32 s_bpfmask; /* bits per fragment mask */
785
786 __u32 s_maxsymlinklen;/* upper limit on fast symlinks' size */
787 __s32 fs_magic; /* filesystem magic */
788 unsigned int s_dirblksize;
789};
790
791/*
792 * Sizes of this structures are:
793 * ufs_super_block_first 512
794 * ufs_super_block_second 512
795 * ufs_super_block_third 356
796 */
797struct ufs_super_block_first {
798 union {
799 struct {
800 __fs32 fs_link; /* UNUSED */
801 } fs_42;
802 struct {
803 __fs32 fs_state; /* file system state flag */
804 } fs_sun;
805 } fs_u0;
806 __fs32 fs_rlink;
807 __fs32 fs_sblkno;
808 __fs32 fs_cblkno;
809 __fs32 fs_iblkno;
810 __fs32 fs_dblkno;
811 __fs32 fs_cgoffset;
812 __fs32 fs_cgmask;
813 __fs32 fs_time;
814 __fs32 fs_size;
815 __fs32 fs_dsize;
816 __fs32 fs_ncg;
817 __fs32 fs_bsize;
818 __fs32 fs_fsize;
819 __fs32 fs_frag;
820 __fs32 fs_minfree;
821 __fs32 fs_rotdelay;
822 __fs32 fs_rps;
823 __fs32 fs_bmask;
824 __fs32 fs_fmask;
825 __fs32 fs_bshift;
826 __fs32 fs_fshift;
827 __fs32 fs_maxcontig;
828 __fs32 fs_maxbpg;
829 __fs32 fs_fragshift;
830 __fs32 fs_fsbtodb;
831 __fs32 fs_sbsize;
832 __fs32 fs_csmask;
833 __fs32 fs_csshift;
834 __fs32 fs_nindir;
835 __fs32 fs_inopb;
836 __fs32 fs_nspf;
837 __fs32 fs_optim;
838 union {
839 struct {
840 __fs32 fs_npsect;
841 } fs_sun;
842 struct {
843 __fs32 fs_state;
844 } fs_sunx86;
845 } fs_u1;
846 __fs32 fs_interleave;
847 __fs32 fs_trackskew;
848 __fs32 fs_id[2];
849 __fs32 fs_csaddr;
850 __fs32 fs_cssize;
851 __fs32 fs_cgsize;
852 __fs32 fs_ntrak;
853 __fs32 fs_nsect;
854 __fs32 fs_spc;
855 __fs32 fs_ncyl;
856 __fs32 fs_cpg;
857 __fs32 fs_ipg;
858 __fs32 fs_fpg;
859 struct ufs_csum fs_cstotal;
860 __s8 fs_fmod;
861 __s8 fs_clean;
862 __s8 fs_ronly;
863 __s8 fs_flags;
864 __s8 fs_fsmnt[UFS_MAXMNTLEN - 212];
865
866};
867
868struct ufs_super_block_second {
869 union {
870 struct {
871 __s8 fs_fsmnt[212];
872 __fs32 fs_cgrotor;
873 __fs32 fs_csp[UFS_MAXCSBUFS];
874 __fs32 fs_maxcluster;
875 __fs32 fs_cpc;
876 __fs16 fs_opostbl[82];
877 } fs_u1;
878 struct {
879 __s8 fs_fsmnt[UFS2_MAXMNTLEN - UFS_MAXMNTLEN + 212];
880 __u8 fs_volname[UFS2_MAXVOLLEN];
881 __fs64 fs_swuid;
882 __fs32 fs_pad;
883 __fs32 fs_cgrotor;
884 __fs32 fs_ocsp[UFS2_NOCSPTRS];
885 __fs32 fs_contigdirs;
886 __fs32 fs_csp;
887 __fs32 fs_maxcluster;
888 __fs32 fs_active;
889 __fs32 fs_old_cpc;
890 __fs32 fs_maxbsize;
891 __fs64 fs_sparecon64[17];
892 __fs64 fs_sblockloc;
893 __fs64 cs_ndir;
894 __fs64 cs_nbfree;
895 } fs_u2;
896 } fs_un;
897};
898
899struct ufs_super_block_third {
900 union {
901 struct {
902 __fs16 fs_opostbl[46];
903 } fs_u1;
904 struct {
905 __fs64 cs_nifree; /* number of free inodes */
906 __fs64 cs_nffree; /* number of free frags */
907 __fs64 cs_numclusters; /* number of free clusters */
908 __fs64 cs_spare[3]; /* future expansion */
909 struct ufs_timeval fs_time; /* last time written */
910 __fs64 fs_size; /* number of blocks in fs */
911 __fs64 fs_dsize; /* number of data blocks in fs */
912 __fs64 fs_csaddr; /* blk addr of cyl grp summary area */
913 __fs64 fs_pendingblocks;/* blocks in process of being freed */
914 __fs32 fs_pendinginodes;/*inodes in process of being freed */
915 } __attribute__ ((packed)) fs_u2;
916 } fs_un1;
917 union {
918 struct {
919 __fs32 fs_sparecon[53];/* reserved for future constants */
920 __fs32 fs_reclaim;
921 __fs32 fs_sparecon2[1];
922 __fs32 fs_state; /* file system state time stamp */
923 __fs32 fs_qbmask[2]; /* ~usb_bmask */
924 __fs32 fs_qfmask[2]; /* ~usb_fmask */
925 } fs_sun;
926 struct {
927 __fs32 fs_sparecon[53];/* reserved for future constants */
928 __fs32 fs_reclaim;
929 __fs32 fs_sparecon2[1];
930 __fs32 fs_npsect; /* # sectors/track including spares */
931 __fs32 fs_qbmask[2]; /* ~usb_bmask */
932 __fs32 fs_qfmask[2]; /* ~usb_fmask */
933 } fs_sunx86;
934 struct {
935 __fs32 fs_sparecon[50];/* reserved for future constants */
936 __fs32 fs_contigsumsize;/* size of cluster summary array */
937 __fs32 fs_maxsymlinklen;/* max length of an internal symlink */
938 __fs32 fs_inodefmt; /* format of on-disk inodes */
939 __fs32 fs_maxfilesize[2]; /* max representable file size */
940 __fs32 fs_qbmask[2]; /* ~usb_bmask */
941 __fs32 fs_qfmask[2]; /* ~usb_fmask */
942 __fs32 fs_state; /* file system state time stamp */
943 } fs_44;
944 } fs_un2;
945 __fs32 fs_postblformat;
946 __fs32 fs_nrpos;
947 __fs32 fs_postbloff;
948 __fs32 fs_rotbloff;
949 __fs32 fs_magic;
950 __u8 fs_space[1];
951};
952
953#endif /* __LINUX_UFS_FS_H */
diff --git a/include/linux/utsname.h b/include/linux/utsname.h
index 923db99175f2..11232676bfff 100644
--- a/include/linux/utsname.h
+++ b/include/linux/utsname.h
@@ -35,6 +35,7 @@ struct new_utsname {
35#include <linux/sched.h> 35#include <linux/sched.h>
36#include <linux/kref.h> 36#include <linux/kref.h>
37#include <linux/nsproxy.h> 37#include <linux/nsproxy.h>
38#include <linux/err.h>
38#include <asm/atomic.h> 39#include <asm/atomic.h>
39 40
40struct uts_namespace { 41struct uts_namespace {
@@ -43,6 +44,7 @@ struct uts_namespace {
43}; 44};
44extern struct uts_namespace init_uts_ns; 45extern struct uts_namespace init_uts_ns;
45 46
47#ifdef CONFIG_UTS_NS
46static inline void get_uts_ns(struct uts_namespace *ns) 48static inline void get_uts_ns(struct uts_namespace *ns)
47{ 49{
48 kref_get(&ns->kref); 50 kref_get(&ns->kref);
@@ -56,6 +58,25 @@ static inline void put_uts_ns(struct uts_namespace *ns)
56{ 58{
57 kref_put(&ns->kref, free_uts_ns); 59 kref_put(&ns->kref, free_uts_ns);
58} 60}
61#else
62static inline void get_uts_ns(struct uts_namespace *ns)
63{
64}
65
66static inline void put_uts_ns(struct uts_namespace *ns)
67{
68}
69
70static inline struct uts_namespace *copy_utsname(unsigned long flags,
71 struct uts_namespace *ns)
72{
73 if (flags & CLONE_NEWUTS)
74 return ERR_PTR(-EINVAL);
75
76 return ns;
77}
78#endif
79
59static inline struct new_utsname *utsname(void) 80static inline struct new_utsname *utsname(void)
60{ 81{
61 return &current->nsproxy->uts_ns->name; 82 return &current->nsproxy->uts_ns->name;
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h
index feb5e99a1079..9448ffbdcbf6 100644
--- a/include/linux/vt_kern.h
+++ b/include/linux/vt_kern.h
@@ -77,6 +77,7 @@ void change_console(struct vc_data *new_vc);
77void reset_vc(struct vc_data *vc); 77void reset_vc(struct vc_data *vc);
78extern int unbind_con_driver(const struct consw *csw, int first, int last, 78extern int unbind_con_driver(const struct consw *csw, int first, int last,
79 int deflt); 79 int deflt);
80int vty_init(void);
80 81
81/* 82/*
82 * vc_screen.c shares this temporary buffer with the console write code so that 83 * vc_screen.c shares this temporary buffer with the console write code so that
diff --git a/include/linux/w1-gpio.h b/include/linux/w1-gpio.h
new file mode 100644
index 000000000000..9797fec7748a
--- /dev/null
+++ b/include/linux/w1-gpio.h
@@ -0,0 +1,23 @@
1/*
2 * w1-gpio interface to platform code
3 *
4 * Copyright (C) 2007 Ville Syrjala <syrjala@sci.fi>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2
8 * as published by the Free Software Foundation.
9 */
10#ifndef _LINUX_W1_GPIO_H
11#define _LINUX_W1_GPIO_H
12
13/**
14 * struct w1_gpio_platform_data - Platform-dependent data for w1-gpio
15 * @pin: GPIO pin to use
16 * @is_open_drain: GPIO pin is configured as open drain
17 */
18struct w1_gpio_platform_data {
19 unsigned int pin;
20 unsigned int is_open_drain:1;
21};
22
23#endif /* _LINUX_W1_GPIO_H */