diff options
author | Jeff Garzik <jeff@garzik.org> | 2006-03-29 19:58:22 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-03-29 19:58:22 -0500 |
commit | 79072f38909e3d9883317238887460c39ddcc4cb (patch) | |
tree | 28369f5a844535ff836565eefd62695b0e890fa3 /include/linux | |
parent | 200d5a7684cc49ef4be40e832daf3f217e70dfbb (diff) | |
parent | 55d8ca4f8094246da6e71889a4e04bfafaa78b10 (diff) |
Merge branch 'upstream'
Diffstat (limited to 'include/linux')
176 files changed, 2284 insertions, 1493 deletions
diff --git a/include/linux/adb.h b/include/linux/adb.h index e9fdc63483c7..b7305b178279 100644 --- a/include/linux/adb.h +++ b/include/linux/adb.h | |||
@@ -85,7 +85,7 @@ enum adb_message { | |||
85 | ADB_MSG_POST_RESET /* Called after resetting the bus (re-do init & register) */ | 85 | ADB_MSG_POST_RESET /* Called after resetting the bus (re-do init & register) */ |
86 | }; | 86 | }; |
87 | extern struct adb_driver *adb_controller; | 87 | extern struct adb_driver *adb_controller; |
88 | extern struct notifier_block *adb_client_list; | 88 | extern struct blocking_notifier_head adb_client_list; |
89 | 89 | ||
90 | int adb_request(struct adb_request *req, void (*done)(struct adb_request *), | 90 | int adb_request(struct adb_request *req, void (*done)(struct adb_request *), |
91 | int flags, int nbytes, ...); | 91 | int flags, int nbytes, ...); |
diff --git a/include/linux/amba/serial.h b/include/linux/amba/serial.h index dc726ffccebd..48ee32a18ac5 100644 --- a/include/linux/amba/serial.h +++ b/include/linux/amba/serial.h | |||
@@ -158,4 +158,10 @@ | |||
158 | #define UART01x_RSR_ANY (UART01x_RSR_OE|UART01x_RSR_BE|UART01x_RSR_PE|UART01x_RSR_FE) | 158 | #define UART01x_RSR_ANY (UART01x_RSR_OE|UART01x_RSR_BE|UART01x_RSR_PE|UART01x_RSR_FE) |
159 | #define UART01x_FR_MODEM_ANY (UART01x_FR_DCD|UART01x_FR_DSR|UART01x_FR_CTS) | 159 | #define UART01x_FR_MODEM_ANY (UART01x_FR_DCD|UART01x_FR_DSR|UART01x_FR_CTS) |
160 | 160 | ||
161 | #ifndef __ASSEMBLY__ | ||
162 | struct amba_pl010_data { | ||
163 | void (*set_mctrl)(struct amba_device *dev, void __iomem *base, unsigned int mctrl); | ||
164 | }; | ||
165 | #endif | ||
166 | |||
161 | #endif | 167 | #endif |
diff --git a/include/linux/audit.h b/include/linux/audit.h index da3c01955f3d..1c47c59058c1 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
@@ -33,27 +33,42 @@ | |||
33 | * 1200 - 1299 messages internal to the audit daemon | 33 | * 1200 - 1299 messages internal to the audit daemon |
34 | * 1300 - 1399 audit event messages | 34 | * 1300 - 1399 audit event messages |
35 | * 1400 - 1499 SE Linux use | 35 | * 1400 - 1499 SE Linux use |
36 | * 1500 - 1999 future use | 36 | * 1500 - 1599 kernel LSPP events |
37 | * 2000 is for otherwise unclassified kernel audit messages | 37 | * 1600 - 1699 kernel crypto events |
38 | * 1700 - 1799 kernel anomaly records | ||
39 | * 1800 - 1999 future kernel use (maybe integrity labels and related events) | ||
40 | * 2000 is for otherwise unclassified kernel audit messages (legacy) | ||
41 | * 2001 - 2099 unused (kernel) | ||
42 | * 2100 - 2199 user space anomaly records | ||
43 | * 2200 - 2299 user space actions taken in response to anomalies | ||
44 | * 2300 - 2399 user space generated LSPP events | ||
45 | * 2400 - 2499 user space crypto events | ||
46 | * 2500 - 2999 future user space (maybe integrity labels and related events) | ||
38 | * | 47 | * |
39 | * Messages from 1000-1199 are bi-directional. 1200-1299 are exclusively user | 48 | * Messages from 1000-1199 are bi-directional. 1200-1299 & 2100 - 2999 are |
40 | * space. Anything over that is kernel --> user space communication. | 49 | * exclusively user space. 1300-2099 is kernel --> user space |
50 | * communication. | ||
41 | */ | 51 | */ |
42 | #define AUDIT_GET 1000 /* Get status */ | 52 | #define AUDIT_GET 1000 /* Get status */ |
43 | #define AUDIT_SET 1001 /* Set status (enable/disable/auditd) */ | 53 | #define AUDIT_SET 1001 /* Set status (enable/disable/auditd) */ |
44 | #define AUDIT_LIST 1002 /* List syscall filtering rules */ | 54 | #define AUDIT_LIST 1002 /* List syscall rules -- deprecated */ |
45 | #define AUDIT_ADD 1003 /* Add syscall filtering rule */ | 55 | #define AUDIT_ADD 1003 /* Add syscall rule -- deprecated */ |
46 | #define AUDIT_DEL 1004 /* Delete syscall filtering rule */ | 56 | #define AUDIT_DEL 1004 /* Delete syscall rule -- deprecated */ |
47 | #define AUDIT_USER 1005 /* Message from userspace -- deprecated */ | 57 | #define AUDIT_USER 1005 /* Message from userspace -- deprecated */ |
48 | #define AUDIT_LOGIN 1006 /* Define the login id and information */ | 58 | #define AUDIT_LOGIN 1006 /* Define the login id and information */ |
49 | #define AUDIT_WATCH_INS 1007 /* Insert file/dir watch entry */ | 59 | #define AUDIT_WATCH_INS 1007 /* Insert file/dir watch entry */ |
50 | #define AUDIT_WATCH_REM 1008 /* Remove file/dir watch entry */ | 60 | #define AUDIT_WATCH_REM 1008 /* Remove file/dir watch entry */ |
51 | #define AUDIT_WATCH_LIST 1009 /* List all file/dir watches */ | 61 | #define AUDIT_WATCH_LIST 1009 /* List all file/dir watches */ |
52 | #define AUDIT_SIGNAL_INFO 1010 /* Get info about sender of signal to auditd */ | 62 | #define AUDIT_SIGNAL_INFO 1010 /* Get info about sender of signal to auditd */ |
63 | #define AUDIT_ADD_RULE 1011 /* Add syscall filtering rule */ | ||
64 | #define AUDIT_DEL_RULE 1012 /* Delete syscall filtering rule */ | ||
65 | #define AUDIT_LIST_RULES 1013 /* List syscall filtering rules */ | ||
53 | 66 | ||
54 | #define AUDIT_FIRST_USER_MSG 1100 /* Userspace messages mostly uninteresting to kernel */ | 67 | #define AUDIT_FIRST_USER_MSG 1100 /* Userspace messages mostly uninteresting to kernel */ |
55 | #define AUDIT_USER_AVC 1107 /* We filter this differently */ | 68 | #define AUDIT_USER_AVC 1107 /* We filter this differently */ |
56 | #define AUDIT_LAST_USER_MSG 1199 | 69 | #define AUDIT_LAST_USER_MSG 1199 |
70 | #define AUDIT_FIRST_USER_MSG2 2100 /* More user space messages */ | ||
71 | #define AUDIT_LAST_USER_MSG2 2999 | ||
57 | 72 | ||
58 | #define AUDIT_DAEMON_START 1200 /* Daemon startup record */ | 73 | #define AUDIT_DAEMON_START 1200 /* Daemon startup record */ |
59 | #define AUDIT_DAEMON_END 1201 /* Daemon normal stop record */ | 74 | #define AUDIT_DAEMON_END 1201 /* Daemon normal stop record */ |
@@ -72,6 +87,13 @@ | |||
72 | #define AUDIT_AVC 1400 /* SE Linux avc denial or grant */ | 87 | #define AUDIT_AVC 1400 /* SE Linux avc denial or grant */ |
73 | #define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */ | 88 | #define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */ |
74 | #define AUDIT_AVC_PATH 1402 /* dentry, vfsmount pair from avc */ | 89 | #define AUDIT_AVC_PATH 1402 /* dentry, vfsmount pair from avc */ |
90 | #define AUDIT_MAC_POLICY_LOAD 1403 /* Policy file load */ | ||
91 | #define AUDIT_MAC_STATUS 1404 /* Changed enforcing,permissive,off */ | ||
92 | #define AUDIT_MAC_CONFIG_CHANGE 1405 /* Changes to booleans */ | ||
93 | |||
94 | #define AUDIT_FIRST_KERN_ANOM_MSG 1700 | ||
95 | #define AUDIT_LAST_KERN_ANOM_MSG 1799 | ||
96 | #define AUDIT_ANOM_PROMISCUOUS 1700 /* Device changed promiscuous mode */ | ||
75 | 97 | ||
76 | #define AUDIT_KERNEL 2000 /* Asynchronous audit record. NOT A REQUEST. */ | 98 | #define AUDIT_KERNEL 2000 /* Asynchronous audit record. NOT A REQUEST. */ |
77 | 99 | ||
@@ -81,8 +103,9 @@ | |||
81 | #define AUDIT_FILTER_ENTRY 0x02 /* Apply rule at syscall entry */ | 103 | #define AUDIT_FILTER_ENTRY 0x02 /* Apply rule at syscall entry */ |
82 | #define AUDIT_FILTER_WATCH 0x03 /* Apply rule to file system watches */ | 104 | #define AUDIT_FILTER_WATCH 0x03 /* Apply rule to file system watches */ |
83 | #define AUDIT_FILTER_EXIT 0x04 /* Apply rule at syscall exit */ | 105 | #define AUDIT_FILTER_EXIT 0x04 /* Apply rule at syscall exit */ |
106 | #define AUDIT_FILTER_TYPE 0x05 /* Apply rule at audit_log_start */ | ||
84 | 107 | ||
85 | #define AUDIT_NR_FILTERS 5 | 108 | #define AUDIT_NR_FILTERS 6 |
86 | 109 | ||
87 | #define AUDIT_FILTER_PREPEND 0x10 /* Prepend to front of list */ | 110 | #define AUDIT_FILTER_PREPEND 0x10 /* Prepend to front of list */ |
88 | 111 | ||
@@ -98,6 +121,13 @@ | |||
98 | #define AUDIT_WORD(nr) ((__u32)((nr)/32)) | 121 | #define AUDIT_WORD(nr) ((__u32)((nr)/32)) |
99 | #define AUDIT_BIT(nr) (1 << ((nr) - AUDIT_WORD(nr)*32)) | 122 | #define AUDIT_BIT(nr) (1 << ((nr) - AUDIT_WORD(nr)*32)) |
100 | 123 | ||
124 | /* This bitmask is used to validate user input. It represents all bits that | ||
125 | * are currently used in an audit field constant understood by the kernel. | ||
126 | * If you are adding a new #define AUDIT_<whatever>, please ensure that | ||
127 | * AUDIT_UNUSED_BITS is updated if need be. */ | ||
128 | #define AUDIT_UNUSED_BITS 0x0FFFFC00 | ||
129 | |||
130 | |||
101 | /* Rule fields */ | 131 | /* Rule fields */ |
102 | /* These are useful when checking the | 132 | /* These are useful when checking the |
103 | * task structure at task creation time | 133 | * task structure at task creation time |
@@ -114,6 +144,7 @@ | |||
114 | #define AUDIT_LOGINUID 9 | 144 | #define AUDIT_LOGINUID 9 |
115 | #define AUDIT_PERS 10 | 145 | #define AUDIT_PERS 10 |
116 | #define AUDIT_ARCH 11 | 146 | #define AUDIT_ARCH 11 |
147 | #define AUDIT_MSGTYPE 12 | ||
117 | 148 | ||
118 | /* These are ONLY useful when checking | 149 | /* These are ONLY useful when checking |
119 | * at syscall exit time (AUDIT_AT_EXIT). */ | 150 | * at syscall exit time (AUDIT_AT_EXIT). */ |
@@ -128,8 +159,28 @@ | |||
128 | #define AUDIT_ARG2 (AUDIT_ARG0+2) | 159 | #define AUDIT_ARG2 (AUDIT_ARG0+2) |
129 | #define AUDIT_ARG3 (AUDIT_ARG0+3) | 160 | #define AUDIT_ARG3 (AUDIT_ARG0+3) |
130 | 161 | ||
131 | #define AUDIT_NEGATE 0x80000000 | 162 | #define AUDIT_NEGATE 0x80000000 |
132 | 163 | ||
164 | /* These are the supported operators. | ||
165 | * 4 2 1 | ||
166 | * = > < | ||
167 | * ------- | ||
168 | * 0 0 0 0 nonsense | ||
169 | * 0 0 1 1 < | ||
170 | * 0 1 0 2 > | ||
171 | * 0 1 1 3 != | ||
172 | * 1 0 0 4 = | ||
173 | * 1 0 1 5 <= | ||
174 | * 1 1 0 6 >= | ||
175 | * 1 1 1 7 all operators | ||
176 | */ | ||
177 | #define AUDIT_LESS_THAN 0x10000000 | ||
178 | #define AUDIT_GREATER_THAN 0x20000000 | ||
179 | #define AUDIT_NOT_EQUAL 0x30000000 | ||
180 | #define AUDIT_EQUAL 0x40000000 | ||
181 | #define AUDIT_LESS_THAN_OR_EQUAL (AUDIT_LESS_THAN|AUDIT_EQUAL) | ||
182 | #define AUDIT_GREATER_THAN_OR_EQUAL (AUDIT_GREATER_THAN|AUDIT_EQUAL) | ||
183 | #define AUDIT_OPERATORS (AUDIT_EQUAL|AUDIT_NOT_EQUAL) | ||
133 | 184 | ||
134 | /* Status symbols */ | 185 | /* Status symbols */ |
135 | /* Mask values */ | 186 | /* Mask values */ |
@@ -186,6 +237,26 @@ struct audit_status { | |||
186 | __u32 backlog; /* messages waiting in queue */ | 237 | __u32 backlog; /* messages waiting in queue */ |
187 | }; | 238 | }; |
188 | 239 | ||
240 | /* audit_rule_data supports filter rules with both integer and string | ||
241 | * fields. It corresponds with AUDIT_ADD_RULE, AUDIT_DEL_RULE and | ||
242 | * AUDIT_LIST_RULES requests. | ||
243 | */ | ||
244 | struct audit_rule_data { | ||
245 | __u32 flags; /* AUDIT_PER_{TASK,CALL}, AUDIT_PREPEND */ | ||
246 | __u32 action; /* AUDIT_NEVER, AUDIT_POSSIBLE, AUDIT_ALWAYS */ | ||
247 | __u32 field_count; | ||
248 | __u32 mask[AUDIT_BITMASK_SIZE]; /* syscall(s) affected */ | ||
249 | __u32 fields[AUDIT_MAX_FIELDS]; | ||
250 | __u32 values[AUDIT_MAX_FIELDS]; | ||
251 | __u32 fieldflags[AUDIT_MAX_FIELDS]; | ||
252 | __u32 buflen; /* total length of string fields */ | ||
253 | char buf[0]; /* string fields buffer */ | ||
254 | }; | ||
255 | |||
256 | /* audit_rule is supported to maintain backward compatibility with | ||
257 | * userspace. It supports integer fields only and corresponds to | ||
258 | * AUDIT_ADD, AUDIT_DEL and AUDIT_LIST requests. | ||
259 | */ | ||
189 | struct audit_rule { /* for AUDIT_LIST, AUDIT_ADD, and AUDIT_DEL */ | 260 | struct audit_rule { /* for AUDIT_LIST, AUDIT_ADD, and AUDIT_DEL */ |
190 | __u32 flags; /* AUDIT_PER_{TASK,CALL}, AUDIT_PREPEND */ | 261 | __u32 flags; /* AUDIT_PER_{TASK,CALL}, AUDIT_PREPEND */ |
191 | __u32 action; /* AUDIT_NEVER, AUDIT_POSSIBLE, AUDIT_ALWAYS */ | 262 | __u32 action; /* AUDIT_NEVER, AUDIT_POSSIBLE, AUDIT_ALWAYS */ |
@@ -222,22 +293,33 @@ extern void audit_syscall_entry(struct task_struct *task, int arch, | |||
222 | extern void audit_syscall_exit(struct task_struct *task, int failed, long return_code); | 293 | extern void audit_syscall_exit(struct task_struct *task, int failed, long return_code); |
223 | extern void audit_getname(const char *name); | 294 | extern void audit_getname(const char *name); |
224 | extern void audit_putname(const char *name); | 295 | extern void audit_putname(const char *name); |
225 | extern void audit_inode(const char *name, const struct inode *inode, unsigned flags); | 296 | extern void __audit_inode(const char *name, const struct inode *inode, unsigned flags); |
297 | extern void __audit_inode_child(const char *dname, const struct inode *inode, | ||
298 | unsigned long pino); | ||
299 | static inline void audit_inode(const char *name, const struct inode *inode, | ||
300 | unsigned flags) { | ||
301 | if (unlikely(current->audit_context)) | ||
302 | __audit_inode(name, inode, flags); | ||
303 | } | ||
304 | static inline void audit_inode_child(const char *dname, | ||
305 | const struct inode *inode, | ||
306 | unsigned long pino) { | ||
307 | if (unlikely(current->audit_context)) | ||
308 | __audit_inode_child(dname, inode, pino); | ||
309 | } | ||
226 | 310 | ||
227 | /* Private API (for audit.c only) */ | 311 | /* Private API (for audit.c only) */ |
228 | extern int audit_receive_filter(int type, int pid, int uid, int seq, | ||
229 | void *data, uid_t loginuid); | ||
230 | extern unsigned int audit_serial(void); | 312 | extern unsigned int audit_serial(void); |
231 | extern void auditsc_get_stamp(struct audit_context *ctx, | 313 | extern void auditsc_get_stamp(struct audit_context *ctx, |
232 | struct timespec *t, unsigned int *serial); | 314 | struct timespec *t, unsigned int *serial); |
233 | extern int audit_set_loginuid(struct task_struct *task, uid_t loginuid); | 315 | extern int audit_set_loginuid(struct task_struct *task, uid_t loginuid); |
234 | extern uid_t audit_get_loginuid(struct audit_context *ctx); | 316 | extern uid_t audit_get_loginuid(struct audit_context *ctx); |
235 | extern int audit_ipc_perms(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode); | 317 | extern int audit_ipc_perms(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode, struct kern_ipc_perm *ipcp); |
236 | extern int audit_socketcall(int nargs, unsigned long *args); | 318 | extern int audit_socketcall(int nargs, unsigned long *args); |
237 | extern int audit_sockaddr(int len, void *addr); | 319 | extern int audit_sockaddr(int len, void *addr); |
238 | extern int audit_avc_path(struct dentry *dentry, struct vfsmount *mnt); | 320 | extern int audit_avc_path(struct dentry *dentry, struct vfsmount *mnt); |
239 | extern void audit_signal_info(int sig, struct task_struct *t); | 321 | extern void audit_signal_info(int sig, struct task_struct *t); |
240 | extern int audit_filter_user(struct netlink_skb_parms *cb, int type); | 322 | extern int audit_set_macxattr(const char *name); |
241 | #else | 323 | #else |
242 | #define audit_alloc(t) ({ 0; }) | 324 | #define audit_alloc(t) ({ 0; }) |
243 | #define audit_free(t) do { ; } while (0) | 325 | #define audit_free(t) do { ; } while (0) |
@@ -245,16 +327,18 @@ extern int audit_filter_user(struct netlink_skb_parms *cb, int type); | |||
245 | #define audit_syscall_exit(t,f,r) do { ; } while (0) | 327 | #define audit_syscall_exit(t,f,r) do { ; } while (0) |
246 | #define audit_getname(n) do { ; } while (0) | 328 | #define audit_getname(n) do { ; } while (0) |
247 | #define audit_putname(n) do { ; } while (0) | 329 | #define audit_putname(n) do { ; } while (0) |
330 | #define __audit_inode(n,i,f) do { ; } while (0) | ||
331 | #define __audit_inode_child(d,i,p) do { ; } while (0) | ||
248 | #define audit_inode(n,i,f) do { ; } while (0) | 332 | #define audit_inode(n,i,f) do { ; } while (0) |
249 | #define audit_receive_filter(t,p,u,s,d,l) ({ -EOPNOTSUPP; }) | 333 | #define audit_inode_child(d,i,p) do { ; } while (0) |
250 | #define auditsc_get_stamp(c,t,s) do { BUG(); } while (0) | 334 | #define auditsc_get_stamp(c,t,s) do { BUG(); } while (0) |
251 | #define audit_get_loginuid(c) ({ -1; }) | 335 | #define audit_get_loginuid(c) ({ -1; }) |
252 | #define audit_ipc_perms(q,u,g,m) ({ 0; }) | 336 | #define audit_ipc_perms(q,u,g,m,i) ({ 0; }) |
253 | #define audit_socketcall(n,a) ({ 0; }) | 337 | #define audit_socketcall(n,a) ({ 0; }) |
254 | #define audit_sockaddr(len, addr) ({ 0; }) | 338 | #define audit_sockaddr(len, addr) ({ 0; }) |
255 | #define audit_avc_path(dentry, mnt) ({ 0; }) | 339 | #define audit_avc_path(dentry, mnt) ({ 0; }) |
256 | #define audit_signal_info(s,t) do { ; } while (0) | 340 | #define audit_signal_info(s,t) do { ; } while (0) |
257 | #define audit_filter_user(cb,t) ({ 1; }) | 341 | #define audit_set_macxattr(n) do { ; } while (0) |
258 | #endif | 342 | #endif |
259 | 343 | ||
260 | #ifdef CONFIG_AUDIT | 344 | #ifdef CONFIG_AUDIT |
@@ -278,12 +362,11 @@ extern void audit_log_d_path(struct audit_buffer *ab, | |||
278 | const char *prefix, | 362 | const char *prefix, |
279 | struct dentry *dentry, | 363 | struct dentry *dentry, |
280 | struct vfsmount *vfsmnt); | 364 | struct vfsmount *vfsmnt); |
281 | /* Private API (for auditsc.c only) */ | 365 | /* Private API (for audit.c only) */ |
282 | extern void audit_send_reply(int pid, int seq, int type, | 366 | extern int audit_filter_user(struct netlink_skb_parms *cb, int type); |
283 | int done, int multi, | 367 | extern int audit_filter_type(int type); |
284 | void *payload, int size); | 368 | extern int audit_receive_filter(int type, int pid, int uid, int seq, |
285 | extern void audit_log_lost(const char *message); | 369 | void *data, size_t datasz, uid_t loginuid); |
286 | extern struct semaphore audit_netlink_sem; | ||
287 | #else | 370 | #else |
288 | #define audit_log(c,g,t,f,...) do { ; } while (0) | 371 | #define audit_log(c,g,t,f,...) do { ; } while (0) |
289 | #define audit_log_start(c,g,t) ({ NULL; }) | 372 | #define audit_log_start(c,g,t) ({ NULL; }) |
@@ -293,6 +376,7 @@ extern struct semaphore audit_netlink_sem; | |||
293 | #define audit_log_hex(a,b,l) do { ; } while (0) | 376 | #define audit_log_hex(a,b,l) do { ; } while (0) |
294 | #define audit_log_untrustedstring(a,s) do { ; } while (0) | 377 | #define audit_log_untrustedstring(a,s) do { ; } while (0) |
295 | #define audit_log_d_path(b,p,d,v) do { ; } while (0) | 378 | #define audit_log_d_path(b,p,d,v) do { ; } while (0) |
379 | #define audit_panic(m) do { ; } while (0) | ||
296 | #endif | 380 | #endif |
297 | #endif | 381 | #endif |
298 | #endif | 382 | #endif |
diff --git a/include/linux/auto_fs4.h b/include/linux/auto_fs4.h index 9343c89d843c..0a6bc52ffe88 100644 --- a/include/linux/auto_fs4.h +++ b/include/linux/auto_fs4.h | |||
@@ -19,18 +19,37 @@ | |||
19 | #undef AUTOFS_MIN_PROTO_VERSION | 19 | #undef AUTOFS_MIN_PROTO_VERSION |
20 | #undef AUTOFS_MAX_PROTO_VERSION | 20 | #undef AUTOFS_MAX_PROTO_VERSION |
21 | 21 | ||
22 | #define AUTOFS_PROTO_VERSION 4 | 22 | #define AUTOFS_PROTO_VERSION 5 |
23 | #define AUTOFS_MIN_PROTO_VERSION 3 | 23 | #define AUTOFS_MIN_PROTO_VERSION 3 |
24 | #define AUTOFS_MAX_PROTO_VERSION 4 | 24 | #define AUTOFS_MAX_PROTO_VERSION 5 |
25 | 25 | ||
26 | #define AUTOFS_PROTO_SUBVERSION 7 | 26 | #define AUTOFS_PROTO_SUBVERSION 0 |
27 | 27 | ||
28 | /* Mask for expire behaviour */ | 28 | /* Mask for expire behaviour */ |
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 | /* New message type */ | 32 | /* Daemon notification packet types */ |
33 | #define autofs_ptype_expire_multi 2 /* Expire entry (umount request) */ | 33 | enum autofs_notify { |
34 | NFY_NONE, | ||
35 | NFY_MOUNT, | ||
36 | NFY_EXPIRE | ||
37 | }; | ||
38 | |||
39 | /* Kernel protocol version 4 packet types */ | ||
40 | |||
41 | /* Expire entry (umount request) */ | ||
42 | #define autofs_ptype_expire_multi 2 | ||
43 | |||
44 | /* Kernel protocol version 5 packet types */ | ||
45 | |||
46 | /* Indirect mount missing and expire requests. */ | ||
47 | #define autofs_ptype_missing_indirect 3 | ||
48 | #define autofs_ptype_expire_indirect 4 | ||
49 | |||
50 | /* Direct mount missing and expire requests */ | ||
51 | #define autofs_ptype_missing_direct 5 | ||
52 | #define autofs_ptype_expire_direct 6 | ||
34 | 53 | ||
35 | /* v4 multi expire (via pipe) */ | 54 | /* v4 multi expire (via pipe) */ |
36 | struct autofs_packet_expire_multi { | 55 | struct autofs_packet_expire_multi { |
@@ -40,14 +59,36 @@ struct autofs_packet_expire_multi { | |||
40 | char name[NAME_MAX+1]; | 59 | char name[NAME_MAX+1]; |
41 | }; | 60 | }; |
42 | 61 | ||
62 | /* autofs v5 common packet struct */ | ||
63 | struct autofs_v5_packet { | ||
64 | struct autofs_packet_hdr hdr; | ||
65 | autofs_wqt_t wait_queue_token; | ||
66 | __u32 dev; | ||
67 | __u64 ino; | ||
68 | __u32 uid; | ||
69 | __u32 gid; | ||
70 | __u32 pid; | ||
71 | __u32 tgid; | ||
72 | __u32 len; | ||
73 | char name[NAME_MAX+1]; | ||
74 | }; | ||
75 | |||
76 | typedef struct autofs_v5_packet autofs_packet_missing_indirect_t; | ||
77 | typedef struct autofs_v5_packet autofs_packet_expire_indirect_t; | ||
78 | typedef struct autofs_v5_packet autofs_packet_missing_direct_t; | ||
79 | typedef struct autofs_v5_packet autofs_packet_expire_direct_t; | ||
80 | |||
43 | union autofs_packet_union { | 81 | union autofs_packet_union { |
44 | struct autofs_packet_hdr hdr; | 82 | struct autofs_packet_hdr hdr; |
45 | struct autofs_packet_missing missing; | 83 | struct autofs_packet_missing missing; |
46 | struct autofs_packet_expire expire; | 84 | struct autofs_packet_expire expire; |
47 | struct autofs_packet_expire_multi expire_multi; | 85 | struct autofs_packet_expire_multi expire_multi; |
86 | struct autofs_v5_packet v5_packet; | ||
48 | }; | 87 | }; |
49 | 88 | ||
50 | #define AUTOFS_IOC_EXPIRE_MULTI _IOW(0x93,0x66,int) | 89 | #define AUTOFS_IOC_EXPIRE_MULTI _IOW(0x93,0x66,int) |
90 | #define AUTOFS_IOC_EXPIRE_INDIRECT AUTOFS_IOC_EXPIRE_MULTI | ||
91 | #define AUTOFS_IOC_EXPIRE_DIRECT AUTOFS_IOC_EXPIRE_MULTI | ||
51 | #define AUTOFS_IOC_PROTOSUBVER _IOR(0x93,0x67,int) | 92 | #define AUTOFS_IOC_PROTOSUBVER _IOR(0x93,0x67,int) |
52 | #define AUTOFS_IOC_ASKREGHOST _IOR(0x93,0x68,int) | 93 | #define AUTOFS_IOC_ASKREGHOST _IOR(0x93,0x68,int) |
53 | #define AUTOFS_IOC_TOGGLEREGHOST _IOR(0x93,0x69,int) | 94 | #define AUTOFS_IOC_TOGGLEREGHOST _IOR(0x93,0x69,int) |
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h index 7d8ff97b3e92..d9ed27969855 100644 --- a/include/linux/bitmap.h +++ b/include/linux/bitmap.h | |||
@@ -46,6 +46,9 @@ | |||
46 | * bitmap_parse(ubuf, ulen, dst, nbits) Parse bitmap dst from user buf | 46 | * bitmap_parse(ubuf, ulen, dst, nbits) Parse bitmap dst from user buf |
47 | * bitmap_scnlistprintf(buf, len, src, nbits) Print bitmap src as list to buf | 47 | * bitmap_scnlistprintf(buf, len, src, nbits) Print bitmap src as list to buf |
48 | * bitmap_parselist(buf, dst, nbits) Parse bitmap dst from list | 48 | * bitmap_parselist(buf, dst, nbits) Parse bitmap dst from list |
49 | * bitmap_find_free_region(bitmap, bits, order) Find and allocate bit region | ||
50 | * bitmap_release_region(bitmap, pos, order) Free specified bit region | ||
51 | * bitmap_allocate_region(bitmap, pos, order) Allocate specified bit region | ||
49 | */ | 52 | */ |
50 | 53 | ||
51 | /* | 54 | /* |
diff --git a/include/linux/bitops.h b/include/linux/bitops.h index 208650b1ad3a..5d1eabcde5d5 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h | |||
@@ -3,88 +3,11 @@ | |||
3 | #include <asm/types.h> | 3 | #include <asm/types.h> |
4 | 4 | ||
5 | /* | 5 | /* |
6 | * ffs: find first bit set. This is defined the same way as | ||
7 | * the libc and compiler builtin ffs routines, therefore | ||
8 | * differs in spirit from the above ffz (man ffs). | ||
9 | */ | ||
10 | |||
11 | static inline int generic_ffs(int x) | ||
12 | { | ||
13 | int r = 1; | ||
14 | |||
15 | if (!x) | ||
16 | return 0; | ||
17 | if (!(x & 0xffff)) { | ||
18 | x >>= 16; | ||
19 | r += 16; | ||
20 | } | ||
21 | if (!(x & 0xff)) { | ||
22 | x >>= 8; | ||
23 | r += 8; | ||
24 | } | ||
25 | if (!(x & 0xf)) { | ||
26 | x >>= 4; | ||
27 | r += 4; | ||
28 | } | ||
29 | if (!(x & 3)) { | ||
30 | x >>= 2; | ||
31 | r += 2; | ||
32 | } | ||
33 | if (!(x & 1)) { | ||
34 | x >>= 1; | ||
35 | r += 1; | ||
36 | } | ||
37 | return r; | ||
38 | } | ||
39 | |||
40 | /* | ||
41 | * fls: find last bit set. | ||
42 | */ | ||
43 | |||
44 | static __inline__ int generic_fls(int x) | ||
45 | { | ||
46 | int r = 32; | ||
47 | |||
48 | if (!x) | ||
49 | return 0; | ||
50 | if (!(x & 0xffff0000u)) { | ||
51 | x <<= 16; | ||
52 | r -= 16; | ||
53 | } | ||
54 | if (!(x & 0xff000000u)) { | ||
55 | x <<= 8; | ||
56 | r -= 8; | ||
57 | } | ||
58 | if (!(x & 0xf0000000u)) { | ||
59 | x <<= 4; | ||
60 | r -= 4; | ||
61 | } | ||
62 | if (!(x & 0xc0000000u)) { | ||
63 | x <<= 2; | ||
64 | r -= 2; | ||
65 | } | ||
66 | if (!(x & 0x80000000u)) { | ||
67 | x <<= 1; | ||
68 | r -= 1; | ||
69 | } | ||
70 | return r; | ||
71 | } | ||
72 | |||
73 | /* | ||
74 | * Include this here because some architectures need generic_ffs/fls in | 6 | * Include this here because some architectures need generic_ffs/fls in |
75 | * scope | 7 | * scope |
76 | */ | 8 | */ |
77 | #include <asm/bitops.h> | 9 | #include <asm/bitops.h> |
78 | 10 | ||
79 | |||
80 | static inline int generic_fls64(__u64 x) | ||
81 | { | ||
82 | __u32 h = x >> 32; | ||
83 | if (h) | ||
84 | return fls(h) + 32; | ||
85 | return fls(x); | ||
86 | } | ||
87 | |||
88 | static __inline__ int get_bitmask_order(unsigned int count) | 11 | static __inline__ int get_bitmask_order(unsigned int count) |
89 | { | 12 | { |
90 | int order; | 13 | int order; |
@@ -103,54 +26,9 @@ static __inline__ int get_count_order(unsigned int count) | |||
103 | return order; | 26 | return order; |
104 | } | 27 | } |
105 | 28 | ||
106 | /* | ||
107 | * hweightN: returns the hamming weight (i.e. the number | ||
108 | * of bits set) of a N-bit word | ||
109 | */ | ||
110 | |||
111 | static inline unsigned int generic_hweight32(unsigned int w) | ||
112 | { | ||
113 | unsigned int res = (w & 0x55555555) + ((w >> 1) & 0x55555555); | ||
114 | res = (res & 0x33333333) + ((res >> 2) & 0x33333333); | ||
115 | res = (res & 0x0F0F0F0F) + ((res >> 4) & 0x0F0F0F0F); | ||
116 | res = (res & 0x00FF00FF) + ((res >> 8) & 0x00FF00FF); | ||
117 | return (res & 0x0000FFFF) + ((res >> 16) & 0x0000FFFF); | ||
118 | } | ||
119 | |||
120 | static inline unsigned int generic_hweight16(unsigned int w) | ||
121 | { | ||
122 | unsigned int res = (w & 0x5555) + ((w >> 1) & 0x5555); | ||
123 | res = (res & 0x3333) + ((res >> 2) & 0x3333); | ||
124 | res = (res & 0x0F0F) + ((res >> 4) & 0x0F0F); | ||
125 | return (res & 0x00FF) + ((res >> 8) & 0x00FF); | ||
126 | } | ||
127 | |||
128 | static inline unsigned int generic_hweight8(unsigned int w) | ||
129 | { | ||
130 | unsigned int res = (w & 0x55) + ((w >> 1) & 0x55); | ||
131 | res = (res & 0x33) + ((res >> 2) & 0x33); | ||
132 | return (res & 0x0F) + ((res >> 4) & 0x0F); | ||
133 | } | ||
134 | |||
135 | static inline unsigned long generic_hweight64(__u64 w) | ||
136 | { | ||
137 | #if BITS_PER_LONG < 64 | ||
138 | return generic_hweight32((unsigned int)(w >> 32)) + | ||
139 | generic_hweight32((unsigned int)w); | ||
140 | #else | ||
141 | u64 res; | ||
142 | res = (w & 0x5555555555555555ul) + ((w >> 1) & 0x5555555555555555ul); | ||
143 | res = (res & 0x3333333333333333ul) + ((res >> 2) & 0x3333333333333333ul); | ||
144 | res = (res & 0x0F0F0F0F0F0F0F0Ful) + ((res >> 4) & 0x0F0F0F0F0F0F0F0Ful); | ||
145 | res = (res & 0x00FF00FF00FF00FFul) + ((res >> 8) & 0x00FF00FF00FF00FFul); | ||
146 | res = (res & 0x0000FFFF0000FFFFul) + ((res >> 16) & 0x0000FFFF0000FFFFul); | ||
147 | return (res & 0x00000000FFFFFFFFul) + ((res >> 32) & 0x00000000FFFFFFFFul); | ||
148 | #endif | ||
149 | } | ||
150 | |||
151 | static inline unsigned long hweight_long(unsigned long w) | 29 | static inline unsigned long hweight_long(unsigned long w) |
152 | { | 30 | { |
153 | return sizeof(w) == 4 ? generic_hweight32(w) : generic_hweight64(w); | 31 | return sizeof(w) == 4 ? hweight32(w) : hweight64(w); |
154 | } | 32 | } |
155 | 33 | ||
156 | /* | 34 | /* |
@@ -175,4 +53,11 @@ static inline __u32 ror32(__u32 word, unsigned int shift) | |||
175 | return (word >> shift) | (word << (32 - shift)); | 53 | return (word >> shift) | (word << (32 - shift)); |
176 | } | 54 | } |
177 | 55 | ||
56 | static inline unsigned fls_long(unsigned long l) | ||
57 | { | ||
58 | if (sizeof(l) == 4) | ||
59 | return fls(l); | ||
60 | return fls64(l); | ||
61 | } | ||
62 | |||
178 | #endif | 63 | #endif |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 56bb6a4e15f3..d0cac8b58de7 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -22,6 +22,7 @@ typedef struct request_queue request_queue_t; | |||
22 | struct elevator_queue; | 22 | struct elevator_queue; |
23 | typedef struct elevator_queue elevator_t; | 23 | typedef struct elevator_queue elevator_t; |
24 | struct request_pm_state; | 24 | struct request_pm_state; |
25 | struct blk_trace; | ||
25 | 26 | ||
26 | #define BLKDEV_MIN_RQ 4 | 27 | #define BLKDEV_MIN_RQ 4 |
27 | #define BLKDEV_MAX_RQ 128 /* Default maximum */ | 28 | #define BLKDEV_MAX_RQ 128 /* Default maximum */ |
@@ -54,25 +55,29 @@ struct as_io_context { | |||
54 | 55 | ||
55 | struct cfq_queue; | 56 | struct cfq_queue; |
56 | struct cfq_io_context { | 57 | struct cfq_io_context { |
57 | /* | 58 | struct rb_node rb_node; |
58 | * circular list of cfq_io_contexts belonging to a process io context | ||
59 | */ | ||
60 | struct list_head list; | ||
61 | struct cfq_queue *cfqq[2]; | ||
62 | void *key; | 59 | void *key; |
63 | 60 | ||
61 | struct cfq_queue *cfqq[2]; | ||
62 | |||
64 | struct io_context *ioc; | 63 | struct io_context *ioc; |
65 | 64 | ||
66 | unsigned long last_end_request; | 65 | unsigned long last_end_request; |
67 | unsigned long last_queue; | 66 | sector_t last_request_pos; |
67 | unsigned long last_queue; | ||
68 | |||
68 | unsigned long ttime_total; | 69 | unsigned long ttime_total; |
69 | unsigned long ttime_samples; | 70 | unsigned long ttime_samples; |
70 | unsigned long ttime_mean; | 71 | unsigned long ttime_mean; |
71 | 72 | ||
73 | unsigned int seek_samples; | ||
74 | u64 seek_total; | ||
75 | sector_t seek_mean; | ||
76 | |||
72 | struct list_head queue_list; | 77 | struct list_head queue_list; |
73 | 78 | ||
74 | void (*dtor)(struct cfq_io_context *); | 79 | void (*dtor)(struct io_context *); /* destructor */ |
75 | void (*exit)(struct cfq_io_context *); | 80 | void (*exit)(struct io_context *); /* called on task exit */ |
76 | }; | 81 | }; |
77 | 82 | ||
78 | /* | 83 | /* |
@@ -93,7 +98,7 @@ struct io_context { | |||
93 | int nr_batch_requests; /* Number of requests left in the batch */ | 98 | int nr_batch_requests; /* Number of requests left in the batch */ |
94 | 99 | ||
95 | struct as_io_context *aic; | 100 | struct as_io_context *aic; |
96 | struct cfq_io_context *cic; | 101 | struct rb_root cic_root; |
97 | }; | 102 | }; |
98 | 103 | ||
99 | void put_io_context(struct io_context *ioc); | 104 | void put_io_context(struct io_context *ioc); |
@@ -416,6 +421,8 @@ struct request_queue | |||
416 | unsigned int sg_reserved_size; | 421 | unsigned int sg_reserved_size; |
417 | int node; | 422 | int node; |
418 | 423 | ||
424 | struct blk_trace *blk_trace; | ||
425 | |||
419 | /* | 426 | /* |
420 | * reserved for flush operations | 427 | * reserved for flush operations |
421 | */ | 428 | */ |
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h new file mode 100644 index 000000000000..b34d3e73d5ea --- /dev/null +++ b/include/linux/blktrace_api.h | |||
@@ -0,0 +1,277 @@ | |||
1 | #ifndef BLKTRACE_H | ||
2 | #define BLKTRACE_H | ||
3 | |||
4 | #include <linux/config.h> | ||
5 | #include <linux/blkdev.h> | ||
6 | #include <linux/relay.h> | ||
7 | |||
8 | /* | ||
9 | * Trace categories | ||
10 | */ | ||
11 | enum blktrace_cat { | ||
12 | BLK_TC_READ = 1 << 0, /* reads */ | ||
13 | BLK_TC_WRITE = 1 << 1, /* writes */ | ||
14 | BLK_TC_BARRIER = 1 << 2, /* barrier */ | ||
15 | BLK_TC_SYNC = 1 << 3, /* barrier */ | ||
16 | BLK_TC_QUEUE = 1 << 4, /* queueing/merging */ | ||
17 | BLK_TC_REQUEUE = 1 << 5, /* requeueing */ | ||
18 | BLK_TC_ISSUE = 1 << 6, /* issue */ | ||
19 | BLK_TC_COMPLETE = 1 << 7, /* completions */ | ||
20 | BLK_TC_FS = 1 << 8, /* fs requests */ | ||
21 | BLK_TC_PC = 1 << 9, /* pc requests */ | ||
22 | BLK_TC_NOTIFY = 1 << 10, /* special message */ | ||
23 | |||
24 | BLK_TC_END = 1 << 15, /* only 16-bits, reminder */ | ||
25 | }; | ||
26 | |||
27 | #define BLK_TC_SHIFT (16) | ||
28 | #define BLK_TC_ACT(act) ((act) << BLK_TC_SHIFT) | ||
29 | |||
30 | /* | ||
31 | * Basic trace actions | ||
32 | */ | ||
33 | enum blktrace_act { | ||
34 | __BLK_TA_QUEUE = 1, /* queued */ | ||
35 | __BLK_TA_BACKMERGE, /* back merged to existing rq */ | ||
36 | __BLK_TA_FRONTMERGE, /* front merge to existing rq */ | ||
37 | __BLK_TA_GETRQ, /* allocated new request */ | ||
38 | __BLK_TA_SLEEPRQ, /* sleeping on rq allocation */ | ||
39 | __BLK_TA_REQUEUE, /* request requeued */ | ||
40 | __BLK_TA_ISSUE, /* sent to driver */ | ||
41 | __BLK_TA_COMPLETE, /* completed by driver */ | ||
42 | __BLK_TA_PLUG, /* queue was plugged */ | ||
43 | __BLK_TA_UNPLUG_IO, /* queue was unplugged by io */ | ||
44 | __BLK_TA_UNPLUG_TIMER, /* queue was unplugged by timer */ | ||
45 | __BLK_TA_INSERT, /* insert request */ | ||
46 | __BLK_TA_SPLIT, /* bio was split */ | ||
47 | __BLK_TA_BOUNCE, /* bio was bounced */ | ||
48 | __BLK_TA_REMAP, /* bio was remapped */ | ||
49 | }; | ||
50 | |||
51 | /* | ||
52 | * Trace actions in full. Additionally, read or write is masked | ||
53 | */ | ||
54 | #define BLK_TA_QUEUE (__BLK_TA_QUEUE | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
55 | #define BLK_TA_BACKMERGE (__BLK_TA_BACKMERGE | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
56 | #define BLK_TA_FRONTMERGE (__BLK_TA_FRONTMERGE | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
57 | #define BLK_TA_GETRQ (__BLK_TA_GETRQ | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
58 | #define BLK_TA_SLEEPRQ (__BLK_TA_SLEEPRQ | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
59 | #define BLK_TA_REQUEUE (__BLK_TA_REQUEUE | BLK_TC_ACT(BLK_TC_REQUEUE)) | ||
60 | #define BLK_TA_ISSUE (__BLK_TA_ISSUE | BLK_TC_ACT(BLK_TC_ISSUE)) | ||
61 | #define BLK_TA_COMPLETE (__BLK_TA_COMPLETE| BLK_TC_ACT(BLK_TC_COMPLETE)) | ||
62 | #define BLK_TA_PLUG (__BLK_TA_PLUG | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
63 | #define BLK_TA_UNPLUG_IO (__BLK_TA_UNPLUG_IO | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
64 | #define BLK_TA_UNPLUG_TIMER (__BLK_TA_UNPLUG_TIMER | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
65 | #define BLK_TA_INSERT (__BLK_TA_INSERT | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
66 | #define BLK_TA_SPLIT (__BLK_TA_SPLIT) | ||
67 | #define BLK_TA_BOUNCE (__BLK_TA_BOUNCE) | ||
68 | #define BLK_TA_REMAP (__BLK_TA_REMAP | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
69 | |||
70 | #define BLK_IO_TRACE_MAGIC 0x65617400 | ||
71 | #define BLK_IO_TRACE_VERSION 0x07 | ||
72 | |||
73 | /* | ||
74 | * The trace itself | ||
75 | */ | ||
76 | struct blk_io_trace { | ||
77 | u32 magic; /* MAGIC << 8 | version */ | ||
78 | u32 sequence; /* event number */ | ||
79 | u64 time; /* in microseconds */ | ||
80 | u64 sector; /* disk offset */ | ||
81 | u32 bytes; /* transfer length */ | ||
82 | u32 action; /* what happened */ | ||
83 | u32 pid; /* who did it */ | ||
84 | u32 device; /* device number */ | ||
85 | u32 cpu; /* on what cpu did it happen */ | ||
86 | u16 error; /* completion error */ | ||
87 | u16 pdu_len; /* length of data after this trace */ | ||
88 | }; | ||
89 | |||
90 | /* | ||
91 | * The remap event | ||
92 | */ | ||
93 | struct blk_io_trace_remap { | ||
94 | u32 device; | ||
95 | u32 __pad; | ||
96 | u64 sector; | ||
97 | }; | ||
98 | |||
99 | enum { | ||
100 | Blktrace_setup = 1, | ||
101 | Blktrace_running, | ||
102 | Blktrace_stopped, | ||
103 | }; | ||
104 | |||
105 | struct blk_trace { | ||
106 | int trace_state; | ||
107 | struct rchan *rchan; | ||
108 | unsigned long *sequence; | ||
109 | u16 act_mask; | ||
110 | u64 start_lba; | ||
111 | u64 end_lba; | ||
112 | u32 pid; | ||
113 | u32 dev; | ||
114 | struct dentry *dir; | ||
115 | struct dentry *dropped_file; | ||
116 | atomic_t dropped; | ||
117 | }; | ||
118 | |||
119 | /* | ||
120 | * User setup structure passed with BLKTRACESTART | ||
121 | */ | ||
122 | struct blk_user_trace_setup { | ||
123 | char name[BDEVNAME_SIZE]; /* output */ | ||
124 | u16 act_mask; /* input */ | ||
125 | u32 buf_size; /* input */ | ||
126 | u32 buf_nr; /* input */ | ||
127 | u64 start_lba; | ||
128 | u64 end_lba; | ||
129 | u32 pid; | ||
130 | }; | ||
131 | |||
132 | #if defined(CONFIG_BLK_DEV_IO_TRACE) | ||
133 | extern int blk_trace_ioctl(struct block_device *, unsigned, char __user *); | ||
134 | extern void blk_trace_shutdown(request_queue_t *); | ||
135 | extern void __blk_add_trace(struct blk_trace *, sector_t, int, int, u32, int, int, void *); | ||
136 | |||
137 | /** | ||
138 | * blk_add_trace_rq - Add a trace for a request oriented action | ||
139 | * @q: queue the io is for | ||
140 | * @rq: the source request | ||
141 | * @what: the action | ||
142 | * | ||
143 | * Description: | ||
144 | * Records an action against a request. Will log the bio offset + size. | ||
145 | * | ||
146 | **/ | ||
147 | static inline void blk_add_trace_rq(struct request_queue *q, struct request *rq, | ||
148 | u32 what) | ||
149 | { | ||
150 | struct blk_trace *bt = q->blk_trace; | ||
151 | int rw = rq->flags & 0x07; | ||
152 | |||
153 | if (likely(!bt)) | ||
154 | return; | ||
155 | |||
156 | if (blk_pc_request(rq)) { | ||
157 | what |= BLK_TC_ACT(BLK_TC_PC); | ||
158 | __blk_add_trace(bt, 0, rq->data_len, rw, what, rq->errors, sizeof(rq->cmd), rq->cmd); | ||
159 | } else { | ||
160 | what |= BLK_TC_ACT(BLK_TC_FS); | ||
161 | __blk_add_trace(bt, rq->hard_sector, rq->hard_nr_sectors << 9, rw, what, rq->errors, 0, NULL); | ||
162 | } | ||
163 | } | ||
164 | |||
165 | /** | ||
166 | * blk_add_trace_bio - Add a trace for a bio oriented action | ||
167 | * @q: queue the io is for | ||
168 | * @bio: the source bio | ||
169 | * @what: the action | ||
170 | * | ||
171 | * Description: | ||
172 | * Records an action against a bio. Will log the bio offset + size. | ||
173 | * | ||
174 | **/ | ||
175 | static inline void blk_add_trace_bio(struct request_queue *q, struct bio *bio, | ||
176 | u32 what) | ||
177 | { | ||
178 | struct blk_trace *bt = q->blk_trace; | ||
179 | |||
180 | if (likely(!bt)) | ||
181 | return; | ||
182 | |||
183 | __blk_add_trace(bt, bio->bi_sector, bio->bi_size, bio->bi_rw, what, !bio_flagged(bio, BIO_UPTODATE), 0, NULL); | ||
184 | } | ||
185 | |||
186 | /** | ||
187 | * blk_add_trace_generic - Add a trace for a generic action | ||
188 | * @q: queue the io is for | ||
189 | * @bio: the source bio | ||
190 | * @rw: the data direction | ||
191 | * @what: the action | ||
192 | * | ||
193 | * Description: | ||
194 | * Records a simple trace | ||
195 | * | ||
196 | **/ | ||
197 | static inline void blk_add_trace_generic(struct request_queue *q, | ||
198 | struct bio *bio, int rw, u32 what) | ||
199 | { | ||
200 | struct blk_trace *bt = q->blk_trace; | ||
201 | |||
202 | if (likely(!bt)) | ||
203 | return; | ||
204 | |||
205 | if (bio) | ||
206 | blk_add_trace_bio(q, bio, what); | ||
207 | else | ||
208 | __blk_add_trace(bt, 0, 0, rw, what, 0, 0, NULL); | ||
209 | } | ||
210 | |||
211 | /** | ||
212 | * blk_add_trace_pdu_int - Add a trace for a bio with an integer payload | ||
213 | * @q: queue the io is for | ||
214 | * @what: the action | ||
215 | * @bio: the source bio | ||
216 | * @pdu: the integer payload | ||
217 | * | ||
218 | * Description: | ||
219 | * Adds a trace with some integer payload. This might be an unplug | ||
220 | * option given as the action, with the depth at unplug time given | ||
221 | * as the payload | ||
222 | * | ||
223 | **/ | ||
224 | static inline void blk_add_trace_pdu_int(struct request_queue *q, u32 what, | ||
225 | struct bio *bio, unsigned int pdu) | ||
226 | { | ||
227 | struct blk_trace *bt = q->blk_trace; | ||
228 | u64 rpdu = cpu_to_be64(pdu); | ||
229 | |||
230 | if (likely(!bt)) | ||
231 | return; | ||
232 | |||
233 | if (bio) | ||
234 | __blk_add_trace(bt, bio->bi_sector, bio->bi_size, bio->bi_rw, what, !bio_flagged(bio, BIO_UPTODATE), sizeof(rpdu), &rpdu); | ||
235 | else | ||
236 | __blk_add_trace(bt, 0, 0, 0, what, 0, sizeof(rpdu), &rpdu); | ||
237 | } | ||
238 | |||
239 | /** | ||
240 | * blk_add_trace_remap - Add a trace for a remap operation | ||
241 | * @q: queue the io is for | ||
242 | * @bio: the source bio | ||
243 | * @dev: target device | ||
244 | * @from: source sector | ||
245 | * @to: target sector | ||
246 | * | ||
247 | * Description: | ||
248 | * Device mapper or raid target sometimes need to split a bio because | ||
249 | * it spans a stripe (or similar). Add a trace for that action. | ||
250 | * | ||
251 | **/ | ||
252 | static inline void blk_add_trace_remap(struct request_queue *q, struct bio *bio, | ||
253 | dev_t dev, sector_t from, sector_t to) | ||
254 | { | ||
255 | struct blk_trace *bt = q->blk_trace; | ||
256 | struct blk_io_trace_remap r; | ||
257 | |||
258 | if (likely(!bt)) | ||
259 | return; | ||
260 | |||
261 | r.device = cpu_to_be32(dev); | ||
262 | r.sector = cpu_to_be64(to); | ||
263 | |||
264 | __blk_add_trace(bt, from, bio->bi_size, bio->bi_rw, BLK_TA_REMAP, !bio_flagged(bio, BIO_UPTODATE), sizeof(r), &r); | ||
265 | } | ||
266 | |||
267 | #else /* !CONFIG_BLK_DEV_IO_TRACE */ | ||
268 | #define blk_trace_ioctl(bdev, cmd, arg) (-ENOTTY) | ||
269 | #define blk_trace_shutdown(q) do { } while (0) | ||
270 | #define blk_add_trace_rq(q, rq, what) do { } while (0) | ||
271 | #define blk_add_trace_bio(q, rq, what) do { } while (0) | ||
272 | #define blk_add_trace_generic(q, rq, rw, what) do { } while (0) | ||
273 | #define blk_add_trace_pdu_int(q, what, bio, pdu) do { } while (0) | ||
274 | #define blk_add_trace_remap(q, bio, dev, f, t) do {} while (0) | ||
275 | #endif /* CONFIG_BLK_DEV_IO_TRACE */ | ||
276 | |||
277 | #endif | ||
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index 993da8cc9706..de3eb8d8ae26 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h | |||
@@ -38,6 +38,7 @@ typedef struct bootmem_data { | |||
38 | unsigned long last_pos; | 38 | unsigned long last_pos; |
39 | unsigned long last_success; /* Previous allocation point. To speed | 39 | unsigned long last_success; /* Previous allocation point. To speed |
40 | * up searching */ | 40 | * up searching */ |
41 | struct list_head list; | ||
41 | } bootmem_data_t; | 42 | } bootmem_data_t; |
42 | 43 | ||
43 | extern unsigned long __init bootmem_bootmap_pages (unsigned long); | 44 | extern unsigned long __init bootmem_bootmap_pages (unsigned long); |
@@ -51,6 +52,9 @@ extern void * __init __alloc_bootmem_low_node(pg_data_t *pgdat, | |||
51 | unsigned long size, | 52 | unsigned long size, |
52 | unsigned long align, | 53 | unsigned long align, |
53 | unsigned long goal); | 54 | unsigned long goal); |
55 | extern void * __init __alloc_bootmem_core(struct bootmem_data *bdata, | ||
56 | unsigned long size, unsigned long align, unsigned long goal, | ||
57 | unsigned long limit); | ||
54 | #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE | 58 | #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE |
55 | extern void __init reserve_bootmem (unsigned long addr, unsigned long size); | 59 | extern void __init reserve_bootmem (unsigned long addr, unsigned long size); |
56 | #define alloc_bootmem(x) \ | 60 | #define alloc_bootmem(x) \ |
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 9f159baf153f..fb7e9b7ccbe3 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h | |||
@@ -46,25 +46,28 @@ struct address_space; | |||
46 | typedef void (bh_end_io_t)(struct buffer_head *bh, int uptodate); | 46 | typedef void (bh_end_io_t)(struct buffer_head *bh, int uptodate); |
47 | 47 | ||
48 | /* | 48 | /* |
49 | * Keep related fields in common cachelines. The most commonly accessed | 49 | * Historically, a buffer_head was used to map a single block |
50 | * field (b_state) goes at the start so the compiler does not generate | 50 | * within a page, and of course as the unit of I/O through the |
51 | * indexed addressing for it. | 51 | * filesystem and block layers. Nowadays the basic I/O unit |
52 | * is the bio, and buffer_heads are used for extracting block | ||
53 | * mappings (via a get_block_t call), for tracking state within | ||
54 | * a page (via a page_mapping) and for wrapping bio submission | ||
55 | * for backward compatibility reasons (e.g. submit_bh). | ||
52 | */ | 56 | */ |
53 | struct buffer_head { | 57 | struct buffer_head { |
54 | /* First cache line: */ | ||
55 | unsigned long b_state; /* buffer state bitmap (see above) */ | 58 | unsigned long b_state; /* buffer state bitmap (see above) */ |
56 | struct buffer_head *b_this_page;/* circular list of page's buffers */ | 59 | struct buffer_head *b_this_page;/* circular list of page's buffers */ |
57 | struct page *b_page; /* the page this bh is mapped to */ | 60 | struct page *b_page; /* the page this bh is mapped to */ |
58 | atomic_t b_count; /* users using this block */ | ||
59 | u32 b_size; /* block size */ | ||
60 | 61 | ||
61 | sector_t b_blocknr; /* block number */ | 62 | sector_t b_blocknr; /* start block number */ |
62 | char *b_data; /* pointer to data block */ | 63 | size_t b_size; /* size of mapping */ |
64 | char *b_data; /* pointer to data within the page */ | ||
63 | 65 | ||
64 | struct block_device *b_bdev; | 66 | struct block_device *b_bdev; |
65 | bh_end_io_t *b_end_io; /* I/O completion */ | 67 | bh_end_io_t *b_end_io; /* I/O completion */ |
66 | void *b_private; /* reserved for b_end_io */ | 68 | void *b_private; /* reserved for b_end_io */ |
67 | struct list_head b_assoc_buffers; /* associated with another mapping */ | 69 | struct list_head b_assoc_buffers; /* associated with another mapping */ |
70 | atomic_t b_count; /* users using this buffer_head */ | ||
68 | }; | 71 | }; |
69 | 72 | ||
70 | /* | 73 | /* |
@@ -189,8 +192,8 @@ extern int buffer_heads_over_limit; | |||
189 | * address_spaces. | 192 | * address_spaces. |
190 | */ | 193 | */ |
191 | int try_to_release_page(struct page * page, gfp_t gfp_mask); | 194 | int try_to_release_page(struct page * page, gfp_t gfp_mask); |
192 | int block_invalidatepage(struct page *page, unsigned long offset); | 195 | void block_invalidatepage(struct page *page, unsigned long offset); |
193 | int do_invalidatepage(struct page *page, unsigned long offset); | 196 | void do_invalidatepage(struct page *page, unsigned long offset); |
194 | int block_write_full_page(struct page *page, get_block_t *get_block, | 197 | int block_write_full_page(struct page *page, get_block_t *get_block, |
195 | struct writeback_control *wbc); | 198 | struct writeback_control *wbc); |
196 | int block_read_full_page(struct page*, get_block_t*); | 199 | int block_read_full_page(struct page*, get_block_t*); |
@@ -200,7 +203,7 @@ int cont_prepare_write(struct page*, unsigned, unsigned, get_block_t*, | |||
200 | int generic_cont_expand(struct inode *inode, loff_t size); | 203 | int generic_cont_expand(struct inode *inode, loff_t size); |
201 | int generic_cont_expand_simple(struct inode *inode, loff_t size); | 204 | int generic_cont_expand_simple(struct inode *inode, loff_t size); |
202 | int block_commit_write(struct page *page, unsigned from, unsigned to); | 205 | int block_commit_write(struct page *page, unsigned from, unsigned to); |
203 | int block_sync_page(struct page *); | 206 | void block_sync_page(struct page *); |
204 | sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *); | 207 | sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *); |
205 | int generic_commit_write(struct file *, struct page *, unsigned, unsigned); | 208 | int generic_commit_write(struct file *, struct page *, unsigned, unsigned); |
206 | int block_truncate_page(struct address_space *, loff_t, get_block_t *); | 209 | int block_truncate_page(struct address_space *, loff_t, get_block_t *); |
@@ -277,6 +280,7 @@ map_bh(struct buffer_head *bh, struct super_block *sb, sector_t block) | |||
277 | set_buffer_mapped(bh); | 280 | set_buffer_mapped(bh); |
278 | bh->b_bdev = sb->s_bdev; | 281 | bh->b_bdev = sb->s_bdev; |
279 | bh->b_blocknr = block; | 282 | bh->b_blocknr = block; |
283 | bh->b_size = sb->s_blocksize; | ||
280 | } | 284 | } |
281 | 285 | ||
282 | /* | 286 | /* |
diff --git a/include/linux/cache.h b/include/linux/cache.h index d22e632f41fb..cc4b3aafad9a 100644 --- a/include/linux/cache.h +++ b/include/linux/cache.h | |||
@@ -13,9 +13,7 @@ | |||
13 | #define SMP_CACHE_BYTES L1_CACHE_BYTES | 13 | #define SMP_CACHE_BYTES L1_CACHE_BYTES |
14 | #endif | 14 | #endif |
15 | 15 | ||
16 | #if defined(CONFIG_X86) || defined(CONFIG_SPARC64) || defined(CONFIG_IA64) || defined(CONFIG_PARISC) | 16 | #ifndef __read_mostly |
17 | #define __read_mostly __attribute__((__section__(".data.read_mostly"))) | ||
18 | #else | ||
19 | #define __read_mostly | 17 | #define __read_mostly |
20 | #endif | 18 | #endif |
21 | 19 | ||
diff --git a/include/linux/capability.h b/include/linux/capability.h index 5a23ce752629..6548b35ab9f6 100644 --- a/include/linux/capability.h +++ b/include/linux/capability.h | |||
@@ -357,7 +357,8 @@ static inline kernel_cap_t cap_invert(kernel_cap_t c) | |||
357 | 357 | ||
358 | #define cap_is_fs_cap(c) (CAP_TO_MASK(c) & CAP_FS_MASK) | 358 | #define cap_is_fs_cap(c) (CAP_TO_MASK(c) & CAP_FS_MASK) |
359 | 359 | ||
360 | extern int capable(int cap); | 360 | int capable(int cap); |
361 | int __capable(struct task_struct *t, int cap); | ||
361 | 362 | ||
362 | #endif /* __KERNEL__ */ | 363 | #endif /* __KERNEL__ */ |
363 | 364 | ||
diff --git a/include/linux/cdev.h b/include/linux/cdev.h index 8da37e29cb87..2216638962d2 100644 --- a/include/linux/cdev.h +++ b/include/linux/cdev.h | |||
@@ -5,13 +5,13 @@ | |||
5 | struct cdev { | 5 | struct cdev { |
6 | struct kobject kobj; | 6 | struct kobject kobj; |
7 | struct module *owner; | 7 | struct module *owner; |
8 | struct file_operations *ops; | 8 | const struct file_operations *ops; |
9 | struct list_head list; | 9 | struct list_head list; |
10 | dev_t dev; | 10 | dev_t dev; |
11 | unsigned int count; | 11 | unsigned int count; |
12 | }; | 12 | }; |
13 | 13 | ||
14 | void cdev_init(struct cdev *, struct file_operations *); | 14 | void cdev_init(struct cdev *, const struct file_operations *); |
15 | 15 | ||
16 | struct cdev *cdev_alloc(void); | 16 | struct cdev *cdev_alloc(void); |
17 | 17 | ||
diff --git a/include/linux/cdrom.h b/include/linux/cdrom.h index b68fdf1f3156..3c9b0bc05123 100644 --- a/include/linux/cdrom.h +++ b/include/linux/cdrom.h | |||
@@ -378,7 +378,6 @@ struct cdrom_generic_command | |||
378 | #define CDC_MEDIA_CHANGED 0x80 /* media changed */ | 378 | #define CDC_MEDIA_CHANGED 0x80 /* media changed */ |
379 | #define CDC_PLAY_AUDIO 0x100 /* audio functions */ | 379 | #define CDC_PLAY_AUDIO 0x100 /* audio functions */ |
380 | #define CDC_RESET 0x200 /* hard reset device */ | 380 | #define CDC_RESET 0x200 /* hard reset device */ |
381 | #define CDC_IOCTLS 0x400 /* driver has non-standard ioctls */ | ||
382 | #define CDC_DRIVE_STATUS 0x800 /* driver implements drive status */ | 381 | #define CDC_DRIVE_STATUS 0x800 /* driver implements drive status */ |
383 | #define CDC_GENERIC_PACKET 0x1000 /* driver implements generic packets */ | 382 | #define CDC_GENERIC_PACKET 0x1000 /* driver implements generic packets */ |
384 | #define CDC_CD_R 0x2000 /* drive is a CD-R */ | 383 | #define CDC_CD_R 0x2000 /* drive is a CD-R */ |
@@ -974,9 +973,7 @@ struct cdrom_device_ops { | |||
974 | int (*reset) (struct cdrom_device_info *); | 973 | int (*reset) (struct cdrom_device_info *); |
975 | /* play stuff */ | 974 | /* play stuff */ |
976 | int (*audio_ioctl) (struct cdrom_device_info *,unsigned int, void *); | 975 | int (*audio_ioctl) (struct cdrom_device_info *,unsigned int, void *); |
977 | /* dev-specific */ | 976 | |
978 | int (*dev_ioctl) (struct cdrom_device_info *, | ||
979 | unsigned int, unsigned long); | ||
980 | /* driver specifications */ | 977 | /* driver specifications */ |
981 | const int capability; /* capability flags */ | 978 | const int capability; /* capability flags */ |
982 | int n_minors; /* number of active minor devices */ | 979 | int n_minors; /* number of active minor devices */ |
diff --git a/include/linux/clk.h b/include/linux/clk.h index 12848f81bb37..5ca8c6fddb56 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h | |||
@@ -8,8 +8,8 @@ | |||
8 | * it under the terms of the GNU General Public License version 2 as | 8 | * it under the terms of the GNU General Public License version 2 as |
9 | * published by the Free Software Foundation. | 9 | * published by the Free Software Foundation. |
10 | */ | 10 | */ |
11 | #ifndef ASMARM_CLOCK_H | 11 | #ifndef __LINUX_CLK_H |
12 | #define ASMARM_CLOCK_H | 12 | #define __LINUX_CLK_H |
13 | 13 | ||
14 | struct device; | 14 | struct device; |
15 | 15 | ||
diff --git a/include/linux/coda_linux.h b/include/linux/coda_linux.h index cc621ec409d8..b3ecf8f71d97 100644 --- a/include/linux/coda_linux.h +++ b/include/linux/coda_linux.h | |||
@@ -30,9 +30,9 @@ extern struct inode_operations coda_ioctl_inode_operations; | |||
30 | extern struct address_space_operations coda_file_aops; | 30 | extern struct address_space_operations coda_file_aops; |
31 | extern struct address_space_operations coda_symlink_aops; | 31 | extern struct address_space_operations coda_symlink_aops; |
32 | 32 | ||
33 | extern struct file_operations coda_dir_operations; | 33 | extern const struct file_operations coda_dir_operations; |
34 | extern struct file_operations coda_file_operations; | 34 | extern const struct file_operations coda_file_operations; |
35 | extern struct file_operations coda_ioctl_operations; | 35 | extern const struct file_operations coda_ioctl_operations; |
36 | 36 | ||
37 | /* operations shared over more than one file */ | 37 | /* operations shared over more than one file */ |
38 | int coda_open(struct inode *i, struct file *f); | 38 | int coda_open(struct inode *i, struct file *f); |
diff --git a/include/linux/compat.h b/include/linux/compat.h index c9ab2a26348c..6d3a654be1ae 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
@@ -45,6 +45,32 @@ struct compat_tms { | |||
45 | compat_clock_t tms_cstime; | 45 | compat_clock_t tms_cstime; |
46 | }; | 46 | }; |
47 | 47 | ||
48 | struct compat_timex { | ||
49 | compat_uint_t modes; | ||
50 | compat_long_t offset; | ||
51 | compat_long_t freq; | ||
52 | compat_long_t maxerror; | ||
53 | compat_long_t esterror; | ||
54 | compat_int_t status; | ||
55 | compat_long_t constant; | ||
56 | compat_long_t precision; | ||
57 | compat_long_t tolerance; | ||
58 | struct compat_timeval time; | ||
59 | compat_long_t tick; | ||
60 | compat_long_t ppsfreq; | ||
61 | compat_long_t jitter; | ||
62 | compat_int_t shift; | ||
63 | compat_long_t stabil; | ||
64 | compat_long_t jitcnt; | ||
65 | compat_long_t calcnt; | ||
66 | compat_long_t errcnt; | ||
67 | compat_long_t stbcnt; | ||
68 | |||
69 | compat_int_t :32; compat_int_t :32; compat_int_t :32; compat_int_t :32; | ||
70 | compat_int_t :32; compat_int_t :32; compat_int_t :32; compat_int_t :32; | ||
71 | compat_int_t :32; compat_int_t :32; compat_int_t :32; compat_int_t :32; | ||
72 | }; | ||
73 | |||
48 | #define _COMPAT_NSIG_WORDS (_COMPAT_NSIG / _COMPAT_NSIG_BPW) | 74 | #define _COMPAT_NSIG_WORDS (_COMPAT_NSIG / _COMPAT_NSIG_BPW) |
49 | 75 | ||
50 | typedef struct { | 76 | typedef struct { |
@@ -121,6 +147,24 @@ typedef struct compat_sigevent { | |||
121 | } _sigev_un; | 147 | } _sigev_un; |
122 | } compat_sigevent_t; | 148 | } compat_sigevent_t; |
123 | 149 | ||
150 | struct compat_robust_list { | ||
151 | compat_uptr_t next; | ||
152 | }; | ||
153 | |||
154 | struct compat_robust_list_head { | ||
155 | struct compat_robust_list list; | ||
156 | compat_long_t futex_offset; | ||
157 | compat_uptr_t list_op_pending; | ||
158 | }; | ||
159 | |||
160 | extern void compat_exit_robust_list(struct task_struct *curr); | ||
161 | |||
162 | asmlinkage long | ||
163 | compat_sys_set_robust_list(struct compat_robust_list_head __user *head, | ||
164 | compat_size_t len); | ||
165 | asmlinkage long | ||
166 | compat_sys_get_robust_list(int pid, compat_uptr_t *head_ptr, | ||
167 | compat_size_t __user *len_ptr); | ||
124 | 168 | ||
125 | long compat_sys_semctl(int first, int second, int third, void __user *uptr); | 169 | long compat_sys_semctl(int first, int second, int third, void __user *uptr); |
126 | long compat_sys_msgsnd(int first, int second, int third, void __user *uptr); | 170 | long compat_sys_msgsnd(int first, int second, int third, void __user *uptr); |
@@ -181,5 +225,7 @@ static inline int compat_timespec_compare(struct compat_timespec *lhs, | |||
181 | return lhs->tv_nsec - rhs->tv_nsec; | 225 | return lhs->tv_nsec - rhs->tv_nsec; |
182 | } | 226 | } |
183 | 227 | ||
228 | asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp); | ||
229 | |||
184 | #endif /* CONFIG_COMPAT */ | 230 | #endif /* CONFIG_COMPAT */ |
185 | #endif /* _LINUX_COMPAT_H */ | 231 | #endif /* _LINUX_COMPAT_H */ |
diff --git a/include/linux/compat_ioctl.h b/include/linux/compat_ioctl.h index ae7dfb790df3..89ab677cb993 100644 --- a/include/linux/compat_ioctl.h +++ b/include/linux/compat_ioctl.h | |||
@@ -97,6 +97,10 @@ COMPATIBLE_IOCTL(BLKRRPART) | |||
97 | COMPATIBLE_IOCTL(BLKFLSBUF) | 97 | COMPATIBLE_IOCTL(BLKFLSBUF) |
98 | COMPATIBLE_IOCTL(BLKSECTSET) | 98 | COMPATIBLE_IOCTL(BLKSECTSET) |
99 | COMPATIBLE_IOCTL(BLKSSZGET) | 99 | COMPATIBLE_IOCTL(BLKSSZGET) |
100 | COMPATIBLE_IOCTL(BLKTRACESTART) | ||
101 | COMPATIBLE_IOCTL(BLKTRACESTOP) | ||
102 | COMPATIBLE_IOCTL(BLKTRACESETUP) | ||
103 | COMPATIBLE_IOCTL(BLKTRACETEARDOWN) | ||
100 | ULONG_IOCTL(BLKRASET) | 104 | ULONG_IOCTL(BLKRASET) |
101 | ULONG_IOCTL(BLKFRASET) | 105 | ULONG_IOCTL(BLKFRASET) |
102 | /* RAID */ | 106 | /* RAID */ |
@@ -136,6 +140,7 @@ COMPATIBLE_IOCTL(DM_TABLE_DEPS_32) | |||
136 | COMPATIBLE_IOCTL(DM_TABLE_STATUS_32) | 140 | COMPATIBLE_IOCTL(DM_TABLE_STATUS_32) |
137 | COMPATIBLE_IOCTL(DM_LIST_VERSIONS_32) | 141 | COMPATIBLE_IOCTL(DM_LIST_VERSIONS_32) |
138 | COMPATIBLE_IOCTL(DM_TARGET_MSG_32) | 142 | COMPATIBLE_IOCTL(DM_TARGET_MSG_32) |
143 | COMPATIBLE_IOCTL(DM_DEV_SET_GEOMETRY_32) | ||
139 | COMPATIBLE_IOCTL(DM_VERSION) | 144 | COMPATIBLE_IOCTL(DM_VERSION) |
140 | COMPATIBLE_IOCTL(DM_REMOVE_ALL) | 145 | COMPATIBLE_IOCTL(DM_REMOVE_ALL) |
141 | COMPATIBLE_IOCTL(DM_LIST_DEVICES) | 146 | COMPATIBLE_IOCTL(DM_LIST_DEVICES) |
@@ -151,6 +156,7 @@ COMPATIBLE_IOCTL(DM_TABLE_DEPS) | |||
151 | COMPATIBLE_IOCTL(DM_TABLE_STATUS) | 156 | COMPATIBLE_IOCTL(DM_TABLE_STATUS) |
152 | COMPATIBLE_IOCTL(DM_LIST_VERSIONS) | 157 | COMPATIBLE_IOCTL(DM_LIST_VERSIONS) |
153 | COMPATIBLE_IOCTL(DM_TARGET_MSG) | 158 | COMPATIBLE_IOCTL(DM_TARGET_MSG) |
159 | COMPATIBLE_IOCTL(DM_DEV_SET_GEOMETRY) | ||
154 | /* Big K */ | 160 | /* Big K */ |
155 | COMPATIBLE_IOCTL(PIO_FONT) | 161 | COMPATIBLE_IOCTL(PIO_FONT) |
156 | COMPATIBLE_IOCTL(GIO_FONT) | 162 | COMPATIBLE_IOCTL(GIO_FONT) |
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index d612b89dce33..08d50c53aab4 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h | |||
@@ -74,7 +74,6 @@ extern int lock_cpu_hotplug_interruptible(void); | |||
74 | register_cpu_notifier(&fn##_nb); \ | 74 | register_cpu_notifier(&fn##_nb); \ |
75 | } | 75 | } |
76 | int cpu_down(unsigned int cpu); | 76 | int cpu_down(unsigned int cpu); |
77 | extern int __attribute__((weak)) smp_prepare_cpu(int cpu); | ||
78 | #define cpu_is_offline(cpu) unlikely(!cpu_online(cpu)) | 77 | #define cpu_is_offline(cpu) unlikely(!cpu_online(cpu)) |
79 | #else | 78 | #else |
80 | #define lock_cpu_hotplug() do { } while (0) | 79 | #define lock_cpu_hotplug() do { } while (0) |
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index 60e56c6e03dd..9cbb781d6f80 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
@@ -67,7 +67,7 @@ | |||
67 | * | 67 | * |
68 | * int any_online_cpu(mask) First online cpu in mask | 68 | * int any_online_cpu(mask) First online cpu in mask |
69 | * | 69 | * |
70 | * for_each_cpu(cpu) for-loop cpu over cpu_possible_map | 70 | * for_each_possible_cpu(cpu) for-loop cpu over cpu_possible_map |
71 | * for_each_online_cpu(cpu) for-loop cpu over cpu_online_map | 71 | * for_each_online_cpu(cpu) for-loop cpu over cpu_online_map |
72 | * for_each_present_cpu(cpu) for-loop cpu over cpu_present_map | 72 | * for_each_present_cpu(cpu) for-loop cpu over cpu_present_map |
73 | * | 73 | * |
@@ -212,17 +212,15 @@ static inline void __cpus_shift_left(cpumask_t *dstp, | |||
212 | bitmap_shift_left(dstp->bits, srcp->bits, n, nbits); | 212 | bitmap_shift_left(dstp->bits, srcp->bits, n, nbits); |
213 | } | 213 | } |
214 | 214 | ||
215 | #define first_cpu(src) __first_cpu(&(src), NR_CPUS) | 215 | #ifdef CONFIG_SMP |
216 | static inline int __first_cpu(const cpumask_t *srcp, int nbits) | 216 | int __first_cpu(const cpumask_t *srcp); |
217 | { | 217 | #define first_cpu(src) __first_cpu(&(src)) |
218 | return min_t(int, nbits, find_first_bit(srcp->bits, nbits)); | 218 | int __next_cpu(int n, const cpumask_t *srcp); |
219 | } | 219 | #define next_cpu(n, src) __next_cpu((n), &(src)) |
220 | 220 | #else | |
221 | #define next_cpu(n, src) __next_cpu((n), &(src), NR_CPUS) | 221 | #define first_cpu(src) 0 |
222 | static inline int __next_cpu(int n, const cpumask_t *srcp, int nbits) | 222 | #define next_cpu(n, src) 1 |
223 | { | 223 | #endif |
224 | return min_t(int, nbits, find_next_bit(srcp->bits, nbits, n+1)); | ||
225 | } | ||
226 | 224 | ||
227 | #define cpumask_of_cpu(cpu) \ | 225 | #define cpumask_of_cpu(cpu) \ |
228 | ({ \ | 226 | ({ \ |
@@ -398,27 +396,18 @@ extern cpumask_t cpu_present_map; | |||
398 | #define cpu_present(cpu) ((cpu) == 0) | 396 | #define cpu_present(cpu) ((cpu) == 0) |
399 | #endif | 397 | #endif |
400 | 398 | ||
401 | #define any_online_cpu(mask) \ | 399 | #ifdef CONFIG_SMP |
402 | ({ \ | 400 | int highest_possible_processor_id(void); |
403 | int cpu; \ | 401 | #define any_online_cpu(mask) __any_online_cpu(&(mask)) |
404 | for_each_cpu_mask(cpu, (mask)) \ | 402 | int __any_online_cpu(const cpumask_t *mask); |
405 | if (cpu_online(cpu)) \ | 403 | #else |
406 | break; \ | 404 | #define highest_possible_processor_id() 0 |
407 | cpu; \ | 405 | #define any_online_cpu(mask) 0 |
408 | }) | 406 | #endif |
409 | 407 | ||
410 | #define for_each_cpu(cpu) for_each_cpu_mask((cpu), cpu_possible_map) | 408 | #define for_each_cpu(cpu) for_each_cpu_mask((cpu), cpu_possible_map) |
409 | #define for_each_possible_cpu(cpu) for_each_cpu_mask((cpu), cpu_possible_map) | ||
411 | #define for_each_online_cpu(cpu) for_each_cpu_mask((cpu), cpu_online_map) | 410 | #define for_each_online_cpu(cpu) for_each_cpu_mask((cpu), cpu_online_map) |
412 | #define for_each_present_cpu(cpu) for_each_cpu_mask((cpu), cpu_present_map) | 411 | #define for_each_present_cpu(cpu) for_each_cpu_mask((cpu), cpu_present_map) |
413 | 412 | ||
414 | /* Find the highest possible smp_processor_id() */ | ||
415 | #define highest_possible_processor_id() \ | ||
416 | ({ \ | ||
417 | unsigned int cpu, highest = 0; \ | ||
418 | for_each_cpu_mask(cpu, cpu_possible_map) \ | ||
419 | highest = cpu; \ | ||
420 | highest; \ | ||
421 | }) | ||
422 | |||
423 | |||
424 | #endif /* __LINUX_CPUMASK_H */ | 413 | #endif /* __LINUX_CPUMASK_H */ |
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h index 3bc606927116..9354722a9217 100644 --- a/include/linux/cpuset.h +++ b/include/linux/cpuset.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * cpuset interface | 4 | * cpuset interface |
5 | * | 5 | * |
6 | * Copyright (C) 2003 BULL SA | 6 | * Copyright (C) 2003 BULL SA |
7 | * Copyright (C) 2004 Silicon Graphics, Inc. | 7 | * Copyright (C) 2004-2006 Silicon Graphics, Inc. |
8 | * | 8 | * |
9 | */ | 9 | */ |
10 | 10 | ||
@@ -51,6 +51,18 @@ extern char *cpuset_task_status_allowed(struct task_struct *task, char *buffer); | |||
51 | extern void cpuset_lock(void); | 51 | extern void cpuset_lock(void); |
52 | extern void cpuset_unlock(void); | 52 | extern void cpuset_unlock(void); |
53 | 53 | ||
54 | extern int cpuset_mem_spread_node(void); | ||
55 | |||
56 | static inline int cpuset_do_page_mem_spread(void) | ||
57 | { | ||
58 | return current->flags & PF_SPREAD_PAGE; | ||
59 | } | ||
60 | |||
61 | static inline int cpuset_do_slab_mem_spread(void) | ||
62 | { | ||
63 | return current->flags & PF_SPREAD_SLAB; | ||
64 | } | ||
65 | |||
54 | #else /* !CONFIG_CPUSETS */ | 66 | #else /* !CONFIG_CPUSETS */ |
55 | 67 | ||
56 | static inline int cpuset_init_early(void) { return 0; } | 68 | static inline int cpuset_init_early(void) { return 0; } |
@@ -99,6 +111,21 @@ static inline char *cpuset_task_status_allowed(struct task_struct *task, | |||
99 | static inline void cpuset_lock(void) {} | 111 | static inline void cpuset_lock(void) {} |
100 | static inline void cpuset_unlock(void) {} | 112 | static inline void cpuset_unlock(void) {} |
101 | 113 | ||
114 | static inline int cpuset_mem_spread_node(void) | ||
115 | { | ||
116 | return 0; | ||
117 | } | ||
118 | |||
119 | static inline int cpuset_do_page_mem_spread(void) | ||
120 | { | ||
121 | return 0; | ||
122 | } | ||
123 | |||
124 | static inline int cpuset_do_slab_mem_spread(void) | ||
125 | { | ||
126 | return 0; | ||
127 | } | ||
128 | |||
102 | #endif /* !CONFIG_CPUSETS */ | 129 | #endif /* !CONFIG_CPUSETS */ |
103 | 130 | ||
104 | #endif /* _LINUX_CPUSET_H */ | 131 | #endif /* _LINUX_CPUSET_H */ |
diff --git a/include/linux/crash_dump.h b/include/linux/crash_dump.h index 534d750d922d..32503657f14f 100644 --- a/include/linux/crash_dump.h +++ b/include/linux/crash_dump.h | |||
@@ -11,7 +11,7 @@ | |||
11 | extern unsigned long long elfcorehdr_addr; | 11 | extern unsigned long long elfcorehdr_addr; |
12 | extern ssize_t copy_oldmem_page(unsigned long, char *, size_t, | 12 | extern ssize_t copy_oldmem_page(unsigned long, char *, size_t, |
13 | unsigned long, int); | 13 | unsigned long, int); |
14 | extern struct file_operations proc_vmcore_operations; | 14 | extern const struct file_operations proc_vmcore_operations; |
15 | extern struct proc_dir_entry *proc_vmcore; | 15 | extern struct proc_dir_entry *proc_vmcore; |
16 | 16 | ||
17 | #endif /* CONFIG_CRASH_DUMP */ | 17 | #endif /* CONFIG_CRASH_DUMP */ |
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 4361f3789975..d10bd30c337e 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h | |||
@@ -162,6 +162,8 @@ d_iput: no no no yes | |||
162 | #define DCACHE_REFERENCED 0x0008 /* Recently used, don't discard. */ | 162 | #define DCACHE_REFERENCED 0x0008 /* Recently used, don't discard. */ |
163 | #define DCACHE_UNHASHED 0x0010 | 163 | #define DCACHE_UNHASHED 0x0010 |
164 | 164 | ||
165 | #define DCACHE_INOTIFY_PARENT_WATCHED 0x0020 /* Parent inode is watched */ | ||
166 | |||
165 | extern spinlock_t dcache_lock; | 167 | extern spinlock_t dcache_lock; |
166 | 168 | ||
167 | /** | 169 | /** |
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h index 4b0428e335be..176e2d371577 100644 --- a/include/linux/debugfs.h +++ b/include/linux/debugfs.h | |||
@@ -29,7 +29,7 @@ struct debugfs_blob_wrapper { | |||
29 | #if defined(CONFIG_DEBUG_FS) | 29 | #if defined(CONFIG_DEBUG_FS) |
30 | struct dentry *debugfs_create_file(const char *name, mode_t mode, | 30 | struct dentry *debugfs_create_file(const char *name, mode_t mode, |
31 | struct dentry *parent, void *data, | 31 | struct dentry *parent, void *data, |
32 | struct file_operations *fops); | 32 | const struct file_operations *fops); |
33 | 33 | ||
34 | struct dentry *debugfs_create_dir(const char *name, struct dentry *parent); | 34 | struct dentry *debugfs_create_dir(const char *name, struct dentry *parent); |
35 | 35 | ||
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index 51e0e95a421a..aee10b2ea4c6 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h | |||
@@ -97,6 +97,7 @@ struct io_restrictions { | |||
97 | unsigned short hardsect_size; | 97 | unsigned short hardsect_size; |
98 | unsigned int max_segment_size; | 98 | unsigned int max_segment_size; |
99 | unsigned long seg_boundary_mask; | 99 | unsigned long seg_boundary_mask; |
100 | unsigned char no_cluster; /* inverted so that 0 is default */ | ||
100 | }; | 101 | }; |
101 | 102 | ||
102 | struct dm_target { | 103 | struct dm_target { |
diff --git a/include/linux/device.h b/include/linux/device.h index 5b595fdfb672..f6e72a65a3f2 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -378,6 +378,7 @@ extern void device_bind_driver(struct device * dev); | |||
378 | extern void device_release_driver(struct device * dev); | 378 | extern void device_release_driver(struct device * dev); |
379 | extern int device_attach(struct device * dev); | 379 | extern int device_attach(struct device * dev); |
380 | extern void driver_attach(struct device_driver * drv); | 380 | extern void driver_attach(struct device_driver * drv); |
381 | extern void device_reprobe(struct device *dev); | ||
381 | 382 | ||
382 | 383 | ||
383 | /* | 384 | /* |
@@ -399,7 +400,7 @@ extern struct device * get_device(struct device * dev); | |||
399 | extern void put_device(struct device * dev); | 400 | extern void put_device(struct device * dev); |
400 | 401 | ||
401 | 402 | ||
402 | /* drivers/base/power.c */ | 403 | /* drivers/base/power/shutdown.c */ |
403 | extern void device_shutdown(void); | 404 | extern void device_shutdown(void); |
404 | 405 | ||
405 | 406 | ||
diff --git a/include/linux/dio.h b/include/linux/dio.h index fae9395fcf4f..1e65ebc2a3db 100644 --- a/include/linux/dio.h +++ b/include/linux/dio.h | |||
@@ -276,37 +276,5 @@ static inline void dio_set_drvdata (struct dio_dev *d, void *data) | |||
276 | dev_set_drvdata(&d->dev, data); | 276 | dev_set_drvdata(&d->dev, data); |
277 | } | 277 | } |
278 | 278 | ||
279 | /* | ||
280 | * A helper function which helps ensure correct dio_driver | ||
281 | * setup and cleanup for commonly-encountered hotplug/modular cases | ||
282 | * | ||
283 | * This MUST stay in a header, as it checks for -DMODULE | ||
284 | */ | ||
285 | static inline int dio_module_init(struct dio_driver *drv) | ||
286 | { | ||
287 | int rc = dio_register_driver(drv); | ||
288 | |||
289 | if (rc > 0) | ||
290 | return 0; | ||
291 | |||
292 | /* iff CONFIG_HOTPLUG and built into kernel, we should | ||
293 | * leave the driver around for future hotplug events. | ||
294 | * For the module case, a hotplug daemon of some sort | ||
295 | * should load a module in response to an insert event. */ | ||
296 | #if defined(CONFIG_HOTPLUG) && !defined(MODULE) | ||
297 | if (rc == 0) | ||
298 | return 0; | ||
299 | #else | ||
300 | if (rc == 0) | ||
301 | rc = -ENODEV; | ||
302 | #endif | ||
303 | |||
304 | /* if we get here, we need to clean up DIO driver instance | ||
305 | * and return some sort of error */ | ||
306 | dio_unregister_driver(drv); | ||
307 | |||
308 | return rc; | ||
309 | } | ||
310 | |||
311 | #endif /* __KERNEL__ */ | 279 | #endif /* __KERNEL__ */ |
312 | #endif /* ndef _LINUX_DIO_H */ | 280 | #endif /* ndef _LINUX_DIO_H */ |
diff --git a/include/linux/dm-ioctl.h b/include/linux/dm-ioctl.h index fa75ba0d635e..c67c6786612a 100644 --- a/include/linux/dm-ioctl.h +++ b/include/linux/dm-ioctl.h | |||
@@ -80,6 +80,16 @@ | |||
80 | * | 80 | * |
81 | * DM_TARGET_MSG: | 81 | * DM_TARGET_MSG: |
82 | * Pass a message string to the target at a specific offset of a device. | 82 | * Pass a message string to the target at a specific offset of a device. |
83 | * | ||
84 | * DM_DEV_SET_GEOMETRY: | ||
85 | * Set the geometry of a device by passing in a string in this format: | ||
86 | * | ||
87 | * "cylinders heads sectors_per_track start_sector" | ||
88 | * | ||
89 | * Beware that CHS geometry is nearly obsolete and only provided | ||
90 | * for compatibility with dm devices that can be booted by a PC | ||
91 | * BIOS. See struct hd_geometry for range limits. Also note that | ||
92 | * the geometry is erased if the device size changes. | ||
83 | */ | 93 | */ |
84 | 94 | ||
85 | /* | 95 | /* |
@@ -218,6 +228,7 @@ enum { | |||
218 | /* Added later */ | 228 | /* Added later */ |
219 | DM_LIST_VERSIONS_CMD, | 229 | DM_LIST_VERSIONS_CMD, |
220 | DM_TARGET_MSG_CMD, | 230 | DM_TARGET_MSG_CMD, |
231 | DM_DEV_SET_GEOMETRY_CMD | ||
221 | }; | 232 | }; |
222 | 233 | ||
223 | /* | 234 | /* |
@@ -247,6 +258,7 @@ typedef char ioctl_struct[308]; | |||
247 | #define DM_TABLE_STATUS_32 _IOWR(DM_IOCTL, DM_TABLE_STATUS_CMD, ioctl_struct) | 258 | #define DM_TABLE_STATUS_32 _IOWR(DM_IOCTL, DM_TABLE_STATUS_CMD, ioctl_struct) |
248 | #define DM_LIST_VERSIONS_32 _IOWR(DM_IOCTL, DM_LIST_VERSIONS_CMD, ioctl_struct) | 259 | #define DM_LIST_VERSIONS_32 _IOWR(DM_IOCTL, DM_LIST_VERSIONS_CMD, ioctl_struct) |
249 | #define DM_TARGET_MSG_32 _IOWR(DM_IOCTL, DM_TARGET_MSG_CMD, ioctl_struct) | 260 | #define DM_TARGET_MSG_32 _IOWR(DM_IOCTL, DM_TARGET_MSG_CMD, ioctl_struct) |
261 | #define DM_DEV_SET_GEOMETRY_32 _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, ioctl_struct) | ||
250 | #endif | 262 | #endif |
251 | 263 | ||
252 | #define DM_IOCTL 0xfd | 264 | #define DM_IOCTL 0xfd |
@@ -270,11 +282,12 @@ typedef char ioctl_struct[308]; | |||
270 | #define DM_LIST_VERSIONS _IOWR(DM_IOCTL, DM_LIST_VERSIONS_CMD, struct dm_ioctl) | 282 | #define DM_LIST_VERSIONS _IOWR(DM_IOCTL, DM_LIST_VERSIONS_CMD, struct dm_ioctl) |
271 | 283 | ||
272 | #define DM_TARGET_MSG _IOWR(DM_IOCTL, DM_TARGET_MSG_CMD, struct dm_ioctl) | 284 | #define DM_TARGET_MSG _IOWR(DM_IOCTL, DM_TARGET_MSG_CMD, struct dm_ioctl) |
285 | #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) | ||
273 | 286 | ||
274 | #define DM_VERSION_MAJOR 4 | 287 | #define DM_VERSION_MAJOR 4 |
275 | #define DM_VERSION_MINOR 5 | 288 | #define DM_VERSION_MINOR 6 |
276 | #define DM_VERSION_PATCHLEVEL 0 | 289 | #define DM_VERSION_PATCHLEVEL 0 |
277 | #define DM_VERSION_EXTRA "-ioctl (2005-10-04)" | 290 | #define DM_VERSION_EXTRA "-ioctl (2006-02-17)" |
278 | 291 | ||
279 | /* Status bits */ | 292 | /* Status bits */ |
280 | #define DM_READONLY_FLAG (1 << 0) /* In/Out */ | 293 | #define DM_READONLY_FLAG (1 << 0) /* In/Out */ |
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index 2d80cc761a15..9b4751aecc23 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h | |||
@@ -20,6 +20,8 @@ enum dma_data_direction { | |||
20 | #define DMA_31BIT_MASK 0x000000007fffffffULL | 20 | #define DMA_31BIT_MASK 0x000000007fffffffULL |
21 | #define DMA_30BIT_MASK 0x000000003fffffffULL | 21 | #define DMA_30BIT_MASK 0x000000003fffffffULL |
22 | #define DMA_29BIT_MASK 0x000000001fffffffULL | 22 | #define DMA_29BIT_MASK 0x000000001fffffffULL |
23 | #define DMA_28BIT_MASK 0x000000000fffffffULL | ||
24 | #define DMA_24BIT_MASK 0x0000000000ffffffULL | ||
23 | 25 | ||
24 | #include <asm/dma-mapping.h> | 26 | #include <asm/dma-mapping.h> |
25 | 27 | ||
diff --git a/include/linux/dmi.h b/include/linux/dmi.h index 2e6bbe014157..64fd6c366604 100644 --- a/include/linux/dmi.h +++ b/include/linux/dmi.h | |||
@@ -68,6 +68,7 @@ extern char * dmi_get_system_info(int field); | |||
68 | extern struct dmi_device * dmi_find_device(int type, const char *name, | 68 | extern struct dmi_device * dmi_find_device(int type, const char *name, |
69 | struct dmi_device *from); | 69 | struct dmi_device *from); |
70 | extern void dmi_scan_machine(void); | 70 | extern void dmi_scan_machine(void); |
71 | extern int dmi_get_year(int field); | ||
71 | 72 | ||
72 | #else | 73 | #else |
73 | 74 | ||
@@ -75,6 +76,7 @@ static inline int dmi_check_system(struct dmi_system_id *list) { return 0; } | |||
75 | static inline char * dmi_get_system_info(int field) { return NULL; } | 76 | static inline char * dmi_get_system_info(int field) { return NULL; } |
76 | static inline struct dmi_device * dmi_find_device(int type, const char *name, | 77 | static inline struct dmi_device * dmi_find_device(int type, const char *name, |
77 | struct dmi_device *from) { return NULL; } | 78 | struct dmi_device *from) { return NULL; } |
79 | static inline int dmi_get_year(int year) { return 0; } | ||
78 | 80 | ||
79 | #endif | 81 | #endif |
80 | 82 | ||
diff --git a/include/linux/efi.h b/include/linux/efi.h index c7c5dd316182..e203613d3aec 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h | |||
@@ -240,19 +240,21 @@ struct efi_memory_map { | |||
240 | unsigned long desc_size; | 240 | unsigned long desc_size; |
241 | }; | 241 | }; |
242 | 242 | ||
243 | #define EFI_INVALID_TABLE_ADDR (~0UL) | ||
244 | |||
243 | /* | 245 | /* |
244 | * All runtime access to EFI goes through this structure: | 246 | * All runtime access to EFI goes through this structure: |
245 | */ | 247 | */ |
246 | extern struct efi { | 248 | extern struct efi { |
247 | efi_system_table_t *systab; /* EFI system table */ | 249 | efi_system_table_t *systab; /* EFI system table */ |
248 | void *mps; /* MPS table */ | 250 | unsigned long mps; /* MPS table */ |
249 | void *acpi; /* ACPI table (IA64 ext 0.71) */ | 251 | unsigned long acpi; /* ACPI table (IA64 ext 0.71) */ |
250 | void *acpi20; /* ACPI table (ACPI 2.0) */ | 252 | unsigned long acpi20; /* ACPI table (ACPI 2.0) */ |
251 | void *smbios; /* SM BIOS table */ | 253 | unsigned long smbios; /* SM BIOS table */ |
252 | void *sal_systab; /* SAL system table */ | 254 | unsigned long sal_systab; /* SAL system table */ |
253 | void *boot_info; /* boot info table */ | 255 | unsigned long boot_info; /* boot info table */ |
254 | void *hcdp; /* HCDP table */ | 256 | unsigned long hcdp; /* HCDP table */ |
255 | void *uga; /* UGA table */ | 257 | unsigned long uga; /* UGA table */ |
256 | efi_get_time_t *get_time; | 258 | efi_get_time_t *get_time; |
257 | efi_set_time_t *set_time; | 259 | efi_set_time_t *set_time; |
258 | efi_get_wakeup_time_t *get_wakeup_time; | 260 | efi_get_wakeup_time_t *get_wakeup_time; |
@@ -292,6 +294,8 @@ extern void efi_enter_virtual_mode (void); /* switch EFI to virtual mode, if pos | |||
292 | extern u64 efi_get_iobase (void); | 294 | extern u64 efi_get_iobase (void); |
293 | extern u32 efi_mem_type (unsigned long phys_addr); | 295 | extern u32 efi_mem_type (unsigned long phys_addr); |
294 | extern u64 efi_mem_attributes (unsigned long phys_addr); | 296 | extern u64 efi_mem_attributes (unsigned long phys_addr); |
297 | extern int efi_mem_attribute_range (unsigned long phys_addr, unsigned long size, | ||
298 | u64 attr); | ||
295 | extern int __init efi_uart_console_only (void); | 299 | extern int __init efi_uart_console_only (void); |
296 | extern void efi_initialize_iomem_resources(struct resource *code_resource, | 300 | extern void efi_initialize_iomem_resources(struct resource *code_resource, |
297 | struct resource *data_resource); | 301 | struct resource *data_resource); |
diff --git a/include/linux/efs_fs.h b/include/linux/efs_fs.h index 28f368c526fb..fbfa6b52e2fb 100644 --- a/include/linux/efs_fs.h +++ b/include/linux/efs_fs.h | |||
@@ -37,7 +37,7 @@ static inline struct efs_sb_info *SUPER_INFO(struct super_block *sb) | |||
37 | struct statfs; | 37 | struct statfs; |
38 | 38 | ||
39 | extern struct inode_operations efs_dir_inode_operations; | 39 | extern struct inode_operations efs_dir_inode_operations; |
40 | extern struct file_operations efs_dir_operations; | 40 | extern const struct file_operations efs_dir_operations; |
41 | extern struct address_space_operations efs_symlink_aops; | 41 | extern struct address_space_operations efs_symlink_aops; |
42 | 42 | ||
43 | extern void efs_read_inode(struct inode *); | 43 | extern void efs_read_inode(struct inode *); |
diff --git a/include/linux/eventpoll.h b/include/linux/eventpoll.h index 1289f0ec4c00..1e4bdfcf83a2 100644 --- a/include/linux/eventpoll.h +++ b/include/linux/eventpoll.h | |||
@@ -52,7 +52,12 @@ struct file; | |||
52 | #ifdef CONFIG_EPOLL | 52 | #ifdef CONFIG_EPOLL |
53 | 53 | ||
54 | /* Used to initialize the epoll bits inside the "struct file" */ | 54 | /* Used to initialize the epoll bits inside the "struct file" */ |
55 | void eventpoll_init_file(struct file *file); | 55 | static inline void eventpoll_init_file(struct file *file) |
56 | { | ||
57 | INIT_LIST_HEAD(&file->f_ep_links); | ||
58 | spin_lock_init(&file->f_ep_lock); | ||
59 | } | ||
60 | |||
56 | 61 | ||
57 | /* Used to release the epoll bits inside the "struct file" */ | 62 | /* Used to release the epoll bits inside the "struct file" */ |
58 | void eventpoll_release_file(struct file *file); | 63 | void eventpoll_release_file(struct file *file); |
@@ -85,7 +90,6 @@ static inline void eventpoll_release(struct file *file) | |||
85 | eventpoll_release_file(file); | 90 | eventpoll_release_file(file); |
86 | } | 91 | } |
87 | 92 | ||
88 | |||
89 | #else | 93 | #else |
90 | 94 | ||
91 | static inline void eventpoll_init_file(struct file *file) {} | 95 | static inline void eventpoll_init_file(struct file *file) {} |
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index c0272d73ab20..3ade6a4e3bdd 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h | |||
@@ -36,7 +36,8 @@ struct statfs; | |||
36 | * Define EXT3_RESERVATION to reserve data blocks for expanding files | 36 | * Define EXT3_RESERVATION to reserve data blocks for expanding files |
37 | */ | 37 | */ |
38 | #define EXT3_DEFAULT_RESERVE_BLOCKS 8 | 38 | #define EXT3_DEFAULT_RESERVE_BLOCKS 8 |
39 | #define EXT3_MAX_RESERVE_BLOCKS 1024 | 39 | /*max window size: 1024(direct blocks) + 3([t,d]indirect blocks) */ |
40 | #define EXT3_MAX_RESERVE_BLOCKS 1027 | ||
40 | #define EXT3_RESERVE_WINDOW_NOT_ALLOCATED 0 | 41 | #define EXT3_RESERVE_WINDOW_NOT_ALLOCATED 0 |
41 | /* | 42 | /* |
42 | * Always enable hashed directories | 43 | * Always enable hashed directories |
@@ -732,6 +733,8 @@ struct dir_private_info { | |||
732 | extern int ext3_bg_has_super(struct super_block *sb, int group); | 733 | extern int ext3_bg_has_super(struct super_block *sb, int group); |
733 | extern unsigned long ext3_bg_num_gdb(struct super_block *sb, int group); | 734 | extern unsigned long ext3_bg_num_gdb(struct super_block *sb, int group); |
734 | extern int ext3_new_block (handle_t *, struct inode *, unsigned long, int *); | 735 | extern int ext3_new_block (handle_t *, struct inode *, unsigned long, int *); |
736 | extern int ext3_new_blocks (handle_t *, struct inode *, unsigned long, | ||
737 | unsigned long *, int *); | ||
735 | extern void ext3_free_blocks (handle_t *, struct inode *, unsigned long, | 738 | extern void ext3_free_blocks (handle_t *, struct inode *, unsigned long, |
736 | unsigned long); | 739 | unsigned long); |
737 | extern void ext3_free_blocks_sb (handle_t *, struct super_block *, | 740 | extern void ext3_free_blocks_sb (handle_t *, struct super_block *, |
@@ -772,9 +775,12 @@ extern unsigned long ext3_count_free (struct buffer_head *, unsigned); | |||
772 | 775 | ||
773 | 776 | ||
774 | /* inode.c */ | 777 | /* inode.c */ |
775 | extern int ext3_forget(handle_t *, int, struct inode *, struct buffer_head *, int); | 778 | int ext3_forget(handle_t *, int, struct inode *, struct buffer_head *, int); |
776 | extern struct buffer_head * ext3_getblk (handle_t *, struct inode *, long, int, int *); | 779 | struct buffer_head * ext3_getblk (handle_t *, struct inode *, long, int, int *); |
777 | extern struct buffer_head * ext3_bread (handle_t *, struct inode *, int, int, int *); | 780 | struct buffer_head * ext3_bread (handle_t *, struct inode *, int, int, int *); |
781 | int ext3_get_blocks_handle(handle_t *handle, struct inode *inode, | ||
782 | sector_t iblock, unsigned long maxblocks, struct buffer_head *bh_result, | ||
783 | int create, int extend_disksize); | ||
778 | 784 | ||
779 | extern void ext3_read_inode (struct inode *); | 785 | extern void ext3_read_inode (struct inode *); |
780 | extern int ext3_write_inode (struct inode *, int); | 786 | extern int ext3_write_inode (struct inode *, int); |
@@ -827,11 +833,11 @@ do { \ | |||
827 | */ | 833 | */ |
828 | 834 | ||
829 | /* dir.c */ | 835 | /* dir.c */ |
830 | extern struct file_operations ext3_dir_operations; | 836 | extern const struct file_operations ext3_dir_operations; |
831 | 837 | ||
832 | /* file.c */ | 838 | /* file.c */ |
833 | extern struct inode_operations ext3_file_inode_operations; | 839 | extern struct inode_operations ext3_file_inode_operations; |
834 | extern struct file_operations ext3_file_operations; | 840 | extern const struct file_operations ext3_file_operations; |
835 | 841 | ||
836 | /* namei.c */ | 842 | /* namei.c */ |
837 | extern struct inode_operations ext3_dir_inode_operations; | 843 | extern struct inode_operations ext3_dir_inode_operations; |
diff --git a/include/linux/ext3_fs_i.h b/include/linux/ext3_fs_i.h index e71dd98dbcae..7abf90147180 100644 --- a/include/linux/ext3_fs_i.h +++ b/include/linux/ext3_fs_i.h | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/rwsem.h> | 19 | #include <linux/rwsem.h> |
20 | #include <linux/rbtree.h> | 20 | #include <linux/rbtree.h> |
21 | #include <linux/seqlock.h> | 21 | #include <linux/seqlock.h> |
22 | #include <linux/mutex.h> | ||
22 | 23 | ||
23 | struct ext3_reserve_window { | 24 | struct ext3_reserve_window { |
24 | __u32 _rsv_start; /* First byte reserved */ | 25 | __u32 _rsv_start; /* First byte reserved */ |
@@ -122,16 +123,16 @@ struct ext3_inode_info { | |||
122 | __u16 i_extra_isize; | 123 | __u16 i_extra_isize; |
123 | 124 | ||
124 | /* | 125 | /* |
125 | * truncate_sem is for serialising ext3_truncate() against | 126 | * truncate_mutex is for serialising ext3_truncate() against |
126 | * ext3_getblock(). In the 2.4 ext2 design, great chunks of inode's | 127 | * ext3_getblock(). In the 2.4 ext2 design, great chunks of inode's |
127 | * data tree are chopped off during truncate. We can't do that in | 128 | * data tree are chopped off during truncate. We can't do that in |
128 | * ext3 because whenever we perform intermediate commits during | 129 | * ext3 because whenever we perform intermediate commits during |
129 | * truncate, the inode and all the metadata blocks *must* be in a | 130 | * truncate, the inode and all the metadata blocks *must* be in a |
130 | * consistent state which allows truncation of the orphans to restart | 131 | * consistent state which allows truncation of the orphans to restart |
131 | * during recovery. Hence we must fix the get_block-vs-truncate race | 132 | * during recovery. Hence we must fix the get_block-vs-truncate race |
132 | * by other means, so we have truncate_sem. | 133 | * by other means, so we have truncate_mutex. |
133 | */ | 134 | */ |
134 | struct semaphore truncate_sem; | 135 | struct mutex truncate_mutex; |
135 | struct inode vfs_inode; | 136 | struct inode vfs_inode; |
136 | }; | 137 | }; |
137 | 138 | ||
diff --git a/include/linux/fadvise.h b/include/linux/fadvise.h index e8e747139b9a..b2913bba35d8 100644 --- a/include/linux/fadvise.h +++ b/include/linux/fadvise.h | |||
@@ -18,4 +18,10 @@ | |||
18 | #define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */ | 18 | #define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */ |
19 | #endif | 19 | #endif |
20 | 20 | ||
21 | /* | ||
22 | * Linux-specific fadvise() extensions: | ||
23 | */ | ||
24 | #define LINUX_FADV_ASYNC_WRITE 32 /* Start writeout on range */ | ||
25 | #define LINUX_FADV_WRITE_WAIT 33 /* Wait upon writeout to range */ | ||
26 | |||
21 | #endif /* FADVISE_H_INCLUDED */ | 27 | #endif /* FADVISE_H_INCLUDED */ |
diff --git a/include/linux/fb.h b/include/linux/fb.h index 2cb19e6503aa..d03fadfcafe3 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -734,7 +734,7 @@ struct fb_tile_ops { | |||
734 | 734 | ||
735 | /* A driver may set this flag to indicate that it does want a set_par to be | 735 | /* A driver may set this flag to indicate that it does want a set_par to be |
736 | * called every time when fbcon_switch is executed. The advantage is that with | 736 | * called every time when fbcon_switch is executed. The advantage is that with |
737 | * this flag set you can really be shure that set_par is always called before | 737 | * this flag set you can really be sure that set_par is always called before |
738 | * any of the functions dependant on the correct hardware state or altering | 738 | * any of the functions dependant on the correct hardware state or altering |
739 | * that state, even if you are using some broken X releases. The disadvantage | 739 | * that state, even if you are using some broken X releases. The disadvantage |
740 | * is that it introduces unwanted delays to every console switch if set_par | 740 | * is that it introduces unwanted delays to every console switch if set_par |
diff --git a/include/linux/file.h b/include/linux/file.h index 9901b850f2e4..9f7c2513866f 100644 --- a/include/linux/file.h +++ b/include/linux/file.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/compiler.h> | 10 | #include <linux/compiler.h> |
11 | #include <linux/spinlock.h> | 11 | #include <linux/spinlock.h> |
12 | #include <linux/rcupdate.h> | 12 | #include <linux/rcupdate.h> |
13 | #include <linux/types.h> | ||
13 | 14 | ||
14 | /* | 15 | /* |
15 | * The default fd array needs to be at least BITS_PER_LONG, | 16 | * The default fd array needs to be at least BITS_PER_LONG, |
@@ -17,10 +18,22 @@ | |||
17 | */ | 18 | */ |
18 | #define NR_OPEN_DEFAULT BITS_PER_LONG | 19 | #define NR_OPEN_DEFAULT BITS_PER_LONG |
19 | 20 | ||
21 | /* | ||
22 | * The embedded_fd_set is a small fd_set, | ||
23 | * suitable for most tasks (which open <= BITS_PER_LONG files) | ||
24 | */ | ||
25 | struct embedded_fd_set { | ||
26 | unsigned long fds_bits[1]; | ||
27 | }; | ||
28 | |||
29 | /* | ||
30 | * More than this number of fds: we use a separately allocated fd_set | ||
31 | */ | ||
32 | #define EMBEDDED_FD_SET_SIZE (BITS_PER_BYTE * sizeof(struct embedded_fd_set)) | ||
33 | |||
20 | struct fdtable { | 34 | struct fdtable { |
21 | unsigned int max_fds; | 35 | unsigned int max_fds; |
22 | int max_fdset; | 36 | int max_fdset; |
23 | int next_fd; | ||
24 | struct file ** fd; /* current fd array */ | 37 | struct file ** fd; /* current fd array */ |
25 | fd_set *close_on_exec; | 38 | fd_set *close_on_exec; |
26 | fd_set *open_fds; | 39 | fd_set *open_fds; |
@@ -33,13 +46,20 @@ struct fdtable { | |||
33 | * Open file table structure | 46 | * Open file table structure |
34 | */ | 47 | */ |
35 | struct files_struct { | 48 | struct files_struct { |
49 | /* | ||
50 | * read mostly part | ||
51 | */ | ||
36 | atomic_t count; | 52 | atomic_t count; |
37 | struct fdtable *fdt; | 53 | struct fdtable *fdt; |
38 | struct fdtable fdtab; | 54 | struct fdtable fdtab; |
39 | fd_set close_on_exec_init; | 55 | /* |
40 | fd_set open_fds_init; | 56 | * written part on a separate cache line in SMP |
57 | */ | ||
58 | spinlock_t file_lock ____cacheline_aligned_in_smp; | ||
59 | int next_fd; | ||
60 | struct embedded_fd_set close_on_exec_init; | ||
61 | struct embedded_fd_set open_fds_init; | ||
41 | struct file * fd_array[NR_OPEN_DEFAULT]; | 62 | struct file * fd_array[NR_OPEN_DEFAULT]; |
42 | spinlock_t file_lock; /* Protects concurrent writers. Nests inside tsk->alloc_lock */ | ||
43 | }; | 63 | }; |
44 | 64 | ||
45 | #define files_fdtable(files) (rcu_dereference((files)->fdt)) | 65 | #define files_fdtable(files) (rcu_dereference((files)->fdt)) |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 128d0082522c..408fe89498f4 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -65,6 +65,11 @@ extern int dir_notify_enable; | |||
65 | #define FMODE_PREAD 8 | 65 | #define FMODE_PREAD 8 |
66 | #define FMODE_PWRITE FMODE_PREAD /* These go hand in hand */ | 66 | #define FMODE_PWRITE FMODE_PREAD /* These go hand in hand */ |
67 | 67 | ||
68 | /* File is being opened for execution. Primary users of this flag are | ||
69 | distributed filesystems that can use it to achieve correct ETXTBUSY | ||
70 | behavior for cross-node execution/opening_for_writing of files */ | ||
71 | #define FMODE_EXEC 16 | ||
72 | |||
68 | #define RW_MASK 1 | 73 | #define RW_MASK 1 |
69 | #define RWA_MASK 2 | 74 | #define RWA_MASK 2 |
70 | #define READ 0 | 75 | #define READ 0 |
@@ -103,7 +108,9 @@ extern int dir_notify_enable; | |||
103 | #define MS_BIND 4096 | 108 | #define MS_BIND 4096 |
104 | #define MS_MOVE 8192 | 109 | #define MS_MOVE 8192 |
105 | #define MS_REC 16384 | 110 | #define MS_REC 16384 |
106 | #define MS_VERBOSE 32768 | 111 | #define MS_VERBOSE 32768 /* War is peace. Verbosity is silence. |
112 | MS_VERBOSE is deprecated. */ | ||
113 | #define MS_SILENT 32768 | ||
107 | #define MS_POSIXACL (1<<16) /* VFS does not apply the umask */ | 114 | #define MS_POSIXACL (1<<16) /* VFS does not apply the umask */ |
108 | #define MS_UNBINDABLE (1<<17) /* change to unbindable */ | 115 | #define MS_UNBINDABLE (1<<17) /* change to unbindable */ |
109 | #define MS_PRIVATE (1<<18) /* change to private */ | 116 | #define MS_PRIVATE (1<<18) /* change to private */ |
@@ -197,6 +204,10 @@ extern int dir_notify_enable; | |||
197 | #define BLKBSZGET _IOR(0x12,112,size_t) | 204 | #define BLKBSZGET _IOR(0x12,112,size_t) |
198 | #define BLKBSZSET _IOW(0x12,113,size_t) | 205 | #define BLKBSZSET _IOW(0x12,113,size_t) |
199 | #define BLKGETSIZE64 _IOR(0x12,114,size_t) /* return device size in bytes (u64 *arg) */ | 206 | #define BLKGETSIZE64 _IOR(0x12,114,size_t) /* return device size in bytes (u64 *arg) */ |
207 | #define BLKTRACESETUP _IOWR(0x12,115,struct blk_user_trace_setup) | ||
208 | #define BLKTRACESTART _IO(0x12,116) | ||
209 | #define BLKTRACESTOP _IO(0x12,117) | ||
210 | #define BLKTRACETEARDOWN _IO(0x12,118) | ||
200 | 211 | ||
201 | #define BMAP_IOCTL 1 /* obsolete - kept for compatibility */ | 212 | #define BMAP_IOCTL 1 /* obsolete - kept for compatibility */ |
202 | #define FIBMAP _IO(0x00,1) /* bmap access */ | 213 | #define FIBMAP _IO(0x00,1) /* bmap access */ |
@@ -241,9 +252,6 @@ extern void __init files_init(unsigned long); | |||
241 | struct buffer_head; | 252 | struct buffer_head; |
242 | typedef int (get_block_t)(struct inode *inode, sector_t iblock, | 253 | typedef int (get_block_t)(struct inode *inode, sector_t iblock, |
243 | struct buffer_head *bh_result, int create); | 254 | struct buffer_head *bh_result, int create); |
244 | typedef int (get_blocks_t)(struct inode *inode, sector_t iblock, | ||
245 | unsigned long max_blocks, | ||
246 | struct buffer_head *bh_result, int create); | ||
247 | typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset, | 255 | typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset, |
248 | ssize_t bytes, void *private); | 256 | ssize_t bytes, void *private); |
249 | 257 | ||
@@ -339,12 +347,12 @@ struct writeback_control; | |||
339 | struct address_space_operations { | 347 | struct address_space_operations { |
340 | int (*writepage)(struct page *page, struct writeback_control *wbc); | 348 | int (*writepage)(struct page *page, struct writeback_control *wbc); |
341 | int (*readpage)(struct file *, struct page *); | 349 | int (*readpage)(struct file *, struct page *); |
342 | int (*sync_page)(struct page *); | 350 | void (*sync_page)(struct page *); |
343 | 351 | ||
344 | /* Write back some dirty pages from this mapping. */ | 352 | /* Write back some dirty pages from this mapping. */ |
345 | int (*writepages)(struct address_space *, struct writeback_control *); | 353 | int (*writepages)(struct address_space *, struct writeback_control *); |
346 | 354 | ||
347 | /* Set a page dirty */ | 355 | /* Set a page dirty. Return true if this dirtied it */ |
348 | int (*set_page_dirty)(struct page *page); | 356 | int (*set_page_dirty)(struct page *page); |
349 | 357 | ||
350 | int (*readpages)(struct file *filp, struct address_space *mapping, | 358 | int (*readpages)(struct file *filp, struct address_space *mapping, |
@@ -358,7 +366,7 @@ struct address_space_operations { | |||
358 | int (*commit_write)(struct file *, struct page *, unsigned, unsigned); | 366 | int (*commit_write)(struct file *, struct page *, unsigned, unsigned); |
359 | /* Unfortunately this kludge is needed for FIBMAP. Don't use it */ | 367 | /* Unfortunately this kludge is needed for FIBMAP. Don't use it */ |
360 | sector_t (*bmap)(struct address_space *, sector_t); | 368 | sector_t (*bmap)(struct address_space *, sector_t); |
361 | int (*invalidatepage) (struct page *, unsigned long); | 369 | void (*invalidatepage) (struct page *, unsigned long); |
362 | int (*releasepage) (struct page *, gfp_t); | 370 | int (*releasepage) (struct page *, gfp_t); |
363 | ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov, | 371 | ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov, |
364 | loff_t offset, unsigned long nr_segs); | 372 | loff_t offset, unsigned long nr_segs); |
@@ -397,11 +405,14 @@ struct block_device { | |||
397 | dev_t bd_dev; /* not a kdev_t - it's a search key */ | 405 | dev_t bd_dev; /* not a kdev_t - it's a search key */ |
398 | struct inode * bd_inode; /* will die */ | 406 | struct inode * bd_inode; /* will die */ |
399 | int bd_openers; | 407 | int bd_openers; |
400 | struct semaphore bd_sem; /* open/close mutex */ | 408 | struct mutex bd_mutex; /* open/close mutex */ |
401 | struct semaphore bd_mount_sem; /* mount mutex */ | 409 | struct mutex bd_mount_mutex; /* mount mutex */ |
402 | struct list_head bd_inodes; | 410 | struct list_head bd_inodes; |
403 | void * bd_holder; | 411 | void * bd_holder; |
404 | int bd_holders; | 412 | int bd_holders; |
413 | #ifdef CONFIG_SYSFS | ||
414 | struct list_head bd_holder_list; | ||
415 | #endif | ||
405 | struct block_device * bd_contains; | 416 | struct block_device * bd_contains; |
406 | unsigned bd_block_size; | 417 | unsigned bd_block_size; |
407 | struct hd_struct * bd_part; | 418 | struct hd_struct * bd_part; |
@@ -479,13 +490,13 @@ struct inode { | |||
479 | unsigned int i_blkbits; | 490 | unsigned int i_blkbits; |
480 | unsigned long i_blksize; | 491 | unsigned long i_blksize; |
481 | unsigned long i_version; | 492 | unsigned long i_version; |
482 | unsigned long i_blocks; | 493 | blkcnt_t i_blocks; |
483 | unsigned short i_bytes; | 494 | unsigned short i_bytes; |
484 | spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ | 495 | spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ |
485 | struct mutex i_mutex; | 496 | struct mutex i_mutex; |
486 | struct rw_semaphore i_alloc_sem; | 497 | struct rw_semaphore i_alloc_sem; |
487 | struct inode_operations *i_op; | 498 | struct inode_operations *i_op; |
488 | struct file_operations *i_fop; /* former ->i_op->default_file_ops */ | 499 | const struct file_operations *i_fop; /* former ->i_op->default_file_ops */ |
489 | struct super_block *i_sb; | 500 | struct super_block *i_sb; |
490 | struct file_lock *i_flock; | 501 | struct file_lock *i_flock; |
491 | struct address_space *i_mapping; | 502 | struct address_space *i_mapping; |
@@ -509,7 +520,7 @@ struct inode { | |||
509 | 520 | ||
510 | #ifdef CONFIG_INOTIFY | 521 | #ifdef CONFIG_INOTIFY |
511 | struct list_head inotify_watches; /* watches on this inode */ | 522 | struct list_head inotify_watches; /* watches on this inode */ |
512 | struct semaphore inotify_sem; /* protects the watches list */ | 523 | struct mutex inotify_mutex; /* protects the watches list */ |
513 | #endif | 524 | #endif |
514 | 525 | ||
515 | unsigned long i_state; | 526 | unsigned long i_state; |
@@ -625,7 +636,7 @@ struct file { | |||
625 | } f_u; | 636 | } f_u; |
626 | struct dentry *f_dentry; | 637 | struct dentry *f_dentry; |
627 | struct vfsmount *f_vfsmnt; | 638 | struct vfsmount *f_vfsmnt; |
628 | struct file_operations *f_op; | 639 | const struct file_operations *f_op; |
629 | atomic_t f_count; | 640 | atomic_t f_count; |
630 | unsigned int f_flags; | 641 | unsigned int f_flags; |
631 | mode_t f_mode; | 642 | mode_t f_mode; |
@@ -667,7 +678,6 @@ extern spinlock_t files_lock; | |||
667 | #define FL_POSIX 1 | 678 | #define FL_POSIX 1 |
668 | #define FL_FLOCK 2 | 679 | #define FL_FLOCK 2 |
669 | #define FL_ACCESS 8 /* not trying to lock, just looking */ | 680 | #define FL_ACCESS 8 /* not trying to lock, just looking */ |
670 | #define FL_LOCKD 16 /* lock held by rpc.lockd */ | ||
671 | #define FL_LEASE 32 /* lease held on this file */ | 681 | #define FL_LEASE 32 /* lease held on this file */ |
672 | #define FL_SLEEP 128 /* A blocking lock */ | 682 | #define FL_SLEEP 128 /* A blocking lock */ |
673 | 683 | ||
@@ -731,8 +741,6 @@ struct file_lock { | |||
731 | #define OFFT_OFFSET_MAX INT_LIMIT(off_t) | 741 | #define OFFT_OFFSET_MAX INT_LIMIT(off_t) |
732 | #endif | 742 | #endif |
733 | 743 | ||
734 | extern struct list_head file_lock_list; | ||
735 | |||
736 | #include <linux/fcntl.h> | 744 | #include <linux/fcntl.h> |
737 | 745 | ||
738 | extern int fcntl_getlk(struct file *, struct flock __user *); | 746 | extern int fcntl_getlk(struct file *, struct flock __user *); |
@@ -754,10 +762,10 @@ extern void locks_init_lock(struct file_lock *); | |||
754 | extern void locks_copy_lock(struct file_lock *, struct file_lock *); | 762 | extern void locks_copy_lock(struct file_lock *, struct file_lock *); |
755 | extern void locks_remove_posix(struct file *, fl_owner_t); | 763 | extern void locks_remove_posix(struct file *, fl_owner_t); |
756 | extern void locks_remove_flock(struct file *); | 764 | extern void locks_remove_flock(struct file *); |
757 | extern struct file_lock *posix_test_lock(struct file *, struct file_lock *); | 765 | extern int posix_test_lock(struct file *, struct file_lock *, struct file_lock *); |
766 | extern int posix_lock_file_conf(struct file *, struct file_lock *, struct file_lock *); | ||
758 | extern int posix_lock_file(struct file *, struct file_lock *); | 767 | extern int posix_lock_file(struct file *, struct file_lock *); |
759 | extern int posix_lock_file_wait(struct file *, struct file_lock *); | 768 | extern int posix_lock_file_wait(struct file *, struct file_lock *); |
760 | extern void posix_block_lock(struct file_lock *, struct file_lock *); | ||
761 | extern int posix_unblock_lock(struct file *, struct file_lock *); | 769 | extern int posix_unblock_lock(struct file *, struct file_lock *); |
762 | extern int posix_locks_deadlock(struct file_lock *, struct file_lock *); | 770 | extern int posix_locks_deadlock(struct file_lock *, struct file_lock *); |
763 | extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl); | 771 | extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl); |
@@ -847,7 +855,7 @@ struct super_block { | |||
847 | * The next field is for VFS *only*. No filesystems have any business | 855 | * The next field is for VFS *only*. No filesystems have any business |
848 | * even looking at it. You had been warned. | 856 | * even looking at it. You had been warned. |
849 | */ | 857 | */ |
850 | struct semaphore s_vfs_rename_sem; /* Kludge */ | 858 | struct mutex s_vfs_rename_mutex; /* Kludge */ |
851 | 859 | ||
852 | /* Granuality of c/m/atime in ns. | 860 | /* Granuality of c/m/atime in ns. |
853 | Cannot be worse than a second */ | 861 | Cannot be worse than a second */ |
@@ -1086,6 +1094,7 @@ struct super_operations { | |||
1086 | void (*umount_begin) (struct super_block *); | 1094 | void (*umount_begin) (struct super_block *); |
1087 | 1095 | ||
1088 | int (*show_options)(struct seq_file *, struct vfsmount *); | 1096 | int (*show_options)(struct seq_file *, struct vfsmount *); |
1097 | int (*show_stats)(struct seq_file *, struct vfsmount *); | ||
1089 | 1098 | ||
1090 | ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t); | 1099 | ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t); |
1091 | ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); | 1100 | ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); |
@@ -1115,6 +1124,18 @@ static inline void mark_inode_dirty_sync(struct inode *inode) | |||
1115 | __mark_inode_dirty(inode, I_DIRTY_SYNC); | 1124 | __mark_inode_dirty(inode, I_DIRTY_SYNC); |
1116 | } | 1125 | } |
1117 | 1126 | ||
1127 | static inline void inode_inc_link_count(struct inode *inode) | ||
1128 | { | ||
1129 | inode->i_nlink++; | ||
1130 | mark_inode_dirty(inode); | ||
1131 | } | ||
1132 | |||
1133 | static inline void inode_dec_link_count(struct inode *inode) | ||
1134 | { | ||
1135 | inode->i_nlink--; | ||
1136 | mark_inode_dirty(inode); | ||
1137 | } | ||
1138 | |||
1118 | extern void touch_atime(struct vfsmount *mnt, struct dentry *dentry); | 1139 | extern void touch_atime(struct vfsmount *mnt, struct dentry *dentry); |
1119 | static inline void file_accessed(struct file *file) | 1140 | static inline void file_accessed(struct file *file) |
1120 | { | 1141 | { |
@@ -1369,11 +1390,11 @@ extern void bd_set_size(struct block_device *, loff_t size); | |||
1369 | extern void bd_forget(struct inode *inode); | 1390 | extern void bd_forget(struct inode *inode); |
1370 | extern void bdput(struct block_device *); | 1391 | extern void bdput(struct block_device *); |
1371 | extern struct block_device *open_by_devnum(dev_t, unsigned); | 1392 | extern struct block_device *open_by_devnum(dev_t, unsigned); |
1372 | extern struct file_operations def_blk_fops; | 1393 | extern const struct file_operations def_blk_fops; |
1373 | extern struct address_space_operations def_blk_aops; | 1394 | extern struct address_space_operations def_blk_aops; |
1374 | extern struct file_operations def_chr_fops; | 1395 | extern const struct file_operations def_chr_fops; |
1375 | extern struct file_operations bad_sock_fops; | 1396 | extern const struct file_operations bad_sock_fops; |
1376 | extern struct file_operations def_fifo_fops; | 1397 | extern const struct file_operations def_fifo_fops; |
1377 | extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long); | 1398 | extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long); |
1378 | extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long); | 1399 | extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long); |
1379 | extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); | 1400 | extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); |
@@ -1381,12 +1402,19 @@ extern int blkdev_get(struct block_device *, mode_t, unsigned); | |||
1381 | extern int blkdev_put(struct block_device *); | 1402 | extern int blkdev_put(struct block_device *); |
1382 | extern int bd_claim(struct block_device *, void *); | 1403 | extern int bd_claim(struct block_device *, void *); |
1383 | extern void bd_release(struct block_device *); | 1404 | extern void bd_release(struct block_device *); |
1405 | #ifdef CONFIG_SYSFS | ||
1406 | extern int bd_claim_by_disk(struct block_device *, void *, struct gendisk *); | ||
1407 | extern void bd_release_from_disk(struct block_device *, struct gendisk *); | ||
1408 | #else | ||
1409 | #define bd_claim_by_disk(bdev, holder, disk) bd_claim(bdev, holder) | ||
1410 | #define bd_release_from_disk(bdev, disk) bd_release(bdev) | ||
1411 | #endif | ||
1384 | 1412 | ||
1385 | /* fs/char_dev.c */ | 1413 | /* fs/char_dev.c */ |
1386 | extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *); | 1414 | extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *); |
1387 | extern int register_chrdev_region(dev_t, unsigned, const char *); | 1415 | extern int register_chrdev_region(dev_t, unsigned, const char *); |
1388 | extern int register_chrdev(unsigned int, const char *, | 1416 | extern int register_chrdev(unsigned int, const char *, |
1389 | struct file_operations *); | 1417 | const struct file_operations *); |
1390 | extern int unregister_chrdev(unsigned int, const char *); | 1418 | extern int unregister_chrdev(unsigned int, const char *); |
1391 | extern void unregister_chrdev_region(dev_t, unsigned); | 1419 | extern void unregister_chrdev_region(dev_t, unsigned); |
1392 | extern int chrdev_open(struct inode *, struct file *); | 1420 | extern int chrdev_open(struct inode *, struct file *); |
@@ -1416,9 +1444,9 @@ extern void init_special_inode(struct inode *, umode_t, dev_t); | |||
1416 | extern void make_bad_inode(struct inode *); | 1444 | extern void make_bad_inode(struct inode *); |
1417 | extern int is_bad_inode(struct inode *); | 1445 | extern int is_bad_inode(struct inode *); |
1418 | 1446 | ||
1419 | extern struct file_operations read_fifo_fops; | 1447 | extern const struct file_operations read_fifo_fops; |
1420 | extern struct file_operations write_fifo_fops; | 1448 | extern const struct file_operations write_fifo_fops; |
1421 | extern struct file_operations rdwr_fifo_fops; | 1449 | extern const struct file_operations rdwr_fifo_fops; |
1422 | 1450 | ||
1423 | extern int fs_may_remount_ro(struct super_block *); | 1451 | extern int fs_may_remount_ro(struct super_block *); |
1424 | 1452 | ||
@@ -1455,6 +1483,12 @@ extern int filemap_fdatawait(struct address_space *); | |||
1455 | extern int filemap_write_and_wait(struct address_space *mapping); | 1483 | extern int filemap_write_and_wait(struct address_space *mapping); |
1456 | extern int filemap_write_and_wait_range(struct address_space *mapping, | 1484 | extern int filemap_write_and_wait_range(struct address_space *mapping, |
1457 | loff_t lstart, loff_t lend); | 1485 | loff_t lstart, loff_t lend); |
1486 | extern int wait_on_page_writeback_range(struct address_space *mapping, | ||
1487 | pgoff_t start, pgoff_t end); | ||
1488 | extern int __filemap_fdatawrite_range(struct address_space *mapping, | ||
1489 | loff_t start, loff_t end, int sync_mode); | ||
1490 | |||
1491 | extern long do_fsync(struct file *file, int datasync); | ||
1458 | extern void sync_supers(void); | 1492 | extern void sync_supers(void); |
1459 | extern void sync_filesystems(int wait); | 1493 | extern void sync_filesystems(int wait); |
1460 | extern void emergency_sync(void); | 1494 | extern void emergency_sync(void); |
@@ -1534,7 +1568,6 @@ extern void destroy_inode(struct inode *); | |||
1534 | extern struct inode *new_inode(struct super_block *); | 1568 | extern struct inode *new_inode(struct super_block *); |
1535 | extern int remove_suid(struct dentry *); | 1569 | extern int remove_suid(struct dentry *); |
1536 | extern void remove_dquot_ref(struct super_block *, int, struct list_head *); | 1570 | extern void remove_dquot_ref(struct super_block *, int, struct list_head *); |
1537 | extern struct semaphore iprune_sem; | ||
1538 | 1571 | ||
1539 | extern void __insert_inode_hash(struct inode *, unsigned long hashval); | 1572 | extern void __insert_inode_hash(struct inode *, unsigned long hashval); |
1540 | extern void remove_inode_hash(struct inode *); | 1573 | extern void remove_inode_hash(struct inode *); |
@@ -1619,7 +1652,7 @@ static inline void do_generic_file_read(struct file * filp, loff_t *ppos, | |||
1619 | 1652 | ||
1620 | ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, | 1653 | ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, |
1621 | struct block_device *bdev, const struct iovec *iov, loff_t offset, | 1654 | struct block_device *bdev, const struct iovec *iov, loff_t offset, |
1622 | unsigned long nr_segs, get_blocks_t get_blocks, dio_iodone_t end_io, | 1655 | unsigned long nr_segs, get_block_t get_block, dio_iodone_t end_io, |
1623 | int lock_type); | 1656 | int lock_type); |
1624 | 1657 | ||
1625 | enum { | 1658 | enum { |
@@ -1630,32 +1663,32 @@ enum { | |||
1630 | 1663 | ||
1631 | static inline ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb, | 1664 | static inline ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb, |
1632 | struct inode *inode, struct block_device *bdev, const struct iovec *iov, | 1665 | struct inode *inode, struct block_device *bdev, const struct iovec *iov, |
1633 | loff_t offset, unsigned long nr_segs, get_blocks_t get_blocks, | 1666 | loff_t offset, unsigned long nr_segs, get_block_t get_block, |
1634 | dio_iodone_t end_io) | 1667 | dio_iodone_t end_io) |
1635 | { | 1668 | { |
1636 | return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, | 1669 | return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, |
1637 | nr_segs, get_blocks, end_io, DIO_LOCKING); | 1670 | nr_segs, get_block, end_io, DIO_LOCKING); |
1638 | } | 1671 | } |
1639 | 1672 | ||
1640 | static inline ssize_t blockdev_direct_IO_no_locking(int rw, struct kiocb *iocb, | 1673 | static inline ssize_t blockdev_direct_IO_no_locking(int rw, struct kiocb *iocb, |
1641 | struct inode *inode, struct block_device *bdev, const struct iovec *iov, | 1674 | struct inode *inode, struct block_device *bdev, const struct iovec *iov, |
1642 | loff_t offset, unsigned long nr_segs, get_blocks_t get_blocks, | 1675 | loff_t offset, unsigned long nr_segs, get_block_t get_block, |
1643 | dio_iodone_t end_io) | 1676 | dio_iodone_t end_io) |
1644 | { | 1677 | { |
1645 | return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, | 1678 | return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, |
1646 | nr_segs, get_blocks, end_io, DIO_NO_LOCKING); | 1679 | nr_segs, get_block, end_io, DIO_NO_LOCKING); |
1647 | } | 1680 | } |
1648 | 1681 | ||
1649 | static inline ssize_t blockdev_direct_IO_own_locking(int rw, struct kiocb *iocb, | 1682 | static inline ssize_t blockdev_direct_IO_own_locking(int rw, struct kiocb *iocb, |
1650 | struct inode *inode, struct block_device *bdev, const struct iovec *iov, | 1683 | struct inode *inode, struct block_device *bdev, const struct iovec *iov, |
1651 | loff_t offset, unsigned long nr_segs, get_blocks_t get_blocks, | 1684 | loff_t offset, unsigned long nr_segs, get_block_t get_block, |
1652 | dio_iodone_t end_io) | 1685 | dio_iodone_t end_io) |
1653 | { | 1686 | { |
1654 | return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, | 1687 | return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, |
1655 | nr_segs, get_blocks, end_io, DIO_OWN_LOCKING); | 1688 | nr_segs, get_block, end_io, DIO_OWN_LOCKING); |
1656 | } | 1689 | } |
1657 | 1690 | ||
1658 | extern struct file_operations generic_ro_fops; | 1691 | extern const struct file_operations generic_ro_fops; |
1659 | 1692 | ||
1660 | #define special_file(m) (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m)) | 1693 | #define special_file(m) (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m)) |
1661 | 1694 | ||
@@ -1711,9 +1744,9 @@ extern int simple_commit_write(struct file *file, struct page *page, | |||
1711 | 1744 | ||
1712 | extern struct dentry *simple_lookup(struct inode *, struct dentry *, struct nameidata *); | 1745 | extern struct dentry *simple_lookup(struct inode *, struct dentry *, struct nameidata *); |
1713 | extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *); | 1746 | extern ssize_t generic_read_dir(struct file *, char __user *, size_t, loff_t *); |
1714 | extern struct file_operations simple_dir_operations; | 1747 | extern const struct file_operations simple_dir_operations; |
1715 | extern struct inode_operations simple_dir_inode_operations; | 1748 | extern struct inode_operations simple_dir_inode_operations; |
1716 | struct tree_descr { char *name; struct file_operations *ops; int mode; }; | 1749 | struct tree_descr { char *name; const struct file_operations *ops; int mode; }; |
1717 | struct dentry *d_alloc_name(struct dentry *, const char *); | 1750 | struct dentry *d_alloc_name(struct dentry *, const char *); |
1718 | extern int simple_fill_super(struct super_block *, int, struct tree_descr *); | 1751 | extern int simple_fill_super(struct super_block *, int, struct tree_descr *); |
1719 | extern int simple_pin_fs(char *name, struct vfsmount **mount, int *count); | 1752 | extern int simple_pin_fs(char *name, struct vfsmount **mount, int *count); |
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h index 03b8e7932b83..11438eff4d44 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h | |||
@@ -15,6 +15,26 @@ | |||
15 | 15 | ||
16 | #include <linux/dnotify.h> | 16 | #include <linux/dnotify.h> |
17 | #include <linux/inotify.h> | 17 | #include <linux/inotify.h> |
18 | #include <linux/audit.h> | ||
19 | |||
20 | /* | ||
21 | * fsnotify_d_instantiate - instantiate a dentry for inode | ||
22 | * Called with dcache_lock held. | ||
23 | */ | ||
24 | static inline void fsnotify_d_instantiate(struct dentry *entry, | ||
25 | struct inode *inode) | ||
26 | { | ||
27 | inotify_d_instantiate(entry, inode); | ||
28 | } | ||
29 | |||
30 | /* | ||
31 | * fsnotify_d_move - entry has been moved | ||
32 | * Called with dcache_lock and entry->d_lock held. | ||
33 | */ | ||
34 | static inline void fsnotify_d_move(struct dentry *entry) | ||
35 | { | ||
36 | inotify_d_move(entry); | ||
37 | } | ||
18 | 38 | ||
19 | /* | 39 | /* |
20 | * fsnotify_move - file old_name at old_dir was moved to new_name at new_dir | 40 | * fsnotify_move - file old_name at old_dir was moved to new_name at new_dir |
@@ -45,6 +65,8 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir, | |||
45 | if (source) { | 65 | if (source) { |
46 | inotify_inode_queue_event(source, IN_MOVE_SELF, 0, NULL); | 66 | inotify_inode_queue_event(source, IN_MOVE_SELF, 0, NULL); |
47 | } | 67 | } |
68 | audit_inode_child(old_name, source, old_dir->i_ino); | ||
69 | audit_inode_child(new_name, target, new_dir->i_ino); | ||
48 | } | 70 | } |
49 | 71 | ||
50 | /* | 72 | /* |
@@ -70,19 +92,22 @@ static inline void fsnotify_inoderemove(struct inode *inode) | |||
70 | /* | 92 | /* |
71 | * fsnotify_create - 'name' was linked in | 93 | * fsnotify_create - 'name' was linked in |
72 | */ | 94 | */ |
73 | static inline void fsnotify_create(struct inode *inode, const char *name) | 95 | static inline void fsnotify_create(struct inode *inode, struct dentry *dentry) |
74 | { | 96 | { |
75 | inode_dir_notify(inode, DN_CREATE); | 97 | inode_dir_notify(inode, DN_CREATE); |
76 | inotify_inode_queue_event(inode, IN_CREATE, 0, name); | 98 | inotify_inode_queue_event(inode, IN_CREATE, 0, dentry->d_name.name); |
99 | audit_inode_child(dentry->d_name.name, dentry->d_inode, inode->i_ino); | ||
77 | } | 100 | } |
78 | 101 | ||
79 | /* | 102 | /* |
80 | * fsnotify_mkdir - directory 'name' was created | 103 | * fsnotify_mkdir - directory 'name' was created |
81 | */ | 104 | */ |
82 | static inline void fsnotify_mkdir(struct inode *inode, const char *name) | 105 | static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry) |
83 | { | 106 | { |
84 | inode_dir_notify(inode, DN_CREATE); | 107 | inode_dir_notify(inode, DN_CREATE); |
85 | inotify_inode_queue_event(inode, IN_CREATE | IN_ISDIR, 0, name); | 108 | inotify_inode_queue_event(inode, IN_CREATE | IN_ISDIR, 0, |
109 | dentry->d_name.name); | ||
110 | audit_inode_child(dentry->d_name.name, dentry->d_inode, inode->i_ino); | ||
86 | } | 111 | } |
87 | 112 | ||
88 | /* | 113 | /* |
diff --git a/include/linux/futex.h b/include/linux/futex.h index 10f96c31971e..966a5b3da439 100644 --- a/include/linux/futex.h +++ b/include/linux/futex.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef _LINUX_FUTEX_H | 1 | #ifndef _LINUX_FUTEX_H |
2 | #define _LINUX_FUTEX_H | 2 | #define _LINUX_FUTEX_H |
3 | 3 | ||
4 | #include <linux/sched.h> | ||
5 | |||
4 | /* Second argument to futex syscall */ | 6 | /* Second argument to futex syscall */ |
5 | 7 | ||
6 | 8 | ||
@@ -11,10 +13,97 @@ | |||
11 | #define FUTEX_CMP_REQUEUE 4 | 13 | #define FUTEX_CMP_REQUEUE 4 |
12 | #define FUTEX_WAKE_OP 5 | 14 | #define FUTEX_WAKE_OP 5 |
13 | 15 | ||
16 | /* | ||
17 | * Support for robust futexes: the kernel cleans up held futexes at | ||
18 | * thread exit time. | ||
19 | */ | ||
20 | |||
21 | /* | ||
22 | * Per-lock list entry - embedded in user-space locks, somewhere close | ||
23 | * to the futex field. (Note: user-space uses a double-linked list to | ||
24 | * achieve O(1) list add and remove, but the kernel only needs to know | ||
25 | * about the forward link) | ||
26 | * | ||
27 | * NOTE: this structure is part of the syscall ABI, and must not be | ||
28 | * changed. | ||
29 | */ | ||
30 | struct robust_list { | ||
31 | struct robust_list __user *next; | ||
32 | }; | ||
33 | |||
34 | /* | ||
35 | * Per-thread list head: | ||
36 | * | ||
37 | * NOTE: this structure is part of the syscall ABI, and must only be | ||
38 | * changed if the change is first communicated with the glibc folks. | ||
39 | * (When an incompatible change is done, we'll increase the structure | ||
40 | * size, which glibc will detect) | ||
41 | */ | ||
42 | struct robust_list_head { | ||
43 | /* | ||
44 | * The head of the list. Points back to itself if empty: | ||
45 | */ | ||
46 | struct robust_list list; | ||
47 | |||
48 | /* | ||
49 | * This relative offset is set by user-space, it gives the kernel | ||
50 | * the relative position of the futex field to examine. This way | ||
51 | * we keep userspace flexible, to freely shape its data-structure, | ||
52 | * without hardcoding any particular offset into the kernel: | ||
53 | */ | ||
54 | long futex_offset; | ||
55 | |||
56 | /* | ||
57 | * The death of the thread may race with userspace setting | ||
58 | * up a lock's links. So to handle this race, userspace first | ||
59 | * sets this field to the address of the to-be-taken lock, | ||
60 | * then does the lock acquire, and then adds itself to the | ||
61 | * list, and then clears this field. Hence the kernel will | ||
62 | * always have full knowledge of all locks that the thread | ||
63 | * _might_ have taken. We check the owner TID in any case, | ||
64 | * so only truly owned locks will be handled. | ||
65 | */ | ||
66 | struct robust_list __user *list_op_pending; | ||
67 | }; | ||
68 | |||
69 | /* | ||
70 | * Are there any waiters for this robust futex: | ||
71 | */ | ||
72 | #define FUTEX_WAITERS 0x80000000 | ||
73 | |||
74 | /* | ||
75 | * The kernel signals via this bit that a thread holding a futex | ||
76 | * has exited without unlocking the futex. The kernel also does | ||
77 | * a FUTEX_WAKE on such futexes, after setting the bit, to wake | ||
78 | * up any possible waiters: | ||
79 | */ | ||
80 | #define FUTEX_OWNER_DIED 0x40000000 | ||
81 | |||
82 | /* | ||
83 | * The rest of the robust-futex field is for the TID: | ||
84 | */ | ||
85 | #define FUTEX_TID_MASK 0x3fffffff | ||
86 | |||
87 | /* | ||
88 | * This limit protects against a deliberately circular list. | ||
89 | * (Not worth introducing an rlimit for it) | ||
90 | */ | ||
91 | #define ROBUST_LIST_LIMIT 2048 | ||
92 | |||
14 | long do_futex(unsigned long uaddr, int op, int val, | 93 | long do_futex(unsigned long uaddr, int op, int val, |
15 | unsigned long timeout, unsigned long uaddr2, int val2, | 94 | unsigned long timeout, unsigned long uaddr2, int val2, |
16 | int val3); | 95 | int val3); |
17 | 96 | ||
97 | extern int handle_futex_death(u32 __user *uaddr, struct task_struct *curr); | ||
98 | |||
99 | #ifdef CONFIG_FUTEX | ||
100 | extern void exit_robust_list(struct task_struct *curr); | ||
101 | #else | ||
102 | static inline void exit_robust_list(struct task_struct *curr) | ||
103 | { | ||
104 | } | ||
105 | #endif | ||
106 | |||
18 | #define FUTEX_OP_SET 0 /* *(int *)UADDR2 = OPARG; */ | 107 | #define FUTEX_OP_SET 0 /* *(int *)UADDR2 = OPARG; */ |
19 | #define FUTEX_OP_ADD 1 /* *(int *)UADDR2 += OPARG; */ | 108 | #define FUTEX_OP_ADD 1 /* *(int *)UADDR2 += OPARG; */ |
20 | #define FUTEX_OP_OR 2 /* *(int *)UADDR2 |= OPARG; */ | 109 | #define FUTEX_OP_OR 2 /* *(int *)UADDR2 |= OPARG; */ |
diff --git a/include/linux/gameport.h b/include/linux/gameport.h index 2401dea2b867..9c8e6da2393b 100644 --- a/include/linux/gameport.h +++ b/include/linux/gameport.h | |||
@@ -119,7 +119,7 @@ static inline void gameport_set_name(struct gameport *gameport, const char *name | |||
119 | } | 119 | } |
120 | 120 | ||
121 | /* | 121 | /* |
122 | * Use the following fucntions to manipulate gameport's per-port | 122 | * Use the following functions to manipulate gameport's per-port |
123 | * driver-specific data. | 123 | * driver-specific data. |
124 | */ | 124 | */ |
125 | static inline void *gameport_get_drvdata(struct gameport *gameport) | 125 | static inline void *gameport_get_drvdata(struct gameport *gameport) |
@@ -133,7 +133,7 @@ static inline void gameport_set_drvdata(struct gameport *gameport, void *data) | |||
133 | } | 133 | } |
134 | 134 | ||
135 | /* | 135 | /* |
136 | * Use the following fucntions to pin gameport's driver in process context | 136 | * Use the following functions to pin gameport's driver in process context |
137 | */ | 137 | */ |
138 | static inline int gameport_pin_driver(struct gameport *gameport) | 138 | static inline int gameport_pin_driver(struct gameport *gameport) |
139 | { | 139 | { |
diff --git a/include/linux/generic_serial.h b/include/linux/generic_serial.h index 0abe9d9a0069..652611a4bdcd 100644 --- a/include/linux/generic_serial.h +++ b/include/linux/generic_serial.h | |||
@@ -12,6 +12,8 @@ | |||
12 | #ifndef GENERIC_SERIAL_H | 12 | #ifndef GENERIC_SERIAL_H |
13 | #define GENERIC_SERIAL_H | 13 | #define GENERIC_SERIAL_H |
14 | 14 | ||
15 | #include <linux/mutex.h> | ||
16 | |||
15 | struct real_driver { | 17 | struct real_driver { |
16 | void (*disable_tx_interrupts) (void *); | 18 | void (*disable_tx_interrupts) (void *); |
17 | void (*enable_tx_interrupts) (void *); | 19 | void (*enable_tx_interrupts) (void *); |
@@ -34,7 +36,7 @@ struct gs_port { | |||
34 | int xmit_head; | 36 | int xmit_head; |
35 | int xmit_tail; | 37 | int xmit_tail; |
36 | int xmit_cnt; | 38 | int xmit_cnt; |
37 | struct semaphore port_write_sem; | 39 | struct mutex port_write_mutex; |
38 | int flags; | 40 | int flags; |
39 | wait_queue_head_t open_wait; | 41 | wait_queue_head_t open_wait; |
40 | wait_queue_head_t close_wait; | 42 | wait_queue_head_t close_wait; |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index eef5ccdcd731..10a27f29d692 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -78,6 +78,7 @@ struct hd_struct { | |||
78 | sector_t start_sect; | 78 | sector_t start_sect; |
79 | sector_t nr_sects; | 79 | sector_t nr_sects; |
80 | struct kobject kobj; | 80 | struct kobject kobj; |
81 | struct kobject *holder_dir; | ||
81 | unsigned ios[2], sectors[2]; /* READs and WRITEs */ | 82 | unsigned ios[2], sectors[2]; /* READs and WRITEs */ |
82 | int policy, partno; | 83 | int policy, partno; |
83 | }; | 84 | }; |
@@ -89,12 +90,12 @@ struct hd_struct { | |||
89 | #define GENHD_FL_SUPPRESS_PARTITION_INFO 32 | 90 | #define GENHD_FL_SUPPRESS_PARTITION_INFO 32 |
90 | 91 | ||
91 | struct disk_stats { | 92 | struct disk_stats { |
92 | unsigned sectors[2]; /* READs and WRITEs */ | 93 | unsigned long sectors[2]; /* READs and WRITEs */ |
93 | unsigned ios[2]; | 94 | unsigned long ios[2]; |
94 | unsigned merges[2]; | 95 | unsigned long merges[2]; |
95 | unsigned ticks[2]; | 96 | unsigned long ticks[2]; |
96 | unsigned io_ticks; | 97 | unsigned long io_ticks; |
97 | unsigned time_in_queue; | 98 | unsigned long time_in_queue; |
98 | }; | 99 | }; |
99 | 100 | ||
100 | struct gendisk { | 101 | struct gendisk { |
@@ -114,6 +115,8 @@ struct gendisk { | |||
114 | int number; /* more of the same */ | 115 | int number; /* more of the same */ |
115 | struct device *driverfs_dev; | 116 | struct device *driverfs_dev; |
116 | struct kobject kobj; | 117 | struct kobject kobj; |
118 | struct kobject *holder_dir; | ||
119 | struct kobject *slave_dir; | ||
117 | 120 | ||
118 | struct timer_rand_state *random; | 121 | struct timer_rand_state *random; |
119 | int policy; | 122 | int policy; |
@@ -149,22 +152,16 @@ struct disk_attribute { | |||
149 | ({ \ | 152 | ({ \ |
150 | typeof(gendiskp->dkstats->field) res = 0; \ | 153 | typeof(gendiskp->dkstats->field) res = 0; \ |
151 | int i; \ | 154 | int i; \ |
152 | for (i=0; i < NR_CPUS; i++) { \ | 155 | for_each_possible_cpu(i) \ |
153 | if (!cpu_possible(i)) \ | ||
154 | continue; \ | ||
155 | res += per_cpu_ptr(gendiskp->dkstats, i)->field; \ | 156 | res += per_cpu_ptr(gendiskp->dkstats, i)->field; \ |
156 | } \ | ||
157 | res; \ | 157 | res; \ |
158 | }) | 158 | }) |
159 | 159 | ||
160 | static inline void disk_stat_set_all(struct gendisk *gendiskp, int value) { | 160 | static inline void disk_stat_set_all(struct gendisk *gendiskp, int value) { |
161 | int i; | 161 | int i; |
162 | for (i=0; i < NR_CPUS; i++) { | 162 | for_each_possible_cpu(i) |
163 | if (cpu_possible(i)) { | 163 | memset(per_cpu_ptr(gendiskp->dkstats, i), value, |
164 | memset(per_cpu_ptr(gendiskp->dkstats, i), value, | 164 | sizeof (struct disk_stats)); |
165 | sizeof (struct disk_stats)); | ||
166 | } | ||
167 | } | ||
168 | } | 165 | } |
169 | 166 | ||
170 | #else | 167 | #else |
diff --git a/include/linux/gigaset_dev.h b/include/linux/gigaset_dev.h new file mode 100644 index 000000000000..70ad09c8ad1e --- /dev/null +++ b/include/linux/gigaset_dev.h | |||
@@ -0,0 +1,32 @@ | |||
1 | /* | ||
2 | * interface to user space for the gigaset driver | ||
3 | * | ||
4 | * Copyright (c) 2004 by Hansjoerg Lipp <hjlipp@web.de> | ||
5 | * | ||
6 | * ===================================================================== | ||
7 | * This program is free software; you can redistribute it and/or | ||
8 | * modify it under the terms of the GNU General Public License as | ||
9 | * published by the Free Software Foundation; either version 2 of | ||
10 | * the License, or (at your option) any later version. | ||
11 | * ===================================================================== | ||
12 | * Version: $Id: gigaset_dev.h,v 1.4.4.4 2005/11/21 22:28:09 hjlipp Exp $ | ||
13 | * ===================================================================== | ||
14 | */ | ||
15 | |||
16 | #ifndef GIGASET_INTERFACE_H | ||
17 | #define GIGASET_INTERFACE_H | ||
18 | |||
19 | #include <linux/ioctl.h> | ||
20 | |||
21 | #define GIGASET_IOCTL 0x47 | ||
22 | |||
23 | #define GIGVER_DRIVER 0 | ||
24 | #define GIGVER_COMPAT 1 | ||
25 | #define GIGVER_FWBASE 2 | ||
26 | |||
27 | #define GIGASET_REDIR _IOWR (GIGASET_IOCTL, 0, int) | ||
28 | #define GIGASET_CONFIG _IOWR (GIGASET_IOCTL, 1, int) | ||
29 | #define GIGASET_BRKCHARS _IOW (GIGASET_IOCTL, 2, unsigned char[6]) //FIXME [6] okay? | ||
30 | #define GIGASET_VERSION _IOWR (GIGASET_IOCTL, 3, unsigned[4]) | ||
31 | |||
32 | #endif | ||
diff --git a/include/linux/highmem.h b/include/linux/highmem.h index 6bece9280eb7..892c4ea1b425 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h | |||
@@ -7,6 +7,18 @@ | |||
7 | 7 | ||
8 | #include <asm/cacheflush.h> | 8 | #include <asm/cacheflush.h> |
9 | 9 | ||
10 | #ifndef ARCH_HAS_FLUSH_ANON_PAGE | ||
11 | static inline void flush_anon_page(struct page *page, unsigned long vmaddr) | ||
12 | { | ||
13 | } | ||
14 | #endif | ||
15 | |||
16 | #ifndef ARCH_HAS_FLUSH_KERNEL_DCACHE_PAGE | ||
17 | static inline void flush_kernel_dcache_page(struct page *page) | ||
18 | { | ||
19 | } | ||
20 | #endif | ||
21 | |||
10 | #ifdef CONFIG_HIGHMEM | 22 | #ifdef CONFIG_HIGHMEM |
11 | 23 | ||
12 | #include <asm/highmem.h> | 24 | #include <asm/highmem.h> |
diff --git a/include/linux/hpet.h b/include/linux/hpet.h index 27238194b212..707f7cb9e795 100644 --- a/include/linux/hpet.h +++ b/include/linux/hpet.h | |||
@@ -3,6 +3,8 @@ | |||
3 | 3 | ||
4 | #include <linux/compiler.h> | 4 | #include <linux/compiler.h> |
5 | 5 | ||
6 | #ifdef __KERNEL__ | ||
7 | |||
6 | /* | 8 | /* |
7 | * Offsets into HPET Registers | 9 | * Offsets into HPET Registers |
8 | */ | 10 | */ |
@@ -85,22 +87,6 @@ struct hpet { | |||
85 | #define Tn_FSB_INT_ADDR_SHIFT (32UL) | 87 | #define Tn_FSB_INT_ADDR_SHIFT (32UL) |
86 | #define Tn_FSB_INT_VAL_MASK (0x00000000ffffffffULL) | 88 | #define Tn_FSB_INT_VAL_MASK (0x00000000ffffffffULL) |
87 | 89 | ||
88 | struct hpet_info { | ||
89 | unsigned long hi_ireqfreq; /* Hz */ | ||
90 | unsigned long hi_flags; /* information */ | ||
91 | unsigned short hi_hpet; | ||
92 | unsigned short hi_timer; | ||
93 | }; | ||
94 | |||
95 | #define HPET_INFO_PERIODIC 0x0001 /* timer is periodic */ | ||
96 | |||
97 | #define HPET_IE_ON _IO('h', 0x01) /* interrupt on */ | ||
98 | #define HPET_IE_OFF _IO('h', 0x02) /* interrupt off */ | ||
99 | #define HPET_INFO _IOR('h', 0x03, struct hpet_info) | ||
100 | #define HPET_EPI _IO('h', 0x04) /* enable periodic */ | ||
101 | #define HPET_DPI _IO('h', 0x05) /* disable periodic */ | ||
102 | #define HPET_IRQFREQ _IOW('h', 0x6, unsigned long) /* IRQFREQ usec */ | ||
103 | |||
104 | /* | 90 | /* |
105 | * exported interfaces | 91 | * exported interfaces |
106 | */ | 92 | */ |
@@ -133,4 +119,22 @@ int hpet_register(struct hpet_task *, int); | |||
133 | int hpet_unregister(struct hpet_task *); | 119 | int hpet_unregister(struct hpet_task *); |
134 | int hpet_control(struct hpet_task *, unsigned int, unsigned long); | 120 | int hpet_control(struct hpet_task *, unsigned int, unsigned long); |
135 | 121 | ||
122 | #endif /* __KERNEL__ */ | ||
123 | |||
124 | struct hpet_info { | ||
125 | unsigned long hi_ireqfreq; /* Hz */ | ||
126 | unsigned long hi_flags; /* information */ | ||
127 | unsigned short hi_hpet; | ||
128 | unsigned short hi_timer; | ||
129 | }; | ||
130 | |||
131 | #define HPET_INFO_PERIODIC 0x0001 /* timer is periodic */ | ||
132 | |||
133 | #define HPET_IE_ON _IO('h', 0x01) /* interrupt on */ | ||
134 | #define HPET_IE_OFF _IO('h', 0x02) /* interrupt off */ | ||
135 | #define HPET_INFO _IOR('h', 0x03, struct hpet_info) | ||
136 | #define HPET_EPI _IO('h', 0x04) /* enable periodic */ | ||
137 | #define HPET_DPI _IO('h', 0x05) /* disable periodic */ | ||
138 | #define HPET_IRQFREQ _IOW('h', 0x6, unsigned long) /* IRQFREQ usec */ | ||
139 | |||
136 | #endif /* !__HPET__ */ | 140 | #endif /* !__HPET__ */ |
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 6401c31d6add..93830158348e 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
@@ -34,15 +34,7 @@ enum hrtimer_restart { | |||
34 | HRTIMER_RESTART, | 34 | HRTIMER_RESTART, |
35 | }; | 35 | }; |
36 | 36 | ||
37 | /* | 37 | #define HRTIMER_INACTIVE ((void *)1UL) |
38 | * Timer states: | ||
39 | */ | ||
40 | enum hrtimer_state { | ||
41 | HRTIMER_INACTIVE, /* Timer is inactive */ | ||
42 | HRTIMER_EXPIRED, /* Timer is expired */ | ||
43 | HRTIMER_RUNNING, /* Timer is running the callback function */ | ||
44 | HRTIMER_PENDING, /* Timer is pending */ | ||
45 | }; | ||
46 | 38 | ||
47 | struct hrtimer_base; | 39 | struct hrtimer_base; |
48 | 40 | ||
@@ -53,9 +45,7 @@ struct hrtimer_base; | |||
53 | * @expires: the absolute expiry time in the hrtimers internal | 45 | * @expires: the absolute expiry time in the hrtimers internal |
54 | * representation. The time is related to the clock on | 46 | * representation. The time is related to the clock on |
55 | * which the timer is based. | 47 | * which the timer is based. |
56 | * @state: state of the timer | ||
57 | * @function: timer expiry callback function | 48 | * @function: timer expiry callback function |
58 | * @data: argument for the callback function | ||
59 | * @base: pointer to the timer base (per cpu and per clock) | 49 | * @base: pointer to the timer base (per cpu and per clock) |
60 | * | 50 | * |
61 | * The hrtimer structure must be initialized by init_hrtimer_#CLOCKTYPE() | 51 | * The hrtimer structure must be initialized by init_hrtimer_#CLOCKTYPE() |
@@ -63,23 +53,23 @@ struct hrtimer_base; | |||
63 | struct hrtimer { | 53 | struct hrtimer { |
64 | struct rb_node node; | 54 | struct rb_node node; |
65 | ktime_t expires; | 55 | ktime_t expires; |
66 | enum hrtimer_state state; | 56 | int (*function)(struct hrtimer *); |
67 | int (*function)(void *); | ||
68 | void *data; | ||
69 | struct hrtimer_base *base; | 57 | struct hrtimer_base *base; |
70 | }; | 58 | }; |
71 | 59 | ||
72 | /** | 60 | /** |
73 | * struct hrtimer_base - the timer base for a specific clock | 61 | * struct hrtimer_base - the timer base for a specific clock |
74 | * | 62 | * |
75 | * @index: clock type index for per_cpu support when moving a timer | 63 | * @index: clock type index for per_cpu support when moving a timer |
76 | * to a base on another cpu. | 64 | * to a base on another cpu. |
77 | * @lock: lock protecting the base and associated timers | 65 | * @lock: lock protecting the base and associated timers |
78 | * @active: red black tree root node for the active timers | 66 | * @active: red black tree root node for the active timers |
79 | * @first: pointer to the timer node which expires first | 67 | * @first: pointer to the timer node which expires first |
80 | * @resolution: the resolution of the clock, in nanoseconds | 68 | * @resolution: the resolution of the clock, in nanoseconds |
81 | * @get_time: function to retrieve the current time of the clock | 69 | * @get_time: function to retrieve the current time of the clock |
82 | * @curr_timer: the timer which is executing a callback right now | 70 | * @get_sofirq_time: function to retrieve the current time from the softirq |
71 | * @curr_timer: the timer which is executing a callback right now | ||
72 | * @softirq_time: the time when running the hrtimer queue in the softirq | ||
83 | */ | 73 | */ |
84 | struct hrtimer_base { | 74 | struct hrtimer_base { |
85 | clockid_t index; | 75 | clockid_t index; |
@@ -88,7 +78,9 @@ struct hrtimer_base { | |||
88 | struct rb_node *first; | 78 | struct rb_node *first; |
89 | ktime_t resolution; | 79 | ktime_t resolution; |
90 | ktime_t (*get_time)(void); | 80 | ktime_t (*get_time)(void); |
81 | ktime_t (*get_softirq_time)(void); | ||
91 | struct hrtimer *curr_timer; | 82 | struct hrtimer *curr_timer; |
83 | ktime_t softirq_time; | ||
92 | }; | 84 | }; |
93 | 85 | ||
94 | /* | 86 | /* |
@@ -122,11 +114,12 @@ extern ktime_t hrtimer_get_next_event(void); | |||
122 | 114 | ||
123 | static inline int hrtimer_active(const struct hrtimer *timer) | 115 | static inline int hrtimer_active(const struct hrtimer *timer) |
124 | { | 116 | { |
125 | return timer->state == HRTIMER_PENDING; | 117 | return timer->node.rb_parent != HRTIMER_INACTIVE; |
126 | } | 118 | } |
127 | 119 | ||
128 | /* Forward a hrtimer so it expires after now: */ | 120 | /* Forward a hrtimer so it expires after now: */ |
129 | extern unsigned long hrtimer_forward(struct hrtimer *timer, ktime_t interval); | 121 | extern unsigned long |
122 | hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval); | ||
130 | 123 | ||
131 | /* Precise sleep: */ | 124 | /* Precise sleep: */ |
132 | extern long hrtimer_nanosleep(struct timespec *rqtp, | 125 | extern long hrtimer_nanosleep(struct timespec *rqtp, |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 68d82ad6b17c..4c5e610fe442 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -20,10 +20,7 @@ void unmap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long) | |||
20 | int hugetlb_prefault(struct address_space *, struct vm_area_struct *); | 20 | int hugetlb_prefault(struct address_space *, struct vm_area_struct *); |
21 | int hugetlb_report_meminfo(char *); | 21 | int hugetlb_report_meminfo(char *); |
22 | int hugetlb_report_node_meminfo(int, char *); | 22 | int hugetlb_report_node_meminfo(int, char *); |
23 | int is_hugepage_mem_enough(size_t); | ||
24 | unsigned long hugetlb_total_pages(void); | 23 | unsigned long hugetlb_total_pages(void); |
25 | struct page *alloc_huge_page(struct vm_area_struct *, unsigned long); | ||
26 | void free_huge_page(struct page *); | ||
27 | int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, | 24 | int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, |
28 | unsigned long address, int write_access); | 25 | unsigned long address, int write_access); |
29 | 26 | ||
@@ -39,18 +36,35 @@ struct page *follow_huge_addr(struct mm_struct *mm, unsigned long address, | |||
39 | int write); | 36 | int write); |
40 | struct page *follow_huge_pmd(struct mm_struct *mm, unsigned long address, | 37 | struct page *follow_huge_pmd(struct mm_struct *mm, unsigned long address, |
41 | pmd_t *pmd, int write); | 38 | pmd_t *pmd, int write); |
42 | int is_aligned_hugepage_range(unsigned long addr, unsigned long len); | ||
43 | int pmd_huge(pmd_t pmd); | 39 | int pmd_huge(pmd_t pmd); |
40 | void hugetlb_change_protection(struct vm_area_struct *vma, | ||
41 | unsigned long address, unsigned long end, pgprot_t newprot); | ||
44 | 42 | ||
45 | #ifndef ARCH_HAS_HUGEPAGE_ONLY_RANGE | 43 | #ifndef ARCH_HAS_HUGEPAGE_ONLY_RANGE |
46 | #define is_hugepage_only_range(mm, addr, len) 0 | 44 | #define is_hugepage_only_range(mm, addr, len) 0 |
47 | #define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) \ | 45 | #endif |
48 | do { } while (0) | 46 | |
47 | #ifndef ARCH_HAS_HUGETLB_FREE_PGD_RANGE | ||
48 | #define hugetlb_free_pgd_range free_pgd_range | ||
49 | #else | ||
50 | void hugetlb_free_pgd_range(struct mmu_gather **tlb, unsigned long addr, | ||
51 | unsigned long end, unsigned long floor, | ||
52 | unsigned long ceiling); | ||
49 | #endif | 53 | #endif |
50 | 54 | ||
51 | #ifndef ARCH_HAS_PREPARE_HUGEPAGE_RANGE | 55 | #ifndef ARCH_HAS_PREPARE_HUGEPAGE_RANGE |
52 | #define prepare_hugepage_range(addr, len) \ | 56 | /* |
53 | is_aligned_hugepage_range(addr, len) | 57 | * If the arch doesn't supply something else, assume that hugepage |
58 | * size aligned regions are ok without further preparation. | ||
59 | */ | ||
60 | static inline int prepare_hugepage_range(unsigned long addr, unsigned long len) | ||
61 | { | ||
62 | if (len & ~HPAGE_MASK) | ||
63 | return -EINVAL; | ||
64 | if (addr & ~HPAGE_MASK) | ||
65 | return -EINVAL; | ||
66 | return 0; | ||
67 | } | ||
54 | #else | 68 | #else |
55 | int prepare_hugepage_range(unsigned long addr, unsigned long len); | 69 | int prepare_hugepage_range(unsigned long addr, unsigned long len); |
56 | #endif | 70 | #endif |
@@ -87,20 +101,17 @@ static inline unsigned long hugetlb_total_pages(void) | |||
87 | #define copy_hugetlb_page_range(src, dst, vma) ({ BUG(); 0; }) | 101 | #define copy_hugetlb_page_range(src, dst, vma) ({ BUG(); 0; }) |
88 | #define hugetlb_prefault(mapping, vma) ({ BUG(); 0; }) | 102 | #define hugetlb_prefault(mapping, vma) ({ BUG(); 0; }) |
89 | #define unmap_hugepage_range(vma, start, end) BUG() | 103 | #define unmap_hugepage_range(vma, start, end) BUG() |
90 | #define is_hugepage_mem_enough(size) 0 | ||
91 | #define hugetlb_report_meminfo(buf) 0 | 104 | #define hugetlb_report_meminfo(buf) 0 |
92 | #define hugetlb_report_node_meminfo(n, buf) 0 | 105 | #define hugetlb_report_node_meminfo(n, buf) 0 |
93 | #define follow_huge_pmd(mm, addr, pmd, write) NULL | 106 | #define follow_huge_pmd(mm, addr, pmd, write) NULL |
94 | #define is_aligned_hugepage_range(addr, len) 0 | ||
95 | #define prepare_hugepage_range(addr, len) (-EINVAL) | 107 | #define prepare_hugepage_range(addr, len) (-EINVAL) |
96 | #define pmd_huge(x) 0 | 108 | #define pmd_huge(x) 0 |
97 | #define is_hugepage_only_range(mm, addr, len) 0 | 109 | #define is_hugepage_only_range(mm, addr, len) 0 |
98 | #define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) \ | 110 | #define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; }) |
99 | do { } while (0) | ||
100 | #define alloc_huge_page(vma, addr) ({ NULL; }) | ||
101 | #define free_huge_page(p) ({ (void)(p); BUG(); }) | ||
102 | #define hugetlb_fault(mm, vma, addr, write) ({ BUG(); 0; }) | 111 | #define hugetlb_fault(mm, vma, addr, write) ({ BUG(); 0; }) |
103 | 112 | ||
113 | #define hugetlb_change_protection(vma, address, end, newprot) | ||
114 | |||
104 | #ifndef HPAGE_MASK | 115 | #ifndef HPAGE_MASK |
105 | #define HPAGE_MASK PAGE_MASK /* Keep the compiler happy */ | 116 | #define HPAGE_MASK PAGE_MASK /* Keep the compiler happy */ |
106 | #define HPAGE_SIZE PAGE_SIZE | 117 | #define HPAGE_SIZE PAGE_SIZE |
@@ -128,6 +139,8 @@ struct hugetlbfs_sb_info { | |||
128 | 139 | ||
129 | struct hugetlbfs_inode_info { | 140 | struct hugetlbfs_inode_info { |
130 | struct shared_policy policy; | 141 | struct shared_policy policy; |
142 | /* Protected by the (global) hugetlb_lock */ | ||
143 | unsigned long prereserved_hpages; | ||
131 | struct inode vfs_inode; | 144 | struct inode vfs_inode; |
132 | }; | 145 | }; |
133 | 146 | ||
@@ -141,9 +154,13 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb) | |||
141 | return sb->s_fs_info; | 154 | return sb->s_fs_info; |
142 | } | 155 | } |
143 | 156 | ||
144 | extern struct file_operations hugetlbfs_file_operations; | 157 | extern const struct file_operations hugetlbfs_file_operations; |
145 | extern struct vm_operations_struct hugetlb_vm_ops; | 158 | extern struct vm_operations_struct hugetlb_vm_ops; |
146 | struct file *hugetlb_zero_setup(size_t); | 159 | struct file *hugetlb_zero_setup(size_t); |
160 | int hugetlb_extend_reservation(struct hugetlbfs_inode_info *info, | ||
161 | unsigned long atleast_hpages); | ||
162 | void hugetlb_truncate_reservation(struct hugetlbfs_inode_info *info, | ||
163 | unsigned long atmost_hpages); | ||
147 | int hugetlb_get_quota(struct address_space *mapping); | 164 | int hugetlb_get_quota(struct address_space *mapping); |
148 | void hugetlb_put_quota(struct address_space *mapping); | 165 | void hugetlb_put_quota(struct address_space *mapping); |
149 | 166 | ||
diff --git a/include/linux/hwmon-sysfs.h b/include/linux/hwmon-sysfs.h index 7eb4004b3601..a90c09d331c1 100644 --- a/include/linux/hwmon-sysfs.h +++ b/include/linux/hwmon-sysfs.h | |||
@@ -27,11 +27,13 @@ struct sensor_device_attribute{ | |||
27 | #define to_sensor_dev_attr(_dev_attr) \ | 27 | #define to_sensor_dev_attr(_dev_attr) \ |
28 | container_of(_dev_attr, struct sensor_device_attribute, dev_attr) | 28 | container_of(_dev_attr, struct sensor_device_attribute, dev_attr) |
29 | 29 | ||
30 | #define SENSOR_DEVICE_ATTR(_name,_mode,_show,_store,_index) \ | 30 | #define SENSOR_ATTR(_name, _mode, _show, _store, _index) \ |
31 | struct sensor_device_attribute sensor_dev_attr_##_name = { \ | 31 | { .dev_attr = __ATTR(_name, _mode, _show, _store), \ |
32 | .dev_attr = __ATTR(_name,_mode,_show,_store), \ | 32 | .index = _index } |
33 | .index = _index, \ | 33 | |
34 | } | 34 | #define SENSOR_DEVICE_ATTR(_name, _mode, _show, _store, _index) \ |
35 | struct sensor_device_attribute sensor_dev_attr_##_name \ | ||
36 | = SENSOR_ATTR(_name, _mode, _show, _store, _index) | ||
35 | 37 | ||
36 | struct sensor_device_attribute_2 { | 38 | struct sensor_device_attribute_2 { |
37 | struct device_attribute dev_attr; | 39 | struct device_attribute dev_attr; |
@@ -41,11 +43,13 @@ struct sensor_device_attribute_2 { | |||
41 | #define to_sensor_dev_attr_2(_dev_attr) \ | 43 | #define to_sensor_dev_attr_2(_dev_attr) \ |
42 | container_of(_dev_attr, struct sensor_device_attribute_2, dev_attr) | 44 | container_of(_dev_attr, struct sensor_device_attribute_2, dev_attr) |
43 | 45 | ||
46 | #define SENSOR_ATTR_2(_name, _mode, _show, _store, _nr, _index) \ | ||
47 | { .dev_attr = __ATTR(_name, _mode, _show, _store), \ | ||
48 | .index = _index, \ | ||
49 | .nr = _nr } | ||
50 | |||
44 | #define SENSOR_DEVICE_ATTR_2(_name,_mode,_show,_store,_nr,_index) \ | 51 | #define SENSOR_DEVICE_ATTR_2(_name,_mode,_show,_store,_nr,_index) \ |
45 | struct sensor_device_attribute_2 sensor_dev_attr_##_name = { \ | 52 | struct sensor_device_attribute_2 sensor_dev_attr_##_name \ |
46 | .dev_attr = __ATTR(_name,_mode,_show,_store), \ | 53 | = SENSOR_ATTR_2(_name, _mode, _show, _store, _nr, _index) |
47 | .index = _index, \ | ||
48 | .nr = _nr, \ | ||
49 | } | ||
50 | 54 | ||
51 | #endif /* _LINUX_HWMON_SYSFS_H */ | 55 | #endif /* _LINUX_HWMON_SYSFS_H */ |
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index 474c8f4f5d4f..c8b81f419fd8 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h | |||
@@ -108,6 +108,10 @@ | |||
108 | #define I2C_DRIVERID_UPD64083 78 /* upd64083 video processor */ | 108 | #define I2C_DRIVERID_UPD64083 78 /* upd64083 video processor */ |
109 | #define I2C_DRIVERID_UPD64031A 79 /* upd64031a video processor */ | 109 | #define I2C_DRIVERID_UPD64031A 79 /* upd64031a video processor */ |
110 | #define I2C_DRIVERID_SAA717X 80 /* saa717x video encoder */ | 110 | #define I2C_DRIVERID_SAA717X 80 /* saa717x video encoder */ |
111 | #define I2C_DRIVERID_DS1672 81 /* Dallas/Maxim DS1672 RTC */ | ||
112 | #define I2C_DRIVERID_X1205 82 /* Xicor/Intersil X1205 RTC */ | ||
113 | #define I2C_DRIVERID_PCF8563 83 /* Philips PCF8563 RTC */ | ||
114 | #define I2C_DRIVERID_RS5C372 84 /* Ricoh RS5C372 RTC */ | ||
111 | 115 | ||
112 | #define I2C_DRIVERID_I2CDEV 900 | 116 | #define I2C_DRIVERID_I2CDEV 900 |
113 | #define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */ | 117 | #define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */ |
@@ -172,7 +176,6 @@ | |||
172 | #define I2C_HW_B_RIVA 0x010010 /* Riva based graphics cards */ | 176 | #define I2C_HW_B_RIVA 0x010010 /* Riva based graphics cards */ |
173 | #define I2C_HW_B_IOC 0x010011 /* IOC bit-wiggling */ | 177 | #define I2C_HW_B_IOC 0x010011 /* IOC bit-wiggling */ |
174 | #define I2C_HW_B_TSUNA 0x010012 /* DEC Tsunami chipset */ | 178 | #define I2C_HW_B_TSUNA 0x010012 /* DEC Tsunami chipset */ |
175 | #define I2C_HW_B_FRODO 0x010013 /* 2d3D SA-1110 Development Board */ | ||
176 | #define I2C_HW_B_OMAHA 0x010014 /* Omaha I2C interface (ARM) */ | 179 | #define I2C_HW_B_OMAHA 0x010014 /* Omaha I2C interface (ARM) */ |
177 | #define I2C_HW_B_GUIDE 0x010015 /* Guide bit-basher */ | 180 | #define I2C_HW_B_GUIDE 0x010015 /* Guide bit-basher */ |
178 | #define I2C_HW_B_IXP2000 0x010016 /* GPIO on IXP2000 systems */ | 181 | #define I2C_HW_B_IXP2000 0x010016 /* GPIO on IXP2000 systems */ |
@@ -185,6 +188,7 @@ | |||
185 | #define I2C_HW_B_SAVAGE 0x01001d /* savage framebuffer driver */ | 188 | #define I2C_HW_B_SAVAGE 0x01001d /* savage framebuffer driver */ |
186 | #define I2C_HW_B_RADEON 0x01001e /* radeon framebuffer driver */ | 189 | #define I2C_HW_B_RADEON 0x01001e /* radeon framebuffer driver */ |
187 | #define I2C_HW_B_EM28XX 0x01001f /* em28xx video capture cards */ | 190 | #define I2C_HW_B_EM28XX 0x01001f /* em28xx video capture cards */ |
191 | #define I2C_HW_B_CX2341X 0x010020 /* Conexant CX2341X MPEG encoder cards */ | ||
188 | 192 | ||
189 | /* --- PCF 8584 based algorithms */ | 193 | /* --- PCF 8584 based algorithms */ |
190 | #define I2C_HW_P_LP 0x020000 /* Parallel port interface */ | 194 | #define I2C_HW_P_LP 0x020000 /* Parallel port interface */ |
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 63f1d63cc1d8..1635ee25918f 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -32,7 +32,7 @@ | |||
32 | #include <linux/mod_devicetable.h> | 32 | #include <linux/mod_devicetable.h> |
33 | #include <linux/device.h> /* for struct device */ | 33 | #include <linux/device.h> /* for struct device */ |
34 | #include <linux/sched.h> /* for completion */ | 34 | #include <linux/sched.h> /* for completion */ |
35 | #include <asm/semaphore.h> | 35 | #include <linux/mutex.h> |
36 | 36 | ||
37 | /* --- For i2c-isa ---------------------------------------------------- */ | 37 | /* --- For i2c-isa ---------------------------------------------------- */ |
38 | 38 | ||
@@ -225,8 +225,8 @@ struct i2c_adapter { | |||
225 | int (*client_unregister)(struct i2c_client *); | 225 | int (*client_unregister)(struct i2c_client *); |
226 | 226 | ||
227 | /* data fields that are valid for all devices */ | 227 | /* data fields that are valid for all devices */ |
228 | struct semaphore bus_lock; | 228 | struct mutex bus_lock; |
229 | struct semaphore clist_lock; | 229 | struct mutex clist_lock; |
230 | 230 | ||
231 | int timeout; | 231 | int timeout; |
232 | int retries; | 232 | int retries; |
diff --git a/include/linux/i2o.h b/include/linux/i2o.h index 5a9d8c599171..dd7d627bf66f 100644 --- a/include/linux/i2o.h +++ b/include/linux/i2o.h | |||
@@ -950,9 +950,7 @@ static inline int i2o_pool_alloc(struct i2o_pool *pool, const char *name, | |||
950 | if (!pool->slab) | 950 | if (!pool->slab) |
951 | goto free_name; | 951 | goto free_name; |
952 | 952 | ||
953 | pool->mempool = | 953 | pool->mempool = mempool_create_slab_pool(min_nr, pool->slab); |
954 | mempool_create(min_nr, mempool_alloc_slab, mempool_free_slab, | ||
955 | pool->slab); | ||
956 | if (!pool->mempool) | 954 | if (!pool->mempool) |
957 | goto free_slab; | 955 | goto free_slab; |
958 | 956 | ||
diff --git a/include/linux/ide.h b/include/linux/ide.h index a7fc4cc79b23..8d2db412ba9c 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -792,6 +792,7 @@ typedef struct hwif_s { | |||
792 | unsigned no_dsc : 1; /* 0 default, 1 dsc_overlap disabled */ | 792 | unsigned no_dsc : 1; /* 0 default, 1 dsc_overlap disabled */ |
793 | unsigned auto_poll : 1; /* supports nop auto-poll */ | 793 | unsigned auto_poll : 1; /* supports nop auto-poll */ |
794 | unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */ | 794 | unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */ |
795 | unsigned no_io_32bit : 1; /* 1 = can not do 32-bit IO ops */ | ||
795 | 796 | ||
796 | struct device gendev; | 797 | struct device gendev; |
797 | struct completion gendev_rel_comp; /* To deal with device release() */ | 798 | struct completion gendev_rel_comp; /* To deal with device release() */ |
diff --git a/include/linux/init.h b/include/linux/init.h index ff8d8b8632f4..ed0ac7c39fdc 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
@@ -69,6 +69,10 @@ extern initcall_t __security_initcall_start[], __security_initcall_end[]; | |||
69 | 69 | ||
70 | /* Defined in init/main.c */ | 70 | /* Defined in init/main.c */ |
71 | extern char saved_command_line[]; | 71 | extern char saved_command_line[]; |
72 | |||
73 | /* used by init/main.c */ | ||
74 | extern void setup_arch(char **); | ||
75 | |||
72 | #endif | 76 | #endif |
73 | 77 | ||
74 | #ifndef MODULE | 78 | #ifndef MODULE |
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index dcfd2ecccb5d..41ecbb847f32 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
@@ -7,11 +7,10 @@ | |||
7 | #define INIT_FDTABLE \ | 7 | #define INIT_FDTABLE \ |
8 | { \ | 8 | { \ |
9 | .max_fds = NR_OPEN_DEFAULT, \ | 9 | .max_fds = NR_OPEN_DEFAULT, \ |
10 | .max_fdset = __FD_SETSIZE, \ | 10 | .max_fdset = EMBEDDED_FD_SET_SIZE, \ |
11 | .next_fd = 0, \ | ||
12 | .fd = &init_files.fd_array[0], \ | 11 | .fd = &init_files.fd_array[0], \ |
13 | .close_on_exec = &init_files.close_on_exec_init, \ | 12 | .close_on_exec = (fd_set *)&init_files.close_on_exec_init, \ |
14 | .open_fds = &init_files.open_fds_init, \ | 13 | .open_fds = (fd_set *)&init_files.open_fds_init, \ |
15 | .rcu = RCU_HEAD_INIT, \ | 14 | .rcu = RCU_HEAD_INIT, \ |
16 | .free_files = NULL, \ | 15 | .free_files = NULL, \ |
17 | .next = NULL, \ | 16 | .next = NULL, \ |
@@ -20,9 +19,10 @@ | |||
20 | #define INIT_FILES \ | 19 | #define INIT_FILES \ |
21 | { \ | 20 | { \ |
22 | .count = ATOMIC_INIT(1), \ | 21 | .count = ATOMIC_INIT(1), \ |
23 | .file_lock = SPIN_LOCK_UNLOCKED, \ | ||
24 | .fdt = &init_files.fdtab, \ | 22 | .fdt = &init_files.fdtab, \ |
25 | .fdtab = INIT_FDTABLE, \ | 23 | .fdtab = INIT_FDTABLE, \ |
24 | .file_lock = SPIN_LOCK_UNLOCKED, \ | ||
25 | .next_fd = 0, \ | ||
26 | .close_on_exec_init = { { 0, } }, \ | 26 | .close_on_exec_init = { { 0, } }, \ |
27 | .open_fds_init = { { 0, } }, \ | 27 | .open_fds_init = { { 0, } }, \ |
28 | .fd_array = { NULL, } \ | 28 | .fd_array = { NULL, } \ |
@@ -62,6 +62,8 @@ | |||
62 | .posix_timers = LIST_HEAD_INIT(sig.posix_timers), \ | 62 | .posix_timers = LIST_HEAD_INIT(sig.posix_timers), \ |
63 | .cpu_timers = INIT_CPU_TIMERS(sig.cpu_timers), \ | 63 | .cpu_timers = INIT_CPU_TIMERS(sig.cpu_timers), \ |
64 | .rlim = INIT_RLIMITS, \ | 64 | .rlim = INIT_RLIMITS, \ |
65 | .pgrp = 1, \ | ||
66 | .session = 1, \ | ||
65 | } | 67 | } |
66 | 68 | ||
67 | #define INIT_SIGHAND(sighand) { \ | 69 | #define INIT_SIGHAND(sighand) { \ |
diff --git a/include/linux/inotify.h b/include/linux/inotify.h index 267c88b5f742..09e00433c78e 100644 --- a/include/linux/inotify.h +++ b/include/linux/inotify.h | |||
@@ -71,6 +71,8 @@ struct inotify_event { | |||
71 | 71 | ||
72 | #ifdef CONFIG_INOTIFY | 72 | #ifdef CONFIG_INOTIFY |
73 | 73 | ||
74 | extern void inotify_d_instantiate(struct dentry *, struct inode *); | ||
75 | extern void inotify_d_move(struct dentry *); | ||
74 | extern void inotify_inode_queue_event(struct inode *, __u32, __u32, | 76 | extern void inotify_inode_queue_event(struct inode *, __u32, __u32, |
75 | const char *); | 77 | const char *); |
76 | extern void inotify_dentry_parent_queue_event(struct dentry *, __u32, __u32, | 78 | extern void inotify_dentry_parent_queue_event(struct dentry *, __u32, __u32, |
@@ -81,6 +83,15 @@ extern u32 inotify_get_cookie(void); | |||
81 | 83 | ||
82 | #else | 84 | #else |
83 | 85 | ||
86 | static inline void inotify_d_instantiate(struct dentry *dentry, | ||
87 | struct inode *inode) | ||
88 | { | ||
89 | } | ||
90 | |||
91 | static inline void inotify_d_move(struct dentry *dentry) | ||
92 | { | ||
93 | } | ||
94 | |||
84 | static inline void inotify_inode_queue_event(struct inode *inode, | 95 | static inline void inotify_inode_queue_event(struct inode *inode, |
85 | __u32 mask, __u32 cookie, | 96 | __u32 mask, __u32 cookie, |
86 | const char *filename) | 97 | const char *filename) |
diff --git a/include/linux/input.h b/include/linux/input.h index 6d4cc3c110d6..1d4e341b72e6 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -957,7 +957,7 @@ struct input_handler { | |||
957 | struct input_handle* (*connect)(struct input_handler *handler, struct input_dev *dev, struct input_device_id *id); | 957 | struct input_handle* (*connect)(struct input_handler *handler, struct input_dev *dev, struct input_device_id *id); |
958 | void (*disconnect)(struct input_handle *handle); | 958 | void (*disconnect)(struct input_handle *handle); |
959 | 959 | ||
960 | struct file_operations *fops; | 960 | const struct file_operations *fops; |
961 | int minor; | 961 | int minor; |
962 | char *name; | 962 | char *name; |
963 | 963 | ||
diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h index d6276e60b3bf..0a84b56935c2 100644 --- a/include/linux/ipmi.h +++ b/include/linux/ipmi.h | |||
@@ -36,6 +36,7 @@ | |||
36 | 36 | ||
37 | #include <linux/ipmi_msgdefs.h> | 37 | #include <linux/ipmi_msgdefs.h> |
38 | #include <linux/compiler.h> | 38 | #include <linux/compiler.h> |
39 | #include <linux/device.h> | ||
39 | 40 | ||
40 | /* | 41 | /* |
41 | * This file describes an interface to an IPMI driver. You have to | 42 | * This file describes an interface to an IPMI driver. You have to |
@@ -397,7 +398,7 @@ struct ipmi_smi_watcher | |||
397 | the watcher list. So you can add and remove users from the | 398 | the watcher list. So you can add and remove users from the |
398 | IPMI interface, send messages, etc., but you cannot add | 399 | IPMI interface, send messages, etc., but you cannot add |
399 | or remove SMI watchers or SMI interfaces. */ | 400 | or remove SMI watchers or SMI interfaces. */ |
400 | void (*new_smi)(int if_num); | 401 | void (*new_smi)(int if_num, struct device *dev); |
401 | void (*smi_gone)(int if_num); | 402 | void (*smi_gone)(int if_num); |
402 | }; | 403 | }; |
403 | 404 | ||
diff --git a/include/linux/ipmi_msgdefs.h b/include/linux/ipmi_msgdefs.h index 03bc64dc2ec1..22f5e2afda4f 100644 --- a/include/linux/ipmi_msgdefs.h +++ b/include/linux/ipmi_msgdefs.h | |||
@@ -47,6 +47,7 @@ | |||
47 | #define IPMI_NETFN_APP_RESPONSE 0x07 | 47 | #define IPMI_NETFN_APP_RESPONSE 0x07 |
48 | #define IPMI_GET_DEVICE_ID_CMD 0x01 | 48 | #define IPMI_GET_DEVICE_ID_CMD 0x01 |
49 | #define IPMI_CLEAR_MSG_FLAGS_CMD 0x30 | 49 | #define IPMI_CLEAR_MSG_FLAGS_CMD 0x30 |
50 | #define IPMI_GET_DEVICE_GUID_CMD 0x08 | ||
50 | #define IPMI_GET_MSG_FLAGS_CMD 0x31 | 51 | #define IPMI_GET_MSG_FLAGS_CMD 0x31 |
51 | #define IPMI_SEND_MSG_CMD 0x34 | 52 | #define IPMI_SEND_MSG_CMD 0x34 |
52 | #define IPMI_GET_MSG_CMD 0x33 | 53 | #define IPMI_GET_MSG_CMD 0x33 |
diff --git a/include/linux/ipmi_smi.h b/include/linux/ipmi_smi.h index e36ee157ad67..53571288a9fc 100644 --- a/include/linux/ipmi_smi.h +++ b/include/linux/ipmi_smi.h | |||
@@ -37,6 +37,9 @@ | |||
37 | #include <linux/ipmi_msgdefs.h> | 37 | #include <linux/ipmi_msgdefs.h> |
38 | #include <linux/proc_fs.h> | 38 | #include <linux/proc_fs.h> |
39 | #include <linux/module.h> | 39 | #include <linux/module.h> |
40 | #include <linux/device.h> | ||
41 | #include <linux/platform_device.h> | ||
42 | #include <linux/ipmi_smi.h> | ||
40 | 43 | ||
41 | /* This files describes the interface for IPMI system management interface | 44 | /* This files describes the interface for IPMI system management interface |
42 | drivers to bind into the IPMI message handler. */ | 45 | drivers to bind into the IPMI message handler. */ |
@@ -113,12 +116,52 @@ struct ipmi_smi_handlers | |||
113 | void (*dec_usecount)(void *send_info); | 116 | void (*dec_usecount)(void *send_info); |
114 | }; | 117 | }; |
115 | 118 | ||
119 | struct ipmi_device_id { | ||
120 | unsigned char device_id; | ||
121 | unsigned char device_revision; | ||
122 | unsigned char firmware_revision_1; | ||
123 | unsigned char firmware_revision_2; | ||
124 | unsigned char ipmi_version; | ||
125 | unsigned char additional_device_support; | ||
126 | unsigned int manufacturer_id; | ||
127 | unsigned int product_id; | ||
128 | unsigned char aux_firmware_revision[4]; | ||
129 | unsigned int aux_firmware_revision_set : 1; | ||
130 | }; | ||
131 | |||
132 | #define ipmi_version_major(v) ((v)->ipmi_version & 0xf) | ||
133 | #define ipmi_version_minor(v) ((v)->ipmi_version >> 4) | ||
134 | |||
135 | /* Take a pointer to a raw data buffer and a length and extract device | ||
136 | id information from it. The first byte of data must point to the | ||
137 | byte from the get device id response after the completion code. | ||
138 | The caller is responsible for making sure the length is at least | ||
139 | 11 and the command completed without error. */ | ||
140 | static inline void ipmi_demangle_device_id(unsigned char *data, | ||
141 | unsigned int data_len, | ||
142 | struct ipmi_device_id *id) | ||
143 | { | ||
144 | id->device_id = data[0]; | ||
145 | id->device_revision = data[1]; | ||
146 | id->firmware_revision_1 = data[2]; | ||
147 | id->firmware_revision_2 = data[3]; | ||
148 | id->ipmi_version = data[4]; | ||
149 | id->additional_device_support = data[5]; | ||
150 | id->manufacturer_id = data[6] | (data[7] << 8) | (data[8] << 16); | ||
151 | id->product_id = data[9] | (data[10] << 8); | ||
152 | if (data_len >= 15) { | ||
153 | memcpy(id->aux_firmware_revision, data+11, 4); | ||
154 | id->aux_firmware_revision_set = 1; | ||
155 | } else | ||
156 | id->aux_firmware_revision_set = 0; | ||
157 | } | ||
158 | |||
116 | /* Add a low-level interface to the IPMI driver. Note that if the | 159 | /* Add a low-level interface to the IPMI driver. Note that if the |
117 | interface doesn't know its slave address, it should pass in zero. */ | 160 | interface doesn't know its slave address, it should pass in zero. */ |
118 | int ipmi_register_smi(struct ipmi_smi_handlers *handlers, | 161 | int ipmi_register_smi(struct ipmi_smi_handlers *handlers, |
119 | void *send_info, | 162 | void *send_info, |
120 | unsigned char version_major, | 163 | struct ipmi_device_id *device_id, |
121 | unsigned char version_minor, | 164 | struct device *dev, |
122 | unsigned char slave_addr, | 165 | unsigned char slave_addr, |
123 | ipmi_smi_t *intf); | 166 | ipmi_smi_t *intf); |
124 | 167 | ||
diff --git a/include/linux/irq.h b/include/linux/irq.h index 6c5d4c898ccb..ee2a82a572f7 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -114,53 +114,8 @@ static inline void set_native_irq_info(int irq, cpumask_t mask) | |||
114 | #if defined (CONFIG_GENERIC_PENDING_IRQ) || defined (CONFIG_IRQBALANCE) | 114 | #if defined (CONFIG_GENERIC_PENDING_IRQ) || defined (CONFIG_IRQBALANCE) |
115 | extern cpumask_t pending_irq_cpumask[NR_IRQS]; | 115 | extern cpumask_t pending_irq_cpumask[NR_IRQS]; |
116 | 116 | ||
117 | static inline void set_pending_irq(unsigned int irq, cpumask_t mask) | 117 | void set_pending_irq(unsigned int irq, cpumask_t mask); |
118 | { | 118 | void move_native_irq(int irq); |
119 | irq_desc_t *desc = irq_desc + irq; | ||
120 | unsigned long flags; | ||
121 | |||
122 | spin_lock_irqsave(&desc->lock, flags); | ||
123 | desc->move_irq = 1; | ||
124 | pending_irq_cpumask[irq] = mask; | ||
125 | spin_unlock_irqrestore(&desc->lock, flags); | ||
126 | } | ||
127 | |||
128 | static inline void | ||
129 | move_native_irq(int irq) | ||
130 | { | ||
131 | cpumask_t tmp; | ||
132 | irq_desc_t *desc = irq_descp(irq); | ||
133 | |||
134 | if (likely (!desc->move_irq)) | ||
135 | return; | ||
136 | |||
137 | desc->move_irq = 0; | ||
138 | |||
139 | if (likely(cpus_empty(pending_irq_cpumask[irq]))) | ||
140 | return; | ||
141 | |||
142 | if (!desc->handler->set_affinity) | ||
143 | return; | ||
144 | |||
145 | /* note - we hold the desc->lock */ | ||
146 | cpus_and(tmp, pending_irq_cpumask[irq], cpu_online_map); | ||
147 | |||
148 | /* | ||
149 | * If there was a valid mask to work with, please | ||
150 | * do the disable, re-program, enable sequence. | ||
151 | * This is *not* particularly important for level triggered | ||
152 | * but in a edge trigger case, we might be setting rte | ||
153 | * when an active trigger is comming in. This could | ||
154 | * cause some ioapics to mal-function. | ||
155 | * Being paranoid i guess! | ||
156 | */ | ||
157 | if (unlikely(!cpus_empty(tmp))) { | ||
158 | desc->handler->disable(irq); | ||
159 | desc->handler->set_affinity(irq,tmp); | ||
160 | desc->handler->enable(irq); | ||
161 | } | ||
162 | cpus_clear(pending_irq_cpumask[irq]); | ||
163 | } | ||
164 | 119 | ||
165 | #ifdef CONFIG_PCI_MSI | 120 | #ifdef CONFIG_PCI_MSI |
166 | /* | 121 | /* |
diff --git a/include/linux/jbd.h b/include/linux/jbd.h index 41ee79962bb2..6a425e370cb3 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h | |||
@@ -28,6 +28,9 @@ | |||
28 | #include <linux/journal-head.h> | 28 | #include <linux/journal-head.h> |
29 | #include <linux/stddef.h> | 29 | #include <linux/stddef.h> |
30 | #include <linux/bit_spinlock.h> | 30 | #include <linux/bit_spinlock.h> |
31 | #include <linux/mutex.h> | ||
32 | #include <linux/timer.h> | ||
33 | |||
31 | #include <asm/semaphore.h> | 34 | #include <asm/semaphore.h> |
32 | #endif | 35 | #endif |
33 | 36 | ||
@@ -575,7 +578,7 @@ struct transaction_s | |||
575 | * @j_wait_checkpoint: Wait queue to trigger checkpointing | 578 | * @j_wait_checkpoint: Wait queue to trigger checkpointing |
576 | * @j_wait_commit: Wait queue to trigger commit | 579 | * @j_wait_commit: Wait queue to trigger commit |
577 | * @j_wait_updates: Wait queue to wait for updates to complete | 580 | * @j_wait_updates: Wait queue to wait for updates to complete |
578 | * @j_checkpoint_sem: Semaphore for locking against concurrent checkpoints | 581 | * @j_checkpoint_mutex: Mutex for locking against concurrent checkpoints |
579 | * @j_head: Journal head - identifies the first unused block in the journal | 582 | * @j_head: Journal head - identifies the first unused block in the journal |
580 | * @j_tail: Journal tail - identifies the oldest still-used block in the | 583 | * @j_tail: Journal tail - identifies the oldest still-used block in the |
581 | * journal. | 584 | * journal. |
@@ -645,7 +648,7 @@ struct journal_s | |||
645 | int j_barrier_count; | 648 | int j_barrier_count; |
646 | 649 | ||
647 | /* The barrier lock itself */ | 650 | /* The barrier lock itself */ |
648 | struct semaphore j_barrier; | 651 | struct mutex j_barrier; |
649 | 652 | ||
650 | /* | 653 | /* |
651 | * Transactions: The current running transaction... | 654 | * Transactions: The current running transaction... |
@@ -687,7 +690,7 @@ struct journal_s | |||
687 | wait_queue_head_t j_wait_updates; | 690 | wait_queue_head_t j_wait_updates; |
688 | 691 | ||
689 | /* Semaphore for locking against concurrent checkpoints */ | 692 | /* Semaphore for locking against concurrent checkpoints */ |
690 | struct semaphore j_checkpoint_sem; | 693 | struct mutex j_checkpoint_mutex; |
691 | 694 | ||
692 | /* | 695 | /* |
693 | * Journal head: identifies the first unused block in the journal. | 696 | * Journal head: identifies the first unused block in the journal. |
@@ -786,7 +789,7 @@ struct journal_s | |||
786 | unsigned long j_commit_interval; | 789 | unsigned long j_commit_interval; |
787 | 790 | ||
788 | /* The timer used to wakeup the commit thread: */ | 791 | /* The timer used to wakeup the commit thread: */ |
789 | struct timer_list *j_commit_timer; | 792 | struct timer_list j_commit_timer; |
790 | 793 | ||
791 | /* | 794 | /* |
792 | * The revoke table: maintains the list of revoked blocks in the | 795 | * The revoke table: maintains the list of revoked blocks in the |
@@ -892,7 +895,7 @@ extern int journal_dirty_metadata (handle_t *, struct buffer_head *); | |||
892 | extern void journal_release_buffer (handle_t *, struct buffer_head *); | 895 | extern void journal_release_buffer (handle_t *, struct buffer_head *); |
893 | extern int journal_forget (handle_t *, struct buffer_head *); | 896 | extern int journal_forget (handle_t *, struct buffer_head *); |
894 | extern void journal_sync_buffer (struct buffer_head *); | 897 | extern void journal_sync_buffer (struct buffer_head *); |
895 | extern int journal_invalidatepage(journal_t *, | 898 | extern void journal_invalidatepage(journal_t *, |
896 | struct page *, unsigned long); | 899 | struct page *, unsigned long); |
897 | extern int journal_try_to_free_buffers(journal_t *, struct page *, gfp_t); | 900 | extern int journal_try_to_free_buffers(journal_t *, struct page *, gfp_t); |
898 | extern int journal_stop(handle_t *); | 901 | extern int journal_stop(handle_t *); |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 3b507bf05d09..a3720f973ea5 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -87,10 +87,13 @@ extern int cond_resched(void); | |||
87 | (__x < 0) ? -__x : __x; \ | 87 | (__x < 0) ? -__x : __x; \ |
88 | }) | 88 | }) |
89 | 89 | ||
90 | extern struct notifier_block *panic_notifier_list; | 90 | extern struct atomic_notifier_head panic_notifier_list; |
91 | extern long (*panic_blink)(long time); | 91 | extern long (*panic_blink)(long time); |
92 | NORET_TYPE void panic(const char * fmt, ...) | 92 | NORET_TYPE void panic(const char * fmt, ...) |
93 | __attribute__ ((NORET_AND format (printf, 1, 2))); | 93 | __attribute__ ((NORET_AND format (printf, 1, 2))); |
94 | extern void oops_enter(void); | ||
95 | extern void oops_exit(void); | ||
96 | extern int oops_may_print(void); | ||
94 | fastcall NORET_TYPE void do_exit(long error_code) | 97 | fastcall NORET_TYPE void do_exit(long error_code) |
95 | ATTRIB_NORET; | 98 | ATTRIB_NORET; |
96 | NORET_TYPE void complete_and_exit(struct completion *, long) | 99 | NORET_TYPE void complete_and_exit(struct completion *, long) |
@@ -151,9 +154,10 @@ static inline int __attribute_pure__ long_log2(unsigned long x) | |||
151 | return r; | 154 | return r; |
152 | } | 155 | } |
153 | 156 | ||
154 | static inline unsigned long __attribute_const__ roundup_pow_of_two(unsigned long x) | 157 | static inline unsigned long |
158 | __attribute_const__ roundup_pow_of_two(unsigned long x) | ||
155 | { | 159 | { |
156 | return (1UL << fls(x - 1)); | 160 | return 1UL << fls_long(x - 1); |
157 | } | 161 | } |
158 | 162 | ||
159 | extern int printk_ratelimit(void); | 163 | extern int printk_ratelimit(void); |
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h index a484572c302e..b46249082cca 100644 --- a/include/linux/kernel_stat.h +++ b/include/linux/kernel_stat.h | |||
@@ -46,7 +46,7 @@ static inline int kstat_irqs(int irq) | |||
46 | { | 46 | { |
47 | int cpu, sum = 0; | 47 | int cpu, sum = 0; |
48 | 48 | ||
49 | for_each_cpu(cpu) | 49 | for_each_possible_cpu(cpu) |
50 | sum += kstat_cpu(cpu).irqs[irq]; | 50 | sum += kstat_cpu(cpu).irqs[irq]; |
51 | 51 | ||
52 | return sum; | 52 | return sum; |
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h index 669756bc20a2..778adc0fa640 100644 --- a/include/linux/kprobes.h +++ b/include/linux/kprobes.h | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <linux/percpu.h> | 36 | #include <linux/percpu.h> |
37 | #include <linux/spinlock.h> | 37 | #include <linux/spinlock.h> |
38 | #include <linux/rcupdate.h> | 38 | #include <linux/rcupdate.h> |
39 | #include <linux/mutex.h> | ||
39 | 40 | ||
40 | #ifdef CONFIG_KPROBES | 41 | #ifdef CONFIG_KPROBES |
41 | #include <asm/kprobes.h> | 42 | #include <asm/kprobes.h> |
@@ -152,7 +153,7 @@ struct kretprobe_instance { | |||
152 | }; | 153 | }; |
153 | 154 | ||
154 | extern spinlock_t kretprobe_lock; | 155 | extern spinlock_t kretprobe_lock; |
155 | extern struct semaphore kprobe_mutex; | 156 | extern struct mutex kprobe_mutex; |
156 | extern int arch_prepare_kprobe(struct kprobe *p); | 157 | extern int arch_prepare_kprobe(struct kprobe *p); |
157 | extern void arch_arm_kprobe(struct kprobe *p); | 158 | extern void arch_arm_kprobe(struct kprobe *p); |
158 | extern void arch_disarm_kprobe(struct kprobe *p); | 159 | extern void arch_disarm_kprobe(struct kprobe *p); |
diff --git a/include/linux/ktime.h b/include/linux/ktime.h index f3dec45ef874..62bc57580707 100644 --- a/include/linux/ktime.h +++ b/include/linux/ktime.h | |||
@@ -64,9 +64,6 @@ typedef union { | |||
64 | 64 | ||
65 | #if (BITS_PER_LONG == 64) || defined(CONFIG_KTIME_SCALAR) | 65 | #if (BITS_PER_LONG == 64) || defined(CONFIG_KTIME_SCALAR) |
66 | 66 | ||
67 | /* Define a ktime_t variable and initialize it to zero: */ | ||
68 | #define DEFINE_KTIME(kt) ktime_t kt = { .tv64 = 0 } | ||
69 | |||
70 | /** | 67 | /** |
71 | * ktime_set - Set a ktime_t variable from a seconds/nanoseconds value | 68 | * ktime_set - Set a ktime_t variable from a seconds/nanoseconds value |
72 | * | 69 | * |
@@ -113,9 +110,6 @@ static inline ktime_t timeval_to_ktime(struct timeval tv) | |||
113 | /* Map the ktime_t to timeval conversion to ns_to_timeval function */ | 110 | /* Map the ktime_t to timeval conversion to ns_to_timeval function */ |
114 | #define ktime_to_timeval(kt) ns_to_timeval((kt).tv64) | 111 | #define ktime_to_timeval(kt) ns_to_timeval((kt).tv64) |
115 | 112 | ||
116 | /* Map the ktime_t to clock_t conversion to the inline in jiffies.h: */ | ||
117 | #define ktime_to_clock_t(kt) nsec_to_clock_t((kt).tv64) | ||
118 | |||
119 | /* Convert ktime_t to nanoseconds - NOP in the scalar storage format: */ | 113 | /* Convert ktime_t to nanoseconds - NOP in the scalar storage format: */ |
120 | #define ktime_to_ns(kt) ((kt).tv64) | 114 | #define ktime_to_ns(kt) ((kt).tv64) |
121 | 115 | ||
@@ -136,9 +130,6 @@ static inline ktime_t timeval_to_ktime(struct timeval tv) | |||
136 | * tv.sec < 0 and 0 >= tv.nsec < NSEC_PER_SEC | 130 | * tv.sec < 0 and 0 >= tv.nsec < NSEC_PER_SEC |
137 | */ | 131 | */ |
138 | 132 | ||
139 | /* Define a ktime_t variable and initialize it to zero: */ | ||
140 | #define DEFINE_KTIME(kt) ktime_t kt = { .tv64 = 0 } | ||
141 | |||
142 | /* Set a ktime_t variable to a value in sec/nsec representation: */ | 133 | /* Set a ktime_t variable to a value in sec/nsec representation: */ |
143 | static inline ktime_t ktime_set(const long secs, const unsigned long nsecs) | 134 | static inline ktime_t ktime_set(const long secs, const unsigned long nsecs) |
144 | { | 135 | { |
@@ -255,17 +246,6 @@ static inline struct timeval ktime_to_timeval(const ktime_t kt) | |||
255 | } | 246 | } |
256 | 247 | ||
257 | /** | 248 | /** |
258 | * ktime_to_clock_t - convert a ktime_t variable to clock_t format | ||
259 | * @kt: the ktime_t variable to convert | ||
260 | * | ||
261 | * Returns a clock_t variable with the converted value | ||
262 | */ | ||
263 | static inline clock_t ktime_to_clock_t(const ktime_t kt) | ||
264 | { | ||
265 | return nsec_to_clock_t( (u64) kt.tv.sec * NSEC_PER_SEC + kt.tv.nsec); | ||
266 | } | ||
267 | |||
268 | /** | ||
269 | * ktime_to_ns - convert a ktime_t variable to scalar nanoseconds | 249 | * ktime_to_ns - convert a ktime_t variable to scalar nanoseconds |
270 | * @kt: the ktime_t variable to convert | 250 | * @kt: the ktime_t variable to convert |
271 | * | 251 | * |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 4dff3cf9d389..c2215469a101 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -161,8 +161,10 @@ enum { | |||
161 | ATA_QCFLAG_DMAMAP = ATA_QCFLAG_SG | ATA_QCFLAG_SINGLE, | 161 | ATA_QCFLAG_DMAMAP = ATA_QCFLAG_SG | ATA_QCFLAG_SINGLE, |
162 | ATA_QCFLAG_EH_SCHEDULED = (1 << 5), /* EH scheduled */ | 162 | ATA_QCFLAG_EH_SCHEDULED = (1 << 5), /* EH scheduled */ |
163 | 163 | ||
164 | /* host set flags */ | ||
165 | ATA_HOST_SIMPLEX = (1 << 0), /* Host is simplex, one DMA channel per host_set only */ | ||
166 | |||
164 | /* various lengths of time */ | 167 | /* various lengths of time */ |
165 | ATA_TMOUT_EDD = 5 * HZ, /* heuristic */ | ||
166 | ATA_TMOUT_PIO = 30 * HZ, | 168 | ATA_TMOUT_PIO = 30 * HZ, |
167 | ATA_TMOUT_BOOT = 30 * HZ, /* heuristic */ | 169 | ATA_TMOUT_BOOT = 30 * HZ, /* heuristic */ |
168 | ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* heuristic */ | 170 | ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* heuristic */ |
@@ -280,6 +282,7 @@ struct ata_probe_ent { | |||
280 | unsigned long irq; | 282 | unsigned long irq; |
281 | unsigned int irq_flags; | 283 | unsigned int irq_flags; |
282 | unsigned long host_flags; | 284 | unsigned long host_flags; |
285 | unsigned long host_set_flags; | ||
283 | void __iomem *mmio_base; | 286 | void __iomem *mmio_base; |
284 | void *private_data; | 287 | void *private_data; |
285 | }; | 288 | }; |
@@ -292,6 +295,9 @@ struct ata_host_set { | |||
292 | unsigned int n_ports; | 295 | unsigned int n_ports; |
293 | void *private_data; | 296 | void *private_data; |
294 | const struct ata_port_operations *ops; | 297 | const struct ata_port_operations *ops; |
298 | unsigned long flags; | ||
299 | int simplex_claimed; /* Keep seperate in case we | ||
300 | ever need to do this locked */ | ||
295 | struct ata_port * ports[0]; | 301 | struct ata_port * ports[0]; |
296 | }; | 302 | }; |
297 | 303 | ||
@@ -359,6 +365,11 @@ struct ata_device { | |||
359 | unsigned int max_sectors; /* per-device max sectors */ | 365 | unsigned int max_sectors; /* per-device max sectors */ |
360 | unsigned int cdb_len; | 366 | unsigned int cdb_len; |
361 | 367 | ||
368 | /* per-dev xfer mask */ | ||
369 | unsigned int pio_mask; | ||
370 | unsigned int mwdma_mask; | ||
371 | unsigned int udma_mask; | ||
372 | |||
362 | /* for CHS addressing */ | 373 | /* for CHS addressing */ |
363 | u16 cylinders; /* Number of cylinders */ | 374 | u16 cylinders; /* Number of cylinders */ |
364 | u16 heads; /* Number of heads */ | 375 | u16 heads; /* Number of heads */ |
@@ -396,6 +407,7 @@ struct ata_port { | |||
396 | 407 | ||
397 | struct ata_host_stats stats; | 408 | struct ata_host_stats stats; |
398 | struct ata_host_set *host_set; | 409 | struct ata_host_set *host_set; |
410 | struct device *dev; | ||
399 | 411 | ||
400 | struct work_struct port_task; | 412 | struct work_struct port_task; |
401 | 413 | ||
@@ -415,6 +427,7 @@ struct ata_port_operations { | |||
415 | 427 | ||
416 | void (*set_piomode) (struct ata_port *, struct ata_device *); | 428 | void (*set_piomode) (struct ata_port *, struct ata_device *); |
417 | void (*set_dmamode) (struct ata_port *, struct ata_device *); | 429 | void (*set_dmamode) (struct ata_port *, struct ata_device *); |
430 | unsigned long (*mode_filter) (const struct ata_port *, struct ata_device *, unsigned long); | ||
418 | 431 | ||
419 | void (*tf_load) (struct ata_port *ap, const struct ata_taskfile *tf); | 432 | void (*tf_load) (struct ata_port *ap, const struct ata_taskfile *tf); |
420 | void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf); | 433 | void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf); |
@@ -425,6 +438,7 @@ struct ata_port_operations { | |||
425 | void (*dev_select)(struct ata_port *ap, unsigned int device); | 438 | void (*dev_select)(struct ata_port *ap, unsigned int device); |
426 | 439 | ||
427 | void (*phy_reset) (struct ata_port *ap); /* obsolete */ | 440 | void (*phy_reset) (struct ata_port *ap); /* obsolete */ |
441 | void (*set_mode) (struct ata_port *ap); | ||
428 | int (*probe_reset) (struct ata_port *ap, unsigned int *classes); | 442 | int (*probe_reset) (struct ata_port *ap, unsigned int *classes); |
429 | 443 | ||
430 | void (*post_set_mode) (struct ata_port *ap); | 444 | void (*post_set_mode) (struct ata_port *ap); |
@@ -510,16 +524,15 @@ extern void ata_host_set_remove(struct ata_host_set *host_set); | |||
510 | extern int ata_scsi_detect(struct scsi_host_template *sht); | 524 | extern int ata_scsi_detect(struct scsi_host_template *sht); |
511 | extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); | 525 | extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); |
512 | extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); | 526 | extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); |
513 | extern enum scsi_eh_timer_return ata_scsi_timed_out(struct scsi_cmnd *cmd); | ||
514 | extern int ata_scsi_error(struct Scsi_Host *host); | 527 | extern int ata_scsi_error(struct Scsi_Host *host); |
515 | extern void ata_eh_qc_complete(struct ata_queued_cmd *qc); | 528 | extern void ata_eh_qc_complete(struct ata_queued_cmd *qc); |
516 | extern void ata_eh_qc_retry(struct ata_queued_cmd *qc); | 529 | extern void ata_eh_qc_retry(struct ata_queued_cmd *qc); |
517 | extern int ata_scsi_release(struct Scsi_Host *host); | 530 | extern int ata_scsi_release(struct Scsi_Host *host); |
518 | extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc); | 531 | extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc); |
519 | extern int ata_scsi_device_resume(struct scsi_device *); | 532 | extern int ata_scsi_device_resume(struct scsi_device *); |
520 | extern int ata_scsi_device_suspend(struct scsi_device *); | 533 | extern int ata_scsi_device_suspend(struct scsi_device *, pm_message_t state); |
521 | extern int ata_device_resume(struct ata_port *, struct ata_device *); | 534 | extern int ata_device_resume(struct ata_port *, struct ata_device *); |
522 | extern int ata_device_suspend(struct ata_port *, struct ata_device *); | 535 | extern int ata_device_suspend(struct ata_port *, struct ata_device *, pm_message_t state); |
523 | extern int ata_ratelimit(void); | 536 | extern int ata_ratelimit(void); |
524 | extern unsigned int ata_busy_sleep(struct ata_port *ap, | 537 | extern unsigned int ata_busy_sleep(struct ata_port *ap, |
525 | unsigned long timeout_pat, | 538 | unsigned long timeout_pat, |
@@ -570,6 +583,8 @@ extern int ata_std_bios_param(struct scsi_device *sdev, | |||
570 | struct block_device *bdev, | 583 | struct block_device *bdev, |
571 | sector_t capacity, int geom[]); | 584 | sector_t capacity, int geom[]); |
572 | extern int ata_scsi_slave_config(struct scsi_device *sdev); | 585 | extern int ata_scsi_slave_config(struct scsi_device *sdev); |
586 | extern struct ata_device *ata_dev_pair(struct ata_port *ap, | ||
587 | struct ata_device *adev); | ||
573 | 588 | ||
574 | /* | 589 | /* |
575 | * Timing helpers | 590 | * Timing helpers |
diff --git a/include/linux/linkage.h b/include/linux/linkage.h index 147eb01e0d4b..c08c9983e840 100644 --- a/include/linux/linkage.h +++ b/include/linux/linkage.h | |||
@@ -28,17 +28,27 @@ | |||
28 | #define ALIGN __ALIGN | 28 | #define ALIGN __ALIGN |
29 | #define ALIGN_STR __ALIGN_STR | 29 | #define ALIGN_STR __ALIGN_STR |
30 | 30 | ||
31 | #ifndef ENTRY | ||
31 | #define ENTRY(name) \ | 32 | #define ENTRY(name) \ |
32 | .globl name; \ | 33 | .globl name; \ |
33 | ALIGN; \ | 34 | ALIGN; \ |
34 | name: | 35 | name: |
36 | #endif | ||
35 | 37 | ||
36 | #define KPROBE_ENTRY(name) \ | 38 | #define KPROBE_ENTRY(name) \ |
37 | .section .kprobes.text, "ax"; \ | 39 | .section .kprobes.text, "ax"; \ |
38 | .globl name; \ | 40 | ENTRY(name) |
39 | ALIGN; \ | ||
40 | name: | ||
41 | 41 | ||
42 | #ifndef END | ||
43 | #define END(name) \ | ||
44 | .size name, .-name | ||
45 | #endif | ||
46 | |||
47 | #ifndef ENDPROC | ||
48 | #define ENDPROC(name) \ | ||
49 | .type name, @function; \ | ||
50 | END(name) | ||
51 | #endif | ||
42 | 52 | ||
43 | #endif | 53 | #endif |
44 | 54 | ||
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index ef21ed296039..995f89dc8c04 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/config.h> | 14 | #include <linux/config.h> |
15 | #include <linux/in.h> | 15 | #include <linux/in.h> |
16 | #include <linux/fs.h> | 16 | #include <linux/fs.h> |
17 | #include <linux/kref.h> | ||
17 | #include <linux/utsname.h> | 18 | #include <linux/utsname.h> |
18 | #include <linux/nfsd/nfsfh.h> | 19 | #include <linux/nfsd/nfsfh.h> |
19 | #include <linux/lockd/bind.h> | 20 | #include <linux/lockd/bind.h> |
@@ -58,6 +59,8 @@ struct nlm_host { | |||
58 | unsigned long h_expires; /* eligible for GC */ | 59 | unsigned long h_expires; /* eligible for GC */ |
59 | struct list_head h_lockowners; /* Lockowners for the client */ | 60 | struct list_head h_lockowners; /* Lockowners for the client */ |
60 | spinlock_t h_lock; | 61 | spinlock_t h_lock; |
62 | struct list_head h_granted; /* Locks in GRANTED state */ | ||
63 | struct list_head h_reclaim; /* Locks in RECLAIM state */ | ||
61 | }; | 64 | }; |
62 | 65 | ||
63 | /* | 66 | /* |
@@ -83,9 +86,9 @@ struct nlm_rqst { | |||
83 | struct nlm_host * a_host; /* host handle */ | 86 | struct nlm_host * a_host; /* host handle */ |
84 | struct nlm_args a_args; /* arguments */ | 87 | struct nlm_args a_args; /* arguments */ |
85 | struct nlm_res a_res; /* result */ | 88 | struct nlm_res a_res; /* result */ |
86 | struct nlm_wait * a_block; | 89 | struct nlm_block * a_block; |
87 | unsigned int a_retries; /* Retry count */ | 90 | unsigned int a_retries; /* Retry count */ |
88 | char a_owner[NLMCLNT_OHSIZE]; | 91 | u8 a_owner[NLMCLNT_OHSIZE]; |
89 | }; | 92 | }; |
90 | 93 | ||
91 | /* | 94 | /* |
@@ -110,16 +113,16 @@ struct nlm_file { | |||
110 | */ | 113 | */ |
111 | #define NLM_NEVER (~(unsigned long) 0) | 114 | #define NLM_NEVER (~(unsigned long) 0) |
112 | struct nlm_block { | 115 | struct nlm_block { |
116 | struct kref b_count; /* Reference count */ | ||
113 | struct nlm_block * b_next; /* linked list (all blocks) */ | 117 | struct nlm_block * b_next; /* linked list (all blocks) */ |
114 | struct nlm_block * b_fnext; /* linked list (per file) */ | 118 | struct nlm_block * b_fnext; /* linked list (per file) */ |
115 | struct nlm_rqst b_call; /* RPC args & callback info */ | 119 | struct nlm_rqst * b_call; /* RPC args & callback info */ |
116 | struct svc_serv * b_daemon; /* NLM service */ | 120 | struct svc_serv * b_daemon; /* NLM service */ |
117 | struct nlm_host * b_host; /* host handle for RPC clnt */ | 121 | struct nlm_host * b_host; /* host handle for RPC clnt */ |
118 | unsigned long b_when; /* next re-xmit */ | 122 | unsigned long b_when; /* next re-xmit */ |
119 | unsigned int b_id; /* block id */ | 123 | unsigned int b_id; /* block id */ |
120 | unsigned char b_queued; /* re-queued */ | 124 | unsigned char b_queued; /* re-queued */ |
121 | unsigned char b_granted; /* VFS granted lock */ | 125 | unsigned char b_granted; /* VFS granted lock */ |
122 | unsigned char b_incall; /* doing callback */ | ||
123 | unsigned char b_done; /* callback complete */ | 126 | unsigned char b_done; /* callback complete */ |
124 | struct nlm_file * b_file; /* file in question */ | 127 | struct nlm_file * b_file; /* file in question */ |
125 | }; | 128 | }; |
@@ -145,15 +148,16 @@ extern unsigned long nlmsvc_timeout; | |||
145 | /* | 148 | /* |
146 | * Lockd client functions | 149 | * Lockd client functions |
147 | */ | 150 | */ |
148 | struct nlm_rqst * nlmclnt_alloc_call(void); | 151 | struct nlm_rqst * nlm_alloc_call(struct nlm_host *host); |
149 | int nlmclnt_prepare_block(struct nlm_rqst *req, struct nlm_host *host, struct file_lock *fl); | 152 | void nlm_release_call(struct nlm_rqst *); |
150 | void nlmclnt_finish_block(struct nlm_rqst *req); | 153 | int nlm_async_call(struct nlm_rqst *, u32, const struct rpc_call_ops *); |
151 | long nlmclnt_block(struct nlm_rqst *req, long timeout); | 154 | int nlm_async_reply(struct nlm_rqst *, u32, const struct rpc_call_ops *); |
155 | struct nlm_wait * nlmclnt_prepare_block(struct nlm_host *host, struct file_lock *fl); | ||
156 | void nlmclnt_finish_block(struct nlm_wait *block); | ||
157 | int nlmclnt_block(struct nlm_wait *block, struct nlm_rqst *req, long timeout); | ||
152 | u32 nlmclnt_grant(const struct sockaddr_in *addr, const struct nlm_lock *); | 158 | u32 nlmclnt_grant(const struct sockaddr_in *addr, const struct nlm_lock *); |
153 | void nlmclnt_recovery(struct nlm_host *, u32); | 159 | void nlmclnt_recovery(struct nlm_host *, u32); |
154 | int nlmclnt_reclaim(struct nlm_host *, struct file_lock *); | 160 | int nlmclnt_reclaim(struct nlm_host *, struct file_lock *); |
155 | int nlmclnt_setgrantargs(struct nlm_rqst *, struct nlm_lock *); | ||
156 | void nlmclnt_freegrantargs(struct nlm_rqst *); | ||
157 | 161 | ||
158 | /* | 162 | /* |
159 | * Host cache | 163 | * Host cache |
@@ -172,7 +176,6 @@ extern struct nlm_host *nlm_find_client(void); | |||
172 | /* | 176 | /* |
173 | * Server-side lock handling | 177 | * Server-side lock handling |
174 | */ | 178 | */ |
175 | int nlmsvc_async_call(struct nlm_rqst *, u32, const struct rpc_call_ops *); | ||
176 | u32 nlmsvc_lock(struct svc_rqst *, struct nlm_file *, | 179 | u32 nlmsvc_lock(struct svc_rqst *, struct nlm_file *, |
177 | struct nlm_lock *, int, struct nlm_cookie *); | 180 | struct nlm_lock *, int, struct nlm_cookie *); |
178 | u32 nlmsvc_unlock(struct nlm_file *, struct nlm_lock *); | 181 | u32 nlmsvc_unlock(struct nlm_file *, struct nlm_lock *); |
@@ -180,7 +183,7 @@ u32 nlmsvc_testlock(struct nlm_file *, struct nlm_lock *, | |||
180 | struct nlm_lock *); | 183 | struct nlm_lock *); |
181 | u32 nlmsvc_cancel_blocked(struct nlm_file *, struct nlm_lock *); | 184 | u32 nlmsvc_cancel_blocked(struct nlm_file *, struct nlm_lock *); |
182 | unsigned long nlmsvc_retry_blocked(void); | 185 | unsigned long nlmsvc_retry_blocked(void); |
183 | int nlmsvc_traverse_blocks(struct nlm_host *, struct nlm_file *, | 186 | void nlmsvc_traverse_blocks(struct nlm_host *, struct nlm_file *, |
184 | int action); | 187 | int action); |
185 | void nlmsvc_grant_reply(struct svc_rqst *, struct nlm_cookie *, u32); | 188 | void nlmsvc_grant_reply(struct svc_rqst *, struct nlm_cookie *, u32); |
186 | 189 | ||
diff --git a/include/linux/lockd/share.h b/include/linux/lockd/share.h index 5d8aa325f140..c75a424ebe4c 100644 --- a/include/linux/lockd/share.h +++ b/include/linux/lockd/share.h | |||
@@ -25,6 +25,6 @@ u32 nlmsvc_share_file(struct nlm_host *, struct nlm_file *, | |||
25 | struct nlm_args *); | 25 | struct nlm_args *); |
26 | u32 nlmsvc_unshare_file(struct nlm_host *, struct nlm_file *, | 26 | u32 nlmsvc_unshare_file(struct nlm_host *, struct nlm_file *, |
27 | struct nlm_args *); | 27 | struct nlm_args *); |
28 | int nlmsvc_traverse_shares(struct nlm_host *, struct nlm_file *, int); | 28 | void nlmsvc_traverse_shares(struct nlm_host *, struct nlm_file *, int); |
29 | 29 | ||
30 | #endif /* LINUX_LOCKD_SHARE_H */ | 30 | #endif /* LINUX_LOCKD_SHARE_H */ |
diff --git a/include/linux/lockd/xdr.h b/include/linux/lockd/xdr.h index d7a5cc4cfa97..bb0a0f1caa91 100644 --- a/include/linux/lockd/xdr.h +++ b/include/linux/lockd/xdr.h | |||
@@ -28,6 +28,7 @@ struct nlm_lock { | |||
28 | int len; /* length of "caller" */ | 28 | int len; /* length of "caller" */ |
29 | struct nfs_fh fh; | 29 | struct nfs_fh fh; |
30 | struct xdr_netobj oh; | 30 | struct xdr_netobj oh; |
31 | u32 svid; | ||
31 | struct file_lock fl; | 32 | struct file_lock fl; |
32 | }; | 33 | }; |
33 | 34 | ||
diff --git a/include/linux/loop.h b/include/linux/loop.h index f96506782ebe..e76c7611d6cc 100644 --- a/include/linux/loop.h +++ b/include/linux/loop.h | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/bio.h> | 17 | #include <linux/bio.h> |
18 | #include <linux/blkdev.h> | 18 | #include <linux/blkdev.h> |
19 | #include <linux/spinlock.h> | 19 | #include <linux/spinlock.h> |
20 | #include <linux/mutex.h> | ||
20 | 21 | ||
21 | /* Possible states of device */ | 22 | /* Possible states of device */ |
22 | enum { | 23 | enum { |
@@ -60,7 +61,7 @@ struct loop_device { | |||
60 | int lo_state; | 61 | int lo_state; |
61 | struct completion lo_done; | 62 | struct completion lo_done; |
62 | struct completion lo_bh_done; | 63 | struct completion lo_bh_done; |
63 | struct semaphore lo_ctl_mutex; | 64 | struct mutex lo_ctl_mutex; |
64 | int lo_pending; | 65 | int lo_pending; |
65 | 66 | ||
66 | request_queue_t *lo_queue; | 67 | request_queue_t *lo_queue; |
diff --git a/include/linux/m48t86.h b/include/linux/m48t86.h new file mode 100644 index 000000000000..9065199319d0 --- /dev/null +++ b/include/linux/m48t86.h | |||
@@ -0,0 +1,16 @@ | |||
1 | /* | ||
2 | * ST M48T86 / Dallas DS12887 RTC driver | ||
3 | * Copyright (c) 2006 Tower Technologies | ||
4 | * | ||
5 | * Author: Alessandro Zummo <a.zummo@towertech.it> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | struct m48t86_ops | ||
13 | { | ||
14 | void (*writeb)(unsigned char value, unsigned long addr); | ||
15 | unsigned char (*readb)(unsigned long addr); | ||
16 | }; | ||
diff --git a/include/linux/major.h b/include/linux/major.h index e36a46702d94..0a74c52924c9 100644 --- a/include/linux/major.h +++ b/include/linux/major.h | |||
@@ -113,6 +113,7 @@ | |||
113 | 113 | ||
114 | #define UBD_MAJOR 98 | 114 | #define UBD_MAJOR 98 |
115 | 115 | ||
116 | #define PP_MAJOR 99 | ||
116 | #define JSFD_MAJOR 99 | 117 | #define JSFD_MAJOR 99 |
117 | 118 | ||
118 | #define PHONE_MAJOR 100 | 119 | #define PHONE_MAJOR 100 |
diff --git a/include/linux/memory.h b/include/linux/memory.h index e251dc43d0f5..8f04143ca363 100644 --- a/include/linux/memory.h +++ b/include/linux/memory.h | |||
@@ -77,7 +77,6 @@ extern int remove_memory_block(unsigned long, struct mem_section *, int); | |||
77 | 77 | ||
78 | #define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT) | 78 | #define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT) |
79 | 79 | ||
80 | struct notifier_block; | ||
81 | 80 | ||
82 | #endif /* CONFIG_MEMORY_HOTPLUG */ | 81 | #endif /* CONFIG_MEMORY_HOTPLUG */ |
83 | 82 | ||
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h index bbd2221923c3..6a7621b2b12b 100644 --- a/include/linux/mempolicy.h +++ b/include/linux/mempolicy.h | |||
@@ -147,6 +147,7 @@ extern void mpol_rebind_policy(struct mempolicy *pol, const nodemask_t *new); | |||
147 | extern void mpol_rebind_task(struct task_struct *tsk, | 147 | extern void mpol_rebind_task(struct task_struct *tsk, |
148 | const nodemask_t *new); | 148 | const nodemask_t *new); |
149 | extern void mpol_rebind_mm(struct mm_struct *mm, nodemask_t *new); | 149 | extern void mpol_rebind_mm(struct mm_struct *mm, nodemask_t *new); |
150 | extern void mpol_fix_fork_child_flag(struct task_struct *p); | ||
150 | #define set_cpuset_being_rebound(x) (cpuset_being_rebound = (x)) | 151 | #define set_cpuset_being_rebound(x) (cpuset_being_rebound = (x)) |
151 | 152 | ||
152 | #ifdef CONFIG_CPUSET | 153 | #ifdef CONFIG_CPUSET |
@@ -248,6 +249,10 @@ static inline void mpol_rebind_mm(struct mm_struct *mm, nodemask_t *new) | |||
248 | { | 249 | { |
249 | } | 250 | } |
250 | 251 | ||
252 | static inline void mpol_fix_fork_child_flag(struct task_struct *p) | ||
253 | { | ||
254 | } | ||
255 | |||
251 | #define set_cpuset_being_rebound(x) do {} while (0) | 256 | #define set_cpuset_being_rebound(x) do {} while (0) |
252 | 257 | ||
253 | static inline struct zonelist *huge_zonelist(struct vm_area_struct *vma, | 258 | static inline struct zonelist *huge_zonelist(struct vm_area_struct *vma, |
diff --git a/include/linux/mempool.h b/include/linux/mempool.h index f2427d7394b0..9be484d11283 100644 --- a/include/linux/mempool.h +++ b/include/linux/mempool.h | |||
@@ -6,6 +6,8 @@ | |||
6 | 6 | ||
7 | #include <linux/wait.h> | 7 | #include <linux/wait.h> |
8 | 8 | ||
9 | struct kmem_cache; | ||
10 | |||
9 | typedef void * (mempool_alloc_t)(gfp_t gfp_mask, void *pool_data); | 11 | typedef void * (mempool_alloc_t)(gfp_t gfp_mask, void *pool_data); |
10 | typedef void (mempool_free_t)(void *element, void *pool_data); | 12 | typedef void (mempool_free_t)(void *element, void *pool_data); |
11 | 13 | ||
@@ -37,5 +39,41 @@ extern void mempool_free(void *element, mempool_t *pool); | |||
37 | */ | 39 | */ |
38 | void *mempool_alloc_slab(gfp_t gfp_mask, void *pool_data); | 40 | void *mempool_alloc_slab(gfp_t gfp_mask, void *pool_data); |
39 | void mempool_free_slab(void *element, void *pool_data); | 41 | void mempool_free_slab(void *element, void *pool_data); |
42 | static inline mempool_t * | ||
43 | mempool_create_slab_pool(int min_nr, struct kmem_cache *kc) | ||
44 | { | ||
45 | return mempool_create(min_nr, mempool_alloc_slab, mempool_free_slab, | ||
46 | (void *) kc); | ||
47 | } | ||
48 | |||
49 | /* | ||
50 | * 2 mempool_alloc_t's and a mempool_free_t to kmalloc/kzalloc and kfree | ||
51 | * the amount of memory specified by pool_data | ||
52 | */ | ||
53 | void *mempool_kmalloc(gfp_t gfp_mask, void *pool_data); | ||
54 | void *mempool_kzalloc(gfp_t gfp_mask, void *pool_data); | ||
55 | void mempool_kfree(void *element, void *pool_data); | ||
56 | static inline mempool_t *mempool_create_kmalloc_pool(int min_nr, size_t size) | ||
57 | { | ||
58 | return mempool_create(min_nr, mempool_kmalloc, mempool_kfree, | ||
59 | (void *) size); | ||
60 | } | ||
61 | static inline mempool_t *mempool_create_kzalloc_pool(int min_nr, size_t size) | ||
62 | { | ||
63 | return mempool_create(min_nr, mempool_kzalloc, mempool_kfree, | ||
64 | (void *) size); | ||
65 | } | ||
66 | |||
67 | /* | ||
68 | * A mempool_alloc_t and mempool_free_t for a simple page allocator that | ||
69 | * allocates pages of the order specified by pool_data | ||
70 | */ | ||
71 | void *mempool_alloc_pages(gfp_t gfp_mask, void *pool_data); | ||
72 | void mempool_free_pages(void *element, void *pool_data); | ||
73 | static inline mempool_t *mempool_create_page_pool(int min_nr, int order) | ||
74 | { | ||
75 | return mempool_create(min_nr, mempool_alloc_pages, mempool_free_pages, | ||
76 | (void *)(long)order); | ||
77 | } | ||
40 | 78 | ||
41 | #endif /* _LINUX_MEMPOOL_H */ | 79 | #endif /* _LINUX_MEMPOOL_H */ |
diff --git a/include/linux/migrate.h b/include/linux/migrate.h new file mode 100644 index 000000000000..7d09962c3c0b --- /dev/null +++ b/include/linux/migrate.h | |||
@@ -0,0 +1,36 @@ | |||
1 | #ifndef _LINUX_MIGRATE_H | ||
2 | #define _LINUX_MIGRATE_H | ||
3 | |||
4 | #include <linux/config.h> | ||
5 | #include <linux/mm.h> | ||
6 | |||
7 | #ifdef CONFIG_MIGRATION | ||
8 | extern int isolate_lru_page(struct page *p, struct list_head *pagelist); | ||
9 | extern int putback_lru_pages(struct list_head *l); | ||
10 | extern int migrate_page(struct page *, struct page *); | ||
11 | extern void migrate_page_copy(struct page *, struct page *); | ||
12 | extern int migrate_page_remove_references(struct page *, struct page *, int); | ||
13 | extern int migrate_pages(struct list_head *l, struct list_head *t, | ||
14 | struct list_head *moved, struct list_head *failed); | ||
15 | int migrate_pages_to(struct list_head *pagelist, | ||
16 | struct vm_area_struct *vma, int dest); | ||
17 | extern int fail_migrate_page(struct page *, struct page *); | ||
18 | |||
19 | extern int migrate_prep(void); | ||
20 | |||
21 | #else | ||
22 | |||
23 | static inline int isolate_lru_page(struct page *p, struct list_head *list) | ||
24 | { return -ENOSYS; } | ||
25 | static inline int putback_lru_pages(struct list_head *l) { return 0; } | ||
26 | static inline int migrate_pages(struct list_head *l, struct list_head *t, | ||
27 | struct list_head *moved, struct list_head *failed) { return -ENOSYS; } | ||
28 | |||
29 | static inline int migrate_prep(void) { return -ENOSYS; } | ||
30 | |||
31 | /* Possible settings for the migrate_page() method in address_operations */ | ||
32 | #define migrate_page NULL | ||
33 | #define fail_migrate_page NULL | ||
34 | |||
35 | #endif /* CONFIG_MIGRATION */ | ||
36 | #endif /* _LINUX_MIGRATE_H */ | ||
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h index 14ceebfc1efa..5b584dafb5a6 100644 --- a/include/linux/miscdevice.h +++ b/include/linux/miscdevice.h | |||
@@ -36,7 +36,7 @@ struct class_device; | |||
36 | struct miscdevice { | 36 | struct miscdevice { |
37 | int minor; | 37 | int minor; |
38 | const char *name; | 38 | const char *name; |
39 | struct file_operations *fops; | 39 | const struct file_operations *fops; |
40 | struct list_head list; | 40 | struct list_head list; |
41 | struct device *dev; | 41 | struct device *dev; |
42 | struct class_device *class; | 42 | struct class_device *class; |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 498ff8778fb6..6aa016f1d3ae 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -286,43 +286,34 @@ struct page { | |||
286 | * | 286 | * |
287 | * Also, many kernel routines increase the page count before a critical | 287 | * Also, many kernel routines increase the page count before a critical |
288 | * routine so they can be sure the page doesn't go away from under them. | 288 | * routine so they can be sure the page doesn't go away from under them. |
289 | * | ||
290 | * Since 2.6.6 (approx), a free page has ->_count = -1. This is so that we | ||
291 | * can use atomic_add_negative(-1, page->_count) to detect when the page | ||
292 | * becomes free and so that we can also use atomic_inc_and_test to atomically | ||
293 | * detect when we just tried to grab a ref on a page which some other CPU has | ||
294 | * already deemed to be freeable. | ||
295 | * | ||
296 | * NO code should make assumptions about this internal detail! Use the provided | ||
297 | * macros which retain the old rules: page_count(page) == 0 is a free page. | ||
298 | */ | 289 | */ |
299 | 290 | ||
300 | /* | 291 | /* |
301 | * Drop a ref, return true if the logical refcount fell to zero (the page has | 292 | * Drop a ref, return true if the logical refcount fell to zero (the page has |
302 | * no users) | 293 | * no users) |
303 | */ | 294 | */ |
304 | #define put_page_testzero(p) \ | 295 | static inline int put_page_testzero(struct page *page) |
305 | ({ \ | 296 | { |
306 | BUG_ON(atomic_read(&(p)->_count) == -1);\ | 297 | BUG_ON(atomic_read(&page->_count) == 0); |
307 | atomic_add_negative(-1, &(p)->_count); \ | 298 | return atomic_dec_and_test(&page->_count); |
308 | }) | 299 | } |
309 | 300 | ||
310 | /* | 301 | /* |
311 | * Grab a ref, return true if the page previously had a logical refcount of | 302 | * Try to grab a ref unless the page has a refcount of zero, return false if |
312 | * zero. ie: returns true if we just grabbed an already-deemed-to-be-free page | 303 | * that is the case. |
313 | */ | 304 | */ |
314 | #define get_page_testone(p) atomic_inc_and_test(&(p)->_count) | 305 | static inline int get_page_unless_zero(struct page *page) |
315 | 306 | { | |
316 | #define set_page_count(p,v) atomic_set(&(p)->_count, (v) - 1) | 307 | return atomic_inc_not_zero(&page->_count); |
317 | #define __put_page(p) atomic_dec(&(p)->_count) | 308 | } |
318 | 309 | ||
319 | extern void FASTCALL(__page_cache_release(struct page *)); | 310 | extern void FASTCALL(__page_cache_release(struct page *)); |
320 | 311 | ||
321 | static inline int page_count(struct page *page) | 312 | static inline int page_count(struct page *page) |
322 | { | 313 | { |
323 | if (PageCompound(page)) | 314 | if (unlikely(PageCompound(page))) |
324 | page = (struct page *)page_private(page); | 315 | page = (struct page *)page_private(page); |
325 | return atomic_read(&page->_count) + 1; | 316 | return atomic_read(&page->_count); |
326 | } | 317 | } |
327 | 318 | ||
328 | static inline void get_page(struct page *page) | 319 | static inline void get_page(struct page *page) |
@@ -332,8 +323,19 @@ static inline void get_page(struct page *page) | |||
332 | atomic_inc(&page->_count); | 323 | atomic_inc(&page->_count); |
333 | } | 324 | } |
334 | 325 | ||
326 | /* | ||
327 | * Setup the page count before being freed into the page allocator for | ||
328 | * the first time (boot or memory hotplug) | ||
329 | */ | ||
330 | static inline void init_page_count(struct page *page) | ||
331 | { | ||
332 | atomic_set(&page->_count, 1); | ||
333 | } | ||
334 | |||
335 | void put_page(struct page *page); | 335 | void put_page(struct page *page); |
336 | 336 | ||
337 | void split_page(struct page *page, unsigned int order); | ||
338 | |||
337 | /* | 339 | /* |
338 | * Multiple processes may "see" the same page. E.g. for untouched | 340 | * Multiple processes may "see" the same page. E.g. for untouched |
339 | * mappings of /dev/null, all processes see the same page full of | 341 | * mappings of /dev/null, all processes see the same page full of |
@@ -1046,7 +1048,7 @@ int in_gate_area_no_task(unsigned long addr); | |||
1046 | 1048 | ||
1047 | int drop_caches_sysctl_handler(struct ctl_table *, int, struct file *, | 1049 | int drop_caches_sysctl_handler(struct ctl_table *, int, struct file *, |
1048 | void __user *, size_t *, loff_t *); | 1050 | void __user *, size_t *, loff_t *); |
1049 | int shrink_slab(unsigned long scanned, gfp_t gfp_mask, | 1051 | unsigned long shrink_slab(unsigned long scanned, gfp_t gfp_mask, |
1050 | unsigned long lru_pages); | 1052 | unsigned long lru_pages); |
1051 | void drop_pagecache(void); | 1053 | void drop_pagecache(void); |
1052 | void drop_slab(void); | 1054 | void drop_slab(void); |
diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h index 8ac854f7f190..3b6723dfaff3 100644 --- a/include/linux/mm_inline.h +++ b/include/linux/mm_inline.h | |||
@@ -32,7 +32,7 @@ del_page_from_lru(struct zone *zone, struct page *page) | |||
32 | { | 32 | { |
33 | list_del(&page->lru); | 33 | list_del(&page->lru); |
34 | if (PageActive(page)) { | 34 | if (PageActive(page)) { |
35 | ClearPageActive(page); | 35 | __ClearPageActive(page); |
36 | zone->nr_active--; | 36 | zone->nr_active--; |
37 | } else { | 37 | } else { |
38 | zone->nr_inactive--; | 38 | zone->nr_inactive--; |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index ebfc238cc243..b5c21122c299 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/numa.h> | 13 | #include <linux/numa.h> |
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <linux/seqlock.h> | 15 | #include <linux/seqlock.h> |
16 | #include <linux/nodemask.h> | ||
16 | #include <asm/atomic.h> | 17 | #include <asm/atomic.h> |
17 | 18 | ||
18 | /* Free memory management - zoned buddy allocator. */ | 19 | /* Free memory management - zoned buddy allocator. */ |
@@ -225,7 +226,6 @@ struct zone { | |||
225 | * Discontig memory support fields. | 226 | * Discontig memory support fields. |
226 | */ | 227 | */ |
227 | struct pglist_data *zone_pgdat; | 228 | struct pglist_data *zone_pgdat; |
228 | struct page *zone_mem_map; | ||
229 | /* zone_start_pfn == zone_start_paddr >> PAGE_SHIFT */ | 229 | /* zone_start_pfn == zone_start_paddr >> PAGE_SHIFT */ |
230 | unsigned long zone_start_pfn; | 230 | unsigned long zone_start_pfn; |
231 | 231 | ||
@@ -307,7 +307,6 @@ typedef struct pglist_data { | |||
307 | unsigned long node_spanned_pages; /* total size of physical page | 307 | unsigned long node_spanned_pages; /* total size of physical page |
308 | range, including holes */ | 308 | range, including holes */ |
309 | int node_id; | 309 | int node_id; |
310 | struct pglist_data *pgdat_next; | ||
311 | wait_queue_head_t kswapd_wait; | 310 | wait_queue_head_t kswapd_wait; |
312 | struct task_struct *kswapd; | 311 | struct task_struct *kswapd; |
313 | int kswapd_max_order; | 312 | int kswapd_max_order; |
@@ -324,8 +323,6 @@ typedef struct pglist_data { | |||
324 | 323 | ||
325 | #include <linux/memory_hotplug.h> | 324 | #include <linux/memory_hotplug.h> |
326 | 325 | ||
327 | extern struct pglist_data *pgdat_list; | ||
328 | |||
329 | void __get_zone_counts(unsigned long *active, unsigned long *inactive, | 326 | void __get_zone_counts(unsigned long *active, unsigned long *inactive, |
330 | unsigned long *free, struct pglist_data *pgdat); | 327 | unsigned long *free, struct pglist_data *pgdat); |
331 | void get_zone_counts(unsigned long *active, unsigned long *inactive, | 328 | void get_zone_counts(unsigned long *active, unsigned long *inactive, |
@@ -350,57 +347,6 @@ unsigned long __init node_memmap_size_bytes(int, unsigned long, unsigned long); | |||
350 | */ | 347 | */ |
351 | #define zone_idx(zone) ((zone) - (zone)->zone_pgdat->node_zones) | 348 | #define zone_idx(zone) ((zone) - (zone)->zone_pgdat->node_zones) |
352 | 349 | ||
353 | /** | ||
354 | * for_each_pgdat - helper macro to iterate over all nodes | ||
355 | * @pgdat - pointer to a pg_data_t variable | ||
356 | * | ||
357 | * Meant to help with common loops of the form | ||
358 | * pgdat = pgdat_list; | ||
359 | * while(pgdat) { | ||
360 | * ... | ||
361 | * pgdat = pgdat->pgdat_next; | ||
362 | * } | ||
363 | */ | ||
364 | #define for_each_pgdat(pgdat) \ | ||
365 | for (pgdat = pgdat_list; pgdat; pgdat = pgdat->pgdat_next) | ||
366 | |||
367 | /* | ||
368 | * next_zone - helper magic for for_each_zone() | ||
369 | * Thanks to William Lee Irwin III for this piece of ingenuity. | ||
370 | */ | ||
371 | static inline struct zone *next_zone(struct zone *zone) | ||
372 | { | ||
373 | pg_data_t *pgdat = zone->zone_pgdat; | ||
374 | |||
375 | if (zone < pgdat->node_zones + MAX_NR_ZONES - 1) | ||
376 | zone++; | ||
377 | else if (pgdat->pgdat_next) { | ||
378 | pgdat = pgdat->pgdat_next; | ||
379 | zone = pgdat->node_zones; | ||
380 | } else | ||
381 | zone = NULL; | ||
382 | |||
383 | return zone; | ||
384 | } | ||
385 | |||
386 | /** | ||
387 | * for_each_zone - helper macro to iterate over all memory zones | ||
388 | * @zone - pointer to struct zone variable | ||
389 | * | ||
390 | * The user only needs to declare the zone variable, for_each_zone | ||
391 | * fills it in. This basically means for_each_zone() is an | ||
392 | * easier to read version of this piece of code: | ||
393 | * | ||
394 | * for (pgdat = pgdat_list; pgdat; pgdat = pgdat->node_next) | ||
395 | * for (i = 0; i < MAX_NR_ZONES; ++i) { | ||
396 | * struct zone * z = pgdat->node_zones + i; | ||
397 | * ... | ||
398 | * } | ||
399 | * } | ||
400 | */ | ||
401 | #define for_each_zone(zone) \ | ||
402 | for (zone = pgdat_list->node_zones; zone; zone = next_zone(zone)) | ||
403 | |||
404 | static inline int populated_zone(struct zone *zone) | 350 | static inline int populated_zone(struct zone *zone) |
405 | { | 351 | { |
406 | return (!!zone->present_pages); | 352 | return (!!zone->present_pages); |
@@ -472,6 +418,30 @@ extern struct pglist_data contig_page_data; | |||
472 | 418 | ||
473 | #endif /* !CONFIG_NEED_MULTIPLE_NODES */ | 419 | #endif /* !CONFIG_NEED_MULTIPLE_NODES */ |
474 | 420 | ||
421 | extern struct pglist_data *first_online_pgdat(void); | ||
422 | extern struct pglist_data *next_online_pgdat(struct pglist_data *pgdat); | ||
423 | extern struct zone *next_zone(struct zone *zone); | ||
424 | |||
425 | /** | ||
426 | * for_each_pgdat - helper macro to iterate over all nodes | ||
427 | * @pgdat - pointer to a pg_data_t variable | ||
428 | */ | ||
429 | #define for_each_online_pgdat(pgdat) \ | ||
430 | for (pgdat = first_online_pgdat(); \ | ||
431 | pgdat; \ | ||
432 | pgdat = next_online_pgdat(pgdat)) | ||
433 | /** | ||
434 | * for_each_zone - helper macro to iterate over all memory zones | ||
435 | * @zone - pointer to struct zone variable | ||
436 | * | ||
437 | * The user only needs to declare the zone variable, for_each_zone | ||
438 | * fills it in. | ||
439 | */ | ||
440 | #define for_each_zone(zone) \ | ||
441 | for (zone = (first_online_pgdat())->node_zones; \ | ||
442 | zone; \ | ||
443 | zone = next_zone(zone)) | ||
444 | |||
475 | #ifdef CONFIG_SPARSEMEM | 445 | #ifdef CONFIG_SPARSEMEM |
476 | #include <asm/sparsemem.h> | 446 | #include <asm/sparsemem.h> |
477 | #endif | 447 | #endif |
@@ -602,17 +572,6 @@ static inline struct mem_section *__pfn_to_section(unsigned long pfn) | |||
602 | return __nr_to_section(pfn_to_section_nr(pfn)); | 572 | return __nr_to_section(pfn_to_section_nr(pfn)); |
603 | } | 573 | } |
604 | 574 | ||
605 | #define pfn_to_page(pfn) \ | ||
606 | ({ \ | ||
607 | unsigned long __pfn = (pfn); \ | ||
608 | __section_mem_map_addr(__pfn_to_section(__pfn)) + __pfn; \ | ||
609 | }) | ||
610 | #define page_to_pfn(page) \ | ||
611 | ({ \ | ||
612 | page - __section_mem_map_addr(__nr_to_section( \ | ||
613 | page_to_section(page))); \ | ||
614 | }) | ||
615 | |||
616 | static inline int pfn_valid(unsigned long pfn) | 575 | static inline int pfn_valid(unsigned long pfn) |
617 | { | 576 | { |
618 | if (pfn_to_section_nr(pfn) >= NR_MEM_SECTIONS) | 577 | if (pfn_to_section_nr(pfn) >= NR_MEM_SECTIONS) |
diff --git a/include/linux/module.h b/include/linux/module.h index 70bd843c71cb..eaec13ddd667 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -183,6 +183,7 @@ void *__symbol_get_gpl(const char *symbol); | |||
183 | 183 | ||
184 | /* For every exported symbol, place a struct in the __ksymtab section */ | 184 | /* For every exported symbol, place a struct in the __ksymtab section */ |
185 | #define __EXPORT_SYMBOL(sym, sec) \ | 185 | #define __EXPORT_SYMBOL(sym, sec) \ |
186 | extern typeof(sym) sym; \ | ||
186 | __CRC_SYMBOL(sym, sec) \ | 187 | __CRC_SYMBOL(sym, sec) \ |
187 | static const char __kstrtab_##sym[] \ | 188 | static const char __kstrtab_##sym[] \ |
188 | __attribute__((section("__ksymtab_strings"))) \ | 189 | __attribute__((section("__ksymtab_strings"))) \ |
@@ -554,25 +555,6 @@ static inline void module_remove_driver(struct device_driver *driver) | |||
554 | 555 | ||
555 | /* BELOW HERE ALL THESE ARE OBSOLETE AND WILL VANISH */ | 556 | /* BELOW HERE ALL THESE ARE OBSOLETE AND WILL VANISH */ |
556 | 557 | ||
557 | struct obsolete_modparm { | ||
558 | char name[64]; | ||
559 | char type[64-sizeof(void *)]; | ||
560 | void *addr; | ||
561 | }; | ||
562 | |||
563 | static inline void MODULE_PARM_(void) { } | ||
564 | #ifdef MODULE | ||
565 | /* DEPRECATED: Do not use. */ | ||
566 | #define MODULE_PARM(var,type) \ | ||
567 | extern struct obsolete_modparm __parm_##var \ | ||
568 | __attribute__((section("__obsparm"))); \ | ||
569 | struct obsolete_modparm __parm_##var = \ | ||
570 | { __stringify(var), type, &MODULE_PARM_ }; \ | ||
571 | __MODULE_PARM_TYPE(var, type); | ||
572 | #else | ||
573 | #define MODULE_PARM(var,type) static void __attribute__((__unused__)) *__parm_##var = &MODULE_PARM_; | ||
574 | #endif | ||
575 | |||
576 | #define __MODULE_STRING(x) __stringify(x) | 558 | #define __MODULE_STRING(x) __stringify(x) |
577 | 559 | ||
578 | /* Use symbol_get and symbol_put instead. You'll thank me. */ | 560 | /* Use symbol_get and symbol_put instead. You'll thank me. */ |
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h index b5c98c43779e..7c0c2c198f1f 100644 --- a/include/linux/moduleparam.h +++ b/include/linux/moduleparam.h | |||
@@ -162,13 +162,6 @@ extern int param_array_get(char *buffer, struct kernel_param *kp); | |||
162 | extern int param_set_copystring(const char *val, struct kernel_param *kp); | 162 | extern int param_set_copystring(const char *val, struct kernel_param *kp); |
163 | extern int param_get_string(char *buffer, struct kernel_param *kp); | 163 | extern int param_get_string(char *buffer, struct kernel_param *kp); |
164 | 164 | ||
165 | int param_array(const char *name, | ||
166 | const char *val, | ||
167 | unsigned int min, unsigned int max, | ||
168 | void *elem, int elemsize, | ||
169 | int (*set)(const char *, struct kernel_param *kp), | ||
170 | int *num); | ||
171 | |||
172 | /* for exporting parameters in /sys/parameters */ | 165 | /* for exporting parameters in /sys/parameters */ |
173 | 166 | ||
174 | struct module; | 167 | struct module; |
diff --git a/include/linux/msdos_fs.h b/include/linux/msdos_fs.h index e933e2a355ad..d9035c73e5d1 100644 --- a/include/linux/msdos_fs.h +++ b/include/linux/msdos_fs.h | |||
@@ -184,6 +184,7 @@ struct fat_slot_info { | |||
184 | #include <linux/string.h> | 184 | #include <linux/string.h> |
185 | #include <linux/nls.h> | 185 | #include <linux/nls.h> |
186 | #include <linux/fs.h> | 186 | #include <linux/fs.h> |
187 | #include <linux/mutex.h> | ||
187 | 188 | ||
188 | struct fat_mount_options { | 189 | struct fat_mount_options { |
189 | uid_t fs_uid; | 190 | uid_t fs_uid; |
@@ -199,7 +200,7 @@ struct fat_mount_options { | |||
199 | sys_immutable:1, /* set = system files are immutable */ | 200 | sys_immutable:1, /* set = system files are immutable */ |
200 | dotsOK:1, /* set = hidden and system files are named '.filename' */ | 201 | dotsOK:1, /* set = hidden and system files are named '.filename' */ |
201 | isvfat:1, /* 0=no vfat long filename support, 1=vfat support */ | 202 | isvfat:1, /* 0=no vfat long filename support, 1=vfat support */ |
202 | utf8:1, /* Use of UTF8 character set (Default) */ | 203 | utf8:1, /* Use of UTF-8 character set (Default) */ |
203 | unicode_xlate:1, /* create escape sequences for unhandled Unicode */ | 204 | unicode_xlate:1, /* create escape sequences for unhandled Unicode */ |
204 | numtail:1, /* Does first alias have a numeric '~1' type tail? */ | 205 | numtail:1, /* Does first alias have a numeric '~1' type tail? */ |
205 | atari:1, /* Use Atari GEMDOS variation of MS-DOS fs */ | 206 | atari:1, /* Use Atari GEMDOS variation of MS-DOS fs */ |
@@ -226,7 +227,7 @@ struct msdos_sb_info { | |||
226 | unsigned long max_cluster; /* maximum cluster number */ | 227 | unsigned long max_cluster; /* maximum cluster number */ |
227 | unsigned long root_cluster; /* first cluster of the root directory */ | 228 | unsigned long root_cluster; /* first cluster of the root directory */ |
228 | unsigned long fsinfo_sector; /* sector number of FAT32 fsinfo */ | 229 | unsigned long fsinfo_sector; /* sector number of FAT32 fsinfo */ |
229 | struct semaphore fat_lock; | 230 | struct mutex fat_lock; |
230 | unsigned int prev_free; /* previously allocated cluster number */ | 231 | unsigned int prev_free; /* previously allocated cluster number */ |
231 | unsigned int free_clusters; /* -1 if undefined */ | 232 | unsigned int free_clusters; /* -1 if undefined */ |
232 | struct fat_mount_options options; | 233 | struct fat_mount_options options; |
@@ -333,7 +334,7 @@ extern int fat_bmap(struct inode *inode, sector_t sector, sector_t *phys, | |||
333 | unsigned long *mapped_blocks); | 334 | unsigned long *mapped_blocks); |
334 | 335 | ||
335 | /* fat/dir.c */ | 336 | /* fat/dir.c */ |
336 | extern struct file_operations fat_dir_operations; | 337 | extern const struct file_operations fat_dir_operations; |
337 | extern int fat_search_long(struct inode *inode, const unsigned char *name, | 338 | extern int fat_search_long(struct inode *inode, const unsigned char *name, |
338 | int name_len, struct fat_slot_info *sinfo); | 339 | int name_len, struct fat_slot_info *sinfo); |
339 | extern int fat_dir_empty(struct inode *dir); | 340 | extern int fat_dir_empty(struct inode *dir); |
@@ -396,7 +397,7 @@ extern int fat_count_free_clusters(struct super_block *sb); | |||
396 | /* fat/file.c */ | 397 | /* fat/file.c */ |
397 | extern int fat_generic_ioctl(struct inode *inode, struct file *filp, | 398 | extern int fat_generic_ioctl(struct inode *inode, struct file *filp, |
398 | unsigned int cmd, unsigned long arg); | 399 | unsigned int cmd, unsigned long arg); |
399 | extern struct file_operations fat_file_operations; | 400 | extern const struct file_operations fat_file_operations; |
400 | extern struct inode_operations fat_file_inode_operations; | 401 | extern struct inode_operations fat_file_inode_operations; |
401 | extern int fat_notify_change(struct dentry * dentry, struct iattr * attr); | 402 | extern int fat_notify_change(struct dentry * dentry, struct iattr * attr); |
402 | extern void fat_truncate(struct inode *inode); | 403 | extern void fat_truncate(struct inode *inode); |
@@ -419,6 +420,9 @@ extern int date_dos2unix(unsigned short time, unsigned short date); | |||
419 | extern void fat_date_unix2dos(int unix_date, __le16 *time, __le16 *date); | 420 | extern void fat_date_unix2dos(int unix_date, __le16 *time, __le16 *date); |
420 | extern int fat_sync_bhs(struct buffer_head **bhs, int nr_bhs); | 421 | extern int fat_sync_bhs(struct buffer_head **bhs, int nr_bhs); |
421 | 422 | ||
423 | int fat_cache_init(void); | ||
424 | void fat_cache_destroy(void); | ||
425 | |||
422 | #endif /* __KERNEL__ */ | 426 | #endif /* __KERNEL__ */ |
423 | 427 | ||
424 | #endif | 428 | #endif |
diff --git a/include/linux/nbd.h b/include/linux/nbd.h index f95d51fae733..a6ce409ec6fc 100644 --- a/include/linux/nbd.h +++ b/include/linux/nbd.h | |||
@@ -38,6 +38,7 @@ enum { | |||
38 | #ifdef __KERNEL__ | 38 | #ifdef __KERNEL__ |
39 | 39 | ||
40 | #include <linux/wait.h> | 40 | #include <linux/wait.h> |
41 | #include <linux/mutex.h> | ||
41 | 42 | ||
42 | /* values for flags field */ | 43 | /* values for flags field */ |
43 | #define NBD_READ_ONLY 0x0001 | 44 | #define NBD_READ_ONLY 0x0001 |
@@ -57,7 +58,7 @@ struct nbd_device { | |||
57 | struct request *active_req; | 58 | struct request *active_req; |
58 | wait_queue_head_t active_wq; | 59 | wait_queue_head_t active_wq; |
59 | 60 | ||
60 | struct semaphore tx_lock; | 61 | struct mutex tx_lock; |
61 | struct gendisk *disk; | 62 | struct gendisk *disk; |
62 | int blksize; | 63 | int blksize; |
63 | u64 bytesize; | 64 | u64 bytesize; |
diff --git a/include/linux/ncp_fs.h b/include/linux/ncp_fs.h index e01342568530..96dc237b8f03 100644 --- a/include/linux/ncp_fs.h +++ b/include/linux/ncp_fs.h | |||
@@ -209,7 +209,7 @@ void ncp_update_inode2(struct inode *, struct ncp_entry_info *); | |||
209 | 209 | ||
210 | /* linux/fs/ncpfs/dir.c */ | 210 | /* linux/fs/ncpfs/dir.c */ |
211 | extern struct inode_operations ncp_dir_inode_operations; | 211 | extern struct inode_operations ncp_dir_inode_operations; |
212 | extern struct file_operations ncp_dir_operations; | 212 | extern const struct file_operations ncp_dir_operations; |
213 | int ncp_conn_logged_in(struct super_block *); | 213 | int ncp_conn_logged_in(struct super_block *); |
214 | int ncp_date_dos2unix(__le16 time, __le16 date); | 214 | int ncp_date_dos2unix(__le16 time, __le16 date); |
215 | void ncp_date_unix2dos(int unix_date, __le16 * time, __le16 * date); | 215 | void ncp_date_unix2dos(int unix_date, __le16 * time, __le16 * date); |
@@ -230,7 +230,7 @@ void ncp_unlock_server(struct ncp_server *server); | |||
230 | 230 | ||
231 | /* linux/fs/ncpfs/file.c */ | 231 | /* linux/fs/ncpfs/file.c */ |
232 | extern struct inode_operations ncp_file_inode_operations; | 232 | extern struct inode_operations ncp_file_inode_operations; |
233 | extern struct file_operations ncp_file_operations; | 233 | extern const struct file_operations ncp_file_operations; |
234 | int ncp_make_open(struct inode *, int); | 234 | int ncp_make_open(struct inode *, int); |
235 | 235 | ||
236 | /* linux/fs/ncpfs/mmap.c */ | 236 | /* linux/fs/ncpfs/mmap.c */ |
diff --git a/include/linux/ncp_fs_i.h b/include/linux/ncp_fs_i.h index 415be1ec6f98..bdb4c8ae6924 100644 --- a/include/linux/ncp_fs_i.h +++ b/include/linux/ncp_fs_i.h | |||
@@ -19,7 +19,7 @@ struct ncp_inode_info { | |||
19 | __le32 DosDirNum; | 19 | __le32 DosDirNum; |
20 | __u8 volNumber; | 20 | __u8 volNumber; |
21 | __le32 nwattr; | 21 | __le32 nwattr; |
22 | struct semaphore open_sem; | 22 | struct mutex open_mutex; |
23 | atomic_t opened; | 23 | atomic_t opened; |
24 | int access; | 24 | int access; |
25 | int flags; | 25 | int flags; |
diff --git a/include/linux/ncp_fs_sb.h b/include/linux/ncp_fs_sb.h index cf858eb80f0b..b089d9506283 100644 --- a/include/linux/ncp_fs_sb.h +++ b/include/linux/ncp_fs_sb.h | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/types.h> | 11 | #include <linux/types.h> |
12 | #include <linux/ncp_mount.h> | 12 | #include <linux/ncp_mount.h> |
13 | #include <linux/net.h> | 13 | #include <linux/net.h> |
14 | #include <linux/mutex.h> | ||
14 | 15 | ||
15 | #ifdef __KERNEL__ | 16 | #ifdef __KERNEL__ |
16 | 17 | ||
@@ -51,7 +52,7 @@ struct ncp_server { | |||
51 | receive replies */ | 52 | receive replies */ |
52 | 53 | ||
53 | int lock; /* To prevent mismatch in protocols. */ | 54 | int lock; /* To prevent mismatch in protocols. */ |
54 | struct semaphore sem; | 55 | struct mutex mutex; |
55 | 56 | ||
56 | int current_size; /* for packet preparation */ | 57 | int current_size; /* for packet preparation */ |
57 | int has_subfunction; | 58 | int has_subfunction; |
@@ -96,7 +97,7 @@ struct ncp_server { | |||
96 | struct { | 97 | struct { |
97 | struct work_struct tq; /* STREAM/DGRAM: data/error ready */ | 98 | struct work_struct tq; /* STREAM/DGRAM: data/error ready */ |
98 | struct ncp_request_reply* creq; /* STREAM/DGRAM: awaiting reply from this request */ | 99 | struct ncp_request_reply* creq; /* STREAM/DGRAM: awaiting reply from this request */ |
99 | struct semaphore creq_sem; /* DGRAM only: lock accesses to rcv.creq */ | 100 | struct mutex creq_mutex; /* DGRAM only: lock accesses to rcv.creq */ |
100 | 101 | ||
101 | unsigned int state; /* STREAM only: receiver state */ | 102 | unsigned int state; /* STREAM only: receiver state */ |
102 | struct { | 103 | struct { |
diff --git a/include/linux/net.h b/include/linux/net.h index 152fa6551fd8..84a490e5f0a1 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
@@ -143,6 +143,8 @@ struct proto_ops { | |||
143 | struct poll_table_struct *wait); | 143 | struct poll_table_struct *wait); |
144 | int (*ioctl) (struct socket *sock, unsigned int cmd, | 144 | int (*ioctl) (struct socket *sock, unsigned int cmd, |
145 | unsigned long arg); | 145 | unsigned long arg); |
146 | int (*compat_ioctl) (struct socket *sock, unsigned int cmd, | ||
147 | unsigned long arg); | ||
146 | int (*listen) (struct socket *sock, int len); | 148 | int (*listen) (struct socket *sock, int len); |
147 | int (*shutdown) (struct socket *sock, int flags); | 149 | int (*shutdown) (struct socket *sock, int flags); |
148 | int (*setsockopt)(struct socket *sock, int level, | 150 | int (*setsockopt)(struct socket *sock, int level, |
@@ -251,6 +253,8 @@ SOCKCALL_UWRAP(name, poll, (struct file *file, struct socket *sock, struct poll_ | |||
251 | (file, sock, wait)) \ | 253 | (file, sock, wait)) \ |
252 | SOCKCALL_WRAP(name, ioctl, (struct socket *sock, unsigned int cmd, \ | 254 | SOCKCALL_WRAP(name, ioctl, (struct socket *sock, unsigned int cmd, \ |
253 | unsigned long arg), (sock, cmd, arg)) \ | 255 | unsigned long arg), (sock, cmd, arg)) \ |
256 | SOCKCALL_WRAP(name, compat_ioctl, (struct socket *sock, unsigned int cmd, \ | ||
257 | unsigned long arg), (sock, cmd, arg)) \ | ||
254 | SOCKCALL_WRAP(name, listen, (struct socket *sock, int len), (sock, len)) \ | 258 | SOCKCALL_WRAP(name, listen, (struct socket *sock, int len), (sock, len)) \ |
255 | SOCKCALL_WRAP(name, shutdown, (struct socket *sock, int flags), (sock, flags)) \ | 259 | SOCKCALL_WRAP(name, shutdown, (struct socket *sock, int flags), (sock, flags)) \ |
256 | SOCKCALL_WRAP(name, setsockopt, (struct socket *sock, int level, int optname, \ | 260 | SOCKCALL_WRAP(name, setsockopt, (struct socket *sock, int level, int optname, \ |
@@ -275,6 +279,7 @@ static const struct proto_ops name##_ops = { \ | |||
275 | .getname = __lock_##name##_getname, \ | 279 | .getname = __lock_##name##_getname, \ |
276 | .poll = __lock_##name##_poll, \ | 280 | .poll = __lock_##name##_poll, \ |
277 | .ioctl = __lock_##name##_ioctl, \ | 281 | .ioctl = __lock_##name##_ioctl, \ |
282 | .compat_ioctl = __lock_##name##_compat_ioctl, \ | ||
278 | .listen = __lock_##name##_listen, \ | 283 | .listen = __lock_##name##_listen, \ |
279 | .shutdown = __lock_##name##_shutdown, \ | 284 | .shutdown = __lock_##name##_shutdown, \ |
280 | .setsockopt = __lock_##name##_setsockopt, \ | 285 | .setsockopt = __lock_##name##_setsockopt, \ |
@@ -283,6 +288,7 @@ static const struct proto_ops name##_ops = { \ | |||
283 | .recvmsg = __lock_##name##_recvmsg, \ | 288 | .recvmsg = __lock_##name##_recvmsg, \ |
284 | .mmap = __lock_##name##_mmap, \ | 289 | .mmap = __lock_##name##_mmap, \ |
285 | }; | 290 | }; |
291 | |||
286 | #endif | 292 | #endif |
287 | 293 | ||
288 | #define MODULE_ALIAS_NETPROTO(proto) \ | 294 | #define MODULE_ALIAS_NETPROTO(proto) \ |
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index 46a0f974f87c..1350e47b0234 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h | |||
@@ -4,6 +4,62 @@ | |||
4 | #define XT_FUNCTION_MAXNAMELEN 30 | 4 | #define XT_FUNCTION_MAXNAMELEN 30 |
5 | #define XT_TABLE_MAXNAMELEN 32 | 5 | #define XT_TABLE_MAXNAMELEN 32 |
6 | 6 | ||
7 | struct xt_entry_match | ||
8 | { | ||
9 | union { | ||
10 | struct { | ||
11 | u_int16_t match_size; | ||
12 | |||
13 | /* Used by userspace */ | ||
14 | char name[XT_FUNCTION_MAXNAMELEN-1]; | ||
15 | |||
16 | u_int8_t revision; | ||
17 | } user; | ||
18 | struct { | ||
19 | u_int16_t match_size; | ||
20 | |||
21 | /* Used inside the kernel */ | ||
22 | struct xt_match *match; | ||
23 | } kernel; | ||
24 | |||
25 | /* Total length */ | ||
26 | u_int16_t match_size; | ||
27 | } u; | ||
28 | |||
29 | unsigned char data[0]; | ||
30 | }; | ||
31 | |||
32 | struct xt_entry_target | ||
33 | { | ||
34 | union { | ||
35 | struct { | ||
36 | u_int16_t target_size; | ||
37 | |||
38 | /* Used by userspace */ | ||
39 | char name[XT_FUNCTION_MAXNAMELEN-1]; | ||
40 | |||
41 | u_int8_t revision; | ||
42 | } user; | ||
43 | struct { | ||
44 | u_int16_t target_size; | ||
45 | |||
46 | /* Used inside the kernel */ | ||
47 | struct xt_target *target; | ||
48 | } kernel; | ||
49 | |||
50 | /* Total length */ | ||
51 | u_int16_t target_size; | ||
52 | } u; | ||
53 | |||
54 | unsigned char data[0]; | ||
55 | }; | ||
56 | |||
57 | struct xt_standard_target | ||
58 | { | ||
59 | struct xt_entry_target target; | ||
60 | int verdict; | ||
61 | }; | ||
62 | |||
7 | /* The argument to IPT_SO_GET_REVISION_*. Returns highest revision | 63 | /* The argument to IPT_SO_GET_REVISION_*. Returns highest revision |
8 | * kernel supports, if >= revision. */ | 64 | * kernel supports, if >= revision. */ |
9 | struct xt_get_revision | 65 | struct xt_get_revision |
@@ -220,10 +276,10 @@ struct xt_table_info | |||
220 | char *entries[NR_CPUS]; | 276 | char *entries[NR_CPUS]; |
221 | }; | 277 | }; |
222 | 278 | ||
223 | extern int xt_register_target(int af, struct xt_target *target); | 279 | extern int xt_register_target(struct xt_target *target); |
224 | extern void xt_unregister_target(int af, struct xt_target *target); | 280 | extern void xt_unregister_target(struct xt_target *target); |
225 | extern int xt_register_match(int af, struct xt_match *target); | 281 | extern int xt_register_match(struct xt_match *target); |
226 | extern void xt_unregister_match(int af, struct xt_match *target); | 282 | extern void xt_unregister_match(struct xt_match *target); |
227 | 283 | ||
228 | extern int xt_check_match(const struct xt_match *match, unsigned short family, | 284 | extern int xt_check_match(const struct xt_match *match, unsigned short family, |
229 | unsigned int size, const char *table, unsigned int hook, | 285 | unsigned int size, const char *table, unsigned int hook, |
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h index fd21796e5131..62cc27daca4e 100644 --- a/include/linux/netfilter_arp/arp_tables.h +++ b/include/linux/netfilter_arp/arp_tables.h | |||
@@ -65,35 +65,8 @@ struct arpt_arp { | |||
65 | u_int16_t invflags; | 65 | u_int16_t invflags; |
66 | }; | 66 | }; |
67 | 67 | ||
68 | struct arpt_entry_target | 68 | #define arpt_entry_target xt_entry_target |
69 | { | 69 | #define arpt_standard_target xt_standard_target |
70 | union { | ||
71 | struct { | ||
72 | u_int16_t target_size; | ||
73 | |||
74 | /* Used by userspace */ | ||
75 | char name[ARPT_FUNCTION_MAXNAMELEN-1]; | ||
76 | u_int8_t revision; | ||
77 | } user; | ||
78 | struct { | ||
79 | u_int16_t target_size; | ||
80 | |||
81 | /* Used inside the kernel */ | ||
82 | struct arpt_target *target; | ||
83 | } kernel; | ||
84 | |||
85 | /* Total length */ | ||
86 | u_int16_t target_size; | ||
87 | } u; | ||
88 | |||
89 | unsigned char data[0]; | ||
90 | }; | ||
91 | |||
92 | struct arpt_standard_target | ||
93 | { | ||
94 | struct arpt_entry_target target; | ||
95 | int verdict; | ||
96 | }; | ||
97 | 70 | ||
98 | /* Values for "flag" field in struct arpt_ip (general arp structure). | 71 | /* Values for "flag" field in struct arpt_ip (general arp structure). |
99 | * No flags defined yet. | 72 | * No flags defined yet. |
@@ -263,8 +236,10 @@ static __inline__ struct arpt_entry_target *arpt_get_target(struct arpt_entry *e | |||
263 | */ | 236 | */ |
264 | #ifdef __KERNEL__ | 237 | #ifdef __KERNEL__ |
265 | 238 | ||
266 | #define arpt_register_target(tgt) xt_register_target(NF_ARP, tgt) | 239 | #define arpt_register_target(tgt) \ |
267 | #define arpt_unregister_target(tgt) xt_unregister_target(NF_ARP, tgt) | 240 | ({ (tgt)->family = NF_ARP; \ |
241 | xt_register_target(tgt); }) | ||
242 | #define arpt_unregister_target(tgt) xt_unregister_target(tgt) | ||
268 | 243 | ||
269 | extern int arpt_register_table(struct arpt_table *table, | 244 | extern int arpt_register_table(struct arpt_table *table, |
270 | const struct arpt_replace *repl); | 245 | const struct arpt_replace *repl); |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h index f32d75c4f4cf..d54d7b278e96 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack.h +++ b/include/linux/netfilter_ipv4/ip_conntrack.h | |||
@@ -308,29 +308,30 @@ DECLARE_PER_CPU(struct ip_conntrack_ecache, ip_conntrack_ecache); | |||
308 | 308 | ||
309 | #define CONNTRACK_ECACHE(x) (__get_cpu_var(ip_conntrack_ecache).x) | 309 | #define CONNTRACK_ECACHE(x) (__get_cpu_var(ip_conntrack_ecache).x) |
310 | 310 | ||
311 | extern struct notifier_block *ip_conntrack_chain; | 311 | extern struct atomic_notifier_head ip_conntrack_chain; |
312 | extern struct notifier_block *ip_conntrack_expect_chain; | 312 | extern struct atomic_notifier_head ip_conntrack_expect_chain; |
313 | 313 | ||
314 | static inline int ip_conntrack_register_notifier(struct notifier_block *nb) | 314 | static inline int ip_conntrack_register_notifier(struct notifier_block *nb) |
315 | { | 315 | { |
316 | return notifier_chain_register(&ip_conntrack_chain, nb); | 316 | return atomic_notifier_chain_register(&ip_conntrack_chain, nb); |
317 | } | 317 | } |
318 | 318 | ||
319 | static inline int ip_conntrack_unregister_notifier(struct notifier_block *nb) | 319 | static inline int ip_conntrack_unregister_notifier(struct notifier_block *nb) |
320 | { | 320 | { |
321 | return notifier_chain_unregister(&ip_conntrack_chain, nb); | 321 | return atomic_notifier_chain_unregister(&ip_conntrack_chain, nb); |
322 | } | 322 | } |
323 | 323 | ||
324 | static inline int | 324 | static inline int |
325 | ip_conntrack_expect_register_notifier(struct notifier_block *nb) | 325 | ip_conntrack_expect_register_notifier(struct notifier_block *nb) |
326 | { | 326 | { |
327 | return notifier_chain_register(&ip_conntrack_expect_chain, nb); | 327 | return atomic_notifier_chain_register(&ip_conntrack_expect_chain, nb); |
328 | } | 328 | } |
329 | 329 | ||
330 | static inline int | 330 | static inline int |
331 | ip_conntrack_expect_unregister_notifier(struct notifier_block *nb) | 331 | ip_conntrack_expect_unregister_notifier(struct notifier_block *nb) |
332 | { | 332 | { |
333 | return notifier_chain_unregister(&ip_conntrack_expect_chain, nb); | 333 | return atomic_notifier_chain_unregister(&ip_conntrack_expect_chain, |
334 | nb); | ||
334 | } | 335 | } |
335 | 336 | ||
336 | extern void ip_ct_deliver_cached_events(const struct ip_conntrack *ct); | 337 | extern void ip_ct_deliver_cached_events(const struct ip_conntrack *ct); |
@@ -355,14 +356,14 @@ static inline void ip_conntrack_event(enum ip_conntrack_events event, | |||
355 | struct ip_conntrack *ct) | 356 | struct ip_conntrack *ct) |
356 | { | 357 | { |
357 | if (is_confirmed(ct) && !is_dying(ct)) | 358 | if (is_confirmed(ct) && !is_dying(ct)) |
358 | notifier_call_chain(&ip_conntrack_chain, event, ct); | 359 | atomic_notifier_call_chain(&ip_conntrack_chain, event, ct); |
359 | } | 360 | } |
360 | 361 | ||
361 | static inline void | 362 | static inline void |
362 | ip_conntrack_expect_event(enum ip_conntrack_expect_events event, | 363 | ip_conntrack_expect_event(enum ip_conntrack_expect_events event, |
363 | struct ip_conntrack_expect *exp) | 364 | struct ip_conntrack_expect *exp) |
364 | { | 365 | { |
365 | notifier_call_chain(&ip_conntrack_expect_chain, event, exp); | 366 | atomic_notifier_call_chain(&ip_conntrack_expect_chain, event, exp); |
366 | } | 367 | } |
367 | #else /* CONFIG_IP_NF_CONNTRACK_EVENTS */ | 368 | #else /* CONFIG_IP_NF_CONNTRACK_EVENTS */ |
368 | static inline void ip_conntrack_event_cache(enum ip_conntrack_events event, | 369 | static inline void ip_conntrack_event_cache(enum ip_conntrack_events event, |
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h index 76ba24b68515..d5b8c0d6a12b 100644 --- a/include/linux/netfilter_ipv4/ip_tables.h +++ b/include/linux/netfilter_ipv4/ip_tables.h | |||
@@ -52,61 +52,9 @@ struct ipt_ip { | |||
52 | u_int8_t invflags; | 52 | u_int8_t invflags; |
53 | }; | 53 | }; |
54 | 54 | ||
55 | struct ipt_entry_match | 55 | #define ipt_entry_match xt_entry_match |
56 | { | 56 | #define ipt_entry_target xt_entry_target |
57 | union { | 57 | #define ipt_standard_target xt_standard_target |
58 | struct { | ||
59 | u_int16_t match_size; | ||
60 | |||
61 | /* Used by userspace */ | ||
62 | char name[IPT_FUNCTION_MAXNAMELEN-1]; | ||
63 | |||
64 | u_int8_t revision; | ||
65 | } user; | ||
66 | struct { | ||
67 | u_int16_t match_size; | ||
68 | |||
69 | /* Used inside the kernel */ | ||
70 | struct ipt_match *match; | ||
71 | } kernel; | ||
72 | |||
73 | /* Total length */ | ||
74 | u_int16_t match_size; | ||
75 | } u; | ||
76 | |||
77 | unsigned char data[0]; | ||
78 | }; | ||
79 | |||
80 | struct ipt_entry_target | ||
81 | { | ||
82 | union { | ||
83 | struct { | ||
84 | u_int16_t target_size; | ||
85 | |||
86 | /* Used by userspace */ | ||
87 | char name[IPT_FUNCTION_MAXNAMELEN-1]; | ||
88 | |||
89 | u_int8_t revision; | ||
90 | } user; | ||
91 | struct { | ||
92 | u_int16_t target_size; | ||
93 | |||
94 | /* Used inside the kernel */ | ||
95 | struct ipt_target *target; | ||
96 | } kernel; | ||
97 | |||
98 | /* Total length */ | ||
99 | u_int16_t target_size; | ||
100 | } u; | ||
101 | |||
102 | unsigned char data[0]; | ||
103 | }; | ||
104 | |||
105 | struct ipt_standard_target | ||
106 | { | ||
107 | struct ipt_entry_target target; | ||
108 | int verdict; | ||
109 | }; | ||
110 | 58 | ||
111 | #define ipt_counters xt_counters | 59 | #define ipt_counters xt_counters |
112 | 60 | ||
@@ -321,11 +269,15 @@ ipt_get_target(struct ipt_entry *e) | |||
321 | #include <linux/init.h> | 269 | #include <linux/init.h> |
322 | extern void ipt_init(void) __init; | 270 | extern void ipt_init(void) __init; |
323 | 271 | ||
324 | #define ipt_register_target(tgt) xt_register_target(AF_INET, tgt) | 272 | #define ipt_register_target(tgt) \ |
325 | #define ipt_unregister_target(tgt) xt_unregister_target(AF_INET, tgt) | 273 | ({ (tgt)->family = AF_INET; \ |
274 | xt_register_target(tgt); }) | ||
275 | #define ipt_unregister_target(tgt) xt_unregister_target(tgt) | ||
326 | 276 | ||
327 | #define ipt_register_match(mtch) xt_register_match(AF_INET, mtch) | 277 | #define ipt_register_match(mtch) \ |
328 | #define ipt_unregister_match(mtch) xt_unregister_match(AF_INET, mtch) | 278 | ({ (mtch)->family = AF_INET; \ |
279 | xt_register_match(mtch); }) | ||
280 | #define ipt_unregister_match(mtch) xt_unregister_match(mtch) | ||
329 | 281 | ||
330 | //#define ipt_register_table(tbl, repl) xt_register_table(AF_INET, tbl, repl) | 282 | //#define ipt_register_table(tbl, repl) xt_register_table(AF_INET, tbl, repl) |
331 | //#define ipt_unregister_table(tbl) xt_unregister_table(AF_INET, tbl) | 283 | //#define ipt_unregister_table(tbl) xt_unregister_table(AF_INET, tbl) |
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h index f249b574f0fa..d0d5d1ee4be3 100644 --- a/include/linux/netfilter_ipv6/ip6_tables.h +++ b/include/linux/netfilter_ipv6/ip6_tables.h | |||
@@ -56,60 +56,9 @@ struct ip6t_ip6 { | |||
56 | u_int8_t invflags; | 56 | u_int8_t invflags; |
57 | }; | 57 | }; |
58 | 58 | ||
59 | /* FIXME: If alignment in kernel different from userspace? --RR */ | 59 | #define ip6t_entry_match xt_entry_match |
60 | struct ip6t_entry_match | 60 | #define ip6t_entry_target xt_entry_target |
61 | { | 61 | #define ip6t_standard_target xt_standard_target |
62 | union { | ||
63 | struct { | ||
64 | u_int16_t match_size; | ||
65 | |||
66 | /* Used by userspace */ | ||
67 | char name[IP6T_FUNCTION_MAXNAMELEN-1]; | ||
68 | u_int8_t revision; | ||
69 | } user; | ||
70 | struct { | ||
71 | u_int16_t match_size; | ||
72 | |||
73 | /* Used inside the kernel */ | ||
74 | struct ip6t_match *match; | ||
75 | } kernel; | ||
76 | |||
77 | /* Total length */ | ||
78 | u_int16_t match_size; | ||
79 | } u; | ||
80 | |||
81 | unsigned char data[0]; | ||
82 | }; | ||
83 | |||
84 | struct ip6t_entry_target | ||
85 | { | ||
86 | union { | ||
87 | struct { | ||
88 | u_int16_t target_size; | ||
89 | |||
90 | /* Used by userspace */ | ||
91 | char name[IP6T_FUNCTION_MAXNAMELEN-1]; | ||
92 | u_int8_t revision; | ||
93 | } user; | ||
94 | struct { | ||
95 | u_int16_t target_size; | ||
96 | |||
97 | /* Used inside the kernel */ | ||
98 | struct ip6t_target *target; | ||
99 | } kernel; | ||
100 | |||
101 | /* Total length */ | ||
102 | u_int16_t target_size; | ||
103 | } u; | ||
104 | |||
105 | unsigned char data[0]; | ||
106 | }; | ||
107 | |||
108 | struct ip6t_standard_target | ||
109 | { | ||
110 | struct ip6t_entry_target target; | ||
111 | int verdict; | ||
112 | }; | ||
113 | 62 | ||
114 | #define ip6t_counters xt_counters | 63 | #define ip6t_counters xt_counters |
115 | 64 | ||
@@ -334,11 +283,15 @@ ip6t_get_target(struct ip6t_entry *e) | |||
334 | #include <linux/init.h> | 283 | #include <linux/init.h> |
335 | extern void ip6t_init(void) __init; | 284 | extern void ip6t_init(void) __init; |
336 | 285 | ||
337 | #define ip6t_register_target(tgt) xt_register_target(AF_INET6, tgt) | 286 | #define ip6t_register_target(tgt) \ |
338 | #define ip6t_unregister_target(tgt) xt_unregister_target(AF_INET6, tgt) | 287 | ({ (tgt)->family = AF_INET6; \ |
288 | xt_register_target(tgt); }) | ||
289 | #define ip6t_unregister_target(tgt) xt_unregister_target(tgt) | ||
339 | 290 | ||
340 | #define ip6t_register_match(match) xt_register_match(AF_INET6, match) | 291 | #define ip6t_register_match(match) \ |
341 | #define ip6t_unregister_match(match) xt_unregister_match(AF_INET6, match) | 292 | ({ (match)->family = AF_INET6; \ |
293 | xt_register_match(match); }) | ||
294 | #define ip6t_unregister_match(match) xt_unregister_match(match) | ||
342 | 295 | ||
343 | extern int ip6t_register_table(struct ip6t_table *table, | 296 | extern int ip6t_register_table(struct ip6t_table *table, |
344 | const struct ip6t_replace *repl); | 297 | const struct ip6t_replace *repl); |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index b4dc6e2e10c9..c71227dd4389 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -56,9 +56,7 @@ | |||
56 | * When flushing a cluster of dirty pages, there can be different | 56 | * When flushing a cluster of dirty pages, there can be different |
57 | * strategies: | 57 | * strategies: |
58 | */ | 58 | */ |
59 | #define FLUSH_AGING 0 /* only flush old buffers */ | ||
60 | #define FLUSH_SYNC 1 /* file being synced, or contention */ | 59 | #define FLUSH_SYNC 1 /* file being synced, or contention */ |
61 | #define FLUSH_WAIT 2 /* wait for completion */ | ||
62 | #define FLUSH_STABLE 4 /* commit to stable storage */ | 60 | #define FLUSH_STABLE 4 /* commit to stable storage */ |
63 | #define FLUSH_LOWPRI 8 /* low priority background flush */ | 61 | #define FLUSH_LOWPRI 8 /* low priority background flush */ |
64 | #define FLUSH_HIGHPRI 16 /* high priority memory reclaim flush */ | 62 | #define FLUSH_HIGHPRI 16 /* high priority memory reclaim flush */ |
@@ -78,6 +76,7 @@ struct nfs_access_entry { | |||
78 | struct nfs4_state; | 76 | struct nfs4_state; |
79 | struct nfs_open_context { | 77 | struct nfs_open_context { |
80 | atomic_t count; | 78 | atomic_t count; |
79 | struct vfsmount *vfsmnt; | ||
81 | struct dentry *dentry; | 80 | struct dentry *dentry; |
82 | struct rpc_cred *cred; | 81 | struct rpc_cred *cred; |
83 | struct nfs4_state *state; | 82 | struct nfs4_state *state; |
@@ -118,8 +117,7 @@ struct nfs_inode { | |||
118 | unsigned long cache_validity; /* bit mask */ | 117 | unsigned long cache_validity; /* bit mask */ |
119 | 118 | ||
120 | /* | 119 | /* |
121 | * read_cache_jiffies is when we started read-caching this inode, | 120 | * read_cache_jiffies is when we started read-caching this inode. |
122 | * and read_cache_mtime is the mtime of the inode at that time. | ||
123 | * attrtimeo is for how long the cached information is assumed | 121 | * attrtimeo is for how long the cached information is assumed |
124 | * to be valid. A successful attribute revalidation doubles | 122 | * to be valid. A successful attribute revalidation doubles |
125 | * attrtimeo (up to acregmax/acdirmax), a failure resets it to | 123 | * attrtimeo (up to acregmax/acdirmax), a failure resets it to |
@@ -128,11 +126,6 @@ struct nfs_inode { | |||
128 | * We need to revalidate the cached attrs for this inode if | 126 | * We need to revalidate the cached attrs for this inode if |
129 | * | 127 | * |
130 | * jiffies - read_cache_jiffies > attrtimeo | 128 | * jiffies - read_cache_jiffies > attrtimeo |
131 | * | ||
132 | * and invalidate any cached data/flush out any dirty pages if | ||
133 | * we find that | ||
134 | * | ||
135 | * mtime != read_cache_mtime | ||
136 | */ | 129 | */ |
137 | unsigned long read_cache_jiffies; | 130 | unsigned long read_cache_jiffies; |
138 | unsigned long attrtimeo; | 131 | unsigned long attrtimeo; |
@@ -311,12 +304,9 @@ extern void nfs_begin_attr_update(struct inode *); | |||
311 | extern void nfs_end_attr_update(struct inode *); | 304 | extern void nfs_end_attr_update(struct inode *); |
312 | extern void nfs_begin_data_update(struct inode *); | 305 | extern void nfs_begin_data_update(struct inode *); |
313 | extern void nfs_end_data_update(struct inode *); | 306 | extern void nfs_end_data_update(struct inode *); |
314 | extern struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry, struct rpc_cred *cred); | ||
315 | extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx); | 307 | extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx); |
316 | extern void put_nfs_open_context(struct nfs_open_context *ctx); | 308 | extern void put_nfs_open_context(struct nfs_open_context *ctx); |
317 | extern void nfs_file_set_open_context(struct file *filp, struct nfs_open_context *ctx); | ||
318 | extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, int mode); | 309 | extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, int mode); |
319 | extern void nfs_file_clear_open_context(struct file *filp); | ||
320 | 310 | ||
321 | /* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */ | 311 | /* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */ |
322 | extern u32 root_nfs_parse_addr(char *name); /*__init*/ | 312 | extern u32 root_nfs_parse_addr(char *name); /*__init*/ |
@@ -334,7 +324,7 @@ extern struct inode_operations nfs_file_inode_operations; | |||
334 | #ifdef CONFIG_NFS_V3 | 324 | #ifdef CONFIG_NFS_V3 |
335 | extern struct inode_operations nfs3_file_inode_operations; | 325 | extern struct inode_operations nfs3_file_inode_operations; |
336 | #endif /* CONFIG_NFS_V3 */ | 326 | #endif /* CONFIG_NFS_V3 */ |
337 | extern struct file_operations nfs_file_operations; | 327 | extern const struct file_operations nfs_file_operations; |
338 | extern struct address_space_operations nfs_file_aops; | 328 | extern struct address_space_operations nfs_file_aops; |
339 | 329 | ||
340 | static inline struct rpc_cred *nfs_file_cred(struct file *file) | 330 | static inline struct rpc_cred *nfs_file_cred(struct file *file) |
@@ -381,7 +371,7 @@ extern struct inode_operations nfs_dir_inode_operations; | |||
381 | #ifdef CONFIG_NFS_V3 | 371 | #ifdef CONFIG_NFS_V3 |
382 | extern struct inode_operations nfs3_dir_inode_operations; | 372 | extern struct inode_operations nfs3_dir_inode_operations; |
383 | #endif /* CONFIG_NFS_V3 */ | 373 | #endif /* CONFIG_NFS_V3 */ |
384 | extern struct file_operations nfs_dir_operations; | 374 | extern const struct file_operations nfs_dir_operations; |
385 | extern struct dentry_operations nfs_dentry_operations; | 375 | extern struct dentry_operations nfs_dentry_operations; |
386 | 376 | ||
387 | extern int nfs_instantiate(struct dentry *dentry, struct nfs_fh *fh, struct nfs_fattr *fattr); | 377 | extern int nfs_instantiate(struct dentry *dentry, struct nfs_fh *fh, struct nfs_fattr *fattr); |
@@ -415,21 +405,22 @@ extern int nfs_writepage(struct page *page, struct writeback_control *wbc); | |||
415 | extern int nfs_writepages(struct address_space *, struct writeback_control *); | 405 | extern int nfs_writepages(struct address_space *, struct writeback_control *); |
416 | extern int nfs_flush_incompatible(struct file *file, struct page *page); | 406 | extern int nfs_flush_incompatible(struct file *file, struct page *page); |
417 | extern int nfs_updatepage(struct file *, struct page *, unsigned int, unsigned int); | 407 | extern int nfs_updatepage(struct file *, struct page *, unsigned int, unsigned int); |
418 | extern void nfs_writeback_done(struct rpc_task *task, void *data); | 408 | extern int nfs_writeback_done(struct rpc_task *, struct nfs_write_data *); |
419 | extern void nfs_writedata_release(void *data); | 409 | extern void nfs_writedata_release(void *); |
420 | 410 | ||
421 | #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) | 411 | #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) |
422 | extern void nfs_commit_done(struct rpc_task *, void *data); | 412 | struct nfs_write_data *nfs_commit_alloc(unsigned int pagecount); |
423 | extern void nfs_commit_release(void *data); | 413 | void nfs_commit_free(struct nfs_write_data *p); |
424 | #endif | 414 | #endif |
425 | 415 | ||
426 | /* | 416 | /* |
427 | * Try to write back everything synchronously (but check the | 417 | * Try to write back everything synchronously (but check the |
428 | * return value!) | 418 | * return value!) |
429 | */ | 419 | */ |
430 | extern int nfs_sync_inode(struct inode *, unsigned long, unsigned int, int); | 420 | extern int nfs_sync_inode_wait(struct inode *, unsigned long, unsigned int, int); |
431 | #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) | 421 | #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) |
432 | extern int nfs_commit_inode(struct inode *, int); | 422 | extern int nfs_commit_inode(struct inode *, int); |
423 | extern void nfs_commit_release(void *wdata); | ||
433 | #else | 424 | #else |
434 | static inline int | 425 | static inline int |
435 | nfs_commit_inode(struct inode *inode, int how) | 426 | nfs_commit_inode(struct inode *inode, int how) |
@@ -447,7 +438,7 @@ nfs_have_writebacks(struct inode *inode) | |||
447 | static inline int | 438 | static inline int |
448 | nfs_wb_all(struct inode *inode) | 439 | nfs_wb_all(struct inode *inode) |
449 | { | 440 | { |
450 | int error = nfs_sync_inode(inode, 0, 0, FLUSH_WAIT); | 441 | int error = nfs_sync_inode_wait(inode, 0, 0, 0); |
451 | return (error < 0) ? error : 0; | 442 | return (error < 0) ? error : 0; |
452 | } | 443 | } |
453 | 444 | ||
@@ -456,8 +447,8 @@ nfs_wb_all(struct inode *inode) | |||
456 | */ | 447 | */ |
457 | static inline int nfs_wb_page_priority(struct inode *inode, struct page* page, int how) | 448 | static inline int nfs_wb_page_priority(struct inode *inode, struct page* page, int how) |
458 | { | 449 | { |
459 | int error = nfs_sync_inode(inode, page->index, 1, | 450 | int error = nfs_sync_inode_wait(inode, page->index, 1, |
460 | how | FLUSH_WAIT | FLUSH_STABLE); | 451 | how | FLUSH_STABLE); |
461 | return (error < 0) ? error : 0; | 452 | return (error < 0) ? error : 0; |
462 | } | 453 | } |
463 | 454 | ||
@@ -469,37 +460,8 @@ static inline int nfs_wb_page(struct inode *inode, struct page* page) | |||
469 | /* | 460 | /* |
470 | * Allocate and free nfs_write_data structures | 461 | * Allocate and free nfs_write_data structures |
471 | */ | 462 | */ |
472 | extern mempool_t *nfs_wdata_mempool; | 463 | extern struct nfs_write_data *nfs_writedata_alloc(unsigned int pagecount); |
473 | 464 | extern void nfs_writedata_free(struct nfs_write_data *p); | |
474 | static inline struct nfs_write_data *nfs_writedata_alloc(unsigned int pagecount) | ||
475 | { | ||
476 | struct nfs_write_data *p = mempool_alloc(nfs_wdata_mempool, SLAB_NOFS); | ||
477 | |||
478 | if (p) { | ||
479 | memset(p, 0, sizeof(*p)); | ||
480 | INIT_LIST_HEAD(&p->pages); | ||
481 | if (pagecount < NFS_PAGEVEC_SIZE) | ||
482 | p->pagevec = &p->page_array[0]; | ||
483 | else { | ||
484 | size_t size = ++pagecount * sizeof(struct page *); | ||
485 | p->pagevec = kmalloc(size, GFP_NOFS); | ||
486 | if (p->pagevec) { | ||
487 | memset(p->pagevec, 0, size); | ||
488 | } else { | ||
489 | mempool_free(p, nfs_wdata_mempool); | ||
490 | p = NULL; | ||
491 | } | ||
492 | } | ||
493 | } | ||
494 | return p; | ||
495 | } | ||
496 | |||
497 | static inline void nfs_writedata_free(struct nfs_write_data *p) | ||
498 | { | ||
499 | if (p && (p->pagevec != &p->page_array[0])) | ||
500 | kfree(p->pagevec); | ||
501 | mempool_free(p, nfs_wdata_mempool); | ||
502 | } | ||
503 | 465 | ||
504 | /* | 466 | /* |
505 | * linux/fs/nfs/read.c | 467 | * linux/fs/nfs/read.c |
@@ -507,44 +469,14 @@ static inline void nfs_writedata_free(struct nfs_write_data *p) | |||
507 | extern int nfs_readpage(struct file *, struct page *); | 469 | extern int nfs_readpage(struct file *, struct page *); |
508 | extern int nfs_readpages(struct file *, struct address_space *, | 470 | extern int nfs_readpages(struct file *, struct address_space *, |
509 | struct list_head *, unsigned); | 471 | struct list_head *, unsigned); |
510 | extern void nfs_readpage_result(struct rpc_task *, void *); | 472 | extern int nfs_readpage_result(struct rpc_task *, struct nfs_read_data *); |
511 | extern void nfs_readdata_release(void *data); | 473 | extern void nfs_readdata_release(void *data); |
512 | |||
513 | 474 | ||
514 | /* | 475 | /* |
515 | * Allocate and free nfs_read_data structures | 476 | * Allocate and free nfs_read_data structures |
516 | */ | 477 | */ |
517 | extern mempool_t *nfs_rdata_mempool; | 478 | extern struct nfs_read_data *nfs_readdata_alloc(unsigned int pagecount); |
518 | 479 | extern void nfs_readdata_free(struct nfs_read_data *p); | |
519 | static inline struct nfs_read_data *nfs_readdata_alloc(unsigned int pagecount) | ||
520 | { | ||
521 | struct nfs_read_data *p = mempool_alloc(nfs_rdata_mempool, SLAB_NOFS); | ||
522 | |||
523 | if (p) { | ||
524 | memset(p, 0, sizeof(*p)); | ||
525 | INIT_LIST_HEAD(&p->pages); | ||
526 | if (pagecount < NFS_PAGEVEC_SIZE) | ||
527 | p->pagevec = &p->page_array[0]; | ||
528 | else { | ||
529 | size_t size = ++pagecount * sizeof(struct page *); | ||
530 | p->pagevec = kmalloc(size, GFP_NOFS); | ||
531 | if (p->pagevec) { | ||
532 | memset(p->pagevec, 0, size); | ||
533 | } else { | ||
534 | mempool_free(p, nfs_rdata_mempool); | ||
535 | p = NULL; | ||
536 | } | ||
537 | } | ||
538 | } | ||
539 | return p; | ||
540 | } | ||
541 | |||
542 | static inline void nfs_readdata_free(struct nfs_read_data *p) | ||
543 | { | ||
544 | if (p && (p->pagevec != &p->page_array[0])) | ||
545 | kfree(p->pagevec); | ||
546 | mempool_free(p, nfs_rdata_mempool); | ||
547 | } | ||
548 | 480 | ||
549 | /* | 481 | /* |
550 | * linux/fs/nfs3proc.c | 482 | * linux/fs/nfs3proc.c |
diff --git a/include/linux/nfs_fs_i.h b/include/linux/nfs_fs_i.h index e2c18dabff86..861730275ba0 100644 --- a/include/linux/nfs_fs_i.h +++ b/include/linux/nfs_fs_i.h | |||
@@ -12,8 +12,8 @@ struct nlm_lockowner; | |||
12 | */ | 12 | */ |
13 | struct nfs_lock_info { | 13 | struct nfs_lock_info { |
14 | u32 state; | 14 | u32 state; |
15 | u32 flags; | ||
16 | struct nlm_lockowner *owner; | 15 | struct nlm_lockowner *owner; |
16 | struct list_head list; | ||
17 | }; | 17 | }; |
18 | 18 | ||
19 | struct nfs4_lock_state; | 19 | struct nfs4_lock_state; |
@@ -21,10 +21,4 @@ struct nfs4_lock_info { | |||
21 | struct nfs4_lock_state *owner; | 21 | struct nfs4_lock_state *owner; |
22 | }; | 22 | }; |
23 | 23 | ||
24 | /* | ||
25 | * Lock flag values | ||
26 | */ | ||
27 | #define NFS_LCK_GRANTED 0x0001 /* lock has been granted */ | ||
28 | #define NFS_LCK_RECLAIM 0x0002 /* lock marked for reclaiming */ | ||
29 | |||
30 | #endif | 24 | #endif |
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index 3d3a305488cf..65dec21af774 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h | |||
@@ -4,6 +4,8 @@ | |||
4 | #include <linux/list.h> | 4 | #include <linux/list.h> |
5 | #include <linux/backing-dev.h> | 5 | #include <linux/backing-dev.h> |
6 | 6 | ||
7 | struct nfs_iostats; | ||
8 | |||
7 | /* | 9 | /* |
8 | * NFS client parameters stored in the superblock. | 10 | * NFS client parameters stored in the superblock. |
9 | */ | 11 | */ |
@@ -12,6 +14,7 @@ struct nfs_server { | |||
12 | struct rpc_clnt * client_sys; /* 2nd handle for FSINFO */ | 14 | struct rpc_clnt * client_sys; /* 2nd handle for FSINFO */ |
13 | struct rpc_clnt * client_acl; /* ACL RPC client handle */ | 15 | struct rpc_clnt * client_acl; /* ACL RPC client handle */ |
14 | struct nfs_rpc_ops * rpc_ops; /* NFS protocol vector */ | 16 | struct nfs_rpc_ops * rpc_ops; /* NFS protocol vector */ |
17 | struct nfs_iostats * io_stats; /* I/O statistics */ | ||
15 | struct backing_dev_info backing_dev_info; | 18 | struct backing_dev_info backing_dev_info; |
16 | int flags; /* various flags */ | 19 | int flags; /* various flags */ |
17 | unsigned int caps; /* server capabilities */ | 20 | unsigned int caps; /* server capabilities */ |
@@ -26,10 +29,13 @@ struct nfs_server { | |||
26 | unsigned int acregmax; | 29 | unsigned int acregmax; |
27 | unsigned int acdirmin; | 30 | unsigned int acdirmin; |
28 | unsigned int acdirmax; | 31 | unsigned int acdirmax; |
32 | unsigned long retrans_timeo; /* retransmit timeout */ | ||
33 | unsigned int retrans_count; /* number of retransmit tries */ | ||
29 | unsigned int namelen; | 34 | unsigned int namelen; |
30 | char * hostname; /* remote hostname */ | 35 | char * hostname; /* remote hostname */ |
31 | struct nfs_fh fh; | 36 | struct nfs_fh fh; |
32 | struct sockaddr_in addr; | 37 | struct sockaddr_in addr; |
38 | unsigned long mount_time; /* when this fs was mounted */ | ||
33 | #ifdef CONFIG_NFS_V4 | 39 | #ifdef CONFIG_NFS_V4 |
34 | /* Our own IP address, as a null-terminated string. | 40 | /* Our own IP address, as a null-terminated string. |
35 | * This is used to generate the clientid, and the callback address. | 41 | * This is used to generate the clientid, and the callback address. |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 6d6f69ec5675..7fafc4c546b7 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
@@ -695,7 +695,6 @@ struct nfs_read_data { | |||
695 | #ifdef CONFIG_NFS_V4 | 695 | #ifdef CONFIG_NFS_V4 |
696 | unsigned long timestamp; /* For lease renewal */ | 696 | unsigned long timestamp; /* For lease renewal */ |
697 | #endif | 697 | #endif |
698 | void (*complete) (struct nfs_read_data *, int); | ||
699 | struct page *page_array[NFS_PAGEVEC_SIZE + 1]; | 698 | struct page *page_array[NFS_PAGEVEC_SIZE + 1]; |
700 | }; | 699 | }; |
701 | 700 | ||
@@ -714,7 +713,6 @@ struct nfs_write_data { | |||
714 | #ifdef CONFIG_NFS_V4 | 713 | #ifdef CONFIG_NFS_V4 |
715 | unsigned long timestamp; /* For lease renewal */ | 714 | unsigned long timestamp; /* For lease renewal */ |
716 | #endif | 715 | #endif |
717 | void (*complete) (struct nfs_write_data *, int); | ||
718 | struct page *page_array[NFS_PAGEVEC_SIZE + 1]; | 716 | struct page *page_array[NFS_PAGEVEC_SIZE + 1]; |
719 | }; | 717 | }; |
720 | 718 | ||
@@ -769,8 +767,11 @@ struct nfs_rpc_ops { | |||
769 | struct nfs_pathconf *); | 767 | struct nfs_pathconf *); |
770 | u32 * (*decode_dirent)(u32 *, struct nfs_entry *, int plus); | 768 | u32 * (*decode_dirent)(u32 *, struct nfs_entry *, int plus); |
771 | void (*read_setup) (struct nfs_read_data *); | 769 | void (*read_setup) (struct nfs_read_data *); |
770 | int (*read_done) (struct rpc_task *, struct nfs_read_data *); | ||
772 | void (*write_setup) (struct nfs_write_data *, int how); | 771 | void (*write_setup) (struct nfs_write_data *, int how); |
772 | int (*write_done) (struct rpc_task *, struct nfs_write_data *); | ||
773 | void (*commit_setup) (struct nfs_write_data *, int how); | 773 | void (*commit_setup) (struct nfs_write_data *, int how); |
774 | int (*commit_done) (struct rpc_task *, struct nfs_write_data *); | ||
774 | int (*file_open) (struct inode *, struct file *); | 775 | int (*file_open) (struct inode *, struct file *); |
775 | int (*file_release) (struct inode *, struct file *); | 776 | int (*file_release) (struct inode *, struct file *); |
776 | int (*lock)(struct file *, int, struct file_lock *); | 777 | int (*lock)(struct file *, int, struct file_lock *); |
diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h index 6bad4766d3d9..d2a8abb5011a 100644 --- a/include/linux/nfsd/export.h +++ b/include/linux/nfsd/export.h | |||
@@ -67,7 +67,8 @@ struct svc_expkey { | |||
67 | int ek_fsidtype; | 67 | int ek_fsidtype; |
68 | u32 ek_fsid[3]; | 68 | u32 ek_fsid[3]; |
69 | 69 | ||
70 | struct svc_export * ek_export; | 70 | struct vfsmount * ek_mnt; |
71 | struct dentry * ek_dentry; | ||
71 | }; | 72 | }; |
72 | 73 | ||
73 | #define EX_SECURE(exp) (!((exp)->ex_flags & NFSEXP_INSECURE_PORT)) | 74 | #define EX_SECURE(exp) (!((exp)->ex_flags & NFSEXP_INSECURE_PORT)) |
@@ -85,9 +86,6 @@ void nfsd_export_shutdown(void); | |||
85 | void nfsd_export_flush(void); | 86 | void nfsd_export_flush(void); |
86 | void exp_readlock(void); | 87 | void exp_readlock(void); |
87 | void exp_readunlock(void); | 88 | void exp_readunlock(void); |
88 | struct svc_expkey * exp_find_key(struct auth_domain *clp, | ||
89 | int fsid_type, u32 *fsidv, | ||
90 | struct cache_req *reqp); | ||
91 | struct svc_export * exp_get_by_name(struct auth_domain *clp, | 89 | struct svc_export * exp_get_by_name(struct auth_domain *clp, |
92 | struct vfsmount *mnt, | 90 | struct vfsmount *mnt, |
93 | struct dentry *dentry, | 91 | struct dentry *dentry, |
@@ -101,35 +99,20 @@ int exp_rootfh(struct auth_domain *, | |||
101 | int exp_pseudoroot(struct auth_domain *, struct svc_fh *fhp, struct cache_req *creq); | 99 | int exp_pseudoroot(struct auth_domain *, struct svc_fh *fhp, struct cache_req *creq); |
102 | int nfserrno(int errno); | 100 | int nfserrno(int errno); |
103 | 101 | ||
104 | extern void expkey_put(struct cache_head *item, struct cache_detail *cd); | 102 | extern struct cache_detail svc_export_cache; |
105 | extern void svc_export_put(struct cache_head *item, struct cache_detail *cd); | ||
106 | extern struct cache_detail svc_export_cache, svc_expkey_cache; | ||
107 | 103 | ||
108 | static inline void exp_put(struct svc_export *exp) | 104 | static inline void exp_put(struct svc_export *exp) |
109 | { | 105 | { |
110 | svc_export_put(&exp->h, &svc_export_cache); | 106 | cache_put(&exp->h, &svc_export_cache); |
111 | } | 107 | } |
112 | 108 | ||
113 | static inline void exp_get(struct svc_export *exp) | 109 | static inline void exp_get(struct svc_export *exp) |
114 | { | 110 | { |
115 | cache_get(&exp->h); | 111 | cache_get(&exp->h); |
116 | } | 112 | } |
117 | static inline struct svc_export * | 113 | extern struct svc_export * |
118 | exp_find(struct auth_domain *clp, int fsid_type, u32 *fsidv, | 114 | exp_find(struct auth_domain *clp, int fsid_type, u32 *fsidv, |
119 | struct cache_req *reqp) | 115 | struct cache_req *reqp); |
120 | { | ||
121 | struct svc_expkey *ek = exp_find_key(clp, fsid_type, fsidv, reqp); | ||
122 | if (ek && !IS_ERR(ek)) { | ||
123 | struct svc_export *exp = ek->ek_export; | ||
124 | int err; | ||
125 | exp_get(exp); | ||
126 | expkey_put(&ek->h, &svc_expkey_cache); | ||
127 | if ((err = cache_check(&svc_export_cache, &exp->h, reqp))) | ||
128 | exp = ERR_PTR(err); | ||
129 | return exp; | ||
130 | } else | ||
131 | return ERR_PTR(PTR_ERR(ek)); | ||
132 | } | ||
133 | 116 | ||
134 | #endif /* __KERNEL__ */ | 117 | #endif /* __KERNEL__ */ |
135 | 118 | ||
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h index b959a4525cbd..1a9ef3e627d1 100644 --- a/include/linux/nodemask.h +++ b/include/linux/nodemask.h | |||
@@ -350,11 +350,15 @@ extern nodemask_t node_possible_map; | |||
350 | #define num_possible_nodes() nodes_weight(node_possible_map) | 350 | #define num_possible_nodes() nodes_weight(node_possible_map) |
351 | #define node_online(node) node_isset((node), node_online_map) | 351 | #define node_online(node) node_isset((node), node_online_map) |
352 | #define node_possible(node) node_isset((node), node_possible_map) | 352 | #define node_possible(node) node_isset((node), node_possible_map) |
353 | #define first_online_node first_node(node_online_map) | ||
354 | #define next_online_node(nid) next_node((nid), node_online_map) | ||
353 | #else | 355 | #else |
354 | #define num_online_nodes() 1 | 356 | #define num_online_nodes() 1 |
355 | #define num_possible_nodes() 1 | 357 | #define num_possible_nodes() 1 |
356 | #define node_online(node) ((node) == 0) | 358 | #define node_online(node) ((node) == 0) |
357 | #define node_possible(node) ((node) == 0) | 359 | #define node_possible(node) ((node) == 0) |
360 | #define first_online_node 0 | ||
361 | #define next_online_node(nid) (MAX_NUMNODES) | ||
358 | #endif | 362 | #endif |
359 | 363 | ||
360 | #define any_online_node(mask) \ | 364 | #define any_online_node(mask) \ |
diff --git a/include/linux/notifier.h b/include/linux/notifier.h index 5937dd6053c3..51dbab9710c7 100644 --- a/include/linux/notifier.h +++ b/include/linux/notifier.h | |||
@@ -10,25 +10,107 @@ | |||
10 | #ifndef _LINUX_NOTIFIER_H | 10 | #ifndef _LINUX_NOTIFIER_H |
11 | #define _LINUX_NOTIFIER_H | 11 | #define _LINUX_NOTIFIER_H |
12 | #include <linux/errno.h> | 12 | #include <linux/errno.h> |
13 | #include <linux/mutex.h> | ||
14 | #include <linux/rwsem.h> | ||
13 | 15 | ||
14 | struct notifier_block | 16 | /* |
15 | { | 17 | * Notifier chains are of three types: |
16 | int (*notifier_call)(struct notifier_block *self, unsigned long, void *); | 18 | * |
19 | * Atomic notifier chains: Chain callbacks run in interrupt/atomic | ||
20 | * context. Callouts are not allowed to block. | ||
21 | * Blocking notifier chains: Chain callbacks run in process context. | ||
22 | * Callouts are allowed to block. | ||
23 | * Raw notifier chains: There are no restrictions on callbacks, | ||
24 | * registration, or unregistration. All locking and protection | ||
25 | * must be provided by the caller. | ||
26 | * | ||
27 | * atomic_notifier_chain_register() may be called from an atomic context, | ||
28 | * but blocking_notifier_chain_register() must be called from a process | ||
29 | * context. Ditto for the corresponding _unregister() routines. | ||
30 | * | ||
31 | * atomic_notifier_chain_unregister() and blocking_notifier_chain_unregister() | ||
32 | * _must not_ be called from within the call chain. | ||
33 | */ | ||
34 | |||
35 | struct notifier_block { | ||
36 | int (*notifier_call)(struct notifier_block *, unsigned long, void *); | ||
17 | struct notifier_block *next; | 37 | struct notifier_block *next; |
18 | int priority; | 38 | int priority; |
19 | }; | 39 | }; |
20 | 40 | ||
41 | struct atomic_notifier_head { | ||
42 | spinlock_t lock; | ||
43 | struct notifier_block *head; | ||
44 | }; | ||
45 | |||
46 | struct blocking_notifier_head { | ||
47 | struct rw_semaphore rwsem; | ||
48 | struct notifier_block *head; | ||
49 | }; | ||
50 | |||
51 | struct raw_notifier_head { | ||
52 | struct notifier_block *head; | ||
53 | }; | ||
54 | |||
55 | #define ATOMIC_INIT_NOTIFIER_HEAD(name) do { \ | ||
56 | spin_lock_init(&(name)->lock); \ | ||
57 | (name)->head = NULL; \ | ||
58 | } while (0) | ||
59 | #define BLOCKING_INIT_NOTIFIER_HEAD(name) do { \ | ||
60 | init_rwsem(&(name)->rwsem); \ | ||
61 | (name)->head = NULL; \ | ||
62 | } while (0) | ||
63 | #define RAW_INIT_NOTIFIER_HEAD(name) do { \ | ||
64 | (name)->head = NULL; \ | ||
65 | } while (0) | ||
66 | |||
67 | #define ATOMIC_NOTIFIER_INIT(name) { \ | ||
68 | .lock = SPIN_LOCK_UNLOCKED, \ | ||
69 | .head = NULL } | ||
70 | #define BLOCKING_NOTIFIER_INIT(name) { \ | ||
71 | .rwsem = __RWSEM_INITIALIZER((name).rwsem), \ | ||
72 | .head = NULL } | ||
73 | #define RAW_NOTIFIER_INIT(name) { \ | ||
74 | .head = NULL } | ||
75 | |||
76 | #define ATOMIC_NOTIFIER_HEAD(name) \ | ||
77 | struct atomic_notifier_head name = \ | ||
78 | ATOMIC_NOTIFIER_INIT(name) | ||
79 | #define BLOCKING_NOTIFIER_HEAD(name) \ | ||
80 | struct blocking_notifier_head name = \ | ||
81 | BLOCKING_NOTIFIER_INIT(name) | ||
82 | #define RAW_NOTIFIER_HEAD(name) \ | ||
83 | struct raw_notifier_head name = \ | ||
84 | RAW_NOTIFIER_INIT(name) | ||
21 | 85 | ||
22 | #ifdef __KERNEL__ | 86 | #ifdef __KERNEL__ |
23 | 87 | ||
24 | extern int notifier_chain_register(struct notifier_block **list, struct notifier_block *n); | 88 | extern int atomic_notifier_chain_register(struct atomic_notifier_head *, |
25 | extern int notifier_chain_unregister(struct notifier_block **nl, struct notifier_block *n); | 89 | struct notifier_block *); |
26 | extern int notifier_call_chain(struct notifier_block **n, unsigned long val, void *v); | 90 | extern int blocking_notifier_chain_register(struct blocking_notifier_head *, |
91 | struct notifier_block *); | ||
92 | extern int raw_notifier_chain_register(struct raw_notifier_head *, | ||
93 | struct notifier_block *); | ||
94 | |||
95 | extern int atomic_notifier_chain_unregister(struct atomic_notifier_head *, | ||
96 | struct notifier_block *); | ||
97 | extern int blocking_notifier_chain_unregister(struct blocking_notifier_head *, | ||
98 | struct notifier_block *); | ||
99 | extern int raw_notifier_chain_unregister(struct raw_notifier_head *, | ||
100 | struct notifier_block *); | ||
101 | |||
102 | extern int atomic_notifier_call_chain(struct atomic_notifier_head *, | ||
103 | unsigned long val, void *v); | ||
104 | extern int blocking_notifier_call_chain(struct blocking_notifier_head *, | ||
105 | unsigned long val, void *v); | ||
106 | extern int raw_notifier_call_chain(struct raw_notifier_head *, | ||
107 | unsigned long val, void *v); | ||
27 | 108 | ||
28 | #define NOTIFY_DONE 0x0000 /* Don't care */ | 109 | #define NOTIFY_DONE 0x0000 /* Don't care */ |
29 | #define NOTIFY_OK 0x0001 /* Suits me */ | 110 | #define NOTIFY_OK 0x0001 /* Suits me */ |
30 | #define NOTIFY_STOP_MASK 0x8000 /* Don't call further */ | 111 | #define NOTIFY_STOP_MASK 0x8000 /* Don't call further */ |
31 | #define NOTIFY_BAD (NOTIFY_STOP_MASK|0x0002) /* Bad/Veto action */ | 112 | #define NOTIFY_BAD (NOTIFY_STOP_MASK|0x0002) |
113 | /* Bad/Veto action */ | ||
32 | /* | 114 | /* |
33 | * Clean way to return from the notifier and stop further calls. | 115 | * Clean way to return from the notifier and stop further calls. |
34 | */ | 116 | */ |
diff --git a/include/linux/oprofile.h b/include/linux/oprofile.h index 559c4c38a9c7..0d514b252454 100644 --- a/include/linux/oprofile.h +++ b/include/linux/oprofile.h | |||
@@ -61,6 +61,16 @@ void oprofile_arch_exit(void); | |||
61 | */ | 61 | */ |
62 | void oprofile_add_sample(struct pt_regs * const regs, unsigned long event); | 62 | void oprofile_add_sample(struct pt_regs * const regs, unsigned long event); |
63 | 63 | ||
64 | /** | ||
65 | * Add an extended sample. Use this when the PC is not from the regs, and | ||
66 | * we cannot determine if we're in kernel mode from the regs. | ||
67 | * | ||
68 | * This function does perform a backtrace. | ||
69 | * | ||
70 | */ | ||
71 | void oprofile_add_ext_sample(unsigned long pc, struct pt_regs * const regs, | ||
72 | unsigned long event, int is_kernel); | ||
73 | |||
64 | /* Use this instead when the PC value is not from the regs. Doesn't | 74 | /* Use this instead when the PC value is not from the regs. Doesn't |
65 | * backtrace. */ | 75 | * backtrace. */ |
66 | void oprofile_add_pc(unsigned long pc, int is_kernel, unsigned long event); | 76 | void oprofile_add_pc(unsigned long pc, int is_kernel, unsigned long event); |
@@ -74,10 +84,10 @@ void oprofile_add_trace(unsigned long eip); | |||
74 | * the specified file operations. | 84 | * the specified file operations. |
75 | */ | 85 | */ |
76 | int oprofilefs_create_file(struct super_block * sb, struct dentry * root, | 86 | int oprofilefs_create_file(struct super_block * sb, struct dentry * root, |
77 | char const * name, struct file_operations * fops); | 87 | char const * name, const struct file_operations * fops); |
78 | 88 | ||
79 | int oprofilefs_create_file_perm(struct super_block * sb, struct dentry * root, | 89 | int oprofilefs_create_file_perm(struct super_block * sb, struct dentry * root, |
80 | char const * name, struct file_operations * fops, int perm); | 90 | char const * name, const struct file_operations * fops, int perm); |
81 | 91 | ||
82 | /** Create a file for read/write access to an unsigned long. */ | 92 | /** Create a file for read/write access to an unsigned long. */ |
83 | int oprofilefs_create_ulong(struct super_block * sb, struct dentry * root, | 93 | int oprofilefs_create_ulong(struct super_block * sb, struct dentry * root, |
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index d52999c43336..9ea629c02a4b 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -86,8 +86,9 @@ | |||
86 | * - The __xxx_page_state variants can be used safely when interrupts are | 86 | * - The __xxx_page_state variants can be used safely when interrupts are |
87 | * disabled. | 87 | * disabled. |
88 | * - The __xxx_page_state variants can be used if the field is only | 88 | * - The __xxx_page_state variants can be used if the field is only |
89 | * modified from process context, or only modified from interrupt context. | 89 | * modified from process context and protected from preemption, or only |
90 | * In this case, the field should be commented here. | 90 | * modified from interrupt context. In this case, the field should be |
91 | * commented here. | ||
91 | */ | 92 | */ |
92 | struct page_state { | 93 | struct page_state { |
93 | unsigned long nr_dirty; /* Dirty writeable pages */ | 94 | unsigned long nr_dirty; /* Dirty writeable pages */ |
@@ -239,22 +240,19 @@ extern void __mod_page_state_offset(unsigned long offset, unsigned long delta); | |||
239 | #define __ClearPageDirty(page) __clear_bit(PG_dirty, &(page)->flags) | 240 | #define __ClearPageDirty(page) __clear_bit(PG_dirty, &(page)->flags) |
240 | #define TestClearPageDirty(page) test_and_clear_bit(PG_dirty, &(page)->flags) | 241 | #define TestClearPageDirty(page) test_and_clear_bit(PG_dirty, &(page)->flags) |
241 | 242 | ||
242 | #define SetPageLRU(page) set_bit(PG_lru, &(page)->flags) | ||
243 | #define PageLRU(page) test_bit(PG_lru, &(page)->flags) | 243 | #define PageLRU(page) test_bit(PG_lru, &(page)->flags) |
244 | #define TestSetPageLRU(page) test_and_set_bit(PG_lru, &(page)->flags) | 244 | #define SetPageLRU(page) set_bit(PG_lru, &(page)->flags) |
245 | #define TestClearPageLRU(page) test_and_clear_bit(PG_lru, &(page)->flags) | 245 | #define ClearPageLRU(page) clear_bit(PG_lru, &(page)->flags) |
246 | #define __ClearPageLRU(page) __clear_bit(PG_lru, &(page)->flags) | ||
246 | 247 | ||
247 | #define PageActive(page) test_bit(PG_active, &(page)->flags) | 248 | #define PageActive(page) test_bit(PG_active, &(page)->flags) |
248 | #define SetPageActive(page) set_bit(PG_active, &(page)->flags) | 249 | #define SetPageActive(page) set_bit(PG_active, &(page)->flags) |
249 | #define ClearPageActive(page) clear_bit(PG_active, &(page)->flags) | 250 | #define ClearPageActive(page) clear_bit(PG_active, &(page)->flags) |
250 | #define TestClearPageActive(page) test_and_clear_bit(PG_active, &(page)->flags) | 251 | #define __ClearPageActive(page) __clear_bit(PG_active, &(page)->flags) |
251 | #define TestSetPageActive(page) test_and_set_bit(PG_active, &(page)->flags) | ||
252 | 252 | ||
253 | #define PageSlab(page) test_bit(PG_slab, &(page)->flags) | 253 | #define PageSlab(page) test_bit(PG_slab, &(page)->flags) |
254 | #define SetPageSlab(page) set_bit(PG_slab, &(page)->flags) | 254 | #define __SetPageSlab(page) __set_bit(PG_slab, &(page)->flags) |
255 | #define ClearPageSlab(page) clear_bit(PG_slab, &(page)->flags) | 255 | #define __ClearPageSlab(page) __clear_bit(PG_slab, &(page)->flags) |
256 | #define TestClearPageSlab(page) test_and_clear_bit(PG_slab, &(page)->flags) | ||
257 | #define TestSetPageSlab(page) test_and_set_bit(PG_slab, &(page)->flags) | ||
258 | 256 | ||
259 | #ifdef CONFIG_HIGHMEM | 257 | #ifdef CONFIG_HIGHMEM |
260 | #define PageHighMem(page) is_highmem(page_zone(page)) | 258 | #define PageHighMem(page) is_highmem(page_zone(page)) |
@@ -329,8 +327,8 @@ extern void __mod_page_state_offset(unsigned long offset, unsigned long delta); | |||
329 | #define TestClearPageReclaim(page) test_and_clear_bit(PG_reclaim, &(page)->flags) | 327 | #define TestClearPageReclaim(page) test_and_clear_bit(PG_reclaim, &(page)->flags) |
330 | 328 | ||
331 | #define PageCompound(page) test_bit(PG_compound, &(page)->flags) | 329 | #define PageCompound(page) test_bit(PG_compound, &(page)->flags) |
332 | #define SetPageCompound(page) set_bit(PG_compound, &(page)->flags) | 330 | #define __SetPageCompound(page) __set_bit(PG_compound, &(page)->flags) |
333 | #define ClearPageCompound(page) clear_bit(PG_compound, &(page)->flags) | 331 | #define __ClearPageCompound(page) __clear_bit(PG_compound, &(page)->flags) |
334 | 332 | ||
335 | #ifdef CONFIG_SWAP | 333 | #ifdef CONFIG_SWAP |
336 | #define PageSwapCache(page) test_bit(PG_swapcache, &(page)->flags) | 334 | #define PageSwapCache(page) test_bit(PG_swapcache, &(page)->flags) |
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index ee700c6eb442..839f0b3c23aa 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
@@ -51,6 +51,10 @@ static inline void mapping_set_gfp_mask(struct address_space *m, gfp_t mask) | |||
51 | #define page_cache_release(page) put_page(page) | 51 | #define page_cache_release(page) put_page(page) |
52 | void release_pages(struct page **pages, int nr, int cold); | 52 | void release_pages(struct page **pages, int nr, int cold); |
53 | 53 | ||
54 | #ifdef CONFIG_NUMA | ||
55 | extern struct page *page_cache_alloc(struct address_space *x); | ||
56 | extern struct page *page_cache_alloc_cold(struct address_space *x); | ||
57 | #else | ||
54 | static inline struct page *page_cache_alloc(struct address_space *x) | 58 | static inline struct page *page_cache_alloc(struct address_space *x) |
55 | { | 59 | { |
56 | return alloc_pages(mapping_gfp_mask(x), 0); | 60 | return alloc_pages(mapping_gfp_mask(x), 0); |
@@ -60,6 +64,7 @@ static inline struct page *page_cache_alloc_cold(struct address_space *x) | |||
60 | { | 64 | { |
61 | return alloc_pages(mapping_gfp_mask(x)|__GFP_COLD, 0); | 65 | return alloc_pages(mapping_gfp_mask(x)|__GFP_COLD, 0); |
62 | } | 66 | } |
67 | #endif | ||
63 | 68 | ||
64 | typedef int filler_t(void *, struct page *); | 69 | typedef int filler_t(void *, struct page *); |
65 | 70 | ||
diff --git a/include/linux/pci.h b/include/linux/pci.h index fe1a2b02fc55..0aad5a378e95 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -95,6 +95,11 @@ enum pci_channel_state { | |||
95 | pci_channel_io_perm_failure = (__force pci_channel_state_t) 3, | 95 | pci_channel_io_perm_failure = (__force pci_channel_state_t) 3, |
96 | }; | 96 | }; |
97 | 97 | ||
98 | typedef unsigned short __bitwise pci_bus_flags_t; | ||
99 | enum pci_bus_flags { | ||
100 | PCI_BUS_FLAGS_NO_MSI = (pci_bus_flags_t) 1, | ||
101 | }; | ||
102 | |||
98 | /* | 103 | /* |
99 | * The pci_dev structure is used to describe PCI devices. | 104 | * The pci_dev structure is used to describe PCI devices. |
100 | */ | 105 | */ |
@@ -203,7 +208,7 @@ struct pci_bus { | |||
203 | char name[48]; | 208 | char name[48]; |
204 | 209 | ||
205 | unsigned short bridge_ctl; /* manage NO_ISA/FBB/et al behaviors */ | 210 | unsigned short bridge_ctl; /* manage NO_ISA/FBB/et al behaviors */ |
206 | unsigned short pad2; | 211 | pci_bus_flags_t bus_flags; /* Inherited by child busses */ |
207 | struct device *bridge; | 212 | struct device *bridge; |
208 | struct class_device class_dev; | 213 | struct class_device class_dev; |
209 | struct bin_attribute *legacy_io; /* legacy I/O for this bus */ | 214 | struct bin_attribute *legacy_io; /* legacy I/O for this bus */ |
@@ -485,9 +490,9 @@ void pdev_sort_resources(struct pci_dev *, struct resource_list *); | |||
485 | void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *), | 490 | void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *), |
486 | int (*)(struct pci_dev *, u8, u8)); | 491 | int (*)(struct pci_dev *, u8, u8)); |
487 | #define HAVE_PCI_REQ_REGIONS 2 | 492 | #define HAVE_PCI_REQ_REGIONS 2 |
488 | int pci_request_regions(struct pci_dev *, char *); | 493 | int pci_request_regions(struct pci_dev *, const char *); |
489 | void pci_release_regions(struct pci_dev *); | 494 | void pci_release_regions(struct pci_dev *); |
490 | int pci_request_region(struct pci_dev *, int, char *); | 495 | int pci_request_region(struct pci_dev *, int, const char *); |
491 | void pci_release_region(struct pci_dev *, int); | 496 | void pci_release_region(struct pci_dev *, int); |
492 | 497 | ||
493 | /* drivers/pci/bus.c */ | 498 | /* drivers/pci/bus.c */ |
@@ -516,6 +521,7 @@ int pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max, int pass | |||
516 | void pci_walk_bus(struct pci_bus *top, void (*cb)(struct pci_dev *, void *), | 521 | void pci_walk_bus(struct pci_bus *top, void (*cb)(struct pci_dev *, void *), |
517 | void *userdata); | 522 | void *userdata); |
518 | int pci_cfg_space_size(struct pci_dev *dev); | 523 | int pci_cfg_space_size(struct pci_dev *dev); |
524 | unsigned char pci_bus_max_busnr(struct pci_bus* bus); | ||
519 | 525 | ||
520 | /* kmem_cache style wrapper around pci_alloc_consistent() */ | 526 | /* kmem_cache style wrapper around pci_alloc_consistent() */ |
521 | 527 | ||
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index b9810ddf435a..870fe38378b1 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -69,6 +69,7 @@ | |||
69 | #define PCI_CLASS_SYSTEM_TIMER 0x0802 | 69 | #define PCI_CLASS_SYSTEM_TIMER 0x0802 |
70 | #define PCI_CLASS_SYSTEM_RTC 0x0803 | 70 | #define PCI_CLASS_SYSTEM_RTC 0x0803 |
71 | #define PCI_CLASS_SYSTEM_PCI_HOTPLUG 0x0804 | 71 | #define PCI_CLASS_SYSTEM_PCI_HOTPLUG 0x0804 |
72 | #define PCI_CLASS_SYSTEM_SDHCI 0x0805 | ||
72 | #define PCI_CLASS_SYSTEM_OTHER 0x0880 | 73 | #define PCI_CLASS_SYSTEM_OTHER 0x0880 |
73 | 74 | ||
74 | #define PCI_BASE_CLASS_INPUT 0x09 | 75 | #define PCI_BASE_CLASS_INPUT 0x09 |
@@ -641,6 +642,7 @@ | |||
641 | #define PCI_DEVICE_ID_SI_965 0x0965 | 642 | #define PCI_DEVICE_ID_SI_965 0x0965 |
642 | #define PCI_DEVICE_ID_SI_5511 0x5511 | 643 | #define PCI_DEVICE_ID_SI_5511 0x5511 |
643 | #define PCI_DEVICE_ID_SI_5513 0x5513 | 644 | #define PCI_DEVICE_ID_SI_5513 0x5513 |
645 | #define PCI_DEVICE_ID_SI_5517 0x5517 | ||
644 | #define PCI_DEVICE_ID_SI_5518 0x5518 | 646 | #define PCI_DEVICE_ID_SI_5518 0x5518 |
645 | #define PCI_DEVICE_ID_SI_5571 0x5571 | 647 | #define PCI_DEVICE_ID_SI_5571 0x5571 |
646 | #define PCI_DEVICE_ID_SI_5581 0x5581 | 648 | #define PCI_DEVICE_ID_SI_5581 0x5581 |
@@ -771,6 +773,7 @@ | |||
771 | #define PCI_DEVICE_ID_MOTOROLA_HAWK 0x4803 | 773 | #define PCI_DEVICE_ID_MOTOROLA_HAWK 0x4803 |
772 | #define PCI_DEVICE_ID_MOTOROLA_HARRIER 0x480b | 774 | #define PCI_DEVICE_ID_MOTOROLA_HARRIER 0x480b |
773 | #define PCI_DEVICE_ID_MOTOROLA_MPC5200 0x5803 | 775 | #define PCI_DEVICE_ID_MOTOROLA_MPC5200 0x5803 |
776 | #define PCI_DEVICE_ID_MOTOROLA_MPC5200B 0x5809 | ||
774 | 777 | ||
775 | #define PCI_VENDOR_ID_PROMISE 0x105a | 778 | #define PCI_VENDOR_ID_PROMISE 0x105a |
776 | #define PCI_DEVICE_ID_PROMISE_20265 0x0d30 | 779 | #define PCI_DEVICE_ID_PROMISE_20265 0x0d30 |
@@ -852,6 +855,8 @@ | |||
852 | #define PCI_DEVICE_ID_QLOGIC_ISP2432 0x2432 | 855 | #define PCI_DEVICE_ID_QLOGIC_ISP2432 0x2432 |
853 | #define PCI_DEVICE_ID_QLOGIC_ISP2512 0x2512 | 856 | #define PCI_DEVICE_ID_QLOGIC_ISP2512 0x2512 |
854 | #define PCI_DEVICE_ID_QLOGIC_ISP2522 0x2522 | 857 | #define PCI_DEVICE_ID_QLOGIC_ISP2522 0x2522 |
858 | #define PCI_DEVICE_ID_QLOGIC_ISP5422 0x5422 | ||
859 | #define PCI_DEVICE_ID_QLOGIC_ISP5432 0x5432 | ||
855 | 860 | ||
856 | #define PCI_VENDOR_ID_CYRIX 0x1078 | 861 | #define PCI_VENDOR_ID_CYRIX 0x1078 |
857 | #define PCI_DEVICE_ID_CYRIX_5510 0x0000 | 862 | #define PCI_DEVICE_ID_CYRIX_5510 0x0000 |
@@ -1049,6 +1054,7 @@ | |||
1049 | #define PCIE_DEVICE_ID_NVIDIA_GEFORCE_6600_ALT2 0x00f2 | 1054 | #define PCIE_DEVICE_ID_NVIDIA_GEFORCE_6600_ALT2 0x00f2 |
1050 | #define PCIE_DEVICE_ID_NVIDIA_GEFORCE_6200_ALT1 0x00f3 | 1055 | #define PCIE_DEVICE_ID_NVIDIA_GEFORCE_6200_ALT1 0x00f3 |
1051 | #define PCIE_DEVICE_ID_NVIDIA_GEFORCE_6800_GT 0x00f9 | 1056 | #define PCIE_DEVICE_ID_NVIDIA_GEFORCE_6800_GT 0x00f9 |
1057 | #define PCIE_DEVICE_ID_NVIDIA_QUADRO_NVS280 0x00fd | ||
1052 | #define PCI_DEVICE_ID_NVIDIA_GEFORCE_SDR 0x0100 | 1058 | #define PCI_DEVICE_ID_NVIDIA_GEFORCE_SDR 0x0100 |
1053 | #define PCI_DEVICE_ID_NVIDIA_GEFORCE_DDR 0x0101 | 1059 | #define PCI_DEVICE_ID_NVIDIA_GEFORCE_DDR 0x0101 |
1054 | #define PCI_DEVICE_ID_NVIDIA_QUADRO 0x0103 | 1060 | #define PCI_DEVICE_ID_NVIDIA_QUADRO 0x0103 |
@@ -1369,6 +1375,7 @@ | |||
1369 | #define PCI_DEVICE_ID_SERVERWORKS_OSB4 0x0200 | 1375 | #define PCI_DEVICE_ID_SERVERWORKS_OSB4 0x0200 |
1370 | #define PCI_DEVICE_ID_SERVERWORKS_CSB5 0x0201 | 1376 | #define PCI_DEVICE_ID_SERVERWORKS_CSB5 0x0201 |
1371 | #define PCI_DEVICE_ID_SERVERWORKS_CSB6 0x0203 | 1377 | #define PCI_DEVICE_ID_SERVERWORKS_CSB6 0x0203 |
1378 | #define PCI_DEVICE_ID_SERVERWORKS_HT1000SB 0x0205 | ||
1372 | #define PCI_DEVICE_ID_SERVERWORKS_OSB4IDE 0x0211 | 1379 | #define PCI_DEVICE_ID_SERVERWORKS_OSB4IDE 0x0211 |
1373 | #define PCI_DEVICE_ID_SERVERWORKS_CSB5IDE 0x0212 | 1380 | #define PCI_DEVICE_ID_SERVERWORKS_CSB5IDE 0x0212 |
1374 | #define PCI_DEVICE_ID_SERVERWORKS_CSB6IDE 0x0213 | 1381 | #define PCI_DEVICE_ID_SERVERWORKS_CSB6IDE 0x0213 |
@@ -1862,11 +1869,13 @@ | |||
1862 | #define PCI_DEVICE_ID_TIGON3_5780S 0x166b | 1869 | #define PCI_DEVICE_ID_TIGON3_5780S 0x166b |
1863 | #define PCI_DEVICE_ID_TIGON3_5705F 0x166e | 1870 | #define PCI_DEVICE_ID_TIGON3_5705F 0x166e |
1864 | #define PCI_DEVICE_ID_TIGON3_5754M 0x1672 | 1871 | #define PCI_DEVICE_ID_TIGON3_5754M 0x1672 |
1872 | #define PCI_DEVICE_ID_TIGON3_5755M 0x1673 | ||
1865 | #define PCI_DEVICE_ID_TIGON3_5750 0x1676 | 1873 | #define PCI_DEVICE_ID_TIGON3_5750 0x1676 |
1866 | #define PCI_DEVICE_ID_TIGON3_5751 0x1677 | 1874 | #define PCI_DEVICE_ID_TIGON3_5751 0x1677 |
1867 | #define PCI_DEVICE_ID_TIGON3_5715 0x1678 | 1875 | #define PCI_DEVICE_ID_TIGON3_5715 0x1678 |
1868 | #define PCI_DEVICE_ID_TIGON3_5715S 0x1679 | 1876 | #define PCI_DEVICE_ID_TIGON3_5715S 0x1679 |
1869 | #define PCI_DEVICE_ID_TIGON3_5754 0x167a | 1877 | #define PCI_DEVICE_ID_TIGON3_5754 0x167a |
1878 | #define PCI_DEVICE_ID_TIGON3_5755 0x167b | ||
1870 | #define PCI_DEVICE_ID_TIGON3_5750M 0x167c | 1879 | #define PCI_DEVICE_ID_TIGON3_5750M 0x167c |
1871 | #define PCI_DEVICE_ID_TIGON3_5751M 0x167d | 1880 | #define PCI_DEVICE_ID_TIGON3_5751M 0x167d |
1872 | #define PCI_DEVICE_ID_TIGON3_5751F 0x167e | 1881 | #define PCI_DEVICE_ID_TIGON3_5751F 0x167e |
diff --git a/include/linux/pfn.h b/include/linux/pfn.h new file mode 100644 index 000000000000..bb01f8b92b56 --- /dev/null +++ b/include/linux/pfn.h | |||
@@ -0,0 +1,9 @@ | |||
1 | #ifndef _LINUX_PFN_H_ | ||
2 | #define _LINUX_PFN_H_ | ||
3 | |||
4 | #define PFN_ALIGN(x) (((unsigned long)(x) + (PAGE_SIZE - 1)) & PAGE_MASK) | ||
5 | #define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT) | ||
6 | #define PFN_DOWN(x) ((x) >> PAGE_SHIFT) | ||
7 | #define PFN_PHYS(x) ((x) << PAGE_SHIFT) | ||
8 | |||
9 | #endif | ||
diff --git a/include/linux/pid.h b/include/linux/pid.h index 5b2fcb19d2da..5b9082cc600f 100644 --- a/include/linux/pid.h +++ b/include/linux/pid.h | |||
@@ -4,7 +4,6 @@ | |||
4 | enum pid_type | 4 | enum pid_type |
5 | { | 5 | { |
6 | PIDTYPE_PID, | 6 | PIDTYPE_PID, |
7 | PIDTYPE_TGID, | ||
8 | PIDTYPE_PGID, | 7 | PIDTYPE_PGID, |
9 | PIDTYPE_SID, | 8 | PIDTYPE_SID, |
10 | PIDTYPE_MAX | 9 | PIDTYPE_MAX |
@@ -38,7 +37,6 @@ extern struct pid *FASTCALL(find_pid(enum pid_type, int)); | |||
38 | 37 | ||
39 | extern int alloc_pidmap(void); | 38 | extern int alloc_pidmap(void); |
40 | extern void FASTCALL(free_pidmap(int)); | 39 | extern void FASTCALL(free_pidmap(int)); |
41 | extern void switch_exec_pids(struct task_struct *leader, struct task_struct *thread); | ||
42 | 40 | ||
43 | #define do_each_task_pid(who, type, task) \ | 41 | #define do_each_task_pid(who, type, task) \ |
44 | if ((task = find_task_by_pid_type(type, who))) { \ | 42 | if ((task = find_task_by_pid_type(type, who))) { \ |
diff --git a/include/linux/platform.h b/include/linux/platform.h deleted file mode 100644 index 3c33084a6ec2..000000000000 --- a/include/linux/platform.h +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | /* | ||
2 | * include/linux/platform.h - platform driver definitions | ||
3 | * | ||
4 | * Because of the prolific consumerism of the average American, | ||
5 | * and the dominant marketing budgets of PC OEMs, we have been | ||
6 | * blessed with frequent updates of the PC architecture. | ||
7 | * | ||
8 | * While most of these calls are singular per architecture, they | ||
9 | * require an extra layer of abstraction on the x86 so the right | ||
10 | * subsystem gets the right call. | ||
11 | * | ||
12 | * Basically, this consolidates the power off and reboot callbacks | ||
13 | * into one structure, as well as adding power management hooks. | ||
14 | * | ||
15 | * When adding a platform driver, please make sure all callbacks are | ||
16 | * filled. There are defaults defined below that do nothing; use those | ||
17 | * if you do not support that callback. | ||
18 | */ | ||
19 | |||
20 | #ifndef _PLATFORM_H_ | ||
21 | #define _PLATFORM_H_ | ||
22 | #ifdef __KERNEL__ | ||
23 | |||
24 | #include <linux/types.h> | ||
25 | |||
26 | struct platform_t { | ||
27 | char * name; | ||
28 | u32 suspend_states; | ||
29 | void (*reboot)(char * cmd); | ||
30 | void (*halt)(void); | ||
31 | void (*power_off)(void); | ||
32 | int (*suspend)(int state, int flags); | ||
33 | void (*idle)(void); | ||
34 | }; | ||
35 | |||
36 | extern struct platform_t * platform; | ||
37 | extern void default_reboot(char * cmd); | ||
38 | extern void default_halt(void); | ||
39 | extern int default_suspend(int state, int flags); | ||
40 | extern void default_idle(void); | ||
41 | |||
42 | #endif /* __KERNEL__ */ | ||
43 | #endif /* _PLATFORM_H */ | ||
diff --git a/include/linux/pm.h b/include/linux/pm.h index 5be87ba3b7ac..6df2585c0169 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -188,6 +188,8 @@ extern void device_power_up(void); | |||
188 | extern void device_resume(void); | 188 | extern void device_resume(void); |
189 | 189 | ||
190 | #ifdef CONFIG_PM | 190 | #ifdef CONFIG_PM |
191 | extern suspend_disk_method_t pm_disk_mode; | ||
192 | |||
191 | extern int device_suspend(pm_message_t state); | 193 | extern int device_suspend(pm_message_t state); |
192 | 194 | ||
193 | #define device_set_wakeup_enable(dev,val) \ | 195 | #define device_set_wakeup_enable(dev,val) \ |
@@ -215,7 +217,6 @@ static inline int dpm_runtime_suspend(struct device * dev, pm_message_t state) | |||
215 | 217 | ||
216 | static inline void dpm_runtime_resume(struct device * dev) | 218 | static inline void dpm_runtime_resume(struct device * dev) |
217 | { | 219 | { |
218 | |||
219 | } | 220 | } |
220 | 221 | ||
221 | #endif | 222 | #endif |
diff --git a/include/linux/poll.h b/include/linux/poll.h index 8e8f6098508a..51e1b56741fb 100644 --- a/include/linux/poll.h +++ b/include/linux/poll.h | |||
@@ -11,6 +11,15 @@ | |||
11 | #include <linux/mm.h> | 11 | #include <linux/mm.h> |
12 | #include <asm/uaccess.h> | 12 | #include <asm/uaccess.h> |
13 | 13 | ||
14 | /* ~832 bytes of stack space used max in sys_select/sys_poll before allocating | ||
15 | additional memory. */ | ||
16 | #define MAX_STACK_ALLOC 832 | ||
17 | #define FRONTEND_STACK_ALLOC 256 | ||
18 | #define SELECT_STACK_ALLOC FRONTEND_STACK_ALLOC | ||
19 | #define POLL_STACK_ALLOC FRONTEND_STACK_ALLOC | ||
20 | #define WQUEUES_STACK_ALLOC (MAX_STACK_ALLOC - FRONTEND_STACK_ALLOC) | ||
21 | #define N_INLINE_POLL_ENTRIES (WQUEUES_STACK_ALLOC / sizeof(struct poll_table_entry)) | ||
22 | |||
14 | struct poll_table_struct; | 23 | struct poll_table_struct; |
15 | 24 | ||
16 | /* | 25 | /* |
@@ -33,6 +42,12 @@ static inline void init_poll_funcptr(poll_table *pt, poll_queue_proc qproc) | |||
33 | pt->qproc = qproc; | 42 | pt->qproc = qproc; |
34 | } | 43 | } |
35 | 44 | ||
45 | struct poll_table_entry { | ||
46 | struct file * filp; | ||
47 | wait_queue_t wait; | ||
48 | wait_queue_head_t * wait_address; | ||
49 | }; | ||
50 | |||
36 | /* | 51 | /* |
37 | * Structures and helpers for sys_poll/sys_poll | 52 | * Structures and helpers for sys_poll/sys_poll |
38 | */ | 53 | */ |
@@ -40,6 +55,8 @@ struct poll_wqueues { | |||
40 | poll_table pt; | 55 | poll_table pt; |
41 | struct poll_table_page * table; | 56 | struct poll_table_page * table; |
42 | int error; | 57 | int error; |
58 | int inline_index; | ||
59 | struct poll_table_entry inline_entries[N_INLINE_POLL_ENTRIES]; | ||
43 | }; | 60 | }; |
44 | 61 | ||
45 | extern void poll_initwait(struct poll_wqueues *pwq); | 62 | extern void poll_initwait(struct poll_wqueues *pwq); |
diff --git a/include/linux/ppdev.h b/include/linux/ppdev.h index 141c96586824..f376a7598a78 100644 --- a/include/linux/ppdev.h +++ b/include/linux/ppdev.h | |||
@@ -14,8 +14,6 @@ | |||
14 | * Added PPGETMODES/PPGETMODE/PPGETPHASE, Fred Barnes <frmb2@ukc.ac.uk>, 03/01/2001 | 14 | * Added PPGETMODES/PPGETMODE/PPGETPHASE, Fred Barnes <frmb2@ukc.ac.uk>, 03/01/2001 |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #define PP_MAJOR 99 | ||
18 | |||
19 | #define PP_IOCTL 'p' | 17 | #define PP_IOCTL 'p' |
20 | 18 | ||
21 | /* Set mode for read/write (e.g. IEEE1284_MODE_EPP) */ | 19 | /* Set mode for read/write (e.g. IEEE1284_MODE_EPP) */ |
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index aa6322d45198..135871df9911 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <linux/config.h> | 4 | #include <linux/config.h> |
5 | #include <linux/slab.h> | 5 | #include <linux/slab.h> |
6 | #include <linux/fs.h> | 6 | #include <linux/fs.h> |
7 | #include <linux/spinlock.h> | ||
7 | #include <asm/atomic.h> | 8 | #include <asm/atomic.h> |
8 | 9 | ||
9 | /* | 10 | /* |
@@ -55,9 +56,9 @@ struct proc_dir_entry { | |||
55 | nlink_t nlink; | 56 | nlink_t nlink; |
56 | uid_t uid; | 57 | uid_t uid; |
57 | gid_t gid; | 58 | gid_t gid; |
58 | unsigned long size; | 59 | loff_t size; |
59 | struct inode_operations * proc_iops; | 60 | struct inode_operations * proc_iops; |
60 | struct file_operations * proc_fops; | 61 | const struct file_operations * proc_fops; |
61 | get_info_t *get_info; | 62 | get_info_t *get_info; |
62 | struct module *owner; | 63 | struct module *owner; |
63 | struct proc_dir_entry *next, *parent, *subdir; | 64 | struct proc_dir_entry *next, *parent, *subdir; |
@@ -92,6 +93,8 @@ extern struct proc_dir_entry *proc_bus; | |||
92 | extern struct proc_dir_entry *proc_root_driver; | 93 | extern struct proc_dir_entry *proc_root_driver; |
93 | extern struct proc_dir_entry *proc_root_kcore; | 94 | extern struct proc_dir_entry *proc_root_kcore; |
94 | 95 | ||
96 | extern spinlock_t proc_subdir_lock; | ||
97 | |||
95 | extern void proc_root_init(void); | 98 | extern void proc_root_init(void); |
96 | extern void proc_misc_init(void); | 99 | extern void proc_misc_init(void); |
97 | 100 | ||
@@ -125,9 +128,9 @@ extern int proc_match(int, const char *,struct proc_dir_entry *); | |||
125 | extern int proc_readdir(struct file *, void *, filldir_t); | 128 | extern int proc_readdir(struct file *, void *, filldir_t); |
126 | extern struct dentry *proc_lookup(struct inode *, struct dentry *, struct nameidata *); | 129 | extern struct dentry *proc_lookup(struct inode *, struct dentry *, struct nameidata *); |
127 | 130 | ||
128 | extern struct file_operations proc_kcore_operations; | 131 | extern const struct file_operations proc_kcore_operations; |
129 | extern struct file_operations proc_kmsg_operations; | 132 | extern const struct file_operations proc_kmsg_operations; |
130 | extern struct file_operations ppc_htab_operations; | 133 | extern const struct file_operations ppc_htab_operations; |
131 | 134 | ||
132 | /* | 135 | /* |
133 | * proc_tty.c | 136 | * proc_tty.c |
@@ -186,7 +189,7 @@ static inline struct proc_dir_entry *proc_net_create(const char *name, | |||
186 | } | 189 | } |
187 | 190 | ||
188 | static inline struct proc_dir_entry *proc_net_fops_create(const char *name, | 191 | static inline struct proc_dir_entry *proc_net_fops_create(const char *name, |
189 | mode_t mode, struct file_operations *fops) | 192 | mode_t mode, const struct file_operations *fops) |
190 | { | 193 | { |
191 | struct proc_dir_entry *res = create_proc_entry(name, mode, proc_net); | 194 | struct proc_dir_entry *res = create_proc_entry(name, mode, proc_net); |
192 | if (res) | 195 | if (res) |
diff --git a/include/linux/profile.h b/include/linux/profile.h index 026969a5595c..1f2fea6640a4 100644 --- a/include/linux/profile.h +++ b/include/linux/profile.h | |||
@@ -14,6 +14,7 @@ | |||
14 | 14 | ||
15 | struct proc_dir_entry; | 15 | struct proc_dir_entry; |
16 | struct pt_regs; | 16 | struct pt_regs; |
17 | struct notifier_block; | ||
17 | 18 | ||
18 | /* init basic kernel profiler */ | 19 | /* init basic kernel profiler */ |
19 | void __init profile_init(void); | 20 | void __init profile_init(void); |
@@ -32,7 +33,6 @@ enum profile_type { | |||
32 | 33 | ||
33 | #ifdef CONFIG_PROFILING | 34 | #ifdef CONFIG_PROFILING |
34 | 35 | ||
35 | struct notifier_block; | ||
36 | struct task_struct; | 36 | struct task_struct; |
37 | struct mm_struct; | 37 | struct mm_struct; |
38 | 38 | ||
diff --git a/include/linux/qnx4_fs.h b/include/linux/qnx4_fs.h index fc610bb0f733..27f49c85d5d6 100644 --- a/include/linux/qnx4_fs.h +++ b/include/linux/qnx4_fs.h | |||
@@ -118,8 +118,8 @@ extern struct buffer_head *qnx4_bread(struct inode *, int, int); | |||
118 | 118 | ||
119 | extern struct inode_operations qnx4_file_inode_operations; | 119 | extern struct inode_operations qnx4_file_inode_operations; |
120 | extern struct inode_operations qnx4_dir_inode_operations; | 120 | extern struct inode_operations qnx4_dir_inode_operations; |
121 | extern struct file_operations qnx4_file_operations; | 121 | extern const struct file_operations qnx4_file_operations; |
122 | extern struct file_operations qnx4_dir_operations; | 122 | extern const struct file_operations qnx4_dir_operations; |
123 | extern int qnx4_is_free(struct super_block *sb, long block); | 123 | extern int qnx4_is_free(struct super_block *sb, long block); |
124 | extern int qnx4_set_bitmap(struct super_block *sb, long block, int busy); | 124 | extern int qnx4_set_bitmap(struct super_block *sb, long block, int busy); |
125 | extern int qnx4_create(struct inode *inode, struct dentry *dentry, int mode, struct nameidata *nd); | 125 | extern int qnx4_create(struct inode *inode, struct dentry *dentry, int mode, struct nameidata *nd); |
diff --git a/include/linux/quota.h b/include/linux/quota.h index f33aeb22c26a..2dab71e1c3d1 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h | |||
@@ -38,6 +38,7 @@ | |||
38 | #include <linux/errno.h> | 38 | #include <linux/errno.h> |
39 | #include <linux/types.h> | 39 | #include <linux/types.h> |
40 | #include <linux/spinlock.h> | 40 | #include <linux/spinlock.h> |
41 | #include <linux/mutex.h> | ||
41 | 42 | ||
42 | #define __DQUOT_VERSION__ "dquot_6.5.1" | 43 | #define __DQUOT_VERSION__ "dquot_6.5.1" |
43 | #define __DQUOT_NUM_VERSION__ 6*10000+5*100+1 | 44 | #define __DQUOT_NUM_VERSION__ 6*10000+5*100+1 |
@@ -208,14 +209,13 @@ extern struct dqstats dqstats; | |||
208 | #define DQ_FAKE_B 3 /* no limits only usage */ | 209 | #define DQ_FAKE_B 3 /* no limits only usage */ |
209 | #define DQ_READ_B 4 /* dquot was read into memory */ | 210 | #define DQ_READ_B 4 /* dquot was read into memory */ |
210 | #define DQ_ACTIVE_B 5 /* dquot is active (dquot_release not called) */ | 211 | #define DQ_ACTIVE_B 5 /* dquot is active (dquot_release not called) */ |
211 | #define DQ_WAITFREE_B 6 /* dquot being waited (by invalidate_dquots) */ | ||
212 | 212 | ||
213 | struct dquot { | 213 | struct dquot { |
214 | struct hlist_node dq_hash; /* Hash list in memory */ | 214 | struct hlist_node dq_hash; /* Hash list in memory */ |
215 | struct list_head dq_inuse; /* List of all quotas */ | 215 | struct list_head dq_inuse; /* List of all quotas */ |
216 | struct list_head dq_free; /* Free list element */ | 216 | struct list_head dq_free; /* Free list element */ |
217 | struct list_head dq_dirty; /* List of dirty dquots */ | 217 | struct list_head dq_dirty; /* List of dirty dquots */ |
218 | struct semaphore dq_lock; /* dquot IO lock */ | 218 | struct mutex dq_lock; /* dquot IO lock */ |
219 | atomic_t dq_count; /* Use count */ | 219 | atomic_t dq_count; /* Use count */ |
220 | wait_queue_head_t dq_wait_unused; /* Wait queue for dquot to become unused */ | 220 | wait_queue_head_t dq_wait_unused; /* Wait queue for dquot to become unused */ |
221 | struct super_block *dq_sb; /* superblock this applies to */ | 221 | struct super_block *dq_sb; /* superblock this applies to */ |
@@ -285,8 +285,8 @@ struct quota_format_type { | |||
285 | 285 | ||
286 | struct quota_info { | 286 | struct quota_info { |
287 | unsigned int flags; /* Flags for diskquotas on this device */ | 287 | unsigned int flags; /* Flags for diskquotas on this device */ |
288 | struct semaphore dqio_sem; /* lock device while I/O in progress */ | 288 | struct mutex dqio_mutex; /* lock device while I/O in progress */ |
289 | struct semaphore dqonoff_sem; /* Serialize quotaon & quotaoff */ | 289 | struct mutex dqonoff_mutex; /* Serialize quotaon & quotaoff */ |
290 | struct rw_semaphore dqptr_sem; /* serialize ops using quota_info struct, pointers from inode to dquots */ | 290 | struct rw_semaphore dqptr_sem; /* serialize ops using quota_info struct, pointers from inode to dquots */ |
291 | struct inode *files[MAXQUOTAS]; /* inodes of quotafiles */ | 291 | struct inode *files[MAXQUOTAS]; /* inodes of quotafiles */ |
292 | struct mem_dqinfo info[MAXQUOTAS]; /* Information for each quota type */ | 292 | struct mem_dqinfo info[MAXQUOTAS]; /* Information for each quota type */ |
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h index c57ff2fcb30a..dd83cca28001 100644 --- a/include/linux/radix-tree.h +++ b/include/linux/radix-tree.h | |||
@@ -45,6 +45,8 @@ do { \ | |||
45 | (root)->rnode = NULL; \ | 45 | (root)->rnode = NULL; \ |
46 | } while (0) | 46 | } while (0) |
47 | 47 | ||
48 | #define RADIX_TREE_MAX_TAGS 2 | ||
49 | |||
48 | int radix_tree_insert(struct radix_tree_root *, unsigned long, void *); | 50 | int radix_tree_insert(struct radix_tree_root *, unsigned long, void *); |
49 | void *radix_tree_lookup(struct radix_tree_root *, unsigned long); | 51 | void *radix_tree_lookup(struct radix_tree_root *, unsigned long); |
50 | void **radix_tree_lookup_slot(struct radix_tree_root *, unsigned long); | 52 | void **radix_tree_lookup_slot(struct radix_tree_root *, unsigned long); |
@@ -55,15 +57,16 @@ radix_tree_gang_lookup(struct radix_tree_root *root, void **results, | |||
55 | int radix_tree_preload(gfp_t gfp_mask); | 57 | int radix_tree_preload(gfp_t gfp_mask); |
56 | void radix_tree_init(void); | 58 | void radix_tree_init(void); |
57 | void *radix_tree_tag_set(struct radix_tree_root *root, | 59 | void *radix_tree_tag_set(struct radix_tree_root *root, |
58 | unsigned long index, int tag); | 60 | unsigned long index, unsigned int tag); |
59 | void *radix_tree_tag_clear(struct radix_tree_root *root, | 61 | void *radix_tree_tag_clear(struct radix_tree_root *root, |
60 | unsigned long index, int tag); | 62 | unsigned long index, unsigned int tag); |
61 | int radix_tree_tag_get(struct radix_tree_root *root, | 63 | int radix_tree_tag_get(struct radix_tree_root *root, |
62 | unsigned long index, int tag); | 64 | unsigned long index, unsigned int tag); |
63 | unsigned int | 65 | unsigned int |
64 | radix_tree_gang_lookup_tag(struct radix_tree_root *root, void **results, | 66 | radix_tree_gang_lookup_tag(struct radix_tree_root *root, void **results, |
65 | unsigned long first_index, unsigned int max_items, int tag); | 67 | unsigned long first_index, unsigned int max_items, |
66 | int radix_tree_tagged(struct radix_tree_root *root, int tag); | 68 | unsigned int tag); |
69 | int radix_tree_tagged(struct radix_tree_root *root, unsigned int tag); | ||
67 | 70 | ||
68 | static inline void radix_tree_preload_end(void) | 71 | static inline void radix_tree_preload_end(void) |
69 | { | 72 | { |
diff --git a/include/linux/raid/md.h b/include/linux/raid/md.h index b6e0bcad84e1..66b44e5e0d6e 100644 --- a/include/linux/raid/md.h +++ b/include/linux/raid/md.h | |||
@@ -92,7 +92,10 @@ extern void md_super_write(mddev_t *mddev, mdk_rdev_t *rdev, | |||
92 | extern void md_super_wait(mddev_t *mddev); | 92 | extern void md_super_wait(mddev_t *mddev); |
93 | extern int sync_page_io(struct block_device *bdev, sector_t sector, int size, | 93 | extern int sync_page_io(struct block_device *bdev, sector_t sector, int size, |
94 | struct page *page, int rw); | 94 | struct page *page, int rw); |
95 | extern void md_do_sync(mddev_t *mddev); | ||
96 | extern void md_new_event(mddev_t *mddev); | ||
95 | 97 | ||
98 | extern void md_update_sb(mddev_t * mddev); | ||
96 | 99 | ||
97 | #define MD_BUG(x...) { printk("md: bug in file %s, line %d\n", __FILE__, __LINE__); md_print_devices(); } | 100 | #define MD_BUG(x...) { printk("md: bug in file %s, line %d\n", __FILE__, __LINE__); md_print_devices(); } |
98 | 101 | ||
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index 617b9506c760..e2df61f5b09a 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h | |||
@@ -132,6 +132,14 @@ struct mddev_s | |||
132 | 132 | ||
133 | char uuid[16]; | 133 | char uuid[16]; |
134 | 134 | ||
135 | /* If the array is being reshaped, we need to record the | ||
136 | * new shape and an indication of where we are up to. | ||
137 | * This is written to the superblock. | ||
138 | * If reshape_position is MaxSector, then no reshape is happening (yet). | ||
139 | */ | ||
140 | sector_t reshape_position; | ||
141 | int delta_disks, new_level, new_layout, new_chunk; | ||
142 | |||
135 | struct mdk_thread_s *thread; /* management thread */ | 143 | struct mdk_thread_s *thread; /* management thread */ |
136 | struct mdk_thread_s *sync_thread; /* doing resync or reconstruct */ | 144 | struct mdk_thread_s *sync_thread; /* doing resync or reconstruct */ |
137 | sector_t curr_resync; /* blocks scheduled */ | 145 | sector_t curr_resync; /* blocks scheduled */ |
@@ -143,6 +151,10 @@ struct mddev_s | |||
143 | sector_t resync_mismatches; /* count of sectors where | 151 | sector_t resync_mismatches; /* count of sectors where |
144 | * parity/replica mismatch found | 152 | * parity/replica mismatch found |
145 | */ | 153 | */ |
154 | |||
155 | /* allow user-space to request suspension of IO to regions of the array */ | ||
156 | sector_t suspend_lo; | ||
157 | sector_t suspend_hi; | ||
146 | /* if zero, use the system-wide default */ | 158 | /* if zero, use the system-wide default */ |
147 | int sync_speed_min; | 159 | int sync_speed_min; |
148 | int sync_speed_max; | 160 | int sync_speed_max; |
@@ -157,6 +169,9 @@ struct mddev_s | |||
157 | * DONE: thread is done and is waiting to be reaped | 169 | * DONE: thread is done and is waiting to be reaped |
158 | * REQUEST: user-space has requested a sync (used with SYNC) | 170 | * REQUEST: user-space has requested a sync (used with SYNC) |
159 | * CHECK: user-space request for for check-only, no repair | 171 | * CHECK: user-space request for for check-only, no repair |
172 | * RESHAPE: A reshape is happening | ||
173 | * | ||
174 | * If neither SYNC or RESHAPE are set, then it is a recovery. | ||
160 | */ | 175 | */ |
161 | #define MD_RECOVERY_RUNNING 0 | 176 | #define MD_RECOVERY_RUNNING 0 |
162 | #define MD_RECOVERY_SYNC 1 | 177 | #define MD_RECOVERY_SYNC 1 |
@@ -166,10 +181,11 @@ struct mddev_s | |||
166 | #define MD_RECOVERY_NEEDED 5 | 181 | #define MD_RECOVERY_NEEDED 5 |
167 | #define MD_RECOVERY_REQUESTED 6 | 182 | #define MD_RECOVERY_REQUESTED 6 |
168 | #define MD_RECOVERY_CHECK 7 | 183 | #define MD_RECOVERY_CHECK 7 |
184 | #define MD_RECOVERY_RESHAPE 8 | ||
169 | unsigned long recovery; | 185 | unsigned long recovery; |
170 | 186 | ||
171 | int in_sync; /* know to not need resync */ | 187 | int in_sync; /* know to not need resync */ |
172 | struct semaphore reconfig_sem; | 188 | struct mutex reconfig_mutex; |
173 | atomic_t active; | 189 | atomic_t active; |
174 | 190 | ||
175 | int changed; /* true if we might need to reread partition info */ | 191 | int changed; /* true if we might need to reread partition info */ |
@@ -249,7 +265,8 @@ struct mdk_personality | |||
249 | int (*spare_active) (mddev_t *mddev); | 265 | int (*spare_active) (mddev_t *mddev); |
250 | sector_t (*sync_request)(mddev_t *mddev, sector_t sector_nr, int *skipped, int go_faster); | 266 | sector_t (*sync_request)(mddev_t *mddev, sector_t sector_nr, int *skipped, int go_faster); |
251 | int (*resize) (mddev_t *mddev, sector_t sectors); | 267 | int (*resize) (mddev_t *mddev, sector_t sectors); |
252 | int (*reshape) (mddev_t *mddev, int raid_disks); | 268 | int (*check_reshape) (mddev_t *mddev); |
269 | int (*start_reshape) (mddev_t *mddev); | ||
253 | int (*reconfig) (mddev_t *mddev, int layout, int chunk_size); | 270 | int (*reconfig) (mddev_t *mddev, int layout, int chunk_size); |
254 | /* quiesce moves between quiescence states | 271 | /* quiesce moves between quiescence states |
255 | * 0 - fully active | 272 | * 0 - fully active |
diff --git a/include/linux/raid/md_p.h b/include/linux/raid/md_p.h index c100fa5d4bfa..774e1acfb8c4 100644 --- a/include/linux/raid/md_p.h +++ b/include/linux/raid/md_p.h | |||
@@ -102,6 +102,18 @@ typedef struct mdp_device_descriptor_s { | |||
102 | #define MD_SB_ERRORS 1 | 102 | #define MD_SB_ERRORS 1 |
103 | 103 | ||
104 | #define MD_SB_BITMAP_PRESENT 8 /* bitmap may be present nearby */ | 104 | #define MD_SB_BITMAP_PRESENT 8 /* bitmap may be present nearby */ |
105 | |||
106 | /* | ||
107 | * Notes: | ||
108 | * - if an array is being reshaped (restriped) in order to change the | ||
109 | * the number of active devices in the array, 'raid_disks' will be | ||
110 | * the larger of the old and new numbers. 'delta_disks' will | ||
111 | * be the "new - old". So if +ve, raid_disks is the new value, and | ||
112 | * "raid_disks-delta_disks" is the old. If -ve, raid_disks is the | ||
113 | * old value and "raid_disks+delta_disks" is the new (smaller) value. | ||
114 | */ | ||
115 | |||
116 | |||
105 | typedef struct mdp_superblock_s { | 117 | typedef struct mdp_superblock_s { |
106 | /* | 118 | /* |
107 | * Constant generic information | 119 | * Constant generic information |
@@ -146,7 +158,13 @@ typedef struct mdp_superblock_s { | |||
146 | __u32 cp_events_hi; /* 10 high-order of checkpoint update count */ | 158 | __u32 cp_events_hi; /* 10 high-order of checkpoint update count */ |
147 | #endif | 159 | #endif |
148 | __u32 recovery_cp; /* 11 recovery checkpoint sector count */ | 160 | __u32 recovery_cp; /* 11 recovery checkpoint sector count */ |
149 | __u32 gstate_sreserved[MD_SB_GENERIC_STATE_WORDS - 12]; | 161 | /* There are only valid for minor_version > 90 */ |
162 | __u64 reshape_position; /* 12,13 next address in array-space for reshape */ | ||
163 | __u32 new_level; /* 14 new level we are reshaping to */ | ||
164 | __u32 delta_disks; /* 15 change in number of raid_disks */ | ||
165 | __u32 new_layout; /* 16 new layout */ | ||
166 | __u32 new_chunk; /* 17 new chunk size (bytes) */ | ||
167 | __u32 gstate_sreserved[MD_SB_GENERIC_STATE_WORDS - 18]; | ||
150 | 168 | ||
151 | /* | 169 | /* |
152 | * Personality information | 170 | * Personality information |
@@ -207,7 +225,14 @@ struct mdp_superblock_1 { | |||
207 | * NOTE: signed, so bitmap can be before superblock | 225 | * NOTE: signed, so bitmap can be before superblock |
208 | * only meaningful of feature_map[0] is set. | 226 | * only meaningful of feature_map[0] is set. |
209 | */ | 227 | */ |
210 | __u8 pad1[128-100]; /* set to 0 when written */ | 228 | |
229 | /* These are only valid with feature bit '4' */ | ||
230 | __u64 reshape_position; /* next address in array-space for reshape */ | ||
231 | __u32 new_level; /* new level we are reshaping to */ | ||
232 | __u32 delta_disks; /* change in number of raid_disks */ | ||
233 | __u32 new_layout; /* new layout */ | ||
234 | __u32 new_chunk; /* new chunk size (bytes) */ | ||
235 | __u8 pad1[128-124]; /* set to 0 when written */ | ||
211 | 236 | ||
212 | /* constant this-device information - 64 bytes */ | 237 | /* constant this-device information - 64 bytes */ |
213 | __u64 data_offset; /* sector start of data, often 0 */ | 238 | __u64 data_offset; /* sector start of data, often 0 */ |
@@ -240,8 +265,9 @@ struct mdp_superblock_1 { | |||
240 | 265 | ||
241 | /* feature_map bits */ | 266 | /* feature_map bits */ |
242 | #define MD_FEATURE_BITMAP_OFFSET 1 | 267 | #define MD_FEATURE_BITMAP_OFFSET 1 |
268 | #define MD_FEATURE_RESHAPE_ACTIVE 4 | ||
243 | 269 | ||
244 | #define MD_FEATURE_ALL 1 | 270 | #define MD_FEATURE_ALL 5 |
245 | 271 | ||
246 | #endif | 272 | #endif |
247 | 273 | ||
diff --git a/include/linux/raid/raid1.h b/include/linux/raid/raid1.h index 9d5494aaac0f..3009c813d83d 100644 --- a/include/linux/raid/raid1.h +++ b/include/linux/raid/raid1.h | |||
@@ -130,6 +130,6 @@ struct r1bio_s { | |||
130 | * with failure when last write completes (and all failed). | 130 | * with failure when last write completes (and all failed). |
131 | * Record that bi_end_io was called with this flag... | 131 | * Record that bi_end_io was called with this flag... |
132 | */ | 132 | */ |
133 | #define R1BIO_Returned 4 | 133 | #define R1BIO_Returned 6 |
134 | 134 | ||
135 | #endif | 135 | #endif |
diff --git a/include/linux/raid/raid5.h b/include/linux/raid/raid5.h index 394da8207b34..914af667044f 100644 --- a/include/linux/raid/raid5.h +++ b/include/linux/raid/raid5.h | |||
@@ -135,6 +135,7 @@ struct stripe_head { | |||
135 | atomic_t count; /* nr of active thread/requests */ | 135 | atomic_t count; /* nr of active thread/requests */ |
136 | spinlock_t lock; | 136 | spinlock_t lock; |
137 | int bm_seq; /* sequence number for bitmap flushes */ | 137 | int bm_seq; /* sequence number for bitmap flushes */ |
138 | int disks; /* disks in stripe */ | ||
138 | struct r5dev { | 139 | struct r5dev { |
139 | struct bio req; | 140 | struct bio req; |
140 | struct bio_vec vec; | 141 | struct bio_vec vec; |
@@ -156,6 +157,7 @@ struct stripe_head { | |||
156 | #define R5_ReadError 8 /* seen a read error here recently */ | 157 | #define R5_ReadError 8 /* seen a read error here recently */ |
157 | #define R5_ReWrite 9 /* have tried to over-write the readerror */ | 158 | #define R5_ReWrite 9 /* have tried to over-write the readerror */ |
158 | 159 | ||
160 | #define R5_Expanded 10 /* This block now has post-expand data */ | ||
159 | /* | 161 | /* |
160 | * Write method | 162 | * Write method |
161 | */ | 163 | */ |
@@ -174,7 +176,9 @@ struct stripe_head { | |||
174 | #define STRIPE_DELAYED 6 | 176 | #define STRIPE_DELAYED 6 |
175 | #define STRIPE_DEGRADED 7 | 177 | #define STRIPE_DEGRADED 7 |
176 | #define STRIPE_BIT_DELAY 8 | 178 | #define STRIPE_BIT_DELAY 8 |
177 | 179 | #define STRIPE_EXPANDING 9 | |
180 | #define STRIPE_EXPAND_SOURCE 10 | ||
181 | #define STRIPE_EXPAND_READY 11 | ||
178 | /* | 182 | /* |
179 | * Plugging: | 183 | * Plugging: |
180 | * | 184 | * |
@@ -211,12 +215,24 @@ struct raid5_private_data { | |||
211 | int raid_disks, working_disks, failed_disks; | 215 | int raid_disks, working_disks, failed_disks; |
212 | int max_nr_stripes; | 216 | int max_nr_stripes; |
213 | 217 | ||
218 | /* used during an expand */ | ||
219 | sector_t expand_progress; /* MaxSector when no expand happening */ | ||
220 | sector_t expand_lo; /* from here up to expand_progress it out-of-bounds | ||
221 | * as we haven't flushed the metadata yet | ||
222 | */ | ||
223 | int previous_raid_disks; | ||
224 | |||
214 | struct list_head handle_list; /* stripes needing handling */ | 225 | struct list_head handle_list; /* stripes needing handling */ |
215 | struct list_head delayed_list; /* stripes that have plugged requests */ | 226 | struct list_head delayed_list; /* stripes that have plugged requests */ |
216 | struct list_head bitmap_list; /* stripes delaying awaiting bitmap update */ | 227 | struct list_head bitmap_list; /* stripes delaying awaiting bitmap update */ |
217 | atomic_t preread_active_stripes; /* stripes with scheduled io */ | 228 | atomic_t preread_active_stripes; /* stripes with scheduled io */ |
218 | 229 | ||
219 | char cache_name[20]; | 230 | atomic_t reshape_stripes; /* stripes with pending writes for reshape */ |
231 | /* unfortunately we need two cache names as we temporarily have | ||
232 | * two caches. | ||
233 | */ | ||
234 | int active_name; | ||
235 | char cache_name[2][20]; | ||
220 | kmem_cache_t *slab_cache; /* for allocating stripes */ | 236 | kmem_cache_t *slab_cache; /* for allocating stripes */ |
221 | 237 | ||
222 | int seq_flush, seq_write; | 238 | int seq_flush, seq_write; |
@@ -238,9 +254,10 @@ struct raid5_private_data { | |||
238 | wait_queue_head_t wait_for_overlap; | 254 | wait_queue_head_t wait_for_overlap; |
239 | int inactive_blocked; /* release of inactive stripes blocked, | 255 | int inactive_blocked; /* release of inactive stripes blocked, |
240 | * waiting for 25% to be free | 256 | * waiting for 25% to be free |
241 | */ | 257 | */ |
258 | int pool_size; /* number of disks in stripeheads in pool */ | ||
242 | spinlock_t device_lock; | 259 | spinlock_t device_lock; |
243 | struct disk_info disks[0]; | 260 | struct disk_info *disks; |
244 | }; | 261 | }; |
245 | 262 | ||
246 | typedef struct raid5_private_data raid5_conf_t; | 263 | typedef struct raid5_private_data raid5_conf_t; |
diff --git a/include/linux/ramfs.h b/include/linux/ramfs.h index 953b6df5d037..78ecfa28b1c2 100644 --- a/include/linux/ramfs.h +++ b/include/linux/ramfs.h | |||
@@ -15,7 +15,7 @@ extern unsigned long ramfs_nommu_get_unmapped_area(struct file *file, | |||
15 | extern int ramfs_nommu_mmap(struct file *file, struct vm_area_struct *vma); | 15 | extern int ramfs_nommu_mmap(struct file *file, struct vm_area_struct *vma); |
16 | #endif | 16 | #endif |
17 | 17 | ||
18 | extern struct file_operations ramfs_file_operations; | 18 | extern const struct file_operations ramfs_file_operations; |
19 | extern struct vm_operations_struct generic_file_vm_ops; | 19 | extern struct vm_operations_struct generic_file_vm_ops; |
20 | 20 | ||
21 | #endif | 21 | #endif |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index c2ec6c77874e..5673008b61e1 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -113,8 +113,6 @@ struct rcu_data { | |||
113 | 113 | ||
114 | DECLARE_PER_CPU(struct rcu_data, rcu_data); | 114 | DECLARE_PER_CPU(struct rcu_data, rcu_data); |
115 | DECLARE_PER_CPU(struct rcu_data, rcu_bh_data); | 115 | DECLARE_PER_CPU(struct rcu_data, rcu_bh_data); |
116 | extern struct rcu_ctrlblk rcu_ctrlblk; | ||
117 | extern struct rcu_ctrlblk rcu_bh_ctrlblk; | ||
118 | 116 | ||
119 | /* | 117 | /* |
120 | * Increment the quiescent state counter. | 118 | * Increment the quiescent state counter. |
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index dad78cecfd20..5676c4210e2c 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h | |||
@@ -1704,6 +1704,11 @@ static inline int reiserfs_transaction_running(struct super_block *s) | |||
1704 | return 0; | 1704 | return 0; |
1705 | } | 1705 | } |
1706 | 1706 | ||
1707 | static inline int reiserfs_transaction_free_space(struct reiserfs_transaction_handle *th) | ||
1708 | { | ||
1709 | return th->t_blocks_allocated - th->t_blocks_logged; | ||
1710 | } | ||
1711 | |||
1707 | int reiserfs_async_progress_wait(struct super_block *s); | 1712 | int reiserfs_async_progress_wait(struct super_block *s); |
1708 | 1713 | ||
1709 | struct reiserfs_transaction_handle *reiserfs_persistent_transaction(struct | 1714 | struct reiserfs_transaction_handle *reiserfs_persistent_transaction(struct |
@@ -1955,7 +1960,7 @@ int reiserfs_global_version_in_proc(char *buffer, char **start, off_t offset, | |||
1955 | extern struct inode_operations reiserfs_dir_inode_operations; | 1960 | extern struct inode_operations reiserfs_dir_inode_operations; |
1956 | extern struct inode_operations reiserfs_symlink_inode_operations; | 1961 | extern struct inode_operations reiserfs_symlink_inode_operations; |
1957 | extern struct inode_operations reiserfs_special_inode_operations; | 1962 | extern struct inode_operations reiserfs_special_inode_operations; |
1958 | extern struct file_operations reiserfs_dir_operations; | 1963 | extern const struct file_operations reiserfs_dir_operations; |
1959 | 1964 | ||
1960 | /* tail_conversion.c */ | 1965 | /* tail_conversion.c */ |
1961 | int direct2indirect(struct reiserfs_transaction_handle *, struct inode *, | 1966 | int direct2indirect(struct reiserfs_transaction_handle *, struct inode *, |
@@ -1967,7 +1972,7 @@ void reiserfs_unmap_buffer(struct buffer_head *); | |||
1967 | 1972 | ||
1968 | /* file.c */ | 1973 | /* file.c */ |
1969 | extern struct inode_operations reiserfs_file_inode_operations; | 1974 | extern struct inode_operations reiserfs_file_inode_operations; |
1970 | extern struct file_operations reiserfs_file_operations; | 1975 | extern const struct file_operations reiserfs_file_operations; |
1971 | extern struct address_space_operations reiserfs_address_space_operations; | 1976 | extern struct address_space_operations reiserfs_address_space_operations; |
1972 | 1977 | ||
1973 | /* fix_nodes.c */ | 1978 | /* fix_nodes.c */ |
diff --git a/include/linux/reiserfs_xattr.h b/include/linux/reiserfs_xattr.h index 87280eb6083d..5353afb11db3 100644 --- a/include/linux/reiserfs_xattr.h +++ b/include/linux/reiserfs_xattr.h | |||
@@ -101,13 +101,13 @@ static inline void reiserfs_mark_inode_private(struct inode *inode) | |||
101 | #else | 101 | #else |
102 | 102 | ||
103 | #define is_reiserfs_priv_object(inode) 0 | 103 | #define is_reiserfs_priv_object(inode) 0 |
104 | #define reiserfs_mark_inode_private(inode) | 104 | #define reiserfs_mark_inode_private(inode) do {;} while(0) |
105 | #define reiserfs_getxattr NULL | 105 | #define reiserfs_getxattr NULL |
106 | #define reiserfs_setxattr NULL | 106 | #define reiserfs_setxattr NULL |
107 | #define reiserfs_listxattr NULL | 107 | #define reiserfs_listxattr NULL |
108 | #define reiserfs_removexattr NULL | 108 | #define reiserfs_removexattr NULL |
109 | #define reiserfs_write_lock_xattrs(sb) | 109 | #define reiserfs_write_lock_xattrs(sb) do {;} while(0) |
110 | #define reiserfs_write_unlock_xattrs(sb) | 110 | #define reiserfs_write_unlock_xattrs(sb) do {;} while(0) |
111 | #define reiserfs_read_lock_xattrs(sb) | 111 | #define reiserfs_read_lock_xattrs(sb) |
112 | #define reiserfs_read_unlock_xattrs(sb) | 112 | #define reiserfs_read_unlock_xattrs(sb) |
113 | 113 | ||
diff --git a/include/linux/relayfs_fs.h b/include/linux/relay.h index 7342e66247fb..4bcc1531d6a9 100644 --- a/include/linux/relayfs_fs.h +++ b/include/linux/relay.h | |||
@@ -1,14 +1,14 @@ | |||
1 | /* | 1 | /* |
2 | * linux/include/linux/relayfs_fs.h | 2 | * linux/include/linux/relay.h |
3 | * | 3 | * |
4 | * Copyright (C) 2002, 2003 - Tom Zanussi (zanussi@us.ibm.com), IBM Corp | 4 | * Copyright (C) 2002, 2003 - Tom Zanussi (zanussi@us.ibm.com), IBM Corp |
5 | * Copyright (C) 1999, 2000, 2001, 2002 - Karim Yaghmour (karim@opersys.com) | 5 | * Copyright (C) 1999, 2000, 2001, 2002 - Karim Yaghmour (karim@opersys.com) |
6 | * | 6 | * |
7 | * RelayFS definitions and declarations | 7 | * CONFIG_RELAY definitions and declarations |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #ifndef _LINUX_RELAYFS_FS_H | 10 | #ifndef _LINUX_RELAY_H |
11 | #define _LINUX_RELAYFS_FS_H | 11 | #define _LINUX_RELAY_H |
12 | 12 | ||
13 | #include <linux/config.h> | 13 | #include <linux/config.h> |
14 | #include <linux/types.h> | 14 | #include <linux/types.h> |
@@ -19,6 +19,9 @@ | |||
19 | #include <linux/poll.h> | 19 | #include <linux/poll.h> |
20 | #include <linux/kref.h> | 20 | #include <linux/kref.h> |
21 | 21 | ||
22 | /* Needs a _much_ better name... */ | ||
23 | #define FIX_SIZE(x) ((((x) - 1) & PAGE_MASK) + PAGE_SIZE) | ||
24 | |||
22 | /* | 25 | /* |
23 | * Tracks changes to rchan/rchan_buf structs | 26 | * Tracks changes to rchan/rchan_buf structs |
24 | */ | 27 | */ |
@@ -92,26 +95,26 @@ struct rchan_callbacks | |||
92 | size_t prev_padding); | 95 | size_t prev_padding); |
93 | 96 | ||
94 | /* | 97 | /* |
95 | * buf_mapped - relayfs buffer mmap notification | 98 | * buf_mapped - relay buffer mmap notification |
96 | * @buf: the channel buffer | 99 | * @buf: the channel buffer |
97 | * @filp: relayfs file pointer | 100 | * @filp: relay file pointer |
98 | * | 101 | * |
99 | * Called when a relayfs file is successfully mmapped | 102 | * Called when a relay file is successfully mmapped |
100 | */ | 103 | */ |
101 | void (*buf_mapped)(struct rchan_buf *buf, | 104 | void (*buf_mapped)(struct rchan_buf *buf, |
102 | struct file *filp); | 105 | struct file *filp); |
103 | 106 | ||
104 | /* | 107 | /* |
105 | * buf_unmapped - relayfs buffer unmap notification | 108 | * buf_unmapped - relay buffer unmap notification |
106 | * @buf: the channel buffer | 109 | * @buf: the channel buffer |
107 | * @filp: relayfs file pointer | 110 | * @filp: relay file pointer |
108 | * | 111 | * |
109 | * Called when a relayfs file is successfully unmapped | 112 | * Called when a relay file is successfully unmapped |
110 | */ | 113 | */ |
111 | void (*buf_unmapped)(struct rchan_buf *buf, | 114 | void (*buf_unmapped)(struct rchan_buf *buf, |
112 | struct file *filp); | 115 | struct file *filp); |
113 | /* | 116 | /* |
114 | * create_buf_file - create file to represent a relayfs channel buffer | 117 | * create_buf_file - create file to represent a relay channel buffer |
115 | * @filename: the name of the file to create | 118 | * @filename: the name of the file to create |
116 | * @parent: the parent of the file to create | 119 | * @parent: the parent of the file to create |
117 | * @mode: the mode of the file to create | 120 | * @mode: the mode of the file to create |
@@ -121,7 +124,7 @@ struct rchan_callbacks | |||
121 | * Called during relay_open(), once for each per-cpu buffer, | 124 | * Called during relay_open(), once for each per-cpu buffer, |
122 | * to allow the client to create a file to be used to | 125 | * to allow the client to create a file to be used to |
123 | * represent the corresponding channel buffer. If the file is | 126 | * represent the corresponding channel buffer. If the file is |
124 | * created outside of relayfs, the parent must also exist in | 127 | * created outside of relay, the parent must also exist in |
125 | * that filesystem. | 128 | * that filesystem. |
126 | * | 129 | * |
127 | * The callback should return the dentry of the file created | 130 | * The callback should return the dentry of the file created |
@@ -140,7 +143,7 @@ struct rchan_callbacks | |||
140 | int *is_global); | 143 | int *is_global); |
141 | 144 | ||
142 | /* | 145 | /* |
143 | * remove_buf_file - remove file representing a relayfs channel buffer | 146 | * remove_buf_file - remove file representing a relay channel buffer |
144 | * @dentry: the dentry of the file to remove | 147 | * @dentry: the dentry of the file to remove |
145 | * | 148 | * |
146 | * Called during relay_close(), once for each per-cpu buffer, | 149 | * Called during relay_close(), once for each per-cpu buffer, |
@@ -153,7 +156,7 @@ struct rchan_callbacks | |||
153 | }; | 156 | }; |
154 | 157 | ||
155 | /* | 158 | /* |
156 | * relayfs kernel API, fs/relayfs/relay.c | 159 | * CONFIG_RELAY kernel API, kernel/relay.c |
157 | */ | 160 | */ |
158 | 161 | ||
159 | struct rchan *relay_open(const char *base_filename, | 162 | struct rchan *relay_open(const char *base_filename, |
@@ -171,15 +174,6 @@ extern int relay_buf_full(struct rchan_buf *buf); | |||
171 | 174 | ||
172 | extern size_t relay_switch_subbuf(struct rchan_buf *buf, | 175 | extern size_t relay_switch_subbuf(struct rchan_buf *buf, |
173 | size_t length); | 176 | size_t length); |
174 | extern struct dentry *relayfs_create_dir(const char *name, | ||
175 | struct dentry *parent); | ||
176 | extern int relayfs_remove_dir(struct dentry *dentry); | ||
177 | extern struct dentry *relayfs_create_file(const char *name, | ||
178 | struct dentry *parent, | ||
179 | int mode, | ||
180 | struct file_operations *fops, | ||
181 | void *data); | ||
182 | extern int relayfs_remove_file(struct dentry *dentry); | ||
183 | 177 | ||
184 | /** | 178 | /** |
185 | * relay_write - write data into the channel | 179 | * relay_write - write data into the channel |
@@ -279,9 +273,9 @@ static inline void subbuf_start_reserve(struct rchan_buf *buf, | |||
279 | } | 273 | } |
280 | 274 | ||
281 | /* | 275 | /* |
282 | * exported relay file operations, fs/relayfs/inode.c | 276 | * exported relay file operations, kernel/relay.c |
283 | */ | 277 | */ |
284 | extern struct file_operations relay_file_operations; | 278 | extern struct file_operations relay_file_operations; |
285 | 279 | ||
286 | #endif /* _LINUX_RELAYFS_FS_H */ | 280 | #endif /* _LINUX_RELAY_H */ |
287 | 281 | ||
diff --git a/include/linux/rtc.h b/include/linux/rtc.h index 0b2ba67ff13c..ab61cd1199f2 100644 --- a/include/linux/rtc.h +++ b/include/linux/rtc.h | |||
@@ -11,8 +11,6 @@ | |||
11 | #ifndef _LINUX_RTC_H_ | 11 | #ifndef _LINUX_RTC_H_ |
12 | #define _LINUX_RTC_H_ | 12 | #define _LINUX_RTC_H_ |
13 | 13 | ||
14 | #include <linux/interrupt.h> | ||
15 | |||
16 | /* | 14 | /* |
17 | * The struct used to pass data via the following ioctl. Similar to the | 15 | * The struct used to pass data via the following ioctl. Similar to the |
18 | * struct tm in <time.h>, but it needs to be here so that the kernel | 16 | * struct tm in <time.h>, but it needs to be here so that the kernel |
@@ -93,8 +91,102 @@ struct rtc_pll_info { | |||
93 | #define RTC_PLL_GET _IOR('p', 0x11, struct rtc_pll_info) /* Get PLL correction */ | 91 | #define RTC_PLL_GET _IOR('p', 0x11, struct rtc_pll_info) /* Get PLL correction */ |
94 | #define RTC_PLL_SET _IOW('p', 0x12, struct rtc_pll_info) /* Set PLL correction */ | 92 | #define RTC_PLL_SET _IOW('p', 0x12, struct rtc_pll_info) /* Set PLL correction */ |
95 | 93 | ||
94 | /* interrupt flags */ | ||
95 | #define RTC_IRQF 0x80 /* any of the following is active */ | ||
96 | #define RTC_PF 0x40 | ||
97 | #define RTC_AF 0x20 | ||
98 | #define RTC_UF 0x10 | ||
99 | |||
96 | #ifdef __KERNEL__ | 100 | #ifdef __KERNEL__ |
97 | 101 | ||
102 | #include <linux/interrupt.h> | ||
103 | |||
104 | extern int rtc_month_days(unsigned int month, unsigned int year); | ||
105 | extern int rtc_valid_tm(struct rtc_time *tm); | ||
106 | extern int rtc_tm_to_time(struct rtc_time *tm, unsigned long *time); | ||
107 | extern void rtc_time_to_tm(unsigned long time, struct rtc_time *tm); | ||
108 | |||
109 | #include <linux/device.h> | ||
110 | #include <linux/seq_file.h> | ||
111 | #include <linux/cdev.h> | ||
112 | #include <linux/poll.h> | ||
113 | #include <linux/mutex.h> | ||
114 | |||
115 | extern struct class *rtc_class; | ||
116 | |||
117 | struct rtc_class_ops { | ||
118 | int (*open)(struct device *); | ||
119 | void (*release)(struct device *); | ||
120 | int (*ioctl)(struct device *, unsigned int, unsigned long); | ||
121 | int (*read_time)(struct device *, struct rtc_time *); | ||
122 | int (*set_time)(struct device *, struct rtc_time *); | ||
123 | int (*read_alarm)(struct device *, struct rtc_wkalrm *); | ||
124 | int (*set_alarm)(struct device *, struct rtc_wkalrm *); | ||
125 | int (*proc)(struct device *, struct seq_file *); | ||
126 | int (*set_mmss)(struct device *, unsigned long secs); | ||
127 | int (*irq_set_state)(struct device *, int enabled); | ||
128 | int (*irq_set_freq)(struct device *, int freq); | ||
129 | int (*read_callback)(struct device *, int data); | ||
130 | }; | ||
131 | |||
132 | #define RTC_DEVICE_NAME_SIZE 20 | ||
133 | struct rtc_task; | ||
134 | |||
135 | struct rtc_device | ||
136 | { | ||
137 | struct class_device class_dev; | ||
138 | struct module *owner; | ||
139 | |||
140 | int id; | ||
141 | char name[RTC_DEVICE_NAME_SIZE]; | ||
142 | |||
143 | struct rtc_class_ops *ops; | ||
144 | struct mutex ops_lock; | ||
145 | |||
146 | struct class_device *rtc_dev; | ||
147 | struct cdev char_dev; | ||
148 | struct mutex char_lock; | ||
149 | |||
150 | unsigned long irq_data; | ||
151 | spinlock_t irq_lock; | ||
152 | wait_queue_head_t irq_queue; | ||
153 | struct fasync_struct *async_queue; | ||
154 | |||
155 | struct rtc_task *irq_task; | ||
156 | spinlock_t irq_task_lock; | ||
157 | int irq_freq; | ||
158 | }; | ||
159 | #define to_rtc_device(d) container_of(d, struct rtc_device, class_dev) | ||
160 | |||
161 | extern struct rtc_device *rtc_device_register(const char *name, | ||
162 | struct device *dev, | ||
163 | struct rtc_class_ops *ops, | ||
164 | struct module *owner); | ||
165 | extern void rtc_device_unregister(struct rtc_device *rdev); | ||
166 | extern int rtc_interface_register(struct class_interface *intf); | ||
167 | |||
168 | extern int rtc_read_time(struct class_device *class_dev, struct rtc_time *tm); | ||
169 | extern int rtc_set_time(struct class_device *class_dev, struct rtc_time *tm); | ||
170 | extern int rtc_set_mmss(struct class_device *class_dev, unsigned long secs); | ||
171 | extern int rtc_read_alarm(struct class_device *class_dev, | ||
172 | struct rtc_wkalrm *alrm); | ||
173 | extern int rtc_set_alarm(struct class_device *class_dev, | ||
174 | struct rtc_wkalrm *alrm); | ||
175 | extern void rtc_update_irq(struct class_device *class_dev, | ||
176 | unsigned long num, unsigned long events); | ||
177 | |||
178 | extern struct class_device *rtc_class_open(char *name); | ||
179 | extern void rtc_class_close(struct class_device *class_dev); | ||
180 | |||
181 | extern int rtc_irq_register(struct class_device *class_dev, | ||
182 | struct rtc_task *task); | ||
183 | extern void rtc_irq_unregister(struct class_device *class_dev, | ||
184 | struct rtc_task *task); | ||
185 | extern int rtc_irq_set_state(struct class_device *class_dev, | ||
186 | struct rtc_task *task, int enabled); | ||
187 | extern int rtc_irq_set_freq(struct class_device *class_dev, | ||
188 | struct rtc_task *task, int freq); | ||
189 | |||
98 | typedef struct rtc_task { | 190 | typedef struct rtc_task { |
99 | void (*func)(void *private_data); | 191 | void (*func)(void *private_data); |
100 | void *private_data; | 192 | void *private_data; |
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index d572d5376319..df0cdd41085c 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
@@ -839,6 +839,7 @@ enum | |||
839 | #define RTMGRP_IPV4_IFADDR 0x10 | 839 | #define RTMGRP_IPV4_IFADDR 0x10 |
840 | #define RTMGRP_IPV4_MROUTE 0x20 | 840 | #define RTMGRP_IPV4_MROUTE 0x20 |
841 | #define RTMGRP_IPV4_ROUTE 0x40 | 841 | #define RTMGRP_IPV4_ROUTE 0x40 |
842 | #define RTMGRP_IPV4_RULE 0x80 | ||
842 | 843 | ||
843 | #define RTMGRP_IPV6_IFADDR 0x100 | 844 | #define RTMGRP_IPV6_IFADDR 0x100 |
844 | #define RTMGRP_IPV6_MROUTE 0x200 | 845 | #define RTMGRP_IPV6_MROUTE 0x200 |
@@ -869,7 +870,8 @@ enum rtnetlink_groups { | |||
869 | #define RTNLGRP_IPV4_MROUTE RTNLGRP_IPV4_MROUTE | 870 | #define RTNLGRP_IPV4_MROUTE RTNLGRP_IPV4_MROUTE |
870 | RTNLGRP_IPV4_ROUTE, | 871 | RTNLGRP_IPV4_ROUTE, |
871 | #define RTNLGRP_IPV4_ROUTE RTNLGRP_IPV4_ROUTE | 872 | #define RTNLGRP_IPV4_ROUTE RTNLGRP_IPV4_ROUTE |
872 | RTNLGRP_NOP1, | 873 | RTNLGRP_IPV4_RULE, |
874 | #define RTNLGRP_IPV4_RULE RTNLGRP_IPV4_RULE | ||
873 | RTNLGRP_IPV6_IFADDR, | 875 | RTNLGRP_IPV6_IFADDR, |
874 | #define RTNLGRP_IPV6_IFADDR RTNLGRP_IPV6_IFADDR | 876 | #define RTNLGRP_IPV6_IFADDR RTNLGRP_IPV6_IFADDR |
875 | RTNLGRP_IPV6_MROUTE, | 877 | RTNLGRP_IPV6_MROUTE, |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 62e6314382f0..d04186d8cc68 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -35,6 +35,7 @@ | |||
35 | #include <linux/topology.h> | 35 | #include <linux/topology.h> |
36 | #include <linux/seccomp.h> | 36 | #include <linux/seccomp.h> |
37 | #include <linux/rcupdate.h> | 37 | #include <linux/rcupdate.h> |
38 | #include <linux/futex.h> | ||
38 | 39 | ||
39 | #include <linux/auxvec.h> /* For AT_VECTOR_SIZE */ | 40 | #include <linux/auxvec.h> /* For AT_VECTOR_SIZE */ |
40 | 41 | ||
@@ -206,11 +207,11 @@ extern void update_process_times(int user); | |||
206 | extern void scheduler_tick(void); | 207 | extern void scheduler_tick(void); |
207 | 208 | ||
208 | #ifdef CONFIG_DETECT_SOFTLOCKUP | 209 | #ifdef CONFIG_DETECT_SOFTLOCKUP |
209 | extern void softlockup_tick(struct pt_regs *regs); | 210 | extern void softlockup_tick(void); |
210 | extern void spawn_softlockup_task(void); | 211 | extern void spawn_softlockup_task(void); |
211 | extern void touch_softlockup_watchdog(void); | 212 | extern void touch_softlockup_watchdog(void); |
212 | #else | 213 | #else |
213 | static inline void softlockup_tick(struct pt_regs *regs) | 214 | static inline void softlockup_tick(void) |
214 | { | 215 | { |
215 | } | 216 | } |
216 | static inline void spawn_softlockup_task(void) | 217 | static inline void spawn_softlockup_task(void) |
@@ -354,16 +355,8 @@ struct sighand_struct { | |||
354 | atomic_t count; | 355 | atomic_t count; |
355 | struct k_sigaction action[_NSIG]; | 356 | struct k_sigaction action[_NSIG]; |
356 | spinlock_t siglock; | 357 | spinlock_t siglock; |
357 | struct rcu_head rcu; | ||
358 | }; | 358 | }; |
359 | 359 | ||
360 | extern void sighand_free_cb(struct rcu_head *rhp); | ||
361 | |||
362 | static inline void sighand_free(struct sighand_struct *sp) | ||
363 | { | ||
364 | call_rcu(&sp->rcu, sighand_free_cb); | ||
365 | } | ||
366 | |||
367 | /* | 360 | /* |
368 | * NOTE! "signal_struct" does not have it's own | 361 | * NOTE! "signal_struct" does not have it's own |
369 | * locking, because a shared signal_struct always | 362 | * locking, because a shared signal_struct always |
@@ -402,6 +395,7 @@ struct signal_struct { | |||
402 | 395 | ||
403 | /* ITIMER_REAL timer for the process */ | 396 | /* ITIMER_REAL timer for the process */ |
404 | struct hrtimer real_timer; | 397 | struct hrtimer real_timer; |
398 | struct task_struct *tsk; | ||
405 | ktime_t it_real_incr; | 399 | ktime_t it_real_incr; |
406 | 400 | ||
407 | /* ITIMER_PROF and ITIMER_VIRTUAL timers for the process */ | 401 | /* ITIMER_PROF and ITIMER_VIRTUAL timers for the process */ |
@@ -706,6 +700,7 @@ struct task_struct { | |||
706 | prio_array_t *array; | 700 | prio_array_t *array; |
707 | 701 | ||
708 | unsigned short ioprio; | 702 | unsigned short ioprio; |
703 | unsigned int btrace_seq; | ||
709 | 704 | ||
710 | unsigned long sleep_avg; | 705 | unsigned long sleep_avg; |
711 | unsigned long long timestamp, last_ran; | 706 | unsigned long long timestamp, last_ran; |
@@ -757,6 +752,7 @@ struct task_struct { | |||
757 | 752 | ||
758 | /* PID/PID hash table linkage. */ | 753 | /* PID/PID hash table linkage. */ |
759 | struct pid pids[PIDTYPE_MAX]; | 754 | struct pid pids[PIDTYPE_MAX]; |
755 | struct list_head thread_group; | ||
760 | 756 | ||
761 | struct completion *vfork_done; /* for vfork() */ | 757 | struct completion *vfork_done; /* for vfork() */ |
762 | int __user *set_child_tid; /* CLONE_CHILD_SETTID */ | 758 | int __user *set_child_tid; /* CLONE_CHILD_SETTID */ |
@@ -868,7 +864,13 @@ struct task_struct { | |||
868 | struct cpuset *cpuset; | 864 | struct cpuset *cpuset; |
869 | nodemask_t mems_allowed; | 865 | nodemask_t mems_allowed; |
870 | int cpuset_mems_generation; | 866 | int cpuset_mems_generation; |
867 | int cpuset_mem_spread_rotor; | ||
868 | #endif | ||
869 | struct robust_list_head __user *robust_list; | ||
870 | #ifdef CONFIG_COMPAT | ||
871 | struct compat_robust_list_head __user *compat_robust_list; | ||
871 | #endif | 872 | #endif |
873 | |||
872 | atomic_t fs_excl; /* holding fs exclusive resources */ | 874 | atomic_t fs_excl; /* holding fs exclusive resources */ |
873 | struct rcu_head rcu; | 875 | struct rcu_head rcu; |
874 | }; | 876 | }; |
@@ -928,6 +930,9 @@ static inline void put_task_struct(struct task_struct *t) | |||
928 | #define PF_BORROWED_MM 0x00400000 /* I am a kthread doing use_mm */ | 930 | #define PF_BORROWED_MM 0x00400000 /* I am a kthread doing use_mm */ |
929 | #define PF_RANDOMIZE 0x00800000 /* randomize virtual address space */ | 931 | #define PF_RANDOMIZE 0x00800000 /* randomize virtual address space */ |
930 | #define PF_SWAPWRITE 0x01000000 /* Allowed to write to swap */ | 932 | #define PF_SWAPWRITE 0x01000000 /* Allowed to write to swap */ |
933 | #define PF_SPREAD_PAGE 0x04000000 /* Spread page cache over cpuset */ | ||
934 | #define PF_SPREAD_SLAB 0x08000000 /* Spread some slab caches over cpuset */ | ||
935 | #define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */ | ||
931 | 936 | ||
932 | /* | 937 | /* |
933 | * Only the _current_ task can read/write to tsk->flags, but other | 938 | * Only the _current_ task can read/write to tsk->flags, but other |
@@ -1089,7 +1094,6 @@ extern void force_sig_specific(int, struct task_struct *); | |||
1089 | extern int send_sig(int, struct task_struct *, int); | 1094 | extern int send_sig(int, struct task_struct *, int); |
1090 | extern void zap_other_threads(struct task_struct *p); | 1095 | extern void zap_other_threads(struct task_struct *p); |
1091 | extern int kill_pg(pid_t, int, int); | 1096 | extern int kill_pg(pid_t, int, int); |
1092 | extern int kill_sl(pid_t, int, int); | ||
1093 | extern int kill_proc(pid_t, int, int); | 1097 | extern int kill_proc(pid_t, int, int); |
1094 | extern struct sigqueue *sigqueue_alloc(void); | 1098 | extern struct sigqueue *sigqueue_alloc(void); |
1095 | extern void sigqueue_free(struct sigqueue *); | 1099 | extern void sigqueue_free(struct sigqueue *); |
@@ -1146,10 +1150,8 @@ extern void flush_thread(void); | |||
1146 | extern void exit_thread(void); | 1150 | extern void exit_thread(void); |
1147 | 1151 | ||
1148 | extern void exit_files(struct task_struct *); | 1152 | extern void exit_files(struct task_struct *); |
1149 | extern void exit_signal(struct task_struct *); | 1153 | extern void __cleanup_signal(struct signal_struct *); |
1150 | extern void __exit_signal(struct task_struct *); | 1154 | extern void __cleanup_sighand(struct sighand_struct *); |
1151 | extern void exit_sighand(struct task_struct *); | ||
1152 | extern void __exit_sighand(struct task_struct *); | ||
1153 | extern void exit_itimers(struct signal_struct *); | 1155 | extern void exit_itimers(struct signal_struct *); |
1154 | 1156 | ||
1155 | extern NORET_TYPE void do_group_exit(int); | 1157 | extern NORET_TYPE void do_group_exit(int); |
@@ -1173,19 +1175,7 @@ extern void wait_task_inactive(task_t * p); | |||
1173 | #endif | 1175 | #endif |
1174 | 1176 | ||
1175 | #define remove_parent(p) list_del_init(&(p)->sibling) | 1177 | #define remove_parent(p) list_del_init(&(p)->sibling) |
1176 | #define add_parent(p, parent) list_add_tail(&(p)->sibling,&(parent)->children) | 1178 | #define add_parent(p) list_add_tail(&(p)->sibling,&(p)->parent->children) |
1177 | |||
1178 | #define REMOVE_LINKS(p) do { \ | ||
1179 | if (thread_group_leader(p)) \ | ||
1180 | list_del_init(&(p)->tasks); \ | ||
1181 | remove_parent(p); \ | ||
1182 | } while (0) | ||
1183 | |||
1184 | #define SET_LINKS(p) do { \ | ||
1185 | if (thread_group_leader(p)) \ | ||
1186 | list_add_tail(&(p)->tasks,&init_task.tasks); \ | ||
1187 | add_parent(p, (p)->parent); \ | ||
1188 | } while (0) | ||
1189 | 1179 | ||
1190 | #define next_task(p) list_entry((p)->tasks.next, struct task_struct, tasks) | 1180 | #define next_task(p) list_entry((p)->tasks.next, struct task_struct, tasks) |
1191 | #define prev_task(p) list_entry((p)->tasks.prev, struct task_struct, tasks) | 1181 | #define prev_task(p) list_entry((p)->tasks.prev, struct task_struct, tasks) |
@@ -1203,20 +1193,22 @@ extern void wait_task_inactive(task_t * p); | |||
1203 | #define while_each_thread(g, t) \ | 1193 | #define while_each_thread(g, t) \ |
1204 | while ((t = next_thread(t)) != g) | 1194 | while ((t = next_thread(t)) != g) |
1205 | 1195 | ||
1206 | extern task_t * FASTCALL(next_thread(const task_t *p)); | ||
1207 | |||
1208 | #define thread_group_leader(p) (p->pid == p->tgid) | 1196 | #define thread_group_leader(p) (p->pid == p->tgid) |
1209 | 1197 | ||
1198 | static inline task_t *next_thread(task_t *p) | ||
1199 | { | ||
1200 | return list_entry(rcu_dereference(p->thread_group.next), | ||
1201 | task_t, thread_group); | ||
1202 | } | ||
1203 | |||
1210 | static inline int thread_group_empty(task_t *p) | 1204 | static inline int thread_group_empty(task_t *p) |
1211 | { | 1205 | { |
1212 | return list_empty(&p->pids[PIDTYPE_TGID].pid_list); | 1206 | return list_empty(&p->thread_group); |
1213 | } | 1207 | } |
1214 | 1208 | ||
1215 | #define delay_group_leader(p) \ | 1209 | #define delay_group_leader(p) \ |
1216 | (thread_group_leader(p) && !thread_group_empty(p)) | 1210 | (thread_group_leader(p) && !thread_group_empty(p)) |
1217 | 1211 | ||
1218 | extern void unhash_process(struct task_struct *p); | ||
1219 | |||
1220 | /* | 1212 | /* |
1221 | * Protects ->fs, ->files, ->mm, ->ptrace, ->group_info, ->comm, keyring | 1213 | * Protects ->fs, ->files, ->mm, ->ptrace, ->group_info, ->comm, keyring |
1222 | * subscriptions and synchronises with wait4(). Also used in procfs. Also | 1214 | * subscriptions and synchronises with wait4(). Also used in procfs. Also |
@@ -1236,6 +1228,15 @@ static inline void task_unlock(struct task_struct *p) | |||
1236 | spin_unlock(&p->alloc_lock); | 1228 | spin_unlock(&p->alloc_lock); |
1237 | } | 1229 | } |
1238 | 1230 | ||
1231 | extern struct sighand_struct *lock_task_sighand(struct task_struct *tsk, | ||
1232 | unsigned long *flags); | ||
1233 | |||
1234 | static inline void unlock_task_sighand(struct task_struct *tsk, | ||
1235 | unsigned long *flags) | ||
1236 | { | ||
1237 | spin_unlock_irqrestore(&tsk->sighand->siglock, *flags); | ||
1238 | } | ||
1239 | |||
1239 | #ifndef __HAVE_THREAD_FUNCTIONS | 1240 | #ifndef __HAVE_THREAD_FUNCTIONS |
1240 | 1241 | ||
1241 | #define task_thread_info(task) (task)->thread_info | 1242 | #define task_thread_info(task) (task)->thread_info |
diff --git a/include/linux/security.h b/include/linux/security.h index b18eb8cfa639..aaa0a5cdbf75 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -869,6 +869,11 @@ struct swap_info_struct; | |||
869 | * @ipcp contains the kernel IPC permission structure | 869 | * @ipcp contains the kernel IPC permission structure |
870 | * @flag contains the desired (requested) permission set | 870 | * @flag contains the desired (requested) permission set |
871 | * Return 0 if permission is granted. | 871 | * Return 0 if permission is granted. |
872 | * @ipc_getsecurity: | ||
873 | * Copy the security label associated with the ipc object into | ||
874 | * @buffer. @buffer may be NULL to request the size of the buffer | ||
875 | * required. @size indicates the size of @buffer in bytes. Return | ||
876 | * number of bytes used/required on success. | ||
872 | * | 877 | * |
873 | * Security hooks for individual messages held in System V IPC message queues | 878 | * Security hooks for individual messages held in System V IPC message queues |
874 | * @msg_msg_alloc_security: | 879 | * @msg_msg_alloc_security: |
@@ -1040,6 +1045,11 @@ struct swap_info_struct; | |||
1040 | * @effective contains the effective capability set. | 1045 | * @effective contains the effective capability set. |
1041 | * @inheritable contains the inheritable capability set. | 1046 | * @inheritable contains the inheritable capability set. |
1042 | * @permitted contains the permitted capability set. | 1047 | * @permitted contains the permitted capability set. |
1048 | * @capable: | ||
1049 | * Check whether the @tsk process has the @cap capability. | ||
1050 | * @tsk contains the task_struct for the process. | ||
1051 | * @cap contains the capability <include/linux/capability.h>. | ||
1052 | * Return 0 if the capability is granted for @tsk. | ||
1043 | * @acct: | 1053 | * @acct: |
1044 | * Check permission before enabling or disabling process accounting. If | 1054 | * Check permission before enabling or disabling process accounting. If |
1045 | * accounting is being enabled, then @file refers to the open file used to | 1055 | * accounting is being enabled, then @file refers to the open file used to |
@@ -1053,11 +1063,6 @@ struct swap_info_struct; | |||
1053 | * @table contains the ctl_table structure for the sysctl variable. | 1063 | * @table contains the ctl_table structure for the sysctl variable. |
1054 | * @op contains the operation (001 = search, 002 = write, 004 = read). | 1064 | * @op contains the operation (001 = search, 002 = write, 004 = read). |
1055 | * Return 0 if permission is granted. | 1065 | * Return 0 if permission is granted. |
1056 | * @capable: | ||
1057 | * Check whether the @tsk process has the @cap capability. | ||
1058 | * @tsk contains the task_struct for the process. | ||
1059 | * @cap contains the capability <include/linux/capability.h>. | ||
1060 | * Return 0 if the capability is granted for @tsk. | ||
1061 | * @syslog: | 1066 | * @syslog: |
1062 | * Check permission before accessing the kernel message ring or changing | 1067 | * Check permission before accessing the kernel message ring or changing |
1063 | * logging to the console. | 1068 | * logging to the console. |
@@ -1099,9 +1104,9 @@ struct security_operations { | |||
1099 | kernel_cap_t * effective, | 1104 | kernel_cap_t * effective, |
1100 | kernel_cap_t * inheritable, | 1105 | kernel_cap_t * inheritable, |
1101 | kernel_cap_t * permitted); | 1106 | kernel_cap_t * permitted); |
1107 | int (*capable) (struct task_struct * tsk, int cap); | ||
1102 | int (*acct) (struct file * file); | 1108 | int (*acct) (struct file * file); |
1103 | int (*sysctl) (struct ctl_table * table, int op); | 1109 | int (*sysctl) (struct ctl_table * table, int op); |
1104 | int (*capable) (struct task_struct * tsk, int cap); | ||
1105 | int (*quotactl) (int cmds, int type, int id, struct super_block * sb); | 1110 | int (*quotactl) (int cmds, int type, int id, struct super_block * sb); |
1106 | int (*quota_on) (struct dentry * dentry); | 1111 | int (*quota_on) (struct dentry * dentry); |
1107 | int (*syslog) (int type); | 1112 | int (*syslog) (int type); |
@@ -1168,7 +1173,8 @@ struct security_operations { | |||
1168 | int (*inode_getxattr) (struct dentry *dentry, char *name); | 1173 | int (*inode_getxattr) (struct dentry *dentry, char *name); |
1169 | int (*inode_listxattr) (struct dentry *dentry); | 1174 | int (*inode_listxattr) (struct dentry *dentry); |
1170 | int (*inode_removexattr) (struct dentry *dentry, char *name); | 1175 | int (*inode_removexattr) (struct dentry *dentry, char *name); |
1171 | int (*inode_getsecurity)(struct inode *inode, const char *name, void *buffer, size_t size, int err); | 1176 | const char *(*inode_xattr_getsuffix) (void); |
1177 | int (*inode_getsecurity)(const struct inode *inode, const char *name, void *buffer, size_t size, int err); | ||
1172 | int (*inode_setsecurity)(struct inode *inode, const char *name, const void *value, size_t size, int flags); | 1178 | int (*inode_setsecurity)(struct inode *inode, const char *name, const void *value, size_t size, int flags); |
1173 | int (*inode_listsecurity)(struct inode *inode, char *buffer, size_t buffer_size); | 1179 | int (*inode_listsecurity)(struct inode *inode, char *buffer, size_t buffer_size); |
1174 | 1180 | ||
@@ -1217,6 +1223,7 @@ struct security_operations { | |||
1217 | void (*task_to_inode)(struct task_struct *p, struct inode *inode); | 1223 | void (*task_to_inode)(struct task_struct *p, struct inode *inode); |
1218 | 1224 | ||
1219 | int (*ipc_permission) (struct kern_ipc_perm * ipcp, short flag); | 1225 | int (*ipc_permission) (struct kern_ipc_perm * ipcp, short flag); |
1226 | int (*ipc_getsecurity)(struct kern_ipc_perm *ipcp, void *buffer, size_t size); | ||
1220 | 1227 | ||
1221 | int (*msg_msg_alloc_security) (struct msg_msg * msg); | 1228 | int (*msg_msg_alloc_security) (struct msg_msg * msg); |
1222 | void (*msg_msg_free_security) (struct msg_msg * msg); | 1229 | void (*msg_msg_free_security) (struct msg_msg * msg); |
@@ -1347,6 +1354,11 @@ static inline void security_capset_set (struct task_struct *target, | |||
1347 | security_ops->capset_set (target, effective, inheritable, permitted); | 1354 | security_ops->capset_set (target, effective, inheritable, permitted); |
1348 | } | 1355 | } |
1349 | 1356 | ||
1357 | static inline int security_capable(struct task_struct *tsk, int cap) | ||
1358 | { | ||
1359 | return security_ops->capable(tsk, cap); | ||
1360 | } | ||
1361 | |||
1350 | static inline int security_acct (struct file *file) | 1362 | static inline int security_acct (struct file *file) |
1351 | { | 1363 | { |
1352 | return security_ops->acct (file); | 1364 | return security_ops->acct (file); |
@@ -1675,7 +1687,12 @@ static inline int security_inode_removexattr (struct dentry *dentry, char *name) | |||
1675 | return security_ops->inode_removexattr (dentry, name); | 1687 | return security_ops->inode_removexattr (dentry, name); |
1676 | } | 1688 | } |
1677 | 1689 | ||
1678 | static inline int security_inode_getsecurity(struct inode *inode, const char *name, void *buffer, size_t size, int err) | 1690 | static inline const char *security_inode_xattr_getsuffix(void) |
1691 | { | ||
1692 | return security_ops->inode_xattr_getsuffix(); | ||
1693 | } | ||
1694 | |||
1695 | static inline int security_inode_getsecurity(const struct inode *inode, const char *name, void *buffer, size_t size, int err) | ||
1679 | { | 1696 | { |
1680 | if (unlikely (IS_PRIVATE (inode))) | 1697 | if (unlikely (IS_PRIVATE (inode))) |
1681 | return 0; | 1698 | return 0; |
@@ -1870,6 +1887,11 @@ static inline int security_ipc_permission (struct kern_ipc_perm *ipcp, | |||
1870 | return security_ops->ipc_permission (ipcp, flag); | 1887 | return security_ops->ipc_permission (ipcp, flag); |
1871 | } | 1888 | } |
1872 | 1889 | ||
1890 | static inline int security_ipc_getsecurity(struct kern_ipc_perm *ipcp, void *buffer, size_t size) | ||
1891 | { | ||
1892 | return security_ops->ipc_getsecurity(ipcp, buffer, size); | ||
1893 | } | ||
1894 | |||
1873 | static inline int security_msg_msg_alloc (struct msg_msg * msg) | 1895 | static inline int security_msg_msg_alloc (struct msg_msg * msg) |
1874 | { | 1896 | { |
1875 | return security_ops->msg_msg_alloc_security (msg); | 1897 | return security_ops->msg_msg_alloc_security (msg); |
@@ -2050,6 +2072,11 @@ static inline void security_capset_set (struct task_struct *target, | |||
2050 | cap_capset_set (target, effective, inheritable, permitted); | 2072 | cap_capset_set (target, effective, inheritable, permitted); |
2051 | } | 2073 | } |
2052 | 2074 | ||
2075 | static inline int security_capable(struct task_struct *tsk, int cap) | ||
2076 | { | ||
2077 | return cap_capable(tsk, cap); | ||
2078 | } | ||
2079 | |||
2053 | static inline int security_acct (struct file *file) | 2080 | static inline int security_acct (struct file *file) |
2054 | { | 2081 | { |
2055 | return 0; | 2082 | return 0; |
@@ -2317,7 +2344,12 @@ static inline int security_inode_removexattr (struct dentry *dentry, char *name) | |||
2317 | return cap_inode_removexattr(dentry, name); | 2344 | return cap_inode_removexattr(dentry, name); |
2318 | } | 2345 | } |
2319 | 2346 | ||
2320 | static inline int security_inode_getsecurity(struct inode *inode, const char *name, void *buffer, size_t size, int err) | 2347 | static inline const char *security_inode_xattr_getsuffix (void) |
2348 | { | ||
2349 | return NULL ; | ||
2350 | } | ||
2351 | |||
2352 | static inline int security_inode_getsecurity(const struct inode *inode, const char *name, void *buffer, size_t size, int err) | ||
2321 | { | 2353 | { |
2322 | return -EOPNOTSUPP; | 2354 | return -EOPNOTSUPP; |
2323 | } | 2355 | } |
@@ -2500,6 +2532,11 @@ static inline int security_ipc_permission (struct kern_ipc_perm *ipcp, | |||
2500 | return 0; | 2532 | return 0; |
2501 | } | 2533 | } |
2502 | 2534 | ||
2535 | static inline int security_ipc_getsecurity(struct kern_ipc_perm *ipcp, void *buffer, size_t size) | ||
2536 | { | ||
2537 | return -EOPNOTSUPP; | ||
2538 | } | ||
2539 | |||
2503 | static inline int security_msg_msg_alloc (struct msg_msg * msg) | 2540 | static inline int security_msg_msg_alloc (struct msg_msg * msg) |
2504 | { | 2541 | { |
2505 | return 0; | 2542 | return 0; |
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index 850a974ee505..b95f6eb7254c 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h | |||
@@ -4,7 +4,7 @@ | |||
4 | 4 | ||
5 | #include <linux/types.h> | 5 | #include <linux/types.h> |
6 | #include <linux/string.h> | 6 | #include <linux/string.h> |
7 | #include <asm/semaphore.h> | 7 | #include <linux/mutex.h> |
8 | 8 | ||
9 | struct seq_operations; | 9 | struct seq_operations; |
10 | struct file; | 10 | struct file; |
@@ -19,7 +19,7 @@ struct seq_file { | |||
19 | size_t count; | 19 | size_t count; |
20 | loff_t index; | 20 | loff_t index; |
21 | loff_t version; | 21 | loff_t version; |
22 | struct semaphore sem; | 22 | struct mutex lock; |
23 | struct seq_operations *op; | 23 | struct seq_operations *op; |
24 | void *private; | 24 | void *private; |
25 | }; | 25 | }; |
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h index 73b464f0926a..8e9681413726 100644 --- a/include/linux/serial_8250.h +++ b/include/linux/serial_8250.h | |||
@@ -37,6 +37,7 @@ enum { | |||
37 | PLAT8250_DEV_LEGACY = -1, | 37 | PLAT8250_DEV_LEGACY = -1, |
38 | PLAT8250_DEV_PLATFORM, | 38 | PLAT8250_DEV_PLATFORM, |
39 | PLAT8250_DEV_PLATFORM1, | 39 | PLAT8250_DEV_PLATFORM1, |
40 | PLAT8250_DEV_PLATFORM2, | ||
40 | PLAT8250_DEV_FOURPORT, | 41 | PLAT8250_DEV_FOURPORT, |
41 | PLAT8250_DEV_ACCENT, | 42 | PLAT8250_DEV_ACCENT, |
42 | PLAT8250_DEV_BOCA, | 43 | PLAT8250_DEV_BOCA, |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 57abcea1cb5d..c32e60e79dea 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -369,6 +369,9 @@ void uart_parse_options(char *options, int *baud, int *parity, int *bits, | |||
369 | int uart_set_options(struct uart_port *port, struct console *co, int baud, | 369 | int uart_set_options(struct uart_port *port, struct console *co, int baud, |
370 | int parity, int bits, int flow); | 370 | int parity, int bits, int flow); |
371 | struct tty_driver *uart_console_device(struct console *co, int *index); | 371 | struct tty_driver *uart_console_device(struct console *co, int *index); |
372 | void uart_console_write(struct uart_port *port, const char *s, | ||
373 | unsigned int count, | ||
374 | void (*putchar)(struct uart_port *, int)); | ||
372 | 375 | ||
373 | /* | 376 | /* |
374 | * Port/driver registration/removal | 377 | * Port/driver registration/removal |
diff --git a/include/linux/serio.h b/include/linux/serio.h index aa4d6493a034..690aabca8ed0 100644 --- a/include/linux/serio.h +++ b/include/linux/serio.h | |||
@@ -119,7 +119,7 @@ static inline void serio_cleanup(struct serio *serio) | |||
119 | } | 119 | } |
120 | 120 | ||
121 | /* | 121 | /* |
122 | * Use the following fucntions to manipulate serio's per-port | 122 | * Use the following functions to manipulate serio's per-port |
123 | * driver-specific data. | 123 | * driver-specific data. |
124 | */ | 124 | */ |
125 | static inline void *serio_get_drvdata(struct serio *serio) | 125 | static inline void *serio_get_drvdata(struct serio *serio) |
@@ -133,7 +133,7 @@ static inline void serio_set_drvdata(struct serio *serio, void *data) | |||
133 | } | 133 | } |
134 | 134 | ||
135 | /* | 135 | /* |
136 | * Use the following fucntions to protect critical sections in | 136 | * Use the following functions to protect critical sections in |
137 | * driver code from port's interrupt handler | 137 | * driver code from port's interrupt handler |
138 | */ | 138 | */ |
139 | static inline void serio_pause_rx(struct serio *serio) | 139 | static inline void serio_pause_rx(struct serio *serio) |
@@ -147,7 +147,7 @@ static inline void serio_continue_rx(struct serio *serio) | |||
147 | } | 147 | } |
148 | 148 | ||
149 | /* | 149 | /* |
150 | * Use the following fucntions to pin serio's driver in process context | 150 | * Use the following functions to pin serio's driver in process context |
151 | */ | 151 | */ |
152 | static inline int serio_pin_driver(struct serio *serio) | 152 | static inline int serio_pin_driver(struct serio *serio) |
153 | { | 153 | { |
diff --git a/include/linux/signal.h b/include/linux/signal.h index b7d093520bb6..162a8fd10b29 100644 --- a/include/linux/signal.h +++ b/include/linux/signal.h | |||
@@ -249,6 +249,8 @@ static inline void init_sigpending(struct sigpending *sig) | |||
249 | INIT_LIST_HEAD(&sig->list); | 249 | INIT_LIST_HEAD(&sig->list); |
250 | } | 250 | } |
251 | 251 | ||
252 | extern void flush_sigqueue(struct sigpending *queue); | ||
253 | |||
252 | /* Test if 'sig' is valid signal. Use this instead of testing _NSIG directly */ | 254 | /* Test if 'sig' is valid signal. Use this instead of testing _NSIG directly */ |
253 | static inline int valid_signal(unsigned long sig) | 255 | static inline int valid_signal(unsigned long sig) |
254 | { | 256 | { |
diff --git a/include/linux/slab.h b/include/linux/slab.h index 8cf52939d0ab..3af03b19c983 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
@@ -38,7 +38,6 @@ typedef struct kmem_cache kmem_cache_t; | |||
38 | #define SLAB_DEBUG_INITIAL 0x00000200UL /* Call constructor (as verifier) */ | 38 | #define SLAB_DEBUG_INITIAL 0x00000200UL /* Call constructor (as verifier) */ |
39 | #define SLAB_RED_ZONE 0x00000400UL /* Red zone objs in a cache */ | 39 | #define SLAB_RED_ZONE 0x00000400UL /* Red zone objs in a cache */ |
40 | #define SLAB_POISON 0x00000800UL /* Poison objects */ | 40 | #define SLAB_POISON 0x00000800UL /* Poison objects */ |
41 | #define SLAB_NO_REAP 0x00001000UL /* never reap from the cache */ | ||
42 | #define SLAB_HWCACHE_ALIGN 0x00002000UL /* align objs on a h/w cache lines */ | 41 | #define SLAB_HWCACHE_ALIGN 0x00002000UL /* align objs on a h/w cache lines */ |
43 | #define SLAB_CACHE_DMA 0x00004000UL /* use GFP_DMA memory */ | 42 | #define SLAB_CACHE_DMA 0x00004000UL /* use GFP_DMA memory */ |
44 | #define SLAB_MUST_HWCACHE_ALIGN 0x00008000UL /* force alignment */ | 43 | #define SLAB_MUST_HWCACHE_ALIGN 0x00008000UL /* force alignment */ |
@@ -47,6 +46,7 @@ typedef struct kmem_cache kmem_cache_t; | |||
47 | what is reclaimable later*/ | 46 | what is reclaimable later*/ |
48 | #define SLAB_PANIC 0x00040000UL /* panic if kmem_cache_create() fails */ | 47 | #define SLAB_PANIC 0x00040000UL /* panic if kmem_cache_create() fails */ |
49 | #define SLAB_DESTROY_BY_RCU 0x00080000UL /* defer freeing pages to RCU */ | 48 | #define SLAB_DESTROY_BY_RCU 0x00080000UL /* defer freeing pages to RCU */ |
49 | #define SLAB_MEM_SPREAD 0x00100000UL /* Spread some memory over cpuset */ | ||
50 | 50 | ||
51 | /* flags passed to a constructor func */ | 51 | /* flags passed to a constructor func */ |
52 | #define SLAB_CTOR_CONSTRUCTOR 0x001UL /* if not set, then deconstructor */ | 52 | #define SLAB_CTOR_CONSTRUCTOR 0x001UL /* if not set, then deconstructor */ |
@@ -64,6 +64,7 @@ extern kmem_cache_t *kmem_cache_create(const char *, size_t, size_t, unsigned lo | |||
64 | extern int kmem_cache_destroy(kmem_cache_t *); | 64 | extern int kmem_cache_destroy(kmem_cache_t *); |
65 | extern int kmem_cache_shrink(kmem_cache_t *); | 65 | extern int kmem_cache_shrink(kmem_cache_t *); |
66 | extern void *kmem_cache_alloc(kmem_cache_t *, gfp_t); | 66 | extern void *kmem_cache_alloc(kmem_cache_t *, gfp_t); |
67 | extern void *kmem_cache_zalloc(struct kmem_cache *, gfp_t); | ||
67 | extern void kmem_cache_free(kmem_cache_t *, void *); | 68 | extern void kmem_cache_free(kmem_cache_t *, void *); |
68 | extern unsigned int kmem_cache_size(kmem_cache_t *); | 69 | extern unsigned int kmem_cache_size(kmem_cache_t *); |
69 | extern const char *kmem_cache_name(kmem_cache_t *); | 70 | extern const char *kmem_cache_name(kmem_cache_t *); |
@@ -77,11 +78,12 @@ struct cache_sizes { | |||
77 | }; | 78 | }; |
78 | extern struct cache_sizes malloc_sizes[]; | 79 | extern struct cache_sizes malloc_sizes[]; |
79 | 80 | ||
80 | #ifndef CONFIG_DEBUG_SLAB | ||
81 | extern void *__kmalloc(size_t, gfp_t); | 81 | extern void *__kmalloc(size_t, gfp_t); |
82 | #ifndef CONFIG_DEBUG_SLAB | ||
83 | #define ____kmalloc(size, flags) __kmalloc(size, flags) | ||
82 | #else | 84 | #else |
83 | extern void *__kmalloc_track_caller(size_t, gfp_t, void*); | 85 | extern void *__kmalloc_track_caller(size_t, gfp_t, void*); |
84 | #define __kmalloc(size, flags) \ | 86 | #define ____kmalloc(size, flags) \ |
85 | __kmalloc_track_caller(size, flags, __builtin_return_address(0)) | 87 | __kmalloc_track_caller(size, flags, __builtin_return_address(0)) |
86 | #endif | 88 | #endif |
87 | 89 | ||
@@ -108,7 +110,30 @@ found: | |||
108 | return __kmalloc(size, flags); | 110 | return __kmalloc(size, flags); |
109 | } | 111 | } |
110 | 112 | ||
111 | extern void *kzalloc(size_t, gfp_t); | 113 | extern void *__kzalloc(size_t, gfp_t); |
114 | |||
115 | static inline void *kzalloc(size_t size, gfp_t flags) | ||
116 | { | ||
117 | if (__builtin_constant_p(size)) { | ||
118 | int i = 0; | ||
119 | #define CACHE(x) \ | ||
120 | if (size <= x) \ | ||
121 | goto found; \ | ||
122 | else \ | ||
123 | i++; | ||
124 | #include "kmalloc_sizes.h" | ||
125 | #undef CACHE | ||
126 | { | ||
127 | extern void __you_cannot_kzalloc_that_much(void); | ||
128 | __you_cannot_kzalloc_that_much(); | ||
129 | } | ||
130 | found: | ||
131 | return kmem_cache_zalloc((flags & GFP_DMA) ? | ||
132 | malloc_sizes[i].cs_dmacachep : | ||
133 | malloc_sizes[i].cs_cachep, flags); | ||
134 | } | ||
135 | return __kzalloc(size, flags); | ||
136 | } | ||
112 | 137 | ||
113 | /** | 138 | /** |
114 | * kcalloc - allocate memory for an array. The memory is set to zero. | 139 | * kcalloc - allocate memory for an array. The memory is set to zero. |
@@ -118,7 +143,7 @@ extern void *kzalloc(size_t, gfp_t); | |||
118 | */ | 143 | */ |
119 | static inline void *kcalloc(size_t n, size_t size, gfp_t flags) | 144 | static inline void *kcalloc(size_t n, size_t size, gfp_t flags) |
120 | { | 145 | { |
121 | if (n != 0 && size > INT_MAX / n) | 146 | if (n != 0 && size > ULONG_MAX / n) |
122 | return NULL; | 147 | return NULL; |
123 | return kzalloc(n * size, flags); | 148 | return kzalloc(n * size, flags); |
124 | } | 149 | } |
@@ -155,17 +180,18 @@ struct kmem_cache *kmem_cache_create(const char *c, size_t, size_t, | |||
155 | void (*)(void *, struct kmem_cache *, unsigned long)); | 180 | void (*)(void *, struct kmem_cache *, unsigned long)); |
156 | int kmem_cache_destroy(struct kmem_cache *c); | 181 | int kmem_cache_destroy(struct kmem_cache *c); |
157 | void *kmem_cache_alloc(struct kmem_cache *c, gfp_t flags); | 182 | void *kmem_cache_alloc(struct kmem_cache *c, gfp_t flags); |
183 | void *kmem_cache_zalloc(struct kmem_cache *, gfp_t); | ||
158 | void kmem_cache_free(struct kmem_cache *c, void *b); | 184 | void kmem_cache_free(struct kmem_cache *c, void *b); |
159 | const char *kmem_cache_name(struct kmem_cache *); | 185 | const char *kmem_cache_name(struct kmem_cache *); |
160 | void *kmalloc(size_t size, gfp_t flags); | 186 | void *kmalloc(size_t size, gfp_t flags); |
161 | void *kzalloc(size_t size, gfp_t flags); | 187 | void *__kzalloc(size_t size, gfp_t flags); |
162 | void kfree(const void *m); | 188 | void kfree(const void *m); |
163 | unsigned int ksize(const void *m); | 189 | unsigned int ksize(const void *m); |
164 | unsigned int kmem_cache_size(struct kmem_cache *c); | 190 | unsigned int kmem_cache_size(struct kmem_cache *c); |
165 | 191 | ||
166 | static inline void *kcalloc(size_t n, size_t size, gfp_t flags) | 192 | static inline void *kcalloc(size_t n, size_t size, gfp_t flags) |
167 | { | 193 | { |
168 | return kzalloc(n * size, flags); | 194 | return __kzalloc(n * size, flags); |
169 | } | 195 | } |
170 | 196 | ||
171 | #define kmem_cache_shrink(d) (0) | 197 | #define kmem_cache_shrink(d) (0) |
@@ -173,6 +199,8 @@ static inline void *kcalloc(size_t n, size_t size, gfp_t flags) | |||
173 | #define kmem_ptr_validate(a, b) (0) | 199 | #define kmem_ptr_validate(a, b) (0) |
174 | #define kmem_cache_alloc_node(c, f, n) kmem_cache_alloc(c, f) | 200 | #define kmem_cache_alloc_node(c, f, n) kmem_cache_alloc(c, f) |
175 | #define kmalloc_node(s, f, n) kmalloc(s, f) | 201 | #define kmalloc_node(s, f, n) kmalloc(s, f) |
202 | #define kzalloc(s, f) __kzalloc(s, f) | ||
203 | #define ____kmalloc kmalloc | ||
176 | 204 | ||
177 | #endif /* CONFIG_SLOB */ | 205 | #endif /* CONFIG_SLOB */ |
178 | 206 | ||
@@ -182,7 +210,6 @@ extern kmem_cache_t *names_cachep; | |||
182 | extern kmem_cache_t *files_cachep; | 210 | extern kmem_cache_t *files_cachep; |
183 | extern kmem_cache_t *filp_cachep; | 211 | extern kmem_cache_t *filp_cachep; |
184 | extern kmem_cache_t *fs_cachep; | 212 | extern kmem_cache_t *fs_cachep; |
185 | extern kmem_cache_t *signal_cachep; | ||
186 | extern kmem_cache_t *sighand_cachep; | 213 | extern kmem_cache_t *sighand_cachep; |
187 | extern kmem_cache_t *bio_cachep; | 214 | extern kmem_cache_t *bio_cachep; |
188 | 215 | ||
diff --git a/include/linux/smp.h b/include/linux/smp.h index 44153fdf73fc..e2fa3ab4afc5 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h | |||
@@ -52,23 +52,12 @@ extern void smp_cpus_done(unsigned int max_cpus); | |||
52 | /* | 52 | /* |
53 | * Call a function on all other processors | 53 | * Call a function on all other processors |
54 | */ | 54 | */ |
55 | extern int smp_call_function (void (*func) (void *info), void *info, | 55 | int smp_call_function(void(*func)(void *info), void *info, int retry, int wait); |
56 | int retry, int wait); | ||
57 | 56 | ||
58 | /* | 57 | /* |
59 | * Call a function on all processors | 58 | * Call a function on all processors |
60 | */ | 59 | */ |
61 | static inline int on_each_cpu(void (*func) (void *info), void *info, | 60 | int on_each_cpu(void (*func) (void *info), void *info, int retry, int wait); |
62 | int retry, int wait) | ||
63 | { | ||
64 | int ret = 0; | ||
65 | |||
66 | preempt_disable(); | ||
67 | ret = smp_call_function(func, info, retry, wait); | ||
68 | func(info); | ||
69 | preempt_enable(); | ||
70 | return ret; | ||
71 | } | ||
72 | 61 | ||
73 | #define MSG_ALL_BUT_SELF 0x8000 /* Assume <32768 CPU's */ | 62 | #define MSG_ALL_BUT_SELF 0x8000 /* Assume <32768 CPU's */ |
74 | #define MSG_ALL 0x8001 | 63 | #define MSG_ALL 0x8001 |
@@ -93,8 +82,18 @@ void smp_prepare_boot_cpu(void); | |||
93 | */ | 82 | */ |
94 | #define raw_smp_processor_id() 0 | 83 | #define raw_smp_processor_id() 0 |
95 | #define hard_smp_processor_id() 0 | 84 | #define hard_smp_processor_id() 0 |
96 | #define smp_call_function(func,info,retry,wait) ({ 0; }) | 85 | static inline int up_smp_call_function(void) |
97 | #define on_each_cpu(func,info,retry,wait) ({ func(info); 0; }) | 86 | { |
87 | return 0; | ||
88 | } | ||
89 | #define smp_call_function(func,info,retry,wait) (up_smp_call_function()) | ||
90 | #define on_each_cpu(func,info,retry,wait) \ | ||
91 | ({ \ | ||
92 | local_irq_disable(); \ | ||
93 | func(info); \ | ||
94 | local_irq_enable(); \ | ||
95 | 0; \ | ||
96 | }) | ||
98 | static inline void smp_send_reschedule(int cpu) { } | 97 | static inline void smp_send_reschedule(int cpu) { } |
99 | #define num_booting_cpus() 1 | 98 | #define num_booting_cpus() 1 |
100 | #define smp_prepare_boot_cpu() do {} while (0) | 99 | #define smp_prepare_boot_cpu() do {} while (0) |
diff --git a/include/linux/sound.h b/include/linux/sound.h index 72b9af4c3fd4..f63d8342ffa3 100644 --- a/include/linux/sound.h +++ b/include/linux/sound.h | |||
@@ -30,12 +30,12 @@ | |||
30 | */ | 30 | */ |
31 | 31 | ||
32 | struct device; | 32 | struct device; |
33 | extern int register_sound_special(struct file_operations *fops, int unit); | 33 | extern int register_sound_special(const struct file_operations *fops, int unit); |
34 | extern int register_sound_special_device(struct file_operations *fops, int unit, struct device *dev); | 34 | extern int register_sound_special_device(const struct file_operations *fops, int unit, struct device *dev); |
35 | extern int register_sound_mixer(struct file_operations *fops, int dev); | 35 | extern int register_sound_mixer(const struct file_operations *fops, int dev); |
36 | extern int register_sound_midi(struct file_operations *fops, int dev); | 36 | extern int register_sound_midi(const struct file_operations *fops, int dev); |
37 | extern int register_sound_dsp(struct file_operations *fops, int dev); | 37 | extern int register_sound_dsp(const struct file_operations *fops, int dev); |
38 | extern int register_sound_synth(struct file_operations *fops, int dev); | 38 | extern int register_sound_synth(const struct file_operations *fops, int dev); |
39 | 39 | ||
40 | extern void unregister_sound_special(int unit); | 40 | extern void unregister_sound_special(int unit); |
41 | extern void unregister_sound_mixer(int unit); | 41 | extern void unregister_sound_mixer(int unit); |
diff --git a/include/linux/stat.h b/include/linux/stat.h index 8ff2a122dfef..8669291352db 100644 --- a/include/linux/stat.h +++ b/include/linux/stat.h | |||
@@ -69,7 +69,7 @@ struct kstat { | |||
69 | struct timespec mtime; | 69 | struct timespec mtime; |
70 | struct timespec ctime; | 70 | struct timespec ctime; |
71 | unsigned long blksize; | 71 | unsigned long blksize; |
72 | unsigned long blocks; | 72 | unsigned long long blocks; |
73 | }; | 73 | }; |
74 | 74 | ||
75 | #endif | 75 | #endif |
diff --git a/include/linux/statfs.h b/include/linux/statfs.h index ad83a2bdb821..b34cc829f98d 100644 --- a/include/linux/statfs.h +++ b/include/linux/statfs.h | |||
@@ -8,11 +8,11 @@ | |||
8 | struct kstatfs { | 8 | struct kstatfs { |
9 | long f_type; | 9 | long f_type; |
10 | long f_bsize; | 10 | long f_bsize; |
11 | sector_t f_blocks; | 11 | u64 f_blocks; |
12 | sector_t f_bfree; | 12 | u64 f_bfree; |
13 | sector_t f_bavail; | 13 | u64 f_bavail; |
14 | sector_t f_files; | 14 | u64 f_files; |
15 | sector_t f_ffree; | 15 | u64 f_ffree; |
16 | __kernel_fsid_t f_fsid; | 16 | __kernel_fsid_t f_fsid; |
17 | long f_namelen; | 17 | long f_namelen; |
18 | long f_frsize; | 18 | long f_frsize; |
diff --git a/include/linux/string.h b/include/linux/string.h index 369be3264a55..dee221429ad0 100644 --- a/include/linux/string.h +++ b/include/linux/string.h | |||
@@ -18,6 +18,8 @@ extern char * strsep(char **,const char *); | |||
18 | extern __kernel_size_t strspn(const char *,const char *); | 18 | extern __kernel_size_t strspn(const char *,const char *); |
19 | extern __kernel_size_t strcspn(const char *,const char *); | 19 | extern __kernel_size_t strcspn(const char *,const char *); |
20 | 20 | ||
21 | extern char *strndup_user(const char __user *, long); | ||
22 | |||
21 | /* | 23 | /* |
22 | * Include machine specific inline routines | 24 | * Include machine specific inline routines |
23 | */ | 25 | */ |
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h index c4e3ea7cf154..b5612c958cce 100644 --- a/include/linux/sunrpc/cache.h +++ b/include/linux/sunrpc/cache.h | |||
@@ -50,7 +50,7 @@ struct cache_head { | |||
50 | time_t last_refresh; /* If CACHE_PENDING, this is when upcall | 50 | time_t last_refresh; /* If CACHE_PENDING, this is when upcall |
51 | * was sent, else this is when update was received | 51 | * was sent, else this is when update was received |
52 | */ | 52 | */ |
53 | atomic_t refcnt; | 53 | struct kref ref; |
54 | unsigned long flags; | 54 | unsigned long flags; |
55 | }; | 55 | }; |
56 | #define CACHE_VALID 0 /* Entry contains valid data */ | 56 | #define CACHE_VALID 0 /* Entry contains valid data */ |
@@ -68,8 +68,7 @@ struct cache_detail { | |||
68 | atomic_t inuse; /* active user-space update or lookup */ | 68 | atomic_t inuse; /* active user-space update or lookup */ |
69 | 69 | ||
70 | char *name; | 70 | char *name; |
71 | void (*cache_put)(struct cache_head *, | 71 | void (*cache_put)(struct kref *); |
72 | struct cache_detail*); | ||
73 | 72 | ||
74 | void (*cache_request)(struct cache_detail *cd, | 73 | void (*cache_request)(struct cache_detail *cd, |
75 | struct cache_head *h, | 74 | struct cache_head *h, |
@@ -81,6 +80,11 @@ struct cache_detail { | |||
81 | struct cache_detail *cd, | 80 | struct cache_detail *cd, |
82 | struct cache_head *h); | 81 | struct cache_head *h); |
83 | 82 | ||
83 | struct cache_head * (*alloc)(void); | ||
84 | int (*match)(struct cache_head *orig, struct cache_head *new); | ||
85 | void (*init)(struct cache_head *orig, struct cache_head *new); | ||
86 | void (*update)(struct cache_head *orig, struct cache_head *new); | ||
87 | |||
84 | /* fields below this comment are for internal use | 88 | /* fields below this comment are for internal use |
85 | * and should not be touched by cache owners | 89 | * and should not be touched by cache owners |
86 | */ | 90 | */ |
@@ -123,126 +127,14 @@ struct cache_deferred_req { | |||
123 | int too_many); | 127 | int too_many); |
124 | }; | 128 | }; |
125 | 129 | ||
126 | /* | ||
127 | * just like a template in C++, this macro does cache lookup | ||
128 | * for us. | ||
129 | * The function is passed some sort of HANDLE from which a cache_detail | ||
130 | * structure can be determined (via SETUP, DETAIL), a template | ||
131 | * cache entry (type RTN*), and a "set" flag. Using the HASHFN and the | ||
132 | * TEST, the function will try to find a matching cache entry in the cache. | ||
133 | * If "set" == 0 : | ||
134 | * If an entry is found, it is returned | ||
135 | * If no entry is found, a new non-VALID entry is created. | ||
136 | * If "set" == 1 and INPLACE == 0 : | ||
137 | * If no entry is found a new one is inserted with data from "template" | ||
138 | * If a non-CACHE_VALID entry is found, it is updated from template using UPDATE | ||
139 | * If a CACHE_VALID entry is found, a new entry is swapped in with data | ||
140 | * from "template" | ||
141 | * If set == 1, and INPLACE == 1 : | ||
142 | * As above, except that if a CACHE_VALID entry is found, we UPDATE in place | ||
143 | * instead of swapping in a new entry. | ||
144 | * | ||
145 | * If the passed handle has the CACHE_NEGATIVE flag set, then UPDATE is not | ||
146 | * run but insteead CACHE_NEGATIVE is set in any new item. | ||
147 | 130 | ||
148 | * In any case, the new entry is returned with a reference count. | 131 | extern struct cache_head * |
149 | * | 132 | sunrpc_cache_lookup(struct cache_detail *detail, |
150 | * | 133 | struct cache_head *key, int hash); |
151 | * RTN is a struct type for a cache entry | 134 | extern struct cache_head * |
152 | * MEMBER is the member of the cache which is cache_head, which must be first | 135 | sunrpc_cache_update(struct cache_detail *detail, |
153 | * FNAME is the name for the function | 136 | struct cache_head *new, struct cache_head *old, int hash); |
154 | * ARGS are arguments to function and must contain RTN *item, int set. May | ||
155 | * also contain something to be usedby SETUP or DETAIL to find cache_detail. | ||
156 | * SETUP locates the cache detail and makes it available as... | ||
157 | * DETAIL identifies the cache detail, possibly set up by SETUP | ||
158 | * HASHFN returns a hash value of the cache entry "item" | ||
159 | * TEST tests if "tmp" matches "item" | ||
160 | * INIT copies key information from "item" to "new" | ||
161 | * UPDATE copies content information from "item" to "tmp" | ||
162 | * INPLACE is true if updates can happen inplace rather than allocating a new structure | ||
163 | * | ||
164 | * WARNING: any substantial changes to this must be reflected in | ||
165 | * net/sunrpc/svcauth.c(auth_domain_lookup) | ||
166 | * which is a similar routine that is open-coded. | ||
167 | */ | ||
168 | #define DefineCacheLookup(RTN,MEMBER,FNAME,ARGS,SETUP,DETAIL,HASHFN,TEST,INIT,UPDATE,INPLACE) \ | ||
169 | RTN *FNAME ARGS \ | ||
170 | { \ | ||
171 | RTN *tmp, *new=NULL; \ | ||
172 | struct cache_head **hp, **head; \ | ||
173 | SETUP; \ | ||
174 | head = &(DETAIL)->hash_table[HASHFN]; \ | ||
175 | retry: \ | ||
176 | if (set||new) write_lock(&(DETAIL)->hash_lock); \ | ||
177 | else read_lock(&(DETAIL)->hash_lock); \ | ||
178 | for(hp=head; *hp != NULL; hp = &tmp->MEMBER.next) { \ | ||
179 | tmp = container_of(*hp, RTN, MEMBER); \ | ||
180 | if (TEST) { /* found a match */ \ | ||
181 | \ | ||
182 | if (set && !INPLACE && test_bit(CACHE_VALID, &tmp->MEMBER.flags) && !new) \ | ||
183 | break; \ | ||
184 | \ | ||
185 | if (new) \ | ||
186 | {INIT;} \ | ||
187 | if (set) { \ | ||
188 | if (!INPLACE && test_bit(CACHE_VALID, &tmp->MEMBER.flags))\ | ||
189 | { /* need to swap in new */ \ | ||
190 | RTN *t2; \ | ||
191 | \ | ||
192 | new->MEMBER.next = tmp->MEMBER.next; \ | ||
193 | *hp = &new->MEMBER; \ | ||
194 | tmp->MEMBER.next = NULL; \ | ||
195 | t2 = tmp; tmp = new; new = t2; \ | ||
196 | } \ | ||
197 | if (test_bit(CACHE_NEGATIVE, &item->MEMBER.flags)) \ | ||
198 | set_bit(CACHE_NEGATIVE, &tmp->MEMBER.flags); \ | ||
199 | else { \ | ||
200 | UPDATE; \ | ||
201 | clear_bit(CACHE_NEGATIVE, &tmp->MEMBER.flags); \ | ||
202 | } \ | ||
203 | } \ | ||
204 | cache_get(&tmp->MEMBER); \ | ||
205 | if (set||new) write_unlock(&(DETAIL)->hash_lock); \ | ||
206 | else read_unlock(&(DETAIL)->hash_lock); \ | ||
207 | if (set) \ | ||
208 | cache_fresh(DETAIL, &tmp->MEMBER, item->MEMBER.expiry_time); \ | ||
209 | if (set && !INPLACE && new) cache_fresh(DETAIL, &new->MEMBER, 0); \ | ||
210 | if (new) (DETAIL)->cache_put(&new->MEMBER, DETAIL); \ | ||
211 | return tmp; \ | ||
212 | } \ | ||
213 | } \ | ||
214 | /* Didn't find anything */ \ | ||
215 | if (new) { \ | ||
216 | INIT; \ | ||
217 | new->MEMBER.next = *head; \ | ||
218 | *head = &new->MEMBER; \ | ||
219 | (DETAIL)->entries ++; \ | ||
220 | cache_get(&new->MEMBER); \ | ||
221 | if (set) { \ | ||
222 | tmp = new; \ | ||
223 | if (test_bit(CACHE_NEGATIVE, &item->MEMBER.flags)) \ | ||
224 | set_bit(CACHE_NEGATIVE, &tmp->MEMBER.flags); \ | ||
225 | else {UPDATE;} \ | ||
226 | } \ | ||
227 | } \ | ||
228 | if (set||new) write_unlock(&(DETAIL)->hash_lock); \ | ||
229 | else read_unlock(&(DETAIL)->hash_lock); \ | ||
230 | if (new && set) \ | ||
231 | cache_fresh(DETAIL, &new->MEMBER, item->MEMBER.expiry_time); \ | ||
232 | if (new) \ | ||
233 | return new; \ | ||
234 | new = kmalloc(sizeof(*new), GFP_KERNEL); \ | ||
235 | if (new) { \ | ||
236 | cache_init(&new->MEMBER); \ | ||
237 | goto retry; \ | ||
238 | } \ | ||
239 | return NULL; \ | ||
240 | } | ||
241 | 137 | ||
242 | #define DefineSimpleCacheLookup(STRUCT,INPLACE) \ | ||
243 | DefineCacheLookup(struct STRUCT, h, STRUCT##_lookup, (struct STRUCT *item, int set), /*no setup */, \ | ||
244 | & STRUCT##_cache, STRUCT##_hash(item), STRUCT##_match(item, tmp),\ | ||
245 | STRUCT##_init(new, item), STRUCT##_update(tmp, item),INPLACE) | ||
246 | 138 | ||
247 | #define cache_for_each(pos, detail, index, member) \ | 139 | #define cache_for_each(pos, detail, index, member) \ |
248 | for (({read_lock(&(detail)->hash_lock); index = (detail)->hash_size;}) ; \ | 140 | for (({read_lock(&(detail)->hash_lock); index = (detail)->hash_size;}) ; \ |
@@ -258,22 +150,19 @@ extern void cache_clean_deferred(void *owner); | |||
258 | 150 | ||
259 | static inline struct cache_head *cache_get(struct cache_head *h) | 151 | static inline struct cache_head *cache_get(struct cache_head *h) |
260 | { | 152 | { |
261 | atomic_inc(&h->refcnt); | 153 | kref_get(&h->ref); |
262 | return h; | 154 | return h; |
263 | } | 155 | } |
264 | 156 | ||
265 | 157 | ||
266 | static inline int cache_put(struct cache_head *h, struct cache_detail *cd) | 158 | static inline void cache_put(struct cache_head *h, struct cache_detail *cd) |
267 | { | 159 | { |
268 | if (atomic_read(&h->refcnt) <= 2 && | 160 | if (atomic_read(&h->ref.refcount) <= 2 && |
269 | h->expiry_time < cd->nextcheck) | 161 | h->expiry_time < cd->nextcheck) |
270 | cd->nextcheck = h->expiry_time; | 162 | cd->nextcheck = h->expiry_time; |
271 | return atomic_dec_and_test(&h->refcnt); | 163 | kref_put(&h->ref, cd->cache_put); |
272 | } | 164 | } |
273 | 165 | ||
274 | extern void cache_init(struct cache_head *h); | ||
275 | extern void cache_fresh(struct cache_detail *detail, | ||
276 | struct cache_head *head, time_t expiry); | ||
277 | extern int cache_check(struct cache_detail *detail, | 166 | extern int cache_check(struct cache_detail *detail, |
278 | struct cache_head *h, struct cache_req *rqstp); | 167 | struct cache_head *h, struct cache_req *rqstp); |
279 | extern void cache_flush(void); | 168 | extern void cache_flush(void); |
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index f147e6b84332..8fe9f35eba31 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h | |||
@@ -45,7 +45,8 @@ struct rpc_clnt { | |||
45 | char * cl_server; /* server machine name */ | 45 | char * cl_server; /* server machine name */ |
46 | char * cl_protname; /* protocol name */ | 46 | char * cl_protname; /* protocol name */ |
47 | struct rpc_auth * cl_auth; /* authenticator */ | 47 | struct rpc_auth * cl_auth; /* authenticator */ |
48 | struct rpc_stat * cl_stats; /* statistics */ | 48 | struct rpc_stat * cl_stats; /* per-program statistics */ |
49 | struct rpc_iostats * cl_metrics; /* per-client statistics */ | ||
49 | 50 | ||
50 | unsigned int cl_softrtry : 1,/* soft timeouts */ | 51 | unsigned int cl_softrtry : 1,/* soft timeouts */ |
51 | cl_intr : 1,/* interruptible */ | 52 | cl_intr : 1,/* interruptible */ |
@@ -59,6 +60,7 @@ struct rpc_clnt { | |||
59 | int cl_nodelen; /* nodename length */ | 60 | int cl_nodelen; /* nodename length */ |
60 | char cl_nodename[UNX_MAXNODENAME]; | 61 | char cl_nodename[UNX_MAXNODENAME]; |
61 | char cl_pathname[30];/* Path in rpc_pipe_fs */ | 62 | char cl_pathname[30];/* Path in rpc_pipe_fs */ |
63 | struct vfsmount * cl_vfsmnt; | ||
62 | struct dentry * cl_dentry; /* inode */ | 64 | struct dentry * cl_dentry; /* inode */ |
63 | struct rpc_clnt * cl_parent; /* Points to parent of clones */ | 65 | struct rpc_clnt * cl_parent; /* Points to parent of clones */ |
64 | struct rpc_rtt cl_rtt_default; | 66 | struct rpc_rtt cl_rtt_default; |
@@ -100,6 +102,8 @@ struct rpc_procinfo { | |||
100 | unsigned int p_bufsiz; /* req. buffer size */ | 102 | unsigned int p_bufsiz; /* req. buffer size */ |
101 | unsigned int p_count; /* call count */ | 103 | unsigned int p_count; /* call count */ |
102 | unsigned int p_timer; /* Which RTT timer to use */ | 104 | unsigned int p_timer; /* Which RTT timer to use */ |
105 | u32 p_statidx; /* Which procedure to account */ | ||
106 | char * p_name; /* name of procedure */ | ||
103 | }; | 107 | }; |
104 | 108 | ||
105 | #define RPC_CONGESTED(clnt) (RPCXPRT_CONGESTED((clnt)->cl_xprt)) | 109 | #define RPC_CONGESTED(clnt) (RPCXPRT_CONGESTED((clnt)->cl_xprt)) |
@@ -137,20 +141,6 @@ size_t rpc_max_payload(struct rpc_clnt *); | |||
137 | void rpc_force_rebind(struct rpc_clnt *); | 141 | void rpc_force_rebind(struct rpc_clnt *); |
138 | int rpc_ping(struct rpc_clnt *clnt, int flags); | 142 | int rpc_ping(struct rpc_clnt *clnt, int flags); |
139 | 143 | ||
140 | static __inline__ | ||
141 | int rpc_call(struct rpc_clnt *clnt, u32 proc, void *argp, void *resp, int flags) | ||
142 | { | ||
143 | struct rpc_message msg = { | ||
144 | .rpc_proc = &clnt->cl_procinfo[proc], | ||
145 | .rpc_argp = argp, | ||
146 | .rpc_resp = resp, | ||
147 | .rpc_cred = NULL | ||
148 | }; | ||
149 | return rpc_call_sync(clnt, &msg, flags); | ||
150 | } | ||
151 | |||
152 | extern void rpciod_wake_up(void); | ||
153 | |||
154 | /* | 144 | /* |
155 | * Helper function for NFSroot support | 145 | * Helper function for NFSroot support |
156 | */ | 146 | */ |
diff --git a/include/linux/sunrpc/gss_krb5.h b/include/linux/sunrpc/gss_krb5.h index 2c3601d31045..1279280d7196 100644 --- a/include/linux/sunrpc/gss_krb5.h +++ b/include/linux/sunrpc/gss_krb5.h | |||
@@ -53,6 +53,8 @@ struct krb5_ctx { | |||
53 | struct xdr_netobj mech_used; | 53 | struct xdr_netobj mech_used; |
54 | }; | 54 | }; |
55 | 55 | ||
56 | extern spinlock_t krb5_seq_lock; | ||
57 | |||
56 | #define KG_TOK_MIC_MSG 0x0101 | 58 | #define KG_TOK_MIC_MSG 0x0101 |
57 | #define KG_TOK_WRAP_MSG 0x0201 | 59 | #define KG_TOK_WRAP_MSG 0x0201 |
58 | 60 | ||
diff --git a/include/linux/sunrpc/metrics.h b/include/linux/sunrpc/metrics.h new file mode 100644 index 000000000000..8f96e9dc369a --- /dev/null +++ b/include/linux/sunrpc/metrics.h | |||
@@ -0,0 +1,77 @@ | |||
1 | /* | ||
2 | * linux/include/linux/sunrpc/metrics.h | ||
3 | * | ||
4 | * Declarations for RPC client per-operation metrics | ||
5 | * | ||
6 | * Copyright (C) 2005 Chuck Lever <cel@netapp.com> | ||
7 | * | ||
8 | * RPC client per-operation statistics provide latency and retry | ||
9 | * information about each type of RPC procedure in a given RPC program. | ||
10 | * These statistics are not for detailed problem diagnosis, but simply | ||
11 | * to indicate whether the problem is local or remote. | ||
12 | * | ||
13 | * These counters are not meant to be human-readable, but are meant to be | ||
14 | * integrated into system monitoring tools such as "sar" and "iostat". As | ||
15 | * such, the counters are sampled by the tools over time, and are never | ||
16 | * zeroed after a file system is mounted. Moving averages can be computed | ||
17 | * by the tools by taking the difference between two instantaneous samples | ||
18 | * and dividing that by the time between the samples. | ||
19 | * | ||
20 | * The counters are maintained in a single array per RPC client, indexed | ||
21 | * by procedure number. There is no need to maintain separate counter | ||
22 | * arrays per-CPU because these counters are always modified behind locks. | ||
23 | */ | ||
24 | |||
25 | #ifndef _LINUX_SUNRPC_METRICS_H | ||
26 | #define _LINUX_SUNRPC_METRICS_H | ||
27 | |||
28 | #include <linux/seq_file.h> | ||
29 | |||
30 | #define RPC_IOSTATS_VERS "1.0" | ||
31 | |||
32 | struct rpc_iostats { | ||
33 | /* | ||
34 | * These counters give an idea about how many request | ||
35 | * transmissions are required, on average, to complete that | ||
36 | * particular procedure. Some procedures may require more | ||
37 | * than one transmission because the server is unresponsive, | ||
38 | * the client is retransmitting too aggressively, or the | ||
39 | * requests are large and the network is congested. | ||
40 | */ | ||
41 | unsigned long om_ops, /* count of operations */ | ||
42 | om_ntrans, /* count of RPC transmissions */ | ||
43 | om_timeouts; /* count of major timeouts */ | ||
44 | |||
45 | /* | ||
46 | * These count how many bytes are sent and received for a | ||
47 | * given RPC procedure type. This indicates how much load a | ||
48 | * particular procedure is putting on the network. These | ||
49 | * counts include the RPC and ULP headers, and the request | ||
50 | * payload. | ||
51 | */ | ||
52 | unsigned long long om_bytes_sent, /* count of bytes out */ | ||
53 | om_bytes_recv; /* count of bytes in */ | ||
54 | |||
55 | /* | ||
56 | * The length of time an RPC request waits in queue before | ||
57 | * transmission, the network + server latency of the request, | ||
58 | * and the total time the request spent from init to release | ||
59 | * are measured. | ||
60 | */ | ||
61 | unsigned long long om_queue, /* jiffies queued for xmit */ | ||
62 | om_rtt, /* jiffies for RPC RTT */ | ||
63 | om_execute; /* jiffies for RPC execution */ | ||
64 | } ____cacheline_aligned; | ||
65 | |||
66 | struct rpc_task; | ||
67 | struct rpc_clnt; | ||
68 | |||
69 | /* | ||
70 | * EXPORTed functions for managing rpc_iostats structures | ||
71 | */ | ||
72 | struct rpc_iostats * rpc_alloc_iostats(struct rpc_clnt *); | ||
73 | void rpc_count_iostats(struct rpc_task *); | ||
74 | void rpc_print_iostats(struct seq_file *, struct rpc_clnt *); | ||
75 | void rpc_free_iostats(struct rpc_iostats *); | ||
76 | |||
77 | #endif /* _LINUX_SUNRPC_METRICS_H */ | ||
diff --git a/include/linux/sunrpc/rpc_pipe_fs.h b/include/linux/sunrpc/rpc_pipe_fs.h index 63929349571f..2c2189cb30aa 100644 --- a/include/linux/sunrpc/rpc_pipe_fs.h +++ b/include/linux/sunrpc/rpc_pipe_fs.h | |||
@@ -45,6 +45,8 @@ extern struct dentry *rpc_mkdir(char *, struct rpc_clnt *); | |||
45 | extern int rpc_rmdir(char *); | 45 | extern int rpc_rmdir(char *); |
46 | extern struct dentry *rpc_mkpipe(char *, void *, struct rpc_pipe_ops *, int flags); | 46 | extern struct dentry *rpc_mkpipe(char *, void *, struct rpc_pipe_ops *, int flags); |
47 | extern int rpc_unlink(char *); | 47 | extern int rpc_unlink(char *); |
48 | extern struct vfsmount *rpc_get_mount(void); | ||
49 | extern void rpc_put_mount(void); | ||
48 | 50 | ||
49 | #endif | 51 | #endif |
50 | #endif | 52 | #endif |
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index 8b25629accd8..82a91bb22362 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h | |||
@@ -86,6 +86,12 @@ struct rpc_task { | |||
86 | struct work_struct tk_work; /* Async task work queue */ | 86 | struct work_struct tk_work; /* Async task work queue */ |
87 | struct rpc_wait tk_wait; /* RPC wait */ | 87 | struct rpc_wait tk_wait; /* RPC wait */ |
88 | } u; | 88 | } u; |
89 | |||
90 | unsigned short tk_timeouts; /* maj timeouts */ | ||
91 | size_t tk_bytes_sent; /* total bytes sent */ | ||
92 | unsigned long tk_start; /* RPC task init timestamp */ | ||
93 | long tk_rtt; /* round-trip time (jiffies) */ | ||
94 | |||
89 | #ifdef RPC_DEBUG | 95 | #ifdef RPC_DEBUG |
90 | unsigned short tk_pid; /* debugging aid */ | 96 | unsigned short tk_pid; /* debugging aid */ |
91 | #endif | 97 | #endif |
@@ -203,6 +209,7 @@ struct rpc_wait_queue { | |||
203 | unsigned char priority; /* current priority */ | 209 | unsigned char priority; /* current priority */ |
204 | unsigned char count; /* # task groups remaining serviced so far */ | 210 | unsigned char count; /* # task groups remaining serviced so far */ |
205 | unsigned char nr; /* # tasks remaining for cookie */ | 211 | unsigned char nr; /* # tasks remaining for cookie */ |
212 | unsigned short qlen; /* total # tasks waiting in queue */ | ||
206 | #ifdef RPC_DEBUG | 213 | #ifdef RPC_DEBUG |
207 | const char * name; | 214 | const char * name; |
208 | #endif | 215 | #endif |
@@ -269,13 +276,13 @@ void * rpc_malloc(struct rpc_task *, size_t); | |||
269 | void rpc_free(struct rpc_task *); | 276 | void rpc_free(struct rpc_task *); |
270 | int rpciod_up(void); | 277 | int rpciod_up(void); |
271 | void rpciod_down(void); | 278 | void rpciod_down(void); |
272 | void rpciod_wake_up(void); | ||
273 | int __rpc_wait_for_completion_task(struct rpc_task *task, int (*)(void *)); | 279 | int __rpc_wait_for_completion_task(struct rpc_task *task, int (*)(void *)); |
274 | #ifdef RPC_DEBUG | 280 | #ifdef RPC_DEBUG |
275 | void rpc_show_tasks(void); | 281 | void rpc_show_tasks(void); |
276 | #endif | 282 | #endif |
277 | int rpc_init_mempool(void); | 283 | int rpc_init_mempool(void); |
278 | void rpc_destroy_mempool(void); | 284 | void rpc_destroy_mempool(void); |
285 | extern struct workqueue_struct *rpciod_workqueue; | ||
279 | 286 | ||
280 | static inline void rpc_exit(struct rpc_task *task, int status) | 287 | static inline void rpc_exit(struct rpc_task *task, int status) |
281 | { | 288 | { |
diff --git a/include/linux/sunrpc/stats.h b/include/linux/sunrpc/stats.h index 0d6ed3c8bdc4..d93c24b47f3f 100644 --- a/include/linux/sunrpc/stats.h +++ b/include/linux/sunrpc/stats.h | |||
@@ -50,7 +50,7 @@ struct proc_dir_entry * rpc_proc_register(struct rpc_stat *); | |||
50 | void rpc_proc_unregister(const char *); | 50 | void rpc_proc_unregister(const char *); |
51 | void rpc_proc_zero(struct rpc_program *); | 51 | void rpc_proc_zero(struct rpc_program *); |
52 | struct proc_dir_entry * svc_proc_register(struct svc_stat *, | 52 | struct proc_dir_entry * svc_proc_register(struct svc_stat *, |
53 | struct file_operations *); | 53 | const struct file_operations *); |
54 | void svc_proc_unregister(const char *); | 54 | void svc_proc_unregister(const char *); |
55 | 55 | ||
56 | void svc_seq_show(struct seq_file *, | 56 | void svc_seq_show(struct seq_file *, |
@@ -65,7 +65,7 @@ static inline void rpc_proc_unregister(const char *p) {} | |||
65 | static inline void rpc_proc_zero(struct rpc_program *p) {} | 65 | static inline void rpc_proc_zero(struct rpc_program *p) {} |
66 | 66 | ||
67 | static inline struct proc_dir_entry *svc_proc_register(struct svc_stat *s, | 67 | static inline struct proc_dir_entry *svc_proc_register(struct svc_stat *s, |
68 | struct file_operations *f) { return NULL; } | 68 | const struct file_operations *f) { return NULL; } |
69 | static inline void svc_proc_unregister(const char *p) {} | 69 | static inline void svc_proc_unregister(const char *p) {} |
70 | 70 | ||
71 | static inline void svc_seq_show(struct seq_file *seq, | 71 | static inline void svc_seq_show(struct seq_file *seq, |
diff --git a/include/linux/sunrpc/svcauth.h b/include/linux/sunrpc/svcauth.h index c119ce7cbd22..2fe2087edd66 100644 --- a/include/linux/sunrpc/svcauth.h +++ b/include/linux/sunrpc/svcauth.h | |||
@@ -45,9 +45,10 @@ struct svc_rqst; /* forward decl */ | |||
45 | * of ip addresses to the given client. | 45 | * of ip addresses to the given client. |
46 | */ | 46 | */ |
47 | struct auth_domain { | 47 | struct auth_domain { |
48 | struct cache_head h; | 48 | struct kref ref; |
49 | struct hlist_node hash; | ||
49 | char *name; | 50 | char *name; |
50 | int flavour; | 51 | struct auth_ops *flavour; |
51 | }; | 52 | }; |
52 | 53 | ||
53 | /* | 54 | /* |
@@ -86,6 +87,9 @@ struct auth_domain { | |||
86 | * | 87 | * |
87 | * domain_release() | 88 | * domain_release() |
88 | * This call releases a domain. | 89 | * This call releases a domain. |
90 | * set_client() | ||
91 | * Givens a pending request (struct svc_rqst), finds and assigns | ||
92 | * an appropriate 'auth_domain' as the client. | ||
89 | */ | 93 | */ |
90 | struct auth_ops { | 94 | struct auth_ops { |
91 | char * name; | 95 | char * name; |
@@ -117,7 +121,7 @@ extern void svc_auth_unregister(rpc_authflavor_t flavor); | |||
117 | extern struct auth_domain *unix_domain_find(char *name); | 121 | extern struct auth_domain *unix_domain_find(char *name); |
118 | extern void auth_domain_put(struct auth_domain *item); | 122 | extern void auth_domain_put(struct auth_domain *item); |
119 | extern int auth_unix_add_addr(struct in_addr addr, struct auth_domain *dom); | 123 | extern int auth_unix_add_addr(struct in_addr addr, struct auth_domain *dom); |
120 | extern struct auth_domain *auth_domain_lookup(struct auth_domain *item, int set); | 124 | extern struct auth_domain *auth_domain_lookup(char *name, struct auth_domain *new); |
121 | extern struct auth_domain *auth_domain_find(char *name); | 125 | extern struct auth_domain *auth_domain_find(char *name); |
122 | extern struct auth_domain *auth_unix_lookup(struct in_addr addr); | 126 | extern struct auth_domain *auth_unix_lookup(struct in_addr addr); |
123 | extern int auth_unix_forget_old(struct auth_domain *dom); | 127 | extern int auth_unix_forget_old(struct auth_domain *dom); |
@@ -160,8 +164,6 @@ static inline unsigned long hash_mem(char *buf, int length, int bits) | |||
160 | return hash >> (BITS_PER_LONG - bits); | 164 | return hash >> (BITS_PER_LONG - bits); |
161 | } | 165 | } |
162 | 166 | ||
163 | extern struct cache_detail auth_domain_cache, ip_map_cache; | ||
164 | |||
165 | #endif /* __KERNEL__ */ | 167 | #endif /* __KERNEL__ */ |
166 | 168 | ||
167 | #endif /* _LINUX_SUNRPC_SVCAUTH_H_ */ | 169 | #endif /* _LINUX_SUNRPC_SVCAUTH_H_ */ |
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index 6ef99b14ff09..7eebbab7160b 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
@@ -114,6 +114,7 @@ struct rpc_xprt_ops { | |||
114 | void (*release_request)(struct rpc_task *task); | 114 | void (*release_request)(struct rpc_task *task); |
115 | void (*close)(struct rpc_xprt *xprt); | 115 | void (*close)(struct rpc_xprt *xprt); |
116 | void (*destroy)(struct rpc_xprt *xprt); | 116 | void (*destroy)(struct rpc_xprt *xprt); |
117 | void (*print_stats)(struct rpc_xprt *xprt, struct seq_file *seq); | ||
117 | }; | 118 | }; |
118 | 119 | ||
119 | struct rpc_xprt { | 120 | struct rpc_xprt { |
@@ -187,6 +188,18 @@ struct rpc_xprt { | |||
187 | 188 | ||
188 | struct list_head recv; | 189 | struct list_head recv; |
189 | 190 | ||
191 | struct { | ||
192 | unsigned long bind_count, /* total number of binds */ | ||
193 | connect_count, /* total number of connects */ | ||
194 | connect_start, /* connect start timestamp */ | ||
195 | connect_time, /* jiffies waiting for connect */ | ||
196 | sends, /* how many complete requests */ | ||
197 | recvs, /* how many complete requests */ | ||
198 | bad_xids; /* lookup_rqst didn't find XID */ | ||
199 | |||
200 | unsigned long long req_u, /* average requests on the wire */ | ||
201 | bklog_u; /* backlog queue utilization */ | ||
202 | } stat; | ||
190 | 203 | ||
191 | void (*old_data_ready)(struct sock *, int); | 204 | void (*old_data_ready)(struct sock *, int); |
192 | void (*old_state_change)(struct sock *); | 205 | void (*old_state_change)(struct sock *); |
diff --git a/include/linux/swap.h b/include/linux/swap.h index d572b19afb7d..54eac8a39a4c 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -172,9 +172,24 @@ extern int rotate_reclaimable_page(struct page *page); | |||
172 | extern void swap_setup(void); | 172 | extern void swap_setup(void); |
173 | 173 | ||
174 | /* linux/mm/vmscan.c */ | 174 | /* linux/mm/vmscan.c */ |
175 | extern int try_to_free_pages(struct zone **, gfp_t); | 175 | extern unsigned long try_to_free_pages(struct zone **, gfp_t); |
176 | extern int shrink_all_memory(int); | 176 | extern unsigned long shrink_all_memory(unsigned long nr_pages); |
177 | extern int vm_swappiness; | 177 | extern int vm_swappiness; |
178 | extern int remove_mapping(struct address_space *mapping, struct page *page); | ||
179 | |||
180 | /* possible outcome of pageout() */ | ||
181 | typedef enum { | ||
182 | /* failed to write page out, page is locked */ | ||
183 | PAGE_KEEP, | ||
184 | /* move page to the active list, page is locked */ | ||
185 | PAGE_ACTIVATE, | ||
186 | /* page has been sent to the disk successfully, page is unlocked */ | ||
187 | PAGE_SUCCESS, | ||
188 | /* page is clean and locked */ | ||
189 | PAGE_CLEAN, | ||
190 | } pageout_t; | ||
191 | |||
192 | extern pageout_t pageout(struct page *page, struct address_space *mapping); | ||
178 | 193 | ||
179 | #ifdef CONFIG_NUMA | 194 | #ifdef CONFIG_NUMA |
180 | extern int zone_reclaim_mode; | 195 | extern int zone_reclaim_mode; |
@@ -188,25 +203,6 @@ static inline int zone_reclaim(struct zone *z, gfp_t mask, unsigned int order) | |||
188 | } | 203 | } |
189 | #endif | 204 | #endif |
190 | 205 | ||
191 | #ifdef CONFIG_MIGRATION | ||
192 | extern int isolate_lru_page(struct page *p); | ||
193 | extern int putback_lru_pages(struct list_head *l); | ||
194 | extern int migrate_page(struct page *, struct page *); | ||
195 | extern void migrate_page_copy(struct page *, struct page *); | ||
196 | extern int migrate_page_remove_references(struct page *, struct page *, int); | ||
197 | extern int migrate_pages(struct list_head *l, struct list_head *t, | ||
198 | struct list_head *moved, struct list_head *failed); | ||
199 | extern int fail_migrate_page(struct page *, struct page *); | ||
200 | #else | ||
201 | static inline int isolate_lru_page(struct page *p) { return -ENOSYS; } | ||
202 | static inline int putback_lru_pages(struct list_head *l) { return 0; } | ||
203 | static inline int migrate_pages(struct list_head *l, struct list_head *t, | ||
204 | struct list_head *moved, struct list_head *failed) { return -ENOSYS; } | ||
205 | /* Possible settings for the migrate_page() method in address_operations */ | ||
206 | #define migrate_page NULL | ||
207 | #define fail_migrate_page NULL | ||
208 | #endif | ||
209 | |||
210 | #ifdef CONFIG_MMU | 206 | #ifdef CONFIG_MMU |
211 | /* linux/mm/shmem.c */ | 207 | /* linux/mm/shmem.c */ |
212 | extern int shmem_unuse(swp_entry_t entry, struct page *page); | 208 | extern int shmem_unuse(swp_entry_t entry, struct page *page); |
@@ -238,14 +234,15 @@ extern struct page * read_swap_cache_async(swp_entry_t, struct vm_area_struct *v | |||
238 | /* linux/mm/swapfile.c */ | 234 | /* linux/mm/swapfile.c */ |
239 | extern long total_swap_pages; | 235 | extern long total_swap_pages; |
240 | extern unsigned int nr_swapfiles; | 236 | extern unsigned int nr_swapfiles; |
241 | extern struct swap_info_struct swap_info[]; | ||
242 | extern void si_swapinfo(struct sysinfo *); | 237 | extern void si_swapinfo(struct sysinfo *); |
243 | extern swp_entry_t get_swap_page(void); | 238 | extern swp_entry_t get_swap_page(void); |
244 | extern swp_entry_t get_swap_page_of_type(int type); | 239 | extern swp_entry_t get_swap_page_of_type(int); |
245 | extern int swap_duplicate(swp_entry_t); | 240 | extern int swap_duplicate(swp_entry_t); |
246 | extern int valid_swaphandles(swp_entry_t, unsigned long *); | 241 | extern int valid_swaphandles(swp_entry_t, unsigned long *); |
247 | extern void swap_free(swp_entry_t); | 242 | extern void swap_free(swp_entry_t); |
248 | extern void free_swap_and_cache(swp_entry_t); | 243 | extern void free_swap_and_cache(swp_entry_t); |
244 | extern int swap_type_of(dev_t); | ||
245 | extern unsigned int count_swap_pages(int, int); | ||
249 | extern sector_t map_swap_page(struct swap_info_struct *, pgoff_t); | 246 | extern sector_t map_swap_page(struct swap_info_struct *, pgoff_t); |
250 | extern struct swap_info_struct *get_swap_info_struct(unsigned); | 247 | extern struct swap_info_struct *get_swap_info_struct(unsigned); |
251 | extern int can_share_swap_page(struct page *); | 248 | extern int can_share_swap_page(struct page *); |
diff --git a/include/linux/synclink.h b/include/linux/synclink.h index 1b7cd8d1a71b..2993302f7923 100644 --- a/include/linux/synclink.h +++ b/include/linux/synclink.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * SyncLink Multiprotocol Serial Adapter Driver | 2 | * SyncLink Multiprotocol Serial Adapter Driver |
3 | * | 3 | * |
4 | * $Id: synclink.h,v 3.10 2005/11/08 19:50:54 paulkf Exp $ | 4 | * $Id: synclink.h,v 3.11 2006/02/06 21:20:29 paulkf Exp $ |
5 | * | 5 | * |
6 | * Copyright (C) 1998-2000 by Microgate Corporation | 6 | * Copyright (C) 1998-2000 by Microgate Corporation |
7 | * | 7 | * |
@@ -221,6 +221,12 @@ struct mgsl_icount { | |||
221 | __u32 rxidle; | 221 | __u32 rxidle; |
222 | }; | 222 | }; |
223 | 223 | ||
224 | struct gpio_desc { | ||
225 | __u32 state; | ||
226 | __u32 smask; | ||
227 | __u32 dir; | ||
228 | __u32 dmask; | ||
229 | }; | ||
224 | 230 | ||
225 | #define DEBUG_LEVEL_DATA 1 | 231 | #define DEBUG_LEVEL_DATA 1 |
226 | #define DEBUG_LEVEL_ERROR 2 | 232 | #define DEBUG_LEVEL_ERROR 2 |
@@ -276,5 +282,8 @@ struct mgsl_icount { | |||
276 | #define MGSL_IOCLOOPTXDONE _IO(MGSL_MAGIC_IOC,9) | 282 | #define MGSL_IOCLOOPTXDONE _IO(MGSL_MAGIC_IOC,9) |
277 | #define MGSL_IOCSIF _IO(MGSL_MAGIC_IOC,10) | 283 | #define MGSL_IOCSIF _IO(MGSL_MAGIC_IOC,10) |
278 | #define MGSL_IOCGIF _IO(MGSL_MAGIC_IOC,11) | 284 | #define MGSL_IOCGIF _IO(MGSL_MAGIC_IOC,11) |
285 | #define MGSL_IOCSGPIO _IOW(MGSL_MAGIC_IOC,16,struct gpio_desc) | ||
286 | #define MGSL_IOCGGPIO _IOR(MGSL_MAGIC_IOC,17,struct gpio_desc) | ||
287 | #define MGSL_IOCWAITGPIO _IOWR(MGSL_MAGIC_IOC,18,struct gpio_desc) | ||
279 | 288 | ||
280 | #endif /* _SYNCLINK_H_ */ | 289 | #endif /* _SYNCLINK_H_ */ |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index b9ea44ac0ddb..e487e3b60f60 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -568,5 +568,6 @@ asmlinkage long compat_sys_newfstatat(unsigned int dfd, char __user * filename, | |||
568 | int flag); | 568 | int flag); |
569 | asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename, | 569 | asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename, |
570 | int flags, int mode); | 570 | int flags, int mode); |
571 | asmlinkage long sys_unshare(unsigned long unshare_flags); | ||
571 | 572 | ||
572 | #endif | 573 | #endif |
diff --git a/include/linux/threads.h b/include/linux/threads.h index b59738ac6197..e646bcdf2614 100644 --- a/include/linux/threads.h +++ b/include/linux/threads.h | |||
@@ -28,7 +28,8 @@ | |||
28 | #define PID_MAX_DEFAULT (CONFIG_BASE_SMALL ? 0x1000 : 0x8000) | 28 | #define PID_MAX_DEFAULT (CONFIG_BASE_SMALL ? 0x1000 : 0x8000) |
29 | 29 | ||
30 | /* | 30 | /* |
31 | * A maximum of 4 million PIDs should be enough for a while: | 31 | * A maximum of 4 million PIDs should be enough for a while. |
32 | * [NOTE: PID/TIDs are limited to 2^29 ~= 500+ million, see futex.h.] | ||
32 | */ | 33 | */ |
33 | #define PID_MAX_LIMIT (CONFIG_BASE_SMALL ? PAGE_SIZE * 8 : \ | 34 | #define PID_MAX_LIMIT (CONFIG_BASE_SMALL ? PAGE_SIZE * 8 : \ |
34 | (sizeof(long) > 4 ? 4 * 1024 * 1024 : PID_MAX_DEFAULT)) | 35 | (sizeof(long) > 4 ? 4 * 1024 * 1024 : PID_MAX_DEFAULT)) |
diff --git a/include/linux/time.h b/include/linux/time.h index d9cdba54b789..0cd696cee998 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
@@ -73,12 +73,6 @@ extern void set_normalized_timespec(struct timespec *ts, time_t sec, long nsec); | |||
73 | #define timespec_valid(ts) \ | 73 | #define timespec_valid(ts) \ |
74 | (((ts)->tv_sec >= 0) && (((unsigned long) (ts)->tv_nsec) < NSEC_PER_SEC)) | 74 | (((ts)->tv_sec >= 0) && (((unsigned long) (ts)->tv_nsec) < NSEC_PER_SEC)) |
75 | 75 | ||
76 | /* | ||
77 | * 64-bit nanosec type. Large enough to span 292+ years in nanosecond | ||
78 | * resolution. Ought to be enough for a while. | ||
79 | */ | ||
80 | typedef s64 nsec_t; | ||
81 | |||
82 | extern struct timespec xtime; | 76 | extern struct timespec xtime; |
83 | extern struct timespec wall_to_monotonic; | 77 | extern struct timespec wall_to_monotonic; |
84 | extern seqlock_t xtime_lock; | 78 | extern seqlock_t xtime_lock; |
@@ -101,6 +95,7 @@ extern long do_utimes(int dfd, char __user *filename, struct timeval *times); | |||
101 | struct itimerval; | 95 | struct itimerval; |
102 | extern int do_setitimer(int which, struct itimerval *value, | 96 | extern int do_setitimer(int which, struct itimerval *value, |
103 | struct itimerval *ovalue); | 97 | struct itimerval *ovalue); |
98 | extern unsigned int alarm_setitimer(unsigned int seconds); | ||
104 | extern int do_getitimer(int which, struct itimerval *value); | 99 | extern int do_getitimer(int which, struct itimerval *value); |
105 | extern void getnstimeofday(struct timespec *tv); | 100 | extern void getnstimeofday(struct timespec *tv); |
106 | 101 | ||
@@ -113,9 +108,9 @@ extern struct timespec timespec_trunc(struct timespec t, unsigned gran); | |||
113 | * Returns the scalar nanosecond representation of the timespec | 108 | * Returns the scalar nanosecond representation of the timespec |
114 | * parameter. | 109 | * parameter. |
115 | */ | 110 | */ |
116 | static inline nsec_t timespec_to_ns(const struct timespec *ts) | 111 | static inline s64 timespec_to_ns(const struct timespec *ts) |
117 | { | 112 | { |
118 | return ((nsec_t) ts->tv_sec * NSEC_PER_SEC) + ts->tv_nsec; | 113 | return ((s64) ts->tv_sec * NSEC_PER_SEC) + ts->tv_nsec; |
119 | } | 114 | } |
120 | 115 | ||
121 | /** | 116 | /** |
@@ -125,9 +120,9 @@ static inline nsec_t timespec_to_ns(const struct timespec *ts) | |||
125 | * Returns the scalar nanosecond representation of the timeval | 120 | * Returns the scalar nanosecond representation of the timeval |
126 | * parameter. | 121 | * parameter. |
127 | */ | 122 | */ |
128 | static inline nsec_t timeval_to_ns(const struct timeval *tv) | 123 | static inline s64 timeval_to_ns(const struct timeval *tv) |
129 | { | 124 | { |
130 | return ((nsec_t) tv->tv_sec * NSEC_PER_SEC) + | 125 | return ((s64) tv->tv_sec * NSEC_PER_SEC) + |
131 | tv->tv_usec * NSEC_PER_USEC; | 126 | tv->tv_usec * NSEC_PER_USEC; |
132 | } | 127 | } |
133 | 128 | ||
@@ -137,7 +132,7 @@ static inline nsec_t timeval_to_ns(const struct timeval *tv) | |||
137 | * | 132 | * |
138 | * Returns the timespec representation of the nsec parameter. | 133 | * Returns the timespec representation of the nsec parameter. |
139 | */ | 134 | */ |
140 | extern struct timespec ns_to_timespec(const nsec_t nsec); | 135 | extern struct timespec ns_to_timespec(const s64 nsec); |
141 | 136 | ||
142 | /** | 137 | /** |
143 | * ns_to_timeval - Convert nanoseconds to timeval | 138 | * ns_to_timeval - Convert nanoseconds to timeval |
@@ -145,7 +140,7 @@ extern struct timespec ns_to_timespec(const nsec_t nsec); | |||
145 | * | 140 | * |
146 | * Returns the timeval representation of the nsec parameter. | 141 | * Returns the timeval representation of the nsec parameter. |
147 | */ | 142 | */ |
148 | extern struct timeval ns_to_timeval(const nsec_t nsec); | 143 | extern struct timeval ns_to_timeval(const s64 nsec); |
149 | 144 | ||
150 | #endif /* __KERNEL__ */ | 145 | #endif /* __KERNEL__ */ |
151 | 146 | ||
diff --git a/include/linux/timer.h b/include/linux/timer.h index 9b9877fd2505..b5caabca553c 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h | |||
@@ -69,13 +69,13 @@ extern unsigned long next_timer_interrupt(void); | |||
69 | * @timer: the timer to be added | 69 | * @timer: the timer to be added |
70 | * | 70 | * |
71 | * The kernel will do a ->function(->data) callback from the | 71 | * The kernel will do a ->function(->data) callback from the |
72 | * timer interrupt at the ->expired point in the future. The | 72 | * timer interrupt at the ->expires point in the future. The |
73 | * current time is 'jiffies'. | 73 | * current time is 'jiffies'. |
74 | * | 74 | * |
75 | * The timer's ->expired, ->function (and if the handler uses it, ->data) | 75 | * The timer's ->expires, ->function (and if the handler uses it, ->data) |
76 | * fields must be set prior calling this function. | 76 | * fields must be set prior calling this function. |
77 | * | 77 | * |
78 | * Timers with an ->expired field in the past will be executed in the next | 78 | * Timers with an ->expires field in the past will be executed in the next |
79 | * timer tick. | 79 | * timer tick. |
80 | */ | 80 | */ |
81 | static inline void add_timer(struct timer_list *timer) | 81 | static inline void add_timer(struct timer_list *timer) |
@@ -96,6 +96,7 @@ static inline void add_timer(struct timer_list *timer) | |||
96 | 96 | ||
97 | extern void init_timers(void); | 97 | extern void init_timers(void); |
98 | extern void run_local_timers(void); | 98 | extern void run_local_timers(void); |
99 | extern int it_real_fn(void *); | 99 | struct hrtimer; |
100 | extern int it_real_fn(struct hrtimer *); | ||
100 | 101 | ||
101 | #endif | 102 | #endif |
diff --git a/include/linux/timex.h b/include/linux/timex.h index b7ca1204e42a..03914b7e41b1 100644 --- a/include/linux/timex.h +++ b/include/linux/timex.h | |||
@@ -97,38 +97,11 @@ | |||
97 | 97 | ||
98 | #define MAXPHASE 512000L /* max phase error (us) */ | 98 | #define MAXPHASE 512000L /* max phase error (us) */ |
99 | #define MAXFREQ (512L << SHIFT_USEC) /* max frequency error (ppm) */ | 99 | #define MAXFREQ (512L << SHIFT_USEC) /* max frequency error (ppm) */ |
100 | #define MAXTIME (200L << PPS_AVG) /* max PPS error (jitter) (200 us) */ | ||
101 | #define MINSEC 16L /* min interval between updates (s) */ | 100 | #define MINSEC 16L /* min interval between updates (s) */ |
102 | #define MAXSEC 1200L /* max interval between updates (s) */ | 101 | #define MAXSEC 1200L /* max interval between updates (s) */ |
103 | #define NTP_PHASE_LIMIT (MAXPHASE << 5) /* beyond max. dispersion */ | 102 | #define NTP_PHASE_LIMIT (MAXPHASE << 5) /* beyond max. dispersion */ |
104 | 103 | ||
105 | /* | 104 | /* |
106 | * The following defines are used only if a pulse-per-second (PPS) | ||
107 | * signal is available and connected via a modem control lead, such as | ||
108 | * produced by the optional ppsclock feature incorporated in the Sun | ||
109 | * asynch driver. They establish the design parameters of the frequency- | ||
110 | * lock loop used to discipline the CPU clock oscillator to the PPS | ||
111 | * signal. | ||
112 | * | ||
113 | * PPS_AVG is the averaging factor for the frequency loop, as well as | ||
114 | * the time and frequency dispersion. | ||
115 | * | ||
116 | * PPS_SHIFT and PPS_SHIFTMAX specify the minimum and maximum | ||
117 | * calibration intervals, respectively, in seconds as a power of two. | ||
118 | * | ||
119 | * PPS_VALID is the maximum interval before the PPS signal is considered | ||
120 | * invalid and protocol updates used directly instead. | ||
121 | * | ||
122 | * MAXGLITCH is the maximum interval before a time offset of more than | ||
123 | * MAXTIME is believed. | ||
124 | */ | ||
125 | #define PPS_AVG 2 /* pps averaging constant (shift) */ | ||
126 | #define PPS_SHIFT 2 /* min interval duration (s) (shift) */ | ||
127 | #define PPS_SHIFTMAX 8 /* max interval duration (s) (shift) */ | ||
128 | #define PPS_VALID 120 /* pps signal watchdog max (s) */ | ||
129 | #define MAXGLITCH 30 /* pps signal glitch max (s) */ | ||
130 | |||
131 | /* | ||
132 | * syscall interface - used (mainly by NTP daemon) | 105 | * syscall interface - used (mainly by NTP daemon) |
133 | * to discipline kernel clock oscillator | 106 | * to discipline kernel clock oscillator |
134 | */ | 107 | */ |
@@ -246,20 +219,6 @@ extern long time_reftime; /* time at last adjustment (s) */ | |||
246 | extern long time_adjust; /* The amount of adjtime left */ | 219 | extern long time_adjust; /* The amount of adjtime left */ |
247 | extern long time_next_adjust; /* Value for time_adjust at next tick */ | 220 | extern long time_next_adjust; /* Value for time_adjust at next tick */ |
248 | 221 | ||
249 | /* interface variables pps->timer interrupt */ | ||
250 | extern long pps_offset; /* pps time offset (us) */ | ||
251 | extern long pps_jitter; /* time dispersion (jitter) (us) */ | ||
252 | extern long pps_freq; /* frequency offset (scaled ppm) */ | ||
253 | extern long pps_stabil; /* frequency dispersion (scaled ppm) */ | ||
254 | extern long pps_valid; /* pps signal watchdog counter */ | ||
255 | |||
256 | /* interface variables pps->adjtimex */ | ||
257 | extern int pps_shift; /* interval duration (s) (shift) */ | ||
258 | extern long pps_jitcnt; /* jitter limit exceeded */ | ||
259 | extern long pps_calcnt; /* calibration intervals */ | ||
260 | extern long pps_errcnt; /* calibration errors */ | ||
261 | extern long pps_stbcnt; /* stability limit exceeded */ | ||
262 | |||
263 | /** | 222 | /** |
264 | * ntp_clear - Clears the NTP state variables | 223 | * ntp_clear - Clears the NTP state variables |
265 | * | 224 | * |
@@ -348,6 +307,8 @@ time_interpolator_reset(void) | |||
348 | /* Returns how long ticks are at present, in ns / 2^(SHIFT_SCALE-10). */ | 307 | /* Returns how long ticks are at present, in ns / 2^(SHIFT_SCALE-10). */ |
349 | extern u64 current_tick_length(void); | 308 | extern u64 current_tick_length(void); |
350 | 309 | ||
310 | extern int do_adjtimex(struct timex *); | ||
311 | |||
351 | #endif /* KERNEL */ | 312 | #endif /* KERNEL */ |
352 | 313 | ||
353 | #endif /* LINUX_TIMEX_H */ | 314 | #endif /* LINUX_TIMEX_H */ |
diff --git a/include/linux/topology.h b/include/linux/topology.h index e8eb0040ce3a..a305ae2e44b6 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h | |||
@@ -164,6 +164,15 @@ | |||
164 | .nr_balance_failed = 0, \ | 164 | .nr_balance_failed = 0, \ |
165 | } | 165 | } |
166 | 166 | ||
167 | #ifdef CONFIG_SCHED_MC | ||
168 | #ifndef SD_MC_INIT | ||
169 | /* for now its same as SD_CPU_INIT. | ||
170 | * TBD: Tune Domain parameters! | ||
171 | */ | ||
172 | #define SD_MC_INIT SD_CPU_INIT | ||
173 | #endif | ||
174 | #endif | ||
175 | |||
167 | #ifdef CONFIG_NUMA | 176 | #ifdef CONFIG_NUMA |
168 | #ifndef SD_NODE_INIT | 177 | #ifndef SD_NODE_INIT |
169 | #error Please define an appropriate SD_NODE_INIT in include/asm/topology.h!!! | 178 | #error Please define an appropriate SD_NODE_INIT in include/asm/topology.h!!! |
diff --git a/include/linux/tty.h b/include/linux/tty.h index f45cd74e6f24..f13f49afe198 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/tty_driver.h> | 24 | #include <linux/tty_driver.h> |
25 | #include <linux/tty_ldisc.h> | 25 | #include <linux/tty_ldisc.h> |
26 | #include <linux/screen_info.h> | 26 | #include <linux/screen_info.h> |
27 | #include <linux/mutex.h> | ||
27 | 28 | ||
28 | #include <asm/system.h> | 29 | #include <asm/system.h> |
29 | 30 | ||
@@ -231,8 +232,8 @@ struct tty_struct { | |||
231 | int canon_data; | 232 | int canon_data; |
232 | unsigned long canon_head; | 233 | unsigned long canon_head; |
233 | unsigned int canon_column; | 234 | unsigned int canon_column; |
234 | struct semaphore atomic_read; | 235 | struct mutex atomic_read_lock; |
235 | struct semaphore atomic_write; | 236 | struct mutex atomic_write_lock; |
236 | unsigned char *write_buf; | 237 | unsigned char *write_buf; |
237 | int write_cnt; | 238 | int write_cnt; |
238 | spinlock_t read_lock; | 239 | spinlock_t read_lock; |
@@ -319,8 +320,7 @@ extern void tty_ldisc_put(int); | |||
319 | extern void tty_wakeup(struct tty_struct *tty); | 320 | extern void tty_wakeup(struct tty_struct *tty); |
320 | extern void tty_ldisc_flush(struct tty_struct *tty); | 321 | extern void tty_ldisc_flush(struct tty_struct *tty); |
321 | 322 | ||
322 | struct semaphore; | 323 | extern struct mutex tty_mutex; |
323 | extern struct semaphore tty_sem; | ||
324 | 324 | ||
325 | /* n_tty.c */ | 325 | /* n_tty.c */ |
326 | extern struct tty_ldisc tty_ldisc_N_TTY; | 326 | extern struct tty_ldisc tty_ldisc_N_TTY; |
diff --git a/include/linux/tty_flip.h b/include/linux/tty_flip.h index 222faf97d5f9..0976a163b459 100644 --- a/include/linux/tty_flip.h +++ b/include/linux/tty_flip.h | |||
@@ -2,19 +2,13 @@ | |||
2 | #define _LINUX_TTY_FLIP_H | 2 | #define _LINUX_TTY_FLIP_H |
3 | 3 | ||
4 | extern int tty_buffer_request_room(struct tty_struct *tty, size_t size); | 4 | extern int tty_buffer_request_room(struct tty_struct *tty, size_t size); |
5 | extern int tty_insert_flip_string(struct tty_struct *tty, unsigned char *chars, size_t size); | 5 | extern int tty_insert_flip_string(struct tty_struct *tty, const unsigned char *chars, size_t size); |
6 | extern int tty_insert_flip_string_flags(struct tty_struct *tty, unsigned char *chars, char *flags, size_t size); | 6 | extern int tty_insert_flip_string_flags(struct tty_struct *tty, const unsigned char *chars, const char *flags, size_t size); |
7 | extern int tty_prepare_flip_string(struct tty_struct *tty, unsigned char **chars, size_t size); | 7 | extern int tty_prepare_flip_string(struct tty_struct *tty, unsigned char **chars, size_t size); |
8 | extern int tty_prepare_flip_string_flags(struct tty_struct *tty, unsigned char **chars, char **flags, size_t size); | 8 | extern int tty_prepare_flip_string_flags(struct tty_struct *tty, unsigned char **chars, char **flags, size_t size); |
9 | 9 | ||
10 | #ifdef INCLUDE_INLINE_FUNCS | 10 | static inline int tty_insert_flip_char(struct tty_struct *tty, |
11 | #define _INLINE_ extern | 11 | unsigned char ch, char flag) |
12 | #else | ||
13 | #define _INLINE_ static __inline__ | ||
14 | #endif | ||
15 | |||
16 | _INLINE_ int tty_insert_flip_char(struct tty_struct *tty, | ||
17 | unsigned char ch, char flag) | ||
18 | { | 12 | { |
19 | struct tty_buffer *tb = tty->buf.tail; | 13 | struct tty_buffer *tb = tty->buf.tail; |
20 | if (tb && tb->active && tb->used < tb->size) { | 14 | if (tb && tb->active && tb->used < tb->size) { |
@@ -25,7 +19,7 @@ _INLINE_ int tty_insert_flip_char(struct tty_struct *tty, | |||
25 | return tty_insert_flip_string_flags(tty, &ch, &flag, 1); | 19 | return tty_insert_flip_string_flags(tty, &ch, &flag, 1); |
26 | } | 20 | } |
27 | 21 | ||
28 | _INLINE_ void tty_schedule_flip(struct tty_struct *tty) | 22 | static inline void tty_schedule_flip(struct tty_struct *tty) |
29 | { | 23 | { |
30 | unsigned long flags; | 24 | unsigned long flags; |
31 | spin_lock_irqsave(&tty->buf.lock, flags); | 25 | spin_lock_irqsave(&tty->buf.lock, flags); |
diff --git a/include/linux/types.h b/include/linux/types.h index 54ae2d59e71b..1046c7ad86d9 100644 --- a/include/linux/types.h +++ b/include/linux/types.h | |||
@@ -137,6 +137,10 @@ typedef __s64 int64_t; | |||
137 | typedef unsigned long sector_t; | 137 | typedef unsigned long sector_t; |
138 | #endif | 138 | #endif |
139 | 139 | ||
140 | #ifndef HAVE_BLKCNT_T | ||
141 | typedef unsigned long blkcnt_t; | ||
142 | #endif | ||
143 | |||
140 | /* | 144 | /* |
141 | * The type of an index into the pagecache. Use a #define so asm/types.h | 145 | * The type of an index into the pagecache. Use a #define so asm/types.h |
142 | * can override it. | 146 | * can override it. |
diff --git a/include/linux/udf_fs_i.h b/include/linux/udf_fs_i.h index 1e7508420fcf..ffaf05679ffb 100644 --- a/include/linux/udf_fs_i.h +++ b/include/linux/udf_fs_i.h | |||
@@ -15,27 +15,6 @@ | |||
15 | 15 | ||
16 | #ifdef __KERNEL__ | 16 | #ifdef __KERNEL__ |
17 | 17 | ||
18 | #ifndef _ECMA_167_H | ||
19 | typedef struct | ||
20 | { | ||
21 | __u32 logicalBlockNum; | ||
22 | __u16 partitionReferenceNum; | ||
23 | } __attribute__ ((packed)) lb_addr; | ||
24 | |||
25 | typedef struct | ||
26 | { | ||
27 | __u32 extLength; | ||
28 | __u32 extPosition; | ||
29 | } __attribute__ ((packed)) short_ad; | ||
30 | |||
31 | typedef struct | ||
32 | { | ||
33 | __u32 extLength; | ||
34 | lb_addr extLocation; | ||
35 | __u8 impUse[6]; | ||
36 | } __attribute__ ((packed)) long_ad; | ||
37 | #endif | ||
38 | |||
39 | struct udf_inode_info | 18 | struct udf_inode_info |
40 | { | 19 | { |
41 | struct timespec i_crtime; | 20 | struct timespec i_crtime; |
diff --git a/include/linux/udf_fs_sb.h b/include/linux/udf_fs_sb.h index b15ff2e99c91..80ae9ef940dc 100644 --- a/include/linux/udf_fs_sb.h +++ b/include/linux/udf_fs_sb.h | |||
@@ -13,7 +13,7 @@ | |||
13 | #ifndef _UDF_FS_SB_H | 13 | #ifndef _UDF_FS_SB_H |
14 | #define _UDF_FS_SB_H 1 | 14 | #define _UDF_FS_SB_H 1 |
15 | 15 | ||
16 | #include <asm/semaphore.h> | 16 | #include <linux/mutex.h> |
17 | 17 | ||
18 | #pragma pack(1) | 18 | #pragma pack(1) |
19 | 19 | ||
@@ -111,7 +111,7 @@ struct udf_sb_info | |||
111 | /* VAT inode */ | 111 | /* VAT inode */ |
112 | struct inode *s_vat; | 112 | struct inode *s_vat; |
113 | 113 | ||
114 | struct semaphore s_alloc_sem; | 114 | struct mutex s_alloc_mutex; |
115 | }; | 115 | }; |
116 | 116 | ||
117 | #endif /* _UDF_FS_SB_H */ | 117 | #endif /* _UDF_FS_SB_H */ |
diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h index b0ffe4356e5a..843aeaaa79d4 100644 --- a/include/linux/ufs_fs.h +++ b/include/linux/ufs_fs.h | |||
@@ -895,7 +895,7 @@ extern void ufs_set_link(struct inode *, struct ufs_dir_entry *, struct buffer_h | |||
895 | 895 | ||
896 | /* file.c */ | 896 | /* file.c */ |
897 | extern struct inode_operations ufs_file_inode_operations; | 897 | extern struct inode_operations ufs_file_inode_operations; |
898 | extern struct file_operations ufs_file_operations; | 898 | extern const struct file_operations ufs_file_operations; |
899 | 899 | ||
900 | extern struct address_space_operations ufs_aops; | 900 | extern struct address_space_operations ufs_aops; |
901 | 901 | ||
@@ -915,7 +915,7 @@ extern struct buffer_head * ufs_bread (struct inode *, unsigned, int, int *); | |||
915 | extern int ufs_getfrag_block (struct inode *inode, sector_t fragment, struct buffer_head *bh_result, int create); | 915 | extern int ufs_getfrag_block (struct inode *inode, sector_t fragment, struct buffer_head *bh_result, int create); |
916 | 916 | ||
917 | /* namei.c */ | 917 | /* namei.c */ |
918 | extern struct file_operations ufs_dir_operations; | 918 | extern const struct file_operations ufs_dir_operations; |
919 | 919 | ||
920 | /* super.c */ | 920 | /* super.c */ |
921 | extern void ufs_warning (struct super_block *, const char *, const char *, ...) __attribute__ ((format (printf, 3, 4))); | 921 | extern void ufs_warning (struct super_block *, const char *, const char *, ...) __attribute__ ((format (printf, 3, 4))); |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 130d125fda12..e34e5e3dce52 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -615,7 +615,7 @@ extern struct bus_type usb_bus_type; | |||
615 | */ | 615 | */ |
616 | struct usb_class_driver { | 616 | struct usb_class_driver { |
617 | char *name; | 617 | char *name; |
618 | struct file_operations *fops; | 618 | const struct file_operations *fops; |
619 | int minor_base; | 619 | int minor_base; |
620 | }; | 620 | }; |
621 | 621 | ||
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 724cfbf54b8a..af2d6155d3fe 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -75,7 +75,7 @@ struct video_device | |||
75 | int minor; | 75 | int minor; |
76 | 76 | ||
77 | /* device ops + callbacks */ | 77 | /* device ops + callbacks */ |
78 | struct file_operations *fops; | 78 | const struct file_operations *fops; |
79 | void (*release)(struct video_device *vfd); | 79 | void (*release)(struct video_device *vfd); |
80 | 80 | ||
81 | 81 | ||
@@ -883,6 +883,7 @@ struct v4l2_modulator | |||
883 | #define V4L2_TUNER_MODE_LANG2 0x0002 | 883 | #define V4L2_TUNER_MODE_LANG2 0x0002 |
884 | #define V4L2_TUNER_MODE_SAP 0x0002 | 884 | #define V4L2_TUNER_MODE_SAP 0x0002 |
885 | #define V4L2_TUNER_MODE_LANG1 0x0003 | 885 | #define V4L2_TUNER_MODE_LANG1 0x0003 |
886 | #define V4L2_TUNER_MODE_LANG1_LANG2 0x0004 | ||
886 | 887 | ||
887 | struct v4l2_frequency | 888 | struct v4l2_frequency |
888 | { | 889 | { |
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h index fab5aed8ca31..530ae3f4248c 100644 --- a/include/linux/vt_kern.h +++ b/include/linux/vt_kern.h | |||
@@ -73,6 +73,11 @@ int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc); | |||
73 | int vt_waitactive(int vt); | 73 | int vt_waitactive(int vt); |
74 | void change_console(struct vc_data *new_vc); | 74 | void change_console(struct vc_data *new_vc); |
75 | void reset_vc(struct vc_data *vc); | 75 | void reset_vc(struct vc_data *vc); |
76 | #ifdef CONFIG_VT | ||
77 | int is_console_suspend_safe(void); | ||
78 | #else | ||
79 | static inline int is_console_suspend_safe(void) { return 1; } | ||
80 | #endif | ||
76 | 81 | ||
77 | /* | 82 | /* |
78 | * vc_screen.c shares this temporary buffer with the console write code so that | 83 | * vc_screen.c shares this temporary buffer with the console write code so that |
diff --git a/include/linux/wireless.h b/include/linux/wireless.h index a555a0f7a7b4..13588564b42b 100644 --- a/include/linux/wireless.h +++ b/include/linux/wireless.h | |||
@@ -1,10 +1,10 @@ | |||
1 | /* | 1 | /* |
2 | * This file define a set of standard wireless extensions | 2 | * This file define a set of standard wireless extensions |
3 | * | 3 | * |
4 | * Version : 19 18.3.05 | 4 | * Version : 20 17.2.06 |
5 | * | 5 | * |
6 | * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com> | 6 | * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com> |
7 | * Copyright (c) 1997-2005 Jean Tourrilhes, All Rights Reserved. | 7 | * Copyright (c) 1997-2006 Jean Tourrilhes, All Rights Reserved. |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #ifndef _LINUX_WIRELESS_H | 10 | #ifndef _LINUX_WIRELESS_H |
@@ -80,7 +80,7 @@ | |||
80 | * (there is some stuff that will be added in the future...) | 80 | * (there is some stuff that will be added in the future...) |
81 | * I just plan to increment with each new version. | 81 | * I just plan to increment with each new version. |
82 | */ | 82 | */ |
83 | #define WIRELESS_EXT 19 | 83 | #define WIRELESS_EXT 20 |
84 | 84 | ||
85 | /* | 85 | /* |
86 | * Changes : | 86 | * Changes : |
@@ -204,6 +204,10 @@ | |||
204 | * - Add IW_QUAL_ALL_UPDATED and IW_QUAL_ALL_INVALID macros | 204 | * - Add IW_QUAL_ALL_UPDATED and IW_QUAL_ALL_INVALID macros |
205 | * - Add explicit flag to tell stats are in dBm : IW_QUAL_DBM | 205 | * - Add explicit flag to tell stats are in dBm : IW_QUAL_DBM |
206 | * - Add IW_IOCTL_IDX() and IW_EVENT_IDX() macros | 206 | * - Add IW_IOCTL_IDX() and IW_EVENT_IDX() macros |
207 | * | ||
208 | * V19 to V20 | ||
209 | * ---------- | ||
210 | * - RtNetlink requests support (SET/GET) | ||
207 | */ | 211 | */ |
208 | 212 | ||
209 | /**************************** CONSTANTS ****************************/ | 213 | /**************************** CONSTANTS ****************************/ |
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 86b111300231..957c21c16d62 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
@@ -20,6 +20,10 @@ struct work_struct { | |||
20 | struct timer_list timer; | 20 | struct timer_list timer; |
21 | }; | 21 | }; |
22 | 22 | ||
23 | struct execute_work { | ||
24 | struct work_struct work; | ||
25 | }; | ||
26 | |||
23 | #define __WORK_INITIALIZER(n, f, d) { \ | 27 | #define __WORK_INITIALIZER(n, f, d) { \ |
24 | .entry = { &(n).entry, &(n).entry }, \ | 28 | .entry = { &(n).entry, &(n).entry }, \ |
25 | .func = (f), \ | 29 | .func = (f), \ |
@@ -74,6 +78,8 @@ extern void init_workqueues(void); | |||
74 | void cancel_rearming_delayed_work(struct work_struct *work); | 78 | void cancel_rearming_delayed_work(struct work_struct *work); |
75 | void cancel_rearming_delayed_workqueue(struct workqueue_struct *, | 79 | void cancel_rearming_delayed_workqueue(struct workqueue_struct *, |
76 | struct work_struct *); | 80 | struct work_struct *); |
81 | int execute_in_process_context(void (*fn)(void *), void *, | ||
82 | struct execute_work *); | ||
77 | 83 | ||
78 | /* | 84 | /* |
79 | * Kill off a pending schedule_delayed_work(). Note that the work callback | 85 | * Kill off a pending schedule_delayed_work(). Note that the work callback |
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index beaef5c7a0ea..56f92fcbe94a 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
@@ -88,8 +88,8 @@ void throttle_vm_writeout(void); | |||
88 | /* These are exported to sysctl. */ | 88 | /* These are exported to sysctl. */ |
89 | extern int dirty_background_ratio; | 89 | extern int dirty_background_ratio; |
90 | extern int vm_dirty_ratio; | 90 | extern int vm_dirty_ratio; |
91 | extern int dirty_writeback_centisecs; | 91 | extern int dirty_writeback_interval; |
92 | extern int dirty_expire_centisecs; | 92 | extern int dirty_expire_interval; |
93 | extern int block_dump; | 93 | extern int block_dump; |
94 | extern int laptop_mode; | 94 | extern int laptop_mode; |
95 | 95 | ||
@@ -99,7 +99,15 @@ int dirty_writeback_centisecs_handler(struct ctl_table *, int, struct file *, | |||
99 | void __user *, size_t *, loff_t *); | 99 | void __user *, size_t *, loff_t *); |
100 | 100 | ||
101 | void page_writeback_init(void); | 101 | void page_writeback_init(void); |
102 | void balance_dirty_pages_ratelimited(struct address_space *mapping); | 102 | void balance_dirty_pages_ratelimited_nr(struct address_space *mapping, |
103 | unsigned long nr_pages_dirtied); | ||
104 | |||
105 | static inline void | ||
106 | balance_dirty_pages_ratelimited(struct address_space *mapping) | ||
107 | { | ||
108 | balance_dirty_pages_ratelimited_nr(mapping, 1); | ||
109 | } | ||
110 | |||
103 | int pdflush_operation(void (*fn)(unsigned long), unsigned long arg0); | 111 | int pdflush_operation(void (*fn)(unsigned long), unsigned long arg0); |
104 | int do_writepages(struct address_space *mapping, struct writeback_control *wbc); | 112 | int do_writepages(struct address_space *mapping, struct writeback_control *wbc); |
105 | int sync_page_range(struct inode *inode, struct address_space *mapping, | 113 | int sync_page_range(struct inode *inode, struct address_space *mapping, |
diff --git a/include/linux/x1205.h b/include/linux/x1205.h deleted file mode 100644 index 64fd3af894a5..000000000000 --- a/include/linux/x1205.h +++ /dev/null | |||
@@ -1,31 +0,0 @@ | |||
1 | /* | ||
2 | * x1205.h - defines for drivers/i2c/chips/x1205.c | ||
3 | * Copyright 2004 Karen Spearel | ||
4 | * Copyright 2005 Alessandro Zummo | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | */ | ||
11 | |||
12 | #ifndef __LINUX_X1205_H__ | ||
13 | #define __LINUX_X1205_H__ | ||
14 | |||
15 | /* commands */ | ||
16 | |||
17 | #define X1205_CMD_GETDATETIME 0 | ||
18 | #define X1205_CMD_SETTIME 1 | ||
19 | #define X1205_CMD_SETDATETIME 2 | ||
20 | #define X1205_CMD_GETALARM 3 | ||
21 | #define X1205_CMD_SETALARM 4 | ||
22 | #define X1205_CMD_GETDTRIM 5 | ||
23 | #define X1205_CMD_SETDTRIM 6 | ||
24 | #define X1205_CMD_GETATRIM 7 | ||
25 | #define X1205_CMD_SETATRIM 8 | ||
26 | |||
27 | extern int x1205_do_command(unsigned int cmd, void *arg); | ||
28 | extern int x1205_direct_attach(int adapter_id, | ||
29 | struct i2c_client_address_data *address_data); | ||
30 | |||
31 | #endif /* __LINUX_X1205_H__ */ | ||
diff --git a/include/linux/x25.h b/include/linux/x25.h index 16d44931afa0..d035e4e87d07 100644 --- a/include/linux/x25.h +++ b/include/linux/x25.h | |||
@@ -11,6 +11,8 @@ | |||
11 | #ifndef X25_KERNEL_H | 11 | #ifndef X25_KERNEL_H |
12 | #define X25_KERNEL_H | 12 | #define X25_KERNEL_H |
13 | 13 | ||
14 | #include <linux/types.h> | ||
15 | |||
14 | #define SIOCX25GSUBSCRIP (SIOCPROTOPRIVATE + 0) | 16 | #define SIOCX25GSUBSCRIP (SIOCPROTOPRIVATE + 0) |
15 | #define SIOCX25SSUBSCRIP (SIOCPROTOPRIVATE + 1) | 17 | #define SIOCX25SSUBSCRIP (SIOCPROTOPRIVATE + 1) |
16 | #define SIOCX25GFACILITIES (SIOCPROTOPRIVATE + 2) | 18 | #define SIOCX25GFACILITIES (SIOCPROTOPRIVATE + 2) |
@@ -21,6 +23,8 @@ | |||
21 | #define SIOCX25SCUDMATCHLEN (SIOCPROTOPRIVATE + 7) | 23 | #define SIOCX25SCUDMATCHLEN (SIOCPROTOPRIVATE + 7) |
22 | #define SIOCX25CALLACCPTAPPRV (SIOCPROTOPRIVATE + 8) | 24 | #define SIOCX25CALLACCPTAPPRV (SIOCPROTOPRIVATE + 8) |
23 | #define SIOCX25SENDCALLACCPT (SIOCPROTOPRIVATE + 9) | 25 | #define SIOCX25SENDCALLACCPT (SIOCPROTOPRIVATE + 9) |
26 | #define SIOCX25GDTEFACILITIES (SIOCPROTOPRIVATE + 10) | ||
27 | #define SIOCX25SDTEFACILITIES (SIOCPROTOPRIVATE + 11) | ||
24 | 28 | ||
25 | /* | 29 | /* |
26 | * Values for {get,set}sockopt. | 30 | * Values for {get,set}sockopt. |
@@ -77,6 +81,8 @@ struct x25_subscrip_struct { | |||
77 | #define X25_MASK_PACKET_SIZE 0x04 | 81 | #define X25_MASK_PACKET_SIZE 0x04 |
78 | #define X25_MASK_WINDOW_SIZE 0x08 | 82 | #define X25_MASK_WINDOW_SIZE 0x08 |
79 | 83 | ||
84 | #define X25_MASK_CALLING_AE 0x10 | ||
85 | #define X25_MASK_CALLED_AE 0x20 | ||
80 | 86 | ||
81 | 87 | ||
82 | /* | 88 | /* |
@@ -99,6 +105,26 @@ struct x25_facilities { | |||
99 | }; | 105 | }; |
100 | 106 | ||
101 | /* | 107 | /* |
108 | * ITU DTE facilities | ||
109 | * Only the called and calling address | ||
110 | * extension are currently implemented. | ||
111 | * The rest are in place to avoid the struct | ||
112 | * changing size if someone needs them later | ||
113 | */ | ||
114 | |||
115 | struct x25_dte_facilities { | ||
116 | __u16 delay_cumul; | ||
117 | __u16 delay_target; | ||
118 | __u16 delay_max; | ||
119 | __u8 min_throughput; | ||
120 | __u8 expedited; | ||
121 | __u8 calling_len; | ||
122 | __u8 called_len; | ||
123 | __u8 calling_ae[20]; | ||
124 | __u8 called_ae[20]; | ||
125 | }; | ||
126 | |||
127 | /* | ||
102 | * Call User Data structure. | 128 | * Call User Data structure. |
103 | */ | 129 | */ |
104 | struct x25_calluserdata { | 130 | struct x25_calluserdata { |
diff --git a/include/linux/zorro.h b/include/linux/zorro.h index ba5b72768bbe..2f135cf6eef1 100644 --- a/include/linux/zorro.h +++ b/include/linux/zorro.h | |||
@@ -271,39 +271,6 @@ static inline void zorro_set_drvdata (struct zorro_dev *z, void *data) | |||
271 | } | 271 | } |
272 | 272 | ||
273 | 273 | ||
274 | /* | ||
275 | * A helper function which helps ensure correct zorro_driver | ||
276 | * setup and cleanup for commonly-encountered hotplug/modular cases | ||
277 | * | ||
278 | * This MUST stay in a header, as it checks for -DMODULE | ||
279 | */ | ||
280 | static inline int zorro_module_init(struct zorro_driver *drv) | ||
281 | { | ||
282 | int rc = zorro_register_driver(drv); | ||
283 | |||
284 | if (rc > 0) | ||
285 | return 0; | ||
286 | |||
287 | /* iff CONFIG_HOTPLUG and built into kernel, we should | ||
288 | * leave the driver around for future hotplug events. | ||
289 | * For the module case, a hotplug daemon of some sort | ||
290 | * should load a module in response to an insert event. */ | ||
291 | #if defined(CONFIG_HOTPLUG) && !defined(MODULE) | ||
292 | if (rc == 0) | ||
293 | return 0; | ||
294 | #else | ||
295 | if (rc == 0) | ||
296 | rc = -ENODEV; | ||
297 | #endif | ||
298 | |||
299 | /* if we get here, we need to clean up Zorro driver instance | ||
300 | * and return some sort of error */ | ||
301 | zorro_unregister_driver(drv); | ||
302 | |||
303 | return rc; | ||
304 | } | ||
305 | |||
306 | |||
307 | /* | 274 | /* |
308 | * Bitmask indicating portions of available Zorro II RAM that are unused | 275 | * Bitmask indicating portions of available Zorro II RAM that are unused |
309 | * by the system. Every bit represents a 64K chunk, for a maximum of 8MB | 276 | * by the system. Every bit represents a 64K chunk, for a maximum of 8MB |