diff options
Diffstat (limited to 'include')
82 files changed, 1262 insertions, 702 deletions
diff --git a/include/asm-frv/atomic.h b/include/asm-frv/atomic.h index 46d696b331e7..296c35cfb207 100644 --- a/include/asm-frv/atomic.h +++ b/include/asm-frv/atomic.h | |||
@@ -35,10 +35,6 @@ | |||
35 | #define smp_mb__before_atomic_inc() barrier() | 35 | #define smp_mb__before_atomic_inc() barrier() |
36 | #define smp_mb__after_atomic_inc() barrier() | 36 | #define smp_mb__after_atomic_inc() barrier() |
37 | 37 | ||
38 | typedef struct { | ||
39 | int counter; | ||
40 | } atomic_t; | ||
41 | |||
42 | #define ATOMIC_INIT(i) { (i) } | 38 | #define ATOMIC_INIT(i) { (i) } |
43 | #define atomic_read(v) ((v)->counter) | 39 | #define atomic_read(v) ((v)->counter) |
44 | #define atomic_set(v, i) (((v)->counter) = (i)) | 40 | #define atomic_set(v, i) (((v)->counter) = (i)) |
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h index 8af276361bf2..37b82cb96c89 100644 --- a/include/asm-generic/bug.h +++ b/include/asm-generic/bug.h | |||
@@ -28,6 +28,17 @@ struct bug_entry { | |||
28 | #define BUGFLAG_WARNING (1<<0) | 28 | #define BUGFLAG_WARNING (1<<0) |
29 | #endif /* CONFIG_GENERIC_BUG */ | 29 | #endif /* CONFIG_GENERIC_BUG */ |
30 | 30 | ||
31 | /* | ||
32 | * Don't use BUG() or BUG_ON() unless there's really no way out; one | ||
33 | * example might be detecting data structure corruption in the middle | ||
34 | * of an operation that can't be backed out of. If the (sub)system | ||
35 | * can somehow continue operating, perhaps with reduced functionality, | ||
36 | * it's probably not BUG-worthy. | ||
37 | * | ||
38 | * If you're tempted to BUG(), think again: is completely giving up | ||
39 | * really the *only* solution? There are usually better options, where | ||
40 | * users don't need to reboot ASAP and can mostly shut down cleanly. | ||
41 | */ | ||
31 | #ifndef HAVE_ARCH_BUG | 42 | #ifndef HAVE_ARCH_BUG |
32 | #define BUG() do { \ | 43 | #define BUG() do { \ |
33 | printk("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); \ | 44 | printk("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __func__); \ |
@@ -39,6 +50,12 @@ struct bug_entry { | |||
39 | #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while(0) | 50 | #define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while(0) |
40 | #endif | 51 | #endif |
41 | 52 | ||
53 | /* | ||
54 | * WARN(), WARN_ON(), WARN_ON_ONCE, and so on can be used to report | ||
55 | * significant issues that need prompt attention if they should ever | ||
56 | * appear at runtime. Use the versions with printk format strings | ||
57 | * to provide better diagnostics. | ||
58 | */ | ||
42 | #ifndef __WARN | 59 | #ifndef __WARN |
43 | #ifndef __ASSEMBLY__ | 60 | #ifndef __ASSEMBLY__ |
44 | extern void warn_slowpath(const char *file, const int line, | 61 | extern void warn_slowpath(const char *file, const int line, |
diff --git a/include/asm-generic/local.h b/include/asm-generic/local.h index 33d7d04e4119..dbd6150763e9 100644 --- a/include/asm-generic/local.h +++ b/include/asm-generic/local.h | |||
@@ -2,7 +2,6 @@ | |||
2 | #define _ASM_GENERIC_LOCAL_H | 2 | #define _ASM_GENERIC_LOCAL_H |
3 | 3 | ||
4 | #include <linux/percpu.h> | 4 | #include <linux/percpu.h> |
5 | #include <linux/hardirq.h> | ||
6 | #include <asm/atomic.h> | 5 | #include <asm/atomic.h> |
7 | #include <asm/types.h> | 6 | #include <asm/types.h> |
8 | 7 | ||
diff --git a/include/asm-generic/memory_model.h b/include/asm-generic/memory_model.h index 36fa286adad5..4c8d0afae711 100644 --- a/include/asm-generic/memory_model.h +++ b/include/asm-generic/memory_model.h | |||
@@ -69,15 +69,8 @@ | |||
69 | }) | 69 | }) |
70 | #endif /* CONFIG_FLATMEM/DISCONTIGMEM/SPARSEMEM */ | 70 | #endif /* CONFIG_FLATMEM/DISCONTIGMEM/SPARSEMEM */ |
71 | 71 | ||
72 | #ifdef CONFIG_OUT_OF_LINE_PFN_TO_PAGE | ||
73 | struct page; | ||
74 | /* this is useful when inlined pfn_to_page is too big */ | ||
75 | extern struct page *pfn_to_page(unsigned long pfn); | ||
76 | extern unsigned long page_to_pfn(struct page *page); | ||
77 | #else | ||
78 | #define page_to_pfn __page_to_pfn | 72 | #define page_to_pfn __page_to_pfn |
79 | #define pfn_to_page __pfn_to_page | 73 | #define pfn_to_page __pfn_to_page |
80 | #endif /* CONFIG_OUT_OF_LINE_PFN_TO_PAGE */ | ||
81 | 74 | ||
82 | #endif /* __ASSEMBLY__ */ | 75 | #endif /* __ASSEMBLY__ */ |
83 | 76 | ||
diff --git a/include/asm-m32r/atomic.h b/include/asm-m32r/atomic.h index 3a38ffe4a4f4..2eed30f84080 100644 --- a/include/asm-m32r/atomic.h +++ b/include/asm-m32r/atomic.h | |||
@@ -9,6 +9,7 @@ | |||
9 | * Copyright (C) 2004 Hirokazu Takata <takata at linux-m32r.org> | 9 | * Copyright (C) 2004 Hirokazu Takata <takata at linux-m32r.org> |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <linux/types.h> | ||
12 | #include <asm/assembler.h> | 13 | #include <asm/assembler.h> |
13 | #include <asm/system.h> | 14 | #include <asm/system.h> |
14 | 15 | ||
@@ -17,13 +18,6 @@ | |||
17 | * resource counting etc.. | 18 | * resource counting etc.. |
18 | */ | 19 | */ |
19 | 20 | ||
20 | /* | ||
21 | * Make sure gcc doesn't try to be clever and move things around | ||
22 | * on us. We need to use _exactly_ the address the user gave us, | ||
23 | * not some alias that contains the same information. | ||
24 | */ | ||
25 | typedef struct { volatile int counter; } atomic_t; | ||
26 | |||
27 | #define ATOMIC_INIT(i) { (i) } | 21 | #define ATOMIC_INIT(i) { (i) } |
28 | 22 | ||
29 | /** | 23 | /** |
diff --git a/include/asm-m68k/atomic.h b/include/asm-m68k/atomic.h index 4915294fea63..eb0ab9d4ee77 100644 --- a/include/asm-m68k/atomic.h +++ b/include/asm-m68k/atomic.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef __ARCH_M68K_ATOMIC__ | 1 | #ifndef __ARCH_M68K_ATOMIC__ |
2 | #define __ARCH_M68K_ATOMIC__ | 2 | #define __ARCH_M68K_ATOMIC__ |
3 | 3 | ||
4 | 4 | #include <linux/types.h> | |
5 | #include <asm/system.h> | 5 | #include <asm/system.h> |
6 | 6 | ||
7 | /* | 7 | /* |
@@ -13,7 +13,6 @@ | |||
13 | * We do not have SMP m68k systems, so we don't have to deal with that. | 13 | * We do not have SMP m68k systems, so we don't have to deal with that. |
14 | */ | 14 | */ |
15 | 15 | ||
16 | typedef struct { int counter; } atomic_t; | ||
17 | #define ATOMIC_INIT(i) { (i) } | 16 | #define ATOMIC_INIT(i) { (i) } |
18 | 17 | ||
19 | #define atomic_read(v) ((v)->counter) | 18 | #define atomic_read(v) ((v)->counter) |
diff --git a/include/asm-mn10300/atomic.h b/include/asm-mn10300/atomic.h index 27c9690b9574..bc064825f9b1 100644 --- a/include/asm-mn10300/atomic.h +++ b/include/asm-mn10300/atomic.h | |||
@@ -20,15 +20,6 @@ | |||
20 | * resource counting etc.. | 20 | * resource counting etc.. |
21 | */ | 21 | */ |
22 | 22 | ||
23 | /* | ||
24 | * Make sure gcc doesn't try to be clever and move things around | ||
25 | * on us. We need to use _exactly_ the address the user gave us, | ||
26 | * not some alias that contains the same information. | ||
27 | */ | ||
28 | typedef struct { | ||
29 | int counter; | ||
30 | } atomic_t; | ||
31 | |||
32 | #define ATOMIC_INIT(i) { (i) } | 23 | #define ATOMIC_INIT(i) { (i) } |
33 | 24 | ||
34 | #ifdef __KERNEL__ | 25 | #ifdef __KERNEL__ |
diff --git a/include/asm-xtensa/atomic.h b/include/asm-xtensa/atomic.h index b3b23540f14d..67ad67bed8c1 100644 --- a/include/asm-xtensa/atomic.h +++ b/include/asm-xtensa/atomic.h | |||
@@ -14,8 +14,7 @@ | |||
14 | #define _XTENSA_ATOMIC_H | 14 | #define _XTENSA_ATOMIC_H |
15 | 15 | ||
16 | #include <linux/stringify.h> | 16 | #include <linux/stringify.h> |
17 | 17 | #include <linux/types.h> | |
18 | typedef struct { volatile int counter; } atomic_t; | ||
19 | 18 | ||
20 | #ifdef __KERNEL__ | 19 | #ifdef __KERNEL__ |
21 | #include <asm/processor.h> | 20 | #include <asm/processor.h> |
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 95ac82340c3b..39da666067b9 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -56,8 +56,6 @@ header-y += dlm_device.h | |||
56 | header-y += dlm_netlink.h | 56 | header-y += dlm_netlink.h |
57 | header-y += dm-ioctl.h | 57 | header-y += dm-ioctl.h |
58 | header-y += dn.h | 58 | header-y += dn.h |
59 | header-y += dqblk_v1.h | ||
60 | header-y += dqblk_v2.h | ||
61 | header-y += dqblk_xfs.h | 59 | header-y += dqblk_xfs.h |
62 | header-y += efs_fs_sb.h | 60 | header-y += efs_fs_sb.h |
63 | header-y += elf-fdpic.h | 61 | header-y += elf-fdpic.h |
@@ -134,8 +132,6 @@ header-y += posix_types.h | |||
134 | header-y += ppdev.h | 132 | header-y += ppdev.h |
135 | header-y += prctl.h | 133 | header-y += prctl.h |
136 | header-y += qnxtypes.h | 134 | header-y += qnxtypes.h |
137 | header-y += quotaio_v1.h | ||
138 | header-y += quotaio_v2.h | ||
139 | header-y += radeonfb.h | 135 | header-y += radeonfb.h |
140 | header-y += raw.h | 136 | header-y += raw.h |
141 | header-y += resource.h | 137 | header-y += resource.h |
diff --git a/include/linux/auto_dev-ioctl.h b/include/linux/auto_dev-ioctl.h index f4d05ccd731f..91a773993a5c 100644 --- a/include/linux/auto_dev-ioctl.h +++ b/include/linux/auto_dev-ioctl.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #ifndef _LINUX_AUTO_DEV_IOCTL_H | 10 | #ifndef _LINUX_AUTO_DEV_IOCTL_H |
11 | #define _LINUX_AUTO_DEV_IOCTL_H | 11 | #define _LINUX_AUTO_DEV_IOCTL_H |
12 | 12 | ||
13 | #include <linux/string.h> | ||
13 | #include <linux/types.h> | 14 | #include <linux/types.h> |
14 | 15 | ||
15 | #define AUTOFS_DEVICE_NAME "autofs" | 16 | #define AUTOFS_DEVICE_NAME "autofs" |
@@ -25,6 +26,60 @@ | |||
25 | * An ioctl interface for autofs mount point control. | 26 | * An ioctl interface for autofs mount point control. |
26 | */ | 27 | */ |
27 | 28 | ||
29 | struct args_protover { | ||
30 | __u32 version; | ||
31 | }; | ||
32 | |||
33 | struct args_protosubver { | ||
34 | __u32 sub_version; | ||
35 | }; | ||
36 | |||
37 | struct args_openmount { | ||
38 | __u32 devid; | ||
39 | }; | ||
40 | |||
41 | struct args_ready { | ||
42 | __u32 token; | ||
43 | }; | ||
44 | |||
45 | struct args_fail { | ||
46 | __u32 token; | ||
47 | __s32 status; | ||
48 | }; | ||
49 | |||
50 | struct args_setpipefd { | ||
51 | __s32 pipefd; | ||
52 | }; | ||
53 | |||
54 | struct args_timeout { | ||
55 | __u64 timeout; | ||
56 | }; | ||
57 | |||
58 | struct args_requester { | ||
59 | __u32 uid; | ||
60 | __u32 gid; | ||
61 | }; | ||
62 | |||
63 | struct args_expire { | ||
64 | __u32 how; | ||
65 | }; | ||
66 | |||
67 | struct args_askumount { | ||
68 | __u32 may_umount; | ||
69 | }; | ||
70 | |||
71 | struct args_ismountpoint { | ||
72 | union { | ||
73 | struct args_in { | ||
74 | __u32 type; | ||
75 | } in; | ||
76 | struct args_out { | ||
77 | __u32 devid; | ||
78 | __u32 magic; | ||
79 | } out; | ||
80 | }; | ||
81 | }; | ||
82 | |||
28 | /* | 83 | /* |
29 | * All the ioctls use this structure. | 84 | * All the ioctls use this structure. |
30 | * When sending a path size must account for the total length | 85 | * When sending a path size must account for the total length |
@@ -39,20 +94,32 @@ struct autofs_dev_ioctl { | |||
39 | * including this struct */ | 94 | * including this struct */ |
40 | __s32 ioctlfd; /* automount command fd */ | 95 | __s32 ioctlfd; /* automount command fd */ |
41 | 96 | ||
42 | __u32 arg1; /* Command parameters */ | 97 | /* Command parameters */ |
43 | __u32 arg2; | 98 | |
99 | union { | ||
100 | struct args_protover protover; | ||
101 | struct args_protosubver protosubver; | ||
102 | struct args_openmount openmount; | ||
103 | struct args_ready ready; | ||
104 | struct args_fail fail; | ||
105 | struct args_setpipefd setpipefd; | ||
106 | struct args_timeout timeout; | ||
107 | struct args_requester requester; | ||
108 | struct args_expire expire; | ||
109 | struct args_askumount askumount; | ||
110 | struct args_ismountpoint ismountpoint; | ||
111 | }; | ||
44 | 112 | ||
45 | char path[0]; | 113 | char path[0]; |
46 | }; | 114 | }; |
47 | 115 | ||
48 | static inline void init_autofs_dev_ioctl(struct autofs_dev_ioctl *in) | 116 | static inline void init_autofs_dev_ioctl(struct autofs_dev_ioctl *in) |
49 | { | 117 | { |
118 | memset(in, 0, sizeof(struct autofs_dev_ioctl)); | ||
50 | in->ver_major = AUTOFS_DEV_IOCTL_VERSION_MAJOR; | 119 | in->ver_major = AUTOFS_DEV_IOCTL_VERSION_MAJOR; |
51 | in->ver_minor = AUTOFS_DEV_IOCTL_VERSION_MINOR; | 120 | in->ver_minor = AUTOFS_DEV_IOCTL_VERSION_MINOR; |
52 | in->size = sizeof(struct autofs_dev_ioctl); | 121 | in->size = sizeof(struct autofs_dev_ioctl); |
53 | in->ioctlfd = -1; | 122 | in->ioctlfd = -1; |
54 | in->arg1 = 0; | ||
55 | in->arg2 = 0; | ||
56 | return; | 123 | return; |
57 | } | 124 | } |
58 | 125 | ||
diff --git a/include/linux/auto_fs4.h b/include/linux/auto_fs4.h index 2253716d4b92..55fa478bd639 100644 --- a/include/linux/auto_fs4.h +++ b/include/linux/auto_fs4.h | |||
@@ -29,10 +29,64 @@ | |||
29 | #define AUTOFS_EXP_IMMEDIATE 1 | 29 | #define AUTOFS_EXP_IMMEDIATE 1 |
30 | #define AUTOFS_EXP_LEAVES 2 | 30 | #define AUTOFS_EXP_LEAVES 2 |
31 | 31 | ||
32 | #define AUTOFS_TYPE_ANY 0x0000 | 32 | #define AUTOFS_TYPE_ANY 0U |
33 | #define AUTOFS_TYPE_INDIRECT 0x0001 | 33 | #define AUTOFS_TYPE_INDIRECT 1U |
34 | #define AUTOFS_TYPE_DIRECT 0x0002 | 34 | #define AUTOFS_TYPE_DIRECT 2U |
35 | #define AUTOFS_TYPE_OFFSET 0x0004 | 35 | #define AUTOFS_TYPE_OFFSET 4U |
36 | |||
37 | static inline void set_autofs_type_indirect(unsigned int *type) | ||
38 | { | ||
39 | *type = AUTOFS_TYPE_INDIRECT; | ||
40 | return; | ||
41 | } | ||
42 | |||
43 | static inline unsigned int autofs_type_indirect(unsigned int type) | ||
44 | { | ||
45 | return (type == AUTOFS_TYPE_INDIRECT); | ||
46 | } | ||
47 | |||
48 | static inline void set_autofs_type_direct(unsigned int *type) | ||
49 | { | ||
50 | *type = AUTOFS_TYPE_DIRECT; | ||
51 | return; | ||
52 | } | ||
53 | |||
54 | static inline unsigned int autofs_type_direct(unsigned int type) | ||
55 | { | ||
56 | return (type == AUTOFS_TYPE_DIRECT); | ||
57 | } | ||
58 | |||
59 | static inline void set_autofs_type_offset(unsigned int *type) | ||
60 | { | ||
61 | *type = AUTOFS_TYPE_OFFSET; | ||
62 | return; | ||
63 | } | ||
64 | |||
65 | static inline unsigned int autofs_type_offset(unsigned int type) | ||
66 | { | ||
67 | return (type == AUTOFS_TYPE_OFFSET); | ||
68 | } | ||
69 | |||
70 | static inline unsigned int autofs_type_trigger(unsigned int type) | ||
71 | { | ||
72 | return (type == AUTOFS_TYPE_DIRECT || type == AUTOFS_TYPE_OFFSET); | ||
73 | } | ||
74 | |||
75 | /* | ||
76 | * This isn't really a type as we use it to say "no type set" to | ||
77 | * indicate we want to search for "any" mount in the | ||
78 | * autofs_dev_ioctl_ismountpoint() device ioctl function. | ||
79 | */ | ||
80 | static inline void set_autofs_type_any(unsigned int *type) | ||
81 | { | ||
82 | *type = AUTOFS_TYPE_ANY; | ||
83 | return; | ||
84 | } | ||
85 | |||
86 | static inline unsigned int autofs_type_any(unsigned int type) | ||
87 | { | ||
88 | return (type == AUTOFS_TYPE_ANY); | ||
89 | } | ||
36 | 90 | ||
37 | /* Daemon notification packet types */ | 91 | /* Daemon notification packet types */ |
38 | enum autofs_notify { | 92 | enum autofs_notify { |
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h index 6cbfbe297180..77b4a9e46004 100644 --- a/include/linux/binfmts.h +++ b/include/linux/binfmts.h | |||
@@ -18,6 +18,7 @@ struct pt_regs; | |||
18 | #define BINPRM_BUF_SIZE 128 | 18 | #define BINPRM_BUF_SIZE 128 |
19 | 19 | ||
20 | #ifdef __KERNEL__ | 20 | #ifdef __KERNEL__ |
21 | #include <linux/list.h> | ||
21 | 22 | ||
22 | #define CORENAME_MAX_SIZE 128 | 23 | #define CORENAME_MAX_SIZE 128 |
23 | 24 | ||
@@ -106,7 +107,7 @@ extern int setup_arg_pages(struct linux_binprm * bprm, | |||
106 | extern int bprm_mm_init(struct linux_binprm *bprm); | 107 | extern int bprm_mm_init(struct linux_binprm *bprm); |
107 | extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm); | 108 | extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm); |
108 | extern void install_exec_creds(struct linux_binprm *bprm); | 109 | extern void install_exec_creds(struct linux_binprm *bprm); |
109 | extern int do_coredump(long signr, int exit_code, struct pt_regs * regs); | 110 | extern void do_coredump(long signr, int exit_code, struct pt_regs *regs); |
110 | extern int set_binfmt(struct linux_binfmt *new); | 111 | extern int set_binfmt(struct linux_binfmt *new); |
111 | extern void free_bprm(struct linux_binprm *); | 112 | extern void free_bprm(struct linux_binprm *); |
112 | 113 | ||
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 1164963c3a85..08b78c09b09a 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -329,13 +329,7 @@ struct cgroup_subsys { | |||
329 | struct cgroup *cgrp); | 329 | struct cgroup *cgrp); |
330 | void (*post_clone)(struct cgroup_subsys *ss, struct cgroup *cgrp); | 330 | void (*post_clone)(struct cgroup_subsys *ss, struct cgroup *cgrp); |
331 | void (*bind)(struct cgroup_subsys *ss, struct cgroup *root); | 331 | void (*bind)(struct cgroup_subsys *ss, struct cgroup *root); |
332 | /* | 332 | |
333 | * This routine is called with the task_lock of mm->owner held | ||
334 | */ | ||
335 | void (*mm_owner_changed)(struct cgroup_subsys *ss, | ||
336 | struct cgroup *old, | ||
337 | struct cgroup *new, | ||
338 | struct task_struct *p); | ||
339 | int subsys_id; | 333 | int subsys_id; |
340 | int active; | 334 | int active; |
341 | int disabled; | 335 | int disabled; |
@@ -400,9 +394,6 @@ void cgroup_iter_end(struct cgroup *cgrp, struct cgroup_iter *it); | |||
400 | int cgroup_scan_tasks(struct cgroup_scanner *scan); | 394 | int cgroup_scan_tasks(struct cgroup_scanner *scan); |
401 | int cgroup_attach_task(struct cgroup *, struct task_struct *); | 395 | int cgroup_attach_task(struct cgroup *, struct task_struct *); |
402 | 396 | ||
403 | void cgroup_mm_owner_callbacks(struct task_struct *old, | ||
404 | struct task_struct *new); | ||
405 | |||
406 | #else /* !CONFIG_CGROUPS */ | 397 | #else /* !CONFIG_CGROUPS */ |
407 | 398 | ||
408 | static inline int cgroup_init_early(void) { return 0; } | 399 | static inline int cgroup_init_early(void) { return 0; } |
@@ -420,9 +411,6 @@ static inline int cgroupstats_build(struct cgroupstats *stats, | |||
420 | return -EINVAL; | 411 | return -EINVAL; |
421 | } | 412 | } |
422 | 413 | ||
423 | static inline void cgroup_mm_owner_callbacks(struct task_struct *old, | ||
424 | struct task_struct *new) {} | ||
425 | |||
426 | #endif /* !CONFIG_CGROUPS */ | 414 | #endif /* !CONFIG_CGROUPS */ |
427 | 415 | ||
428 | #endif /* _LINUX_CGROUP_H */ | 416 | #endif /* _LINUX_CGROUP_H */ |
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 1ee608fd7b77..484b3abf61bb 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
@@ -234,6 +234,7 @@ struct cpufreq_driver { | |||
234 | int (*suspend) (struct cpufreq_policy *policy, pm_message_t pmsg); | 234 | int (*suspend) (struct cpufreq_policy *policy, pm_message_t pmsg); |
235 | int (*resume) (struct cpufreq_policy *policy); | 235 | int (*resume) (struct cpufreq_policy *policy); |
236 | struct freq_attr **attr; | 236 | struct freq_attr **attr; |
237 | bool hide_interface; | ||
237 | }; | 238 | }; |
238 | 239 | ||
239 | /* flags */ | 240 | /* flags */ |
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h index 8e540d32c9fe..51ea2bdea0f9 100644 --- a/include/linux/cpuset.h +++ b/include/linux/cpuset.h | |||
@@ -78,6 +78,8 @@ extern int current_cpuset_is_being_rebound(void); | |||
78 | 78 | ||
79 | extern void rebuild_sched_domains(void); | 79 | extern void rebuild_sched_domains(void); |
80 | 80 | ||
81 | extern void cpuset_print_task_mems_allowed(struct task_struct *p); | ||
82 | |||
81 | #else /* !CONFIG_CPUSETS */ | 83 | #else /* !CONFIG_CPUSETS */ |
82 | 84 | ||
83 | static inline int cpuset_init_early(void) { return 0; } | 85 | static inline int cpuset_init_early(void) { return 0; } |
@@ -159,6 +161,10 @@ static inline void rebuild_sched_domains(void) | |||
159 | partition_sched_domains(1, NULL, NULL); | 161 | partition_sched_domains(1, NULL, NULL); |
160 | } | 162 | } |
161 | 163 | ||
164 | static inline void cpuset_print_task_mems_allowed(struct task_struct *p) | ||
165 | { | ||
166 | } | ||
167 | |||
162 | #endif /* !CONFIG_CPUSETS */ | 168 | #endif /* !CONFIG_CPUSETS */ |
163 | 169 | ||
164 | #endif /* _LINUX_CPUSET_H */ | 170 | #endif /* _LINUX_CPUSET_H */ |
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index c17fd334e574..8209e08969f9 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h | |||
@@ -45,6 +45,8 @@ typedef void (*dm_dtr_fn) (struct dm_target *ti); | |||
45 | */ | 45 | */ |
46 | typedef int (*dm_map_fn) (struct dm_target *ti, struct bio *bio, | 46 | typedef int (*dm_map_fn) (struct dm_target *ti, struct bio *bio, |
47 | union map_info *map_context); | 47 | union map_info *map_context); |
48 | typedef int (*dm_map_request_fn) (struct dm_target *ti, struct request *clone, | ||
49 | union map_info *map_context); | ||
48 | 50 | ||
49 | /* | 51 | /* |
50 | * Returns: | 52 | * Returns: |
@@ -57,6 +59,9 @@ typedef int (*dm_map_fn) (struct dm_target *ti, struct bio *bio, | |||
57 | typedef int (*dm_endio_fn) (struct dm_target *ti, | 59 | typedef int (*dm_endio_fn) (struct dm_target *ti, |
58 | struct bio *bio, int error, | 60 | struct bio *bio, int error, |
59 | union map_info *map_context); | 61 | union map_info *map_context); |
62 | typedef int (*dm_request_endio_fn) (struct dm_target *ti, | ||
63 | struct request *clone, int error, | ||
64 | union map_info *map_context); | ||
60 | 65 | ||
61 | typedef void (*dm_flush_fn) (struct dm_target *ti); | 66 | typedef void (*dm_flush_fn) (struct dm_target *ti); |
62 | typedef void (*dm_presuspend_fn) (struct dm_target *ti); | 67 | typedef void (*dm_presuspend_fn) (struct dm_target *ti); |
@@ -75,6 +80,13 @@ typedef int (*dm_ioctl_fn) (struct dm_target *ti, unsigned int cmd, | |||
75 | typedef int (*dm_merge_fn) (struct dm_target *ti, struct bvec_merge_data *bvm, | 80 | typedef int (*dm_merge_fn) (struct dm_target *ti, struct bvec_merge_data *bvm, |
76 | struct bio_vec *biovec, int max_size); | 81 | struct bio_vec *biovec, int max_size); |
77 | 82 | ||
83 | /* | ||
84 | * Returns: | ||
85 | * 0: The target can handle the next I/O immediately. | ||
86 | * 1: The target can't handle the next I/O immediately. | ||
87 | */ | ||
88 | typedef int (*dm_busy_fn) (struct dm_target *ti); | ||
89 | |||
78 | void dm_error(const char *message); | 90 | void dm_error(const char *message); |
79 | 91 | ||
80 | /* | 92 | /* |
@@ -100,14 +112,23 @@ void dm_put_device(struct dm_target *ti, struct dm_dev *d); | |||
100 | /* | 112 | /* |
101 | * Information about a target type | 113 | * Information about a target type |
102 | */ | 114 | */ |
115 | |||
116 | /* | ||
117 | * Target features | ||
118 | */ | ||
119 | #define DM_TARGET_SUPPORTS_BARRIERS 0x00000001 | ||
120 | |||
103 | struct target_type { | 121 | struct target_type { |
122 | uint64_t features; | ||
104 | const char *name; | 123 | const char *name; |
105 | struct module *module; | 124 | struct module *module; |
106 | unsigned version[3]; | 125 | unsigned version[3]; |
107 | dm_ctr_fn ctr; | 126 | dm_ctr_fn ctr; |
108 | dm_dtr_fn dtr; | 127 | dm_dtr_fn dtr; |
109 | dm_map_fn map; | 128 | dm_map_fn map; |
129 | dm_map_request_fn map_rq; | ||
110 | dm_endio_fn end_io; | 130 | dm_endio_fn end_io; |
131 | dm_request_endio_fn rq_end_io; | ||
111 | dm_flush_fn flush; | 132 | dm_flush_fn flush; |
112 | dm_presuspend_fn presuspend; | 133 | dm_presuspend_fn presuspend; |
113 | dm_postsuspend_fn postsuspend; | 134 | dm_postsuspend_fn postsuspend; |
@@ -117,6 +138,7 @@ struct target_type { | |||
117 | dm_message_fn message; | 138 | dm_message_fn message; |
118 | dm_ioctl_fn ioctl; | 139 | dm_ioctl_fn ioctl; |
119 | dm_merge_fn merge; | 140 | dm_merge_fn merge; |
141 | dm_busy_fn busy; | ||
120 | }; | 142 | }; |
121 | 143 | ||
122 | struct io_restrictions { | 144 | struct io_restrictions { |
@@ -157,8 +179,7 @@ struct dm_target { | |||
157 | }; | 179 | }; |
158 | 180 | ||
159 | int dm_register_target(struct target_type *t); | 181 | int dm_register_target(struct target_type *t); |
160 | int dm_unregister_target(struct target_type *t); | 182 | void dm_unregister_target(struct target_type *t); |
161 | |||
162 | 183 | ||
163 | /*----------------------------------------------------------------- | 184 | /*----------------------------------------------------------------- |
164 | * Functions for creating and manipulating mapped devices. | 185 | * Functions for creating and manipulating mapped devices. |
@@ -276,6 +297,9 @@ void *dm_vcalloc(unsigned long nmemb, unsigned long elem_size); | |||
276 | *---------------------------------------------------------------*/ | 297 | *---------------------------------------------------------------*/ |
277 | #define DM_NAME "device-mapper" | 298 | #define DM_NAME "device-mapper" |
278 | 299 | ||
300 | #define DMCRIT(f, arg...) \ | ||
301 | printk(KERN_CRIT DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) | ||
302 | |||
279 | #define DMERR(f, arg...) \ | 303 | #define DMERR(f, arg...) \ |
280 | printk(KERN_ERR DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) | 304 | printk(KERN_ERR DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) |
281 | #define DMERR_LIMIT(f, arg...) \ | 305 | #define DMERR_LIMIT(f, arg...) \ |
diff --git a/include/linux/device.h b/include/linux/device.h index 1a3686d15f98..7d9da4b4993f 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -28,6 +28,7 @@ | |||
28 | #define BUS_ID_SIZE 20 | 28 | #define BUS_ID_SIZE 20 |
29 | 29 | ||
30 | struct device; | 30 | struct device; |
31 | struct device_private; | ||
31 | struct device_driver; | 32 | struct device_driver; |
32 | struct driver_private; | 33 | struct driver_private; |
33 | struct class; | 34 | struct class; |
@@ -65,7 +66,7 @@ struct bus_type { | |||
65 | int (*resume_early)(struct device *dev); | 66 | int (*resume_early)(struct device *dev); |
66 | int (*resume)(struct device *dev); | 67 | int (*resume)(struct device *dev); |
67 | 68 | ||
68 | struct pm_ext_ops *pm; | 69 | struct dev_pm_ops *pm; |
69 | 70 | ||
70 | struct bus_type_private *p; | 71 | struct bus_type_private *p; |
71 | }; | 72 | }; |
@@ -133,7 +134,7 @@ struct device_driver { | |||
133 | int (*resume) (struct device *dev); | 134 | int (*resume) (struct device *dev); |
134 | struct attribute_group **groups; | 135 | struct attribute_group **groups; |
135 | 136 | ||
136 | struct pm_ops *pm; | 137 | struct dev_pm_ops *pm; |
137 | 138 | ||
138 | struct driver_private *p; | 139 | struct driver_private *p; |
139 | }; | 140 | }; |
@@ -198,7 +199,7 @@ struct class { | |||
198 | int (*suspend)(struct device *dev, pm_message_t state); | 199 | int (*suspend)(struct device *dev, pm_message_t state); |
199 | int (*resume)(struct device *dev); | 200 | int (*resume)(struct device *dev); |
200 | 201 | ||
201 | struct pm_ops *pm; | 202 | struct dev_pm_ops *pm; |
202 | struct class_private *p; | 203 | struct class_private *p; |
203 | }; | 204 | }; |
204 | 205 | ||
@@ -291,7 +292,7 @@ struct device_type { | |||
291 | int (*suspend)(struct device *dev, pm_message_t state); | 292 | int (*suspend)(struct device *dev, pm_message_t state); |
292 | int (*resume)(struct device *dev); | 293 | int (*resume)(struct device *dev); |
293 | 294 | ||
294 | struct pm_ops *pm; | 295 | struct dev_pm_ops *pm; |
295 | }; | 296 | }; |
296 | 297 | ||
297 | /* interface for exporting device attributes */ | 298 | /* interface for exporting device attributes */ |
@@ -365,17 +366,15 @@ struct device_dma_parameters { | |||
365 | }; | 366 | }; |
366 | 367 | ||
367 | struct device { | 368 | struct device { |
368 | struct klist klist_children; | ||
369 | struct klist_node knode_parent; /* node in sibling list */ | ||
370 | struct klist_node knode_driver; | ||
371 | struct klist_node knode_bus; | ||
372 | struct device *parent; | 369 | struct device *parent; |
373 | 370 | ||
371 | struct device_private *p; | ||
372 | |||
374 | struct kobject kobj; | 373 | struct kobject kobj; |
375 | char bus_id[BUS_ID_SIZE]; /* position on parent bus */ | 374 | char bus_id[BUS_ID_SIZE]; /* position on parent bus */ |
375 | unsigned uevent_suppress:1; | ||
376 | const char *init_name; /* initial name of the device */ | 376 | const char *init_name; /* initial name of the device */ |
377 | struct device_type *type; | 377 | struct device_type *type; |
378 | unsigned uevent_suppress:1; | ||
379 | 378 | ||
380 | struct semaphore sem; /* semaphore to synchronize calls to | 379 | struct semaphore sem; /* semaphore to synchronize calls to |
381 | * its driver. | 380 | * its driver. |
@@ -408,12 +407,13 @@ struct device { | |||
408 | /* arch specific additions */ | 407 | /* arch specific additions */ |
409 | struct dev_archdata archdata; | 408 | struct dev_archdata archdata; |
410 | 409 | ||
410 | dev_t devt; /* dev_t, creates the sysfs "dev" */ | ||
411 | |||
411 | spinlock_t devres_lock; | 412 | spinlock_t devres_lock; |
412 | struct list_head devres_head; | 413 | struct list_head devres_head; |
413 | 414 | ||
414 | struct klist_node knode_class; | 415 | struct klist_node knode_class; |
415 | struct class *class; | 416 | struct class *class; |
416 | dev_t devt; /* dev_t, creates the sysfs "dev" */ | ||
417 | struct attribute_group **groups; /* optional groups */ | 417 | struct attribute_group **groups; /* optional groups */ |
418 | 418 | ||
419 | void (*release)(struct device *dev); | 419 | void (*release)(struct device *dev); |
@@ -483,6 +483,17 @@ extern int device_rename(struct device *dev, char *new_name); | |||
483 | extern int device_move(struct device *dev, struct device *new_parent); | 483 | extern int device_move(struct device *dev, struct device *new_parent); |
484 | 484 | ||
485 | /* | 485 | /* |
486 | * Root device objects for grouping under /sys/devices | ||
487 | */ | ||
488 | extern struct device *__root_device_register(const char *name, | ||
489 | struct module *owner); | ||
490 | static inline struct device *root_device_register(const char *name) | ||
491 | { | ||
492 | return __root_device_register(name, THIS_MODULE); | ||
493 | } | ||
494 | extern void root_device_unregister(struct device *root); | ||
495 | |||
496 | /* | ||
486 | * Manual binding of a device to driver. See drivers/base/bus.c | 497 | * Manual binding of a device to driver. See drivers/base/bus.c |
487 | * for information on use. | 498 | * for information on use. |
488 | */ | 499 | */ |
@@ -553,13 +564,13 @@ extern const char *dev_driver_string(const struct device *dev); | |||
553 | #define dev_info(dev, format, arg...) \ | 564 | #define dev_info(dev, format, arg...) \ |
554 | dev_printk(KERN_INFO , dev , format , ## arg) | 565 | dev_printk(KERN_INFO , dev , format , ## arg) |
555 | 566 | ||
556 | #if defined(CONFIG_DYNAMIC_PRINTK_DEBUG) | 567 | #if defined(DEBUG) |
568 | #define dev_dbg(dev, format, arg...) \ | ||
569 | dev_printk(KERN_DEBUG , dev , format , ## arg) | ||
570 | #elif defined(CONFIG_DYNAMIC_PRINTK_DEBUG) | ||
557 | #define dev_dbg(dev, format, ...) do { \ | 571 | #define dev_dbg(dev, format, ...) do { \ |
558 | dynamic_dev_dbg(dev, format, ##__VA_ARGS__); \ | 572 | dynamic_dev_dbg(dev, format, ##__VA_ARGS__); \ |
559 | } while (0) | 573 | } while (0) |
560 | #elif defined(DEBUG) | ||
561 | #define dev_dbg(dev, format, arg...) \ | ||
562 | dev_printk(KERN_DEBUG , dev , format , ## arg) | ||
563 | #else | 574 | #else |
564 | #define dev_dbg(dev, format, arg...) \ | 575 | #define dev_dbg(dev, format, arg...) \ |
565 | ({ if (0) dev_printk(KERN_DEBUG, dev, format, ##arg); 0; }) | 576 | ({ if (0) dev_printk(KERN_DEBUG, dev, format, ##arg); 0; }) |
diff --git a/include/linux/dma_remapping.h b/include/linux/dma_remapping.h index 136f170cecc2..af1dab41674b 100644 --- a/include/linux/dma_remapping.h +++ b/include/linux/dma_remapping.h | |||
@@ -17,7 +17,15 @@ struct dmar_domain; | |||
17 | struct root_entry; | 17 | struct root_entry; |
18 | 18 | ||
19 | extern void free_dmar_iommu(struct intel_iommu *iommu); | 19 | extern void free_dmar_iommu(struct intel_iommu *iommu); |
20 | |||
21 | #ifdef CONFIG_DMAR | ||
20 | extern int iommu_calculate_agaw(struct intel_iommu *iommu); | 22 | extern int iommu_calculate_agaw(struct intel_iommu *iommu); |
23 | #else | ||
24 | static inline int iommu_calculate_agaw(struct intel_iommu *iommu) | ||
25 | { | ||
26 | return 0; | ||
27 | } | ||
28 | #endif | ||
21 | 29 | ||
22 | extern int dmar_disabled; | 30 | extern int dmar_disabled; |
23 | 31 | ||
diff --git a/include/linux/dqblk_qtree.h b/include/linux/dqblk_qtree.h new file mode 100644 index 000000000000..82a16527b367 --- /dev/null +++ b/include/linux/dqblk_qtree.h | |||
@@ -0,0 +1,56 @@ | |||
1 | /* | ||
2 | * Definitions of structures and functions for quota formats using trie | ||
3 | */ | ||
4 | |||
5 | #ifndef _LINUX_DQBLK_QTREE_H | ||
6 | #define _LINUX_DQBLK_QTREE_H | ||
7 | |||
8 | #include <linux/types.h> | ||
9 | |||
10 | /* Numbers of blocks needed for updates - we count with the smallest | ||
11 | * possible block size (1024) */ | ||
12 | #define QTREE_INIT_ALLOC 4 | ||
13 | #define QTREE_INIT_REWRITE 2 | ||
14 | #define QTREE_DEL_ALLOC 0 | ||
15 | #define QTREE_DEL_REWRITE 6 | ||
16 | |||
17 | struct dquot; | ||
18 | |||
19 | /* Operations */ | ||
20 | struct qtree_fmt_operations { | ||
21 | void (*mem2disk_dqblk)(void *disk, struct dquot *dquot); /* Convert given entry from in memory format to disk one */ | ||
22 | void (*disk2mem_dqblk)(struct dquot *dquot, void *disk); /* Convert given entry from disk format to in memory one */ | ||
23 | int (*is_id)(void *disk, struct dquot *dquot); /* Is this structure for given id? */ | ||
24 | }; | ||
25 | |||
26 | /* Inmemory copy of version specific information */ | ||
27 | struct qtree_mem_dqinfo { | ||
28 | struct super_block *dqi_sb; /* Sb quota is on */ | ||
29 | int dqi_type; /* Quota type */ | ||
30 | unsigned int dqi_blocks; /* # of blocks in quota file */ | ||
31 | unsigned int dqi_free_blk; /* First block in list of free blocks */ | ||
32 | unsigned int dqi_free_entry; /* First block with free entry */ | ||
33 | unsigned int dqi_blocksize_bits; /* Block size of quota file */ | ||
34 | unsigned int dqi_entry_size; /* Size of quota entry in quota file */ | ||
35 | unsigned int dqi_usable_bs; /* Space usable in block for quota data */ | ||
36 | unsigned int dqi_qtree_depth; /* Precomputed depth of quota tree */ | ||
37 | struct qtree_fmt_operations *dqi_ops; /* Operations for entry manipulation */ | ||
38 | }; | ||
39 | |||
40 | int qtree_write_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot); | ||
41 | int qtree_read_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot); | ||
42 | int qtree_delete_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot); | ||
43 | int qtree_release_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot); | ||
44 | int qtree_entry_unused(struct qtree_mem_dqinfo *info, char *disk); | ||
45 | static inline int qtree_depth(struct qtree_mem_dqinfo *info) | ||
46 | { | ||
47 | unsigned int epb = info->dqi_usable_bs >> 2; | ||
48 | unsigned long long entries = epb; | ||
49 | int i; | ||
50 | |||
51 | for (i = 1; entries < (1ULL << 32); i++) | ||
52 | entries *= epb; | ||
53 | return i; | ||
54 | } | ||
55 | |||
56 | #endif /* _LINUX_DQBLK_QTREE_H */ | ||
diff --git a/include/linux/dqblk_v1.h b/include/linux/dqblk_v1.h index 57f1250d5a52..3713a7232dd8 100644 --- a/include/linux/dqblk_v1.h +++ b/include/linux/dqblk_v1.h | |||
@@ -5,9 +5,6 @@ | |||
5 | #ifndef _LINUX_DQBLK_V1_H | 5 | #ifndef _LINUX_DQBLK_V1_H |
6 | #define _LINUX_DQBLK_V1_H | 6 | #define _LINUX_DQBLK_V1_H |
7 | 7 | ||
8 | /* Id of quota format */ | ||
9 | #define QFMT_VFS_OLD 1 | ||
10 | |||
11 | /* Root squash turned on */ | 8 | /* Root squash turned on */ |
12 | #define V1_DQF_RSQUASH 1 | 9 | #define V1_DQF_RSQUASH 1 |
13 | 10 | ||
@@ -17,8 +14,4 @@ | |||
17 | #define V1_DEL_ALLOC 0 | 14 | #define V1_DEL_ALLOC 0 |
18 | #define V1_DEL_REWRITE 2 | 15 | #define V1_DEL_REWRITE 2 |
19 | 16 | ||
20 | /* Special information about quotafile */ | ||
21 | struct v1_mem_dqinfo { | ||
22 | }; | ||
23 | |||
24 | #endif /* _LINUX_DQBLK_V1_H */ | 17 | #endif /* _LINUX_DQBLK_V1_H */ |
diff --git a/include/linux/dqblk_v2.h b/include/linux/dqblk_v2.h index 4f853322cb7f..18000a542677 100644 --- a/include/linux/dqblk_v2.h +++ b/include/linux/dqblk_v2.h | |||
@@ -1,26 +1,16 @@ | |||
1 | /* | 1 | /* |
2 | * Definitions of structures for vfsv0 quota format | 2 | * Definitions for vfsv0 quota format |
3 | */ | 3 | */ |
4 | 4 | ||
5 | #ifndef _LINUX_DQBLK_V2_H | 5 | #ifndef _LINUX_DQBLK_V2_H |
6 | #define _LINUX_DQBLK_V2_H | 6 | #define _LINUX_DQBLK_V2_H |
7 | 7 | ||
8 | #include <linux/types.h> | 8 | #include <linux/dqblk_qtree.h> |
9 | |||
10 | /* id numbers of quota format */ | ||
11 | #define QFMT_VFS_V0 2 | ||
12 | 9 | ||
13 | /* Numbers of blocks needed for updates */ | 10 | /* Numbers of blocks needed for updates */ |
14 | #define V2_INIT_ALLOC 4 | 11 | #define V2_INIT_ALLOC QTREE_INIT_ALLOC |
15 | #define V2_INIT_REWRITE 2 | 12 | #define V2_INIT_REWRITE QTREE_INIT_REWRITE |
16 | #define V2_DEL_ALLOC 0 | 13 | #define V2_DEL_ALLOC QTREE_DEL_ALLOC |
17 | #define V2_DEL_REWRITE 6 | 14 | #define V2_DEL_REWRITE QTREE_DEL_REWRITE |
18 | |||
19 | /* Inmemory copy of version specific information */ | ||
20 | struct v2_mem_dqinfo { | ||
21 | unsigned int dqi_blocks; | ||
22 | unsigned int dqi_free_blk; | ||
23 | unsigned int dqi_free_entry; | ||
24 | }; | ||
25 | 15 | ||
26 | #endif /* _LINUX_DQBLK_V2_H */ | 16 | #endif /* _LINUX_DQBLK_V2_H */ |
diff --git a/include/linux/fs.h b/include/linux/fs.h index f2a3010140e3..d7eba77f666e 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -1133,7 +1133,6 @@ struct super_block { | |||
1133 | struct rw_semaphore s_umount; | 1133 | struct rw_semaphore s_umount; |
1134 | struct mutex s_lock; | 1134 | struct mutex s_lock; |
1135 | int s_count; | 1135 | int s_count; |
1136 | int s_syncing; | ||
1137 | int s_need_sync_fs; | 1136 | int s_need_sync_fs; |
1138 | atomic_t s_active; | 1137 | atomic_t s_active; |
1139 | #ifdef CONFIG_SECURITY | 1138 | #ifdef CONFIG_SECURITY |
@@ -1830,7 +1829,7 @@ extern int __filemap_fdatawrite_range(struct address_space *mapping, | |||
1830 | extern int filemap_fdatawrite_range(struct address_space *mapping, | 1829 | extern int filemap_fdatawrite_range(struct address_space *mapping, |
1831 | loff_t start, loff_t end); | 1830 | loff_t start, loff_t end); |
1832 | 1831 | ||
1833 | extern long do_fsync(struct file *file, int datasync); | 1832 | extern int vfs_fsync(struct file *file, struct dentry *dentry, int datasync); |
1834 | extern void sync_supers(void); | 1833 | extern void sync_supers(void); |
1835 | extern void sync_filesystems(int wait); | 1834 | extern void sync_filesystems(int wait); |
1836 | extern void __fsync_super(struct super_block *sb); | 1835 | extern void __fsync_super(struct super_block *sb); |
@@ -2059,6 +2058,9 @@ extern int vfs_fstat(unsigned int, struct kstat *); | |||
2059 | 2058 | ||
2060 | extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, | 2059 | extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, |
2061 | unsigned long arg); | 2060 | unsigned long arg); |
2061 | extern int __generic_block_fiemap(struct inode *inode, | ||
2062 | struct fiemap_extent_info *fieinfo, u64 start, | ||
2063 | u64 len, get_block_t *get_block); | ||
2062 | extern int generic_block_fiemap(struct inode *inode, | 2064 | extern int generic_block_fiemap(struct inode *inode, |
2063 | struct fiemap_extent_info *fieinfo, u64 start, | 2065 | struct fiemap_extent_info *fieinfo, u64 start, |
2064 | u64 len, get_block_t *get_block); | 2066 | u64 len, get_block_t *get_block); |
diff --git a/include/linux/fuse.h b/include/linux/fuse.h index 350fe9767bbc..162e5defe683 100644 --- a/include/linux/fuse.h +++ b/include/linux/fuse.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | FUSE: Filesystem in Userspace | 2 | FUSE: Filesystem in Userspace |
3 | Copyright (C) 2001-2006 Miklos Szeredi <miklos@szeredi.hu> | 3 | Copyright (C) 2001-2008 Miklos Szeredi <miklos@szeredi.hu> |
4 | 4 | ||
5 | This program can be distributed under the terms of the GNU GPL. | 5 | This program can be distributed under the terms of the GNU GPL. |
6 | See the file COPYING. | 6 | See the file COPYING. |
@@ -20,29 +20,27 @@ | |||
20 | * | 20 | * |
21 | * 7.10 | 21 | * 7.10 |
22 | * - add nonseekable open flag | 22 | * - add nonseekable open flag |
23 | * | ||
24 | * 7.11 | ||
25 | * - add IOCTL message | ||
26 | * - add unsolicited notification support | ||
27 | * - add POLL message and NOTIFY_POLL notification | ||
23 | */ | 28 | */ |
24 | 29 | ||
25 | #ifndef _LINUX_FUSE_H | 30 | #ifndef _LINUX_FUSE_H |
26 | #define _LINUX_FUSE_H | 31 | #define _LINUX_FUSE_H |
27 | 32 | ||
28 | #include <asm/types.h> | 33 | #include <linux/types.h> |
29 | #include <linux/major.h> | ||
30 | 34 | ||
31 | /** Version number of this interface */ | 35 | /** Version number of this interface */ |
32 | #define FUSE_KERNEL_VERSION 7 | 36 | #define FUSE_KERNEL_VERSION 7 |
33 | 37 | ||
34 | /** Minor version number of this interface */ | 38 | /** Minor version number of this interface */ |
35 | #define FUSE_KERNEL_MINOR_VERSION 10 | 39 | #define FUSE_KERNEL_MINOR_VERSION 11 |
36 | 40 | ||
37 | /** The node ID of the root inode */ | 41 | /** The node ID of the root inode */ |
38 | #define FUSE_ROOT_ID 1 | 42 | #define FUSE_ROOT_ID 1 |
39 | 43 | ||
40 | /** The major number of the fuse character device */ | ||
41 | #define FUSE_MAJOR MISC_MAJOR | ||
42 | |||
43 | /** The minor number of the fuse character device */ | ||
44 | #define FUSE_MINOR 229 | ||
45 | |||
46 | /* Make sure all structures are padded to 64bit boundary, so 32bit | 44 | /* Make sure all structures are padded to 64bit boundary, so 32bit |
47 | userspace works under 64bit kernels */ | 45 | userspace works under 64bit kernels */ |
48 | 46 | ||
@@ -151,6 +149,28 @@ struct fuse_file_lock { | |||
151 | */ | 149 | */ |
152 | #define FUSE_READ_LOCKOWNER (1 << 1) | 150 | #define FUSE_READ_LOCKOWNER (1 << 1) |
153 | 151 | ||
152 | /** | ||
153 | * Ioctl flags | ||
154 | * | ||
155 | * FUSE_IOCTL_COMPAT: 32bit compat ioctl on 64bit machine | ||
156 | * FUSE_IOCTL_UNRESTRICTED: not restricted to well-formed ioctls, retry allowed | ||
157 | * FUSE_IOCTL_RETRY: retry with new iovecs | ||
158 | * | ||
159 | * FUSE_IOCTL_MAX_IOV: maximum of in_iovecs + out_iovecs | ||
160 | */ | ||
161 | #define FUSE_IOCTL_COMPAT (1 << 0) | ||
162 | #define FUSE_IOCTL_UNRESTRICTED (1 << 1) | ||
163 | #define FUSE_IOCTL_RETRY (1 << 2) | ||
164 | |||
165 | #define FUSE_IOCTL_MAX_IOV 256 | ||
166 | |||
167 | /** | ||
168 | * Poll flags | ||
169 | * | ||
170 | * FUSE_POLL_SCHEDULE_NOTIFY: request poll notify | ||
171 | */ | ||
172 | #define FUSE_POLL_SCHEDULE_NOTIFY (1 << 0) | ||
173 | |||
154 | enum fuse_opcode { | 174 | enum fuse_opcode { |
155 | FUSE_LOOKUP = 1, | 175 | FUSE_LOOKUP = 1, |
156 | FUSE_FORGET = 2, /* no reply */ | 176 | FUSE_FORGET = 2, /* no reply */ |
@@ -188,6 +208,13 @@ enum fuse_opcode { | |||
188 | FUSE_INTERRUPT = 36, | 208 | FUSE_INTERRUPT = 36, |
189 | FUSE_BMAP = 37, | 209 | FUSE_BMAP = 37, |
190 | FUSE_DESTROY = 38, | 210 | FUSE_DESTROY = 38, |
211 | FUSE_IOCTL = 39, | ||
212 | FUSE_POLL = 40, | ||
213 | }; | ||
214 | |||
215 | enum fuse_notify_code { | ||
216 | FUSE_NOTIFY_POLL = 1, | ||
217 | FUSE_NOTIFY_CODE_MAX, | ||
191 | }; | 218 | }; |
192 | 219 | ||
193 | /* The read buffer is required to be at least 8k, but may be much larger */ | 220 | /* The read buffer is required to be at least 8k, but may be much larger */ |
@@ -388,6 +415,38 @@ struct fuse_bmap_out { | |||
388 | __u64 block; | 415 | __u64 block; |
389 | }; | 416 | }; |
390 | 417 | ||
418 | struct fuse_ioctl_in { | ||
419 | __u64 fh; | ||
420 | __u32 flags; | ||
421 | __u32 cmd; | ||
422 | __u64 arg; | ||
423 | __u32 in_size; | ||
424 | __u32 out_size; | ||
425 | }; | ||
426 | |||
427 | struct fuse_ioctl_out { | ||
428 | __s32 result; | ||
429 | __u32 flags; | ||
430 | __u32 in_iovs; | ||
431 | __u32 out_iovs; | ||
432 | }; | ||
433 | |||
434 | struct fuse_poll_in { | ||
435 | __u64 fh; | ||
436 | __u64 kh; | ||
437 | __u32 flags; | ||
438 | __u32 padding; | ||
439 | }; | ||
440 | |||
441 | struct fuse_poll_out { | ||
442 | __u32 revents; | ||
443 | __u32 padding; | ||
444 | }; | ||
445 | |||
446 | struct fuse_notify_poll_wakeup_out { | ||
447 | __u64 kh; | ||
448 | }; | ||
449 | |||
391 | struct fuse_in_header { | 450 | struct fuse_in_header { |
392 | __u32 len; | 451 | __u32 len; |
393 | __u32 opcode; | 452 | __u32 opcode; |
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index e8003afeffba..dd20cd78faa8 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -69,12 +69,6 @@ struct vm_area_struct; | |||
69 | #define GFP_HIGHUSER_MOVABLE (__GFP_WAIT | __GFP_IO | __GFP_FS | \ | 69 | #define GFP_HIGHUSER_MOVABLE (__GFP_WAIT | __GFP_IO | __GFP_FS | \ |
70 | __GFP_HARDWALL | __GFP_HIGHMEM | \ | 70 | __GFP_HARDWALL | __GFP_HIGHMEM | \ |
71 | __GFP_MOVABLE) | 71 | __GFP_MOVABLE) |
72 | #define GFP_NOFS_PAGECACHE (__GFP_WAIT | __GFP_IO | __GFP_MOVABLE) | ||
73 | #define GFP_USER_PAGECACHE (__GFP_WAIT | __GFP_IO | __GFP_FS | \ | ||
74 | __GFP_HARDWALL | __GFP_MOVABLE) | ||
75 | #define GFP_HIGHUSER_PAGECACHE (__GFP_WAIT | __GFP_IO | __GFP_FS | \ | ||
76 | __GFP_HARDWALL | __GFP_HIGHMEM | \ | ||
77 | __GFP_MOVABLE) | ||
78 | 72 | ||
79 | #ifdef CONFIG_NUMA | 73 | #ifdef CONFIG_NUMA |
80 | #define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY) | 74 | #define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY) |
diff --git a/include/linux/hid.h b/include/linux/hid.h index e5780f8c934a..81aa84d60c6b 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
@@ -403,15 +403,6 @@ struct hid_output_fifo { | |||
403 | #define HID_STAT_ADDED 1 | 403 | #define HID_STAT_ADDED 1 |
404 | #define HID_STAT_PARSED 2 | 404 | #define HID_STAT_PARSED 2 |
405 | 405 | ||
406 | #define HID_CTRL_RUNNING 1 | ||
407 | #define HID_OUT_RUNNING 2 | ||
408 | #define HID_IN_RUNNING 3 | ||
409 | #define HID_RESET_PENDING 4 | ||
410 | #define HID_SUSPENDED 5 | ||
411 | #define HID_CLEAR_HALT 6 | ||
412 | #define HID_DISCONNECTED 7 | ||
413 | #define HID_STARTED 8 | ||
414 | |||
415 | struct hid_input { | 406 | struct hid_input { |
416 | struct list_head list; | 407 | struct list_head list; |
417 | struct hid_report *report; | 408 | struct hid_report *report; |
@@ -540,6 +531,8 @@ struct hid_usage_id { | |||
540 | * @name: driver name (e.g. "Footech_bar-wheel") | 531 | * @name: driver name (e.g. "Footech_bar-wheel") |
541 | * @id_table: which devices is this driver for (must be non-NULL for probe | 532 | * @id_table: which devices is this driver for (must be non-NULL for probe |
542 | * to be called) | 533 | * to be called) |
534 | * @dyn_list: list of dynamically added device ids | ||
535 | * @dyn_lock: lock protecting @dyn_list | ||
543 | * @probe: new device inserted | 536 | * @probe: new device inserted |
544 | * @remove: device removed (NULL if not a hot-plug capable driver) | 537 | * @remove: device removed (NULL if not a hot-plug capable driver) |
545 | * @report_table: on which reports to call raw_event (NULL means all) | 538 | * @report_table: on which reports to call raw_event (NULL means all) |
@@ -567,6 +560,9 @@ struct hid_driver { | |||
567 | char *name; | 560 | char *name; |
568 | const struct hid_device_id *id_table; | 561 | const struct hid_device_id *id_table; |
569 | 562 | ||
563 | struct list_head dyn_list; | ||
564 | spinlock_t dyn_lock; | ||
565 | |||
570 | int (*probe)(struct hid_device *dev, const struct hid_device_id *id); | 566 | int (*probe)(struct hid_device *dev, const struct hid_device_id *id); |
571 | void (*remove)(struct hid_device *dev); | 567 | void (*remove)(struct hid_device *dev); |
572 | 568 | ||
@@ -797,6 +793,8 @@ dbg_hid(const char *fmt, ...) | |||
797 | 793 | ||
798 | #ifdef CONFIG_HID_COMPAT | 794 | #ifdef CONFIG_HID_COMPAT |
799 | #define HID_COMPAT_LOAD_DRIVER(name) \ | 795 | #define HID_COMPAT_LOAD_DRIVER(name) \ |
796 | /* prototype to avoid sparse warning */ \ | ||
797 | extern void hid_compat_##name(void); \ | ||
800 | void hid_compat_##name(void) { } \ | 798 | void hid_compat_##name(void) { } \ |
801 | EXPORT_SYMBOL(hid_compat_##name) | 799 | EXPORT_SYMBOL(hid_compat_##name) |
802 | #else | 800 | #else |
diff --git a/include/linux/hidraw.h b/include/linux/hidraw.h index dbb5c8c374f0..dd8d69269176 100644 --- a/include/linux/hidraw.h +++ b/include/linux/hidraw.h | |||
@@ -33,6 +33,8 @@ struct hidraw_devinfo { | |||
33 | #define HIDIOCGRDESCSIZE _IOR('H', 0x01, int) | 33 | #define HIDIOCGRDESCSIZE _IOR('H', 0x01, int) |
34 | #define HIDIOCGRDESC _IOR('H', 0x02, struct hidraw_report_descriptor) | 34 | #define HIDIOCGRDESC _IOR('H', 0x02, struct hidraw_report_descriptor) |
35 | #define HIDIOCGRAWINFO _IOR('H', 0x03, struct hidraw_devinfo) | 35 | #define HIDIOCGRAWINFO _IOR('H', 0x03, struct hidraw_devinfo) |
36 | #define HIDIOCGRAWNAME(len) _IOC(_IOC_READ, 'H', 0x04, len) | ||
37 | #define HIDIOCGRAWPHYS(len) _IOC(_IOC_READ, 'H', 0x05, len) | ||
36 | 38 | ||
37 | #define HIDRAW_FIRST_MINOR 0 | 39 | #define HIDRAW_FIRST_MINOR 0 |
38 | #define HIDRAW_MAX_DEVICES 64 | 40 | #define HIDRAW_MAX_DEVICES 64 |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index e1c8afc002c0..f1d2fba19ea0 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -233,6 +233,10 @@ static inline unsigned long huge_page_size(struct hstate *h) | |||
233 | return (unsigned long)PAGE_SIZE << h->order; | 233 | return (unsigned long)PAGE_SIZE << h->order; |
234 | } | 234 | } |
235 | 235 | ||
236 | extern unsigned long vma_kernel_pagesize(struct vm_area_struct *vma); | ||
237 | |||
238 | extern unsigned long vma_mmu_pagesize(struct vm_area_struct *vma); | ||
239 | |||
236 | static inline unsigned long huge_page_mask(struct hstate *h) | 240 | static inline unsigned long huge_page_mask(struct hstate *h) |
237 | { | 241 | { |
238 | return h->mask; | 242 | return h->mask; |
@@ -273,6 +277,8 @@ struct hstate {}; | |||
273 | #define hstate_inode(i) NULL | 277 | #define hstate_inode(i) NULL |
274 | #define huge_page_size(h) PAGE_SIZE | 278 | #define huge_page_size(h) PAGE_SIZE |
275 | #define huge_page_mask(h) PAGE_MASK | 279 | #define huge_page_mask(h) PAGE_MASK |
280 | #define vma_kernel_pagesize(v) PAGE_SIZE | ||
281 | #define vma_mmu_pagesize(v) PAGE_SIZE | ||
276 | #define huge_page_order(h) 0 | 282 | #define huge_page_order(h) 0 |
277 | #define huge_page_shift(h) PAGE_SHIFT | 283 | #define huge_page_shift(h) PAGE_SHIFT |
278 | static inline unsigned int pages_per_huge_page(struct hstate *h) | 284 | static inline unsigned int pages_per_huge_page(struct hstate *h) |
diff --git a/include/linux/i2c/dm355evm_msp.h b/include/linux/i2c/dm355evm_msp.h new file mode 100644 index 000000000000..372470350fab --- /dev/null +++ b/include/linux/i2c/dm355evm_msp.h | |||
@@ -0,0 +1,79 @@ | |||
1 | /* | ||
2 | * dm355evm_msp.h - support MSP430 microcontroller on DM355EVM board | ||
3 | */ | ||
4 | #ifndef __LINUX_I2C_DM355EVM_MSP | ||
5 | #define __LINUX_I2C_DM355EVM_MSP | ||
6 | |||
7 | /* | ||
8 | * Written against Spectrum's writeup for the A4 firmware revision, | ||
9 | * and tweaked to match source and rev D2 schematics by removing CPLD | ||
10 | * and NOR flash hooks (which were last appropriate in rev B boards). | ||
11 | * | ||
12 | * Note that the firmware supports a flavor of write posting ... to be | ||
13 | * sure a write completes, issue another read or write. | ||
14 | */ | ||
15 | |||
16 | /* utilities to access "registers" emulated by msp430 firmware */ | ||
17 | extern int dm355evm_msp_write(u8 value, u8 reg); | ||
18 | extern int dm355evm_msp_read(u8 reg); | ||
19 | |||
20 | |||
21 | /* command/control registers */ | ||
22 | #define DM355EVM_MSP_COMMAND 0x00 | ||
23 | # define MSP_COMMAND_NULL 0 | ||
24 | # define MSP_COMMAND_RESET_COLD 1 | ||
25 | # define MSP_COMMAND_RESET_WARM 2 | ||
26 | # define MSP_COMMAND_RESET_WARM_I 3 | ||
27 | # define MSP_COMMAND_POWEROFF 4 | ||
28 | # define MSP_COMMAND_IR_REINIT 5 | ||
29 | #define DM355EVM_MSP_STATUS 0x01 | ||
30 | # define MSP_STATUS_BAD_OFFSET BIT(0) | ||
31 | # define MSP_STATUS_BAD_COMMAND BIT(1) | ||
32 | # define MSP_STATUS_POWER_ERROR BIT(2) | ||
33 | # define MSP_STATUS_RXBUF_OVERRUN BIT(3) | ||
34 | #define DM355EVM_MSP_RESET 0x02 /* 0 bits == in reset */ | ||
35 | # define MSP_RESET_DC5 BIT(0) | ||
36 | # define MSP_RESET_TVP5154 BIT(2) | ||
37 | # define MSP_RESET_IMAGER BIT(3) | ||
38 | # define MSP_RESET_ETHERNET BIT(4) | ||
39 | # define MSP_RESET_SYS BIT(5) | ||
40 | # define MSP_RESET_AIC33 BIT(7) | ||
41 | |||
42 | /* GPIO registers ... bit patterns mostly match the source MSP ports */ | ||
43 | #define DM355EVM_MSP_LED 0x03 /* active low (MSP P4) */ | ||
44 | #define DM355EVM_MSP_SWITCH1 0x04 /* (MSP P5, masked) */ | ||
45 | # define MSP_SWITCH1_SW6_1 BIT(0) | ||
46 | # define MSP_SWITCH1_SW6_2 BIT(1) | ||
47 | # define MSP_SWITCH1_SW6_3 BIT(2) | ||
48 | # define MSP_SWITCH1_SW6_4 BIT(3) | ||
49 | # define MSP_SWITCH1_J1 BIT(4) /* NTSC/PAL */ | ||
50 | # define MSP_SWITCH1_MSP_INT BIT(5) /* active low */ | ||
51 | #define DM355EVM_MSP_SWITCH2 0x05 /* (MSP P6, masked) */ | ||
52 | # define MSP_SWITCH2_SW10 BIT(3) | ||
53 | # define MSP_SWITCH2_SW11 BIT(4) | ||
54 | # define MSP_SWITCH2_SW12 BIT(5) | ||
55 | # define MSP_SWITCH2_SW13 BIT(6) | ||
56 | # define MSP_SWITCH2_SW14 BIT(7) | ||
57 | #define DM355EVM_MSP_SDMMC 0x06 /* (MSP P2, masked) */ | ||
58 | # define MSP_SDMMC_0_WP BIT(1) | ||
59 | # define MSP_SDMMC_0_CD BIT(2) /* active low */ | ||
60 | # define MSP_SDMMC_1_WP BIT(3) | ||
61 | # define MSP_SDMMC_1_CD BIT(4) /* active low */ | ||
62 | #define DM355EVM_MSP_FIRMREV 0x07 /* not a GPIO (out of order) */ | ||
63 | #define DM355EVM_MSP_VIDEO_IN 0x08 /* (MSP P3, masked) */ | ||
64 | # define MSP_VIDEO_IMAGER BIT(7) /* low == tvp5146 */ | ||
65 | |||
66 | /* power supply registers are currently omitted */ | ||
67 | |||
68 | /* RTC registers */ | ||
69 | #define DM355EVM_MSP_RTC_0 0x12 /* LSB */ | ||
70 | #define DM355EVM_MSP_RTC_1 0x13 | ||
71 | #define DM355EVM_MSP_RTC_2 0x14 | ||
72 | #define DM355EVM_MSP_RTC_3 0x15 /* MSB */ | ||
73 | |||
74 | /* input event queue registers; code == ((HIGH << 8) | LOW) */ | ||
75 | #define DM355EVM_MSP_INPUT_COUNT 0x16 /* decrement by reading LOW */ | ||
76 | #define DM355EVM_MSP_INPUT_HIGH 0x17 | ||
77 | #define DM355EVM_MSP_INPUT_LOW 0x18 | ||
78 | |||
79 | #endif /* __LINUX_I2C_DM355EVM_MSP */ | ||
diff --git a/include/linux/i2c/twl4030.h b/include/linux/i2c/twl4030.h index fb604dcd38f1..8137f660a5cc 100644 --- a/include/linux/i2c/twl4030.h +++ b/include/linux/i2c/twl4030.h | |||
@@ -78,8 +78,8 @@ int twl4030_i2c_read_u8(u8 mod_no, u8 *val, u8 reg); | |||
78 | * IMPORTANT: For twl4030_i2c_write(), allocate num_bytes + 1 | 78 | * IMPORTANT: For twl4030_i2c_write(), allocate num_bytes + 1 |
79 | * for the value, and populate your data starting at offset 1. | 79 | * for the value, and populate your data starting at offset 1. |
80 | */ | 80 | */ |
81 | int twl4030_i2c_write(u8 mod_no, u8 *value, u8 reg, u8 num_bytes); | 81 | int twl4030_i2c_write(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); |
82 | int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, u8 num_bytes); | 82 | int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); |
83 | 83 | ||
84 | /*----------------------------------------------------------------------*/ | 84 | /*----------------------------------------------------------------------*/ |
85 | 85 | ||
@@ -234,6 +234,9 @@ struct twl4030_gpio_platform_data { | |||
234 | /* gpio-n should control VMMC(n+1) if BIT(n) in mmc_cd is set */ | 234 | /* gpio-n should control VMMC(n+1) if BIT(n) in mmc_cd is set */ |
235 | u8 mmc_cd; | 235 | u8 mmc_cd; |
236 | 236 | ||
237 | /* if BIT(N) is set, or VMMC(n+1) is linked, debounce GPIO-N */ | ||
238 | u32 debounce; | ||
239 | |||
237 | /* For gpio-N, bit (1 << N) in "pullups" is set if that pullup | 240 | /* For gpio-N, bit (1 << N) in "pullups" is set if that pullup |
238 | * should be enabled. Else, if that bit is set in "pulldowns", | 241 | * should be enabled. Else, if that bit is set in "pulldowns", |
239 | * that pulldown is enabled. Don't waste power by letting any | 242 | * that pulldown is enabled. Don't waste power by letting any |
@@ -278,6 +281,18 @@ struct twl4030_platform_data { | |||
278 | struct twl4030_keypad_data *keypad; | 281 | struct twl4030_keypad_data *keypad; |
279 | struct twl4030_usb_data *usb; | 282 | struct twl4030_usb_data *usb; |
280 | 283 | ||
284 | /* LDO regulators */ | ||
285 | struct regulator_init_data *vdac; | ||
286 | struct regulator_init_data *vpll1; | ||
287 | struct regulator_init_data *vpll2; | ||
288 | struct regulator_init_data *vmmc1; | ||
289 | struct regulator_init_data *vmmc2; | ||
290 | struct regulator_init_data *vsim; | ||
291 | struct regulator_init_data *vaux1; | ||
292 | struct regulator_init_data *vaux2; | ||
293 | struct regulator_init_data *vaux3; | ||
294 | struct regulator_init_data *vaux4; | ||
295 | |||
281 | /* REVISIT more to come ... _nothing_ should be hard-wired */ | 296 | /* REVISIT more to come ... _nothing_ should be hard-wired */ |
282 | }; | 297 | }; |
283 | 298 | ||
@@ -285,33 +300,6 @@ struct twl4030_platform_data { | |||
285 | 300 | ||
286 | int twl4030_sih_setup(int module); | 301 | int twl4030_sih_setup(int module); |
287 | 302 | ||
288 | /* | ||
289 | * FIXME completely stop using TWL4030_IRQ_BASE ... instead, pass the | ||
290 | * IRQ data to subsidiary devices using platform device resources. | ||
291 | */ | ||
292 | |||
293 | /* IRQ information-need base */ | ||
294 | #include <mach/irqs.h> | ||
295 | /* TWL4030 interrupts */ | ||
296 | |||
297 | /* #define TWL4030_MODIRQ_GPIO (TWL4030_IRQ_BASE + 0) */ | ||
298 | #define TWL4030_MODIRQ_KEYPAD (TWL4030_IRQ_BASE + 1) | ||
299 | #define TWL4030_MODIRQ_BCI (TWL4030_IRQ_BASE + 2) | ||
300 | #define TWL4030_MODIRQ_MADC (TWL4030_IRQ_BASE + 3) | ||
301 | /* #define TWL4030_MODIRQ_USB (TWL4030_IRQ_BASE + 4) */ | ||
302 | /* #define TWL4030_MODIRQ_PWR (TWL4030_IRQ_BASE + 5) */ | ||
303 | |||
304 | #define TWL4030_PWRIRQ_PWRBTN (TWL4030_PWR_IRQ_BASE + 0) | ||
305 | /* #define TWL4030_PWRIRQ_CHG_PRES (TWL4030_PWR_IRQ_BASE + 1) */ | ||
306 | /* #define TWL4030_PWRIRQ_USB_PRES (TWL4030_PWR_IRQ_BASE + 2) */ | ||
307 | /* #define TWL4030_PWRIRQ_RTC (TWL4030_PWR_IRQ_BASE + 3) */ | ||
308 | /* #define TWL4030_PWRIRQ_HOT_DIE (TWL4030_PWR_IRQ_BASE + 4) */ | ||
309 | /* #define TWL4030_PWRIRQ_PWROK_TIMEOUT (TWL4030_PWR_IRQ_BASE + 5) */ | ||
310 | /* #define TWL4030_PWRIRQ_MBCHG (TWL4030_PWR_IRQ_BASE + 6) */ | ||
311 | /* #define TWL4030_PWRIRQ_SC_DETECT (TWL4030_PWR_IRQ_BASE + 7) */ | ||
312 | |||
313 | /* Rest are unsued currently*/ | ||
314 | |||
315 | /* Offsets to Power Registers */ | 303 | /* Offsets to Power Registers */ |
316 | #define TWL4030_VDAC_DEV_GRP 0x3B | 304 | #define TWL4030_VDAC_DEV_GRP 0x3B |
317 | #define TWL4030_VDAC_DEDICATED 0x3E | 305 | #define TWL4030_VDAC_DEDICATED 0x3E |
@@ -322,16 +310,6 @@ int twl4030_sih_setup(int module); | |||
322 | #define TWL4030_VAUX3_DEV_GRP 0x1F | 310 | #define TWL4030_VAUX3_DEV_GRP 0x1F |
323 | #define TWL4030_VAUX3_DEDICATED 0x22 | 311 | #define TWL4030_VAUX3_DEDICATED 0x22 |
324 | 312 | ||
325 | /* TWL4030 GPIO interrupt definitions */ | ||
326 | |||
327 | #define TWL4030_GPIO_IRQ_NO(n) (TWL4030_GPIO_IRQ_BASE + (n)) | ||
328 | |||
329 | /* | ||
330 | * Exported TWL4030 GPIO APIs | ||
331 | * | ||
332 | * WARNING -- use standard GPIO and IRQ calls instead; these will vanish. | ||
333 | */ | ||
334 | int twl4030_set_gpio_debounce(int gpio, int enable); | ||
335 | 313 | ||
336 | #if defined(CONFIG_TWL4030_BCI_BATTERY) || \ | 314 | #if defined(CONFIG_TWL4030_BCI_BATTERY) || \ |
337 | defined(CONFIG_TWL4030_BCI_BATTERY_MODULE) | 315 | defined(CONFIG_TWL4030_BCI_BATTERY_MODULE) |
@@ -340,4 +318,38 @@ int twl4030_set_gpio_debounce(int gpio, int enable); | |||
340 | static inline int twl4030charger_usb_en(int enable) { return 0; } | 318 | static inline int twl4030charger_usb_en(int enable) { return 0; } |
341 | #endif | 319 | #endif |
342 | 320 | ||
321 | /*----------------------------------------------------------------------*/ | ||
322 | |||
323 | /* Linux-specific regulator identifiers ... for now, we only support | ||
324 | * the LDOs, and leave the three buck converters alone. VDD1 and VDD2 | ||
325 | * need to tie into hardware based voltage scaling (cpufreq etc), while | ||
326 | * VIO is generally fixed. | ||
327 | */ | ||
328 | |||
329 | /* EXTERNAL dc-to-dc buck converters */ | ||
330 | #define TWL4030_REG_VDD1 0 | ||
331 | #define TWL4030_REG_VDD2 1 | ||
332 | #define TWL4030_REG_VIO 2 | ||
333 | |||
334 | /* EXTERNAL LDOs */ | ||
335 | #define TWL4030_REG_VDAC 3 | ||
336 | #define TWL4030_REG_VPLL1 4 | ||
337 | #define TWL4030_REG_VPLL2 5 /* not on all chips */ | ||
338 | #define TWL4030_REG_VMMC1 6 | ||
339 | #define TWL4030_REG_VMMC2 7 /* not on all chips */ | ||
340 | #define TWL4030_REG_VSIM 8 /* not on all chips */ | ||
341 | #define TWL4030_REG_VAUX1 9 /* not on all chips */ | ||
342 | #define TWL4030_REG_VAUX2_4030 10 /* (twl4030-specific) */ | ||
343 | #define TWL4030_REG_VAUX2 11 /* (twl5030 and newer) */ | ||
344 | #define TWL4030_REG_VAUX3 12 /* not on all chips */ | ||
345 | #define TWL4030_REG_VAUX4 13 /* not on all chips */ | ||
346 | |||
347 | /* INTERNAL LDOs */ | ||
348 | #define TWL4030_REG_VINTANA1 14 | ||
349 | #define TWL4030_REG_VINTANA2 15 | ||
350 | #define TWL4030_REG_VINTDIG 16 | ||
351 | #define TWL4030_REG_VUSB1V5 17 | ||
352 | #define TWL4030_REG_VUSB1V8 18 | ||
353 | #define TWL4030_REG_VUSB3V1 19 | ||
354 | |||
343 | #endif /* End of __TWL4030_H */ | 355 | #endif /* End of __TWL4030_H */ |
diff --git a/include/linux/ide.h b/include/linux/ide.h index db5ef8ae1ab9..3644f6323384 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -32,18 +32,14 @@ | |||
32 | # define SUPPORT_VLB_SYNC 1 | 32 | # define SUPPORT_VLB_SYNC 1 |
33 | #endif | 33 | #endif |
34 | 34 | ||
35 | typedef unsigned char byte; /* used everywhere */ | ||
36 | |||
37 | /* | 35 | /* |
38 | * Probably not wise to fiddle with these | 36 | * Probably not wise to fiddle with these |
39 | */ | 37 | */ |
38 | #define IDE_DEFAULT_MAX_FAILURES 1 | ||
40 | #define ERROR_MAX 8 /* Max read/write errors per sector */ | 39 | #define ERROR_MAX 8 /* Max read/write errors per sector */ |
41 | #define ERROR_RESET 3 /* Reset controller every 4th retry */ | 40 | #define ERROR_RESET 3 /* Reset controller every 4th retry */ |
42 | #define ERROR_RECAL 1 /* Recalibrate every 2nd retry */ | 41 | #define ERROR_RECAL 1 /* Recalibrate every 2nd retry */ |
43 | 42 | ||
44 | #define HWIF(drive) ((ide_hwif_t *)((drive)->hwif)) | ||
45 | #define HWGROUP(drive) ((ide_hwgroup_t *)(HWIF(drive)->hwgroup)) | ||
46 | |||
47 | /* | 43 | /* |
48 | * Definitions for accessing IDE controller registers | 44 | * Definitions for accessing IDE controller registers |
49 | */ | 45 | */ |
@@ -185,9 +181,6 @@ typedef struct hw_regs_s { | |||
185 | unsigned long config; | 181 | unsigned long config; |
186 | } hw_regs_t; | 182 | } hw_regs_t; |
187 | 183 | ||
188 | void ide_init_port_data(struct hwif_s *, unsigned int); | ||
189 | void ide_init_port_hw(struct hwif_s *, hw_regs_t *); | ||
190 | |||
191 | static inline void ide_std_init_ports(hw_regs_t *hw, | 184 | static inline void ide_std_init_ports(hw_regs_t *hw, |
192 | unsigned long io_addr, | 185 | unsigned long io_addr, |
193 | unsigned long ctl_addr) | 186 | unsigned long ctl_addr) |
@@ -433,18 +426,14 @@ struct ide_atapi_pc { | |||
433 | struct idetape_bh *bh; | 426 | struct idetape_bh *bh; |
434 | char *b_data; | 427 | char *b_data; |
435 | 428 | ||
436 | /* idescsi only for now */ | ||
437 | struct scatterlist *sg; | 429 | struct scatterlist *sg; |
438 | unsigned int sg_cnt; | 430 | unsigned int sg_cnt; |
439 | 431 | ||
440 | struct scsi_cmnd *scsi_cmd; | ||
441 | void (*done) (struct scsi_cmnd *); | ||
442 | |||
443 | unsigned long timeout; | 432 | unsigned long timeout; |
444 | }; | 433 | }; |
445 | 434 | ||
446 | struct ide_devset; | 435 | struct ide_devset; |
447 | struct ide_driver_s; | 436 | struct ide_driver; |
448 | 437 | ||
449 | #ifdef CONFIG_BLK_DEV_IDEACPI | 438 | #ifdef CONFIG_BLK_DEV_IDEACPI |
450 | struct ide_acpi_drive_link; | 439 | struct ide_acpi_drive_link; |
@@ -588,7 +577,6 @@ struct ide_drive_s { | |||
588 | struct request_queue *queue; /* request queue */ | 577 | struct request_queue *queue; /* request queue */ |
589 | 578 | ||
590 | struct request *rq; /* current request */ | 579 | struct request *rq; /* current request */ |
591 | struct ide_drive_s *next; /* circular list of hwgroup drives */ | ||
592 | void *driver_data; /* extra driver data */ | 580 | void *driver_data; /* extra driver data */ |
593 | u16 *id; /* identification info */ | 581 | u16 *id; /* identification info */ |
594 | #ifdef CONFIG_IDE_PROC_FS | 582 | #ifdef CONFIG_IDE_PROC_FS |
@@ -662,6 +650,8 @@ struct ide_drive_s { | |||
662 | int (*pc_io_buffers)(struct ide_drive_s *, struct ide_atapi_pc *, | 650 | int (*pc_io_buffers)(struct ide_drive_s *, struct ide_atapi_pc *, |
663 | unsigned int, int); | 651 | unsigned int, int); |
664 | 652 | ||
653 | ide_startstop_t (*irq_handler)(struct ide_drive_s *); | ||
654 | |||
665 | unsigned long atapi_flags; | 655 | unsigned long atapi_flags; |
666 | 656 | ||
667 | struct ide_atapi_pc request_sense_pc; | 657 | struct ide_atapi_pc request_sense_pc; |
@@ -684,7 +674,6 @@ struct ide_tp_ops { | |||
684 | void (*exec_command)(struct hwif_s *, u8); | 674 | void (*exec_command)(struct hwif_s *, u8); |
685 | u8 (*read_status)(struct hwif_s *); | 675 | u8 (*read_status)(struct hwif_s *); |
686 | u8 (*read_altstatus)(struct hwif_s *); | 676 | u8 (*read_altstatus)(struct hwif_s *); |
687 | u8 (*read_sff_dma_status)(struct hwif_s *); | ||
688 | 677 | ||
689 | void (*set_irq)(struct hwif_s *, int); | 678 | void (*set_irq)(struct hwif_s *, int); |
690 | 679 | ||
@@ -745,14 +734,17 @@ struct ide_dma_ops { | |||
745 | int (*dma_test_irq)(struct ide_drive_s *); | 734 | int (*dma_test_irq)(struct ide_drive_s *); |
746 | void (*dma_lost_irq)(struct ide_drive_s *); | 735 | void (*dma_lost_irq)(struct ide_drive_s *); |
747 | void (*dma_timeout)(struct ide_drive_s *); | 736 | void (*dma_timeout)(struct ide_drive_s *); |
737 | /* | ||
738 | * The following method is optional and only required to be | ||
739 | * implemented for the SFF-8038i compatible controllers. | ||
740 | */ | ||
741 | u8 (*dma_sff_read_status)(struct hwif_s *); | ||
748 | }; | 742 | }; |
749 | 743 | ||
750 | struct ide_host; | 744 | struct ide_host; |
751 | 745 | ||
752 | typedef struct hwif_s { | 746 | typedef struct hwif_s { |
753 | struct hwif_s *next; /* for linked-list in ide_hwgroup_t */ | ||
754 | struct hwif_s *mate; /* other hwif from same PCI chip */ | 747 | struct hwif_s *mate; /* other hwif from same PCI chip */ |
755 | struct hwgroup_s *hwgroup; /* actually (ide_hwgroup_t *) */ | ||
756 | struct proc_dir_entry *proc; /* /proc/ide/ directory entry */ | 748 | struct proc_dir_entry *proc; /* /proc/ide/ directory entry */ |
757 | 749 | ||
758 | struct ide_host *host; | 750 | struct ide_host *host; |
@@ -763,7 +755,7 @@ typedef struct hwif_s { | |||
763 | 755 | ||
764 | unsigned long sata_scr[SATA_NR_PORTS]; | 756 | unsigned long sata_scr[SATA_NR_PORTS]; |
765 | 757 | ||
766 | ide_drive_t drives[MAX_DRIVES]; /* drive info */ | 758 | ide_drive_t *devices[MAX_DRIVES + 1]; |
767 | 759 | ||
768 | u8 major; /* our major number */ | 760 | u8 major; /* our major number */ |
769 | u8 index; /* 0 for ide0; 1 for ide1; ... */ | 761 | u8 index; /* 0 for ide0; 1 for ide1; ... */ |
@@ -829,7 +821,7 @@ typedef struct hwif_s { | |||
829 | unsigned extra_ports; /* number of extra dma ports */ | 821 | unsigned extra_ports; /* number of extra dma ports */ |
830 | 822 | ||
831 | unsigned present : 1; /* this interface exists */ | 823 | unsigned present : 1; /* this interface exists */ |
832 | unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */ | 824 | unsigned busy : 1; /* serializes devices on a port */ |
833 | 825 | ||
834 | struct device gendev; | 826 | struct device gendev; |
835 | struct device *portdev; | 827 | struct device *portdev; |
@@ -841,19 +833,49 @@ typedef struct hwif_s { | |||
841 | #ifdef CONFIG_BLK_DEV_IDEACPI | 833 | #ifdef CONFIG_BLK_DEV_IDEACPI |
842 | struct ide_acpi_hwif_link *acpidata; | 834 | struct ide_acpi_hwif_link *acpidata; |
843 | #endif | 835 | #endif |
836 | |||
837 | /* IRQ handler, if active */ | ||
838 | ide_startstop_t (*handler)(ide_drive_t *); | ||
839 | |||
840 | /* BOOL: polling active & poll_timeout field valid */ | ||
841 | unsigned int polling : 1; | ||
842 | |||
843 | /* current drive */ | ||
844 | ide_drive_t *cur_dev; | ||
845 | |||
846 | /* current request */ | ||
847 | struct request *rq; | ||
848 | |||
849 | /* failsafe timer */ | ||
850 | struct timer_list timer; | ||
851 | /* timeout value during long polls */ | ||
852 | unsigned long poll_timeout; | ||
853 | /* queried upon timeouts */ | ||
854 | int (*expiry)(ide_drive_t *); | ||
855 | |||
856 | int req_gen; | ||
857 | int req_gen_timer; | ||
858 | |||
859 | spinlock_t lock; | ||
844 | } ____cacheline_internodealigned_in_smp ide_hwif_t; | 860 | } ____cacheline_internodealigned_in_smp ide_hwif_t; |
845 | 861 | ||
846 | #define MAX_HOST_PORTS 4 | 862 | #define MAX_HOST_PORTS 4 |
847 | 863 | ||
848 | struct ide_host { | 864 | struct ide_host { |
849 | ide_hwif_t *ports[MAX_HOST_PORTS]; | 865 | ide_hwif_t *ports[MAX_HOST_PORTS + 1]; |
850 | unsigned int n_ports; | 866 | unsigned int n_ports; |
851 | struct device *dev[2]; | 867 | struct device *dev[2]; |
852 | unsigned int (*init_chipset)(struct pci_dev *); | 868 | unsigned int (*init_chipset)(struct pci_dev *); |
853 | unsigned long host_flags; | 869 | unsigned long host_flags; |
854 | void *host_priv; | 870 | void *host_priv; |
871 | ide_hwif_t *cur_port; /* for hosts requiring serialization */ | ||
872 | |||
873 | /* used for hosts requiring serialization */ | ||
874 | volatile long host_busy; | ||
855 | }; | 875 | }; |
856 | 876 | ||
877 | #define IDE_HOST_BUSY 0 | ||
878 | |||
857 | /* | 879 | /* |
858 | * internal ide interrupt handler type | 880 | * internal ide interrupt handler type |
859 | */ | 881 | */ |
@@ -863,38 +885,6 @@ typedef int (ide_expiry_t)(ide_drive_t *); | |||
863 | /* used by ide-cd, ide-floppy, etc. */ | 885 | /* used by ide-cd, ide-floppy, etc. */ |
864 | typedef void (xfer_func_t)(ide_drive_t *, struct request *rq, void *, unsigned); | 886 | typedef void (xfer_func_t)(ide_drive_t *, struct request *rq, void *, unsigned); |
865 | 887 | ||
866 | typedef struct hwgroup_s { | ||
867 | /* irq handler, if active */ | ||
868 | ide_startstop_t (*handler)(ide_drive_t *); | ||
869 | |||
870 | /* BOOL: protects all fields below */ | ||
871 | volatile int busy; | ||
872 | /* BOOL: polling active & poll_timeout field valid */ | ||
873 | unsigned int polling : 1; | ||
874 | |||
875 | /* current drive */ | ||
876 | ide_drive_t *drive; | ||
877 | /* ptr to current hwif in linked-list */ | ||
878 | ide_hwif_t *hwif; | ||
879 | |||
880 | /* current request */ | ||
881 | struct request *rq; | ||
882 | |||
883 | /* failsafe timer */ | ||
884 | struct timer_list timer; | ||
885 | /* timeout value during long polls */ | ||
886 | unsigned long poll_timeout; | ||
887 | /* queried upon timeouts */ | ||
888 | int (*expiry)(ide_drive_t *); | ||
889 | |||
890 | int req_gen; | ||
891 | int req_gen_timer; | ||
892 | |||
893 | spinlock_t lock; | ||
894 | } ide_hwgroup_t; | ||
895 | |||
896 | typedef struct ide_driver_s ide_driver_t; | ||
897 | |||
898 | extern struct mutex ide_setting_mtx; | 888 | extern struct mutex ide_setting_mtx; |
899 | 889 | ||
900 | /* | 890 | /* |
@@ -1020,8 +1010,8 @@ void ide_proc_register_port(ide_hwif_t *); | |||
1020 | void ide_proc_port_register_devices(ide_hwif_t *); | 1010 | void ide_proc_port_register_devices(ide_hwif_t *); |
1021 | void ide_proc_unregister_device(ide_drive_t *); | 1011 | void ide_proc_unregister_device(ide_drive_t *); |
1022 | void ide_proc_unregister_port(ide_hwif_t *); | 1012 | void ide_proc_unregister_port(ide_hwif_t *); |
1023 | void ide_proc_register_driver(ide_drive_t *, ide_driver_t *); | 1013 | void ide_proc_register_driver(ide_drive_t *, struct ide_driver *); |
1024 | void ide_proc_unregister_driver(ide_drive_t *, ide_driver_t *); | 1014 | void ide_proc_unregister_driver(ide_drive_t *, struct ide_driver *); |
1025 | 1015 | ||
1026 | read_proc_t proc_ide_read_capacity; | 1016 | read_proc_t proc_ide_read_capacity; |
1027 | read_proc_t proc_ide_read_geometry; | 1017 | read_proc_t proc_ide_read_geometry; |
@@ -1048,8 +1038,10 @@ static inline void ide_proc_register_port(ide_hwif_t *hwif) { ; } | |||
1048 | static inline void ide_proc_port_register_devices(ide_hwif_t *hwif) { ; } | 1038 | static inline void ide_proc_port_register_devices(ide_hwif_t *hwif) { ; } |
1049 | static inline void ide_proc_unregister_device(ide_drive_t *drive) { ; } | 1039 | static inline void ide_proc_unregister_device(ide_drive_t *drive) { ; } |
1050 | static inline void ide_proc_unregister_port(ide_hwif_t *hwif) { ; } | 1040 | static inline void ide_proc_unregister_port(ide_hwif_t *hwif) { ; } |
1051 | static inline void ide_proc_register_driver(ide_drive_t *drive, ide_driver_t *driver) { ; } | 1041 | static inline void ide_proc_register_driver(ide_drive_t *drive, |
1052 | static inline void ide_proc_unregister_driver(ide_drive_t *drive, ide_driver_t *driver) { ; } | 1042 | struct ide_driver *driver) { ; } |
1043 | static inline void ide_proc_unregister_driver(ide_drive_t *drive, | ||
1044 | struct ide_driver *driver) { ; } | ||
1053 | #define PROC_IDE_READ_RETURN(page,start,off,count,eof,len) return 0; | 1045 | #define PROC_IDE_READ_RETURN(page,start,off,count,eof,len) return 0; |
1054 | #endif | 1046 | #endif |
1055 | 1047 | ||
@@ -1118,11 +1110,10 @@ void ide_check_pm_state(ide_drive_t *, struct request *); | |||
1118 | * The gendriver.owner field should be set to the module owner of this driver. | 1110 | * The gendriver.owner field should be set to the module owner of this driver. |
1119 | * The gendriver.name field should be set to the name of this driver | 1111 | * The gendriver.name field should be set to the name of this driver |
1120 | */ | 1112 | */ |
1121 | struct ide_driver_s { | 1113 | struct ide_driver { |
1122 | const char *version; | 1114 | const char *version; |
1123 | ide_startstop_t (*do_request)(ide_drive_t *, struct request *, sector_t); | 1115 | ide_startstop_t (*do_request)(ide_drive_t *, struct request *, sector_t); |
1124 | int (*end_request)(ide_drive_t *, int, int); | 1116 | int (*end_request)(ide_drive_t *, int, int); |
1125 | ide_startstop_t (*error)(ide_drive_t *, struct request *rq, u8, u8); | ||
1126 | struct device_driver gen_driver; | 1117 | struct device_driver gen_driver; |
1127 | int (*probe)(ide_drive_t *); | 1118 | int (*probe)(ide_drive_t *); |
1128 | void (*remove)(ide_drive_t *); | 1119 | void (*remove)(ide_drive_t *); |
@@ -1134,7 +1125,7 @@ struct ide_driver_s { | |||
1134 | #endif | 1125 | #endif |
1135 | }; | 1126 | }; |
1136 | 1127 | ||
1137 | #define to_ide_driver(drv) container_of(drv, ide_driver_t, gen_driver) | 1128 | #define to_ide_driver(drv) container_of(drv, struct ide_driver, gen_driver) |
1138 | 1129 | ||
1139 | int ide_device_get(ide_drive_t *); | 1130 | int ide_device_get(ide_drive_t *); |
1140 | void ide_device_put(ide_drive_t *); | 1131 | void ide_device_put(ide_drive_t *); |
@@ -1166,9 +1157,7 @@ void ide_execute_pkt_cmd(ide_drive_t *); | |||
1166 | 1157 | ||
1167 | void ide_pad_transfer(ide_drive_t *, int, int); | 1158 | void ide_pad_transfer(ide_drive_t *, int, int); |
1168 | 1159 | ||
1169 | ide_startstop_t __ide_error(ide_drive_t *, struct request *, u8, u8); | 1160 | ide_startstop_t ide_error(ide_drive_t *, const char *, u8); |
1170 | |||
1171 | ide_startstop_t ide_error (ide_drive_t *drive, const char *msg, byte stat); | ||
1172 | 1161 | ||
1173 | void ide_fix_driveid(u16 *); | 1162 | void ide_fix_driveid(u16 *); |
1174 | 1163 | ||
@@ -1192,7 +1181,6 @@ void ide_tf_dump(const char *, struct ide_taskfile *); | |||
1192 | void ide_exec_command(ide_hwif_t *, u8); | 1181 | void ide_exec_command(ide_hwif_t *, u8); |
1193 | u8 ide_read_status(ide_hwif_t *); | 1182 | u8 ide_read_status(ide_hwif_t *); |
1194 | u8 ide_read_altstatus(ide_hwif_t *); | 1183 | u8 ide_read_altstatus(ide_hwif_t *); |
1195 | u8 ide_read_sff_dma_status(ide_hwif_t *); | ||
1196 | 1184 | ||
1197 | void ide_set_irq(ide_hwif_t *, int); | 1185 | void ide_set_irq(ide_hwif_t *, int); |
1198 | 1186 | ||
@@ -1272,26 +1260,6 @@ extern void ide_stall_queue(ide_drive_t *drive, unsigned long timeout); | |||
1272 | 1260 | ||
1273 | extern void ide_timer_expiry(unsigned long); | 1261 | extern void ide_timer_expiry(unsigned long); |
1274 | extern irqreturn_t ide_intr(int irq, void *dev_id); | 1262 | extern irqreturn_t ide_intr(int irq, void *dev_id); |
1275 | |||
1276 | static inline int ide_lock_hwgroup(ide_hwgroup_t *hwgroup) | ||
1277 | { | ||
1278 | if (hwgroup->busy) | ||
1279 | return 1; | ||
1280 | |||
1281 | hwgroup->busy = 1; | ||
1282 | /* for atari only */ | ||
1283 | ide_get_lock(ide_intr, hwgroup); | ||
1284 | |||
1285 | return 0; | ||
1286 | } | ||
1287 | |||
1288 | static inline void ide_unlock_hwgroup(ide_hwgroup_t *hwgroup) | ||
1289 | { | ||
1290 | /* for atari only */ | ||
1291 | ide_release_lock(); | ||
1292 | hwgroup->busy = 0; | ||
1293 | } | ||
1294 | |||
1295 | extern void do_ide_request(struct request_queue *); | 1263 | extern void do_ide_request(struct request_queue *); |
1296 | 1264 | ||
1297 | void ide_init_disk(struct gendisk *, ide_drive_t *); | 1265 | void ide_init_disk(struct gendisk *, ide_drive_t *); |
@@ -1327,11 +1295,11 @@ static inline int ide_hwif_setup_dma(ide_hwif_t *hwif, | |||
1327 | } | 1295 | } |
1328 | #endif | 1296 | #endif |
1329 | 1297 | ||
1330 | typedef struct ide_pci_enablebit_s { | 1298 | struct ide_pci_enablebit { |
1331 | u8 reg; /* byte pci reg holding the enable-bit */ | 1299 | u8 reg; /* byte pci reg holding the enable-bit */ |
1332 | u8 mask; /* mask to isolate the enable-bit */ | 1300 | u8 mask; /* mask to isolate the enable-bit */ |
1333 | u8 val; /* value of masked reg when "enabled" */ | 1301 | u8 val; /* value of masked reg when "enabled" */ |
1334 | } ide_pci_enablebit_t; | 1302 | }; |
1335 | 1303 | ||
1336 | enum { | 1304 | enum { |
1337 | /* Uses ISA control ports not PCI ones. */ | 1305 | /* Uses ISA control ports not PCI ones. */ |
@@ -1420,7 +1388,8 @@ struct ide_port_info { | |||
1420 | const struct ide_port_ops *port_ops; | 1388 | const struct ide_port_ops *port_ops; |
1421 | const struct ide_dma_ops *dma_ops; | 1389 | const struct ide_dma_ops *dma_ops; |
1422 | 1390 | ||
1423 | ide_pci_enablebit_t enablebits[2]; | 1391 | struct ide_pci_enablebit enablebits[2]; |
1392 | |||
1424 | hwif_chipset_t chipset; | 1393 | hwif_chipset_t chipset; |
1425 | 1394 | ||
1426 | u16 max_sectors; /* if < than the default one */ | 1395 | u16 max_sectors; /* if < than the default one */ |
@@ -1492,6 +1461,7 @@ void ide_dma_exec_cmd(ide_drive_t *, u8); | |||
1492 | extern void ide_dma_start(ide_drive_t *); | 1461 | extern void ide_dma_start(ide_drive_t *); |
1493 | int ide_dma_end(ide_drive_t *); | 1462 | int ide_dma_end(ide_drive_t *); |
1494 | int ide_dma_test_irq(ide_drive_t *); | 1463 | int ide_dma_test_irq(ide_drive_t *); |
1464 | u8 ide_dma_sff_read_status(ide_hwif_t *); | ||
1495 | extern const struct ide_dma_ops sff_dma_ops; | 1465 | extern const struct ide_dma_ops sff_dma_ops; |
1496 | #else | 1466 | #else |
1497 | static inline int config_drive_for_dma(ide_drive_t *drive) { return 0; } | 1467 | static inline int config_drive_for_dma(ide_drive_t *drive) { return 0; } |
@@ -1529,9 +1499,6 @@ static inline void ide_acpi_port_init_devices(ide_hwif_t *hwif) { ; } | |||
1529 | static inline void ide_acpi_set_state(ide_hwif_t *hwif, int on) {} | 1499 | static inline void ide_acpi_set_state(ide_hwif_t *hwif, int on) {} |
1530 | #endif | 1500 | #endif |
1531 | 1501 | ||
1532 | void ide_remove_port_from_hwgroup(ide_hwif_t *); | ||
1533 | void ide_unregister(ide_hwif_t *); | ||
1534 | |||
1535 | void ide_register_region(struct gendisk *); | 1502 | void ide_register_region(struct gendisk *); |
1536 | void ide_unregister_region(struct gendisk *); | 1503 | void ide_unregister_region(struct gendisk *); |
1537 | 1504 | ||
@@ -1616,23 +1583,6 @@ static inline void ide_set_max_pio(ide_drive_t *drive) | |||
1616 | ide_set_pio(drive, 255); | 1583 | ide_set_pio(drive, 255); |
1617 | } | 1584 | } |
1618 | 1585 | ||
1619 | extern spinlock_t ide_lock; | ||
1620 | extern struct mutex ide_cfg_mtx; | ||
1621 | /* | ||
1622 | * Structure locking: | ||
1623 | * | ||
1624 | * ide_cfg_mtx and hwgroup->lock together protect changes to | ||
1625 | * ide_hwif_t->next | ||
1626 | * ide_drive_t->next | ||
1627 | * | ||
1628 | * ide_hwgroup_t->busy: hwgroup->lock | ||
1629 | * ide_hwgroup_t->hwif: hwgroup->lock | ||
1630 | * ide_hwif_t->{hwgroup,mate}: constant, no locking | ||
1631 | * ide_drive_t->hwif: constant, no locking | ||
1632 | */ | ||
1633 | |||
1634 | #define local_irq_set(flags) do { local_save_flags((flags)); local_irq_enable_in_hardirq(); } while (0) | ||
1635 | |||
1636 | char *ide_media_string(ide_drive_t *); | 1586 | char *ide_media_string(ide_drive_t *); |
1637 | 1587 | ||
1638 | extern struct device_attribute ide_dev_attrs[]; | 1588 | extern struct device_attribute ide_dev_attrs[]; |
@@ -1651,8 +1601,15 @@ static inline int hwif_to_node(ide_hwif_t *hwif) | |||
1651 | 1601 | ||
1652 | static inline ide_drive_t *ide_get_pair_dev(ide_drive_t *drive) | 1602 | static inline ide_drive_t *ide_get_pair_dev(ide_drive_t *drive) |
1653 | { | 1603 | { |
1654 | ide_drive_t *peer = &drive->hwif->drives[(drive->dn ^ 1) & 1]; | 1604 | ide_drive_t *peer = drive->hwif->devices[(drive->dn ^ 1) & 1]; |
1655 | 1605 | ||
1656 | return (peer->dev_flags & IDE_DFLAG_PRESENT) ? peer : NULL; | 1606 | return (peer->dev_flags & IDE_DFLAG_PRESENT) ? peer : NULL; |
1657 | } | 1607 | } |
1608 | |||
1609 | #define ide_port_for_each_dev(i, dev, port) \ | ||
1610 | for ((i) = 0; ((dev) = (port)->devices[i]) || (i) < MAX_DRIVES; (i)++) | ||
1611 | |||
1612 | #define ide_host_for_each_port(i, port, host) \ | ||
1613 | for ((i) = 0; ((port) = (host)->ports[i]) || (i) < MAX_HOST_PORTS; (i)++) | ||
1614 | |||
1658 | #endif /* _IDE_H */ | 1615 | #endif /* _IDE_H */ |
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 0702c4d7bdf0..af886b26c9d1 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -14,7 +14,6 @@ | |||
14 | #include <linux/irqflags.h> | 14 | #include <linux/irqflags.h> |
15 | #include <linux/smp.h> | 15 | #include <linux/smp.h> |
16 | #include <linux/percpu.h> | 16 | #include <linux/percpu.h> |
17 | #include <linux/irqnr.h> | ||
18 | 17 | ||
19 | #include <asm/atomic.h> | 18 | #include <asm/atomic.h> |
20 | #include <asm/ptrace.h> | 19 | #include <asm/ptrace.h> |
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index c7d106ef22e2..34456476e761 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h | |||
@@ -329,6 +329,7 @@ enum jbd_state_bits { | |||
329 | BH_State, /* Pins most journal_head state */ | 329 | BH_State, /* Pins most journal_head state */ |
330 | BH_JournalHead, /* Pins bh->b_private and jh->b_bh */ | 330 | BH_JournalHead, /* Pins bh->b_private and jh->b_bh */ |
331 | BH_Unshadow, /* Dummy bit, for BJ_Shadow wakeup filtering */ | 331 | BH_Unshadow, /* Dummy bit, for BJ_Shadow wakeup filtering */ |
332 | BH_JBDPrivateStart, /* First bit available for private use by FS */ | ||
332 | }; | 333 | }; |
333 | 334 | ||
334 | BUFFER_FNS(JBD, jbd) | 335 | BUFFER_FNS(JBD, jbd) |
@@ -1007,6 +1008,35 @@ int __jbd2_journal_clean_checkpoint_list(journal_t *journal); | |||
1007 | int __jbd2_journal_remove_checkpoint(struct journal_head *); | 1008 | int __jbd2_journal_remove_checkpoint(struct journal_head *); |
1008 | void __jbd2_journal_insert_checkpoint(struct journal_head *, transaction_t *); | 1009 | void __jbd2_journal_insert_checkpoint(struct journal_head *, transaction_t *); |
1009 | 1010 | ||
1011 | |||
1012 | /* | ||
1013 | * Triggers | ||
1014 | */ | ||
1015 | |||
1016 | struct jbd2_buffer_trigger_type { | ||
1017 | /* | ||
1018 | * Fired just before a buffer is written to the journal. | ||
1019 | * mapped_data is a mapped buffer that is the frozen data for | ||
1020 | * commit. | ||
1021 | */ | ||
1022 | void (*t_commit)(struct jbd2_buffer_trigger_type *type, | ||
1023 | struct buffer_head *bh, void *mapped_data, | ||
1024 | size_t size); | ||
1025 | |||
1026 | /* | ||
1027 | * Fired during journal abort for dirty buffers that will not be | ||
1028 | * committed. | ||
1029 | */ | ||
1030 | void (*t_abort)(struct jbd2_buffer_trigger_type *type, | ||
1031 | struct buffer_head *bh); | ||
1032 | }; | ||
1033 | |||
1034 | extern void jbd2_buffer_commit_trigger(struct journal_head *jh, | ||
1035 | void *mapped_data, | ||
1036 | struct jbd2_buffer_trigger_type *triggers); | ||
1037 | extern void jbd2_buffer_abort_trigger(struct journal_head *jh, | ||
1038 | struct jbd2_buffer_trigger_type *triggers); | ||
1039 | |||
1010 | /* Buffer IO */ | 1040 | /* Buffer IO */ |
1011 | extern int | 1041 | extern int |
1012 | jbd2_journal_write_metadata_buffer(transaction_t *transaction, | 1042 | jbd2_journal_write_metadata_buffer(transaction_t *transaction, |
@@ -1045,6 +1075,8 @@ extern int jbd2_journal_extend (handle_t *, int nblocks); | |||
1045 | extern int jbd2_journal_get_write_access(handle_t *, struct buffer_head *); | 1075 | extern int jbd2_journal_get_write_access(handle_t *, struct buffer_head *); |
1046 | extern int jbd2_journal_get_create_access (handle_t *, struct buffer_head *); | 1076 | extern int jbd2_journal_get_create_access (handle_t *, struct buffer_head *); |
1047 | extern int jbd2_journal_get_undo_access(handle_t *, struct buffer_head *); | 1077 | extern int jbd2_journal_get_undo_access(handle_t *, struct buffer_head *); |
1078 | void jbd2_journal_set_triggers(struct buffer_head *, | ||
1079 | struct jbd2_buffer_trigger_type *type); | ||
1048 | extern int jbd2_journal_dirty_metadata (handle_t *, struct buffer_head *); | 1080 | extern int jbd2_journal_dirty_metadata (handle_t *, struct buffer_head *); |
1049 | extern void jbd2_journal_release_buffer (handle_t *, struct buffer_head *); | 1081 | extern void jbd2_journal_release_buffer (handle_t *, struct buffer_head *); |
1050 | extern int jbd2_journal_forget (handle_t *, struct buffer_head *); | 1082 | extern int jbd2_journal_forget (handle_t *, struct buffer_head *); |
diff --git a/include/linux/journal-head.h b/include/linux/journal-head.h index bb70ebb6a2d5..525aac3c97df 100644 --- a/include/linux/journal-head.h +++ b/include/linux/journal-head.h | |||
@@ -12,6 +12,8 @@ | |||
12 | 12 | ||
13 | typedef unsigned int tid_t; /* Unique transaction ID */ | 13 | typedef unsigned int tid_t; /* Unique transaction ID */ |
14 | typedef struct transaction_s transaction_t; /* Compound transaction type */ | 14 | typedef struct transaction_s transaction_t; /* Compound transaction type */ |
15 | |||
16 | |||
15 | struct buffer_head; | 17 | struct buffer_head; |
16 | 18 | ||
17 | struct journal_head { | 19 | struct journal_head { |
@@ -87,6 +89,12 @@ struct journal_head { | |||
87 | * [j_list_lock] | 89 | * [j_list_lock] |
88 | */ | 90 | */ |
89 | struct journal_head *b_cpnext, *b_cpprev; | 91 | struct journal_head *b_cpnext, *b_cpprev; |
92 | |||
93 | /* Trigger type */ | ||
94 | struct jbd2_buffer_trigger_type *b_triggers; | ||
95 | |||
96 | /* Trigger type for the committing transaction's frozen data */ | ||
97 | struct jbd2_buffer_trigger_type *b_frozen_triggers; | ||
90 | }; | 98 | }; |
91 | 99 | ||
92 | #endif /* JOURNAL_HEAD_H_INCLUDED */ | 100 | #endif /* JOURNAL_HEAD_H_INCLUDED */ |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index ca9ff6411dfa..6b8e2027165e 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -48,6 +48,12 @@ extern const char linux_proc_banner[]; | |||
48 | #define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f)) | 48 | #define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f)) |
49 | #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) | 49 | #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) |
50 | #define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) | 50 | #define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) |
51 | #define DIV_ROUND_CLOSEST(x, divisor)( \ | ||
52 | { \ | ||
53 | typeof(divisor) __divisor = divisor; \ | ||
54 | (((x) + ((__divisor) / 2)) / (__divisor)); \ | ||
55 | } \ | ||
56 | ) | ||
51 | 57 | ||
52 | #define _RET_IP_ (unsigned long)__builtin_return_address(0) | 58 | #define _RET_IP_ (unsigned long)__builtin_return_address(0) |
53 | #define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; }) | 59 | #define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; }) |
@@ -349,13 +355,13 @@ static inline char *pack_hex_byte(char *buf, u8 byte) | |||
349 | printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | 355 | printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) |
350 | 356 | ||
351 | /* If you are writing a driver, please use dev_dbg instead */ | 357 | /* If you are writing a driver, please use dev_dbg instead */ |
352 | #if defined(CONFIG_DYNAMIC_PRINTK_DEBUG) | 358 | #if defined(DEBUG) |
359 | #define pr_debug(fmt, ...) \ | ||
360 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
361 | #elif defined(CONFIG_DYNAMIC_PRINTK_DEBUG) | ||
353 | #define pr_debug(fmt, ...) do { \ | 362 | #define pr_debug(fmt, ...) do { \ |
354 | dynamic_pr_debug(pr_fmt(fmt), ##__VA_ARGS__); \ | 363 | dynamic_pr_debug(pr_fmt(fmt), ##__VA_ARGS__); \ |
355 | } while (0) | 364 | } while (0) |
356 | #elif defined(DEBUG) | ||
357 | #define pr_debug(fmt, ...) \ | ||
358 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) | ||
359 | #else | 365 | #else |
360 | #define pr_debug(fmt, ...) \ | 366 | #define pr_debug(fmt, ...) \ |
361 | ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; }) | 367 | ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; }) |
diff --git a/include/linux/klist.h b/include/linux/klist.h index 8ea98db223e5..d5a27af9dba5 100644 --- a/include/linux/klist.h +++ b/include/linux/klist.h | |||
@@ -13,7 +13,6 @@ | |||
13 | #define _LINUX_KLIST_H | 13 | #define _LINUX_KLIST_H |
14 | 14 | ||
15 | #include <linux/spinlock.h> | 15 | #include <linux/spinlock.h> |
16 | #include <linux/completion.h> | ||
17 | #include <linux/kref.h> | 16 | #include <linux/kref.h> |
18 | #include <linux/list.h> | 17 | #include <linux/list.h> |
19 | 18 | ||
@@ -41,7 +40,6 @@ struct klist_node { | |||
41 | void *n_klist; /* never access directly */ | 40 | void *n_klist; /* never access directly */ |
42 | struct list_head n_node; | 41 | struct list_head n_node; |
43 | struct kref n_ref; | 42 | struct kref n_ref; |
44 | struct completion n_removed; | ||
45 | }; | 43 | }; |
46 | 44 | ||
47 | extern void klist_add_tail(struct klist_node *n, struct klist *k); | 45 | extern void klist_add_tail(struct klist_node *n, struct klist *k); |
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h index 497b1d1f7a05..d6ea19e314bb 100644 --- a/include/linux/kprobes.h +++ b/include/linux/kprobes.h | |||
@@ -69,9 +69,6 @@ struct kprobe { | |||
69 | /* list of kprobes for multi-handler support */ | 69 | /* list of kprobes for multi-handler support */ |
70 | struct list_head list; | 70 | struct list_head list; |
71 | 71 | ||
72 | /* Indicates that the corresponding module has been ref counted */ | ||
73 | unsigned int mod_refcounted; | ||
74 | |||
75 | /*count the number of times this probe was temporarily disarmed */ | 72 | /*count the number of times this probe was temporarily disarmed */ |
76 | unsigned long nmissed; | 73 | unsigned long nmissed; |
77 | 74 | ||
@@ -103,8 +100,19 @@ struct kprobe { | |||
103 | 100 | ||
104 | /* copy of the original instruction */ | 101 | /* copy of the original instruction */ |
105 | struct arch_specific_insn ainsn; | 102 | struct arch_specific_insn ainsn; |
103 | |||
104 | /* Indicates various status flags. Protected by kprobe_mutex. */ | ||
105 | u32 flags; | ||
106 | }; | 106 | }; |
107 | 107 | ||
108 | /* Kprobe status flags */ | ||
109 | #define KPROBE_FLAG_GONE 1 /* breakpoint has already gone */ | ||
110 | |||
111 | static inline int kprobe_gone(struct kprobe *p) | ||
112 | { | ||
113 | return p->flags & KPROBE_FLAG_GONE; | ||
114 | } | ||
115 | |||
108 | /* | 116 | /* |
109 | * Special probe type that uses setjmp-longjmp type tricks to resume | 117 | * Special probe type that uses setjmp-longjmp type tricks to resume |
110 | * execution at a specified entry with a matching prototype corresponding | 118 | * execution at a specified entry with a matching prototype corresponding |
@@ -201,7 +209,6 @@ static inline int init_test_probes(void) | |||
201 | } | 209 | } |
202 | #endif /* CONFIG_KPROBES_SANITY_TEST */ | 210 | #endif /* CONFIG_KPROBES_SANITY_TEST */ |
203 | 211 | ||
204 | extern struct mutex kprobe_mutex; | ||
205 | extern int arch_prepare_kprobe(struct kprobe *p); | 212 | extern int arch_prepare_kprobe(struct kprobe *p); |
206 | extern void arch_arm_kprobe(struct kprobe *p); | 213 | extern void arch_arm_kprobe(struct kprobe *p); |
207 | extern void arch_disarm_kprobe(struct kprobe *p); | 214 | extern void arch_disarm_kprobe(struct kprobe *p); |
diff --git a/include/linux/memory.h b/include/linux/memory.h index 36c82c9e6ea7..3fdc10806d31 100644 --- a/include/linux/memory.h +++ b/include/linux/memory.h | |||
@@ -79,14 +79,14 @@ static inline int memory_notify(unsigned long val, void *v) | |||
79 | #else | 79 | #else |
80 | extern int register_memory_notifier(struct notifier_block *nb); | 80 | extern int register_memory_notifier(struct notifier_block *nb); |
81 | extern void unregister_memory_notifier(struct notifier_block *nb); | 81 | extern void unregister_memory_notifier(struct notifier_block *nb); |
82 | extern int register_new_memory(struct mem_section *); | 82 | extern int register_new_memory(int, struct mem_section *); |
83 | extern int unregister_memory_section(struct mem_section *); | 83 | extern int unregister_memory_section(struct mem_section *); |
84 | extern int memory_dev_init(void); | 84 | extern int memory_dev_init(void); |
85 | extern int remove_memory_block(unsigned long, struct mem_section *, int); | 85 | extern int remove_memory_block(unsigned long, struct mem_section *, int); |
86 | extern int memory_notify(unsigned long val, void *v); | 86 | extern int memory_notify(unsigned long val, void *v); |
87 | extern struct memory_block *find_memory_block(struct mem_section *); | ||
87 | #define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT) | 88 | #define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT) |
88 | 89 | enum mem_add_context { BOOT, HOTPLUG }; | |
89 | |||
90 | #endif /* CONFIG_MEMORY_HOTPLUG_SPARSE */ | 90 | #endif /* CONFIG_MEMORY_HOTPLUG_SPARSE */ |
91 | 91 | ||
92 | #ifdef CONFIG_MEMORY_HOTPLUG | 92 | #ifdef CONFIG_MEMORY_HOTPLUG |
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index 763ba81fc0f0..d95f72e79b82 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h | |||
@@ -72,7 +72,7 @@ extern void __offline_isolated_pages(unsigned long, unsigned long); | |||
72 | extern int offline_pages(unsigned long, unsigned long, unsigned long); | 72 | extern int offline_pages(unsigned long, unsigned long, unsigned long); |
73 | 73 | ||
74 | /* reasonably generic interface to expand the physical pages in a zone */ | 74 | /* reasonably generic interface to expand the physical pages in a zone */ |
75 | extern int __add_pages(struct zone *zone, unsigned long start_pfn, | 75 | extern int __add_pages(int nid, struct zone *zone, unsigned long start_pfn, |
76 | unsigned long nr_pages); | 76 | unsigned long nr_pages); |
77 | extern int __remove_pages(struct zone *zone, unsigned long start_pfn, | 77 | extern int __remove_pages(struct zone *zone, unsigned long start_pfn, |
78 | unsigned long nr_pages); | 78 | unsigned long nr_pages); |
diff --git a/include/linux/mfd/da903x.h b/include/linux/mfd/da903x.h index cad314c12439..115dbe965082 100644 --- a/include/linux/mfd/da903x.h +++ b/include/linux/mfd/da903x.h | |||
@@ -32,6 +32,7 @@ enum { | |||
32 | DA9030_ID_LDO18, | 32 | DA9030_ID_LDO18, |
33 | DA9030_ID_LDO19, | 33 | DA9030_ID_LDO19, |
34 | DA9030_ID_LDO_INT, /* LDO Internal */ | 34 | DA9030_ID_LDO_INT, /* LDO Internal */ |
35 | DA9030_ID_BAT, /* battery charger */ | ||
35 | 36 | ||
36 | DA9034_ID_LED_1, | 37 | DA9034_ID_LED_1, |
37 | DA9034_ID_LED_2, | 38 | DA9034_ID_LED_2, |
@@ -93,6 +94,43 @@ struct da9034_touch_pdata { | |||
93 | int y_inverted; | 94 | int y_inverted; |
94 | }; | 95 | }; |
95 | 96 | ||
97 | /* DA9030 battery charger data */ | ||
98 | struct power_supply_info; | ||
99 | |||
100 | struct da9030_battery_info { | ||
101 | /* battery parameters */ | ||
102 | struct power_supply_info *battery_info; | ||
103 | |||
104 | /* current and voltage to use for battery charging */ | ||
105 | unsigned int charge_milliamp; | ||
106 | unsigned int charge_millivolt; | ||
107 | |||
108 | /* voltage thresholds (in millivolts) */ | ||
109 | int vbat_low; | ||
110 | int vbat_crit; | ||
111 | int vbat_charge_start; | ||
112 | int vbat_charge_stop; | ||
113 | int vbat_charge_restart; | ||
114 | |||
115 | /* battery nominal minimal and maximal voltages in millivolts */ | ||
116 | int vcharge_min; | ||
117 | int vcharge_max; | ||
118 | |||
119 | /* Temperature thresholds. These are DA9030 register values | ||
120 | "as is" and should be measured for each battery type */ | ||
121 | int tbat_low; | ||
122 | int tbat_high; | ||
123 | int tbat_restart; | ||
124 | |||
125 | |||
126 | /* battery monitor interval (seconds) */ | ||
127 | unsigned int batmon_interval; | ||
128 | |||
129 | /* platform callbacks for battery low and critical events */ | ||
130 | void (*battery_low)(void); | ||
131 | void (*battery_critical)(void); | ||
132 | }; | ||
133 | |||
96 | struct da903x_subdev_info { | 134 | struct da903x_subdev_info { |
97 | int id; | 135 | int id; |
98 | const char *name; | 136 | const char *name; |
@@ -190,11 +228,13 @@ extern int da903x_unregister_notifier(struct device *dev, | |||
190 | extern int da903x_query_status(struct device *dev, unsigned int status); | 228 | extern int da903x_query_status(struct device *dev, unsigned int status); |
191 | 229 | ||
192 | 230 | ||
193 | /* NOTE: the two functions below are not intended for use outside | 231 | /* NOTE: the functions below are not intended for use outside |
194 | * of the DA9034 sub-device drivers | 232 | * of the DA903x sub-device drivers |
195 | */ | 233 | */ |
196 | extern int da903x_write(struct device *dev, int reg, uint8_t val); | 234 | extern int da903x_write(struct device *dev, int reg, uint8_t val); |
235 | extern int da903x_writes(struct device *dev, int reg, int len, uint8_t *val); | ||
197 | extern int da903x_read(struct device *dev, int reg, uint8_t *val); | 236 | extern int da903x_read(struct device *dev, int reg, uint8_t *val); |
237 | extern int da903x_reads(struct device *dev, int reg, int len, uint8_t *val); | ||
198 | extern int da903x_update(struct device *dev, int reg, uint8_t val, uint8_t mask); | 238 | extern int da903x_update(struct device *dev, int reg, uint8_t val, uint8_t mask); |
199 | extern int da903x_set_bits(struct device *dev, int reg, uint8_t bit_mask); | 239 | extern int da903x_set_bits(struct device *dev, int reg, uint8_t bit_mask); |
200 | extern int da903x_clr_bits(struct device *dev, int reg, uint8_t bit_mask); | 240 | extern int da903x_clr_bits(struct device *dev, int reg, uint8_t bit_mask); |
diff --git a/include/linux/mfd/wm8350/comparator.h b/include/linux/mfd/wm8350/comparator.h index 053788649452..54bc5d0fd502 100644 --- a/include/linux/mfd/wm8350/comparator.h +++ b/include/linux/mfd/wm8350/comparator.h | |||
@@ -164,4 +164,12 @@ | |||
164 | #define WM8350_AUXADC_BATT 6 | 164 | #define WM8350_AUXADC_BATT 6 |
165 | #define WM8350_AUXADC_TEMP 7 | 165 | #define WM8350_AUXADC_TEMP 7 |
166 | 166 | ||
167 | struct wm8350; | ||
168 | |||
169 | /* | ||
170 | * AUX ADC Readback | ||
171 | */ | ||
172 | int wm8350_read_auxadc(struct wm8350 *wm8350, int channel, int scale, | ||
173 | int vref); | ||
174 | |||
167 | #endif | 175 | #endif |
diff --git a/include/linux/mfd/wm8350/core.h b/include/linux/mfd/wm8350/core.h index 6ebf97f2a475..980669d50dca 100644 --- a/include/linux/mfd/wm8350/core.h +++ b/include/linux/mfd/wm8350/core.h | |||
@@ -29,6 +29,7 @@ | |||
29 | */ | 29 | */ |
30 | #define WM8350_RESET_ID 0x00 | 30 | #define WM8350_RESET_ID 0x00 |
31 | #define WM8350_ID 0x01 | 31 | #define WM8350_ID 0x01 |
32 | #define WM8350_REVISION 0x02 | ||
32 | #define WM8350_SYSTEM_CONTROL_1 0x03 | 33 | #define WM8350_SYSTEM_CONTROL_1 0x03 |
33 | #define WM8350_SYSTEM_CONTROL_2 0x04 | 34 | #define WM8350_SYSTEM_CONTROL_2 0x04 |
34 | #define WM8350_SYSTEM_HIBERNATE 0x05 | 35 | #define WM8350_SYSTEM_HIBERNATE 0x05 |
@@ -57,6 +58,10 @@ | |||
57 | #define WM8350_OVER_CURRENT_INT_STATUS_MASK 0x25 | 58 | #define WM8350_OVER_CURRENT_INT_STATUS_MASK 0x25 |
58 | #define WM8350_GPIO_INT_STATUS_MASK 0x26 | 59 | #define WM8350_GPIO_INT_STATUS_MASK 0x26 |
59 | #define WM8350_COMPARATOR_INT_STATUS_MASK 0x27 | 60 | #define WM8350_COMPARATOR_INT_STATUS_MASK 0x27 |
61 | #define WM8350_CHARGER_OVERRIDES 0xE2 | ||
62 | #define WM8350_MISC_OVERRIDES 0xE3 | ||
63 | #define WM8350_COMPARATOR_OVERRIDES 0xE7 | ||
64 | #define WM8350_STATE_MACHINE_STATUS 0xE9 | ||
60 | 65 | ||
61 | #define WM8350_MAX_REGISTER 0xFF | 66 | #define WM8350_MAX_REGISTER 0xFF |
62 | 67 | ||
@@ -77,6 +82,11 @@ | |||
77 | #define WM8350_CUST_ID_MASK 0x00FF | 82 | #define WM8350_CUST_ID_MASK 0x00FF |
78 | 83 | ||
79 | /* | 84 | /* |
85 | * R2 (0x02) - Revision | ||
86 | */ | ||
87 | #define WM8350_MASK_REV_MASK 0x00FF | ||
88 | |||
89 | /* | ||
80 | * R3 (0x03) - System Control 1 | 90 | * R3 (0x03) - System Control 1 |
81 | */ | 91 | */ |
82 | #define WM8350_CHIP_ON 0x8000 | 92 | #define WM8350_CHIP_ON 0x8000 |
@@ -523,6 +533,35 @@ | |||
523 | #define WM8350_DC2_STS 0x0002 | 533 | #define WM8350_DC2_STS 0x0002 |
524 | #define WM8350_DC1_STS 0x0001 | 534 | #define WM8350_DC1_STS 0x0001 |
525 | 535 | ||
536 | /* | ||
537 | * R226 (0xE2) - Charger status | ||
538 | */ | ||
539 | #define WM8350_CHG_BATT_HOT_OVRDE 0x8000 | ||
540 | #define WM8350_CHG_BATT_COLD_OVRDE 0x4000 | ||
541 | |||
542 | /* | ||
543 | * R227 (0xE3) - Misc Overrides | ||
544 | */ | ||
545 | #define WM8350_USB_LIMIT_OVRDE 0x0400 | ||
546 | |||
547 | /* | ||
548 | * R227 (0xE7) - Comparator Overrides | ||
549 | */ | ||
550 | #define WM8350_USB_FB_OVRDE 0x8000 | ||
551 | #define WM8350_WALL_FB_OVRDE 0x4000 | ||
552 | #define WM8350_BATT_FB_OVRDE 0x2000 | ||
553 | |||
554 | |||
555 | /* | ||
556 | * R233 (0xE9) - State Machinine Status | ||
557 | */ | ||
558 | #define WM8350_USB_SM_MASK 0x0700 | ||
559 | #define WM8350_USB_SM_SHIFT 8 | ||
560 | |||
561 | #define WM8350_USB_SM_100_SLV 1 | ||
562 | #define WM8350_USB_SM_500_SLV 5 | ||
563 | #define WM8350_USB_SM_STDBY_SLV 7 | ||
564 | |||
526 | /* WM8350 wake up conditions */ | 565 | /* WM8350 wake up conditions */ |
527 | #define WM8350_IRQ_WKUP_OFF_STATE 43 | 566 | #define WM8350_IRQ_WKUP_OFF_STATE 43 |
528 | #define WM8350_IRQ_WKUP_HIB_STATE 44 | 567 | #define WM8350_IRQ_WKUP_HIB_STATE 44 |
@@ -536,6 +575,7 @@ | |||
536 | #define WM8350_REV_E 0x4 | 575 | #define WM8350_REV_E 0x4 |
537 | #define WM8350_REV_F 0x5 | 576 | #define WM8350_REV_F 0x5 |
538 | #define WM8350_REV_G 0x6 | 577 | #define WM8350_REV_G 0x6 |
578 | #define WM8350_REV_H 0x7 | ||
539 | 579 | ||
540 | #define WM8350_NUM_IRQ 63 | 580 | #define WM8350_NUM_IRQ 63 |
541 | 581 | ||
@@ -549,6 +589,14 @@ extern const u16 wm8350_mode0_defaults[]; | |||
549 | extern const u16 wm8350_mode1_defaults[]; | 589 | extern const u16 wm8350_mode1_defaults[]; |
550 | extern const u16 wm8350_mode2_defaults[]; | 590 | extern const u16 wm8350_mode2_defaults[]; |
551 | extern const u16 wm8350_mode3_defaults[]; | 591 | extern const u16 wm8350_mode3_defaults[]; |
592 | extern const u16 wm8351_mode0_defaults[]; | ||
593 | extern const u16 wm8351_mode1_defaults[]; | ||
594 | extern const u16 wm8351_mode2_defaults[]; | ||
595 | extern const u16 wm8351_mode3_defaults[]; | ||
596 | extern const u16 wm8352_mode0_defaults[]; | ||
597 | extern const u16 wm8352_mode1_defaults[]; | ||
598 | extern const u16 wm8352_mode2_defaults[]; | ||
599 | extern const u16 wm8352_mode3_defaults[]; | ||
552 | 600 | ||
553 | struct wm8350; | 601 | struct wm8350; |
554 | 602 | ||
@@ -558,8 +606,6 @@ struct wm8350_irq { | |||
558 | }; | 606 | }; |
559 | 607 | ||
560 | struct wm8350 { | 608 | struct wm8350 { |
561 | int rev; /* chip revision */ | ||
562 | |||
563 | struct device *dev; | 609 | struct device *dev; |
564 | 610 | ||
565 | /* device IO */ | 611 | /* device IO */ |
@@ -572,6 +618,8 @@ struct wm8350 { | |||
572 | void *src); | 618 | void *src); |
573 | u16 *reg_cache; | 619 | u16 *reg_cache; |
574 | 620 | ||
621 | struct mutex auxadc_mutex; | ||
622 | |||
575 | /* Interrupt handling */ | 623 | /* Interrupt handling */ |
576 | struct work_struct irq_work; | 624 | struct work_struct irq_work; |
577 | struct mutex irq_mutex; /* IRQ table mutex */ | 625 | struct mutex irq_mutex; /* IRQ table mutex */ |
diff --git a/include/linux/mfd/wm8350/pmic.h b/include/linux/mfd/wm8350/pmic.h index 69b69e07f62f..96acbfc8aa12 100644 --- a/include/linux/mfd/wm8350/pmic.h +++ b/include/linux/mfd/wm8350/pmic.h | |||
@@ -701,6 +701,10 @@ struct platform_device; | |||
701 | struct regulator_init_data; | 701 | struct regulator_init_data; |
702 | 702 | ||
703 | struct wm8350_pmic { | 703 | struct wm8350_pmic { |
704 | /* Number of regulators of each type on this device */ | ||
705 | int max_dcdc; | ||
706 | int max_isink; | ||
707 | |||
704 | /* ISINK to DCDC mapping */ | 708 | /* ISINK to DCDC mapping */ |
705 | int isink_A_dcdc; | 709 | int isink_A_dcdc; |
706 | int isink_B_dcdc; | 710 | int isink_B_dcdc; |
diff --git a/include/linux/mfd/wm8350/supply.h b/include/linux/mfd/wm8350/supply.h index 1c8f3cde79b0..2b9479310bbd 100644 --- a/include/linux/mfd/wm8350/supply.h +++ b/include/linux/mfd/wm8350/supply.h | |||
@@ -13,7 +13,8 @@ | |||
13 | #ifndef __LINUX_MFD_WM8350_SUPPLY_H_ | 13 | #ifndef __LINUX_MFD_WM8350_SUPPLY_H_ |
14 | #define __LINUX_MFD_WM8350_SUPPLY_H_ | 14 | #define __LINUX_MFD_WM8350_SUPPLY_H_ |
15 | 15 | ||
16 | #include <linux/platform_device.h> | 16 | #include <linux/mutex.h> |
17 | #include <linux/power_supply.h> | ||
17 | 18 | ||
18 | /* | 19 | /* |
19 | * Charger registers | 20 | * Charger registers |
@@ -104,8 +105,30 @@ | |||
104 | #define WM8350_IRQ_EXT_WALL_FB 37 | 105 | #define WM8350_IRQ_EXT_WALL_FB 37 |
105 | #define WM8350_IRQ_EXT_BAT_FB 38 | 106 | #define WM8350_IRQ_EXT_BAT_FB 38 |
106 | 107 | ||
108 | /* | ||
109 | * Policy to control charger state machine. | ||
110 | */ | ||
111 | struct wm8350_charger_policy { | ||
112 | |||
113 | /* charger state machine policy - set in machine driver */ | ||
114 | int eoc_mA; /* end of charge current (mA) */ | ||
115 | int charge_mV; /* charge voltage */ | ||
116 | int fast_limit_mA; /* fast charge current limit */ | ||
117 | int fast_limit_USB_mA; /* USB fast charge current limit */ | ||
118 | int charge_timeout; /* charge timeout (mins) */ | ||
119 | int trickle_start_mV; /* trickle charge starts at mV */ | ||
120 | int trickle_charge_mA; /* trickle charge current */ | ||
121 | int trickle_charge_USB_mA; /* USB trickle charge current */ | ||
122 | }; | ||
123 | |||
107 | struct wm8350_power { | 124 | struct wm8350_power { |
108 | struct platform_device *pdev; | 125 | struct platform_device *pdev; |
126 | struct power_supply battery; | ||
127 | struct power_supply usb; | ||
128 | struct power_supply ac; | ||
129 | struct wm8350_charger_policy *policy; | ||
130 | |||
131 | int rev_g_coeff; | ||
109 | }; | 132 | }; |
110 | 133 | ||
111 | #endif | 134 | #endif |
diff --git a/include/linux/migrate.h b/include/linux/migrate.h index 3f34005068d4..527602cdea1c 100644 --- a/include/linux/migrate.h +++ b/include/linux/migrate.h | |||
@@ -7,6 +7,8 @@ | |||
7 | typedef struct page *new_page_t(struct page *, unsigned long private, int **); | 7 | typedef struct page *new_page_t(struct page *, unsigned long private, int **); |
8 | 8 | ||
9 | #ifdef CONFIG_MIGRATION | 9 | #ifdef CONFIG_MIGRATION |
10 | #define PAGE_MIGRATION 1 | ||
11 | |||
10 | extern int putback_lru_pages(struct list_head *l); | 12 | extern int putback_lru_pages(struct list_head *l); |
11 | extern int migrate_page(struct address_space *, | 13 | extern int migrate_page(struct address_space *, |
12 | struct page *, struct page *); | 14 | struct page *, struct page *); |
@@ -20,6 +22,8 @@ extern int migrate_vmas(struct mm_struct *mm, | |||
20 | const nodemask_t *from, const nodemask_t *to, | 22 | const nodemask_t *from, const nodemask_t *to, |
21 | unsigned long flags); | 23 | unsigned long flags); |
22 | #else | 24 | #else |
25 | #define PAGE_MIGRATION 0 | ||
26 | |||
23 | static inline int putback_lru_pages(struct list_head *l) { return 0; } | 27 | static inline int putback_lru_pages(struct list_head *l) { return 0; } |
24 | static inline int migrate_pages(struct list_head *l, new_page_t x, | 28 | static inline int migrate_pages(struct list_head *l, new_page_t x, |
25 | unsigned long private) { return -ENOSYS; } | 29 | unsigned long private) { return -ENOSYS; } |
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h index 26433ec520b3..a820f816a49e 100644 --- a/include/linux/miscdevice.h +++ b/include/linux/miscdevice.h | |||
@@ -3,33 +3,33 @@ | |||
3 | #include <linux/module.h> | 3 | #include <linux/module.h> |
4 | #include <linux/major.h> | 4 | #include <linux/major.h> |
5 | 5 | ||
6 | #define PSMOUSE_MINOR 1 | 6 | #define PSMOUSE_MINOR 1 |
7 | #define MS_BUSMOUSE_MINOR 2 | 7 | #define MS_BUSMOUSE_MINOR 2 |
8 | #define ATIXL_BUSMOUSE_MINOR 3 | 8 | #define ATIXL_BUSMOUSE_MINOR 3 |
9 | /*#define AMIGAMOUSE_MINOR 4 FIXME OBSOLETE */ | 9 | /*#define AMIGAMOUSE_MINOR 4 FIXME OBSOLETE */ |
10 | #define ATARIMOUSE_MINOR 5 | 10 | #define ATARIMOUSE_MINOR 5 |
11 | #define SUN_MOUSE_MINOR 6 | 11 | #define SUN_MOUSE_MINOR 6 |
12 | #define APOLLO_MOUSE_MINOR 7 | 12 | #define APOLLO_MOUSE_MINOR 7 |
13 | #define PC110PAD_MINOR 9 | 13 | #define PC110PAD_MINOR 9 |
14 | /*#define ADB_MOUSE_MINOR 10 FIXME OBSOLETE */ | 14 | /*#define ADB_MOUSE_MINOR 10 FIXME OBSOLETE */ |
15 | #define WATCHDOG_MINOR 130 /* Watchdog timer */ | 15 | #define WATCHDOG_MINOR 130 /* Watchdog timer */ |
16 | #define TEMP_MINOR 131 /* Temperature Sensor */ | 16 | #define TEMP_MINOR 131 /* Temperature Sensor */ |
17 | #define RTC_MINOR 135 | 17 | #define RTC_MINOR 135 |
18 | #define EFI_RTC_MINOR 136 /* EFI Time services */ | 18 | #define EFI_RTC_MINOR 136 /* EFI Time services */ |
19 | #define SUN_OPENPROM_MINOR 139 | 19 | #define SUN_OPENPROM_MINOR 139 |
20 | #define DMAPI_MINOR 140 /* DMAPI */ | 20 | #define DMAPI_MINOR 140 /* DMAPI */ |
21 | #define NVRAM_MINOR 144 | 21 | #define NVRAM_MINOR 144 |
22 | #define SGI_MMTIMER 153 | 22 | #define SGI_MMTIMER 153 |
23 | #define STORE_QUEUE_MINOR 155 | 23 | #define STORE_QUEUE_MINOR 155 |
24 | #define I2O_MINOR 166 | 24 | #define I2O_MINOR 166 |
25 | #define MICROCODE_MINOR 184 | 25 | #define MICROCODE_MINOR 184 |
26 | #define MWAVE_MINOR 219 /* ACP/Mwave Modem */ | 26 | #define TUN_MINOR 200 |
27 | #define MPT_MINOR 220 | 27 | #define MWAVE_MINOR 219 /* ACP/Mwave Modem */ |
28 | #define MISC_DYNAMIC_MINOR 255 | 28 | #define MPT_MINOR 220 |
29 | 29 | #define HPET_MINOR 228 | |
30 | #define TUN_MINOR 200 | 30 | #define FUSE_MINOR 229 |
31 | #define HPET_MINOR 228 | 31 | #define KVM_MINOR 232 |
32 | #define KVM_MINOR 232 | 32 | #define MISC_DYNAMIC_MINOR 255 |
33 | 33 | ||
34 | struct device; | 34 | struct device; |
35 | 35 | ||
diff --git a/include/linux/mm.h b/include/linux/mm.h index aaa8b843be28..4a3d28c86443 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -717,6 +717,11 @@ static inline int page_mapped(struct page *page) | |||
717 | 717 | ||
718 | #define VM_FAULT_ERROR (VM_FAULT_OOM | VM_FAULT_SIGBUS) | 718 | #define VM_FAULT_ERROR (VM_FAULT_OOM | VM_FAULT_SIGBUS) |
719 | 719 | ||
720 | /* | ||
721 | * Can be called by the pagefault handler when it gets a VM_FAULT_OOM. | ||
722 | */ | ||
723 | extern void pagefault_out_of_memory(void); | ||
724 | |||
720 | #define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK) | 725 | #define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK) |
721 | 726 | ||
722 | extern void show_free_areas(void); | 727 | extern void show_free_areas(void); |
diff --git a/include/linux/module.h b/include/linux/module.h index 3bfed013350b..4f7ea12463d3 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -294,9 +294,6 @@ struct module | |||
294 | /* The size of the executable code in each section. */ | 294 | /* The size of the executable code in each section. */ |
295 | unsigned int init_text_size, core_text_size; | 295 | unsigned int init_text_size, core_text_size; |
296 | 296 | ||
297 | /* The handle returned from unwind_add_table. */ | ||
298 | void *unwind_info; | ||
299 | |||
300 | /* Arch-specific module values */ | 297 | /* Arch-specific module values */ |
301 | struct mod_arch_specific arch; | 298 | struct mod_arch_specific arch; |
302 | 299 | ||
@@ -368,6 +365,18 @@ struct module *module_text_address(unsigned long addr); | |||
368 | struct module *__module_text_address(unsigned long addr); | 365 | struct module *__module_text_address(unsigned long addr); |
369 | int is_module_address(unsigned long addr); | 366 | int is_module_address(unsigned long addr); |
370 | 367 | ||
368 | static inline int within_module_core(unsigned long addr, struct module *mod) | ||
369 | { | ||
370 | return (unsigned long)mod->module_core <= addr && | ||
371 | addr < (unsigned long)mod->module_core + mod->core_size; | ||
372 | } | ||
373 | |||
374 | static inline int within_module_init(unsigned long addr, struct module *mod) | ||
375 | { | ||
376 | return (unsigned long)mod->module_init <= addr && | ||
377 | addr < (unsigned long)mod->module_init + mod->init_size; | ||
378 | } | ||
379 | |||
371 | /* Returns 0 and fills in value, defined and namebuf, or -ERANGE if | 380 | /* Returns 0 and fills in value, defined and namebuf, or -ERANGE if |
372 | symnum out of range. */ | 381 | symnum out of range. */ |
373 | int module_get_kallsym(unsigned int symnum, unsigned long *value, char *type, | 382 | int module_get_kallsym(unsigned int symnum, unsigned long *value, char *type, |
diff --git a/include/linux/moduleloader.h b/include/linux/moduleloader.h index eb1033957486..c1f40c2f7ffb 100644 --- a/include/linux/moduleloader.h +++ b/include/linux/moduleloader.h | |||
@@ -13,6 +13,9 @@ int module_frob_arch_sections(Elf_Ehdr *hdr, | |||
13 | char *secstrings, | 13 | char *secstrings, |
14 | struct module *mod); | 14 | struct module *mod); |
15 | 15 | ||
16 | /* Additional bytes needed by arch in front of individual sections */ | ||
17 | unsigned int arch_mod_section_prepend(struct module *mod, unsigned int section); | ||
18 | |||
16 | /* Allocator used for allocating struct module, core sections and init | 19 | /* Allocator used for allocating struct module, core sections and init |
17 | sections. Returns NULL on failure. */ | 20 | sections. Returns NULL on failure. */ |
18 | void *module_alloc(unsigned long size); | 21 | void *module_alloc(unsigned long size); |
diff --git a/include/linux/mtd/concat.h b/include/linux/mtd/concat.h index c02f3d264ecf..e80c674daeb3 100644 --- a/include/linux/mtd/concat.h +++ b/include/linux/mtd/concat.h | |||
@@ -13,7 +13,7 @@ | |||
13 | struct mtd_info *mtd_concat_create( | 13 | struct mtd_info *mtd_concat_create( |
14 | struct mtd_info *subdev[], /* subdevices to concatenate */ | 14 | struct mtd_info *subdev[], /* subdevices to concatenate */ |
15 | int num_devs, /* number of subdevices */ | 15 | int num_devs, /* number of subdevices */ |
16 | char *name); /* name for the new device */ | 16 | const char *name); /* name for the new device */ |
17 | 17 | ||
18 | void mtd_concat_destroy(struct mtd_info *mtd); | 18 | void mtd_concat_destroy(struct mtd_info *mtd); |
19 | 19 | ||
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 41e1224651cf..c28bbba3c23d 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -313,10 +313,11 @@ struct napi_struct { | |||
313 | #ifdef CONFIG_NETPOLL | 313 | #ifdef CONFIG_NETPOLL |
314 | spinlock_t poll_lock; | 314 | spinlock_t poll_lock; |
315 | int poll_owner; | 315 | int poll_owner; |
316 | struct net_device *dev; | ||
317 | #endif | 316 | #endif |
317 | struct net_device *dev; | ||
318 | struct list_head dev_list; | 318 | struct list_head dev_list; |
319 | struct sk_buff *gro_list; | 319 | struct sk_buff *gro_list; |
320 | struct sk_buff *skb; | ||
320 | }; | 321 | }; |
321 | 322 | ||
322 | enum | 323 | enum |
@@ -990,6 +991,9 @@ struct napi_gro_cb { | |||
990 | 991 | ||
991 | /* Number of segments aggregated. */ | 992 | /* Number of segments aggregated. */ |
992 | int count; | 993 | int count; |
994 | |||
995 | /* Free the skb? */ | ||
996 | int free; | ||
993 | }; | 997 | }; |
994 | 998 | ||
995 | #define NAPI_GRO_CB(skb) ((struct napi_gro_cb *)(skb)->cb) | 999 | #define NAPI_GRO_CB(skb) ((struct napi_gro_cb *)(skb)->cb) |
@@ -1011,6 +1015,14 @@ struct packet_type { | |||
1011 | struct list_head list; | 1015 | struct list_head list; |
1012 | }; | 1016 | }; |
1013 | 1017 | ||
1018 | struct napi_gro_fraginfo { | ||
1019 | skb_frag_t frags[MAX_SKB_FRAGS]; | ||
1020 | unsigned int nr_frags; | ||
1021 | unsigned int ip_summed; | ||
1022 | unsigned int len; | ||
1023 | __wsum csum; | ||
1024 | }; | ||
1025 | |||
1014 | #include <linux/interrupt.h> | 1026 | #include <linux/interrupt.h> |
1015 | #include <linux/notifier.h> | 1027 | #include <linux/notifier.h> |
1016 | 1028 | ||
@@ -1363,6 +1375,8 @@ extern int netif_receive_skb(struct sk_buff *skb); | |||
1363 | extern void napi_gro_flush(struct napi_struct *napi); | 1375 | extern void napi_gro_flush(struct napi_struct *napi); |
1364 | extern int napi_gro_receive(struct napi_struct *napi, | 1376 | extern int napi_gro_receive(struct napi_struct *napi, |
1365 | struct sk_buff *skb); | 1377 | struct sk_buff *skb); |
1378 | extern int napi_gro_frags(struct napi_struct *napi, | ||
1379 | struct napi_gro_fraginfo *info); | ||
1366 | extern void netif_nit_deliver(struct sk_buff *skb); | 1380 | extern void netif_nit_deliver(struct sk_buff *skb); |
1367 | extern int dev_valid_name(const char *name); | 1381 | extern int dev_valid_name(const char *name); |
1368 | extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *); | 1382 | extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *); |
diff --git a/include/linux/node.h b/include/linux/node.h index bc001bc225c3..681a697b9a86 100644 --- a/include/linux/node.h +++ b/include/linux/node.h | |||
@@ -26,6 +26,7 @@ struct node { | |||
26 | struct sys_device sysdev; | 26 | struct sys_device sysdev; |
27 | }; | 27 | }; |
28 | 28 | ||
29 | struct memory_block; | ||
29 | extern struct node node_devices[]; | 30 | extern struct node node_devices[]; |
30 | 31 | ||
31 | extern int register_node(struct node *, int, struct node *); | 32 | extern int register_node(struct node *, int, struct node *); |
@@ -35,6 +36,9 @@ extern int register_one_node(int nid); | |||
35 | extern void unregister_one_node(int nid); | 36 | extern void unregister_one_node(int nid); |
36 | extern int register_cpu_under_node(unsigned int cpu, unsigned int nid); | 37 | extern int register_cpu_under_node(unsigned int cpu, unsigned int nid); |
37 | extern int unregister_cpu_under_node(unsigned int cpu, unsigned int nid); | 38 | extern int unregister_cpu_under_node(unsigned int cpu, unsigned int nid); |
39 | extern int register_mem_sect_under_node(struct memory_block *mem_blk, | ||
40 | int nid); | ||
41 | extern int unregister_mem_sect_under_nodes(struct memory_block *mem_blk); | ||
38 | #else | 42 | #else |
39 | static inline int register_one_node(int nid) | 43 | static inline int register_one_node(int nid) |
40 | { | 44 | { |
@@ -52,6 +56,15 @@ static inline int unregister_cpu_under_node(unsigned int cpu, unsigned int nid) | |||
52 | { | 56 | { |
53 | return 0; | 57 | return 0; |
54 | } | 58 | } |
59 | static inline int register_mem_sect_under_node(struct memory_block *mem_blk, | ||
60 | int nid) | ||
61 | { | ||
62 | return 0; | ||
63 | } | ||
64 | static inline int unregister_mem_sect_under_nodes(struct memory_block *mem_blk) | ||
65 | { | ||
66 | return 0; | ||
67 | } | ||
55 | #endif | 68 | #endif |
56 | 69 | ||
57 | #define to_node(sys_device) container_of(sys_device, struct node, sysdev) | 70 | #define to_node(sys_device) container_of(sys_device, struct node, sysdev) |
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index b12f93a3c345..219a523ecdb0 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -228,6 +228,7 @@ PAGEFLAG_FALSE(HighMem) | |||
228 | PAGEFLAG(SwapCache, swapcache) | 228 | PAGEFLAG(SwapCache, swapcache) |
229 | #else | 229 | #else |
230 | PAGEFLAG_FALSE(SwapCache) | 230 | PAGEFLAG_FALSE(SwapCache) |
231 | SETPAGEFLAG_NOOP(SwapCache) CLEARPAGEFLAG_NOOP(SwapCache) | ||
231 | #endif | 232 | #endif |
232 | 233 | ||
233 | #ifdef CONFIG_UNEVICTABLE_LRU | 234 | #ifdef CONFIG_UNEVICTABLE_LRU |
@@ -372,31 +373,22 @@ static inline void __ClearPageTail(struct page *page) | |||
372 | #define __PG_MLOCKED 0 | 373 | #define __PG_MLOCKED 0 |
373 | #endif | 374 | #endif |
374 | 375 | ||
375 | #define PAGE_FLAGS (1 << PG_lru | 1 << PG_private | 1 << PG_locked | \ | ||
376 | 1 << PG_buddy | 1 << PG_writeback | \ | ||
377 | 1 << PG_slab | 1 << PG_swapcache | 1 << PG_active | \ | ||
378 | __PG_UNEVICTABLE | __PG_MLOCKED) | ||
379 | |||
380 | /* | ||
381 | * Flags checked in bad_page(). Pages on the free list should not have | ||
382 | * these flags set. It they are, there is a problem. | ||
383 | */ | ||
384 | #define PAGE_FLAGS_CLEAR_WHEN_BAD (PAGE_FLAGS | \ | ||
385 | 1 << PG_reclaim | 1 << PG_dirty | 1 << PG_swapbacked) | ||
386 | |||
387 | /* | 376 | /* |
388 | * Flags checked when a page is freed. Pages being freed should not have | 377 | * Flags checked when a page is freed. Pages being freed should not have |
389 | * these flags set. It they are, there is a problem. | 378 | * these flags set. It they are, there is a problem. |
390 | */ | 379 | */ |
391 | #define PAGE_FLAGS_CHECK_AT_FREE (PAGE_FLAGS | 1 << PG_reserved) | 380 | #define PAGE_FLAGS_CHECK_AT_FREE \ |
381 | (1 << PG_lru | 1 << PG_private | 1 << PG_locked | \ | ||
382 | 1 << PG_buddy | 1 << PG_writeback | 1 << PG_reserved | \ | ||
383 | 1 << PG_slab | 1 << PG_swapcache | 1 << PG_active | \ | ||
384 | __PG_UNEVICTABLE | __PG_MLOCKED) | ||
392 | 385 | ||
393 | /* | 386 | /* |
394 | * Flags checked when a page is prepped for return by the page allocator. | 387 | * Flags checked when a page is prepped for return by the page allocator. |
395 | * Pages being prepped should not have these flags set. It they are, there | 388 | * Pages being prepped should not have any flags set. It they are set, |
396 | * is a problem. | 389 | * there has been a kernel bug or struct page corruption. |
397 | */ | 390 | */ |
398 | #define PAGE_FLAGS_CHECK_AT_PREP (PAGE_FLAGS | \ | 391 | #define PAGE_FLAGS_CHECK_AT_PREP ((1 << NR_PAGEFLAGS) - 1) |
399 | 1 << PG_reserved | 1 << PG_dirty | 1 << PG_swapbacked) | ||
400 | 392 | ||
401 | #endif /* !__GENERATING_BOUNDS_H */ | 393 | #endif /* !__GENERATING_BOUNDS_H */ |
402 | #endif /* PAGE_FLAGS_H */ | 394 | #endif /* PAGE_FLAGS_H */ |
diff --git a/include/linux/pagevec.h b/include/linux/pagevec.h index e90a2cb02915..7b2886fa7fdc 100644 --- a/include/linux/pagevec.h +++ b/include/linux/pagevec.h | |||
@@ -21,7 +21,6 @@ struct pagevec { | |||
21 | }; | 21 | }; |
22 | 22 | ||
23 | void __pagevec_release(struct pagevec *pvec); | 23 | void __pagevec_release(struct pagevec *pvec); |
24 | void __pagevec_release_nonlru(struct pagevec *pvec); | ||
25 | void __pagevec_free(struct pagevec *pvec); | 24 | void __pagevec_free(struct pagevec *pvec); |
26 | void ____pagevec_lru_add(struct pagevec *pvec, enum lru_list lru); | 25 | void ____pagevec_lru_add(struct pagevec *pvec, enum lru_list lru); |
27 | void pagevec_strip(struct pagevec *pvec); | 26 | void pagevec_strip(struct pagevec *pvec); |
@@ -69,12 +68,6 @@ static inline void pagevec_release(struct pagevec *pvec) | |||
69 | __pagevec_release(pvec); | 68 | __pagevec_release(pvec); |
70 | } | 69 | } |
71 | 70 | ||
72 | static inline void pagevec_release_nonlru(struct pagevec *pvec) | ||
73 | { | ||
74 | if (pagevec_count(pvec)) | ||
75 | __pagevec_release_nonlru(pvec); | ||
76 | } | ||
77 | |||
78 | static inline void pagevec_free(struct pagevec *pvec) | 71 | static inline void pagevec_free(struct pagevec *pvec) |
79 | { | 72 | { |
80 | if (pagevec_count(pvec)) | 73 | if (pagevec_count(pvec)) |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 03b0b8c3c81b..4bb156ba854a 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -421,7 +421,6 @@ struct pci_driver { | |||
421 | int (*resume_early) (struct pci_dev *dev); | 421 | int (*resume_early) (struct pci_dev *dev); |
422 | int (*resume) (struct pci_dev *dev); /* Device woken up */ | 422 | int (*resume) (struct pci_dev *dev); /* Device woken up */ |
423 | void (*shutdown) (struct pci_dev *dev); | 423 | void (*shutdown) (struct pci_dev *dev); |
424 | struct pm_ext_ops *pm; | ||
425 | struct pci_error_handlers *err_handler; | 424 | struct pci_error_handlers *err_handler; |
426 | struct device_driver driver; | 425 | struct device_driver driver; |
427 | struct pci_dynids dynids; | 426 | struct pci_dynids dynids; |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 218c73b1e6d4..d543365518ab 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -1658,6 +1658,7 @@ | |||
1658 | #define PCI_VENDOR_ID_ROCKWELL 0x127A | 1658 | #define PCI_VENDOR_ID_ROCKWELL 0x127A |
1659 | 1659 | ||
1660 | #define PCI_VENDOR_ID_ITE 0x1283 | 1660 | #define PCI_VENDOR_ID_ITE 0x1283 |
1661 | #define PCI_DEVICE_ID_ITE_8172 0x8172 | ||
1661 | #define PCI_DEVICE_ID_ITE_8211 0x8211 | 1662 | #define PCI_DEVICE_ID_ITE_8211 0x8211 |
1662 | #define PCI_DEVICE_ID_ITE_8212 0x8212 | 1663 | #define PCI_DEVICE_ID_ITE_8212 0x8212 |
1663 | #define PCI_DEVICE_ID_ITE_8213 0x8213 | 1664 | #define PCI_DEVICE_ID_ITE_8213 0x8213 |
diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h index 9007ccdfc112..a7684a513994 100644 --- a/include/linux/percpu_counter.h +++ b/include/linux/percpu_counter.h | |||
@@ -24,14 +24,18 @@ struct percpu_counter { | |||
24 | s32 *counters; | 24 | s32 *counters; |
25 | }; | 25 | }; |
26 | 26 | ||
27 | #if NR_CPUS >= 16 | 27 | extern int percpu_counter_batch; |
28 | #define FBC_BATCH (NR_CPUS*2) | 28 | |
29 | #else | 29 | int __percpu_counter_init(struct percpu_counter *fbc, s64 amount, |
30 | #define FBC_BATCH (NR_CPUS*4) | 30 | struct lock_class_key *key); |
31 | #endif | 31 | |
32 | #define percpu_counter_init(fbc, value) \ | ||
33 | ({ \ | ||
34 | static struct lock_class_key __key; \ | ||
35 | \ | ||
36 | __percpu_counter_init(fbc, value, &__key); \ | ||
37 | }) | ||
32 | 38 | ||
33 | int percpu_counter_init(struct percpu_counter *fbc, s64 amount); | ||
34 | int percpu_counter_init_irq(struct percpu_counter *fbc, s64 amount); | ||
35 | void percpu_counter_destroy(struct percpu_counter *fbc); | 39 | void percpu_counter_destroy(struct percpu_counter *fbc); |
36 | void percpu_counter_set(struct percpu_counter *fbc, s64 amount); | 40 | void percpu_counter_set(struct percpu_counter *fbc, s64 amount); |
37 | void __percpu_counter_add(struct percpu_counter *fbc, s64 amount, s32 batch); | 41 | void __percpu_counter_add(struct percpu_counter *fbc, s64 amount, s32 batch); |
@@ -39,7 +43,7 @@ s64 __percpu_counter_sum(struct percpu_counter *fbc); | |||
39 | 43 | ||
40 | static inline void percpu_counter_add(struct percpu_counter *fbc, s64 amount) | 44 | static inline void percpu_counter_add(struct percpu_counter *fbc, s64 amount) |
41 | { | 45 | { |
42 | __percpu_counter_add(fbc, amount, FBC_BATCH); | 46 | __percpu_counter_add(fbc, amount, percpu_counter_batch); |
43 | } | 47 | } |
44 | 48 | ||
45 | static inline s64 percpu_counter_sum_positive(struct percpu_counter *fbc) | 49 | static inline s64 percpu_counter_sum_positive(struct percpu_counter *fbc) |
@@ -85,8 +89,6 @@ static inline int percpu_counter_init(struct percpu_counter *fbc, s64 amount) | |||
85 | return 0; | 89 | return 0; |
86 | } | 90 | } |
87 | 91 | ||
88 | #define percpu_counter_init_irq percpu_counter_init | ||
89 | |||
90 | static inline void percpu_counter_destroy(struct percpu_counter *fbc) | 92 | static inline void percpu_counter_destroy(struct percpu_counter *fbc) |
91 | { | 93 | { |
92 | } | 94 | } |
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 4b8cc6a32479..9a342699c607 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
@@ -55,7 +55,6 @@ struct platform_driver { | |||
55 | int (*suspend_late)(struct platform_device *, pm_message_t state); | 55 | int (*suspend_late)(struct platform_device *, pm_message_t state); |
56 | int (*resume_early)(struct platform_device *); | 56 | int (*resume_early)(struct platform_device *); |
57 | int (*resume)(struct platform_device *); | 57 | int (*resume)(struct platform_device *); |
58 | struct pm_ext_ops *pm; | ||
59 | struct device_driver driver; | 58 | struct device_driver driver; |
60 | }; | 59 | }; |
61 | 60 | ||
diff --git a/include/linux/pm.h b/include/linux/pm.h index 42de4003c4ee..de2e0a8f6728 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -41,7 +41,7 @@ typedef struct pm_message { | |||
41 | } pm_message_t; | 41 | } pm_message_t; |
42 | 42 | ||
43 | /** | 43 | /** |
44 | * struct pm_ops - device PM callbacks | 44 | * struct dev_pm_ops - device PM callbacks |
45 | * | 45 | * |
46 | * Several driver power state transitions are externally visible, affecting | 46 | * Several driver power state transitions are externally visible, affecting |
47 | * the state of pending I/O queues and (for drivers that touch hardware) | 47 | * the state of pending I/O queues and (for drivers that touch hardware) |
@@ -126,46 +126,6 @@ typedef struct pm_message { | |||
126 | * On most platforms, there are no restrictions on availability of | 126 | * On most platforms, there are no restrictions on availability of |
127 | * resources like clocks during @restore(). | 127 | * resources like clocks during @restore(). |
128 | * | 128 | * |
129 | * All of the above callbacks, except for @complete(), return error codes. | ||
130 | * However, the error codes returned by the resume operations, @resume(), | ||
131 | * @thaw(), and @restore(), do not cause the PM core to abort the resume | ||
132 | * transition during which they are returned. The error codes returned in | ||
133 | * that cases are only printed by the PM core to the system logs for debugging | ||
134 | * purposes. Still, it is recommended that drivers only return error codes | ||
135 | * from their resume methods in case of an unrecoverable failure (i.e. when the | ||
136 | * device being handled refuses to resume and becomes unusable) to allow us to | ||
137 | * modify the PM core in the future, so that it can avoid attempting to handle | ||
138 | * devices that failed to resume and their children. | ||
139 | * | ||
140 | * It is allowed to unregister devices while the above callbacks are being | ||
141 | * executed. However, it is not allowed to unregister a device from within any | ||
142 | * of its own callbacks. | ||
143 | */ | ||
144 | |||
145 | struct pm_ops { | ||
146 | int (*prepare)(struct device *dev); | ||
147 | void (*complete)(struct device *dev); | ||
148 | int (*suspend)(struct device *dev); | ||
149 | int (*resume)(struct device *dev); | ||
150 | int (*freeze)(struct device *dev); | ||
151 | int (*thaw)(struct device *dev); | ||
152 | int (*poweroff)(struct device *dev); | ||
153 | int (*restore)(struct device *dev); | ||
154 | }; | ||
155 | |||
156 | /** | ||
157 | * struct pm_ext_ops - extended device PM callbacks | ||
158 | * | ||
159 | * Some devices require certain operations related to suspend and hibernation | ||
160 | * to be carried out with interrupts disabled. Thus, 'struct pm_ext_ops' below | ||
161 | * is defined, adding callbacks to be executed with interrupts disabled to | ||
162 | * 'struct pm_ops'. | ||
163 | * | ||
164 | * The following callbacks included in 'struct pm_ext_ops' are executed with | ||
165 | * the nonboot CPUs switched off and with interrupts disabled on the only | ||
166 | * functional CPU. They also are executed with the PM core list of devices | ||
167 | * locked, so they must NOT unregister any devices. | ||
168 | * | ||
169 | * @suspend_noirq: Complete the operations of ->suspend() by carrying out any | 129 | * @suspend_noirq: Complete the operations of ->suspend() by carrying out any |
170 | * actions required for suspending the device that need interrupts to be | 130 | * actions required for suspending the device that need interrupts to be |
171 | * disabled | 131 | * disabled |
@@ -190,18 +150,32 @@ struct pm_ops { | |||
190 | * actions required for restoring the operations of the device that need | 150 | * actions required for restoring the operations of the device that need |
191 | * interrupts to be disabled | 151 | * interrupts to be disabled |
192 | * | 152 | * |
193 | * All of the above callbacks return error codes, but the error codes returned | 153 | * All of the above callbacks, except for @complete(), return error codes. |
194 | * by the resume operations, @resume_noirq(), @thaw_noirq(), and | 154 | * However, the error codes returned by the resume operations, @resume(), |
195 | * @restore_noirq(), do not cause the PM core to abort the resume transition | 155 | * @thaw(), @restore(), @resume_noirq(), @thaw_noirq(), and @restore_noirq() do |
196 | * during which they are returned. The error codes returned in that cases are | 156 | * not cause the PM core to abort the resume transition during which they are |
197 | * only printed by the PM core to the system logs for debugging purposes. | 157 | * returned. The error codes returned in that cases are only printed by the PM |
198 | * Still, as stated above, it is recommended that drivers only return error | 158 | * core to the system logs for debugging purposes. Still, it is recommended |
199 | * codes from their resume methods if the device being handled fails to resume | 159 | * that drivers only return error codes from their resume methods in case of an |
200 | * and is not usable any more. | 160 | * unrecoverable failure (i.e. when the device being handled refuses to resume |
161 | * and becomes unusable) to allow us to modify the PM core in the future, so | ||
162 | * that it can avoid attempting to handle devices that failed to resume and | ||
163 | * their children. | ||
164 | * | ||
165 | * It is allowed to unregister devices while the above callbacks are being | ||
166 | * executed. However, it is not allowed to unregister a device from within any | ||
167 | * of its own callbacks. | ||
201 | */ | 168 | */ |
202 | 169 | ||
203 | struct pm_ext_ops { | 170 | struct dev_pm_ops { |
204 | struct pm_ops base; | 171 | int (*prepare)(struct device *dev); |
172 | void (*complete)(struct device *dev); | ||
173 | int (*suspend)(struct device *dev); | ||
174 | int (*resume)(struct device *dev); | ||
175 | int (*freeze)(struct device *dev); | ||
176 | int (*thaw)(struct device *dev); | ||
177 | int (*poweroff)(struct device *dev); | ||
178 | int (*restore)(struct device *dev); | ||
205 | int (*suspend_noirq)(struct device *dev); | 179 | int (*suspend_noirq)(struct device *dev); |
206 | int (*resume_noirq)(struct device *dev); | 180 | int (*resume_noirq)(struct device *dev); |
207 | int (*freeze_noirq)(struct device *dev); | 181 | int (*freeze_noirq)(struct device *dev); |
@@ -278,7 +252,7 @@ struct pm_ext_ops { | |||
278 | #define PM_EVENT_SLEEP (PM_EVENT_SUSPEND | PM_EVENT_HIBERNATE) | 252 | #define PM_EVENT_SLEEP (PM_EVENT_SUSPEND | PM_EVENT_HIBERNATE) |
279 | #define PM_EVENT_USER_SUSPEND (PM_EVENT_USER | PM_EVENT_SUSPEND) | 253 | #define PM_EVENT_USER_SUSPEND (PM_EVENT_USER | PM_EVENT_SUSPEND) |
280 | #define PM_EVENT_USER_RESUME (PM_EVENT_USER | PM_EVENT_RESUME) | 254 | #define PM_EVENT_USER_RESUME (PM_EVENT_USER | PM_EVENT_RESUME) |
281 | #define PM_EVENT_REMOTE_WAKEUP (PM_EVENT_REMOTE | PM_EVENT_RESUME) | 255 | #define PM_EVENT_REMOTE_RESUME (PM_EVENT_REMOTE | PM_EVENT_RESUME) |
282 | #define PM_EVENT_AUTO_SUSPEND (PM_EVENT_AUTO | PM_EVENT_SUSPEND) | 256 | #define PM_EVENT_AUTO_SUSPEND (PM_EVENT_AUTO | PM_EVENT_SUSPEND) |
283 | #define PM_EVENT_AUTO_RESUME (PM_EVENT_AUTO | PM_EVENT_RESUME) | 257 | #define PM_EVENT_AUTO_RESUME (PM_EVENT_AUTO | PM_EVENT_RESUME) |
284 | 258 | ||
@@ -291,15 +265,15 @@ struct pm_ext_ops { | |||
291 | #define PMSG_THAW ((struct pm_message){ .event = PM_EVENT_THAW, }) | 265 | #define PMSG_THAW ((struct pm_message){ .event = PM_EVENT_THAW, }) |
292 | #define PMSG_RESTORE ((struct pm_message){ .event = PM_EVENT_RESTORE, }) | 266 | #define PMSG_RESTORE ((struct pm_message){ .event = PM_EVENT_RESTORE, }) |
293 | #define PMSG_RECOVER ((struct pm_message){ .event = PM_EVENT_RECOVER, }) | 267 | #define PMSG_RECOVER ((struct pm_message){ .event = PM_EVENT_RECOVER, }) |
294 | #define PMSG_USER_SUSPEND ((struct pm_messge) \ | 268 | #define PMSG_USER_SUSPEND ((struct pm_message) \ |
295 | { .event = PM_EVENT_USER_SUSPEND, }) | 269 | { .event = PM_EVENT_USER_SUSPEND, }) |
296 | #define PMSG_USER_RESUME ((struct pm_messge) \ | 270 | #define PMSG_USER_RESUME ((struct pm_message) \ |
297 | { .event = PM_EVENT_USER_RESUME, }) | 271 | { .event = PM_EVENT_USER_RESUME, }) |
298 | #define PMSG_REMOTE_RESUME ((struct pm_messge) \ | 272 | #define PMSG_REMOTE_RESUME ((struct pm_message) \ |
299 | { .event = PM_EVENT_REMOTE_RESUME, }) | 273 | { .event = PM_EVENT_REMOTE_RESUME, }) |
300 | #define PMSG_AUTO_SUSPEND ((struct pm_messge) \ | 274 | #define PMSG_AUTO_SUSPEND ((struct pm_message) \ |
301 | { .event = PM_EVENT_AUTO_SUSPEND, }) | 275 | { .event = PM_EVENT_AUTO_SUSPEND, }) |
302 | #define PMSG_AUTO_RESUME ((struct pm_messge) \ | 276 | #define PMSG_AUTO_RESUME ((struct pm_message) \ |
303 | { .event = PM_EVENT_AUTO_RESUME, }) | 277 | { .event = PM_EVENT_AUTO_RESUME, }) |
304 | 278 | ||
305 | /** | 279 | /** |
diff --git a/include/linux/poll.h b/include/linux/poll.h index badd98ab06f6..8c24ef8d9976 100644 --- a/include/linux/poll.h +++ b/include/linux/poll.h | |||
@@ -46,9 +46,9 @@ static inline void init_poll_funcptr(poll_table *pt, poll_queue_proc qproc) | |||
46 | } | 46 | } |
47 | 47 | ||
48 | struct poll_table_entry { | 48 | struct poll_table_entry { |
49 | struct file * filp; | 49 | struct file *filp; |
50 | wait_queue_t wait; | 50 | wait_queue_t wait; |
51 | wait_queue_head_t * wait_address; | 51 | wait_queue_head_t *wait_address; |
52 | }; | 52 | }; |
53 | 53 | ||
54 | /* | 54 | /* |
@@ -56,7 +56,9 @@ struct poll_table_entry { | |||
56 | */ | 56 | */ |
57 | struct poll_wqueues { | 57 | struct poll_wqueues { |
58 | poll_table pt; | 58 | poll_table pt; |
59 | struct poll_table_page * table; | 59 | struct poll_table_page *table; |
60 | struct task_struct *polling_task; | ||
61 | int triggered; | ||
60 | int error; | 62 | int error; |
61 | int inline_index; | 63 | int inline_index; |
62 | struct poll_table_entry inline_entries[N_INLINE_POLL_ENTRIES]; | 64 | struct poll_table_entry inline_entries[N_INLINE_POLL_ENTRIES]; |
@@ -64,6 +66,13 @@ struct poll_wqueues { | |||
64 | 66 | ||
65 | extern void poll_initwait(struct poll_wqueues *pwq); | 67 | extern void poll_initwait(struct poll_wqueues *pwq); |
66 | extern void poll_freewait(struct poll_wqueues *pwq); | 68 | extern void poll_freewait(struct poll_wqueues *pwq); |
69 | extern int poll_schedule_timeout(struct poll_wqueues *pwq, int state, | ||
70 | ktime_t *expires, unsigned long slack); | ||
71 | |||
72 | static inline int poll_schedule(struct poll_wqueues *pwq, int state) | ||
73 | { | ||
74 | return poll_schedule_timeout(pwq, state, NULL, 0); | ||
75 | } | ||
67 | 76 | ||
68 | /* | 77 | /* |
69 | * Scaleable version of the fd_set. | 78 | * Scaleable version of the fd_set. |
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index f9348cba6dc1..8ff25e0e7f7a 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h | |||
@@ -45,6 +45,7 @@ enum { | |||
45 | POWER_SUPPLY_HEALTH_DEAD, | 45 | POWER_SUPPLY_HEALTH_DEAD, |
46 | POWER_SUPPLY_HEALTH_OVERVOLTAGE, | 46 | POWER_SUPPLY_HEALTH_OVERVOLTAGE, |
47 | POWER_SUPPLY_HEALTH_UNSPEC_FAILURE, | 47 | POWER_SUPPLY_HEALTH_UNSPEC_FAILURE, |
48 | POWER_SUPPLY_HEALTH_COLD, | ||
48 | }; | 49 | }; |
49 | 50 | ||
50 | enum { | 51 | enum { |
diff --git a/include/linux/quota.h b/include/linux/quota.h index 40401b554484..d72d5d84fde5 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h | |||
@@ -36,17 +36,7 @@ | |||
36 | #include <linux/errno.h> | 36 | #include <linux/errno.h> |
37 | #include <linux/types.h> | 37 | #include <linux/types.h> |
38 | 38 | ||
39 | #define __DQUOT_VERSION__ "dquot_6.5.1" | 39 | #define __DQUOT_VERSION__ "dquot_6.5.2" |
40 | #define __DQUOT_NUM_VERSION__ 6*10000+5*100+1 | ||
41 | |||
42 | /* Size of blocks in which are counted size limits */ | ||
43 | #define QUOTABLOCK_BITS 10 | ||
44 | #define QUOTABLOCK_SIZE (1 << QUOTABLOCK_BITS) | ||
45 | |||
46 | /* Conversion routines from and to quota blocks */ | ||
47 | #define qb2kb(x) ((x) << (QUOTABLOCK_BITS-10)) | ||
48 | #define kb2qb(x) ((x) >> (QUOTABLOCK_BITS-10)) | ||
49 | #define toqb(x) (((x) + QUOTABLOCK_SIZE - 1) >> QUOTABLOCK_BITS) | ||
50 | 40 | ||
51 | #define MAXQUOTAS 2 | 41 | #define MAXQUOTAS 2 |
52 | #define USRQUOTA 0 /* element used for user quotas */ | 42 | #define USRQUOTA 0 /* element used for user quotas */ |
@@ -80,16 +70,34 @@ | |||
80 | #define Q_GETQUOTA 0x800007 /* get user quota structure */ | 70 | #define Q_GETQUOTA 0x800007 /* get user quota structure */ |
81 | #define Q_SETQUOTA 0x800008 /* set user quota structure */ | 71 | #define Q_SETQUOTA 0x800008 /* set user quota structure */ |
82 | 72 | ||
73 | /* Quota format type IDs */ | ||
74 | #define QFMT_VFS_OLD 1 | ||
75 | #define QFMT_VFS_V0 2 | ||
76 | |||
77 | /* Size of block in which space limits are passed through the quota | ||
78 | * interface */ | ||
79 | #define QIF_DQBLKSIZE_BITS 10 | ||
80 | #define QIF_DQBLKSIZE (1 << QIF_DQBLKSIZE_BITS) | ||
81 | |||
83 | /* | 82 | /* |
84 | * Quota structure used for communication with userspace via quotactl | 83 | * Quota structure used for communication with userspace via quotactl |
85 | * Following flags are used to specify which fields are valid | 84 | * Following flags are used to specify which fields are valid |
86 | */ | 85 | */ |
87 | #define QIF_BLIMITS 1 | 86 | enum { |
88 | #define QIF_SPACE 2 | 87 | QIF_BLIMITS_B = 0, |
89 | #define QIF_ILIMITS 4 | 88 | QIF_SPACE_B, |
90 | #define QIF_INODES 8 | 89 | QIF_ILIMITS_B, |
91 | #define QIF_BTIME 16 | 90 | QIF_INODES_B, |
92 | #define QIF_ITIME 32 | 91 | QIF_BTIME_B, |
92 | QIF_ITIME_B, | ||
93 | }; | ||
94 | |||
95 | #define QIF_BLIMITS (1 << QIF_BLIMITS_B) | ||
96 | #define QIF_SPACE (1 << QIF_SPACE_B) | ||
97 | #define QIF_ILIMITS (1 << QIF_ILIMITS_B) | ||
98 | #define QIF_INODES (1 << QIF_INODES_B) | ||
99 | #define QIF_BTIME (1 << QIF_BTIME_B) | ||
100 | #define QIF_ITIME (1 << QIF_ITIME_B) | ||
93 | #define QIF_LIMITS (QIF_BLIMITS | QIF_ILIMITS) | 101 | #define QIF_LIMITS (QIF_BLIMITS | QIF_ILIMITS) |
94 | #define QIF_USAGE (QIF_SPACE | QIF_INODES) | 102 | #define QIF_USAGE (QIF_SPACE | QIF_INODES) |
95 | #define QIF_TIMES (QIF_BTIME | QIF_ITIME) | 103 | #define QIF_TIMES (QIF_BTIME | QIF_ITIME) |
@@ -172,7 +180,7 @@ enum { | |||
172 | #include <asm/atomic.h> | 180 | #include <asm/atomic.h> |
173 | 181 | ||
174 | typedef __kernel_uid32_t qid_t; /* Type in which we store ids in memory */ | 182 | typedef __kernel_uid32_t qid_t; /* Type in which we store ids in memory */ |
175 | typedef __u64 qsize_t; /* Type in which we store sizes */ | 183 | typedef long long qsize_t; /* Type in which we store sizes */ |
176 | 184 | ||
177 | extern spinlock_t dq_data_lock; | 185 | extern spinlock_t dq_data_lock; |
178 | 186 | ||
@@ -187,12 +195,12 @@ extern spinlock_t dq_data_lock; | |||
187 | * Data for one user/group kept in memory | 195 | * Data for one user/group kept in memory |
188 | */ | 196 | */ |
189 | struct mem_dqblk { | 197 | struct mem_dqblk { |
190 | __u32 dqb_bhardlimit; /* absolute limit on disk blks alloc */ | 198 | qsize_t dqb_bhardlimit; /* absolute limit on disk blks alloc */ |
191 | __u32 dqb_bsoftlimit; /* preferred limit on disk blks */ | 199 | qsize_t dqb_bsoftlimit; /* preferred limit on disk blks */ |
192 | qsize_t dqb_curspace; /* current used space */ | 200 | qsize_t dqb_curspace; /* current used space */ |
193 | __u32 dqb_ihardlimit; /* absolute limit on allocated inodes */ | 201 | qsize_t dqb_ihardlimit; /* absolute limit on allocated inodes */ |
194 | __u32 dqb_isoftlimit; /* preferred inode limit */ | 202 | qsize_t dqb_isoftlimit; /* preferred inode limit */ |
195 | __u32 dqb_curinodes; /* current # allocated inodes */ | 203 | qsize_t dqb_curinodes; /* current # allocated inodes */ |
196 | time_t dqb_btime; /* time limit for excessive disk use */ | 204 | time_t dqb_btime; /* time limit for excessive disk use */ |
197 | time_t dqb_itime; /* time limit for excessive inode use */ | 205 | time_t dqb_itime; /* time limit for excessive inode use */ |
198 | }; | 206 | }; |
@@ -212,10 +220,7 @@ struct mem_dqinfo { | |||
212 | unsigned int dqi_igrace; | 220 | unsigned int dqi_igrace; |
213 | qsize_t dqi_maxblimit; | 221 | qsize_t dqi_maxblimit; |
214 | qsize_t dqi_maxilimit; | 222 | qsize_t dqi_maxilimit; |
215 | union { | 223 | void *dqi_priv; |
216 | struct v1_mem_dqinfo v1_i; | ||
217 | struct v2_mem_dqinfo v2_i; | ||
218 | } u; | ||
219 | }; | 224 | }; |
220 | 225 | ||
221 | struct super_block; | 226 | struct super_block; |
@@ -249,6 +254,11 @@ extern struct dqstats dqstats; | |||
249 | #define DQ_FAKE_B 3 /* no limits only usage */ | 254 | #define DQ_FAKE_B 3 /* no limits only usage */ |
250 | #define DQ_READ_B 4 /* dquot was read into memory */ | 255 | #define DQ_READ_B 4 /* dquot was read into memory */ |
251 | #define DQ_ACTIVE_B 5 /* dquot is active (dquot_release not called) */ | 256 | #define DQ_ACTIVE_B 5 /* dquot is active (dquot_release not called) */ |
257 | #define DQ_LASTSET_B 6 /* Following 6 bits (see QIF_) are reserved\ | ||
258 | * for the mask of entries set via SETQUOTA\ | ||
259 | * quotactl. They are set under dq_data_lock\ | ||
260 | * and the quota format handling dquot can\ | ||
261 | * clear them when it sees fit. */ | ||
252 | 262 | ||
253 | struct dquot { | 263 | struct dquot { |
254 | struct hlist_node dq_hash; /* Hash list in memory */ | 264 | struct hlist_node dq_hash; /* Hash list in memory */ |
@@ -287,11 +297,13 @@ struct dquot_operations { | |||
287 | int (*initialize) (struct inode *, int); | 297 | int (*initialize) (struct inode *, int); |
288 | int (*drop) (struct inode *); | 298 | int (*drop) (struct inode *); |
289 | int (*alloc_space) (struct inode *, qsize_t, int); | 299 | int (*alloc_space) (struct inode *, qsize_t, int); |
290 | int (*alloc_inode) (const struct inode *, unsigned long); | 300 | int (*alloc_inode) (const struct inode *, qsize_t); |
291 | int (*free_space) (struct inode *, qsize_t); | 301 | int (*free_space) (struct inode *, qsize_t); |
292 | int (*free_inode) (const struct inode *, unsigned long); | 302 | int (*free_inode) (const struct inode *, qsize_t); |
293 | int (*transfer) (struct inode *, struct iattr *); | 303 | int (*transfer) (struct inode *, struct iattr *); |
294 | int (*write_dquot) (struct dquot *); /* Ordinary dquot write */ | 304 | int (*write_dquot) (struct dquot *); /* Ordinary dquot write */ |
305 | struct dquot *(*alloc_dquot)(struct super_block *, int); /* Allocate memory for new dquot */ | ||
306 | void (*destroy_dquot)(struct dquot *); /* Free memory for dquot */ | ||
295 | int (*acquire_dquot) (struct dquot *); /* Quota is going to be created on disk */ | 307 | int (*acquire_dquot) (struct dquot *); /* Quota is going to be created on disk */ |
296 | int (*release_dquot) (struct dquot *); /* Quota is going to be deleted from disk */ | 308 | int (*release_dquot) (struct dquot *); /* Quota is going to be deleted from disk */ |
297 | int (*mark_dirty) (struct dquot *); /* Dquot is marked dirty */ | 309 | int (*mark_dirty) (struct dquot *); /* Dquot is marked dirty */ |
@@ -320,12 +332,42 @@ struct quota_format_type { | |||
320 | struct quota_format_type *qf_next; | 332 | struct quota_format_type *qf_next; |
321 | }; | 333 | }; |
322 | 334 | ||
323 | #define DQUOT_USR_ENABLED 0x01 /* User diskquotas enabled */ | 335 | /* Quota state flags - they actually come in two flavors - for users and groups */ |
324 | #define DQUOT_GRP_ENABLED 0x02 /* Group diskquotas enabled */ | 336 | enum { |
325 | #define DQUOT_USR_SUSPENDED 0x04 /* User diskquotas are off, but | 337 | _DQUOT_USAGE_ENABLED = 0, /* Track disk usage for users */ |
338 | _DQUOT_LIMITS_ENABLED, /* Enforce quota limits for users */ | ||
339 | _DQUOT_SUSPENDED, /* User diskquotas are off, but | ||
326 | * we have necessary info in | 340 | * we have necessary info in |
327 | * memory to turn them on */ | 341 | * memory to turn them on */ |
328 | #define DQUOT_GRP_SUSPENDED 0x08 /* The same for group quotas */ | 342 | _DQUOT_STATE_FLAGS |
343 | }; | ||
344 | #define DQUOT_USAGE_ENABLED (1 << _DQUOT_USAGE_ENABLED) | ||
345 | #define DQUOT_LIMITS_ENABLED (1 << _DQUOT_LIMITS_ENABLED) | ||
346 | #define DQUOT_SUSPENDED (1 << _DQUOT_SUSPENDED) | ||
347 | #define DQUOT_STATE_FLAGS (DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED | \ | ||
348 | DQUOT_SUSPENDED) | ||
349 | /* Other quota flags */ | ||
350 | #define DQUOT_QUOTA_SYS_FILE (1 << 6) /* Quota file is a special | ||
351 | * system file and user cannot | ||
352 | * touch it. Filesystem is | ||
353 | * responsible for setting | ||
354 | * S_NOQUOTA, S_NOATIME flags | ||
355 | */ | ||
356 | #define DQUOT_NEGATIVE_USAGE (1 << 7) /* Allow negative quota usage */ | ||
357 | |||
358 | static inline unsigned int dquot_state_flag(unsigned int flags, int type) | ||
359 | { | ||
360 | if (type == USRQUOTA) | ||
361 | return flags; | ||
362 | return flags << _DQUOT_STATE_FLAGS; | ||
363 | } | ||
364 | |||
365 | static inline unsigned int dquot_generic_flag(unsigned int flags, int type) | ||
366 | { | ||
367 | if (type == USRQUOTA) | ||
368 | return flags; | ||
369 | return flags >> _DQUOT_STATE_FLAGS; | ||
370 | } | ||
329 | 371 | ||
330 | struct quota_info { | 372 | struct quota_info { |
331 | unsigned int flags; /* Flags for diskquotas on this device */ | 373 | unsigned int flags; /* Flags for diskquotas on this device */ |
diff --git a/include/linux/quotaio_v1.h b/include/linux/quotaio_v1.h deleted file mode 100644 index 746654b5de70..000000000000 --- a/include/linux/quotaio_v1.h +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | #ifndef _LINUX_QUOTAIO_V1_H | ||
2 | #define _LINUX_QUOTAIO_V1_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | /* | ||
7 | * The following constants define the amount of time given a user | ||
8 | * before the soft limits are treated as hard limits (usually resulting | ||
9 | * in an allocation failure). The timer is started when the user crosses | ||
10 | * their soft limit, it is reset when they go below their soft limit. | ||
11 | */ | ||
12 | #define MAX_IQ_TIME 604800 /* (7*24*60*60) 1 week */ | ||
13 | #define MAX_DQ_TIME 604800 /* (7*24*60*60) 1 week */ | ||
14 | |||
15 | /* | ||
16 | * The following structure defines the format of the disk quota file | ||
17 | * (as it appears on disk) - the file is an array of these structures | ||
18 | * indexed by user or group number. | ||
19 | */ | ||
20 | struct v1_disk_dqblk { | ||
21 | __u32 dqb_bhardlimit; /* absolute limit on disk blks alloc */ | ||
22 | __u32 dqb_bsoftlimit; /* preferred limit on disk blks */ | ||
23 | __u32 dqb_curblocks; /* current block count */ | ||
24 | __u32 dqb_ihardlimit; /* absolute limit on allocated inodes */ | ||
25 | __u32 dqb_isoftlimit; /* preferred inode limit */ | ||
26 | __u32 dqb_curinodes; /* current # allocated inodes */ | ||
27 | time_t dqb_btime; /* time limit for excessive disk use */ | ||
28 | time_t dqb_itime; /* time limit for excessive inode use */ | ||
29 | }; | ||
30 | |||
31 | #define v1_dqoff(UID) ((loff_t)((UID) * sizeof (struct v1_disk_dqblk))) | ||
32 | |||
33 | #endif /* _LINUX_QUOTAIO_V1_H */ | ||
diff --git a/include/linux/quotaio_v2.h b/include/linux/quotaio_v2.h deleted file mode 100644 index 303d7cbe30d4..000000000000 --- a/include/linux/quotaio_v2.h +++ /dev/null | |||
@@ -1,79 +0,0 @@ | |||
1 | /* | ||
2 | * Definitions of structures for vfsv0 quota format | ||
3 | */ | ||
4 | |||
5 | #ifndef _LINUX_QUOTAIO_V2_H | ||
6 | #define _LINUX_QUOTAIO_V2_H | ||
7 | |||
8 | #include <linux/types.h> | ||
9 | #include <linux/quota.h> | ||
10 | |||
11 | /* | ||
12 | * Definitions of magics and versions of current quota files | ||
13 | */ | ||
14 | #define V2_INITQMAGICS {\ | ||
15 | 0xd9c01f11, /* USRQUOTA */\ | ||
16 | 0xd9c01927 /* GRPQUOTA */\ | ||
17 | } | ||
18 | |||
19 | #define V2_INITQVERSIONS {\ | ||
20 | 0, /* USRQUOTA */\ | ||
21 | 0 /* GRPQUOTA */\ | ||
22 | } | ||
23 | |||
24 | /* | ||
25 | * The following structure defines the format of the disk quota file | ||
26 | * (as it appears on disk) - the file is a radix tree whose leaves point | ||
27 | * to blocks of these structures. | ||
28 | */ | ||
29 | struct v2_disk_dqblk { | ||
30 | __le32 dqb_id; /* id this quota applies to */ | ||
31 | __le32 dqb_ihardlimit; /* absolute limit on allocated inodes */ | ||
32 | __le32 dqb_isoftlimit; /* preferred inode limit */ | ||
33 | __le32 dqb_curinodes; /* current # allocated inodes */ | ||
34 | __le32 dqb_bhardlimit; /* absolute limit on disk space (in QUOTABLOCK_SIZE) */ | ||
35 | __le32 dqb_bsoftlimit; /* preferred limit on disk space (in QUOTABLOCK_SIZE) */ | ||
36 | __le64 dqb_curspace; /* current space occupied (in bytes) */ | ||
37 | __le64 dqb_btime; /* time limit for excessive disk use */ | ||
38 | __le64 dqb_itime; /* time limit for excessive inode use */ | ||
39 | }; | ||
40 | |||
41 | /* | ||
42 | * Here are header structures as written on disk and their in-memory copies | ||
43 | */ | ||
44 | /* First generic header */ | ||
45 | struct v2_disk_dqheader { | ||
46 | __le32 dqh_magic; /* Magic number identifying file */ | ||
47 | __le32 dqh_version; /* File version */ | ||
48 | }; | ||
49 | |||
50 | /* Header with type and version specific information */ | ||
51 | struct v2_disk_dqinfo { | ||
52 | __le32 dqi_bgrace; /* Time before block soft limit becomes hard limit */ | ||
53 | __le32 dqi_igrace; /* Time before inode soft limit becomes hard limit */ | ||
54 | __le32 dqi_flags; /* Flags for quotafile (DQF_*) */ | ||
55 | __le32 dqi_blocks; /* Number of blocks in file */ | ||
56 | __le32 dqi_free_blk; /* Number of first free block in the list */ | ||
57 | __le32 dqi_free_entry; /* Number of block with at least one free entry */ | ||
58 | }; | ||
59 | |||
60 | /* | ||
61 | * Structure of header of block with quota structures. It is padded to 16 bytes so | ||
62 | * there will be space for exactly 21 quota-entries in a block | ||
63 | */ | ||
64 | struct v2_disk_dqdbheader { | ||
65 | __le32 dqdh_next_free; /* Number of next block with free entry */ | ||
66 | __le32 dqdh_prev_free; /* Number of previous block with free entry */ | ||
67 | __le16 dqdh_entries; /* Number of valid entries in block */ | ||
68 | __le16 dqdh_pad1; | ||
69 | __le32 dqdh_pad2; | ||
70 | }; | ||
71 | |||
72 | #define V2_DQINFOOFF sizeof(struct v2_disk_dqheader) /* Offset of info header in file */ | ||
73 | #define V2_DQBLKSIZE_BITS 10 | ||
74 | #define V2_DQBLKSIZE (1 << V2_DQBLKSIZE_BITS) /* Size of block with quota structures */ | ||
75 | #define V2_DQTREEOFF 1 /* Offset of tree in file in blocks */ | ||
76 | #define V2_DQTREEDEPTH 4 /* Depth of quota tree */ | ||
77 | #define V2_DQSTRINBLK ((V2_DQBLKSIZE - sizeof(struct v2_disk_dqdbheader)) / sizeof(struct v2_disk_dqblk)) /* Number of entries in one blocks */ | ||
78 | |||
79 | #endif /* _LINUX_QUOTAIO_V2_H */ | ||
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h index a558a4c1d35a..21b781a3350f 100644 --- a/include/linux/quotaops.h +++ b/include/linux/quotaops.h | |||
@@ -24,12 +24,21 @@ void sync_dquots(struct super_block *sb, int type); | |||
24 | 24 | ||
25 | int dquot_initialize(struct inode *inode, int type); | 25 | int dquot_initialize(struct inode *inode, int type); |
26 | int dquot_drop(struct inode *inode); | 26 | int dquot_drop(struct inode *inode); |
27 | int dquot_drop_locked(struct inode *inode); | ||
28 | struct dquot *dqget(struct super_block *sb, unsigned int id, int type); | ||
29 | void dqput(struct dquot *dquot); | ||
30 | int dquot_is_cached(struct super_block *sb, unsigned int id, int type); | ||
31 | int dquot_scan_active(struct super_block *sb, | ||
32 | int (*fn)(struct dquot *dquot, unsigned long priv), | ||
33 | unsigned long priv); | ||
34 | struct dquot *dquot_alloc(struct super_block *sb, int type); | ||
35 | void dquot_destroy(struct dquot *dquot); | ||
27 | 36 | ||
28 | int dquot_alloc_space(struct inode *inode, qsize_t number, int prealloc); | 37 | int dquot_alloc_space(struct inode *inode, qsize_t number, int prealloc); |
29 | int dquot_alloc_inode(const struct inode *inode, unsigned long number); | 38 | int dquot_alloc_inode(const struct inode *inode, qsize_t number); |
30 | 39 | ||
31 | int dquot_free_space(struct inode *inode, qsize_t number); | 40 | int dquot_free_space(struct inode *inode, qsize_t number); |
32 | int dquot_free_inode(const struct inode *inode, unsigned long number); | 41 | int dquot_free_inode(const struct inode *inode, qsize_t number); |
33 | 42 | ||
34 | int dquot_transfer(struct inode *inode, struct iattr *iattr); | 43 | int dquot_transfer(struct inode *inode, struct iattr *iattr); |
35 | int dquot_commit(struct dquot *dquot); | 44 | int dquot_commit(struct dquot *dquot); |
@@ -40,11 +49,14 @@ int dquot_mark_dquot_dirty(struct dquot *dquot); | |||
40 | 49 | ||
41 | int vfs_quota_on(struct super_block *sb, int type, int format_id, | 50 | int vfs_quota_on(struct super_block *sb, int type, int format_id, |
42 | char *path, int remount); | 51 | char *path, int remount); |
52 | int vfs_quota_enable(struct inode *inode, int type, int format_id, | ||
53 | unsigned int flags); | ||
43 | int vfs_quota_on_path(struct super_block *sb, int type, int format_id, | 54 | int vfs_quota_on_path(struct super_block *sb, int type, int format_id, |
44 | struct path *path); | 55 | struct path *path); |
45 | int vfs_quota_on_mount(struct super_block *sb, char *qf_name, | 56 | int vfs_quota_on_mount(struct super_block *sb, char *qf_name, |
46 | int format_id, int type); | 57 | int format_id, int type); |
47 | int vfs_quota_off(struct super_block *sb, int type, int remount); | 58 | int vfs_quota_off(struct super_block *sb, int type, int remount); |
59 | int vfs_quota_disable(struct super_block *sb, int type, unsigned int flags); | ||
48 | int vfs_quota_sync(struct super_block *sb, int type); | 60 | int vfs_quota_sync(struct super_block *sb, int type); |
49 | int vfs_get_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); | 61 | int vfs_get_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); |
50 | int vfs_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); | 62 | int vfs_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); |
@@ -64,24 +76,22 @@ static inline struct mem_dqinfo *sb_dqinfo(struct super_block *sb, int type) | |||
64 | * Functions for checking status of quota | 76 | * Functions for checking status of quota |
65 | */ | 77 | */ |
66 | 78 | ||
67 | static inline int sb_has_quota_enabled(struct super_block *sb, int type) | 79 | static inline int sb_has_quota_usage_enabled(struct super_block *sb, int type) |
68 | { | 80 | { |
69 | if (type == USRQUOTA) | 81 | return sb_dqopt(sb)->flags & |
70 | return sb_dqopt(sb)->flags & DQUOT_USR_ENABLED; | 82 | dquot_state_flag(DQUOT_USAGE_ENABLED, type); |
71 | return sb_dqopt(sb)->flags & DQUOT_GRP_ENABLED; | ||
72 | } | 83 | } |
73 | 84 | ||
74 | static inline int sb_any_quota_enabled(struct super_block *sb) | 85 | static inline int sb_has_quota_limits_enabled(struct super_block *sb, int type) |
75 | { | 86 | { |
76 | return sb_has_quota_enabled(sb, USRQUOTA) || | 87 | return sb_dqopt(sb)->flags & |
77 | sb_has_quota_enabled(sb, GRPQUOTA); | 88 | dquot_state_flag(DQUOT_LIMITS_ENABLED, type); |
78 | } | 89 | } |
79 | 90 | ||
80 | static inline int sb_has_quota_suspended(struct super_block *sb, int type) | 91 | static inline int sb_has_quota_suspended(struct super_block *sb, int type) |
81 | { | 92 | { |
82 | if (type == USRQUOTA) | 93 | return sb_dqopt(sb)->flags & |
83 | return sb_dqopt(sb)->flags & DQUOT_USR_SUSPENDED; | 94 | dquot_state_flag(DQUOT_SUSPENDED, type); |
84 | return sb_dqopt(sb)->flags & DQUOT_GRP_SUSPENDED; | ||
85 | } | 95 | } |
86 | 96 | ||
87 | static inline int sb_any_quota_suspended(struct super_block *sb) | 97 | static inline int sb_any_quota_suspended(struct super_block *sb) |
@@ -90,6 +100,31 @@ static inline int sb_any_quota_suspended(struct super_block *sb) | |||
90 | sb_has_quota_suspended(sb, GRPQUOTA); | 100 | sb_has_quota_suspended(sb, GRPQUOTA); |
91 | } | 101 | } |
92 | 102 | ||
103 | /* Does kernel know about any quota information for given sb + type? */ | ||
104 | static inline int sb_has_quota_loaded(struct super_block *sb, int type) | ||
105 | { | ||
106 | /* Currently if anything is on, then quota usage is on as well */ | ||
107 | return sb_has_quota_usage_enabled(sb, type); | ||
108 | } | ||
109 | |||
110 | static inline int sb_any_quota_loaded(struct super_block *sb) | ||
111 | { | ||
112 | return sb_has_quota_loaded(sb, USRQUOTA) || | ||
113 | sb_has_quota_loaded(sb, GRPQUOTA); | ||
114 | } | ||
115 | |||
116 | static inline int sb_has_quota_active(struct super_block *sb, int type) | ||
117 | { | ||
118 | return sb_has_quota_loaded(sb, type) && | ||
119 | !sb_has_quota_suspended(sb, type); | ||
120 | } | ||
121 | |||
122 | static inline int sb_any_quota_active(struct super_block *sb) | ||
123 | { | ||
124 | return sb_has_quota_active(sb, USRQUOTA) || | ||
125 | sb_has_quota_active(sb, GRPQUOTA); | ||
126 | } | ||
127 | |||
93 | /* | 128 | /* |
94 | * Operations supported for diskquotas. | 129 | * Operations supported for diskquotas. |
95 | */ | 130 | */ |
@@ -104,7 +139,7 @@ extern struct quotactl_ops vfs_quotactl_ops; | |||
104 | static inline void vfs_dq_init(struct inode *inode) | 139 | static inline void vfs_dq_init(struct inode *inode) |
105 | { | 140 | { |
106 | BUG_ON(!inode->i_sb); | 141 | BUG_ON(!inode->i_sb); |
107 | if (sb_any_quota_enabled(inode->i_sb) && !IS_NOQUOTA(inode)) | 142 | if (sb_any_quota_active(inode->i_sb) && !IS_NOQUOTA(inode)) |
108 | inode->i_sb->dq_op->initialize(inode, -1); | 143 | inode->i_sb->dq_op->initialize(inode, -1); |
109 | } | 144 | } |
110 | 145 | ||
@@ -112,7 +147,7 @@ static inline void vfs_dq_init(struct inode *inode) | |||
112 | * a transaction (deadlocks possible otherwise) */ | 147 | * a transaction (deadlocks possible otherwise) */ |
113 | static inline int vfs_dq_prealloc_space_nodirty(struct inode *inode, qsize_t nr) | 148 | static inline int vfs_dq_prealloc_space_nodirty(struct inode *inode, qsize_t nr) |
114 | { | 149 | { |
115 | if (sb_any_quota_enabled(inode->i_sb)) { | 150 | if (sb_any_quota_active(inode->i_sb)) { |
116 | /* Used space is updated in alloc_space() */ | 151 | /* Used space is updated in alloc_space() */ |
117 | if (inode->i_sb->dq_op->alloc_space(inode, nr, 1) == NO_QUOTA) | 152 | if (inode->i_sb->dq_op->alloc_space(inode, nr, 1) == NO_QUOTA) |
118 | return 1; | 153 | return 1; |
@@ -132,7 +167,7 @@ static inline int vfs_dq_prealloc_space(struct inode *inode, qsize_t nr) | |||
132 | 167 | ||
133 | static inline int vfs_dq_alloc_space_nodirty(struct inode *inode, qsize_t nr) | 168 | static inline int vfs_dq_alloc_space_nodirty(struct inode *inode, qsize_t nr) |
134 | { | 169 | { |
135 | if (sb_any_quota_enabled(inode->i_sb)) { | 170 | if (sb_any_quota_active(inode->i_sb)) { |
136 | /* Used space is updated in alloc_space() */ | 171 | /* Used space is updated in alloc_space() */ |
137 | if (inode->i_sb->dq_op->alloc_space(inode, nr, 0) == NO_QUOTA) | 172 | if (inode->i_sb->dq_op->alloc_space(inode, nr, 0) == NO_QUOTA) |
138 | return 1; | 173 | return 1; |
@@ -152,7 +187,7 @@ static inline int vfs_dq_alloc_space(struct inode *inode, qsize_t nr) | |||
152 | 187 | ||
153 | static inline int vfs_dq_alloc_inode(struct inode *inode) | 188 | static inline int vfs_dq_alloc_inode(struct inode *inode) |
154 | { | 189 | { |
155 | if (sb_any_quota_enabled(inode->i_sb)) { | 190 | if (sb_any_quota_active(inode->i_sb)) { |
156 | vfs_dq_init(inode); | 191 | vfs_dq_init(inode); |
157 | if (inode->i_sb->dq_op->alloc_inode(inode, 1) == NO_QUOTA) | 192 | if (inode->i_sb->dq_op->alloc_inode(inode, 1) == NO_QUOTA) |
158 | return 1; | 193 | return 1; |
@@ -162,7 +197,7 @@ static inline int vfs_dq_alloc_inode(struct inode *inode) | |||
162 | 197 | ||
163 | static inline void vfs_dq_free_space_nodirty(struct inode *inode, qsize_t nr) | 198 | static inline void vfs_dq_free_space_nodirty(struct inode *inode, qsize_t nr) |
164 | { | 199 | { |
165 | if (sb_any_quota_enabled(inode->i_sb)) | 200 | if (sb_any_quota_active(inode->i_sb)) |
166 | inode->i_sb->dq_op->free_space(inode, nr); | 201 | inode->i_sb->dq_op->free_space(inode, nr); |
167 | else | 202 | else |
168 | inode_sub_bytes(inode, nr); | 203 | inode_sub_bytes(inode, nr); |
@@ -176,7 +211,7 @@ static inline void vfs_dq_free_space(struct inode *inode, qsize_t nr) | |||
176 | 211 | ||
177 | static inline void vfs_dq_free_inode(struct inode *inode) | 212 | static inline void vfs_dq_free_inode(struct inode *inode) |
178 | { | 213 | { |
179 | if (sb_any_quota_enabled(inode->i_sb)) | 214 | if (sb_any_quota_active(inode->i_sb)) |
180 | inode->i_sb->dq_op->free_inode(inode, 1); | 215 | inode->i_sb->dq_op->free_inode(inode, 1); |
181 | } | 216 | } |
182 | 217 | ||
@@ -197,12 +232,12 @@ static inline int vfs_dq_off(struct super_block *sb, int remount) | |||
197 | 232 | ||
198 | #else | 233 | #else |
199 | 234 | ||
200 | static inline int sb_has_quota_enabled(struct super_block *sb, int type) | 235 | static inline int sb_has_quota_usage_enabled(struct super_block *sb, int type) |
201 | { | 236 | { |
202 | return 0; | 237 | return 0; |
203 | } | 238 | } |
204 | 239 | ||
205 | static inline int sb_any_quota_enabled(struct super_block *sb) | 240 | static inline int sb_has_quota_limits_enabled(struct super_block *sb, int type) |
206 | { | 241 | { |
207 | return 0; | 242 | return 0; |
208 | } | 243 | } |
@@ -217,6 +252,27 @@ static inline int sb_any_quota_suspended(struct super_block *sb) | |||
217 | return 0; | 252 | return 0; |
218 | } | 253 | } |
219 | 254 | ||
255 | /* Does kernel know about any quota information for given sb + type? */ | ||
256 | static inline int sb_has_quota_loaded(struct super_block *sb, int type) | ||
257 | { | ||
258 | return 0; | ||
259 | } | ||
260 | |||
261 | static inline int sb_any_quota_loaded(struct super_block *sb) | ||
262 | { | ||
263 | return 0; | ||
264 | } | ||
265 | |||
266 | static inline int sb_has_quota_active(struct super_block *sb, int type) | ||
267 | { | ||
268 | return 0; | ||
269 | } | ||
270 | |||
271 | static inline int sb_any_quota_active(struct super_block *sb) | ||
272 | { | ||
273 | return 0; | ||
274 | } | ||
275 | |||
220 | /* | 276 | /* |
221 | * NO-OP when quota not configured. | 277 | * NO-OP when quota not configured. |
222 | */ | 278 | */ |
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h index a916c6660dfa..355f6e80db0d 100644 --- a/include/linux/radix-tree.h +++ b/include/linux/radix-tree.h | |||
@@ -136,7 +136,7 @@ do { \ | |||
136 | */ | 136 | */ |
137 | static inline void *radix_tree_deref_slot(void **pslot) | 137 | static inline void *radix_tree_deref_slot(void **pslot) |
138 | { | 138 | { |
139 | void *ret = *pslot; | 139 | void *ret = rcu_dereference(*pslot); |
140 | if (unlikely(radix_tree_is_indirect_ptr(ret))) | 140 | if (unlikely(radix_tree_is_indirect_ptr(ret))) |
141 | ret = RADIX_TREE_RETRY; | 141 | ret = RADIX_TREE_RETRY; |
142 | return ret; | 142 | return ret; |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 1168fbcea8d4..921340a7b71c 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -204,18 +204,6 @@ struct rcu_synchronize { | |||
204 | 204 | ||
205 | extern void wakeme_after_rcu(struct rcu_head *head); | 205 | extern void wakeme_after_rcu(struct rcu_head *head); |
206 | 206 | ||
207 | #define synchronize_rcu_xxx(name, func) \ | ||
208 | void name(void) \ | ||
209 | { \ | ||
210 | struct rcu_synchronize rcu; \ | ||
211 | \ | ||
212 | init_completion(&rcu.completion); \ | ||
213 | /* Will wake me after RCU finished. */ \ | ||
214 | func(&rcu.head, wakeme_after_rcu); \ | ||
215 | /* Wait for it. */ \ | ||
216 | wait_for_completion(&rcu.completion); \ | ||
217 | } | ||
218 | |||
219 | /** | 207 | /** |
220 | * synchronize_sched - block until all CPUs have exited any non-preemptive | 208 | * synchronize_sched - block until all CPUs have exited any non-preemptive |
221 | * kernel code sequences. | 209 | * kernel code sequences. |
diff --git a/include/linux/rio_drv.h b/include/linux/rio_drv.h index 32c0547ffafc..c93a58a40033 100644 --- a/include/linux/rio_drv.h +++ b/include/linux/rio_drv.h | |||
@@ -391,7 +391,6 @@ static inline int rio_add_inb_buffer(struct rio_mport *mport, int mbox, | |||
391 | * rio_get_inb_message - Get A RIO message from an inbound mailbox queue | 391 | * rio_get_inb_message - Get A RIO message from an inbound mailbox queue |
392 | * @mport: Master port containing the inbound mailbox | 392 | * @mport: Master port containing the inbound mailbox |
393 | * @mbox: The inbound mailbox number | 393 | * @mbox: The inbound mailbox number |
394 | * @buffer: Pointer to the message buffer | ||
395 | * | 394 | * |
396 | * Get a RIO message from an inbound mailbox queue. Returns 0 on success. | 395 | * Get a RIO message from an inbound mailbox queue. Returns 0 on success. |
397 | */ | 396 | */ |
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index 89f0564b10c8..b35bc0e19cd9 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
@@ -63,16 +63,13 @@ void anon_vma_unlink(struct vm_area_struct *); | |||
63 | void anon_vma_link(struct vm_area_struct *); | 63 | void anon_vma_link(struct vm_area_struct *); |
64 | void __anon_vma_link(struct vm_area_struct *); | 64 | void __anon_vma_link(struct vm_area_struct *); |
65 | 65 | ||
66 | extern struct anon_vma *page_lock_anon_vma(struct page *page); | ||
67 | extern void page_unlock_anon_vma(struct anon_vma *anon_vma); | ||
68 | |||
69 | /* | 66 | /* |
70 | * rmap interfaces called when adding or removing pte of page | 67 | * rmap interfaces called when adding or removing pte of page |
71 | */ | 68 | */ |
72 | void page_add_anon_rmap(struct page *, struct vm_area_struct *, unsigned long); | 69 | void page_add_anon_rmap(struct page *, struct vm_area_struct *, unsigned long); |
73 | void page_add_new_anon_rmap(struct page *, struct vm_area_struct *, unsigned long); | 70 | void page_add_new_anon_rmap(struct page *, struct vm_area_struct *, unsigned long); |
74 | void page_add_file_rmap(struct page *); | 71 | void page_add_file_rmap(struct page *); |
75 | void page_remove_rmap(struct page *, struct vm_area_struct *); | 72 | void page_remove_rmap(struct page *); |
76 | 73 | ||
77 | #ifdef CONFIG_DEBUG_VM | 74 | #ifdef CONFIG_DEBUG_VM |
78 | void page_dup_rmap(struct page *page, struct vm_area_struct *vma, unsigned long address); | 75 | void page_dup_rmap(struct page *page, struct vm_area_struct *vma, unsigned long address); |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 38a3f4b15394..ea415136ac9e 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -386,6 +386,9 @@ extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long); | |||
386 | (mm)->hiwater_vm = (mm)->total_vm; \ | 386 | (mm)->hiwater_vm = (mm)->total_vm; \ |
387 | } while (0) | 387 | } while (0) |
388 | 388 | ||
389 | #define get_mm_hiwater_rss(mm) max((mm)->hiwater_rss, get_mm_rss(mm)) | ||
390 | #define get_mm_hiwater_vm(mm) max((mm)->hiwater_vm, (mm)->total_vm) | ||
391 | |||
389 | extern void set_dumpable(struct mm_struct *mm, int value); | 392 | extern void set_dumpable(struct mm_struct *mm, int value); |
390 | extern int get_dumpable(struct mm_struct *mm); | 393 | extern int get_dumpable(struct mm_struct *mm); |
391 | 394 | ||
diff --git a/include/linux/spi/spi_gpio.h b/include/linux/spi/spi_gpio.h new file mode 100644 index 000000000000..0f01a0f1f40c --- /dev/null +++ b/include/linux/spi/spi_gpio.h | |||
@@ -0,0 +1,60 @@ | |||
1 | #ifndef __LINUX_SPI_GPIO_H | ||
2 | #define __LINUX_SPI_GPIO_H | ||
3 | |||
4 | /* | ||
5 | * For each bitbanged SPI bus, set up a platform_device node with: | ||
6 | * - name "spi_gpio" | ||
7 | * - id the same as the SPI bus number it implements | ||
8 | * - dev.platform data pointing to a struct spi_gpio_platform_data | ||
9 | * | ||
10 | * Or, see the driver code for information about speedups that are | ||
11 | * possible on platforms that support inlined access for GPIOs (no | ||
12 | * spi_gpio_platform_data is used). | ||
13 | * | ||
14 | * Use spi_board_info with these busses in the usual way, being sure | ||
15 | * that the controller_data being the GPIO used for each device's | ||
16 | * chipselect: | ||
17 | * | ||
18 | * static struct spi_board_info ... [] = { | ||
19 | * ... | ||
20 | * // this slave uses GPIO 42 for its chipselect | ||
21 | * .controller_data = (void *) 42, | ||
22 | * ... | ||
23 | * // this one uses GPIO 86 for its chipselect | ||
24 | * .controller_data = (void *) 86, | ||
25 | * ... | ||
26 | * }; | ||
27 | * | ||
28 | * If the bitbanged bus is later switched to a "native" controller, | ||
29 | * that platform_device and controller_data should be removed. | ||
30 | */ | ||
31 | |||
32 | /** | ||
33 | * struct spi_gpio_platform_data - parameter for bitbanged SPI master | ||
34 | * @sck: number of the GPIO used for clock output | ||
35 | * @mosi: number of the GPIO used for Master Output, Slave In (MOSI) data | ||
36 | * @miso: number of the GPIO used for Master Input, Slave Output (MISO) data | ||
37 | * @num_chipselect: how many slaves to allow | ||
38 | * | ||
39 | * All GPIO signals used with the SPI bus managed through this driver | ||
40 | * (chipselects, MOSI, MISO, SCK) must be configured as GPIOs, instead | ||
41 | * of some alternate function. | ||
42 | * | ||
43 | * It can be convenient to use this driver with pins that have alternate | ||
44 | * functions associated with a "native" SPI controller if a driver for that | ||
45 | * controller is not available, or is missing important functionality. | ||
46 | * | ||
47 | * On platforms which can do so, configure MISO with a weak pullup unless | ||
48 | * there's an external pullup on that signal. That saves power by avoiding | ||
49 | * floating signals. (A weak pulldown would save power too, but many | ||
50 | * drivers expect to see all-ones data as the no slave "response".) | ||
51 | */ | ||
52 | struct spi_gpio_platform_data { | ||
53 | unsigned sck; | ||
54 | unsigned mosi; | ||
55 | unsigned miso; | ||
56 | |||
57 | u16 num_chipselect; | ||
58 | }; | ||
59 | |||
60 | #endif /* __LINUX_SPI_GPIO_H */ | ||
diff --git a/include/linux/stop_machine.h b/include/linux/stop_machine.h index 74d59a641362..baba3a23a814 100644 --- a/include/linux/stop_machine.h +++ b/include/linux/stop_machine.h | |||
@@ -35,6 +35,24 @@ int stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus); | |||
35 | * won't come or go while it's being called. Used by hotplug cpu. | 35 | * won't come or go while it's being called. Used by hotplug cpu. |
36 | */ | 36 | */ |
37 | int __stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus); | 37 | int __stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus); |
38 | |||
39 | /** | ||
40 | * stop_machine_create: create all stop_machine threads | ||
41 | * | ||
42 | * Description: This causes all stop_machine threads to be created before | ||
43 | * stop_machine actually gets called. This can be used by subsystems that | ||
44 | * need a non failing stop_machine infrastructure. | ||
45 | */ | ||
46 | int stop_machine_create(void); | ||
47 | |||
48 | /** | ||
49 | * stop_machine_destroy: destroy all stop_machine threads | ||
50 | * | ||
51 | * Description: This causes all stop_machine threads which were created with | ||
52 | * stop_machine_create to be destroyed again. | ||
53 | */ | ||
54 | void stop_machine_destroy(void); | ||
55 | |||
38 | #else | 56 | #else |
39 | 57 | ||
40 | static inline int stop_machine(int (*fn)(void *), void *data, | 58 | static inline int stop_machine(int (*fn)(void *), void *data, |
@@ -46,5 +64,9 @@ static inline int stop_machine(int (*fn)(void *), void *data, | |||
46 | local_irq_enable(); | 64 | local_irq_enable(); |
47 | return ret; | 65 | return ret; |
48 | } | 66 | } |
67 | |||
68 | static inline int stop_machine_create(void) { return 0; } | ||
69 | static inline void stop_machine_destroy(void) { } | ||
70 | |||
49 | #endif /* CONFIG_SMP */ | 71 | #endif /* CONFIG_SMP */ |
50 | #endif /* _LINUX_STOP_MACHINE */ | 72 | #endif /* _LINUX_STOP_MACHINE */ |
diff --git a/include/linux/swap.h b/include/linux/swap.h index a3af95b2cb6d..91dee50fe260 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -120,7 +120,9 @@ struct swap_extent { | |||
120 | enum { | 120 | enum { |
121 | SWP_USED = (1 << 0), /* is slot in swap_info[] used? */ | 121 | SWP_USED = (1 << 0), /* is slot in swap_info[] used? */ |
122 | SWP_WRITEOK = (1 << 1), /* ok to write to this swap? */ | 122 | SWP_WRITEOK = (1 << 1), /* ok to write to this swap? */ |
123 | SWP_ACTIVE = (SWP_USED | SWP_WRITEOK), | 123 | SWP_DISCARDABLE = (1 << 2), /* blkdev supports discard */ |
124 | SWP_DISCARDING = (1 << 3), /* now discarding a free cluster */ | ||
125 | SWP_SOLIDSTATE = (1 << 4), /* blkdev seeks are cheap */ | ||
124 | /* add others here before... */ | 126 | /* add others here before... */ |
125 | SWP_SCANNING = (1 << 8), /* refcount in scan_swap_map */ | 127 | SWP_SCANNING = (1 << 8), /* refcount in scan_swap_map */ |
126 | }; | 128 | }; |
@@ -134,22 +136,24 @@ enum { | |||
134 | * The in-memory structure used to track swap areas. | 136 | * The in-memory structure used to track swap areas. |
135 | */ | 137 | */ |
136 | struct swap_info_struct { | 138 | struct swap_info_struct { |
137 | unsigned int flags; | 139 | unsigned long flags; |
138 | int prio; /* swap priority */ | 140 | int prio; /* swap priority */ |
141 | int next; /* next entry on swap list */ | ||
139 | struct file *swap_file; | 142 | struct file *swap_file; |
140 | struct block_device *bdev; | 143 | struct block_device *bdev; |
141 | struct list_head extent_list; | 144 | struct list_head extent_list; |
142 | struct swap_extent *curr_swap_extent; | 145 | struct swap_extent *curr_swap_extent; |
143 | unsigned old_block_size; | 146 | unsigned short *swap_map; |
144 | unsigned short * swap_map; | ||
145 | unsigned int lowest_bit; | 147 | unsigned int lowest_bit; |
146 | unsigned int highest_bit; | 148 | unsigned int highest_bit; |
149 | unsigned int lowest_alloc; /* while preparing discard cluster */ | ||
150 | unsigned int highest_alloc; /* while preparing discard cluster */ | ||
147 | unsigned int cluster_next; | 151 | unsigned int cluster_next; |
148 | unsigned int cluster_nr; | 152 | unsigned int cluster_nr; |
149 | unsigned int pages; | 153 | unsigned int pages; |
150 | unsigned int max; | 154 | unsigned int max; |
151 | unsigned int inuse_pages; | 155 | unsigned int inuse_pages; |
152 | int next; /* next entry on swap list */ | 156 | unsigned int old_block_size; |
153 | }; | 157 | }; |
154 | 158 | ||
155 | struct swap_list_t { | 159 | struct swap_list_t { |
@@ -163,7 +167,6 @@ struct swap_list_t { | |||
163 | /* linux/mm/page_alloc.c */ | 167 | /* linux/mm/page_alloc.c */ |
164 | extern unsigned long totalram_pages; | 168 | extern unsigned long totalram_pages; |
165 | extern unsigned long totalreserve_pages; | 169 | extern unsigned long totalreserve_pages; |
166 | extern long nr_swap_pages; | ||
167 | extern unsigned int nr_free_buffer_pages(void); | 170 | extern unsigned int nr_free_buffer_pages(void); |
168 | extern unsigned int nr_free_pagecache_pages(void); | 171 | extern unsigned int nr_free_pagecache_pages(void); |
169 | 172 | ||
@@ -174,8 +177,6 @@ extern unsigned int nr_free_pagecache_pages(void); | |||
174 | /* linux/mm/swap.c */ | 177 | /* linux/mm/swap.c */ |
175 | extern void __lru_cache_add(struct page *, enum lru_list lru); | 178 | extern void __lru_cache_add(struct page *, enum lru_list lru); |
176 | extern void lru_cache_add_lru(struct page *, enum lru_list lru); | 179 | extern void lru_cache_add_lru(struct page *, enum lru_list lru); |
177 | extern void lru_cache_add_active_or_unevictable(struct page *, | ||
178 | struct vm_area_struct *); | ||
179 | extern void activate_page(struct page *); | 180 | extern void activate_page(struct page *); |
180 | extern void mark_page_accessed(struct page *); | 181 | extern void mark_page_accessed(struct page *); |
181 | extern void lru_add_drain(void); | 182 | extern void lru_add_drain(void); |
@@ -280,7 +281,7 @@ extern void end_swap_bio_read(struct bio *bio, int err); | |||
280 | extern struct address_space swapper_space; | 281 | extern struct address_space swapper_space; |
281 | #define total_swapcache_pages swapper_space.nrpages | 282 | #define total_swapcache_pages swapper_space.nrpages |
282 | extern void show_swap_cache_info(void); | 283 | extern void show_swap_cache_info(void); |
283 | extern int add_to_swap(struct page *, gfp_t); | 284 | extern int add_to_swap(struct page *); |
284 | extern int add_to_swap_cache(struct page *, swp_entry_t, gfp_t); | 285 | extern int add_to_swap_cache(struct page *, swp_entry_t, gfp_t); |
285 | extern void __delete_from_swap_cache(struct page *); | 286 | extern void __delete_from_swap_cache(struct page *); |
286 | extern void delete_from_swap_cache(struct page *); | 287 | extern void delete_from_swap_cache(struct page *); |
@@ -293,6 +294,7 @@ extern struct page *swapin_readahead(swp_entry_t, gfp_t, | |||
293 | struct vm_area_struct *vma, unsigned long addr); | 294 | struct vm_area_struct *vma, unsigned long addr); |
294 | 295 | ||
295 | /* linux/mm/swapfile.c */ | 296 | /* linux/mm/swapfile.c */ |
297 | extern long nr_swap_pages; | ||
296 | extern long total_swap_pages; | 298 | extern long total_swap_pages; |
297 | extern void si_swapinfo(struct sysinfo *); | 299 | extern void si_swapinfo(struct sysinfo *); |
298 | extern swp_entry_t get_swap_page(void); | 300 | extern swp_entry_t get_swap_page(void); |
@@ -300,15 +302,14 @@ extern swp_entry_t get_swap_page_of_type(int); | |||
300 | extern int swap_duplicate(swp_entry_t); | 302 | extern int swap_duplicate(swp_entry_t); |
301 | extern int valid_swaphandles(swp_entry_t, unsigned long *); | 303 | extern int valid_swaphandles(swp_entry_t, unsigned long *); |
302 | extern void swap_free(swp_entry_t); | 304 | extern void swap_free(swp_entry_t); |
303 | extern void free_swap_and_cache(swp_entry_t); | 305 | extern int free_swap_and_cache(swp_entry_t); |
304 | extern int swap_type_of(dev_t, sector_t, struct block_device **); | 306 | extern int swap_type_of(dev_t, sector_t, struct block_device **); |
305 | extern unsigned int count_swap_pages(int, int); | 307 | extern unsigned int count_swap_pages(int, int); |
306 | extern sector_t map_swap_page(struct swap_info_struct *, pgoff_t); | 308 | extern sector_t map_swap_page(struct swap_info_struct *, pgoff_t); |
307 | extern sector_t swapdev_block(int, pgoff_t); | 309 | extern sector_t swapdev_block(int, pgoff_t); |
308 | extern struct swap_info_struct *get_swap_info_struct(unsigned); | 310 | extern struct swap_info_struct *get_swap_info_struct(unsigned); |
309 | extern int can_share_swap_page(struct page *); | 311 | extern int reuse_swap_page(struct page *); |
310 | extern int remove_exclusive_swap_page(struct page *); | 312 | extern int try_to_free_swap(struct page *); |
311 | extern int remove_exclusive_swap_page_ref(struct page *); | ||
312 | struct backing_dev_info; | 313 | struct backing_dev_info; |
313 | 314 | ||
314 | /* linux/mm/thrash.c */ | 315 | /* linux/mm/thrash.c */ |
@@ -334,7 +335,8 @@ static inline void disable_swap_token(void) | |||
334 | 335 | ||
335 | #else /* CONFIG_SWAP */ | 336 | #else /* CONFIG_SWAP */ |
336 | 337 | ||
337 | #define total_swap_pages 0 | 338 | #define nr_swap_pages 0L |
339 | #define total_swap_pages 0L | ||
338 | #define total_swapcache_pages 0UL | 340 | #define total_swapcache_pages 0UL |
339 | 341 | ||
340 | #define si_swapinfo(val) \ | 342 | #define si_swapinfo(val) \ |
@@ -350,14 +352,8 @@ static inline void show_swap_cache_info(void) | |||
350 | { | 352 | { |
351 | } | 353 | } |
352 | 354 | ||
353 | static inline void free_swap_and_cache(swp_entry_t swp) | 355 | #define free_swap_and_cache(swp) is_migration_entry(swp) |
354 | { | 356 | #define swap_duplicate(swp) is_migration_entry(swp) |
355 | } | ||
356 | |||
357 | static inline int swap_duplicate(swp_entry_t swp) | ||
358 | { | ||
359 | return 0; | ||
360 | } | ||
361 | 357 | ||
362 | static inline void swap_free(swp_entry_t swp) | 358 | static inline void swap_free(swp_entry_t swp) |
363 | { | 359 | { |
@@ -374,7 +370,10 @@ static inline struct page *lookup_swap_cache(swp_entry_t swp) | |||
374 | return NULL; | 370 | return NULL; |
375 | } | 371 | } |
376 | 372 | ||
377 | #define can_share_swap_page(p) (page_mapcount(p) == 1) | 373 | static inline int add_to_swap(struct page *page) |
374 | { | ||
375 | return 0; | ||
376 | } | ||
378 | 377 | ||
379 | static inline int add_to_swap_cache(struct page *page, swp_entry_t entry, | 378 | static inline int add_to_swap_cache(struct page *page, swp_entry_t entry, |
380 | gfp_t gfp_mask) | 379 | gfp_t gfp_mask) |
@@ -390,14 +389,9 @@ static inline void delete_from_swap_cache(struct page *page) | |||
390 | { | 389 | { |
391 | } | 390 | } |
392 | 391 | ||
393 | #define swap_token_default_timeout 0 | 392 | #define reuse_swap_page(page) (page_mapcount(page) == 1) |
394 | |||
395 | static inline int remove_exclusive_swap_page(struct page *p) | ||
396 | { | ||
397 | return 0; | ||
398 | } | ||
399 | 393 | ||
400 | static inline int remove_exclusive_swap_page_ref(struct page *page) | 394 | static inline int try_to_free_swap(struct page *page) |
401 | { | 395 | { |
402 | return 0; | 396 | return 0; |
403 | } | 397 | } |
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h index 325af1de0351..dedd3c0cfe30 100644 --- a/include/linux/swiotlb.h +++ b/include/linux/swiotlb.h | |||
@@ -27,7 +27,8 @@ swiotlb_init(void); | |||
27 | extern void *swiotlb_alloc_boot(size_t bytes, unsigned long nslabs); | 27 | extern void *swiotlb_alloc_boot(size_t bytes, unsigned long nslabs); |
28 | extern void *swiotlb_alloc(unsigned order, unsigned long nslabs); | 28 | extern void *swiotlb_alloc(unsigned order, unsigned long nslabs); |
29 | 29 | ||
30 | extern dma_addr_t swiotlb_phys_to_bus(phys_addr_t address); | 30 | extern dma_addr_t swiotlb_phys_to_bus(struct device *hwdev, |
31 | phys_addr_t address); | ||
31 | extern phys_addr_t swiotlb_bus_to_phys(dma_addr_t address); | 32 | extern phys_addr_t swiotlb_bus_to_phys(dma_addr_t address); |
32 | 33 | ||
33 | extern int swiotlb_arch_range_needs_mapping(void *ptr, size_t size); | 34 | extern int swiotlb_arch_range_needs_mapping(void *ptr, size_t size); |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 04fb47bfb920..18d0a243a7b3 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -549,7 +549,7 @@ asmlinkage long sys_inotify_init(void); | |||
549 | asmlinkage long sys_inotify_init1(int flags); | 549 | asmlinkage long sys_inotify_init1(int flags); |
550 | asmlinkage long sys_inotify_add_watch(int fd, const char __user *path, | 550 | asmlinkage long sys_inotify_add_watch(int fd, const char __user *path, |
551 | u32 mask); | 551 | u32 mask); |
552 | asmlinkage long sys_inotify_rm_watch(int fd, u32 wd); | 552 | asmlinkage long sys_inotify_rm_watch(int fd, __s32 wd); |
553 | 553 | ||
554 | asmlinkage long sys_spu_run(int fd, __u32 __user *unpc, | 554 | asmlinkage long sys_spu_run(int fd, __u32 __user *unpc, |
555 | __u32 __user *ustatus); | 555 | __u32 __user *ustatus); |
diff --git a/include/linux/types.h b/include/linux/types.h index 121f349cb7ec..3b864f2d9560 100644 --- a/include/linux/types.h +++ b/include/linux/types.h | |||
@@ -195,6 +195,16 @@ typedef u32 phys_addr_t; | |||
195 | 195 | ||
196 | typedef phys_addr_t resource_size_t; | 196 | typedef phys_addr_t resource_size_t; |
197 | 197 | ||
198 | typedef struct { | ||
199 | volatile int counter; | ||
200 | } atomic_t; | ||
201 | |||
202 | #ifdef CONFIG_64BIT | ||
203 | typedef struct { | ||
204 | volatile long counter; | ||
205 | } atomic64_t; | ||
206 | #endif | ||
207 | |||
198 | struct ustat { | 208 | struct ustat { |
199 | __kernel_daddr_t f_tfree; | 209 | __kernel_daddr_t f_tfree; |
200 | __kernel_ino_t f_tinode; | 210 | __kernel_ino_t f_tinode; |
diff --git a/include/linux/uio_driver.h b/include/linux/uio_driver.h index cdf338d94b7f..a0bb6bd2e5c1 100644 --- a/include/linux/uio_driver.h +++ b/include/linux/uio_driver.h | |||
@@ -38,6 +38,24 @@ struct uio_mem { | |||
38 | 38 | ||
39 | #define MAX_UIO_MAPS 5 | 39 | #define MAX_UIO_MAPS 5 |
40 | 40 | ||
41 | struct uio_portio; | ||
42 | |||
43 | /** | ||
44 | * struct uio_port - description of a UIO port region | ||
45 | * @start: start of port region | ||
46 | * @size: size of port region | ||
47 | * @porttype: type of port (see UIO_PORT_* below) | ||
48 | * @portio: for use by the UIO core only. | ||
49 | */ | ||
50 | struct uio_port { | ||
51 | unsigned long start; | ||
52 | unsigned long size; | ||
53 | int porttype; | ||
54 | struct uio_portio *portio; | ||
55 | }; | ||
56 | |||
57 | #define MAX_UIO_PORT_REGIONS 5 | ||
58 | |||
41 | struct uio_device; | 59 | struct uio_device; |
42 | 60 | ||
43 | /** | 61 | /** |
@@ -46,6 +64,7 @@ struct uio_device; | |||
46 | * @name: device name | 64 | * @name: device name |
47 | * @version: device driver version | 65 | * @version: device driver version |
48 | * @mem: list of mappable memory regions, size==0 for end of list | 66 | * @mem: list of mappable memory regions, size==0 for end of list |
67 | * @port: list of port regions, size==0 for end of list | ||
49 | * @irq: interrupt number or UIO_IRQ_CUSTOM | 68 | * @irq: interrupt number or UIO_IRQ_CUSTOM |
50 | * @irq_flags: flags for request_irq() | 69 | * @irq_flags: flags for request_irq() |
51 | * @priv: optional private data | 70 | * @priv: optional private data |
@@ -57,9 +76,10 @@ struct uio_device; | |||
57 | */ | 76 | */ |
58 | struct uio_info { | 77 | struct uio_info { |
59 | struct uio_device *uio_dev; | 78 | struct uio_device *uio_dev; |
60 | char *name; | 79 | const char *name; |
61 | char *version; | 80 | const char *version; |
62 | struct uio_mem mem[MAX_UIO_MAPS]; | 81 | struct uio_mem mem[MAX_UIO_MAPS]; |
82 | struct uio_port port[MAX_UIO_PORT_REGIONS]; | ||
63 | long irq; | 83 | long irq; |
64 | unsigned long irq_flags; | 84 | unsigned long irq_flags; |
65 | void *priv; | 85 | void *priv; |
@@ -92,4 +112,10 @@ extern void uio_event_notify(struct uio_info *info); | |||
92 | #define UIO_MEM_LOGICAL 2 | 112 | #define UIO_MEM_LOGICAL 2 |
93 | #define UIO_MEM_VIRTUAL 3 | 113 | #define UIO_MEM_VIRTUAL 3 |
94 | 114 | ||
115 | /* defines for uio_port->porttype */ | ||
116 | #define UIO_PORT_NONE 0 | ||
117 | #define UIO_PORT_X86 1 | ||
118 | #define UIO_PORT_GPIO 2 | ||
119 | #define UIO_PORT_OTHER 3 | ||
120 | |||
95 | #endif /* _LINUX_UIO_DRIVER_H_ */ | 121 | #endif /* _LINUX_UIO_DRIVER_H_ */ |
diff --git a/include/linux/unwind.h b/include/linux/unwind.h deleted file mode 100644 index 7760860fa170..000000000000 --- a/include/linux/unwind.h +++ /dev/null | |||
@@ -1,68 +0,0 @@ | |||
1 | #ifndef _LINUX_UNWIND_H | ||
2 | #define _LINUX_UNWIND_H | ||
3 | |||
4 | /* | ||
5 | * Copyright (C) 2002-2006 Novell, Inc. | ||
6 | * Jan Beulich <jbeulich@novell.com> | ||
7 | * This code is released under version 2 of the GNU GPL. | ||
8 | * | ||
9 | * A simple API for unwinding kernel stacks. This is used for | ||
10 | * debugging and error reporting purposes. The kernel doesn't need | ||
11 | * full-blown stack unwinding with all the bells and whistles, so there | ||
12 | * is not much point in implementing the full Dwarf2 unwind API. | ||
13 | */ | ||
14 | |||
15 | struct module; | ||
16 | |||
17 | struct unwind_frame_info {}; | ||
18 | |||
19 | static inline void unwind_init(void) {} | ||
20 | static inline void unwind_setup(void) {} | ||
21 | |||
22 | #ifdef CONFIG_MODULES | ||
23 | |||
24 | static inline void *unwind_add_table(struct module *mod, | ||
25 | const void *table_start, | ||
26 | unsigned long table_size) | ||
27 | { | ||
28 | return NULL; | ||
29 | } | ||
30 | |||
31 | static inline void unwind_remove_table(void *handle, int init_only) | ||
32 | { | ||
33 | } | ||
34 | |||
35 | #endif | ||
36 | |||
37 | static inline int unwind_init_frame_info(struct unwind_frame_info *info, | ||
38 | struct task_struct *tsk, | ||
39 | const struct pt_regs *regs) | ||
40 | { | ||
41 | return -ENOSYS; | ||
42 | } | ||
43 | |||
44 | static inline int unwind_init_blocked(struct unwind_frame_info *info, | ||
45 | struct task_struct *tsk) | ||
46 | { | ||
47 | return -ENOSYS; | ||
48 | } | ||
49 | |||
50 | static inline int unwind_init_running(struct unwind_frame_info *info, | ||
51 | asmlinkage int (*cb)(struct unwind_frame_info *, | ||
52 | void *arg), | ||
53 | void *arg) | ||
54 | { | ||
55 | return -ENOSYS; | ||
56 | } | ||
57 | |||
58 | static inline int unwind(struct unwind_frame_info *info) | ||
59 | { | ||
60 | return -ENOSYS; | ||
61 | } | ||
62 | |||
63 | static inline int unwind_to_user(struct unwind_frame_info *info) | ||
64 | { | ||
65 | return -ENOSYS; | ||
66 | } | ||
67 | |||
68 | #endif /* _LINUX_UNWIND_H */ | ||
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 307b88577eaa..506e7620a986 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h | |||
@@ -97,6 +97,10 @@ extern void unmap_kernel_range(unsigned long addr, unsigned long size); | |||
97 | extern struct vm_struct *alloc_vm_area(size_t size); | 97 | extern struct vm_struct *alloc_vm_area(size_t size); |
98 | extern void free_vm_area(struct vm_struct *area); | 98 | extern void free_vm_area(struct vm_struct *area); |
99 | 99 | ||
100 | /* for /dev/kmem */ | ||
101 | extern long vread(char *buf, char *addr, unsigned long count); | ||
102 | extern long vwrite(char *buf, char *addr, unsigned long count); | ||
103 | |||
100 | /* | 104 | /* |
101 | * Internals. Dont't use.. | 105 | * Internals. Dont't use.. |
102 | */ | 106 | */ |
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index e585657e9831..7300ecdc480c 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
@@ -30,7 +30,6 @@ static inline int task_is_pdflush(struct task_struct *task) | |||
30 | enum writeback_sync_modes { | 30 | enum writeback_sync_modes { |
31 | WB_SYNC_NONE, /* Don't wait on anything */ | 31 | WB_SYNC_NONE, /* Don't wait on anything */ |
32 | WB_SYNC_ALL, /* Wait on every mapping */ | 32 | WB_SYNC_ALL, /* Wait on every mapping */ |
33 | WB_SYNC_HOLD, /* Hold the inode on sb_dirty for sys_sync() */ | ||
34 | }; | 33 | }; |
35 | 34 | ||
36 | /* | 35 | /* |
@@ -107,7 +106,9 @@ void throttle_vm_writeout(gfp_t gfp_mask); | |||
107 | 106 | ||
108 | /* These are exported to sysctl. */ | 107 | /* These are exported to sysctl. */ |
109 | extern int dirty_background_ratio; | 108 | extern int dirty_background_ratio; |
109 | extern unsigned long dirty_background_bytes; | ||
110 | extern int vm_dirty_ratio; | 110 | extern int vm_dirty_ratio; |
111 | extern unsigned long vm_dirty_bytes; | ||
111 | extern int dirty_writeback_interval; | 112 | extern int dirty_writeback_interval; |
112 | extern int dirty_expire_interval; | 113 | extern int dirty_expire_interval; |
113 | extern int vm_highmem_is_dirtyable; | 114 | extern int vm_highmem_is_dirtyable; |
@@ -116,17 +117,26 @@ extern int laptop_mode; | |||
116 | 117 | ||
117 | extern unsigned long determine_dirtyable_memory(void); | 118 | extern unsigned long determine_dirtyable_memory(void); |
118 | 119 | ||
120 | extern int dirty_background_ratio_handler(struct ctl_table *table, int write, | ||
121 | struct file *filp, void __user *buffer, size_t *lenp, | ||
122 | loff_t *ppos); | ||
123 | extern int dirty_background_bytes_handler(struct ctl_table *table, int write, | ||
124 | struct file *filp, void __user *buffer, size_t *lenp, | ||
125 | loff_t *ppos); | ||
119 | extern int dirty_ratio_handler(struct ctl_table *table, int write, | 126 | extern int dirty_ratio_handler(struct ctl_table *table, int write, |
120 | struct file *filp, void __user *buffer, size_t *lenp, | 127 | struct file *filp, void __user *buffer, size_t *lenp, |
121 | loff_t *ppos); | 128 | loff_t *ppos); |
129 | extern int dirty_bytes_handler(struct ctl_table *table, int write, | ||
130 | struct file *filp, void __user *buffer, size_t *lenp, | ||
131 | loff_t *ppos); | ||
122 | 132 | ||
123 | struct ctl_table; | 133 | struct ctl_table; |
124 | struct file; | 134 | struct file; |
125 | int dirty_writeback_centisecs_handler(struct ctl_table *, int, struct file *, | 135 | int dirty_writeback_centisecs_handler(struct ctl_table *, int, struct file *, |
126 | void __user *, size_t *, loff_t *); | 136 | void __user *, size_t *, loff_t *); |
127 | 137 | ||
128 | void get_dirty_limits(long *pbackground, long *pdirty, long *pbdi_dirty, | 138 | void get_dirty_limits(unsigned long *pbackground, unsigned long *pdirty, |
129 | struct backing_dev_info *bdi); | 139 | unsigned long *pbdi_dirty, struct backing_dev_info *bdi); |
130 | 140 | ||
131 | void page_writeback_init(void); | 141 | void page_writeback_init(void); |
132 | void balance_dirty_pages_ratelimited_nr(struct address_space *mapping, | 142 | void balance_dirty_pages_ratelimited_nr(struct address_space *mapping, |
diff --git a/include/net/ndisc.h b/include/net/ndisc.h index ce532f2222ce..1459ed3e2697 100644 --- a/include/net/ndisc.h +++ b/include/net/ndisc.h | |||
@@ -155,9 +155,9 @@ static inline struct neighbour * ndisc_get_neigh(struct net_device *dev, const s | |||
155 | { | 155 | { |
156 | 156 | ||
157 | if (dev) | 157 | if (dev) |
158 | return __neigh_lookup(&nd_tbl, addr, dev, 1); | 158 | return __neigh_lookup_errno(&nd_tbl, addr, dev); |
159 | 159 | ||
160 | return NULL; | 160 | return ERR_PTR(-ENODEV); |
161 | } | 161 | } |
162 | 162 | ||
163 | 163 | ||
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index 7ee2f70ca42e..4af1083e3287 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
@@ -85,6 +85,10 @@ | |||
85 | #define SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols) \ | 85 | #define SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols) \ |
86 | { .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \ | 86 | { .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \ |
87 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1} | 87 | .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1} |
88 | #define SND_SOC_DAPM_VALUE_MUX(wname, wreg, wshift, winvert, wcontrols) \ | ||
89 | { .id = snd_soc_dapm_value_mux, .name = wname, .reg = wreg, \ | ||
90 | .shift = wshift, .invert = winvert, .kcontrols = wcontrols, \ | ||
91 | .num_kcontrols = 1} | ||
88 | 92 | ||
89 | /* path domain with event - event handler must return 0 for success */ | 93 | /* path domain with event - event handler must return 0 for success */ |
90 | #define SND_SOC_DAPM_PGA_E(wname, wreg, wshift, winvert, wcontrols, \ | 94 | #define SND_SOC_DAPM_PGA_E(wname, wreg, wshift, winvert, wcontrols, \ |
@@ -172,6 +176,12 @@ | |||
172 | .get = snd_soc_dapm_get_enum_double, \ | 176 | .get = snd_soc_dapm_get_enum_double, \ |
173 | .put = snd_soc_dapm_put_enum_double, \ | 177 | .put = snd_soc_dapm_put_enum_double, \ |
174 | .private_value = (unsigned long)&xenum } | 178 | .private_value = (unsigned long)&xenum } |
179 | #define SOC_DAPM_VALUE_ENUM(xname, xenum) \ | ||
180 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | ||
181 | .info = snd_soc_info_value_enum_double, \ | ||
182 | .get = snd_soc_dapm_get_value_enum_double, \ | ||
183 | .put = snd_soc_dapm_put_value_enum_double, \ | ||
184 | .private_value = (unsigned long)&xenum } | ||
175 | 185 | ||
176 | /* dapm stream operations */ | 186 | /* dapm stream operations */ |
177 | #define SND_SOC_DAPM_STREAM_NOP 0x0 | 187 | #define SND_SOC_DAPM_STREAM_NOP 0x0 |
@@ -214,6 +224,10 @@ int snd_soc_dapm_get_enum_double(struct snd_kcontrol *kcontrol, | |||
214 | struct snd_ctl_elem_value *ucontrol); | 224 | struct snd_ctl_elem_value *ucontrol); |
215 | int snd_soc_dapm_put_enum_double(struct snd_kcontrol *kcontrol, | 225 | int snd_soc_dapm_put_enum_double(struct snd_kcontrol *kcontrol, |
216 | struct snd_ctl_elem_value *ucontrol); | 226 | struct snd_ctl_elem_value *ucontrol); |
227 | int snd_soc_dapm_get_value_enum_double(struct snd_kcontrol *kcontrol, | ||
228 | struct snd_ctl_elem_value *ucontrol); | ||
229 | int snd_soc_dapm_put_value_enum_double(struct snd_kcontrol *kcontrol, | ||
230 | struct snd_ctl_elem_value *ucontrol); | ||
217 | int snd_soc_dapm_new_control(struct snd_soc_codec *codec, | 231 | int snd_soc_dapm_new_control(struct snd_soc_codec *codec, |
218 | const struct snd_soc_dapm_widget *widget); | 232 | const struct snd_soc_dapm_widget *widget); |
219 | int snd_soc_dapm_new_controls(struct snd_soc_codec *codec, | 233 | int snd_soc_dapm_new_controls(struct snd_soc_codec *codec, |
@@ -247,6 +261,7 @@ enum snd_soc_dapm_type { | |||
247 | snd_soc_dapm_input = 0, /* input pin */ | 261 | snd_soc_dapm_input = 0, /* input pin */ |
248 | snd_soc_dapm_output, /* output pin */ | 262 | snd_soc_dapm_output, /* output pin */ |
249 | snd_soc_dapm_mux, /* selects 1 analog signal from many inputs */ | 263 | snd_soc_dapm_mux, /* selects 1 analog signal from many inputs */ |
264 | snd_soc_dapm_value_mux, /* selects 1 analog signal from many inputs */ | ||
250 | snd_soc_dapm_mixer, /* mixes several analog signals together */ | 265 | snd_soc_dapm_mixer, /* mixes several analog signals together */ |
251 | snd_soc_dapm_pga, /* programmable gain/attenuation (volume) */ | 266 | snd_soc_dapm_pga, /* programmable gain/attenuation (volume) */ |
252 | snd_soc_dapm_adc, /* analog to digital converter */ | 267 | snd_soc_dapm_adc, /* analog to digital converter */ |
diff --git a/include/sound/soc.h b/include/sound/soc.h index f86e455d3828..9b930d342116 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -94,11 +94,22 @@ | |||
94 | SOC_ENUM_DOUBLE(xreg, xshift, xshift, xmax, xtexts) | 94 | SOC_ENUM_DOUBLE(xreg, xshift, xshift, xmax, xtexts) |
95 | #define SOC_ENUM_SINGLE_EXT(xmax, xtexts) \ | 95 | #define SOC_ENUM_SINGLE_EXT(xmax, xtexts) \ |
96 | { .max = xmax, .texts = xtexts } | 96 | { .max = xmax, .texts = xtexts } |
97 | #define SOC_VALUE_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmask, xmax, xtexts, xvalues) \ | ||
98 | { .reg = xreg, .shift_l = xshift_l, .shift_r = xshift_r, \ | ||
99 | .mask = xmask, .max = xmax, .texts = xtexts, .values = xvalues} | ||
100 | #define SOC_VALUE_ENUM_SINGLE(xreg, xshift, xmask, xmax, xtexts, xvalues) \ | ||
101 | SOC_VALUE_ENUM_DOUBLE(xreg, xshift, xshift, xmask, xmax, xtexts, xvalues) | ||
97 | #define SOC_ENUM(xname, xenum) \ | 102 | #define SOC_ENUM(xname, xenum) \ |
98 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname,\ | 103 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname,\ |
99 | .info = snd_soc_info_enum_double, \ | 104 | .info = snd_soc_info_enum_double, \ |
100 | .get = snd_soc_get_enum_double, .put = snd_soc_put_enum_double, \ | 105 | .get = snd_soc_get_enum_double, .put = snd_soc_put_enum_double, \ |
101 | .private_value = (unsigned long)&xenum } | 106 | .private_value = (unsigned long)&xenum } |
107 | #define SOC_VALUE_ENUM(xname, xenum) \ | ||
108 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname,\ | ||
109 | .info = snd_soc_info_value_enum_double, \ | ||
110 | .get = snd_soc_get_value_enum_double, \ | ||
111 | .put = snd_soc_put_value_enum_double, \ | ||
112 | .private_value = (unsigned long)&xenum } | ||
102 | #define SOC_SINGLE_EXT(xname, xreg, xshift, xmax, xinvert,\ | 113 | #define SOC_SINGLE_EXT(xname, xreg, xshift, xmax, xinvert,\ |
103 | xhandler_get, xhandler_put) \ | 114 | xhandler_get, xhandler_put) \ |
104 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 115 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
@@ -200,6 +211,12 @@ int snd_soc_get_enum_double(struct snd_kcontrol *kcontrol, | |||
200 | struct snd_ctl_elem_value *ucontrol); | 211 | struct snd_ctl_elem_value *ucontrol); |
201 | int snd_soc_put_enum_double(struct snd_kcontrol *kcontrol, | 212 | int snd_soc_put_enum_double(struct snd_kcontrol *kcontrol, |
202 | struct snd_ctl_elem_value *ucontrol); | 213 | struct snd_ctl_elem_value *ucontrol); |
214 | int snd_soc_info_value_enum_double(struct snd_kcontrol *kcontrol, | ||
215 | struct snd_ctl_elem_info *uinfo); | ||
216 | int snd_soc_get_value_enum_double(struct snd_kcontrol *kcontrol, | ||
217 | struct snd_ctl_elem_value *ucontrol); | ||
218 | int snd_soc_put_value_enum_double(struct snd_kcontrol *kcontrol, | ||
219 | struct snd_ctl_elem_value *ucontrol); | ||
203 | int snd_soc_info_volsw(struct snd_kcontrol *kcontrol, | 220 | int snd_soc_info_volsw(struct snd_kcontrol *kcontrol, |
204 | struct snd_ctl_elem_info *uinfo); | 221 | struct snd_ctl_elem_info *uinfo); |
205 | int snd_soc_info_volsw_ext(struct snd_kcontrol *kcontrol, | 222 | int snd_soc_info_volsw_ext(struct snd_kcontrol *kcontrol, |
@@ -406,6 +423,19 @@ struct soc_enum { | |||
406 | void *dapm; | 423 | void *dapm; |
407 | }; | 424 | }; |
408 | 425 | ||
426 | /* semi enumerated kcontrol */ | ||
427 | struct soc_value_enum { | ||
428 | unsigned short reg; | ||
429 | unsigned short reg2; | ||
430 | unsigned char shift_l; | ||
431 | unsigned char shift_r; | ||
432 | unsigned int max; | ||
433 | unsigned int mask; | ||
434 | const char **texts; | ||
435 | const unsigned int *values; | ||
436 | void *dapm; | ||
437 | }; | ||
438 | |||
409 | #include <sound/soc-dai.h> | 439 | #include <sound/soc-dai.h> |
410 | 440 | ||
411 | #endif | 441 | #endif |