diff options
Diffstat (limited to 'include/linux')
86 files changed, 1330 insertions, 605 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 9aa9bcadf869..2547daf2aef2 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -210,6 +210,7 @@ unifdef-y += ethtool.h | |||
210 | unifdef-y += eventpoll.h | 210 | unifdef-y += eventpoll.h |
211 | unifdef-y += signalfd.h | 211 | unifdef-y += signalfd.h |
212 | unifdef-y += ext2_fs.h | 212 | unifdef-y += ext2_fs.h |
213 | unifdef-y += fanotify.h | ||
213 | unifdef-y += fb.h | 214 | unifdef-y += fb.h |
214 | unifdef-y += fcntl.h | 215 | unifdef-y += fcntl.h |
215 | unifdef-y += filter.h | 216 | unifdef-y += filter.h |
diff --git a/include/linux/auto_fs.h b/include/linux/auto_fs.h index 7b09c8348fd3..da64e15004b6 100644 --- a/include/linux/auto_fs.h +++ b/include/linux/auto_fs.h | |||
@@ -79,6 +79,7 @@ struct autofs_packet_expire { | |||
79 | #define AUTOFS_IOC_FAIL _IO(0x93,0x61) | 79 | #define AUTOFS_IOC_FAIL _IO(0x93,0x61) |
80 | #define AUTOFS_IOC_CATATONIC _IO(0x93,0x62) | 80 | #define AUTOFS_IOC_CATATONIC _IO(0x93,0x62) |
81 | #define AUTOFS_IOC_PROTOVER _IOR(0x93,0x63,int) | 81 | #define AUTOFS_IOC_PROTOVER _IOR(0x93,0x63,int) |
82 | #define AUTOFS_IOC_SETTIMEOUT32 _IOWR(0x93,0x64,compat_ulong_t) | ||
82 | #define AUTOFS_IOC_SETTIMEOUT _IOWR(0x93,0x64,unsigned long) | 83 | #define AUTOFS_IOC_SETTIMEOUT _IOWR(0x93,0x64,unsigned long) |
83 | #define AUTOFS_IOC_EXPIRE _IOR(0x93,0x65,struct autofs_packet_expire) | 84 | #define AUTOFS_IOC_EXPIRE _IOR(0x93,0x65,struct autofs_packet_expire) |
84 | 85 | ||
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 1b9ba193b789..43e649a72529 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h | |||
@@ -203,12 +203,10 @@ int block_write_full_page_endio(struct page *page, get_block_t *get_block, | |||
203 | int block_read_full_page(struct page*, get_block_t*); | 203 | int block_read_full_page(struct page*, get_block_t*); |
204 | int block_is_partially_uptodate(struct page *page, read_descriptor_t *desc, | 204 | int block_is_partially_uptodate(struct page *page, read_descriptor_t *desc, |
205 | unsigned long from); | 205 | unsigned long from); |
206 | int block_write_begin_newtrunc(struct file *, struct address_space *, | 206 | int block_write_begin(struct address_space *mapping, loff_t pos, unsigned len, |
207 | loff_t, unsigned, unsigned, | 207 | unsigned flags, struct page **pagep, get_block_t *get_block); |
208 | struct page **, void **, get_block_t*); | 208 | int __block_write_begin(struct page *page, loff_t pos, unsigned len, |
209 | int block_write_begin(struct file *, struct address_space *, | 209 | get_block_t *get_block); |
210 | loff_t, unsigned, unsigned, | ||
211 | struct page **, void **, get_block_t*); | ||
212 | int block_write_end(struct file *, struct address_space *, | 210 | int block_write_end(struct file *, struct address_space *, |
213 | loff_t, unsigned, unsigned, | 211 | loff_t, unsigned, unsigned, |
214 | struct page *, void *); | 212 | struct page *, void *); |
@@ -217,9 +215,6 @@ int generic_write_end(struct file *, struct address_space *, | |||
217 | struct page *, void *); | 215 | struct page *, void *); |
218 | void page_zero_new_buffers(struct page *page, unsigned from, unsigned to); | 216 | void page_zero_new_buffers(struct page *page, unsigned from, unsigned to); |
219 | int block_prepare_write(struct page*, unsigned, unsigned, get_block_t*); | 217 | int block_prepare_write(struct page*, unsigned, unsigned, get_block_t*); |
220 | int cont_write_begin_newtrunc(struct file *, struct address_space *, loff_t, | ||
221 | unsigned, unsigned, struct page **, void **, | ||
222 | get_block_t *, loff_t *); | ||
223 | int cont_write_begin(struct file *, struct address_space *, loff_t, | 218 | int cont_write_begin(struct file *, struct address_space *, loff_t, |
224 | unsigned, unsigned, struct page **, void **, | 219 | unsigned, unsigned, struct page **, void **, |
225 | get_block_t *, loff_t *); | 220 | get_block_t *, loff_t *); |
@@ -230,12 +225,7 @@ int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, | |||
230 | void block_sync_page(struct page *); | 225 | void block_sync_page(struct page *); |
231 | sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *); | 226 | sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *); |
232 | int block_truncate_page(struct address_space *, loff_t, get_block_t *); | 227 | int block_truncate_page(struct address_space *, loff_t, get_block_t *); |
233 | int file_fsync(struct file *, int); | 228 | int nobh_write_begin(struct address_space *, loff_t, unsigned, unsigned, |
234 | int nobh_write_begin_newtrunc(struct file *, struct address_space *, | ||
235 | loff_t, unsigned, unsigned, | ||
236 | struct page **, void **, get_block_t*); | ||
237 | int nobh_write_begin(struct file *, struct address_space *, | ||
238 | loff_t, unsigned, unsigned, | ||
239 | struct page **, void **, get_block_t*); | 229 | struct page **, void **, get_block_t*); |
240 | int nobh_write_end(struct file *, struct address_space *, | 230 | int nobh_write_end(struct file *, struct address_space *, |
241 | loff_t, unsigned, unsigned, | 231 | loff_t, unsigned, unsigned, |
@@ -314,15 +304,10 @@ map_bh(struct buffer_head *bh, struct super_block *sb, sector_t block) | |||
314 | bh->b_size = sb->s_blocksize; | 304 | bh->b_size = sb->s_blocksize; |
315 | } | 305 | } |
316 | 306 | ||
317 | /* | ||
318 | * Calling wait_on_buffer() for a zero-ref buffer is illegal, so we call into | ||
319 | * __wait_on_buffer() just to trip a debug check. Because debug code in inline | ||
320 | * functions is bloaty. | ||
321 | */ | ||
322 | static inline void wait_on_buffer(struct buffer_head *bh) | 307 | static inline void wait_on_buffer(struct buffer_head *bh) |
323 | { | 308 | { |
324 | might_sleep(); | 309 | might_sleep(); |
325 | if (buffer_locked(bh) || atomic_read(&bh->b_count) == 0) | 310 | if (buffer_locked(bh)) |
326 | __wait_on_buffer(bh); | 311 | __wait_on_buffer(bh); |
327 | } | 312 | } |
328 | 313 | ||
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index 0da5b187f124..16508bcddacc 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h | |||
@@ -35,8 +35,7 @@ | |||
35 | (typeof(ptr)) (__ptr + (off)); }) | 35 | (typeof(ptr)) (__ptr + (off)); }) |
36 | 36 | ||
37 | /* &a[0] degrades to a pointer: a different type from an array */ | 37 | /* &a[0] degrades to a pointer: a different type from an array */ |
38 | #define __must_be_array(a) \ | 38 | #define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0])) |
39 | BUILD_BUG_ON_ZERO(__builtin_types_compatible_p(typeof(a), typeof(&a[0]))) | ||
40 | 39 | ||
41 | /* | 40 | /* |
42 | * Force always-inline if the user requests it so via the .config, | 41 | * Force always-inline if the user requests it so via the .config, |
diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h index 38fe59dc89ae..7f0c32908568 100644 --- a/include/linux/console_struct.h +++ b/include/linux/console_struct.h | |||
@@ -21,6 +21,8 @@ struct vt_struct; | |||
21 | #define NPAR 16 | 21 | #define NPAR 16 |
22 | 22 | ||
23 | struct vc_data { | 23 | struct vc_data { |
24 | struct tty_port port; /* Upper level data */ | ||
25 | |||
24 | unsigned short vc_num; /* Console number */ | 26 | unsigned short vc_num; /* Console number */ |
25 | unsigned int vc_cols; /* [#] Console size */ | 27 | unsigned int vc_cols; /* [#] Console size */ |
26 | unsigned int vc_rows; | 28 | unsigned int vc_rows; |
@@ -56,7 +58,6 @@ struct vc_data { | |||
56 | /* VT terminal data */ | 58 | /* VT terminal data */ |
57 | unsigned int vc_state; /* Escape sequence parser state */ | 59 | unsigned int vc_state; /* Escape sequence parser state */ |
58 | unsigned int vc_npar,vc_par[NPAR]; /* Parameters of current escape sequence */ | 60 | unsigned int vc_npar,vc_par[NPAR]; /* Parameters of current escape sequence */ |
59 | struct tty_struct *vc_tty; /* TTY we are attached to */ | ||
60 | /* data for manual vt switching */ | 61 | /* data for manual vt switching */ |
61 | struct vt_mode vt_mode; | 62 | struct vt_mode vt_mode; |
62 | struct pid *vt_pid; | 63 | struct pid *vt_pid; |
@@ -105,6 +106,7 @@ struct vc_data { | |||
105 | struct vc_data **vc_display_fg; /* [!] Ptr to var holding fg console for this display */ | 106 | struct vc_data **vc_display_fg; /* [!] Ptr to var holding fg console for this display */ |
106 | unsigned long vc_uni_pagedir; | 107 | unsigned long vc_uni_pagedir; |
107 | unsigned long *vc_uni_pagedir_loc; /* [!] Location of uni_pagedir variable for this console */ | 108 | unsigned long *vc_uni_pagedir_loc; /* [!] Location of uni_pagedir variable for this console */ |
109 | bool vc_panic_force_write; /* when oops/panic this VC can accept forced output/blanking */ | ||
108 | /* additional information is in vt_kern.h */ | 110 | /* additional information is in vt_kern.h */ |
109 | }; | 111 | }; |
110 | 112 | ||
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index 55215cce5005..36ca9721a0c2 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h | |||
@@ -52,6 +52,7 @@ struct cpuidle_state { | |||
52 | #define CPUIDLE_FLAG_SHALLOW (0x20) /* low latency, minimal savings */ | 52 | #define CPUIDLE_FLAG_SHALLOW (0x20) /* low latency, minimal savings */ |
53 | #define CPUIDLE_FLAG_BALANCED (0x40) /* medium latency, moderate savings */ | 53 | #define CPUIDLE_FLAG_BALANCED (0x40) /* medium latency, moderate savings */ |
54 | #define CPUIDLE_FLAG_DEEP (0x80) /* high latency, large savings */ | 54 | #define CPUIDLE_FLAG_DEEP (0x80) /* high latency, large savings */ |
55 | #define CPUIDLE_FLAG_IGNORE (0x100) /* ignore during this idle period */ | ||
55 | 56 | ||
56 | #define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000) | 57 | #define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000) |
57 | 58 | ||
@@ -84,6 +85,7 @@ struct cpuidle_state_kobj { | |||
84 | struct cpuidle_device { | 85 | struct cpuidle_device { |
85 | unsigned int registered:1; | 86 | unsigned int registered:1; |
86 | unsigned int enabled:1; | 87 | unsigned int enabled:1; |
88 | unsigned int power_specified:1; | ||
87 | unsigned int cpu; | 89 | unsigned int cpu; |
88 | 90 | ||
89 | int last_residency; | 91 | int last_residency; |
@@ -97,6 +99,8 @@ struct cpuidle_device { | |||
97 | struct completion kobj_unregister; | 99 | struct completion kobj_unregister; |
98 | void *governor_data; | 100 | void *governor_data; |
99 | struct cpuidle_state *safe_state; | 101 | struct cpuidle_state *safe_state; |
102 | |||
103 | int (*prepare) (struct cpuidle_device *dev); | ||
100 | }; | 104 | }; |
101 | 105 | ||
102 | DECLARE_PER_CPU(struct cpuidle_device *, cpuidle_devices); | 106 | DECLARE_PER_CPU(struct cpuidle_device *, cpuidle_devices); |
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index eebb617c17d8..d23be0386e2d 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h | |||
@@ -315,6 +315,7 @@ extern char *dynamic_dname(struct dentry *, char *, int, const char *, ...); | |||
315 | 315 | ||
316 | extern char *__d_path(const struct path *path, struct path *root, char *, int); | 316 | extern char *__d_path(const struct path *path, struct path *root, char *, int); |
317 | extern char *d_path(const struct path *, char *, int); | 317 | extern char *d_path(const struct path *, char *, int); |
318 | extern char *__dentry_path(struct dentry *, char *, int); | ||
318 | extern char *dentry_path(struct dentry *, char *, int); | 319 | extern char *dentry_path(struct dentry *, char *, int); |
319 | 320 | ||
320 | /* Allocation counts.. */ | 321 | /* Allocation counts.. */ |
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 5204f018931b..c61d4ca27bcc 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
@@ -114,11 +114,17 @@ enum dma_ctrl_flags { | |||
114 | * @DMA_TERMINATE_ALL: terminate all ongoing transfers | 114 | * @DMA_TERMINATE_ALL: terminate all ongoing transfers |
115 | * @DMA_PAUSE: pause ongoing transfers | 115 | * @DMA_PAUSE: pause ongoing transfers |
116 | * @DMA_RESUME: resume paused transfer | 116 | * @DMA_RESUME: resume paused transfer |
117 | * @DMA_SLAVE_CONFIG: this command is only implemented by DMA controllers | ||
118 | * that need to runtime reconfigure the slave channels (as opposed to passing | ||
119 | * configuration data in statically from the platform). An additional | ||
120 | * argument of struct dma_slave_config must be passed in with this | ||
121 | * command. | ||
117 | */ | 122 | */ |
118 | enum dma_ctrl_cmd { | 123 | enum dma_ctrl_cmd { |
119 | DMA_TERMINATE_ALL, | 124 | DMA_TERMINATE_ALL, |
120 | DMA_PAUSE, | 125 | DMA_PAUSE, |
121 | DMA_RESUME, | 126 | DMA_RESUME, |
127 | DMA_SLAVE_CONFIG, | ||
122 | }; | 128 | }; |
123 | 129 | ||
124 | /** | 130 | /** |
@@ -199,6 +205,71 @@ struct dma_chan_dev { | |||
199 | atomic_t *idr_ref; | 205 | atomic_t *idr_ref; |
200 | }; | 206 | }; |
201 | 207 | ||
208 | /** | ||
209 | * enum dma_slave_buswidth - defines bus with of the DMA slave | ||
210 | * device, source or target buses | ||
211 | */ | ||
212 | enum dma_slave_buswidth { | ||
213 | DMA_SLAVE_BUSWIDTH_UNDEFINED = 0, | ||
214 | DMA_SLAVE_BUSWIDTH_1_BYTE = 1, | ||
215 | DMA_SLAVE_BUSWIDTH_2_BYTES = 2, | ||
216 | DMA_SLAVE_BUSWIDTH_4_BYTES = 4, | ||
217 | DMA_SLAVE_BUSWIDTH_8_BYTES = 8, | ||
218 | }; | ||
219 | |||
220 | /** | ||
221 | * struct dma_slave_config - dma slave channel runtime config | ||
222 | * @direction: whether the data shall go in or out on this slave | ||
223 | * channel, right now. DMA_TO_DEVICE and DMA_FROM_DEVICE are | ||
224 | * legal values, DMA_BIDIRECTIONAL is not acceptable since we | ||
225 | * need to differentiate source and target addresses. | ||
226 | * @src_addr: this is the physical address where DMA slave data | ||
227 | * should be read (RX), if the source is memory this argument is | ||
228 | * ignored. | ||
229 | * @dst_addr: this is the physical address where DMA slave data | ||
230 | * should be written (TX), if the source is memory this argument | ||
231 | * is ignored. | ||
232 | * @src_addr_width: this is the width in bytes of the source (RX) | ||
233 | * register where DMA data shall be read. If the source | ||
234 | * is memory this may be ignored depending on architecture. | ||
235 | * Legal values: 1, 2, 4, 8. | ||
236 | * @dst_addr_width: same as src_addr_width but for destination | ||
237 | * target (TX) mutatis mutandis. | ||
238 | * @src_maxburst: the maximum number of words (note: words, as in | ||
239 | * units of the src_addr_width member, not bytes) that can be sent | ||
240 | * in one burst to the device. Typically something like half the | ||
241 | * FIFO depth on I/O peripherals so you don't overflow it. This | ||
242 | * may or may not be applicable on memory sources. | ||
243 | * @dst_maxburst: same as src_maxburst but for destination target | ||
244 | * mutatis mutandis. | ||
245 | * | ||
246 | * This struct is passed in as configuration data to a DMA engine | ||
247 | * in order to set up a certain channel for DMA transport at runtime. | ||
248 | * The DMA device/engine has to provide support for an additional | ||
249 | * command in the channel config interface, DMA_SLAVE_CONFIG | ||
250 | * and this struct will then be passed in as an argument to the | ||
251 | * DMA engine device_control() function. | ||
252 | * | ||
253 | * The rationale for adding configuration information to this struct | ||
254 | * is as follows: if it is likely that most DMA slave controllers in | ||
255 | * the world will support the configuration option, then make it | ||
256 | * generic. If not: if it is fixed so that it be sent in static from | ||
257 | * the platform data, then prefer to do that. Else, if it is neither | ||
258 | * fixed at runtime, nor generic enough (such as bus mastership on | ||
259 | * some CPU family and whatnot) then create a custom slave config | ||
260 | * struct and pass that, then make this config a member of that | ||
261 | * struct, if applicable. | ||
262 | */ | ||
263 | struct dma_slave_config { | ||
264 | enum dma_data_direction direction; | ||
265 | dma_addr_t src_addr; | ||
266 | dma_addr_t dst_addr; | ||
267 | enum dma_slave_buswidth src_addr_width; | ||
268 | enum dma_slave_buswidth dst_addr_width; | ||
269 | u32 src_maxburst; | ||
270 | u32 dst_maxburst; | ||
271 | }; | ||
272 | |||
202 | static inline const char *dma_chan_name(struct dma_chan *chan) | 273 | static inline const char *dma_chan_name(struct dma_chan *chan) |
203 | { | 274 | { |
204 | return dev_name(&chan->dev->device); | 275 | return dev_name(&chan->dev->device); |
diff --git a/include/linux/dnotify.h b/include/linux/dnotify.h index ecc06286226d..3290555a52ee 100644 --- a/include/linux/dnotify.h +++ b/include/linux/dnotify.h | |||
@@ -28,6 +28,7 @@ struct dnotify_struct { | |||
28 | FS_CREATE | FS_DN_RENAME |\ | 28 | FS_CREATE | FS_DN_RENAME |\ |
29 | FS_MOVED_FROM | FS_MOVED_TO) | 29 | FS_MOVED_FROM | FS_MOVED_TO) |
30 | 30 | ||
31 | extern int dir_notify_enable; | ||
31 | extern void dnotify_flush(struct file *, fl_owner_t); | 32 | extern void dnotify_flush(struct file *, fl_owner_t); |
32 | extern int fcntl_dirnotify(int, struct file *, unsigned long); | 33 | extern int fcntl_dirnotify(int, struct file *, unsigned long); |
33 | 34 | ||
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index 3d3a9915dde2..6ce1bca01724 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h | |||
@@ -895,7 +895,7 @@ int ext3_get_blocks_handle(handle_t *handle, struct inode *inode, | |||
895 | extern struct inode *ext3_iget(struct super_block *, unsigned long); | 895 | extern struct inode *ext3_iget(struct super_block *, unsigned long); |
896 | extern int ext3_write_inode (struct inode *, struct writeback_control *); | 896 | extern int ext3_write_inode (struct inode *, struct writeback_control *); |
897 | extern int ext3_setattr (struct dentry *, struct iattr *); | 897 | extern int ext3_setattr (struct dentry *, struct iattr *); |
898 | extern void ext3_delete_inode (struct inode *); | 898 | extern void ext3_evict_inode (struct inode *); |
899 | extern int ext3_sync_inode (handle_t *, struct inode *); | 899 | extern int ext3_sync_inode (handle_t *, struct inode *); |
900 | extern void ext3_discard_reservation (struct inode *); | 900 | extern void ext3_discard_reservation (struct inode *); |
901 | extern void ext3_dirty_inode(struct inode *); | 901 | extern void ext3_dirty_inode(struct inode *); |
diff --git a/include/linux/fanotify.h b/include/linux/fanotify.h new file mode 100644 index 000000000000..f0949a57ca9d --- /dev/null +++ b/include/linux/fanotify.h | |||
@@ -0,0 +1,105 @@ | |||
1 | #ifndef _LINUX_FANOTIFY_H | ||
2 | #define _LINUX_FANOTIFY_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | /* the following events that user-space can register for */ | ||
7 | #define FAN_ACCESS 0x00000001 /* File was accessed */ | ||
8 | #define FAN_MODIFY 0x00000002 /* File was modified */ | ||
9 | #define FAN_CLOSE_WRITE 0x00000008 /* Unwrittable file closed */ | ||
10 | #define FAN_CLOSE_NOWRITE 0x00000010 /* Writtable file closed */ | ||
11 | #define FAN_OPEN 0x00000020 /* File was opened */ | ||
12 | |||
13 | #define FAN_EVENT_ON_CHILD 0x08000000 /* interested in child events */ | ||
14 | |||
15 | /* FIXME currently Q's have no limit.... */ | ||
16 | #define FAN_Q_OVERFLOW 0x00004000 /* Event queued overflowed */ | ||
17 | |||
18 | #define FAN_OPEN_PERM 0x00010000 /* File open in perm check */ | ||
19 | #define FAN_ACCESS_PERM 0x00020000 /* File accessed in perm check */ | ||
20 | |||
21 | /* helper events */ | ||
22 | #define FAN_CLOSE (FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE) /* close */ | ||
23 | |||
24 | /* flags used for fanotify_init() */ | ||
25 | #define FAN_CLOEXEC 0x00000001 | ||
26 | #define FAN_NONBLOCK 0x00000002 | ||
27 | |||
28 | #define FAN_ALL_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK) | ||
29 | |||
30 | /* flags used for fanotify_modify_mark() */ | ||
31 | #define FAN_MARK_ADD 0x00000001 | ||
32 | #define FAN_MARK_REMOVE 0x00000002 | ||
33 | #define FAN_MARK_DONT_FOLLOW 0x00000004 | ||
34 | #define FAN_MARK_ONLYDIR 0x00000008 | ||
35 | #define FAN_MARK_MOUNT 0x00000010 | ||
36 | #define FAN_MARK_IGNORED_MASK 0x00000020 | ||
37 | #define FAN_MARK_IGNORED_SURV_MODIFY 0x00000040 | ||
38 | #define FAN_MARK_FLUSH 0x00000080 | ||
39 | |||
40 | #define FAN_ALL_MARK_FLAGS (FAN_MARK_ADD |\ | ||
41 | FAN_MARK_REMOVE |\ | ||
42 | FAN_MARK_DONT_FOLLOW |\ | ||
43 | FAN_MARK_ONLYDIR |\ | ||
44 | FAN_MARK_MOUNT |\ | ||
45 | FAN_MARK_IGNORED_MASK |\ | ||
46 | FAN_MARK_IGNORED_SURV_MODIFY) | ||
47 | |||
48 | /* | ||
49 | * All of the events - we build the list by hand so that we can add flags in | ||
50 | * the future and not break backward compatibility. Apps will get only the | ||
51 | * events that they originally wanted. Be sure to add new events here! | ||
52 | */ | ||
53 | #define FAN_ALL_EVENTS (FAN_ACCESS |\ | ||
54 | FAN_MODIFY |\ | ||
55 | FAN_CLOSE |\ | ||
56 | FAN_OPEN) | ||
57 | |||
58 | /* | ||
59 | * All events which require a permission response from userspace | ||
60 | */ | ||
61 | #define FAN_ALL_PERM_EVENTS (FAN_OPEN_PERM |\ | ||
62 | FAN_ACCESS_PERM) | ||
63 | |||
64 | #define FAN_ALL_OUTGOING_EVENTS (FAN_ALL_EVENTS |\ | ||
65 | FAN_ALL_PERM_EVENTS |\ | ||
66 | FAN_Q_OVERFLOW) | ||
67 | |||
68 | #define FANOTIFY_METADATA_VERSION 1 | ||
69 | |||
70 | struct fanotify_event_metadata { | ||
71 | __u32 event_len; | ||
72 | __u32 vers; | ||
73 | __s32 fd; | ||
74 | __u64 mask; | ||
75 | __s64 pid; | ||
76 | } __attribute__ ((packed)); | ||
77 | |||
78 | struct fanotify_response { | ||
79 | __s32 fd; | ||
80 | __u32 response; | ||
81 | } __attribute__ ((packed)); | ||
82 | |||
83 | /* Legit userspace responses to a _PERM event */ | ||
84 | #define FAN_ALLOW 0x01 | ||
85 | #define FAN_DENY 0x02 | ||
86 | |||
87 | /* Helper functions to deal with fanotify_event_metadata buffers */ | ||
88 | #define FAN_EVENT_METADATA_LEN (sizeof(struct fanotify_event_metadata)) | ||
89 | |||
90 | #define FAN_EVENT_NEXT(meta, len) ((len) -= (meta)->event_len, \ | ||
91 | (struct fanotify_event_metadata*)(((char *)(meta)) + \ | ||
92 | (meta)->event_len)) | ||
93 | |||
94 | #define FAN_EVENT_OK(meta, len) ((long)(len) >= (long)FAN_EVENT_METADATA_LEN && \ | ||
95 | (long)(meta)->event_len >= (long)FAN_EVENT_METADATA_LEN && \ | ||
96 | (long)(meta)->event_len <= (long)(len)) | ||
97 | |||
98 | #ifdef __KERNEL__ | ||
99 | |||
100 | struct fanotify_wait { | ||
101 | struct fsnotify_event *event; | ||
102 | __s32 fd; | ||
103 | }; | ||
104 | #endif /* __KERNEL__ */ | ||
105 | #endif /* _LINUX_FANOTIFY_H */ | ||
diff --git a/include/linux/fb.h b/include/linux/fb.h index 0c5659c41b01..f0268deca658 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -825,6 +825,10 @@ struct fb_tile_ops { | |||
825 | */ | 825 | */ |
826 | #define FBINFO_BE_MATH 0x100000 | 826 | #define FBINFO_BE_MATH 0x100000 |
827 | 827 | ||
828 | /* report to the VT layer that this fb driver can accept forced console | ||
829 | output like oopses */ | ||
830 | #define FBINFO_CAN_FORCE_OUTPUT 0x200000 | ||
831 | |||
828 | struct fb_info { | 832 | struct fb_info { |
829 | int node; | 833 | int node; |
830 | int flags; | 834 | int flags; |
diff --git a/include/linux/flex_array.h b/include/linux/flex_array.h index 1d747f72298b..631b77f2ac70 100644 --- a/include/linux/flex_array.h +++ b/include/linux/flex_array.h | |||
@@ -70,4 +70,9 @@ int flex_array_clear(struct flex_array *fa, unsigned int element_nr); | |||
70 | void *flex_array_get(struct flex_array *fa, unsigned int element_nr); | 70 | void *flex_array_get(struct flex_array *fa, unsigned int element_nr); |
71 | int flex_array_shrink(struct flex_array *fa); | 71 | int flex_array_shrink(struct flex_array *fa); |
72 | 72 | ||
73 | #define flex_array_put_ptr(fa, nr, src, gfp) \ | ||
74 | flex_array_put(fa, nr, &(void *)(src), gfp) | ||
75 | |||
76 | void *flex_array_get_ptr(struct flex_array *fa, unsigned int element_nr); | ||
77 | |||
73 | #endif /* _FLEX_ARRAY_H */ | 78 | #endif /* _FLEX_ARRAY_H */ |
diff --git a/include/linux/fs.h b/include/linux/fs.h index e5106e49bd2c..a8ccf85b8691 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -91,6 +91,9 @@ struct inodes_stat_t { | |||
91 | /* Expect random access pattern */ | 91 | /* Expect random access pattern */ |
92 | #define FMODE_RANDOM ((__force fmode_t)0x1000) | 92 | #define FMODE_RANDOM ((__force fmode_t)0x1000) |
93 | 93 | ||
94 | /* File was opened by fanotify and shouldn't generate fanotify events */ | ||
95 | #define FMODE_NONOTIFY ((__force fmode_t)16777216) /* 0x1000000 */ | ||
96 | |||
94 | /* | 97 | /* |
95 | * The below are the various read and write types that we support. Some of | 98 | * The below are the various read and write types that we support. Some of |
96 | * them include behavioral modifiers that send information down to the | 99 | * them include behavioral modifiers that send information down to the |
@@ -210,6 +213,7 @@ struct inodes_stat_t { | |||
210 | #define MS_KERNMOUNT (1<<22) /* this is a kern_mount call */ | 213 | #define MS_KERNMOUNT (1<<22) /* this is a kern_mount call */ |
211 | #define MS_I_VERSION (1<<23) /* Update inode I_version field */ | 214 | #define MS_I_VERSION (1<<23) /* Update inode I_version field */ |
212 | #define MS_STRICTATIME (1<<24) /* Always perform atime updates */ | 215 | #define MS_STRICTATIME (1<<24) /* Always perform atime updates */ |
216 | #define MS_BORN (1<<29) | ||
213 | #define MS_ACTIVE (1<<30) | 217 | #define MS_ACTIVE (1<<30) |
214 | #define MS_NOUSER (1<<31) | 218 | #define MS_NOUSER (1<<31) |
215 | 219 | ||
@@ -408,9 +412,6 @@ extern int get_max_files(void); | |||
408 | extern int sysctl_nr_open; | 412 | extern int sysctl_nr_open; |
409 | extern struct inodes_stat_t inodes_stat; | 413 | extern struct inodes_stat_t inodes_stat; |
410 | extern int leases_enable, lease_break_time; | 414 | extern int leases_enable, lease_break_time; |
411 | #ifdef CONFIG_DNOTIFY | ||
412 | extern int dir_notify_enable; | ||
413 | #endif | ||
414 | 415 | ||
415 | struct buffer_head; | 416 | struct buffer_head; |
416 | typedef int (get_block_t)(struct inode *inode, sector_t iblock, | 417 | typedef int (get_block_t)(struct inode *inode, sector_t iblock, |
@@ -687,6 +688,7 @@ struct block_device { | |||
687 | */ | 688 | */ |
688 | #define PAGECACHE_TAG_DIRTY 0 | 689 | #define PAGECACHE_TAG_DIRTY 0 |
689 | #define PAGECACHE_TAG_WRITEBACK 1 | 690 | #define PAGECACHE_TAG_WRITEBACK 1 |
691 | #define PAGECACHE_TAG_TOWRITE 2 | ||
690 | 692 | ||
691 | int mapping_tagged(struct address_space *mapping, int tag); | 693 | int mapping_tagged(struct address_space *mapping, int tag); |
692 | 694 | ||
@@ -770,12 +772,7 @@ struct inode { | |||
770 | 772 | ||
771 | #ifdef CONFIG_FSNOTIFY | 773 | #ifdef CONFIG_FSNOTIFY |
772 | __u32 i_fsnotify_mask; /* all events this inode cares about */ | 774 | __u32 i_fsnotify_mask; /* all events this inode cares about */ |
773 | struct hlist_head i_fsnotify_mark_entries; /* fsnotify mark entries */ | 775 | struct hlist_head i_fsnotify_marks; |
774 | #endif | ||
775 | |||
776 | #ifdef CONFIG_INOTIFY | ||
777 | struct list_head inotify_watches; /* watches on this inode */ | ||
778 | struct mutex inotify_mutex; /* protects the watches list */ | ||
779 | #endif | 776 | #endif |
780 | 777 | ||
781 | unsigned long i_state; | 778 | unsigned long i_state; |
@@ -1563,8 +1560,8 @@ struct super_operations { | |||
1563 | 1560 | ||
1564 | void (*dirty_inode) (struct inode *); | 1561 | void (*dirty_inode) (struct inode *); |
1565 | int (*write_inode) (struct inode *, struct writeback_control *wbc); | 1562 | int (*write_inode) (struct inode *, struct writeback_control *wbc); |
1566 | void (*drop_inode) (struct inode *); | 1563 | int (*drop_inode) (struct inode *); |
1567 | void (*delete_inode) (struct inode *); | 1564 | void (*evict_inode) (struct inode *); |
1568 | void (*put_super) (struct super_block *); | 1565 | void (*put_super) (struct super_block *); |
1569 | void (*write_super) (struct super_block *); | 1566 | void (*write_super) (struct super_block *); |
1570 | int (*sync_fs)(struct super_block *sb, int wait); | 1567 | int (*sync_fs)(struct super_block *sb, int wait); |
@@ -1572,7 +1569,6 @@ struct super_operations { | |||
1572 | int (*unfreeze_fs) (struct super_block *); | 1569 | int (*unfreeze_fs) (struct super_block *); |
1573 | int (*statfs) (struct dentry *, struct kstatfs *); | 1570 | int (*statfs) (struct dentry *, struct kstatfs *); |
1574 | int (*remount_fs) (struct super_block *, int *, char *); | 1571 | int (*remount_fs) (struct super_block *, int *, char *); |
1575 | void (*clear_inode) (struct inode *); | ||
1576 | void (*umount_begin) (struct super_block *); | 1572 | void (*umount_begin) (struct super_block *); |
1577 | 1573 | ||
1578 | int (*show_options)(struct seq_file *, struct vfsmount *); | 1574 | int (*show_options)(struct seq_file *, struct vfsmount *); |
@@ -1617,8 +1613,8 @@ struct super_operations { | |||
1617 | * I_FREEING Set when inode is about to be freed but still has dirty | 1613 | * I_FREEING Set when inode is about to be freed but still has dirty |
1618 | * pages or buffers attached or the inode itself is still | 1614 | * pages or buffers attached or the inode itself is still |
1619 | * dirty. | 1615 | * dirty. |
1620 | * I_CLEAR Set by clear_inode(). In this state the inode is clean | 1616 | * I_CLEAR Added by end_writeback(). In this state the inode is clean |
1621 | * and can be destroyed. | 1617 | * and can be destroyed. Inode keeps I_FREEING. |
1622 | * | 1618 | * |
1623 | * Inodes that are I_WILL_FREE, I_FREEING or I_CLEAR are | 1619 | * Inodes that are I_WILL_FREE, I_FREEING or I_CLEAR are |
1624 | * prohibited for many purposes. iget() must wait for | 1620 | * prohibited for many purposes. iget() must wait for |
@@ -1815,7 +1811,8 @@ extern struct vfsmount *collect_mounts(struct path *); | |||
1815 | extern void drop_collected_mounts(struct vfsmount *); | 1811 | extern void drop_collected_mounts(struct vfsmount *); |
1816 | extern int iterate_mounts(int (*)(struct vfsmount *, void *), void *, | 1812 | extern int iterate_mounts(int (*)(struct vfsmount *, void *), void *, |
1817 | struct vfsmount *); | 1813 | struct vfsmount *); |
1818 | extern int vfs_statfs(struct dentry *, struct kstatfs *); | 1814 | extern int vfs_statfs(struct path *, struct kstatfs *); |
1815 | extern int statfs_by_dentry(struct dentry *, struct kstatfs *); | ||
1819 | extern int freeze_super(struct super_block *super); | 1816 | extern int freeze_super(struct super_block *super); |
1820 | extern int thaw_super(struct super_block *super); | 1817 | extern int thaw_super(struct super_block *super); |
1821 | 1818 | ||
@@ -2165,9 +2162,8 @@ extern void iput(struct inode *); | |||
2165 | extern struct inode * igrab(struct inode *); | 2162 | extern struct inode * igrab(struct inode *); |
2166 | extern ino_t iunique(struct super_block *, ino_t); | 2163 | extern ino_t iunique(struct super_block *, ino_t); |
2167 | extern int inode_needs_sync(struct inode *inode); | 2164 | extern int inode_needs_sync(struct inode *inode); |
2168 | extern void generic_delete_inode(struct inode *inode); | 2165 | extern int generic_delete_inode(struct inode *inode); |
2169 | extern void generic_drop_inode(struct inode *inode); | 2166 | extern int generic_drop_inode(struct inode *inode); |
2170 | extern int generic_detach_inode(struct inode *inode); | ||
2171 | 2167 | ||
2172 | extern struct inode *ilookup5_nowait(struct super_block *sb, | 2168 | extern struct inode *ilookup5_nowait(struct super_block *sb, |
2173 | unsigned long hashval, int (*test)(struct inode *, void *), | 2169 | unsigned long hashval, int (*test)(struct inode *, void *), |
@@ -2184,7 +2180,7 @@ extern void unlock_new_inode(struct inode *); | |||
2184 | 2180 | ||
2185 | extern void __iget(struct inode * inode); | 2181 | extern void __iget(struct inode * inode); |
2186 | extern void iget_failed(struct inode *); | 2182 | extern void iget_failed(struct inode *); |
2187 | extern void clear_inode(struct inode *); | 2183 | extern void end_writeback(struct inode *); |
2188 | extern void destroy_inode(struct inode *); | 2184 | extern void destroy_inode(struct inode *); |
2189 | extern void __destroy_inode(struct inode *); | 2185 | extern void __destroy_inode(struct inode *); |
2190 | extern struct inode *new_inode(struct super_block *); | 2186 | extern struct inode *new_inode(struct super_block *); |
@@ -2270,16 +2266,6 @@ static inline int xip_truncate_page(struct address_space *mapping, loff_t from) | |||
2270 | struct bio; | 2266 | struct bio; |
2271 | typedef void (dio_submit_t)(int rw, struct bio *bio, struct inode *inode, | 2267 | typedef void (dio_submit_t)(int rw, struct bio *bio, struct inode *inode, |
2272 | loff_t file_offset); | 2268 | loff_t file_offset); |
2273 | void dio_end_io(struct bio *bio, int error); | ||
2274 | |||
2275 | ssize_t __blockdev_direct_IO_newtrunc(int rw, struct kiocb *iocb, struct inode *inode, | ||
2276 | struct block_device *bdev, const struct iovec *iov, loff_t offset, | ||
2277 | unsigned long nr_segs, get_block_t get_block, dio_iodone_t end_io, | ||
2278 | dio_submit_t submit_io, int lock_type); | ||
2279 | ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, | ||
2280 | struct block_device *bdev, const struct iovec *iov, loff_t offset, | ||
2281 | unsigned long nr_segs, get_block_t get_block, dio_iodone_t end_io, | ||
2282 | dio_submit_t submit_io, int lock_type); | ||
2283 | 2269 | ||
2284 | enum { | 2270 | enum { |
2285 | /* need locking between buffered and direct access */ | 2271 | /* need locking between buffered and direct access */ |
@@ -2289,24 +2275,13 @@ enum { | |||
2289 | DIO_SKIP_HOLES = 0x02, | 2275 | DIO_SKIP_HOLES = 0x02, |
2290 | }; | 2276 | }; |
2291 | 2277 | ||
2292 | static inline ssize_t blockdev_direct_IO_newtrunc(int rw, struct kiocb *iocb, | 2278 | void dio_end_io(struct bio *bio, int error); |
2293 | struct inode *inode, struct block_device *bdev, const struct iovec *iov, | 2279 | |
2294 | loff_t offset, unsigned long nr_segs, get_block_t get_block, | 2280 | ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, |
2295 | dio_iodone_t end_io) | 2281 | struct block_device *bdev, const struct iovec *iov, loff_t offset, |
2296 | { | 2282 | unsigned long nr_segs, get_block_t get_block, dio_iodone_t end_io, |
2297 | return __blockdev_direct_IO_newtrunc(rw, iocb, inode, bdev, iov, offset, | 2283 | dio_submit_t submit_io, int flags); |
2298 | nr_segs, get_block, end_io, NULL, | ||
2299 | DIO_LOCKING | DIO_SKIP_HOLES); | ||
2300 | } | ||
2301 | 2284 | ||
2302 | static inline ssize_t blockdev_direct_IO_no_locking_newtrunc(int rw, struct kiocb *iocb, | ||
2303 | struct inode *inode, struct block_device *bdev, const struct iovec *iov, | ||
2304 | loff_t offset, unsigned long nr_segs, get_block_t get_block, | ||
2305 | dio_iodone_t end_io) | ||
2306 | { | ||
2307 | return __blockdev_direct_IO_newtrunc(rw, iocb, inode, bdev, iov, offset, | ||
2308 | nr_segs, get_block, end_io, NULL, 0); | ||
2309 | } | ||
2310 | static inline ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb, | 2285 | static inline ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb, |
2311 | struct inode *inode, struct block_device *bdev, const struct iovec *iov, | 2286 | struct inode *inode, struct block_device *bdev, const struct iovec *iov, |
2312 | loff_t offset, unsigned long nr_segs, get_block_t get_block, | 2287 | loff_t offset, unsigned long nr_segs, get_block_t get_block, |
@@ -2316,15 +2291,6 @@ static inline ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb, | |||
2316 | nr_segs, get_block, end_io, NULL, | 2291 | nr_segs, get_block, end_io, NULL, |
2317 | DIO_LOCKING | DIO_SKIP_HOLES); | 2292 | DIO_LOCKING | DIO_SKIP_HOLES); |
2318 | } | 2293 | } |
2319 | |||
2320 | static inline ssize_t blockdev_direct_IO_no_locking(int rw, struct kiocb *iocb, | ||
2321 | struct inode *inode, struct block_device *bdev, const struct iovec *iov, | ||
2322 | loff_t offset, unsigned long nr_segs, get_block_t get_block, | ||
2323 | dio_iodone_t end_io) | ||
2324 | { | ||
2325 | return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, | ||
2326 | nr_segs, get_block, end_io, NULL, 0); | ||
2327 | } | ||
2328 | #endif | 2294 | #endif |
2329 | 2295 | ||
2330 | extern const struct file_operations generic_ro_fops; | 2296 | extern const struct file_operations generic_ro_fops; |
@@ -2386,7 +2352,6 @@ extern int simple_link(struct dentry *, struct inode *, struct dentry *); | |||
2386 | extern int simple_unlink(struct inode *, struct dentry *); | 2352 | extern int simple_unlink(struct inode *, struct dentry *); |
2387 | extern int simple_rmdir(struct inode *, struct dentry *); | 2353 | extern int simple_rmdir(struct inode *, struct dentry *); |
2388 | extern int simple_rename(struct inode *, struct dentry *, struct inode *, struct dentry *); | 2354 | extern int simple_rename(struct inode *, struct dentry *, struct inode *, struct dentry *); |
2389 | extern int simple_setsize(struct inode *, loff_t); | ||
2390 | extern int noop_fsync(struct file *, int); | 2355 | extern int noop_fsync(struct file *, int); |
2391 | extern int simple_empty(struct dentry *); | 2356 | extern int simple_empty(struct dentry *); |
2392 | extern int simple_readpage(struct file *file, struct page *page); | 2357 | extern int simple_readpage(struct file *file, struct page *page); |
@@ -2423,8 +2388,7 @@ extern int buffer_migrate_page(struct address_space *, | |||
2423 | 2388 | ||
2424 | extern int inode_change_ok(const struct inode *, struct iattr *); | 2389 | extern int inode_change_ok(const struct inode *, struct iattr *); |
2425 | extern int inode_newsize_ok(const struct inode *, loff_t offset); | 2390 | extern int inode_newsize_ok(const struct inode *, loff_t offset); |
2426 | extern int __must_check inode_setattr(struct inode *, const struct iattr *); | 2391 | extern void setattr_copy(struct inode *inode, const struct iattr *attr); |
2427 | extern void generic_setattr(struct inode *inode, const struct iattr *attr); | ||
2428 | 2392 | ||
2429 | extern void file_update_time(struct file *file); | 2393 | extern void file_update_time(struct file *file); |
2430 | 2394 | ||
@@ -2515,7 +2479,8 @@ int proc_nr_files(struct ctl_table *table, int write, | |||
2515 | int __init get_filesystem_list(char *buf); | 2479 | int __init get_filesystem_list(char *buf); |
2516 | 2480 | ||
2517 | #define ACC_MODE(x) ("\004\002\006\006"[(x)&O_ACCMODE]) | 2481 | #define ACC_MODE(x) ("\004\002\006\006"[(x)&O_ACCMODE]) |
2518 | #define OPEN_FMODE(flag) ((__force fmode_t)((flag + 1) & O_ACCMODE)) | 2482 | #define OPEN_FMODE(flag) ((__force fmode_t)(((flag + 1) & O_ACCMODE) | \ |
2483 | (flag & FMODE_NONOTIFY))) | ||
2519 | 2484 | ||
2520 | #endif /* __KERNEL__ */ | 2485 | #endif /* __KERNEL__ */ |
2521 | #endif /* _LINUX_FS_H */ | 2486 | #endif /* _LINUX_FS_H */ |
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h index 01755909ce81..e4e2204187ee 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h | |||
@@ -11,8 +11,6 @@ | |||
11 | * (C) Copyright 2005 Robert Love | 11 | * (C) Copyright 2005 Robert Love |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include <linux/dnotify.h> | ||
15 | #include <linux/inotify.h> | ||
16 | #include <linux/fsnotify_backend.h> | 14 | #include <linux/fsnotify_backend.h> |
17 | #include <linux/audit.h> | 15 | #include <linux/audit.h> |
18 | #include <linux/slab.h> | 16 | #include <linux/slab.h> |
@@ -21,35 +19,52 @@ | |||
21 | * fsnotify_d_instantiate - instantiate a dentry for inode | 19 | * fsnotify_d_instantiate - instantiate a dentry for inode |
22 | * Called with dcache_lock held. | 20 | * Called with dcache_lock held. |
23 | */ | 21 | */ |
24 | static inline void fsnotify_d_instantiate(struct dentry *entry, | 22 | static inline void fsnotify_d_instantiate(struct dentry *dentry, |
25 | struct inode *inode) | 23 | struct inode *inode) |
26 | { | 24 | { |
27 | __fsnotify_d_instantiate(entry, inode); | 25 | __fsnotify_d_instantiate(dentry, inode); |
28 | |||
29 | inotify_d_instantiate(entry, inode); | ||
30 | } | 26 | } |
31 | 27 | ||
32 | /* Notify this dentry's parent about a child's events. */ | 28 | /* Notify this dentry's parent about a child's events. */ |
33 | static inline void fsnotify_parent(struct dentry *dentry, __u32 mask) | 29 | static inline void fsnotify_parent(struct file *file, struct dentry *dentry, __u32 mask) |
34 | { | 30 | { |
35 | __fsnotify_parent(dentry, mask); | 31 | if (!dentry) |
32 | dentry = file->f_path.dentry; | ||
33 | |||
34 | __fsnotify_parent(file, dentry, mask); | ||
35 | } | ||
36 | 36 | ||
37 | inotify_dentry_parent_queue_event(dentry, mask, 0, dentry->d_name.name); | 37 | /* simple call site for access decisions */ |
38 | static inline int fsnotify_perm(struct file *file, int mask) | ||
39 | { | ||
40 | struct inode *inode = file->f_path.dentry->d_inode; | ||
41 | __u32 fsnotify_mask = 0; | ||
42 | |||
43 | if (file->f_mode & FMODE_NONOTIFY) | ||
44 | return 0; | ||
45 | if (!(mask & (MAY_READ | MAY_OPEN))) | ||
46 | return 0; | ||
47 | if (mask & MAY_OPEN) | ||
48 | fsnotify_mask = FS_OPEN_PERM; | ||
49 | else if (mask & MAY_READ) | ||
50 | fsnotify_mask = FS_ACCESS_PERM; | ||
51 | else | ||
52 | BUG(); | ||
53 | |||
54 | return fsnotify(inode, fsnotify_mask, file, FSNOTIFY_EVENT_FILE, NULL, 0); | ||
38 | } | 55 | } |
39 | 56 | ||
40 | /* | 57 | /* |
41 | * fsnotify_d_move - entry has been moved | 58 | * fsnotify_d_move - dentry has been moved |
42 | * Called with dcache_lock and entry->d_lock held. | 59 | * Called with dcache_lock and dentry->d_lock held. |
43 | */ | 60 | */ |
44 | static inline void fsnotify_d_move(struct dentry *entry) | 61 | static inline void fsnotify_d_move(struct dentry *dentry) |
45 | { | 62 | { |
46 | /* | 63 | /* |
47 | * On move we need to update entry->d_flags to indicate if the new parent | 64 | * On move we need to update dentry->d_flags to indicate if the new parent |
48 | * cares about events from this entry. | 65 | * cares about events from this dentry. |
49 | */ | 66 | */ |
50 | __fsnotify_update_dcache_flags(entry); | 67 | __fsnotify_update_dcache_flags(dentry); |
51 | |||
52 | inotify_d_move(entry); | ||
53 | } | 68 | } |
54 | 69 | ||
55 | /* | 70 | /* |
@@ -57,8 +72,6 @@ static inline void fsnotify_d_move(struct dentry *entry) | |||
57 | */ | 72 | */ |
58 | static inline void fsnotify_link_count(struct inode *inode) | 73 | static inline void fsnotify_link_count(struct inode *inode) |
59 | { | 74 | { |
60 | inotify_inode_queue_event(inode, IN_ATTRIB, 0, NULL, NULL); | ||
61 | |||
62 | fsnotify(inode, FS_ATTRIB, inode, FSNOTIFY_EVENT_INODE, NULL, 0); | 75 | fsnotify(inode, FS_ATTRIB, inode, FSNOTIFY_EVENT_INODE, NULL, 0); |
63 | } | 76 | } |
64 | 77 | ||
@@ -66,45 +79,31 @@ static inline void fsnotify_link_count(struct inode *inode) | |||
66 | * fsnotify_move - file old_name at old_dir was moved to new_name at new_dir | 79 | * fsnotify_move - file old_name at old_dir was moved to new_name at new_dir |
67 | */ | 80 | */ |
68 | static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir, | 81 | static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir, |
69 | const char *old_name, | 82 | const unsigned char *old_name, |
70 | int isdir, struct inode *target, struct dentry *moved) | 83 | int isdir, struct inode *target, struct dentry *moved) |
71 | { | 84 | { |
72 | struct inode *source = moved->d_inode; | 85 | struct inode *source = moved->d_inode; |
73 | u32 in_cookie = inotify_get_cookie(); | ||
74 | u32 fs_cookie = fsnotify_get_cookie(); | 86 | u32 fs_cookie = fsnotify_get_cookie(); |
75 | __u32 old_dir_mask = (FS_EVENT_ON_CHILD | FS_MOVED_FROM); | 87 | __u32 old_dir_mask = (FS_EVENT_ON_CHILD | FS_MOVED_FROM); |
76 | __u32 new_dir_mask = (FS_EVENT_ON_CHILD | FS_MOVED_TO); | 88 | __u32 new_dir_mask = (FS_EVENT_ON_CHILD | FS_MOVED_TO); |
77 | const char *new_name = moved->d_name.name; | 89 | const unsigned char *new_name = moved->d_name.name; |
78 | 90 | ||
79 | if (old_dir == new_dir) | 91 | if (old_dir == new_dir) |
80 | old_dir_mask |= FS_DN_RENAME; | 92 | old_dir_mask |= FS_DN_RENAME; |
81 | 93 | ||
82 | if (isdir) { | 94 | if (isdir) { |
83 | isdir = IN_ISDIR; | ||
84 | old_dir_mask |= FS_IN_ISDIR; | 95 | old_dir_mask |= FS_IN_ISDIR; |
85 | new_dir_mask |= FS_IN_ISDIR; | 96 | new_dir_mask |= FS_IN_ISDIR; |
86 | } | 97 | } |
87 | 98 | ||
88 | inotify_inode_queue_event(old_dir, IN_MOVED_FROM|isdir, in_cookie, old_name, | ||
89 | source); | ||
90 | inotify_inode_queue_event(new_dir, IN_MOVED_TO|isdir, in_cookie, new_name, | ||
91 | source); | ||
92 | |||
93 | fsnotify(old_dir, old_dir_mask, old_dir, FSNOTIFY_EVENT_INODE, old_name, fs_cookie); | 99 | fsnotify(old_dir, old_dir_mask, old_dir, FSNOTIFY_EVENT_INODE, old_name, fs_cookie); |
94 | fsnotify(new_dir, new_dir_mask, new_dir, FSNOTIFY_EVENT_INODE, new_name, fs_cookie); | 100 | fsnotify(new_dir, new_dir_mask, new_dir, FSNOTIFY_EVENT_INODE, new_name, fs_cookie); |
95 | 101 | ||
96 | if (target) { | 102 | if (target) |
97 | inotify_inode_queue_event(target, IN_DELETE_SELF, 0, NULL, NULL); | ||
98 | inotify_inode_is_dead(target); | ||
99 | |||
100 | /* this is really a link_count change not a removal */ | ||
101 | fsnotify_link_count(target); | 103 | fsnotify_link_count(target); |
102 | } | ||
103 | 104 | ||
104 | if (source) { | 105 | if (source) |
105 | inotify_inode_queue_event(source, IN_MOVE_SELF, 0, NULL, NULL); | ||
106 | fsnotify(source, FS_MOVE_SELF, moved->d_inode, FSNOTIFY_EVENT_INODE, NULL, 0); | 106 | fsnotify(source, FS_MOVE_SELF, moved->d_inode, FSNOTIFY_EVENT_INODE, NULL, 0); |
107 | } | ||
108 | audit_inode_child(moved, new_dir); | 107 | audit_inode_child(moved, new_dir); |
109 | } | 108 | } |
110 | 109 | ||
@@ -117,6 +116,14 @@ static inline void fsnotify_inode_delete(struct inode *inode) | |||
117 | } | 116 | } |
118 | 117 | ||
119 | /* | 118 | /* |
119 | * fsnotify_vfsmount_delete - a vfsmount is being destroyed, clean up is needed | ||
120 | */ | ||
121 | static inline void fsnotify_vfsmount_delete(struct vfsmount *mnt) | ||
122 | { | ||
123 | __fsnotify_vfsmount_delete(mnt); | ||
124 | } | ||
125 | |||
126 | /* | ||
120 | * fsnotify_nameremove - a filename was removed from a directory | 127 | * fsnotify_nameremove - a filename was removed from a directory |
121 | */ | 128 | */ |
122 | static inline void fsnotify_nameremove(struct dentry *dentry, int isdir) | 129 | static inline void fsnotify_nameremove(struct dentry *dentry, int isdir) |
@@ -126,7 +133,7 @@ static inline void fsnotify_nameremove(struct dentry *dentry, int isdir) | |||
126 | if (isdir) | 133 | if (isdir) |
127 | mask |= FS_IN_ISDIR; | 134 | mask |= FS_IN_ISDIR; |
128 | 135 | ||
129 | fsnotify_parent(dentry, mask); | 136 | fsnotify_parent(NULL, dentry, mask); |
130 | } | 137 | } |
131 | 138 | ||
132 | /* | 139 | /* |
@@ -134,9 +141,6 @@ static inline void fsnotify_nameremove(struct dentry *dentry, int isdir) | |||
134 | */ | 141 | */ |
135 | static inline void fsnotify_inoderemove(struct inode *inode) | 142 | static inline void fsnotify_inoderemove(struct inode *inode) |
136 | { | 143 | { |
137 | inotify_inode_queue_event(inode, IN_DELETE_SELF, 0, NULL, NULL); | ||
138 | inotify_inode_is_dead(inode); | ||
139 | |||
140 | fsnotify(inode, FS_DELETE_SELF, inode, FSNOTIFY_EVENT_INODE, NULL, 0); | 144 | fsnotify(inode, FS_DELETE_SELF, inode, FSNOTIFY_EVENT_INODE, NULL, 0); |
141 | __fsnotify_inode_delete(inode); | 145 | __fsnotify_inode_delete(inode); |
142 | } | 146 | } |
@@ -146,8 +150,6 @@ static inline void fsnotify_inoderemove(struct inode *inode) | |||
146 | */ | 150 | */ |
147 | static inline void fsnotify_create(struct inode *inode, struct dentry *dentry) | 151 | static inline void fsnotify_create(struct inode *inode, struct dentry *dentry) |
148 | { | 152 | { |
149 | inotify_inode_queue_event(inode, IN_CREATE, 0, dentry->d_name.name, | ||
150 | dentry->d_inode); | ||
151 | audit_inode_child(dentry, inode); | 153 | audit_inode_child(dentry, inode); |
152 | 154 | ||
153 | fsnotify(inode, FS_CREATE, dentry->d_inode, FSNOTIFY_EVENT_INODE, dentry->d_name.name, 0); | 155 | fsnotify(inode, FS_CREATE, dentry->d_inode, FSNOTIFY_EVENT_INODE, dentry->d_name.name, 0); |
@@ -160,8 +162,6 @@ static inline void fsnotify_create(struct inode *inode, struct dentry *dentry) | |||
160 | */ | 162 | */ |
161 | static inline void fsnotify_link(struct inode *dir, struct inode *inode, struct dentry *new_dentry) | 163 | static inline void fsnotify_link(struct inode *dir, struct inode *inode, struct dentry *new_dentry) |
162 | { | 164 | { |
163 | inotify_inode_queue_event(dir, IN_CREATE, 0, new_dentry->d_name.name, | ||
164 | inode); | ||
165 | fsnotify_link_count(inode); | 165 | fsnotify_link_count(inode); |
166 | audit_inode_child(new_dentry, dir); | 166 | audit_inode_child(new_dentry, dir); |
167 | 167 | ||
@@ -176,7 +176,6 @@ static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry) | |||
176 | __u32 mask = (FS_CREATE | FS_IN_ISDIR); | 176 | __u32 mask = (FS_CREATE | FS_IN_ISDIR); |
177 | struct inode *d_inode = dentry->d_inode; | 177 | struct inode *d_inode = dentry->d_inode; |
178 | 178 | ||
179 | inotify_inode_queue_event(inode, mask, 0, dentry->d_name.name, d_inode); | ||
180 | audit_inode_child(dentry, inode); | 179 | audit_inode_child(dentry, inode); |
181 | 180 | ||
182 | fsnotify(inode, mask, d_inode, FSNOTIFY_EVENT_INODE, dentry->d_name.name, 0); | 181 | fsnotify(inode, mask, d_inode, FSNOTIFY_EVENT_INODE, dentry->d_name.name, 0); |
@@ -185,52 +184,52 @@ static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry) | |||
185 | /* | 184 | /* |
186 | * fsnotify_access - file was read | 185 | * fsnotify_access - file was read |
187 | */ | 186 | */ |
188 | static inline void fsnotify_access(struct dentry *dentry) | 187 | static inline void fsnotify_access(struct file *file) |
189 | { | 188 | { |
190 | struct inode *inode = dentry->d_inode; | 189 | struct inode *inode = file->f_path.dentry->d_inode; |
191 | __u32 mask = FS_ACCESS; | 190 | __u32 mask = FS_ACCESS; |
192 | 191 | ||
193 | if (S_ISDIR(inode->i_mode)) | 192 | if (S_ISDIR(inode->i_mode)) |
194 | mask |= FS_IN_ISDIR; | 193 | mask |= FS_IN_ISDIR; |
195 | 194 | ||
196 | inotify_inode_queue_event(inode, mask, 0, NULL, NULL); | 195 | if (!(file->f_mode & FMODE_NONOTIFY)) { |
197 | 196 | fsnotify_parent(file, NULL, mask); | |
198 | fsnotify_parent(dentry, mask); | 197 | fsnotify(inode, mask, file, FSNOTIFY_EVENT_FILE, NULL, 0); |
199 | fsnotify(inode, mask, inode, FSNOTIFY_EVENT_INODE, NULL, 0); | 198 | } |
200 | } | 199 | } |
201 | 200 | ||
202 | /* | 201 | /* |
203 | * fsnotify_modify - file was modified | 202 | * fsnotify_modify - file was modified |
204 | */ | 203 | */ |
205 | static inline void fsnotify_modify(struct dentry *dentry) | 204 | static inline void fsnotify_modify(struct file *file) |
206 | { | 205 | { |
207 | struct inode *inode = dentry->d_inode; | 206 | struct inode *inode = file->f_path.dentry->d_inode; |
208 | __u32 mask = FS_MODIFY; | 207 | __u32 mask = FS_MODIFY; |
209 | 208 | ||
210 | if (S_ISDIR(inode->i_mode)) | 209 | if (S_ISDIR(inode->i_mode)) |
211 | mask |= FS_IN_ISDIR; | 210 | mask |= FS_IN_ISDIR; |
212 | 211 | ||
213 | inotify_inode_queue_event(inode, mask, 0, NULL, NULL); | 212 | if (!(file->f_mode & FMODE_NONOTIFY)) { |
214 | 213 | fsnotify_parent(file, NULL, mask); | |
215 | fsnotify_parent(dentry, mask); | 214 | fsnotify(inode, mask, file, FSNOTIFY_EVENT_FILE, NULL, 0); |
216 | fsnotify(inode, mask, inode, FSNOTIFY_EVENT_INODE, NULL, 0); | 215 | } |
217 | } | 216 | } |
218 | 217 | ||
219 | /* | 218 | /* |
220 | * fsnotify_open - file was opened | 219 | * fsnotify_open - file was opened |
221 | */ | 220 | */ |
222 | static inline void fsnotify_open(struct dentry *dentry) | 221 | static inline void fsnotify_open(struct file *file) |
223 | { | 222 | { |
224 | struct inode *inode = dentry->d_inode; | 223 | struct inode *inode = file->f_path.dentry->d_inode; |
225 | __u32 mask = FS_OPEN; | 224 | __u32 mask = FS_OPEN; |
226 | 225 | ||
227 | if (S_ISDIR(inode->i_mode)) | 226 | if (S_ISDIR(inode->i_mode)) |
228 | mask |= FS_IN_ISDIR; | 227 | mask |= FS_IN_ISDIR; |
229 | 228 | ||
230 | inotify_inode_queue_event(inode, mask, 0, NULL, NULL); | 229 | if (!(file->f_mode & FMODE_NONOTIFY)) { |
231 | 230 | fsnotify_parent(file, NULL, mask); | |
232 | fsnotify_parent(dentry, mask); | 231 | fsnotify(inode, mask, file, FSNOTIFY_EVENT_FILE, NULL, 0); |
233 | fsnotify(inode, mask, inode, FSNOTIFY_EVENT_INODE, NULL, 0); | 232 | } |
234 | } | 233 | } |
235 | 234 | ||
236 | /* | 235 | /* |
@@ -238,18 +237,17 @@ static inline void fsnotify_open(struct dentry *dentry) | |||
238 | */ | 237 | */ |
239 | static inline void fsnotify_close(struct file *file) | 238 | static inline void fsnotify_close(struct file *file) |
240 | { | 239 | { |
241 | struct dentry *dentry = file->f_path.dentry; | 240 | struct inode *inode = file->f_path.dentry->d_inode; |
242 | struct inode *inode = dentry->d_inode; | ||
243 | fmode_t mode = file->f_mode; | 241 | fmode_t mode = file->f_mode; |
244 | __u32 mask = (mode & FMODE_WRITE) ? FS_CLOSE_WRITE : FS_CLOSE_NOWRITE; | 242 | __u32 mask = (mode & FMODE_WRITE) ? FS_CLOSE_WRITE : FS_CLOSE_NOWRITE; |
245 | 243 | ||
246 | if (S_ISDIR(inode->i_mode)) | 244 | if (S_ISDIR(inode->i_mode)) |
247 | mask |= FS_IN_ISDIR; | 245 | mask |= FS_IN_ISDIR; |
248 | 246 | ||
249 | inotify_inode_queue_event(inode, mask, 0, NULL, NULL); | 247 | if (!(file->f_mode & FMODE_NONOTIFY)) { |
250 | 248 | fsnotify_parent(file, NULL, mask); | |
251 | fsnotify_parent(dentry, mask); | 249 | fsnotify(inode, mask, file, FSNOTIFY_EVENT_FILE, NULL, 0); |
252 | fsnotify(inode, mask, file, FSNOTIFY_EVENT_FILE, NULL, 0); | 250 | } |
253 | } | 251 | } |
254 | 252 | ||
255 | /* | 253 | /* |
@@ -263,9 +261,7 @@ static inline void fsnotify_xattr(struct dentry *dentry) | |||
263 | if (S_ISDIR(inode->i_mode)) | 261 | if (S_ISDIR(inode->i_mode)) |
264 | mask |= FS_IN_ISDIR; | 262 | mask |= FS_IN_ISDIR; |
265 | 263 | ||
266 | inotify_inode_queue_event(inode, mask, 0, NULL, NULL); | 264 | fsnotify_parent(NULL, dentry, mask); |
267 | |||
268 | fsnotify_parent(dentry, mask); | ||
269 | fsnotify(inode, mask, inode, FSNOTIFY_EVENT_INODE, NULL, 0); | 265 | fsnotify(inode, mask, inode, FSNOTIFY_EVENT_INODE, NULL, 0); |
270 | } | 266 | } |
271 | 267 | ||
@@ -299,19 +295,18 @@ static inline void fsnotify_change(struct dentry *dentry, unsigned int ia_valid) | |||
299 | if (mask) { | 295 | if (mask) { |
300 | if (S_ISDIR(inode->i_mode)) | 296 | if (S_ISDIR(inode->i_mode)) |
301 | mask |= FS_IN_ISDIR; | 297 | mask |= FS_IN_ISDIR; |
302 | inotify_inode_queue_event(inode, mask, 0, NULL, NULL); | ||
303 | 298 | ||
304 | fsnotify_parent(dentry, mask); | 299 | fsnotify_parent(NULL, dentry, mask); |
305 | fsnotify(inode, mask, inode, FSNOTIFY_EVENT_INODE, NULL, 0); | 300 | fsnotify(inode, mask, inode, FSNOTIFY_EVENT_INODE, NULL, 0); |
306 | } | 301 | } |
307 | } | 302 | } |
308 | 303 | ||
309 | #if defined(CONFIG_INOTIFY) || defined(CONFIG_FSNOTIFY) /* notify helpers */ | 304 | #if defined(CONFIG_FSNOTIFY) /* notify helpers */ |
310 | 305 | ||
311 | /* | 306 | /* |
312 | * fsnotify_oldname_init - save off the old filename before we change it | 307 | * fsnotify_oldname_init - save off the old filename before we change it |
313 | */ | 308 | */ |
314 | static inline const char *fsnotify_oldname_init(const char *name) | 309 | static inline const unsigned char *fsnotify_oldname_init(const unsigned char *name) |
315 | { | 310 | { |
316 | return kstrdup(name, GFP_KERNEL); | 311 | return kstrdup(name, GFP_KERNEL); |
317 | } | 312 | } |
@@ -319,22 +314,22 @@ static inline const char *fsnotify_oldname_init(const char *name) | |||
319 | /* | 314 | /* |
320 | * fsnotify_oldname_free - free the name we got from fsnotify_oldname_init | 315 | * fsnotify_oldname_free - free the name we got from fsnotify_oldname_init |
321 | */ | 316 | */ |
322 | static inline void fsnotify_oldname_free(const char *old_name) | 317 | static inline void fsnotify_oldname_free(const unsigned char *old_name) |
323 | { | 318 | { |
324 | kfree(old_name); | 319 | kfree(old_name); |
325 | } | 320 | } |
326 | 321 | ||
327 | #else /* CONFIG_INOTIFY || CONFIG_FSNOTIFY */ | 322 | #else /* CONFIG_FSNOTIFY */ |
328 | 323 | ||
329 | static inline const char *fsnotify_oldname_init(const char *name) | 324 | static inline const char *fsnotify_oldname_init(const unsigned char *name) |
330 | { | 325 | { |
331 | return NULL; | 326 | return NULL; |
332 | } | 327 | } |
333 | 328 | ||
334 | static inline void fsnotify_oldname_free(const char *old_name) | 329 | static inline void fsnotify_oldname_free(const unsigned char *old_name) |
335 | { | 330 | { |
336 | } | 331 | } |
337 | 332 | ||
338 | #endif /* ! CONFIG_INOTIFY */ | 333 | #endif /* CONFIG_FSNOTIFY */ |
339 | 334 | ||
340 | #endif /* _LINUX_FS_NOTIFY_H */ | 335 | #endif /* _LINUX_FS_NOTIFY_H */ |
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h index 4d6f47b51189..9bbfd7204b04 100644 --- a/include/linux/fsnotify_backend.h +++ b/include/linux/fsnotify_backend.h | |||
@@ -41,6 +41,10 @@ | |||
41 | #define FS_Q_OVERFLOW 0x00004000 /* Event queued overflowed */ | 41 | #define FS_Q_OVERFLOW 0x00004000 /* Event queued overflowed */ |
42 | #define FS_IN_IGNORED 0x00008000 /* last inotify event here */ | 42 | #define FS_IN_IGNORED 0x00008000 /* last inotify event here */ |
43 | 43 | ||
44 | #define FS_OPEN_PERM 0x00010000 /* open event in an permission hook */ | ||
45 | #define FS_ACCESS_PERM 0x00020000 /* access event in a permissions hook */ | ||
46 | |||
47 | #define FS_EXCL_UNLINK 0x04000000 /* do not send events if object is unlinked */ | ||
44 | #define FS_IN_ISDIR 0x40000000 /* event occurred against dir */ | 48 | #define FS_IN_ISDIR 0x40000000 /* event occurred against dir */ |
45 | #define FS_IN_ONESHOT 0x80000000 /* only send event once */ | 49 | #define FS_IN_ONESHOT 0x80000000 /* only send event once */ |
46 | 50 | ||
@@ -58,13 +62,20 @@ | |||
58 | FS_MOVED_FROM | FS_MOVED_TO | FS_CREATE |\ | 62 | FS_MOVED_FROM | FS_MOVED_TO | FS_CREATE |\ |
59 | FS_DELETE) | 63 | FS_DELETE) |
60 | 64 | ||
61 | /* listeners that hard code group numbers near the top */ | 65 | #define FS_MOVE (FS_MOVED_FROM | FS_MOVED_TO) |
62 | #define DNOTIFY_GROUP_NUM UINT_MAX | 66 | |
63 | #define INOTIFY_GROUP_NUM (DNOTIFY_GROUP_NUM-1) | 67 | #define ALL_FSNOTIFY_EVENTS (FS_ACCESS | FS_MODIFY | FS_ATTRIB | \ |
68 | FS_CLOSE_WRITE | FS_CLOSE_NOWRITE | FS_OPEN | \ | ||
69 | FS_MOVED_FROM | FS_MOVED_TO | FS_CREATE | \ | ||
70 | FS_DELETE | FS_DELETE_SELF | FS_MOVE_SELF | \ | ||
71 | FS_UNMOUNT | FS_Q_OVERFLOW | FS_IN_IGNORED | \ | ||
72 | FS_OPEN_PERM | FS_ACCESS_PERM | FS_EXCL_UNLINK | \ | ||
73 | FS_IN_ISDIR | FS_IN_ONESHOT | FS_DN_RENAME | \ | ||
74 | FS_DN_MULTISHOT | FS_EVENT_ON_CHILD) | ||
64 | 75 | ||
65 | struct fsnotify_group; | 76 | struct fsnotify_group; |
66 | struct fsnotify_event; | 77 | struct fsnotify_event; |
67 | struct fsnotify_mark_entry; | 78 | struct fsnotify_mark; |
68 | struct fsnotify_event_private_data; | 79 | struct fsnotify_event_private_data; |
69 | 80 | ||
70 | /* | 81 | /* |
@@ -80,10 +91,16 @@ struct fsnotify_event_private_data; | |||
80 | * valid group and inode to use to clean up. | 91 | * valid group and inode to use to clean up. |
81 | */ | 92 | */ |
82 | struct fsnotify_ops { | 93 | struct fsnotify_ops { |
83 | bool (*should_send_event)(struct fsnotify_group *group, struct inode *inode, __u32 mask); | 94 | bool (*should_send_event)(struct fsnotify_group *group, struct inode *inode, |
84 | int (*handle_event)(struct fsnotify_group *group, struct fsnotify_event *event); | 95 | struct fsnotify_mark *inode_mark, |
96 | struct fsnotify_mark *vfsmount_mark, | ||
97 | __u32 mask, void *data, int data_type); | ||
98 | int (*handle_event)(struct fsnotify_group *group, | ||
99 | struct fsnotify_mark *inode_mark, | ||
100 | struct fsnotify_mark *vfsmount_mark, | ||
101 | struct fsnotify_event *event); | ||
85 | void (*free_group_priv)(struct fsnotify_group *group); | 102 | void (*free_group_priv)(struct fsnotify_group *group); |
86 | void (*freeing_mark)(struct fsnotify_mark_entry *entry, struct fsnotify_group *group); | 103 | void (*freeing_mark)(struct fsnotify_mark *mark, struct fsnotify_group *group); |
87 | void (*free_event_priv)(struct fsnotify_event_private_data *priv); | 104 | void (*free_event_priv)(struct fsnotify_event_private_data *priv); |
88 | }; | 105 | }; |
89 | 106 | ||
@@ -95,22 +112,6 @@ struct fsnotify_ops { | |||
95 | */ | 112 | */ |
96 | struct fsnotify_group { | 113 | struct fsnotify_group { |
97 | /* | 114 | /* |
98 | * global list of all groups receiving events from fsnotify. | ||
99 | * anchored by fsnotify_groups and protected by either fsnotify_grp_mutex | ||
100 | * or fsnotify_grp_srcu depending on write vs read. | ||
101 | */ | ||
102 | struct list_head group_list; | ||
103 | |||
104 | /* | ||
105 | * Defines all of the event types in which this group is interested. | ||
106 | * This mask is a bitwise OR of the FS_* events from above. Each time | ||
107 | * this mask changes for a group (if it changes) the correct functions | ||
108 | * must be called to update the global structures which indicate global | ||
109 | * interest in event types. | ||
110 | */ | ||
111 | __u32 mask; | ||
112 | |||
113 | /* | ||
114 | * How the refcnt is used is up to each group. When the refcnt hits 0 | 115 | * How the refcnt is used is up to each group. When the refcnt hits 0 |
115 | * fsnotify will clean up all of the resources associated with this group. | 116 | * fsnotify will clean up all of the resources associated with this group. |
116 | * As an example, the dnotify group will always have a refcnt=1 and that | 117 | * As an example, the dnotify group will always have a refcnt=1 and that |
@@ -119,7 +120,6 @@ struct fsnotify_group { | |||
119 | * closed. | 120 | * closed. |
120 | */ | 121 | */ |
121 | atomic_t refcnt; /* things with interest in this group */ | 122 | atomic_t refcnt; /* things with interest in this group */ |
122 | unsigned int group_num; /* simply prevents accidental group collision */ | ||
123 | 123 | ||
124 | const struct fsnotify_ops *ops; /* how this group handles things */ | 124 | const struct fsnotify_ops *ops; /* how this group handles things */ |
125 | 125 | ||
@@ -130,15 +130,12 @@ struct fsnotify_group { | |||
130 | unsigned int q_len; /* events on the queue */ | 130 | unsigned int q_len; /* events on the queue */ |
131 | unsigned int max_events; /* maximum events allowed on the list */ | 131 | unsigned int max_events; /* maximum events allowed on the list */ |
132 | 132 | ||
133 | /* stores all fastapth entries assoc with this group so they can be cleaned on unregister */ | 133 | /* stores all fastpath marks assoc with this group so they can be cleaned on unregister */ |
134 | spinlock_t mark_lock; /* protect mark_entries list */ | 134 | spinlock_t mark_lock; /* protect marks_list */ |
135 | atomic_t num_marks; /* 1 for each mark entry and 1 for not being | 135 | atomic_t num_marks; /* 1 for each mark and 1 for not being |
136 | * past the point of no return when freeing | 136 | * past the point of no return when freeing |
137 | * a group */ | 137 | * a group */ |
138 | struct list_head mark_entries; /* all inode mark entries for this group */ | 138 | struct list_head marks_list; /* all inode marks for this group */ |
139 | |||
140 | /* prevents double list_del of group_list. protected by global fsnotify_grp_mutex */ | ||
141 | bool on_group_list; | ||
142 | 139 | ||
143 | /* groups can define private fields here or use the void *private */ | 140 | /* groups can define private fields here or use the void *private */ |
144 | union { | 141 | union { |
@@ -152,6 +149,17 @@ struct fsnotify_group { | |||
152 | struct user_struct *user; | 149 | struct user_struct *user; |
153 | } inotify_data; | 150 | } inotify_data; |
154 | #endif | 151 | #endif |
152 | #ifdef CONFIG_FANOTIFY | ||
153 | struct fanotify_group_private_data { | ||
154 | #ifdef CONFIG_FANOTIFY_ACCESS_PERMISSIONS | ||
155 | /* allows a group to block waiting for a userspace response */ | ||
156 | struct mutex access_mutex; | ||
157 | struct list_head access_list; | ||
158 | wait_queue_head_t access_waitq; | ||
159 | #endif /* CONFIG_FANOTIFY_ACCESS_PERMISSIONS */ | ||
160 | int f_flags; | ||
161 | } fanotify_data; | ||
162 | #endif /* CONFIG_FANOTIFY */ | ||
155 | }; | 163 | }; |
156 | }; | 164 | }; |
157 | 165 | ||
@@ -195,35 +203,57 @@ struct fsnotify_event { | |||
195 | /* to_tell may ONLY be dereferenced during handle_event(). */ | 203 | /* to_tell may ONLY be dereferenced during handle_event(). */ |
196 | struct inode *to_tell; /* either the inode the event happened to or its parent */ | 204 | struct inode *to_tell; /* either the inode the event happened to or its parent */ |
197 | /* | 205 | /* |
198 | * depending on the event type we should have either a path or inode | 206 | * depending on the event type we should have either a file or inode |
199 | * We hold a reference on path, but NOT on inode. Since we have the ref on | 207 | * We hold a reference on file, but NOT on inode. Since we have the ref on |
200 | * the path, it may be dereferenced at any point during this object's | 208 | * the file, it may be dereferenced at any point during this object's |
201 | * lifetime. That reference is dropped when this object's refcnt hits | 209 | * lifetime. That reference is dropped when this object's refcnt hits |
202 | * 0. If this event contains an inode instead of a path, the inode may | 210 | * 0. If this event contains an inode instead of a file, the inode may |
203 | * ONLY be used during handle_event(). | 211 | * ONLY be used during handle_event(). |
204 | */ | 212 | */ |
205 | union { | 213 | union { |
206 | struct path path; | 214 | struct file *file; |
207 | struct inode *inode; | 215 | struct inode *inode; |
208 | }; | 216 | }; |
209 | /* when calling fsnotify tell it if the data is a path or inode */ | 217 | /* when calling fsnotify tell it if the data is a path or inode */ |
210 | #define FSNOTIFY_EVENT_NONE 0 | 218 | #define FSNOTIFY_EVENT_NONE 0 |
211 | #define FSNOTIFY_EVENT_PATH 1 | 219 | #define FSNOTIFY_EVENT_FILE 1 |
212 | #define FSNOTIFY_EVENT_INODE 2 | 220 | #define FSNOTIFY_EVENT_INODE 2 |
213 | #define FSNOTIFY_EVENT_FILE 3 | ||
214 | int data_type; /* which of the above union we have */ | 221 | int data_type; /* which of the above union we have */ |
215 | atomic_t refcnt; /* how many groups still are using/need to send this event */ | 222 | atomic_t refcnt; /* how many groups still are using/need to send this event */ |
216 | __u32 mask; /* the type of access, bitwise OR for FS_* event types */ | 223 | __u32 mask; /* the type of access, bitwise OR for FS_* event types */ |
217 | 224 | ||
218 | u32 sync_cookie; /* used to corrolate events, namely inotify mv events */ | 225 | u32 sync_cookie; /* used to corrolate events, namely inotify mv events */ |
219 | char *file_name; | 226 | const unsigned char *file_name; |
220 | size_t name_len; | 227 | size_t name_len; |
228 | struct pid *tgid; | ||
229 | |||
230 | #ifdef CONFIG_FANOTIFY_ACCESS_PERMISSIONS | ||
231 | __u32 response; /* userspace answer to question */ | ||
232 | #endif /* CONFIG_FANOTIFY_ACCESS_PERMISSIONS */ | ||
221 | 233 | ||
222 | struct list_head private_data_list; /* groups can store private data here */ | 234 | struct list_head private_data_list; /* groups can store private data here */ |
223 | }; | 235 | }; |
224 | 236 | ||
225 | /* | 237 | /* |
226 | * a mark is simply an entry attached to an in core inode which allows an | 238 | * Inode specific fields in an fsnotify_mark |
239 | */ | ||
240 | struct fsnotify_inode_mark { | ||
241 | struct inode *inode; /* inode this mark is associated with */ | ||
242 | struct hlist_node i_list; /* list of marks by inode->i_fsnotify_marks */ | ||
243 | struct list_head free_i_list; /* tmp list used when freeing this mark */ | ||
244 | }; | ||
245 | |||
246 | /* | ||
247 | * Mount point specific fields in an fsnotify_mark | ||
248 | */ | ||
249 | struct fsnotify_vfsmount_mark { | ||
250 | struct vfsmount *mnt; /* vfsmount this mark is associated with */ | ||
251 | struct hlist_node m_list; /* list of marks by inode->i_fsnotify_marks */ | ||
252 | struct list_head free_m_list; /* tmp list used when freeing this mark */ | ||
253 | }; | ||
254 | |||
255 | /* | ||
256 | * a mark is simply an object attached to an in core inode which allows an | ||
227 | * fsnotify listener to indicate they are either no longer interested in events | 257 | * fsnotify listener to indicate they are either no longer interested in events |
228 | * of a type matching mask or only interested in those events. | 258 | * of a type matching mask or only interested in those events. |
229 | * | 259 | * |
@@ -232,19 +262,28 @@ struct fsnotify_event { | |||
232 | * (such as dnotify) will flush these when the open fd is closed and not at | 262 | * (such as dnotify) will flush these when the open fd is closed and not at |
233 | * inode eviction or modification. | 263 | * inode eviction or modification. |
234 | */ | 264 | */ |
235 | struct fsnotify_mark_entry { | 265 | struct fsnotify_mark { |
236 | __u32 mask; /* mask this mark entry is for */ | 266 | __u32 mask; /* mask this mark is for */ |
237 | /* we hold ref for each i_list and g_list. also one ref for each 'thing' | 267 | /* we hold ref for each i_list and g_list. also one ref for each 'thing' |
238 | * in kernel that found and may be using this mark. */ | 268 | * in kernel that found and may be using this mark. */ |
239 | atomic_t refcnt; /* active things looking at this mark */ | 269 | atomic_t refcnt; /* active things looking at this mark */ |
240 | struct inode *inode; /* inode this entry is associated with */ | 270 | struct fsnotify_group *group; /* group this mark is for */ |
241 | struct fsnotify_group *group; /* group this mark entry is for */ | 271 | struct list_head g_list; /* list of marks by group->i_fsnotify_marks */ |
242 | struct hlist_node i_list; /* list of mark_entries by inode->i_fsnotify_mark_entries */ | 272 | spinlock_t lock; /* protect group and inode */ |
243 | struct list_head g_list; /* list of mark_entries by group->i_fsnotify_mark_entries */ | 273 | union { |
244 | spinlock_t lock; /* protect group, inode, and killme */ | 274 | struct fsnotify_inode_mark i; |
245 | struct list_head free_i_list; /* tmp list used when freeing this mark */ | 275 | struct fsnotify_vfsmount_mark m; |
276 | }; | ||
277 | __u32 ignored_mask; /* events types to ignore */ | ||
246 | struct list_head free_g_list; /* tmp list used when freeing this mark */ | 278 | struct list_head free_g_list; /* tmp list used when freeing this mark */ |
247 | void (*free_mark)(struct fsnotify_mark_entry *entry); /* called on final put+free */ | 279 | #define FSNOTIFY_MARK_FLAG_INODE 0x01 |
280 | #define FSNOTIFY_MARK_FLAG_VFSMOUNT 0x02 | ||
281 | #define FSNOTIFY_MARK_FLAG_OBJECT_PINNED 0x04 | ||
282 | #define FSNOTIFY_MARK_FLAG_IGNORED_SURV_MODIFY 0x08 | ||
283 | #define FSNOTIFY_MARK_FLAG_ALIVE 0x10 | ||
284 | unsigned int flags; /* vfsmount or inode mark? */ | ||
285 | struct list_head destroy_list; | ||
286 | void (*free_mark)(struct fsnotify_mark *mark); /* called on final put+free */ | ||
248 | }; | 287 | }; |
249 | 288 | ||
250 | #ifdef CONFIG_FSNOTIFY | 289 | #ifdef CONFIG_FSNOTIFY |
@@ -252,10 +291,11 @@ struct fsnotify_mark_entry { | |||
252 | /* called from the vfs helpers */ | 291 | /* called from the vfs helpers */ |
253 | 292 | ||
254 | /* main fsnotify call to send events */ | 293 | /* main fsnotify call to send events */ |
255 | extern void fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is, | 294 | extern int fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is, |
256 | const char *name, u32 cookie); | 295 | const unsigned char *name, u32 cookie); |
257 | extern void __fsnotify_parent(struct dentry *dentry, __u32 mask); | 296 | extern void __fsnotify_parent(struct file *file, struct dentry *dentry, __u32 mask); |
258 | extern void __fsnotify_inode_delete(struct inode *inode); | 297 | extern void __fsnotify_inode_delete(struct inode *inode); |
298 | extern void __fsnotify_vfsmount_delete(struct vfsmount *mnt); | ||
259 | extern u32 fsnotify_get_cookie(void); | 299 | extern u32 fsnotify_get_cookie(void); |
260 | 300 | ||
261 | static inline int fsnotify_inode_watches_children(struct inode *inode) | 301 | static inline int fsnotify_inode_watches_children(struct inode *inode) |
@@ -304,15 +344,9 @@ static inline void __fsnotify_d_instantiate(struct dentry *dentry, struct inode | |||
304 | 344 | ||
305 | /* called from fsnotify listeners, such as fanotify or dnotify */ | 345 | /* called from fsnotify listeners, such as fanotify or dnotify */ |
306 | 346 | ||
307 | /* must call when a group changes its ->mask */ | ||
308 | extern void fsnotify_recalc_global_mask(void); | ||
309 | /* get a reference to an existing or create a new group */ | 347 | /* get a reference to an existing or create a new group */ |
310 | extern struct fsnotify_group *fsnotify_obtain_group(unsigned int group_num, | 348 | extern struct fsnotify_group *fsnotify_alloc_group(const struct fsnotify_ops *ops); |
311 | __u32 mask, | 349 | /* drop reference on a group from fsnotify_alloc_group */ |
312 | const struct fsnotify_ops *ops); | ||
313 | /* run all marks associated with this group and update group->mask */ | ||
314 | extern void fsnotify_recalc_group_mask(struct fsnotify_group *group); | ||
315 | /* drop reference on a group from fsnotify_obtain_group */ | ||
316 | extern void fsnotify_put_group(struct fsnotify_group *group); | 350 | extern void fsnotify_put_group(struct fsnotify_group *group); |
317 | 351 | ||
318 | /* take a reference to an event */ | 352 | /* take a reference to an event */ |
@@ -323,8 +357,11 @@ extern struct fsnotify_event_private_data *fsnotify_remove_priv_from_event(struc | |||
323 | struct fsnotify_event *event); | 357 | struct fsnotify_event *event); |
324 | 358 | ||
325 | /* attach the event to the group notification queue */ | 359 | /* attach the event to the group notification queue */ |
326 | extern int fsnotify_add_notify_event(struct fsnotify_group *group, struct fsnotify_event *event, | 360 | extern struct fsnotify_event *fsnotify_add_notify_event(struct fsnotify_group *group, |
327 | struct fsnotify_event_private_data *priv); | 361 | struct fsnotify_event *event, |
362 | struct fsnotify_event_private_data *priv, | ||
363 | struct fsnotify_event *(*merge)(struct list_head *, | ||
364 | struct fsnotify_event *)); | ||
328 | /* true if the group notification queue is empty */ | 365 | /* true if the group notification queue is empty */ |
329 | extern bool fsnotify_notify_queue_is_empty(struct fsnotify_group *group); | 366 | extern bool fsnotify_notify_queue_is_empty(struct fsnotify_group *group); |
330 | /* return, but do not dequeue the first event on the notification queue */ | 367 | /* return, but do not dequeue the first event on the notification queue */ |
@@ -334,38 +371,66 @@ extern struct fsnotify_event *fsnotify_remove_notify_event(struct fsnotify_group | |||
334 | 371 | ||
335 | /* functions used to manipulate the marks attached to inodes */ | 372 | /* functions used to manipulate the marks attached to inodes */ |
336 | 373 | ||
374 | /* run all marks associated with a vfsmount and update mnt->mnt_fsnotify_mask */ | ||
375 | extern void fsnotify_recalc_vfsmount_mask(struct vfsmount *mnt); | ||
337 | /* run all marks associated with an inode and update inode->i_fsnotify_mask */ | 376 | /* run all marks associated with an inode and update inode->i_fsnotify_mask */ |
338 | extern void fsnotify_recalc_inode_mask(struct inode *inode); | 377 | extern void fsnotify_recalc_inode_mask(struct inode *inode); |
339 | extern void fsnotify_init_mark(struct fsnotify_mark_entry *entry, void (*free_mark)(struct fsnotify_mark_entry *entry)); | 378 | extern void fsnotify_init_mark(struct fsnotify_mark *mark, void (*free_mark)(struct fsnotify_mark *mark)); |
340 | /* find (and take a reference) to a mark associated with group and inode */ | 379 | /* find (and take a reference) to a mark associated with group and inode */ |
341 | extern struct fsnotify_mark_entry *fsnotify_find_mark_entry(struct fsnotify_group *group, struct inode *inode); | 380 | extern struct fsnotify_mark *fsnotify_find_inode_mark(struct fsnotify_group *group, struct inode *inode); |
381 | /* find (and take a reference) to a mark associated with group and vfsmount */ | ||
382 | extern struct fsnotify_mark *fsnotify_find_vfsmount_mark(struct fsnotify_group *group, struct vfsmount *mnt); | ||
383 | /* copy the values from old into new */ | ||
384 | extern void fsnotify_duplicate_mark(struct fsnotify_mark *new, struct fsnotify_mark *old); | ||
385 | /* set the ignored_mask of a mark */ | ||
386 | extern void fsnotify_set_mark_ignored_mask_locked(struct fsnotify_mark *mark, __u32 mask); | ||
387 | /* set the mask of a mark (might pin the object into memory */ | ||
388 | extern void fsnotify_set_mark_mask_locked(struct fsnotify_mark *mark, __u32 mask); | ||
342 | /* attach the mark to both the group and the inode */ | 389 | /* attach the mark to both the group and the inode */ |
343 | extern int fsnotify_add_mark(struct fsnotify_mark_entry *entry, struct fsnotify_group *group, struct inode *inode); | 390 | extern int fsnotify_add_mark(struct fsnotify_mark *mark, struct fsnotify_group *group, |
391 | struct inode *inode, struct vfsmount *mnt, int allow_dups); | ||
344 | /* given a mark, flag it to be freed when all references are dropped */ | 392 | /* given a mark, flag it to be freed when all references are dropped */ |
345 | extern void fsnotify_destroy_mark_by_entry(struct fsnotify_mark_entry *entry); | 393 | extern void fsnotify_destroy_mark(struct fsnotify_mark *mark); |
394 | /* run all the marks in a group, and clear all of the vfsmount marks */ | ||
395 | extern void fsnotify_clear_vfsmount_marks_by_group(struct fsnotify_group *group); | ||
396 | /* run all the marks in a group, and clear all of the inode marks */ | ||
397 | extern void fsnotify_clear_inode_marks_by_group(struct fsnotify_group *group); | ||
398 | /* run all the marks in a group, and clear all of the marks where mark->flags & flags is true*/ | ||
399 | extern void fsnotify_clear_marks_by_group_flags(struct fsnotify_group *group, unsigned int flags); | ||
346 | /* run all the marks in a group, and flag them to be freed */ | 400 | /* run all the marks in a group, and flag them to be freed */ |
347 | extern void fsnotify_clear_marks_by_group(struct fsnotify_group *group); | 401 | extern void fsnotify_clear_marks_by_group(struct fsnotify_group *group); |
348 | extern void fsnotify_get_mark(struct fsnotify_mark_entry *entry); | 402 | extern void fsnotify_get_mark(struct fsnotify_mark *mark); |
349 | extern void fsnotify_put_mark(struct fsnotify_mark_entry *entry); | 403 | extern void fsnotify_put_mark(struct fsnotify_mark *mark); |
350 | extern void fsnotify_unmount_inodes(struct list_head *list); | 404 | extern void fsnotify_unmount_inodes(struct list_head *list); |
351 | 405 | ||
352 | /* put here because inotify does some weird stuff when destroying watches */ | 406 | /* put here because inotify does some weird stuff when destroying watches */ |
353 | extern struct fsnotify_event *fsnotify_create_event(struct inode *to_tell, __u32 mask, | 407 | extern struct fsnotify_event *fsnotify_create_event(struct inode *to_tell, __u32 mask, |
354 | void *data, int data_is, const char *name, | 408 | void *data, int data_is, |
409 | const unsigned char *name, | ||
355 | u32 cookie, gfp_t gfp); | 410 | u32 cookie, gfp_t gfp); |
356 | 411 | ||
412 | /* fanotify likes to change events after they are on lists... */ | ||
413 | extern struct fsnotify_event *fsnotify_clone_event(struct fsnotify_event *old_event); | ||
414 | extern int fsnotify_replace_event(struct fsnotify_event_holder *old_holder, | ||
415 | struct fsnotify_event *new_event); | ||
416 | |||
357 | #else | 417 | #else |
358 | 418 | ||
359 | static inline void fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is, | 419 | static inline int fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is, |
360 | const char *name, u32 cookie) | 420 | const unsigned char *name, u32 cookie) |
361 | {} | 421 | { |
422 | return 0; | ||
423 | } | ||
362 | 424 | ||
363 | static inline void __fsnotify_parent(struct dentry *dentry, __u32 mask) | 425 | static inline void __fsnotify_parent(struct file *file, struct dentry *dentry, __u32 mask) |
364 | {} | 426 | {} |
365 | 427 | ||
366 | static inline void __fsnotify_inode_delete(struct inode *inode) | 428 | static inline void __fsnotify_inode_delete(struct inode *inode) |
367 | {} | 429 | {} |
368 | 430 | ||
431 | static inline void __fsnotify_vfsmount_delete(struct vfsmount *mnt) | ||
432 | {} | ||
433 | |||
369 | static inline void __fsnotify_update_dcache_flags(struct dentry *dentry) | 434 | static inline void __fsnotify_update_dcache_flags(struct dentry *dentry) |
370 | {} | 435 | {} |
371 | 436 | ||
diff --git a/include/linux/gpio_keys.h b/include/linux/gpio_keys.h index cd0b3f30f48e..ce73a30113b4 100644 --- a/include/linux/gpio_keys.h +++ b/include/linux/gpio_keys.h | |||
@@ -17,6 +17,8 @@ struct gpio_keys_platform_data { | |||
17 | struct gpio_keys_button *buttons; | 17 | struct gpio_keys_button *buttons; |
18 | int nbuttons; | 18 | int nbuttons; |
19 | unsigned int rep:1; /* enable input subsystem auto repeat */ | 19 | unsigned int rep:1; /* enable input subsystem auto repeat */ |
20 | int (*enable)(struct device *dev); | ||
21 | void (*disable)(struct device *dev); | ||
20 | }; | 22 | }; |
21 | 23 | ||
22 | #endif | 24 | #endif |
diff --git a/include/linux/highmem.h b/include/linux/highmem.h index caafd0561aa1..e3060ef85b6d 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _LINUX_HIGHMEM_H | 2 | #define _LINUX_HIGHMEM_H |
3 | 3 | ||
4 | #include <linux/fs.h> | 4 | #include <linux/fs.h> |
5 | #include <linux/kernel.h> | ||
5 | #include <linux/mm.h> | 6 | #include <linux/mm.h> |
6 | #include <linux/uaccess.h> | 7 | #include <linux/uaccess.h> |
7 | 8 | ||
@@ -72,7 +73,11 @@ static inline void *kmap_atomic(struct page *page, enum km_type idx) | |||
72 | } | 73 | } |
73 | #define kmap_atomic_prot(page, idx, prot) kmap_atomic(page, idx) | 74 | #define kmap_atomic_prot(page, idx, prot) kmap_atomic(page, idx) |
74 | 75 | ||
75 | #define kunmap_atomic(addr, idx) do { pagefault_enable(); } while (0) | 76 | static inline void kunmap_atomic_notypecheck(void *addr, enum km_type idx) |
77 | { | ||
78 | pagefault_enable(); | ||
79 | } | ||
80 | |||
76 | #define kmap_atomic_pfn(pfn, idx) kmap_atomic(pfn_to_page(pfn), (idx)) | 81 | #define kmap_atomic_pfn(pfn, idx) kmap_atomic(pfn_to_page(pfn), (idx)) |
77 | #define kmap_atomic_to_page(ptr) virt_to_page(ptr) | 82 | #define kmap_atomic_to_page(ptr) virt_to_page(ptr) |
78 | 83 | ||
@@ -81,6 +86,13 @@ static inline void *kmap_atomic(struct page *page, enum km_type idx) | |||
81 | 86 | ||
82 | #endif /* CONFIG_HIGHMEM */ | 87 | #endif /* CONFIG_HIGHMEM */ |
83 | 88 | ||
89 | /* Prevent people trying to call kunmap_atomic() as if it were kunmap() */ | ||
90 | /* kunmap_atomic() should get the return value of kmap_atomic, not the page. */ | ||
91 | #define kunmap_atomic(addr, idx) do { \ | ||
92 | BUILD_BUG_ON(__same_type((addr), struct page *)); \ | ||
93 | kunmap_atomic_notypecheck((addr), (idx)); \ | ||
94 | } while (0) | ||
95 | |||
84 | /* when CONFIG_HIGHMEM is not set these will be plain clear/copy_page */ | 96 | /* when CONFIG_HIGHMEM is not set these will be plain clear/copy_page */ |
85 | #ifndef clear_user_highpage | 97 | #ifndef clear_user_highpage |
86 | static inline void clear_user_highpage(struct page *page, unsigned long vaddr) | 98 | static inline void clear_user_highpage(struct page *page, unsigned long vaddr) |
diff --git a/include/linux/inotify.h b/include/linux/inotify.h index 37ea2894b3c0..d33041e2a42a 100644 --- a/include/linux/inotify.h +++ b/include/linux/inotify.h | |||
@@ -51,6 +51,7 @@ struct inotify_event { | |||
51 | /* special flags */ | 51 | /* special flags */ |
52 | #define IN_ONLYDIR 0x01000000 /* only watch the path if it is a directory */ | 52 | #define IN_ONLYDIR 0x01000000 /* only watch the path if it is a directory */ |
53 | #define IN_DONT_FOLLOW 0x02000000 /* don't follow a sym link */ | 53 | #define IN_DONT_FOLLOW 0x02000000 /* don't follow a sym link */ |
54 | #define IN_EXCL_UNLINK 0x04000000 /* exclude events on unlinked objects */ | ||
54 | #define IN_MASK_ADD 0x20000000 /* add to the mask of an already existing watch */ | 55 | #define IN_MASK_ADD 0x20000000 /* add to the mask of an already existing watch */ |
55 | #define IN_ISDIR 0x40000000 /* event occurred against dir */ | 56 | #define IN_ISDIR 0x40000000 /* event occurred against dir */ |
56 | #define IN_ONESHOT 0x80000000 /* only send event once */ | 57 | #define IN_ONESHOT 0x80000000 /* only send event once */ |
@@ -70,177 +71,17 @@ struct inotify_event { | |||
70 | #define IN_NONBLOCK O_NONBLOCK | 71 | #define IN_NONBLOCK O_NONBLOCK |
71 | 72 | ||
72 | #ifdef __KERNEL__ | 73 | #ifdef __KERNEL__ |
73 | 74 | #include <linux/sysctl.h> | |
74 | #include <linux/dcache.h> | 75 | extern struct ctl_table inotify_table[]; /* for sysctl */ |
75 | #include <linux/fs.h> | 76 | |
76 | 77 | #define ALL_INOTIFY_BITS (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | \ | |
77 | /* | 78 | IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM | \ |
78 | * struct inotify_watch - represents a watch request on a specific inode | 79 | IN_MOVED_TO | IN_CREATE | IN_DELETE | \ |
79 | * | 80 | IN_DELETE_SELF | IN_MOVE_SELF | IN_UNMOUNT | \ |
80 | * h_list is protected by ih->mutex of the associated inotify_handle. | 81 | IN_Q_OVERFLOW | IN_IGNORED | IN_ONLYDIR | \ |
81 | * i_list, mask are protected by inode->inotify_mutex of the associated inode. | 82 | IN_DONT_FOLLOW | IN_EXCL_UNLINK | IN_MASK_ADD | \ |
82 | * ih, inode, and wd are never written to once the watch is created. | 83 | IN_ISDIR | IN_ONESHOT) |
83 | * | 84 | |
84 | * Callers must use the established inotify interfaces to access inotify_watch | 85 | #endif |
85 | * contents. The content of this structure is private to the inotify | ||
86 | * implementation. | ||
87 | */ | ||
88 | struct inotify_watch { | ||
89 | struct list_head h_list; /* entry in inotify_handle's list */ | ||
90 | struct list_head i_list; /* entry in inode's list */ | ||
91 | atomic_t count; /* reference count */ | ||
92 | struct inotify_handle *ih; /* associated inotify handle */ | ||
93 | struct inode *inode; /* associated inode */ | ||
94 | __s32 wd; /* watch descriptor */ | ||
95 | __u32 mask; /* event mask for this watch */ | ||
96 | }; | ||
97 | |||
98 | struct inotify_operations { | ||
99 | void (*handle_event)(struct inotify_watch *, u32, u32, u32, | ||
100 | const char *, struct inode *); | ||
101 | void (*destroy_watch)(struct inotify_watch *); | ||
102 | }; | ||
103 | |||
104 | #ifdef CONFIG_INOTIFY | ||
105 | |||
106 | /* Kernel API for producing events */ | ||
107 | |||
108 | extern void inotify_d_instantiate(struct dentry *, struct inode *); | ||
109 | extern void inotify_d_move(struct dentry *); | ||
110 | extern void inotify_inode_queue_event(struct inode *, __u32, __u32, | ||
111 | const char *, struct inode *); | ||
112 | extern void inotify_dentry_parent_queue_event(struct dentry *, __u32, __u32, | ||
113 | const char *); | ||
114 | extern void inotify_unmount_inodes(struct list_head *); | ||
115 | extern void inotify_inode_is_dead(struct inode *); | ||
116 | extern u32 inotify_get_cookie(void); | ||
117 | |||
118 | /* Kernel Consumer API */ | ||
119 | |||
120 | extern struct inotify_handle *inotify_init(const struct inotify_operations *); | ||
121 | extern void inotify_init_watch(struct inotify_watch *); | ||
122 | extern void inotify_destroy(struct inotify_handle *); | ||
123 | extern __s32 inotify_find_watch(struct inotify_handle *, struct inode *, | ||
124 | struct inotify_watch **); | ||
125 | extern __s32 inotify_find_update_watch(struct inotify_handle *, struct inode *, | ||
126 | u32); | ||
127 | extern __s32 inotify_add_watch(struct inotify_handle *, struct inotify_watch *, | ||
128 | struct inode *, __u32); | ||
129 | extern __s32 inotify_clone_watch(struct inotify_watch *, struct inotify_watch *); | ||
130 | extern void inotify_evict_watch(struct inotify_watch *); | ||
131 | extern int inotify_rm_watch(struct inotify_handle *, struct inotify_watch *); | ||
132 | extern int inotify_rm_wd(struct inotify_handle *, __u32); | ||
133 | extern void inotify_remove_watch_locked(struct inotify_handle *, | ||
134 | struct inotify_watch *); | ||
135 | extern void get_inotify_watch(struct inotify_watch *); | ||
136 | extern void put_inotify_watch(struct inotify_watch *); | ||
137 | extern int pin_inotify_watch(struct inotify_watch *); | ||
138 | extern void unpin_inotify_watch(struct inotify_watch *); | ||
139 | |||
140 | #else | ||
141 | |||
142 | static inline void inotify_d_instantiate(struct dentry *dentry, | ||
143 | struct inode *inode) | ||
144 | { | ||
145 | } | ||
146 | |||
147 | static inline void inotify_d_move(struct dentry *dentry) | ||
148 | { | ||
149 | } | ||
150 | |||
151 | static inline void inotify_inode_queue_event(struct inode *inode, | ||
152 | __u32 mask, __u32 cookie, | ||
153 | const char *filename, | ||
154 | struct inode *n_inode) | ||
155 | { | ||
156 | } | ||
157 | |||
158 | static inline void inotify_dentry_parent_queue_event(struct dentry *dentry, | ||
159 | __u32 mask, __u32 cookie, | ||
160 | const char *filename) | ||
161 | { | ||
162 | } | ||
163 | |||
164 | static inline void inotify_unmount_inodes(struct list_head *list) | ||
165 | { | ||
166 | } | ||
167 | |||
168 | static inline void inotify_inode_is_dead(struct inode *inode) | ||
169 | { | ||
170 | } | ||
171 | |||
172 | static inline u32 inotify_get_cookie(void) | ||
173 | { | ||
174 | return 0; | ||
175 | } | ||
176 | |||
177 | static inline struct inotify_handle *inotify_init(const struct inotify_operations *ops) | ||
178 | { | ||
179 | return ERR_PTR(-EOPNOTSUPP); | ||
180 | } | ||
181 | |||
182 | static inline void inotify_init_watch(struct inotify_watch *watch) | ||
183 | { | ||
184 | } | ||
185 | |||
186 | static inline void inotify_destroy(struct inotify_handle *ih) | ||
187 | { | ||
188 | } | ||
189 | |||
190 | static inline __s32 inotify_find_watch(struct inotify_handle *ih, struct inode *inode, | ||
191 | struct inotify_watch **watchp) | ||
192 | { | ||
193 | return -EOPNOTSUPP; | ||
194 | } | ||
195 | |||
196 | static inline __s32 inotify_find_update_watch(struct inotify_handle *ih, | ||
197 | struct inode *inode, u32 mask) | ||
198 | { | ||
199 | return -EOPNOTSUPP; | ||
200 | } | ||
201 | |||
202 | static inline __s32 inotify_add_watch(struct inotify_handle *ih, | ||
203 | struct inotify_watch *watch, | ||
204 | struct inode *inode, __u32 mask) | ||
205 | { | ||
206 | return -EOPNOTSUPP; | ||
207 | } | ||
208 | |||
209 | static inline int inotify_rm_watch(struct inotify_handle *ih, | ||
210 | struct inotify_watch *watch) | ||
211 | { | ||
212 | return -EOPNOTSUPP; | ||
213 | } | ||
214 | |||
215 | static inline int inotify_rm_wd(struct inotify_handle *ih, __u32 wd) | ||
216 | { | ||
217 | return -EOPNOTSUPP; | ||
218 | } | ||
219 | |||
220 | static inline void inotify_remove_watch_locked(struct inotify_handle *ih, | ||
221 | struct inotify_watch *watch) | ||
222 | { | ||
223 | } | ||
224 | |||
225 | static inline void get_inotify_watch(struct inotify_watch *watch) | ||
226 | { | ||
227 | } | ||
228 | |||
229 | static inline void put_inotify_watch(struct inotify_watch *watch) | ||
230 | { | ||
231 | } | ||
232 | |||
233 | extern inline int pin_inotify_watch(struct inotify_watch *watch) | ||
234 | { | ||
235 | return 0; | ||
236 | } | ||
237 | |||
238 | extern inline void unpin_inotify_watch(struct inotify_watch *watch) | ||
239 | { | ||
240 | } | ||
241 | |||
242 | #endif /* CONFIG_INOTIFY */ | ||
243 | |||
244 | #endif /* __KERNEL __ */ | ||
245 | 86 | ||
246 | #endif /* _LINUX_INOTIFY_H */ | 87 | #endif /* _LINUX_INOTIFY_H */ |
diff --git a/include/linux/input.h b/include/linux/input.h index 339d043ccb53..896a92227bc4 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -776,6 +776,7 @@ struct input_absinfo { | |||
776 | #define REP_DELAY 0x00 | 776 | #define REP_DELAY 0x00 |
777 | #define REP_PERIOD 0x01 | 777 | #define REP_PERIOD 0x01 |
778 | #define REP_MAX 0x01 | 778 | #define REP_MAX 0x01 |
779 | #define REP_CNT (REP_MAX+1) | ||
779 | 780 | ||
780 | /* | 781 | /* |
781 | * Sounds | 782 | * Sounds |
@@ -1099,21 +1100,18 @@ struct input_mt_slot { | |||
1099 | * @repeat_key: stores key code of the last key pressed; used to implement | 1100 | * @repeat_key: stores key code of the last key pressed; used to implement |
1100 | * software autorepeat | 1101 | * software autorepeat |
1101 | * @timer: timer for software autorepeat | 1102 | * @timer: timer for software autorepeat |
1102 | * @abs: current values for reports from absolute axes | ||
1103 | * @rep: current values for autorepeat parameters (delay, rate) | 1103 | * @rep: current values for autorepeat parameters (delay, rate) |
1104 | * @mt: pointer to array of struct input_mt_slot holding current values | 1104 | * @mt: pointer to array of struct input_mt_slot holding current values |
1105 | * of tracked contacts | 1105 | * of tracked contacts |
1106 | * @mtsize: number of MT slots the device uses | 1106 | * @mtsize: number of MT slots the device uses |
1107 | * @slot: MT slot currently being transmitted | 1107 | * @slot: MT slot currently being transmitted |
1108 | * @absinfo: array of &struct absinfo elements holding information | ||
1109 | * about absolute axes (current value, min, max, flat, fuzz, | ||
1110 | * resolution) | ||
1108 | * @key: reflects current state of device's keys/buttons | 1111 | * @key: reflects current state of device's keys/buttons |
1109 | * @led: reflects current state of device's LEDs | 1112 | * @led: reflects current state of device's LEDs |
1110 | * @snd: reflects current state of sound effects | 1113 | * @snd: reflects current state of sound effects |
1111 | * @sw: reflects current state of device's switches | 1114 | * @sw: reflects current state of device's switches |
1112 | * @absmax: maximum values for events coming from absolute axes | ||
1113 | * @absmin: minimum values for events coming from absolute axes | ||
1114 | * @absfuzz: describes noisiness for axes | ||
1115 | * @absflat: size of the center flat position (used by joydev) | ||
1116 | * @absres: resolution used for events coming form absolute axes | ||
1117 | * @open: this method is called when the very first user calls | 1115 | * @open: this method is called when the very first user calls |
1118 | * input_open_device(). The driver must prepare the device | 1116 | * input_open_device(). The driver must prepare the device |
1119 | * to start generating events (start polling thread, | 1117 | * to start generating events (start polling thread, |
@@ -1180,24 +1178,19 @@ struct input_dev { | |||
1180 | unsigned int repeat_key; | 1178 | unsigned int repeat_key; |
1181 | struct timer_list timer; | 1179 | struct timer_list timer; |
1182 | 1180 | ||
1183 | int abs[ABS_CNT]; | 1181 | int rep[REP_CNT]; |
1184 | int rep[REP_MAX + 1]; | ||
1185 | 1182 | ||
1186 | struct input_mt_slot *mt; | 1183 | struct input_mt_slot *mt; |
1187 | int mtsize; | 1184 | int mtsize; |
1188 | int slot; | 1185 | int slot; |
1189 | 1186 | ||
1187 | struct input_absinfo *absinfo; | ||
1188 | |||
1190 | unsigned long key[BITS_TO_LONGS(KEY_CNT)]; | 1189 | unsigned long key[BITS_TO_LONGS(KEY_CNT)]; |
1191 | unsigned long led[BITS_TO_LONGS(LED_CNT)]; | 1190 | unsigned long led[BITS_TO_LONGS(LED_CNT)]; |
1192 | unsigned long snd[BITS_TO_LONGS(SND_CNT)]; | 1191 | unsigned long snd[BITS_TO_LONGS(SND_CNT)]; |
1193 | unsigned long sw[BITS_TO_LONGS(SW_CNT)]; | 1192 | unsigned long sw[BITS_TO_LONGS(SW_CNT)]; |
1194 | 1193 | ||
1195 | int absmax[ABS_CNT]; | ||
1196 | int absmin[ABS_CNT]; | ||
1197 | int absfuzz[ABS_CNT]; | ||
1198 | int absflat[ABS_CNT]; | ||
1199 | int absres[ABS_CNT]; | ||
1200 | |||
1201 | int (*open)(struct input_dev *dev); | 1194 | int (*open)(struct input_dev *dev); |
1202 | void (*close)(struct input_dev *dev); | 1195 | void (*close)(struct input_dev *dev); |
1203 | int (*flush)(struct input_dev *dev, struct file *file); | 1196 | int (*flush)(struct input_dev *dev, struct file *file); |
@@ -1459,16 +1452,32 @@ static inline void input_set_events_per_packet(struct input_dev *dev, int n_even | |||
1459 | dev->hint_events_per_packet = n_events; | 1452 | dev->hint_events_per_packet = n_events; |
1460 | } | 1453 | } |
1461 | 1454 | ||
1462 | static inline void input_set_abs_params(struct input_dev *dev, int axis, int min, int max, int fuzz, int flat) | 1455 | void input_alloc_absinfo(struct input_dev *dev); |
1463 | { | 1456 | void input_set_abs_params(struct input_dev *dev, unsigned int axis, |
1464 | dev->absmin[axis] = min; | 1457 | int min, int max, int fuzz, int flat); |
1465 | dev->absmax[axis] = max; | 1458 | |
1466 | dev->absfuzz[axis] = fuzz; | 1459 | #define INPUT_GENERATE_ABS_ACCESSORS(_suffix, _item) \ |
1467 | dev->absflat[axis] = flat; | 1460 | static inline int input_abs_get_##_suffix(struct input_dev *dev, \ |
1468 | 1461 | unsigned int axis) \ | |
1469 | dev->absbit[BIT_WORD(axis)] |= BIT_MASK(axis); | 1462 | { \ |
1463 | return dev->absinfo ? dev->absinfo[axis]._item : 0; \ | ||
1464 | } \ | ||
1465 | \ | ||
1466 | static inline void input_abs_set_##_suffix(struct input_dev *dev, \ | ||
1467 | unsigned int axis, int val) \ | ||
1468 | { \ | ||
1469 | input_alloc_absinfo(dev); \ | ||
1470 | if (dev->absinfo) \ | ||
1471 | dev->absinfo[axis]._item = val; \ | ||
1470 | } | 1472 | } |
1471 | 1473 | ||
1474 | INPUT_GENERATE_ABS_ACCESSORS(val, value) | ||
1475 | INPUT_GENERATE_ABS_ACCESSORS(min, minimum) | ||
1476 | INPUT_GENERATE_ABS_ACCESSORS(max, maximum) | ||
1477 | INPUT_GENERATE_ABS_ACCESSORS(fuzz, fuzz) | ||
1478 | INPUT_GENERATE_ABS_ACCESSORS(flat, flat) | ||
1479 | INPUT_GENERATE_ABS_ACCESSORS(res, resolution) | ||
1480 | |||
1472 | int input_get_keycode(struct input_dev *dev, | 1481 | int input_get_keycode(struct input_dev *dev, |
1473 | unsigned int scancode, unsigned int *keycode); | 1482 | unsigned int scancode, unsigned int *keycode); |
1474 | int input_set_keycode(struct input_dev *dev, | 1483 | int input_set_keycode(struct input_dev *dev, |
diff --git a/include/linux/intel_mid_dma.h b/include/linux/intel_mid_dma.h new file mode 100644 index 000000000000..d9d08b6269b6 --- /dev/null +++ b/include/linux/intel_mid_dma.h | |||
@@ -0,0 +1,86 @@ | |||
1 | /* | ||
2 | * intel_mid_dma.h - Intel MID DMA Drivers | ||
3 | * | ||
4 | * Copyright (C) 2008-10 Intel Corp | ||
5 | * Author: Vinod Koul <vinod.koul@intel.com> | ||
6 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; version 2 of the License. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, but | ||
13 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
15 | * General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License along | ||
18 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
19 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. | ||
20 | * | ||
21 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
22 | * | ||
23 | * | ||
24 | */ | ||
25 | #ifndef __INTEL_MID_DMA_H__ | ||
26 | #define __INTEL_MID_DMA_H__ | ||
27 | |||
28 | #include <linux/dmaengine.h> | ||
29 | |||
30 | /*DMA transaction width, src and dstn width would be same | ||
31 | The DMA length must be width aligned, | ||
32 | for 32 bit width the length must be 32 bit (4bytes) aligned only*/ | ||
33 | enum intel_mid_dma_width { | ||
34 | LNW_DMA_WIDTH_8BIT = 0x0, | ||
35 | LNW_DMA_WIDTH_16BIT = 0x1, | ||
36 | LNW_DMA_WIDTH_32BIT = 0x2, | ||
37 | }; | ||
38 | |||
39 | /*DMA mode configurations*/ | ||
40 | enum intel_mid_dma_mode { | ||
41 | LNW_DMA_PER_TO_MEM = 0, /*periphral to memory configuration*/ | ||
42 | LNW_DMA_MEM_TO_PER, /*memory to periphral configuration*/ | ||
43 | LNW_DMA_MEM_TO_MEM, /*mem to mem confg (testing only)*/ | ||
44 | }; | ||
45 | |||
46 | /*DMA handshaking*/ | ||
47 | enum intel_mid_dma_hs_mode { | ||
48 | LNW_DMA_HW_HS = 0, /*HW Handshaking only*/ | ||
49 | LNW_DMA_SW_HS = 1, /*SW Handshaking not recommended*/ | ||
50 | }; | ||
51 | |||
52 | /*Burst size configuration*/ | ||
53 | enum intel_mid_dma_msize { | ||
54 | LNW_DMA_MSIZE_1 = 0x0, | ||
55 | LNW_DMA_MSIZE_4 = 0x1, | ||
56 | LNW_DMA_MSIZE_8 = 0x2, | ||
57 | LNW_DMA_MSIZE_16 = 0x3, | ||
58 | LNW_DMA_MSIZE_32 = 0x4, | ||
59 | LNW_DMA_MSIZE_64 = 0x5, | ||
60 | }; | ||
61 | |||
62 | /** | ||
63 | * struct intel_mid_dma_slave - DMA slave structure | ||
64 | * | ||
65 | * @dirn: DMA trf direction | ||
66 | * @src_width: tx register width | ||
67 | * @dst_width: rx register width | ||
68 | * @hs_mode: HW/SW handshaking mode | ||
69 | * @cfg_mode: DMA data transfer mode (per-per/mem-per/mem-mem) | ||
70 | * @src_msize: Source DMA burst size | ||
71 | * @dst_msize: Dst DMA burst size | ||
72 | * @device_instance: DMA peripheral device instance, we can have multiple | ||
73 | * peripheral device connected to single DMAC | ||
74 | */ | ||
75 | struct intel_mid_dma_slave { | ||
76 | enum dma_data_direction dirn; | ||
77 | enum intel_mid_dma_width src_width; /*width of DMA src txn*/ | ||
78 | enum intel_mid_dma_width dst_width; /*width of DMA dst txn*/ | ||
79 | enum intel_mid_dma_hs_mode hs_mode; /*handshaking*/ | ||
80 | enum intel_mid_dma_mode cfg_mode; /*mode configuration*/ | ||
81 | enum intel_mid_dma_msize src_msize; /*size if src burst*/ | ||
82 | enum intel_mid_dma_msize dst_msize; /*size of dst burst*/ | ||
83 | unsigned int device_instance; /*0, 1 for periphral instance*/ | ||
84 | }; | ||
85 | |||
86 | #endif /*__INTEL_MID_DMA_H__*/ | ||
diff --git a/include/linux/iommu-helper.h b/include/linux/iommu-helper.h index 64d1b638745d..86bdeffe43ad 100644 --- a/include/linux/iommu-helper.h +++ b/include/linux/iommu-helper.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef _LINUX_IOMMU_HELPER_H | 1 | #ifndef _LINUX_IOMMU_HELPER_H |
2 | #define _LINUX_IOMMU_HELPER_H | 2 | #define _LINUX_IOMMU_HELPER_H |
3 | 3 | ||
4 | #include <linux/kernel.h> | ||
5 | |||
4 | static inline unsigned long iommu_device_max_index(unsigned long size, | 6 | static inline unsigned long iommu_device_max_index(unsigned long size, |
5 | unsigned long offset, | 7 | unsigned long offset, |
6 | u64 dma_mask) | 8 | u64 dma_mask) |
@@ -20,7 +22,13 @@ extern unsigned long iommu_area_alloc(unsigned long *map, unsigned long size, | |||
20 | unsigned long boundary_size, | 22 | unsigned long boundary_size, |
21 | unsigned long align_mask); | 23 | unsigned long align_mask); |
22 | 24 | ||
23 | extern unsigned long iommu_num_pages(unsigned long addr, unsigned long len, | 25 | static inline unsigned long iommu_num_pages(unsigned long addr, |
24 | unsigned long io_page_size); | 26 | unsigned long len, |
27 | unsigned long io_page_size) | ||
28 | { | ||
29 | unsigned long size = (addr & (io_page_size - 1)) + len; | ||
30 | |||
31 | return DIV_ROUND_UP(size, io_page_size); | ||
32 | } | ||
25 | 33 | ||
26 | #endif | 34 | #endif |
diff --git a/include/linux/istallion.h b/include/linux/istallion.h index 7faca98c7d14..ad700a60c158 100644 --- a/include/linux/istallion.h +++ b/include/linux/istallion.h | |||
@@ -86,7 +86,7 @@ struct stlibrd { | |||
86 | unsigned long magic; | 86 | unsigned long magic; |
87 | unsigned int brdnr; | 87 | unsigned int brdnr; |
88 | unsigned int brdtype; | 88 | unsigned int brdtype; |
89 | unsigned int state; | 89 | unsigned long state; |
90 | unsigned int nrpanels; | 90 | unsigned int nrpanels; |
91 | unsigned int nrports; | 91 | unsigned int nrports; |
92 | unsigned int nrdevs; | 92 | unsigned int nrdevs; |
diff --git a/include/linux/jffs2.h b/include/linux/jffs2.h index edb9231f1898..a18b719f49d4 100644 --- a/include/linux/jffs2.h +++ b/include/linux/jffs2.h | |||
@@ -1,7 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * JFFS2 -- Journalling Flash File System, Version 2. | 2 | * JFFS2 -- Journalling Flash File System, Version 2. |
3 | * | 3 | * |
4 | * Copyright (C) 2001-2003 Red Hat, Inc. | 4 | * Copyright © 2001-2007 Red Hat, Inc. |
5 | * Copyright © 2004-2010 David Woodhouse <dwmw2@infradead.org> | ||
5 | * | 6 | * |
6 | * Created by David Woodhouse <dwmw2@infradead.org> | 7 | * Created by David Woodhouse <dwmw2@infradead.org> |
7 | * | 8 | * |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 7d5b10ff63e0..5b57236dfbd0 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -616,17 +616,6 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { } | |||
616 | #endif /* CONFIG_TRACING */ | 616 | #endif /* CONFIG_TRACING */ |
617 | 617 | ||
618 | /* | 618 | /* |
619 | * Display an IP address in readable format. | ||
620 | */ | ||
621 | |||
622 | #define NIPQUAD(addr) \ | ||
623 | ((unsigned char *)&addr)[0], \ | ||
624 | ((unsigned char *)&addr)[1], \ | ||
625 | ((unsigned char *)&addr)[2], \ | ||
626 | ((unsigned char *)&addr)[3] | ||
627 | #define NIPQUAD_FMT "%u.%u.%u.%u" | ||
628 | |||
629 | /* | ||
630 | * min()/max()/clamp() macros that also do | 619 | * min()/max()/clamp() macros that also do |
631 | * strict type-checking.. See the | 620 | * strict type-checking.. See the |
632 | * "unnecessary" pointer comparison. | 621 | * "unnecessary" pointer comparison. |
diff --git a/include/linux/ksm.h b/include/linux/ksm.h index 43bdab769fc3..74d691ee9121 100644 --- a/include/linux/ksm.h +++ b/include/linux/ksm.h | |||
@@ -78,7 +78,7 @@ static inline struct page *ksm_might_need_to_copy(struct page *page, | |||
78 | struct anon_vma *anon_vma = page_anon_vma(page); | 78 | struct anon_vma *anon_vma = page_anon_vma(page); |
79 | 79 | ||
80 | if (!anon_vma || | 80 | if (!anon_vma || |
81 | (anon_vma == vma->anon_vma && | 81 | (anon_vma->root == vma->anon_vma->root && |
82 | page->index == linear_page_index(vma, address))) | 82 | page->index == linear_page_index(vma, address))) |
83 | return page; | 83 | return page; |
84 | 84 | ||
diff --git a/include/linux/list.h b/include/linux/list.h index 5d57a3a1fa1b..d167b5d7c0ac 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef _LINUX_LIST_H | 1 | #ifndef _LINUX_LIST_H |
2 | #define _LINUX_LIST_H | 2 | #define _LINUX_LIST_H |
3 | 3 | ||
4 | #include <linux/types.h> | ||
4 | #include <linux/stddef.h> | 5 | #include <linux/stddef.h> |
5 | #include <linux/poison.h> | 6 | #include <linux/poison.h> |
6 | #include <linux/prefetch.h> | 7 | #include <linux/prefetch.h> |
@@ -16,10 +17,6 @@ | |||
16 | * using the generic single-entry routines. | 17 | * using the generic single-entry routines. |
17 | */ | 18 | */ |
18 | 19 | ||
19 | struct list_head { | ||
20 | struct list_head *next, *prev; | ||
21 | }; | ||
22 | |||
23 | #define LIST_HEAD_INIT(name) { &(name), &(name) } | 20 | #define LIST_HEAD_INIT(name) { &(name), &(name) } |
24 | 21 | ||
25 | #define LIST_HEAD(name) \ | 22 | #define LIST_HEAD(name) \ |
@@ -566,14 +563,6 @@ static inline void list_splice_tail_init(struct list_head *list, | |||
566 | * You lose the ability to access the tail in O(1). | 563 | * You lose the ability to access the tail in O(1). |
567 | */ | 564 | */ |
568 | 565 | ||
569 | struct hlist_head { | ||
570 | struct hlist_node *first; | ||
571 | }; | ||
572 | |||
573 | struct hlist_node { | ||
574 | struct hlist_node *next, **pprev; | ||
575 | }; | ||
576 | |||
577 | #define HLIST_HEAD_INIT { .first = NULL } | 566 | #define HLIST_HEAD_INIT { .first = NULL } |
578 | #define HLIST_HEAD(name) struct hlist_head name = { .first = NULL } | 567 | #define HLIST_HEAD(name) struct hlist_head name = { .first = NULL } |
579 | #define INIT_HLIST_HEAD(ptr) ((ptr)->first = NULL) | 568 | #define INIT_HLIST_HEAD(ptr) ((ptr)->first = NULL) |
diff --git a/include/linux/mbcache.h b/include/linux/mbcache.h index a09b84e4fdb4..54cbbac1e71d 100644 --- a/include/linux/mbcache.h +++ b/include/linux/mbcache.h | |||
@@ -4,9 +4,6 @@ | |||
4 | (C) 2001 by Andreas Gruenbacher, <a.gruenbacher@computer.org> | 4 | (C) 2001 by Andreas Gruenbacher, <a.gruenbacher@computer.org> |
5 | */ | 5 | */ |
6 | 6 | ||
7 | /* Hardwire the number of additional indexes */ | ||
8 | #define MB_CACHE_INDEXES_COUNT 1 | ||
9 | |||
10 | struct mb_cache_entry { | 7 | struct mb_cache_entry { |
11 | struct list_head e_lru_list; | 8 | struct list_head e_lru_list; |
12 | struct mb_cache *e_cache; | 9 | struct mb_cache *e_cache; |
@@ -18,17 +15,12 @@ struct mb_cache_entry { | |||
18 | struct { | 15 | struct { |
19 | struct list_head o_list; | 16 | struct list_head o_list; |
20 | unsigned int o_key; | 17 | unsigned int o_key; |
21 | } e_indexes[0]; | 18 | } e_index; |
22 | }; | ||
23 | |||
24 | struct mb_cache_op { | ||
25 | int (*free)(struct mb_cache_entry *, gfp_t); | ||
26 | }; | 19 | }; |
27 | 20 | ||
28 | /* Functions on caches */ | 21 | /* Functions on caches */ |
29 | 22 | ||
30 | struct mb_cache * mb_cache_create(const char *, struct mb_cache_op *, size_t, | 23 | struct mb_cache *mb_cache_create(const char *, int); |
31 | int, int); | ||
32 | void mb_cache_shrink(struct block_device *); | 24 | void mb_cache_shrink(struct block_device *); |
33 | void mb_cache_destroy(struct mb_cache *); | 25 | void mb_cache_destroy(struct mb_cache *); |
34 | 26 | ||
@@ -36,17 +28,15 @@ void mb_cache_destroy(struct mb_cache *); | |||
36 | 28 | ||
37 | struct mb_cache_entry *mb_cache_entry_alloc(struct mb_cache *, gfp_t); | 29 | struct mb_cache_entry *mb_cache_entry_alloc(struct mb_cache *, gfp_t); |
38 | int mb_cache_entry_insert(struct mb_cache_entry *, struct block_device *, | 30 | int mb_cache_entry_insert(struct mb_cache_entry *, struct block_device *, |
39 | sector_t, unsigned int[]); | 31 | sector_t, unsigned int); |
40 | void mb_cache_entry_release(struct mb_cache_entry *); | 32 | void mb_cache_entry_release(struct mb_cache_entry *); |
41 | void mb_cache_entry_free(struct mb_cache_entry *); | 33 | void mb_cache_entry_free(struct mb_cache_entry *); |
42 | struct mb_cache_entry *mb_cache_entry_get(struct mb_cache *, | 34 | struct mb_cache_entry *mb_cache_entry_get(struct mb_cache *, |
43 | struct block_device *, | 35 | struct block_device *, |
44 | sector_t); | 36 | sector_t); |
45 | #if !defined(MB_CACHE_INDEXES_COUNT) || (MB_CACHE_INDEXES_COUNT > 0) | 37 | struct mb_cache_entry *mb_cache_entry_find_first(struct mb_cache *cache, |
46 | struct mb_cache_entry *mb_cache_entry_find_first(struct mb_cache *cache, int, | ||
47 | struct block_device *, | 38 | struct block_device *, |
48 | unsigned int); | 39 | unsigned int); |
49 | struct mb_cache_entry *mb_cache_entry_find_next(struct mb_cache_entry *, int, | 40 | struct mb_cache_entry *mb_cache_entry_find_next(struct mb_cache_entry *, |
50 | struct block_device *, | 41 | struct block_device *, |
51 | unsigned int); | 42 | unsigned int); |
52 | #endif | ||
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 9411d32840b0..73564cac38c7 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -98,11 +98,6 @@ extern void mem_cgroup_end_migration(struct mem_cgroup *mem, | |||
98 | /* | 98 | /* |
99 | * For memory reclaim. | 99 | * For memory reclaim. |
100 | */ | 100 | */ |
101 | extern int mem_cgroup_get_reclaim_priority(struct mem_cgroup *mem); | ||
102 | extern void mem_cgroup_note_reclaim_priority(struct mem_cgroup *mem, | ||
103 | int priority); | ||
104 | extern void mem_cgroup_record_reclaim_priority(struct mem_cgroup *mem, | ||
105 | int priority); | ||
106 | int mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg); | 101 | int mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg); |
107 | int mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg); | 102 | int mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg); |
108 | unsigned long mem_cgroup_zone_nr_pages(struct mem_cgroup *memcg, | 103 | unsigned long mem_cgroup_zone_nr_pages(struct mem_cgroup *memcg, |
@@ -130,6 +125,8 @@ void mem_cgroup_update_file_mapped(struct page *page, int val); | |||
130 | unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order, | 125 | unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order, |
131 | gfp_t gfp_mask, int nid, | 126 | gfp_t gfp_mask, int nid, |
132 | int zid); | 127 | int zid); |
128 | u64 mem_cgroup_get_limit(struct mem_cgroup *mem); | ||
129 | |||
133 | #else /* CONFIG_CGROUP_MEM_RES_CTLR */ | 130 | #else /* CONFIG_CGROUP_MEM_RES_CTLR */ |
134 | struct mem_cgroup; | 131 | struct mem_cgroup; |
135 | 132 | ||
@@ -309,6 +306,12 @@ unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order, | |||
309 | return 0; | 306 | return 0; |
310 | } | 307 | } |
311 | 308 | ||
309 | static inline | ||
310 | u64 mem_cgroup_get_limit(struct mem_cgroup *mem) | ||
311 | { | ||
312 | return 0; | ||
313 | } | ||
314 | |||
312 | #endif /* CONFIG_CGROUP_MEM_CONT */ | 315 | #endif /* CONFIG_CGROUP_MEM_CONT */ |
313 | 316 | ||
314 | #endif /* _LINUX_MEMCONTROL_H */ | 317 | #endif /* _LINUX_MEMCONTROL_H */ |
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h index 7b9ef6bf45aa..31ac26ca4acf 100644 --- a/include/linux/mempolicy.h +++ b/include/linux/mempolicy.h | |||
@@ -210,6 +210,8 @@ extern struct zonelist *huge_zonelist(struct vm_area_struct *vma, | |||
210 | unsigned long addr, gfp_t gfp_flags, | 210 | unsigned long addr, gfp_t gfp_flags, |
211 | struct mempolicy **mpol, nodemask_t **nodemask); | 211 | struct mempolicy **mpol, nodemask_t **nodemask); |
212 | extern bool init_nodemask_of_mempolicy(nodemask_t *mask); | 212 | extern bool init_nodemask_of_mempolicy(nodemask_t *mask); |
213 | extern bool mempolicy_nodemask_intersects(struct task_struct *tsk, | ||
214 | const nodemask_t *mask); | ||
213 | extern unsigned slab_node(struct mempolicy *policy); | 215 | extern unsigned slab_node(struct mempolicy *policy); |
214 | 216 | ||
215 | extern enum zone_type policy_zone; | 217 | extern enum zone_type policy_zone; |
@@ -338,7 +340,16 @@ static inline struct zonelist *huge_zonelist(struct vm_area_struct *vma, | |||
338 | return node_zonelist(0, gfp_flags); | 340 | return node_zonelist(0, gfp_flags); |
339 | } | 341 | } |
340 | 342 | ||
341 | static inline bool init_nodemask_of_mempolicy(nodemask_t *m) { return false; } | 343 | static inline bool init_nodemask_of_mempolicy(nodemask_t *m) |
344 | { | ||
345 | return false; | ||
346 | } | ||
347 | |||
348 | static inline bool mempolicy_nodemask_intersects(struct task_struct *tsk, | ||
349 | const nodemask_t *mask) | ||
350 | { | ||
351 | return false; | ||
352 | } | ||
342 | 353 | ||
343 | static inline int do_migrate_pages(struct mm_struct *mm, | 354 | static inline int do_migrate_pages(struct mm_struct *mm, |
344 | const nodemask_t *from_nodes, | 355 | const nodemask_t *from_nodes, |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 7a9ab7db1975..709f6728fc90 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -815,6 +815,7 @@ static inline void unmap_shared_mapping_range(struct address_space *mapping, | |||
815 | } | 815 | } |
816 | 816 | ||
817 | extern void truncate_pagecache(struct inode *inode, loff_t old, loff_t new); | 817 | extern void truncate_pagecache(struct inode *inode, loff_t old, loff_t new); |
818 | extern void truncate_setsize(struct inode *inode, loff_t newsize); | ||
818 | extern int vmtruncate(struct inode *inode, loff_t offset); | 819 | extern int vmtruncate(struct inode *inode, loff_t offset); |
819 | extern int vmtruncate_range(struct inode *inode, loff_t offset, loff_t end); | 820 | extern int vmtruncate_range(struct inode *inode, loff_t offset, loff_t end); |
820 | 821 | ||
diff --git a/include/linux/mmdebug.h b/include/linux/mmdebug.h index ee24ef8ab616..c04ecfe03f7f 100644 --- a/include/linux/mmdebug.h +++ b/include/linux/mmdebug.h | |||
@@ -4,7 +4,7 @@ | |||
4 | #ifdef CONFIG_DEBUG_VM | 4 | #ifdef CONFIG_DEBUG_VM |
5 | #define VM_BUG_ON(cond) BUG_ON(cond) | 5 | #define VM_BUG_ON(cond) BUG_ON(cond) |
6 | #else | 6 | #else |
7 | #define VM_BUG_ON(cond) do { } while (0) | 7 | #define VM_BUG_ON(cond) do { (void)(cond); } while (0) |
8 | #endif | 8 | #endif |
9 | 9 | ||
10 | #ifdef CONFIG_DEBUG_VIRTUAL | 10 | #ifdef CONFIG_DEBUG_VIRTUAL |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index b4d109e389b8..6e6e62648a4d 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -348,21 +348,6 @@ struct zone { | |||
348 | atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS]; | 348 | atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS]; |
349 | 349 | ||
350 | /* | 350 | /* |
351 | * prev_priority holds the scanning priority for this zone. It is | ||
352 | * defined as the scanning priority at which we achieved our reclaim | ||
353 | * target at the previous try_to_free_pages() or balance_pgdat() | ||
354 | * invocation. | ||
355 | * | ||
356 | * We use prev_priority as a measure of how much stress page reclaim is | ||
357 | * under - it drives the swappiness decision: whether to unmap mapped | ||
358 | * pages. | ||
359 | * | ||
360 | * Access to both this field is quite racy even on uniprocessor. But | ||
361 | * it is expected to average out OK. | ||
362 | */ | ||
363 | int prev_priority; | ||
364 | |||
365 | /* | ||
366 | * The target ratio of ACTIVE_ANON to INACTIVE_ANON pages on | 351 | * The target ratio of ACTIVE_ANON to INACTIVE_ANON pages on |
367 | * this zone's LRU. Maintained by the pageout code. | 352 | * this zone's LRU. Maintained by the pageout code. |
368 | */ | 353 | */ |
@@ -651,8 +636,6 @@ typedef struct pglist_data { | |||
651 | #include <linux/memory_hotplug.h> | 636 | #include <linux/memory_hotplug.h> |
652 | 637 | ||
653 | extern struct mutex zonelists_mutex; | 638 | extern struct mutex zonelists_mutex; |
654 | void get_zone_counts(unsigned long *active, unsigned long *inactive, | ||
655 | unsigned long *free); | ||
656 | void build_all_zonelists(void *data); | 639 | void build_all_zonelists(void *data); |
657 | void wakeup_kswapd(struct zone *zone, int order); | 640 | void wakeup_kswapd(struct zone *zone, int order); |
658 | int zone_watermark_ok(struct zone *z, int order, unsigned long mark, | 641 | int zone_watermark_ok(struct zone *z, int order, unsigned long mark, |
diff --git a/include/linux/mount.h b/include/linux/mount.h index 4bd05474d11d..907210bd9f9c 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h | |||
@@ -56,7 +56,11 @@ struct vfsmount { | |||
56 | struct list_head mnt_mounts; /* list of children, anchored here */ | 56 | struct list_head mnt_mounts; /* list of children, anchored here */ |
57 | struct list_head mnt_child; /* and going through their mnt_child */ | 57 | struct list_head mnt_child; /* and going through their mnt_child */ |
58 | int mnt_flags; | 58 | int mnt_flags; |
59 | /* 4 bytes hole on 64bits arches */ | 59 | /* 4 bytes hole on 64bits arches without fsnotify */ |
60 | #ifdef CONFIG_FSNOTIFY | ||
61 | __u32 mnt_fsnotify_mask; | ||
62 | struct hlist_head mnt_fsnotify_marks; | ||
63 | #endif | ||
60 | const char *mnt_devname; /* Name of device e.g. /dev/dsk/hda1 */ | 64 | const char *mnt_devname; /* Name of device e.g. /dev/dsk/hda1 */ |
61 | struct list_head mnt_list; | 65 | struct list_head mnt_list; |
62 | struct list_head mnt_expire; /* link in fs-specific expiry list */ | 66 | struct list_head mnt_expire; /* link in fs-specific expiry list */ |
diff --git a/include/linux/mtd/bbm.h b/include/linux/mtd/bbm.h index 9c3757c5759d..7fa20beb2ab9 100644 --- a/include/linux/mtd/bbm.h +++ b/include/linux/mtd/bbm.h | |||
@@ -4,12 +4,26 @@ | |||
4 | * NAND family Bad Block Management (BBM) header file | 4 | * NAND family Bad Block Management (BBM) header file |
5 | * - Bad Block Table (BBT) implementation | 5 | * - Bad Block Table (BBT) implementation |
6 | * | 6 | * |
7 | * Copyright (c) 2005 Samsung Electronics | 7 | * Copyright © 2005 Samsung Electronics |
8 | * Kyungmin Park <kyungmin.park@samsung.com> | 8 | * Kyungmin Park <kyungmin.park@samsung.com> |
9 | * | 9 | * |
10 | * Copyright (c) 2000-2005 | 10 | * Copyright © 2000-2005 |
11 | * Thomas Gleixner <tglx@linuxtronix.de> | 11 | * Thomas Gleixner <tglx@linuxtronix.de> |
12 | * | 12 | * |
13 | * This program is free software; you can redistribute it and/or modify | ||
14 | * it under the terms of the GNU General Public License as published by | ||
15 | * the Free Software Foundation; either version 2 of the License, or | ||
16 | * (at your option) any later version. | ||
17 | * | ||
18 | * This program is distributed in the hope that it will be useful, | ||
19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
21 | * GNU General Public License for more details. | ||
22 | * | ||
23 | * You should have received a copy of the GNU General Public License | ||
24 | * along with this program; if not, write to the Free Software | ||
25 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
26 | * | ||
13 | */ | 27 | */ |
14 | #ifndef __LINUX_MTD_BBM_H | 28 | #ifndef __LINUX_MTD_BBM_H |
15 | #define __LINUX_MTD_BBM_H | 29 | #define __LINUX_MTD_BBM_H |
@@ -82,6 +96,12 @@ struct nand_bbt_descr { | |||
82 | #define NAND_BBT_SAVECONTENT 0x00002000 | 96 | #define NAND_BBT_SAVECONTENT 0x00002000 |
83 | /* Search good / bad pattern on the first and the second page */ | 97 | /* Search good / bad pattern on the first and the second page */ |
84 | #define NAND_BBT_SCAN2NDPAGE 0x00004000 | 98 | #define NAND_BBT_SCAN2NDPAGE 0x00004000 |
99 | /* Search good / bad pattern on the last page of the eraseblock */ | ||
100 | #define NAND_BBT_SCANLASTPAGE 0x00008000 | ||
101 | /* Chip stores bad block marker on BOTH 1st and 6th bytes of OOB */ | ||
102 | #define NAND_BBT_SCANBYTE1AND6 0x00100000 | ||
103 | /* The nand_bbt_descr was created dynamicaly and must be freed */ | ||
104 | #define NAND_BBT_DYNAMICSTRUCT 0x00200000 | ||
85 | 105 | ||
86 | /* The maximum number of blocks to scan for a bbt */ | 106 | /* The maximum number of blocks to scan for a bbt */ |
87 | #define NAND_BBT_SCAN_MAXBLOCKS 4 | 107 | #define NAND_BBT_SCAN_MAXBLOCKS 4 |
diff --git a/include/linux/mtd/blktrans.h b/include/linux/mtd/blktrans.h index b481ccd7ff3c..26529ebd59cc 100644 --- a/include/linux/mtd/blktrans.h +++ b/include/linux/mtd/blktrans.h | |||
@@ -1,7 +1,19 @@ | |||
1 | /* | 1 | /* |
2 | * (C) 2003 David Woodhouse <dwmw2@infradead.org> | 2 | * Copyright © 2003-2010 David Woodhouse <dwmw2@infradead.org> |
3 | * | 3 | * |
4 | * Interface to Linux block layer for MTD 'translation layers'. | 4 | * This program is free software; you can redistribute it and/or modify |
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
5 | * | 17 | * |
6 | */ | 18 | */ |
7 | 19 | ||
diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h index 574d9ee066f1..d2118b0eac9a 100644 --- a/include/linux/mtd/cfi.h +++ b/include/linux/mtd/cfi.h | |||
@@ -1,6 +1,20 @@ | |||
1 | 1 | /* | |
2 | /* Common Flash Interface structures | 2 | * Copyright © 2000-2010 David Woodhouse <dwmw2@infradead.org> et al. |
3 | * See http://support.intel.com/design/flash/technote/index.htm | 3 | * |
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
17 | * | ||
4 | */ | 18 | */ |
5 | 19 | ||
6 | #ifndef __MTD_CFI_H__ | 20 | #ifndef __MTD_CFI_H__ |
diff --git a/include/linux/mtd/cfi_endian.h b/include/linux/mtd/cfi_endian.h index d802f7736be3..51cc3f5917a8 100644 --- a/include/linux/mtd/cfi_endian.h +++ b/include/linux/mtd/cfi_endian.h | |||
@@ -1,3 +1,22 @@ | |||
1 | /* | ||
2 | * Copyright © 2001-2010 David Woodhouse <dwmw2@infradead.org> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
17 | * | ||
18 | */ | ||
19 | |||
1 | #include <asm/byteorder.h> | 20 | #include <asm/byteorder.h> |
2 | 21 | ||
3 | #ifndef CONFIG_MTD_CFI_ADV_OPTIONS | 22 | #ifndef CONFIG_MTD_CFI_ADV_OPTIONS |
diff --git a/include/linux/mtd/compatmac.h b/include/linux/mtd/compatmac.h deleted file mode 100644 index 7d1300d9bd51..000000000000 --- a/include/linux/mtd/compatmac.h +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | |||
2 | #ifndef __LINUX_MTD_COMPATMAC_H__ | ||
3 | #define __LINUX_MTD_COMPATMAC_H__ | ||
4 | |||
5 | /* Nothing to see here. We write 2.5-compatible code and this | ||
6 | file makes it all OK in older kernels, but it's empty in _current_ | ||
7 | kernels. Include guard just to make GCC ignore it in future inclusions | ||
8 | anyway... */ | ||
9 | |||
10 | #endif /* __LINUX_MTD_COMPATMAC_H__ */ | ||
diff --git a/include/linux/mtd/concat.h b/include/linux/mtd/concat.h index e80c674daeb3..ccdbe93a909c 100644 --- a/include/linux/mtd/concat.h +++ b/include/linux/mtd/concat.h | |||
@@ -1,9 +1,22 @@ | |||
1 | /* | 1 | /* |
2 | * MTD device concatenation layer definitions | 2 | * MTD device concatenation layer definitions |
3 | * | 3 | * |
4 | * (C) 2002 Robert Kaiser <rkaiser@sysgo.de> | 4 | * Copyright © 2002 Robert Kaiser <rkaiser@sysgo.de> |
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 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
5 | * | 19 | * |
6 | * This code is GPL | ||
7 | */ | 20 | */ |
8 | 21 | ||
9 | #ifndef MTD_CONCAT_H | 22 | #ifndef MTD_CONCAT_H |
diff --git a/include/linux/mtd/doc2000.h b/include/linux/mtd/doc2000.h index 0a6d516ab71d..0f6fea73a1f6 100644 --- a/include/linux/mtd/doc2000.h +++ b/include/linux/mtd/doc2000.h | |||
@@ -1,12 +1,25 @@ | |||
1 | /* | 1 | /* |
2 | * Linux driver for Disk-On-Chip devices | 2 | * Linux driver for Disk-On-Chip devices |
3 | * | 3 | * |
4 | * Copyright (C) 1999 Machine Vision Holdings, Inc. | 4 | * Copyright © 1999 Machine Vision Holdings, Inc. |
5 | * Copyright (C) 2001-2003 David Woodhouse <dwmw2@infradead.org> | 5 | * Copyright © 1999-2010 David Woodhouse <dwmw2@infradead.org> |
6 | * Copyright (C) 2002-2003 Greg Ungerer <gerg@snapgear.com> | 6 | * Copyright © 2002-2003 Greg Ungerer <gerg@snapgear.com> |
7 | * Copyright (C) 2002-2003 SnapGear Inc | 7 | * Copyright © 2002-2003 SnapGear Inc |
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License as published by | ||
11 | * the Free Software Foundation; either version 2 of the License, or | ||
12 | * (at your option) any later version. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, | ||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
17 | * GNU General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this program; if not, write to the Free Software | ||
21 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
8 | * | 22 | * |
9 | * Released under GPL | ||
10 | */ | 23 | */ |
11 | 24 | ||
12 | #ifndef __MTD_DOC2000_H__ | 25 | #ifndef __MTD_DOC2000_H__ |
diff --git a/include/linux/mtd/flashchip.h b/include/linux/mtd/flashchip.h index f43e9b49b751..b63fa457febd 100644 --- a/include/linux/mtd/flashchip.h +++ b/include/linux/mtd/flashchip.h | |||
@@ -1,10 +1,21 @@ | |||
1 | |||
2 | /* | 1 | /* |
3 | * struct flchip definition | 2 | * Copyright © 2000 Red Hat UK Limited |
3 | * Copyright © 2000-2010 David Woodhouse <dwmw2@infradead.org> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
4 | * | 14 | * |
5 | * Contains information about the location and state of a given flash device | 15 | * You should have received a copy of the GNU General Public License |
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
6 | * | 18 | * |
7 | * (C) 2000 Red Hat. GPLd. | ||
8 | */ | 19 | */ |
9 | 20 | ||
10 | #ifndef __MTD_FLASHCHIP_H__ | 21 | #ifndef __MTD_FLASHCHIP_H__ |
@@ -92,7 +103,7 @@ struct flchip { | |||
92 | /* This is used to handle contention on write/erase operations | 103 | /* This is used to handle contention on write/erase operations |
93 | between partitions of the same physical chip. */ | 104 | between partitions of the same physical chip. */ |
94 | struct flchip_shared { | 105 | struct flchip_shared { |
95 | spinlock_t lock; | 106 | struct mutex lock; |
96 | struct flchip *writing; | 107 | struct flchip *writing; |
97 | struct flchip *erasing; | 108 | struct flchip *erasing; |
98 | }; | 109 | }; |
diff --git a/include/linux/mtd/gen_probe.h b/include/linux/mtd/gen_probe.h index df362ddf2949..2c456054fded 100644 --- a/include/linux/mtd/gen_probe.h +++ b/include/linux/mtd/gen_probe.h | |||
@@ -1,6 +1,21 @@ | |||
1 | /* | 1 | /* |
2 | * (C) 2001, 2001 Red Hat, Inc. | 2 | * Copyright © 2001 Red Hat UK Limited |
3 | * GPL'd | 3 | * Copyright © 2001-2010 David Woodhouse <dwmw2@infradead.org> |
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
18 | * | ||
4 | */ | 19 | */ |
5 | 20 | ||
6 | #ifndef __LINUX_MTD_GEN_PROBE_H__ | 21 | #ifndef __LINUX_MTD_GEN_PROBE_H__ |
diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h index de89eca864ce..a9e6ba46865e 100644 --- a/include/linux/mtd/map.h +++ b/include/linux/mtd/map.h | |||
@@ -1,3 +1,21 @@ | |||
1 | /* | ||
2 | * Copyright © 2000-2010 David Woodhouse <dwmw2@infradead.org> et al. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
17 | * | ||
18 | */ | ||
1 | 19 | ||
2 | /* Overhauled routines for dealing with different mmap regions of flash */ | 20 | /* Overhauled routines for dealing with different mmap regions of flash */ |
3 | 21 | ||
@@ -9,7 +27,6 @@ | |||
9 | #include <linux/string.h> | 27 | #include <linux/string.h> |
10 | #include <linux/bug.h> | 28 | #include <linux/bug.h> |
11 | 29 | ||
12 | #include <linux/mtd/compatmac.h> | ||
13 | 30 | ||
14 | #include <asm/unaligned.h> | 31 | #include <asm/unaligned.h> |
15 | #include <asm/system.h> | 32 | #include <asm/system.h> |
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 5326435a7571..8485e42a9b09 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
@@ -1,7 +1,20 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 1999-2003 David Woodhouse <dwmw2@infradead.org> et al. | 2 | * Copyright © 1999-2010 David Woodhouse <dwmw2@infradead.org> et al. |
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
3 | * | 17 | * |
4 | * Released under GPL | ||
5 | */ | 18 | */ |
6 | 19 | ||
7 | #ifndef __MTD_MTD_H__ | 20 | #ifndef __MTD_MTD_H__ |
@@ -13,7 +26,6 @@ | |||
13 | #include <linux/notifier.h> | 26 | #include <linux/notifier.h> |
14 | #include <linux/device.h> | 27 | #include <linux/device.h> |
15 | 28 | ||
16 | #include <linux/mtd/compatmac.h> | ||
17 | #include <mtd/mtd-abi.h> | 29 | #include <mtd/mtd-abi.h> |
18 | 30 | ||
19 | #include <asm/div64.h> | 31 | #include <asm/div64.h> |
@@ -216,6 +228,7 @@ struct mtd_info { | |||
216 | /* Chip-supported device locking */ | 228 | /* Chip-supported device locking */ |
217 | int (*lock) (struct mtd_info *mtd, loff_t ofs, uint64_t len); | 229 | int (*lock) (struct mtd_info *mtd, loff_t ofs, uint64_t len); |
218 | int (*unlock) (struct mtd_info *mtd, loff_t ofs, uint64_t len); | 230 | int (*unlock) (struct mtd_info *mtd, loff_t ofs, uint64_t len); |
231 | int (*is_locked) (struct mtd_info *mtd, loff_t ofs, uint64_t len); | ||
219 | 232 | ||
220 | /* Power Management functions */ | 233 | /* Power Management functions */ |
221 | int (*suspend) (struct mtd_info *mtd); | 234 | int (*suspend) (struct mtd_info *mtd); |
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index a81b185e23a7..102e12c58cb3 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
@@ -1,9 +1,9 @@ | |||
1 | /* | 1 | /* |
2 | * linux/include/linux/mtd/nand.h | 2 | * linux/include/linux/mtd/nand.h |
3 | * | 3 | * |
4 | * Copyright (c) 2000 David Woodhouse <dwmw2@infradead.org> | 4 | * Copyright © 2000-2010 David Woodhouse <dwmw2@infradead.org> |
5 | * Steven J. Hill <sjhill@realitydiluted.com> | 5 | * Steven J. Hill <sjhill@realitydiluted.com> |
6 | * Thomas Gleixner <tglx@linutronix.de> | 6 | * Thomas Gleixner <tglx@linutronix.de> |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License version 2 as | 9 | * it under the terms of the GNU General Public License version 2 as |
@@ -181,8 +181,6 @@ typedef enum { | |||
181 | #define NAND_NO_READRDY 0x00000100 | 181 | #define NAND_NO_READRDY 0x00000100 |
182 | /* Chip does not allow subpage writes */ | 182 | /* Chip does not allow subpage writes */ |
183 | #define NAND_NO_SUBPAGE_WRITE 0x00000200 | 183 | #define NAND_NO_SUBPAGE_WRITE 0x00000200 |
184 | /* Chip stores bad block marker on the last page of the eraseblock */ | ||
185 | #define NAND_BB_LAST_PAGE 0x00000400 | ||
186 | 184 | ||
187 | /* Device is one of 'new' xD cards that expose fake nand command set */ | 185 | /* Device is one of 'new' xD cards that expose fake nand command set */ |
188 | #define NAND_BROKEN_XD 0x00000400 | 186 | #define NAND_BROKEN_XD 0x00000400 |
diff --git a/include/linux/mtd/nand_ecc.h b/include/linux/mtd/nand_ecc.h index 41bc013571d0..4d8406c81652 100644 --- a/include/linux/mtd/nand_ecc.h +++ b/include/linux/mtd/nand_ecc.h | |||
@@ -1,7 +1,9 @@ | |||
1 | /* | 1 | /* |
2 | * drivers/mtd/nand_ecc.h | 2 | * drivers/mtd/nand_ecc.h |
3 | * | 3 | * |
4 | * Copyright (C) 2000 Steven J. Hill (sjhill@realitydiluted.com) | 4 | * Copyright (C) 2000-2010 Steven J. Hill <sjhill@realitydiluted.com> |
5 | * David Woodhouse <dwmw2@infradead.org> | ||
6 | * Thomas Gleixner <tglx@linutronix.de> | ||
5 | * | 7 | * |
6 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License version 2 as | 9 | * it under the terms of the GNU General Public License version 2 as |
diff --git a/include/linux/mtd/nftl.h b/include/linux/mtd/nftl.h index dcaf611ed748..b059629e22bc 100644 --- a/include/linux/mtd/nftl.h +++ b/include/linux/mtd/nftl.h | |||
@@ -1,5 +1,20 @@ | |||
1 | /* | 1 | /* |
2 | * (C) 1999-2003 David Woodhouse <dwmw2@infradead.org> | 2 | * Copyright © 1999-2010 David Woodhouse <dwmw2@infradead.org> |
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
17 | * | ||
3 | */ | 18 | */ |
4 | 19 | ||
5 | #ifndef __MTD_NFTL_H__ | 20 | #ifndef __MTD_NFTL_H__ |
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h index c26ff86ad08a..0c8815bfae1c 100644 --- a/include/linux/mtd/onenand.h +++ b/include/linux/mtd/onenand.h | |||
@@ -68,6 +68,7 @@ struct onenand_bufferram { | |||
68 | * @write_word: [REPLACEABLE] hardware specific function for write | 68 | * @write_word: [REPLACEABLE] hardware specific function for write |
69 | * register of OneNAND | 69 | * register of OneNAND |
70 | * @mmcontrol: sync burst read function | 70 | * @mmcontrol: sync burst read function |
71 | * @chip_probe: [REPLACEABLE] hardware specific function for chip probe | ||
71 | * @block_markbad: function to mark a block as bad | 72 | * @block_markbad: function to mark a block as bad |
72 | * @scan_bbt: [REPLACEALBE] hardware specific function for scanning | 73 | * @scan_bbt: [REPLACEALBE] hardware specific function for scanning |
73 | * Bad block Table | 74 | * Bad block Table |
@@ -114,6 +115,7 @@ struct onenand_chip { | |||
114 | unsigned short (*read_word)(void __iomem *addr); | 115 | unsigned short (*read_word)(void __iomem *addr); |
115 | void (*write_word)(unsigned short value, void __iomem *addr); | 116 | void (*write_word)(unsigned short value, void __iomem *addr); |
116 | void (*mmcontrol)(struct mtd_info *mtd, int sync_read); | 117 | void (*mmcontrol)(struct mtd_info *mtd, int sync_read); |
118 | int (*chip_probe)(struct mtd_info *mtd); | ||
117 | int (*block_markbad)(struct mtd_info *mtd, loff_t ofs); | 119 | int (*block_markbad)(struct mtd_info *mtd, loff_t ofs); |
118 | int (*scan_bbt)(struct mtd_info *mtd); | 120 | int (*scan_bbt)(struct mtd_info *mtd); |
119 | 121 | ||
diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h index 76f7cabf07d3..bcfd9f777454 100644 --- a/include/linux/mtd/physmap.h +++ b/include/linux/mtd/physmap.h | |||
@@ -25,6 +25,7 @@ struct physmap_flash_data { | |||
25 | void (*set_vpp)(struct map_info *, int); | 25 | void (*set_vpp)(struct map_info *, int); |
26 | unsigned int nr_parts; | 26 | unsigned int nr_parts; |
27 | unsigned int pfow_base; | 27 | unsigned int pfow_base; |
28 | char *probe_type; | ||
28 | struct mtd_partition *parts; | 29 | struct mtd_partition *parts; |
29 | }; | 30 | }; |
30 | 31 | ||
diff --git a/include/linux/omapfb.h b/include/linux/omapfb.h index 7e4cd616bcb5..c0b018790f07 100644 --- a/include/linux/omapfb.h +++ b/include/linux/omapfb.h | |||
@@ -85,6 +85,9 @@ | |||
85 | #define OMAPFB_MEMTYPE_SRAM 1 | 85 | #define OMAPFB_MEMTYPE_SRAM 1 |
86 | #define OMAPFB_MEMTYPE_MAX 1 | 86 | #define OMAPFB_MEMTYPE_MAX 1 |
87 | 87 | ||
88 | #define OMAPFB_MEM_IDX_ENABLED 0x80 | ||
89 | #define OMAPFB_MEM_IDX_MASK 0x7f | ||
90 | |||
88 | enum omapfb_color_format { | 91 | enum omapfb_color_format { |
89 | OMAPFB_COLOR_RGB565 = 0, | 92 | OMAPFB_COLOR_RGB565 = 0, |
90 | OMAPFB_COLOR_YUV422, | 93 | OMAPFB_COLOR_YUV422, |
@@ -136,7 +139,7 @@ struct omapfb_plane_info { | |||
136 | __u8 enabled; | 139 | __u8 enabled; |
137 | __u8 channel_out; | 140 | __u8 channel_out; |
138 | __u8 mirror; | 141 | __u8 mirror; |
139 | __u8 reserved1; | 142 | __u8 mem_idx; |
140 | __u32 out_width; | 143 | __u32 out_width; |
141 | __u32 out_height; | 144 | __u32 out_height; |
142 | __u32 reserved2[12]; | 145 | __u32 reserved2[12]; |
diff --git a/include/linux/oom.h b/include/linux/oom.h index 537662315627..f209b683e118 100644 --- a/include/linux/oom.h +++ b/include/linux/oom.h | |||
@@ -1,19 +1,34 @@ | |||
1 | #ifndef __INCLUDE_LINUX_OOM_H | 1 | #ifndef __INCLUDE_LINUX_OOM_H |
2 | #define __INCLUDE_LINUX_OOM_H | 2 | #define __INCLUDE_LINUX_OOM_H |
3 | 3 | ||
4 | /* /proc/<pid>/oom_adj set to -17 protects from the oom-killer */ | 4 | /* |
5 | * /proc/<pid>/oom_adj is deprecated, see | ||
6 | * Documentation/feature-removal-schedule.txt. | ||
7 | * | ||
8 | * /proc/<pid>/oom_adj set to -17 protects from the oom-killer | ||
9 | */ | ||
5 | #define OOM_DISABLE (-17) | 10 | #define OOM_DISABLE (-17) |
6 | /* inclusive */ | 11 | /* inclusive */ |
7 | #define OOM_ADJUST_MIN (-16) | 12 | #define OOM_ADJUST_MIN (-16) |
8 | #define OOM_ADJUST_MAX 15 | 13 | #define OOM_ADJUST_MAX 15 |
9 | 14 | ||
15 | /* | ||
16 | * /proc/<pid>/oom_score_adj set to OOM_SCORE_ADJ_MIN disables oom killing for | ||
17 | * pid. | ||
18 | */ | ||
19 | #define OOM_SCORE_ADJ_MIN (-1000) | ||
20 | #define OOM_SCORE_ADJ_MAX 1000 | ||
21 | |||
10 | #ifdef __KERNEL__ | 22 | #ifdef __KERNEL__ |
11 | 23 | ||
24 | #include <linux/sched.h> | ||
12 | #include <linux/types.h> | 25 | #include <linux/types.h> |
13 | #include <linux/nodemask.h> | 26 | #include <linux/nodemask.h> |
14 | 27 | ||
15 | struct zonelist; | 28 | struct zonelist; |
16 | struct notifier_block; | 29 | struct notifier_block; |
30 | struct mem_cgroup; | ||
31 | struct task_struct; | ||
17 | 32 | ||
18 | /* | 33 | /* |
19 | * Types of limitations to the nodes from which allocations may occur | 34 | * Types of limitations to the nodes from which allocations may occur |
@@ -22,9 +37,12 @@ enum oom_constraint { | |||
22 | CONSTRAINT_NONE, | 37 | CONSTRAINT_NONE, |
23 | CONSTRAINT_CPUSET, | 38 | CONSTRAINT_CPUSET, |
24 | CONSTRAINT_MEMORY_POLICY, | 39 | CONSTRAINT_MEMORY_POLICY, |
40 | CONSTRAINT_MEMCG, | ||
25 | }; | 41 | }; |
26 | 42 | ||
27 | extern int try_set_zone_oom(struct zonelist *zonelist, gfp_t gfp_flags); | 43 | extern unsigned int oom_badness(struct task_struct *p, struct mem_cgroup *mem, |
44 | const nodemask_t *nodemask, unsigned long totalpages); | ||
45 | extern int try_set_zonelist_oom(struct zonelist *zonelist, gfp_t gfp_flags); | ||
28 | extern void clear_zonelist_oom(struct zonelist *zonelist, gfp_t gfp_flags); | 46 | extern void clear_zonelist_oom(struct zonelist *zonelist, gfp_t gfp_flags); |
29 | 47 | ||
30 | extern void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, | 48 | extern void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, |
@@ -43,5 +61,14 @@ static inline void oom_killer_enable(void) | |||
43 | { | 61 | { |
44 | oom_killer_disabled = false; | 62 | oom_killer_disabled = false; |
45 | } | 63 | } |
64 | |||
65 | /* The badness from the OOM killer */ | ||
66 | extern unsigned long badness(struct task_struct *p, struct mem_cgroup *mem, | ||
67 | const nodemask_t *nodemask, unsigned long uptime); | ||
68 | |||
69 | /* sysctls */ | ||
70 | extern int sysctl_oom_dump_tasks; | ||
71 | extern int sysctl_oom_kill_allocating_task; | ||
72 | extern int sysctl_panic_on_oom; | ||
46 | #endif /* __KERNEL__*/ | 73 | #endif /* __KERNEL__*/ |
47 | #endif /* _INCLUDE_LINUX_OOM_H */ | 74 | #endif /* _INCLUDE_LINUX_OOM_H */ |
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 3c62ed408492..78a702ce4fcb 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
@@ -423,8 +423,10 @@ static inline int fault_in_pages_readable(const char __user *uaddr, int size) | |||
423 | const char __user *end = uaddr + size - 1; | 423 | const char __user *end = uaddr + size - 1; |
424 | 424 | ||
425 | if (((unsigned long)uaddr & PAGE_MASK) != | 425 | if (((unsigned long)uaddr & PAGE_MASK) != |
426 | ((unsigned long)end & PAGE_MASK)) | 426 | ((unsigned long)end & PAGE_MASK)) { |
427 | ret = __get_user(c, end); | 427 | ret = __get_user(c, end); |
428 | (void)c; | ||
429 | } | ||
428 | } | 430 | } |
429 | return ret; | 431 | return ret; |
430 | } | 432 | } |
diff --git a/include/linux/pch_dma.h b/include/linux/pch_dma.h new file mode 100644 index 000000000000..fdafe529ef8a --- /dev/null +++ b/include/linux/pch_dma.h | |||
@@ -0,0 +1,37 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2010 Intel Corporation | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program; if not, write to the Free Software | ||
15 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
16 | */ | ||
17 | |||
18 | #ifndef PCH_DMA_H | ||
19 | #define PCH_DMA_H | ||
20 | |||
21 | #include <linux/dmaengine.h> | ||
22 | |||
23 | enum pch_dma_width { | ||
24 | PCH_DMA_WIDTH_1_BYTE, | ||
25 | PCH_DMA_WIDTH_2_BYTES, | ||
26 | PCH_DMA_WIDTH_4_BYTES, | ||
27 | }; | ||
28 | |||
29 | struct pch_dma_slave { | ||
30 | struct device *dma_dev; | ||
31 | unsigned int chan_id; | ||
32 | dma_addr_t tx_reg; | ||
33 | dma_addr_t rx_reg; | ||
34 | enum pch_dma_width width; | ||
35 | }; | ||
36 | |||
37 | #endif | ||
diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h index c88d67b59394..8a7d510ffa9c 100644 --- a/include/linux/percpu_counter.h +++ b/include/linux/percpu_counter.h | |||
@@ -40,6 +40,7 @@ void percpu_counter_destroy(struct percpu_counter *fbc); | |||
40 | void percpu_counter_set(struct percpu_counter *fbc, s64 amount); | 40 | void percpu_counter_set(struct percpu_counter *fbc, s64 amount); |
41 | void __percpu_counter_add(struct percpu_counter *fbc, s64 amount, s32 batch); | 41 | void __percpu_counter_add(struct percpu_counter *fbc, s64 amount, s32 batch); |
42 | s64 __percpu_counter_sum(struct percpu_counter *fbc); | 42 | s64 __percpu_counter_sum(struct percpu_counter *fbc); |
43 | int percpu_counter_compare(struct percpu_counter *fbc, s64 rhs); | ||
43 | 44 | ||
44 | static inline void percpu_counter_add(struct percpu_counter *fbc, s64 amount) | 45 | static inline void percpu_counter_add(struct percpu_counter *fbc, s64 amount) |
45 | { | 46 | { |
@@ -98,6 +99,16 @@ static inline void percpu_counter_set(struct percpu_counter *fbc, s64 amount) | |||
98 | fbc->count = amount; | 99 | fbc->count = amount; |
99 | } | 100 | } |
100 | 101 | ||
102 | static inline int percpu_counter_compare(struct percpu_counter *fbc, s64 rhs) | ||
103 | { | ||
104 | if (fbc->count > rhs) | ||
105 | return 1; | ||
106 | else if (fbc->count < rhs) | ||
107 | return -1; | ||
108 | else | ||
109 | return 0; | ||
110 | } | ||
111 | |||
101 | static inline void | 112 | static inline void |
102 | percpu_counter_add(struct percpu_counter *fbc, s64 amount) | 113 | percpu_counter_add(struct percpu_counter *fbc, s64 amount) |
103 | { | 114 | { |
diff --git a/include/linux/posix-timers.h b/include/linux/posix-timers.h index 4f71bf4e628c..3e23844a6990 100644 --- a/include/linux/posix-timers.h +++ b/include/linux/posix-timers.h | |||
@@ -117,6 +117,6 @@ void set_process_cpu_timer(struct task_struct *task, unsigned int clock_idx, | |||
117 | 117 | ||
118 | long clock_nanosleep_restart(struct restart_block *restart_block); | 118 | long clock_nanosleep_restart(struct restart_block *restart_block); |
119 | 119 | ||
120 | void update_rlimit_cpu(unsigned long rlim_new); | 120 | void update_rlimit_cpu(struct task_struct *task, unsigned long rlim_new); |
121 | 121 | ||
122 | #endif | 122 | #endif |
diff --git a/include/linux/ppp_channel.h b/include/linux/ppp_channel.h index bff98ec1bfed..5d87f810a3b7 100644 --- a/include/linux/ppp_channel.h +++ b/include/linux/ppp_channel.h | |||
@@ -36,7 +36,7 @@ struct ppp_channel_ops { | |||
36 | 36 | ||
37 | struct ppp_channel { | 37 | struct ppp_channel { |
38 | void *private; /* channel private data */ | 38 | void *private; /* channel private data */ |
39 | struct ppp_channel_ops *ops; /* operations for this channel */ | 39 | const struct ppp_channel_ops *ops; /* operations for this channel */ |
40 | int mtu; /* max transmit packet size */ | 40 | int mtu; /* max transmit packet size */ |
41 | int hdrlen; /* amount of headroom channel needs */ | 41 | int hdrlen; /* amount of headroom channel needs */ |
42 | void *ppp; /* opaque to channel */ | 42 | void *ppp; /* opaque to channel */ |
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h index 55ca73cf25e5..634b8e674ac5 100644 --- a/include/linux/radix-tree.h +++ b/include/linux/radix-tree.h | |||
@@ -55,7 +55,7 @@ static inline int radix_tree_is_indirect_ptr(void *ptr) | |||
55 | 55 | ||
56 | /*** radix-tree API starts here ***/ | 56 | /*** radix-tree API starts here ***/ |
57 | 57 | ||
58 | #define RADIX_TREE_MAX_TAGS 2 | 58 | #define RADIX_TREE_MAX_TAGS 3 |
59 | 59 | ||
60 | /* root tags are stored in gfp_mask, shifted by __GFP_BITS_SHIFT */ | 60 | /* root tags are stored in gfp_mask, shifted by __GFP_BITS_SHIFT */ |
61 | struct radix_tree_root { | 61 | struct radix_tree_root { |
@@ -192,6 +192,10 @@ unsigned int | |||
192 | radix_tree_gang_lookup_tag_slot(struct radix_tree_root *root, void ***results, | 192 | radix_tree_gang_lookup_tag_slot(struct radix_tree_root *root, void ***results, |
193 | unsigned long first_index, unsigned int max_items, | 193 | unsigned long first_index, unsigned int max_items, |
194 | unsigned int tag); | 194 | unsigned int tag); |
195 | unsigned long radix_tree_range_tag_if_tagged(struct radix_tree_root *root, | ||
196 | unsigned long *first_indexp, unsigned long last_index, | ||
197 | unsigned long nr_to_tag, | ||
198 | unsigned int fromtag, unsigned int totag); | ||
195 | int radix_tree_tagged(struct radix_tree_root *root, unsigned int tag); | 199 | int radix_tree_tagged(struct radix_tree_root *root, unsigned int tag); |
196 | 200 | ||
197 | static inline void radix_tree_preload_end(void) | 201 | static inline void radix_tree_preload_end(void) |
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index ba394163dea1..91a4177e60ce 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h | |||
@@ -2033,7 +2033,7 @@ void reiserfs_read_locked_inode(struct inode *inode, | |||
2033 | struct reiserfs_iget_args *args); | 2033 | struct reiserfs_iget_args *args); |
2034 | int reiserfs_find_actor(struct inode *inode, void *p); | 2034 | int reiserfs_find_actor(struct inode *inode, void *p); |
2035 | int reiserfs_init_locked_inode(struct inode *inode, void *p); | 2035 | int reiserfs_init_locked_inode(struct inode *inode, void *p); |
2036 | void reiserfs_delete_inode(struct inode *inode); | 2036 | void reiserfs_evict_inode(struct inode *inode); |
2037 | int reiserfs_write_inode(struct inode *inode, struct writeback_control *wbc); | 2037 | int reiserfs_write_inode(struct inode *inode, struct writeback_control *wbc); |
2038 | int reiserfs_get_block(struct inode *inode, sector_t block, | 2038 | int reiserfs_get_block(struct inode *inode, sector_t block, |
2039 | struct buffer_head *bh_result, int create); | 2039 | struct buffer_head *bh_result, int create); |
diff --git a/include/linux/reiserfs_fs_i.h b/include/linux/reiserfs_fs_i.h index 89f4d3abbf5a..97959bdfe214 100644 --- a/include/linux/reiserfs_fs_i.h +++ b/include/linux/reiserfs_fs_i.h | |||
@@ -25,7 +25,6 @@ typedef enum { | |||
25 | i_link_saved_truncate_mask = 0x0020, | 25 | i_link_saved_truncate_mask = 0x0020, |
26 | i_has_xattr_dir = 0x0040, | 26 | i_has_xattr_dir = 0x0040, |
27 | i_data_log = 0x0080, | 27 | i_data_log = 0x0080, |
28 | i_ever_mapped = 0x0100 | ||
29 | } reiserfs_inode_flags; | 28 | } reiserfs_inode_flags; |
30 | 29 | ||
31 | struct reiserfs_inode_info { | 30 | struct reiserfs_inode_info { |
@@ -53,7 +52,8 @@ struct reiserfs_inode_info { | |||
53 | ** flushed */ | 52 | ** flushed */ |
54 | unsigned int i_trans_id; | 53 | unsigned int i_trans_id; |
55 | struct reiserfs_journal_list *i_jl; | 54 | struct reiserfs_journal_list *i_jl; |
56 | struct mutex i_mmap; | 55 | atomic_t openers; |
56 | struct mutex tailpack; | ||
57 | #ifdef CONFIG_REISERFS_FS_XATTR | 57 | #ifdef CONFIG_REISERFS_FS_XATTR |
58 | struct rw_semaphore i_xattr_sem; | 58 | struct rw_semaphore i_xattr_sem; |
59 | #endif | 59 | #endif |
diff --git a/include/linux/resource.h b/include/linux/resource.h index f1e914eefeab..88d36f9145ba 100644 --- a/include/linux/resource.h +++ b/include/linux/resource.h | |||
@@ -43,6 +43,13 @@ struct rlimit { | |||
43 | unsigned long rlim_max; | 43 | unsigned long rlim_max; |
44 | }; | 44 | }; |
45 | 45 | ||
46 | #define RLIM64_INFINITY (~0ULL) | ||
47 | |||
48 | struct rlimit64 { | ||
49 | __u64 rlim_cur; | ||
50 | __u64 rlim_max; | ||
51 | }; | ||
52 | |||
46 | #define PRIO_MIN (-20) | 53 | #define PRIO_MIN (-20) |
47 | #define PRIO_MAX 20 | 54 | #define PRIO_MAX 20 |
48 | 55 | ||
@@ -73,6 +80,8 @@ struct rlimit { | |||
73 | struct task_struct; | 80 | struct task_struct; |
74 | 81 | ||
75 | int getrusage(struct task_struct *p, int who, struct rusage __user *ru); | 82 | int getrusage(struct task_struct *p, int who, struct rusage __user *ru); |
83 | int do_prlimit(struct task_struct *tsk, unsigned int resource, | ||
84 | struct rlimit *new_rlim, struct rlimit *old_rlim); | ||
76 | 85 | ||
77 | #endif /* __KERNEL__ */ | 86 | #endif /* __KERNEL__ */ |
78 | 87 | ||
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index 77216742c178..d6661de56f30 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
@@ -26,6 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | struct anon_vma { | 27 | struct anon_vma { |
28 | spinlock_t lock; /* Serialize access to vma list */ | 28 | spinlock_t lock; /* Serialize access to vma list */ |
29 | struct anon_vma *root; /* Root of this anon_vma tree */ | ||
29 | #if defined(CONFIG_KSM) || defined(CONFIG_MIGRATION) | 30 | #if defined(CONFIG_KSM) || defined(CONFIG_MIGRATION) |
30 | 31 | ||
31 | /* | 32 | /* |
@@ -80,6 +81,13 @@ static inline int anonvma_external_refcount(struct anon_vma *anon_vma) | |||
80 | { | 81 | { |
81 | return atomic_read(&anon_vma->external_refcount); | 82 | return atomic_read(&anon_vma->external_refcount); |
82 | } | 83 | } |
84 | |||
85 | static inline void get_anon_vma(struct anon_vma *anon_vma) | ||
86 | { | ||
87 | atomic_inc(&anon_vma->external_refcount); | ||
88 | } | ||
89 | |||
90 | void drop_anon_vma(struct anon_vma *); | ||
83 | #else | 91 | #else |
84 | static inline void anonvma_external_refcount_init(struct anon_vma *anon_vma) | 92 | static inline void anonvma_external_refcount_init(struct anon_vma *anon_vma) |
85 | { | 93 | { |
@@ -89,6 +97,14 @@ static inline int anonvma_external_refcount(struct anon_vma *anon_vma) | |||
89 | { | 97 | { |
90 | return 0; | 98 | return 0; |
91 | } | 99 | } |
100 | |||
101 | static inline void get_anon_vma(struct anon_vma *anon_vma) | ||
102 | { | ||
103 | } | ||
104 | |||
105 | static inline void drop_anon_vma(struct anon_vma *anon_vma) | ||
106 | { | ||
107 | } | ||
92 | #endif /* CONFIG_KSM */ | 108 | #endif /* CONFIG_KSM */ |
93 | 109 | ||
94 | static inline struct anon_vma *page_anon_vma(struct page *page) | 110 | static inline struct anon_vma *page_anon_vma(struct page *page) |
@@ -99,18 +115,28 @@ static inline struct anon_vma *page_anon_vma(struct page *page) | |||
99 | return page_rmapping(page); | 115 | return page_rmapping(page); |
100 | } | 116 | } |
101 | 117 | ||
102 | static inline void anon_vma_lock(struct vm_area_struct *vma) | 118 | static inline void vma_lock_anon_vma(struct vm_area_struct *vma) |
103 | { | 119 | { |
104 | struct anon_vma *anon_vma = vma->anon_vma; | 120 | struct anon_vma *anon_vma = vma->anon_vma; |
105 | if (anon_vma) | 121 | if (anon_vma) |
106 | spin_lock(&anon_vma->lock); | 122 | spin_lock(&anon_vma->root->lock); |
107 | } | 123 | } |
108 | 124 | ||
109 | static inline void anon_vma_unlock(struct vm_area_struct *vma) | 125 | static inline void vma_unlock_anon_vma(struct vm_area_struct *vma) |
110 | { | 126 | { |
111 | struct anon_vma *anon_vma = vma->anon_vma; | 127 | struct anon_vma *anon_vma = vma->anon_vma; |
112 | if (anon_vma) | 128 | if (anon_vma) |
113 | spin_unlock(&anon_vma->lock); | 129 | spin_unlock(&anon_vma->root->lock); |
130 | } | ||
131 | |||
132 | static inline void anon_vma_lock(struct anon_vma *anon_vma) | ||
133 | { | ||
134 | spin_lock(&anon_vma->root->lock); | ||
135 | } | ||
136 | |||
137 | static inline void anon_vma_unlock(struct anon_vma *anon_vma) | ||
138 | { | ||
139 | spin_unlock(&anon_vma->root->lock); | ||
114 | } | 140 | } |
115 | 141 | ||
116 | /* | 142 | /* |
@@ -136,6 +162,8 @@ static inline void anon_vma_merge(struct vm_area_struct *vma, | |||
136 | */ | 162 | */ |
137 | void page_move_anon_rmap(struct page *, struct vm_area_struct *, unsigned long); | 163 | void page_move_anon_rmap(struct page *, struct vm_area_struct *, unsigned long); |
138 | void page_add_anon_rmap(struct page *, struct vm_area_struct *, unsigned long); | 164 | void page_add_anon_rmap(struct page *, struct vm_area_struct *, unsigned long); |
165 | void do_page_add_anon_rmap(struct page *, struct vm_area_struct *, | ||
166 | unsigned long, int); | ||
139 | void page_add_new_anon_rmap(struct page *, struct vm_area_struct *, unsigned long); | 167 | void page_add_new_anon_rmap(struct page *, struct vm_area_struct *, unsigned long); |
140 | void page_add_file_rmap(struct page *); | 168 | void page_add_file_rmap(struct page *); |
141 | void page_remove_rmap(struct page *); | 169 | void page_remove_rmap(struct page *); |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 9591907c4f79..ce160d68f5e7 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -621,7 +621,8 @@ struct signal_struct { | |||
621 | struct tty_audit_buf *tty_audit_buf; | 621 | struct tty_audit_buf *tty_audit_buf; |
622 | #endif | 622 | #endif |
623 | 623 | ||
624 | int oom_adj; /* OOM kill score adjustment (bit shift) */ | 624 | int oom_adj; /* OOM kill score adjustment (bit shift) */ |
625 | int oom_score_adj; /* OOM kill score adjustment */ | ||
625 | }; | 626 | }; |
626 | 627 | ||
627 | /* Context switch must be unlocked if interrupts are to be enabled */ | 628 | /* Context switch must be unlocked if interrupts are to be enabled */ |
diff --git a/include/linux/security.h b/include/linux/security.h index 723a93df756a..a22219afff09 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -23,6 +23,7 @@ | |||
23 | #define __LINUX_SECURITY_H | 23 | #define __LINUX_SECURITY_H |
24 | 24 | ||
25 | #include <linux/fs.h> | 25 | #include <linux/fs.h> |
26 | #include <linux/fsnotify.h> | ||
26 | #include <linux/binfmts.h> | 27 | #include <linux/binfmts.h> |
27 | #include <linux/signal.h> | 28 | #include <linux/signal.h> |
28 | #include <linux/resource.h> | 29 | #include <linux/resource.h> |
@@ -1498,7 +1499,8 @@ struct security_operations { | |||
1498 | int (*task_setnice) (struct task_struct *p, int nice); | 1499 | int (*task_setnice) (struct task_struct *p, int nice); |
1499 | int (*task_setioprio) (struct task_struct *p, int ioprio); | 1500 | int (*task_setioprio) (struct task_struct *p, int ioprio); |
1500 | int (*task_getioprio) (struct task_struct *p); | 1501 | int (*task_getioprio) (struct task_struct *p); |
1501 | int (*task_setrlimit) (unsigned int resource, struct rlimit *new_rlim); | 1502 | int (*task_setrlimit) (struct task_struct *p, unsigned int resource, |
1503 | struct rlimit *new_rlim); | ||
1502 | int (*task_setscheduler) (struct task_struct *p, int policy, | 1504 | int (*task_setscheduler) (struct task_struct *p, int policy, |
1503 | struct sched_param *lp); | 1505 | struct sched_param *lp); |
1504 | int (*task_getscheduler) (struct task_struct *p); | 1506 | int (*task_getscheduler) (struct task_struct *p); |
@@ -1748,7 +1750,8 @@ void security_task_getsecid(struct task_struct *p, u32 *secid); | |||
1748 | int security_task_setnice(struct task_struct *p, int nice); | 1750 | int security_task_setnice(struct task_struct *p, int nice); |
1749 | int security_task_setioprio(struct task_struct *p, int ioprio); | 1751 | int security_task_setioprio(struct task_struct *p, int ioprio); |
1750 | int security_task_getioprio(struct task_struct *p); | 1752 | int security_task_getioprio(struct task_struct *p); |
1751 | int security_task_setrlimit(unsigned int resource, struct rlimit *new_rlim); | 1753 | int security_task_setrlimit(struct task_struct *p, unsigned int resource, |
1754 | struct rlimit *new_rlim); | ||
1752 | int security_task_setscheduler(struct task_struct *p, | 1755 | int security_task_setscheduler(struct task_struct *p, |
1753 | int policy, struct sched_param *lp); | 1756 | int policy, struct sched_param *lp); |
1754 | int security_task_getscheduler(struct task_struct *p); | 1757 | int security_task_getscheduler(struct task_struct *p); |
@@ -2310,7 +2313,8 @@ static inline int security_task_getioprio(struct task_struct *p) | |||
2310 | return 0; | 2313 | return 0; |
2311 | } | 2314 | } |
2312 | 2315 | ||
2313 | static inline int security_task_setrlimit(unsigned int resource, | 2316 | static inline int security_task_setrlimit(struct task_struct *p, |
2317 | unsigned int resource, | ||
2314 | struct rlimit *new_rlim) | 2318 | struct rlimit *new_rlim) |
2315 | { | 2319 | { |
2316 | return 0; | 2320 | return 0; |
diff --git a/include/linux/serial.h b/include/linux/serial.h index c8613c3ff9d3..1ebc694a6d52 100644 --- a/include/linux/serial.h +++ b/include/linux/serial.h | |||
@@ -77,7 +77,8 @@ struct serial_struct { | |||
77 | #define PORT_16654 11 | 77 | #define PORT_16654 11 |
78 | #define PORT_16850 12 | 78 | #define PORT_16850 12 |
79 | #define PORT_RSA 13 /* RSA-DV II/S card */ | 79 | #define PORT_RSA 13 /* RSA-DV II/S card */ |
80 | #define PORT_MAX 13 | 80 | #define PORT_U6_16550A 14 |
81 | #define PORT_MAX 14 | ||
81 | 82 | ||
82 | #define SERIAL_IO_PORT 0 | 83 | #define SERIAL_IO_PORT 0 |
83 | #define SERIAL_IO_HUB6 1 | 84 | #define SERIAL_IO_HUB6 1 |
@@ -151,7 +152,7 @@ struct serial_uart_config { | |||
151 | #define ASYNC_BUGGY_UART (1U << ASYNCB_BUGGY_UART) | 152 | #define ASYNC_BUGGY_UART (1U << ASYNCB_BUGGY_UART) |
152 | #define ASYNC_AUTOPROBE (1U << ASYNCB_AUTOPROBE) | 153 | #define ASYNC_AUTOPROBE (1U << ASYNCB_AUTOPROBE) |
153 | 154 | ||
154 | #define ASYNC_FLAGS ((1U << ASYNCB_LAST_USER) - 1) | 155 | #define ASYNC_FLAGS ((1U << (ASYNCB_LAST_USER + 1)) - 1) |
155 | #define ASYNC_USR_MASK (ASYNC_SPD_HI|ASYNC_SPD_VHI| \ | 156 | #define ASYNC_USR_MASK (ASYNC_SPD_HI|ASYNC_SPD_VHI| \ |
156 | ASYNC_CALLOUT_NOHUP|ASYNC_SPD_SHI|ASYNC_LOW_LATENCY) | 157 | ASYNC_CALLOUT_NOHUP|ASYNC_SPD_SHI|ASYNC_LOW_LATENCY) |
157 | #define ASYNC_SPD_CUST (ASYNC_SPD_HI|ASYNC_SPD_VHI) | 158 | #define ASYNC_SPD_CUST (ASYNC_SPD_HI|ASYNC_SPD_VHI) |
@@ -210,8 +211,10 @@ struct serial_rs485 { | |||
210 | #define SER_RS485_ENABLED (1 << 0) | 211 | #define SER_RS485_ENABLED (1 << 0) |
211 | #define SER_RS485_RTS_ON_SEND (1 << 1) | 212 | #define SER_RS485_RTS_ON_SEND (1 << 1) |
212 | #define SER_RS485_RTS_AFTER_SEND (1 << 2) | 213 | #define SER_RS485_RTS_AFTER_SEND (1 << 2) |
214 | #define SER_RS485_RTS_BEFORE_SEND (1 << 3) | ||
213 | __u32 delay_rts_before_send; /* Milliseconds */ | 215 | __u32 delay_rts_before_send; /* Milliseconds */ |
214 | __u32 padding[6]; /* Memory is cheap, new structs | 216 | __u32 delay_rts_after_send; /* Milliseconds */ |
217 | __u32 padding[5]; /* Memory is cheap, new structs | ||
215 | are a royal PITA .. */ | 218 | are a royal PITA .. */ |
216 | }; | 219 | }; |
217 | 220 | ||
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h index fb46aba11fb5..7638deaaba65 100644 --- a/include/linux/serial_8250.h +++ b/include/linux/serial_8250.h | |||
@@ -32,6 +32,9 @@ struct plat_serial8250_port { | |||
32 | unsigned int type; /* If UPF_FIXED_TYPE */ | 32 | unsigned int type; /* If UPF_FIXED_TYPE */ |
33 | unsigned int (*serial_in)(struct uart_port *, int); | 33 | unsigned int (*serial_in)(struct uart_port *, int); |
34 | void (*serial_out)(struct uart_port *, int, int); | 34 | void (*serial_out)(struct uart_port *, int, int); |
35 | void (*set_termios)(struct uart_port *, | ||
36 | struct ktermios *new, | ||
37 | struct ktermios *old); | ||
35 | }; | 38 | }; |
36 | 39 | ||
37 | /* | 40 | /* |
@@ -71,5 +74,7 @@ extern int early_serial_setup(struct uart_port *port); | |||
71 | extern int serial8250_find_port(struct uart_port *p); | 74 | extern int serial8250_find_port(struct uart_port *p); |
72 | extern int serial8250_find_port_for_earlycon(void); | 75 | extern int serial8250_find_port_for_earlycon(void); |
73 | extern int setup_early_serial8250_console(char *cmdline); | 76 | extern int setup_early_serial8250_console(char *cmdline); |
77 | extern void serial8250_do_set_termios(struct uart_port *port, | ||
78 | struct ktermios *termios, struct ktermios *old); | ||
74 | 79 | ||
75 | #endif | 80 | #endif |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index f10db6e5f3b5..8129ca2d57e3 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -186,6 +186,12 @@ | |||
186 | #define PORT_ALTERA_JTAGUART 91 | 186 | #define PORT_ALTERA_JTAGUART 91 |
187 | #define PORT_ALTERA_UART 92 | 187 | #define PORT_ALTERA_UART 92 |
188 | 188 | ||
189 | /* MAX3107 */ | ||
190 | #define PORT_MAX3107 94 | ||
191 | |||
192 | /* High Speed UART for Medfield */ | ||
193 | #define PORT_MFD 95 | ||
194 | |||
189 | #ifdef __KERNEL__ | 195 | #ifdef __KERNEL__ |
190 | 196 | ||
191 | #include <linux/compiler.h> | 197 | #include <linux/compiler.h> |
@@ -220,7 +226,7 @@ struct uart_ops { | |||
220 | void (*flush_buffer)(struct uart_port *); | 226 | void (*flush_buffer)(struct uart_port *); |
221 | void (*set_termios)(struct uart_port *, struct ktermios *new, | 227 | void (*set_termios)(struct uart_port *, struct ktermios *new, |
222 | struct ktermios *old); | 228 | struct ktermios *old); |
223 | void (*set_ldisc)(struct uart_port *); | 229 | void (*set_ldisc)(struct uart_port *, int new); |
224 | void (*pm)(struct uart_port *, unsigned int state, | 230 | void (*pm)(struct uart_port *, unsigned int state, |
225 | unsigned int oldstate); | 231 | unsigned int oldstate); |
226 | int (*set_wake)(struct uart_port *, unsigned int state); | 232 | int (*set_wake)(struct uart_port *, unsigned int state); |
@@ -276,6 +282,9 @@ struct uart_port { | |||
276 | unsigned char __iomem *membase; /* read/write[bwl] */ | 282 | unsigned char __iomem *membase; /* read/write[bwl] */ |
277 | unsigned int (*serial_in)(struct uart_port *, int); | 283 | unsigned int (*serial_in)(struct uart_port *, int); |
278 | void (*serial_out)(struct uart_port *, int, int); | 284 | void (*serial_out)(struct uart_port *, int, int); |
285 | void (*set_termios)(struct uart_port *, | ||
286 | struct ktermios *new, | ||
287 | struct ktermios *old); | ||
279 | unsigned int irq; /* irq number */ | 288 | unsigned int irq; /* irq number */ |
280 | unsigned long irqflags; /* irq flags */ | 289 | unsigned long irqflags; /* irq flags */ |
281 | unsigned int uartclk; /* base uart clock */ | 290 | unsigned int uartclk; /* base uart clock */ |
diff --git a/include/linux/serial_mfd.h b/include/linux/serial_mfd.h new file mode 100644 index 000000000000..2b071e0b034d --- /dev/null +++ b/include/linux/serial_mfd.h | |||
@@ -0,0 +1,47 @@ | |||
1 | #ifndef _SERIAL_MFD_H_ | ||
2 | #define _SERIAL_MFD_H_ | ||
3 | |||
4 | /* HW register offset definition */ | ||
5 | #define UART_FOR 0x08 | ||
6 | #define UART_PS 0x0C | ||
7 | #define UART_MUL 0x0D | ||
8 | #define UART_DIV 0x0E | ||
9 | |||
10 | #define HSU_GBL_IEN 0x0 | ||
11 | #define HSU_GBL_IST 0x4 | ||
12 | |||
13 | #define HSU_GBL_INT_BIT_PORT0 0x0 | ||
14 | #define HSU_GBL_INT_BIT_PORT1 0x1 | ||
15 | #define HSU_GBL_INT_BIT_PORT2 0x2 | ||
16 | #define HSU_GBL_INT_BIT_IRI 0x3 | ||
17 | #define HSU_GBL_INT_BIT_HDLC 0x4 | ||
18 | #define HSU_GBL_INT_BIT_DMA 0x5 | ||
19 | |||
20 | #define HSU_GBL_ISR 0x8 | ||
21 | #define HSU_GBL_DMASR 0x400 | ||
22 | #define HSU_GBL_DMAISR 0x404 | ||
23 | |||
24 | #define HSU_PORT_REG_OFFSET 0x80 | ||
25 | #define HSU_PORT0_REG_OFFSET 0x80 | ||
26 | #define HSU_PORT1_REG_OFFSET 0x100 | ||
27 | #define HSU_PORT2_REG_OFFSET 0x180 | ||
28 | #define HSU_PORT_REG_LENGTH 0x80 | ||
29 | |||
30 | #define HSU_DMA_CHANS_REG_OFFSET 0x500 | ||
31 | #define HSU_DMA_CHANS_REG_LENGTH 0x40 | ||
32 | |||
33 | #define HSU_CH_SR 0x0 /* channel status reg */ | ||
34 | #define HSU_CH_CR 0x4 /* control reg */ | ||
35 | #define HSU_CH_DCR 0x8 /* descriptor control reg */ | ||
36 | #define HSU_CH_BSR 0x10 /* max fifo buffer size reg */ | ||
37 | #define HSU_CH_MOTSR 0x14 /* minimum ocp transfer size */ | ||
38 | #define HSU_CH_D0SAR 0x20 /* desc 0 start addr */ | ||
39 | #define HSU_CH_D0TSR 0x24 /* desc 0 transfer size */ | ||
40 | #define HSU_CH_D1SAR 0x28 | ||
41 | #define HSU_CH_D1TSR 0x2C | ||
42 | #define HSU_CH_D2SAR 0x30 | ||
43 | #define HSU_CH_D2TSR 0x34 | ||
44 | #define HSU_CH_D3SAR 0x38 | ||
45 | #define HSU_CH_D3TSR 0x3C | ||
46 | |||
47 | #endif | ||
diff --git a/include/linux/serial_reg.h b/include/linux/serial_reg.h index cf9327c051ad..c7a0ce11cd47 100644 --- a/include/linux/serial_reg.h +++ b/include/linux/serial_reg.h | |||
@@ -221,8 +221,24 @@ | |||
221 | #define UART_FCR_PXAR16 0x80 /* receive FIFO threshold = 16 */ | 221 | #define UART_FCR_PXAR16 0x80 /* receive FIFO threshold = 16 */ |
222 | #define UART_FCR_PXAR32 0xc0 /* receive FIFO threshold = 32 */ | 222 | #define UART_FCR_PXAR32 0xc0 /* receive FIFO threshold = 32 */ |
223 | 223 | ||
224 | /* | ||
225 | * Intel MID on-chip HSU (High Speed UART) defined bits | ||
226 | */ | ||
227 | #define UART_FCR_HSU_64_1B 0x00 /* receive FIFO treshold = 1 */ | ||
228 | #define UART_FCR_HSU_64_16B 0x40 /* receive FIFO treshold = 16 */ | ||
229 | #define UART_FCR_HSU_64_32B 0x80 /* receive FIFO treshold = 32 */ | ||
230 | #define UART_FCR_HSU_64_56B 0xc0 /* receive FIFO treshold = 56 */ | ||
231 | |||
232 | #define UART_FCR_HSU_16_1B 0x00 /* receive FIFO treshold = 1 */ | ||
233 | #define UART_FCR_HSU_16_4B 0x40 /* receive FIFO treshold = 4 */ | ||
234 | #define UART_FCR_HSU_16_8B 0x80 /* receive FIFO treshold = 8 */ | ||
235 | #define UART_FCR_HSU_16_14B 0xc0 /* receive FIFO treshold = 14 */ | ||
224 | 236 | ||
237 | #define UART_FCR_HSU_64B_FIFO 0x20 /* chose 64 bytes FIFO */ | ||
238 | #define UART_FCR_HSU_16B_FIFO 0x00 /* chose 16 bytes FIFO */ | ||
225 | 239 | ||
240 | #define UART_FCR_HALF_EMPT_TXI 0x00 /* trigger TX_EMPT IRQ for half empty */ | ||
241 | #define UART_FCR_FULL_EMPT_TXI 0x08 /* trigger TX_EMPT IRQ for full empty */ | ||
226 | 242 | ||
227 | /* | 243 | /* |
228 | * These register definitions are for the 16C950 | 244 | * These register definitions are for the 16C950 |
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h index e164291fb3e7..399be5ad2f99 100644 --- a/include/linux/shmem_fs.h +++ b/include/linux/shmem_fs.h | |||
@@ -3,6 +3,7 @@ | |||
3 | 3 | ||
4 | #include <linux/swap.h> | 4 | #include <linux/swap.h> |
5 | #include <linux/mempolicy.h> | 5 | #include <linux/mempolicy.h> |
6 | #include <linux/percpu_counter.h> | ||
6 | 7 | ||
7 | /* inode in-kernel data */ | 8 | /* inode in-kernel data */ |
8 | 9 | ||
@@ -23,7 +24,7 @@ struct shmem_inode_info { | |||
23 | 24 | ||
24 | struct shmem_sb_info { | 25 | struct shmem_sb_info { |
25 | unsigned long max_blocks; /* How many blocks are allowed */ | 26 | unsigned long max_blocks; /* How many blocks are allowed */ |
26 | unsigned long free_blocks; /* How many are left for allocation */ | 27 | struct percpu_counter used_blocks; /* How many are allocated */ |
27 | unsigned long max_inodes; /* How many inodes are allowed */ | 28 | unsigned long max_inodes; /* How many inodes are allowed */ |
28 | unsigned long free_inodes; /* How many are left for allocation */ | 29 | unsigned long free_inodes; /* How many are left for allocation */ |
29 | spinlock_t stat_lock; /* Serialize shmem_sb_info changes */ | 30 | spinlock_t stat_lock; /* Serialize shmem_sb_info changes */ |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index d20d9e7a9bbd..77eb60d2b496 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -1379,6 +1379,11 @@ static inline int skb_network_offset(const struct sk_buff *skb) | |||
1379 | return skb_network_header(skb) - skb->data; | 1379 | return skb_network_header(skb) - skb->data; |
1380 | } | 1380 | } |
1381 | 1381 | ||
1382 | static inline int pskb_network_may_pull(struct sk_buff *skb, unsigned int len) | ||
1383 | { | ||
1384 | return pskb_may_pull(skb, skb_network_offset(skb) + len); | ||
1385 | } | ||
1386 | |||
1382 | /* | 1387 | /* |
1383 | * CPUs often take a performance hit when accessing unaligned memory | 1388 | * CPUs often take a performance hit when accessing unaligned memory |
1384 | * locations. The actual performance hit varies, it can be small if the | 1389 | * locations. The actual performance hit varies, it can be small if the |
diff --git a/include/linux/statfs.h b/include/linux/statfs.h index b34cc829f98d..0166d320a75d 100644 --- a/include/linux/statfs.h +++ b/include/linux/statfs.h | |||
@@ -2,7 +2,6 @@ | |||
2 | #define _LINUX_STATFS_H | 2 | #define _LINUX_STATFS_H |
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | |||
6 | #include <asm/statfs.h> | 5 | #include <asm/statfs.h> |
7 | 6 | ||
8 | struct kstatfs { | 7 | struct kstatfs { |
@@ -16,7 +15,29 @@ struct kstatfs { | |||
16 | __kernel_fsid_t f_fsid; | 15 | __kernel_fsid_t f_fsid; |
17 | long f_namelen; | 16 | long f_namelen; |
18 | long f_frsize; | 17 | long f_frsize; |
19 | long f_spare[5]; | 18 | long f_flags; |
19 | long f_spare[4]; | ||
20 | }; | 20 | }; |
21 | 21 | ||
22 | /* | ||
23 | * Definitions for the flag in f_flag. | ||
24 | * | ||
25 | * Generally these flags are equivalent to the MS_ flags used in the mount | ||
26 | * ABI. The exception is ST_VALID which has the same value as MS_REMOUNT | ||
27 | * which doesn't make any sense for statfs. | ||
28 | */ | ||
29 | #define ST_RDONLY 0x0001 /* mount read-only */ | ||
30 | #define ST_NOSUID 0x0002 /* ignore suid and sgid bits */ | ||
31 | #define ST_NODEV 0x0004 /* disallow access to device special files */ | ||
32 | #define ST_NOEXEC 0x0008 /* disallow program execution */ | ||
33 | #define ST_SYNCHRONOUS 0x0010 /* writes are synced at once */ | ||
34 | #define ST_VALID 0x0020 /* f_flags support is implemented */ | ||
35 | #define ST_MANDLOCK 0x0040 /* allow mandatory locks on an FS */ | ||
36 | /* 0x0080 used for ST_WRITE in glibc */ | ||
37 | /* 0x0100 used for ST_APPEND in glibc */ | ||
38 | /* 0x0200 used for ST_IMMUTABLE in glibc */ | ||
39 | #define ST_NOATIME 0x0400 /* do not update access times */ | ||
40 | #define ST_NODIRATIME 0x0800 /* do not update directory access times */ | ||
41 | #define ST_RELATIME 0x1000 /* update atime relative to mtime/ctime */ | ||
42 | |||
22 | #endif | 43 | #endif |
diff --git a/include/linux/swap.h b/include/linux/swap.h index ff4acea9bbdb..91c9d3fc8513 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -316,7 +316,6 @@ extern long nr_swap_pages; | |||
316 | extern long total_swap_pages; | 316 | extern long total_swap_pages; |
317 | extern void si_swapinfo(struct sysinfo *); | 317 | extern void si_swapinfo(struct sysinfo *); |
318 | extern swp_entry_t get_swap_page(void); | 318 | extern swp_entry_t get_swap_page(void); |
319 | extern swp_entry_t get_swap_page_of_type(int); | ||
320 | extern int valid_swaphandles(swp_entry_t, unsigned long *); | 319 | extern int valid_swaphandles(swp_entry_t, unsigned long *); |
321 | extern int add_swap_count_continuation(swp_entry_t, gfp_t); | 320 | extern int add_swap_count_continuation(swp_entry_t, gfp_t); |
322 | extern void swap_shmem_alloc(swp_entry_t); | 321 | extern void swap_shmem_alloc(swp_entry_t); |
@@ -333,6 +332,13 @@ extern int reuse_swap_page(struct page *); | |||
333 | extern int try_to_free_swap(struct page *); | 332 | extern int try_to_free_swap(struct page *); |
334 | struct backing_dev_info; | 333 | struct backing_dev_info; |
335 | 334 | ||
335 | #ifdef CONFIG_HIBERNATION | ||
336 | void hibernation_freeze_swap(void); | ||
337 | void hibernation_thaw_swap(void); | ||
338 | swp_entry_t get_swap_for_hibernation(int type); | ||
339 | void swap_free_for_hibernation(swp_entry_t val); | ||
340 | #endif | ||
341 | |||
336 | /* linux/mm/thrash.c */ | 342 | /* linux/mm/thrash.c */ |
337 | extern struct mm_struct *swap_token_mm; | 343 | extern struct mm_struct *swap_token_mm; |
338 | extern void grab_swap_token(struct mm_struct *); | 344 | extern void grab_swap_token(struct mm_struct *); |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index a6bfd1367d2a..1b67bd333b5e 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -35,6 +35,7 @@ struct oldold_utsname; | |||
35 | struct old_utsname; | 35 | struct old_utsname; |
36 | struct pollfd; | 36 | struct pollfd; |
37 | struct rlimit; | 37 | struct rlimit; |
38 | struct rlimit64; | ||
38 | struct rusage; | 39 | struct rusage; |
39 | struct sched_param; | 40 | struct sched_param; |
40 | struct sel_arg_struct; | 41 | struct sel_arg_struct; |
@@ -644,6 +645,9 @@ asmlinkage long sys_old_getrlimit(unsigned int resource, struct rlimit __user *r | |||
644 | #endif | 645 | #endif |
645 | asmlinkage long sys_setrlimit(unsigned int resource, | 646 | asmlinkage long sys_setrlimit(unsigned int resource, |
646 | struct rlimit __user *rlim); | 647 | struct rlimit __user *rlim); |
648 | asmlinkage long sys_prlimit64(pid_t pid, unsigned int resource, | ||
649 | const struct rlimit64 __user *new_rlim, | ||
650 | struct rlimit64 __user *old_rlim); | ||
647 | asmlinkage long sys_getrusage(int who, struct rusage __user *ru); | 651 | asmlinkage long sys_getrusage(int who, struct rusage __user *ru); |
648 | asmlinkage long sys_umask(int mask); | 652 | asmlinkage long sys_umask(int mask); |
649 | 653 | ||
@@ -811,6 +815,10 @@ asmlinkage long sys_pselect6(int, fd_set __user *, fd_set __user *, | |||
811 | asmlinkage long sys_ppoll(struct pollfd __user *, unsigned int, | 815 | asmlinkage long sys_ppoll(struct pollfd __user *, unsigned int, |
812 | struct timespec __user *, const sigset_t __user *, | 816 | struct timespec __user *, const sigset_t __user *, |
813 | size_t); | 817 | size_t); |
818 | asmlinkage long sys_fanotify_init(unsigned int flags, unsigned int event_f_flags); | ||
819 | asmlinkage long sys_fanotify_mark(int fanotify_fd, unsigned int flags, | ||
820 | u64 mask, int fd, | ||
821 | const char __user *pathname); | ||
814 | 822 | ||
815 | int kernel_execve(const char *filename, char *const argv[], char *const envp[]); | 823 | int kernel_execve(const char *filename, char *const argv[], char *const envp[]); |
816 | 824 | ||
diff --git a/include/linux/topology.h b/include/linux/topology.h index b572e432d2f3..64e084ff5e5c 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h | |||
@@ -292,10 +292,6 @@ static inline void set_cpu_numa_mem(int cpu, int node) | |||
292 | 292 | ||
293 | #else /* !CONFIG_HAVE_MEMORYLESS_NODES */ | 293 | #else /* !CONFIG_HAVE_MEMORYLESS_NODES */ |
294 | 294 | ||
295 | static inline void set_numa_mem(int node) {} | ||
296 | |||
297 | static inline void set_cpu_numa_mem(int cpu, int node) {} | ||
298 | |||
299 | #ifndef numa_mem_id | 295 | #ifndef numa_mem_id |
300 | /* Returns the number of the nearest Node with memory */ | 296 | /* Returns the number of the nearest Node with memory */ |
301 | static inline int numa_mem_id(void) | 297 | static inline int numa_mem_id(void) |
diff --git a/include/linux/tty.h b/include/linux/tty.h index 7802a243ee13..1437da3ddc62 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/tty_driver.h> | 13 | #include <linux/tty_driver.h> |
14 | #include <linux/tty_ldisc.h> | 14 | #include <linux/tty_ldisc.h> |
15 | #include <linux/mutex.h> | 15 | #include <linux/mutex.h> |
16 | #include <linux/smp_lock.h> | ||
16 | 17 | ||
17 | #include <asm/system.h> | 18 | #include <asm/system.h> |
18 | 19 | ||
@@ -179,6 +180,7 @@ struct tty_bufhead { | |||
179 | #define L_FLUSHO(tty) _L_FLAG((tty), FLUSHO) | 180 | #define L_FLUSHO(tty) _L_FLAG((tty), FLUSHO) |
180 | #define L_PENDIN(tty) _L_FLAG((tty), PENDIN) | 181 | #define L_PENDIN(tty) _L_FLAG((tty), PENDIN) |
181 | #define L_IEXTEN(tty) _L_FLAG((tty), IEXTEN) | 182 | #define L_IEXTEN(tty) _L_FLAG((tty), IEXTEN) |
183 | #define L_EXTPROC(tty) _L_FLAG((tty), EXTPROC) | ||
182 | 184 | ||
183 | struct device; | 185 | struct device; |
184 | struct signal_struct; | 186 | struct signal_struct; |
@@ -415,6 +417,7 @@ extern int is_ignored(int sig); | |||
415 | extern int tty_signal(int sig, struct tty_struct *tty); | 417 | extern int tty_signal(int sig, struct tty_struct *tty); |
416 | extern void tty_hangup(struct tty_struct *tty); | 418 | extern void tty_hangup(struct tty_struct *tty); |
417 | extern void tty_vhangup(struct tty_struct *tty); | 419 | extern void tty_vhangup(struct tty_struct *tty); |
420 | extern void tty_vhangup_locked(struct tty_struct *tty); | ||
418 | extern void tty_vhangup_self(void); | 421 | extern void tty_vhangup_self(void); |
419 | extern void tty_unhangup(struct file *filp); | 422 | extern void tty_unhangup(struct file *filp); |
420 | extern int tty_hung_up_p(struct file *filp); | 423 | extern int tty_hung_up_p(struct file *filp); |
@@ -575,5 +578,54 @@ extern int vt_ioctl(struct tty_struct *tty, struct file *file, | |||
575 | extern long vt_compat_ioctl(struct tty_struct *tty, struct file * file, | 578 | extern long vt_compat_ioctl(struct tty_struct *tty, struct file * file, |
576 | unsigned int cmd, unsigned long arg); | 579 | unsigned int cmd, unsigned long arg); |
577 | 580 | ||
581 | /* tty_mutex.c */ | ||
582 | /* functions for preparation of BKL removal */ | ||
583 | extern void __lockfunc tty_lock(void) __acquires(tty_lock); | ||
584 | extern void __lockfunc tty_unlock(void) __releases(tty_lock); | ||
585 | extern struct task_struct *__big_tty_mutex_owner; | ||
586 | #define tty_locked() (current == __big_tty_mutex_owner) | ||
587 | |||
588 | /* | ||
589 | * wait_event_interruptible_tty -- wait for a condition with the tty lock held | ||
590 | * | ||
591 | * The condition we are waiting for might take a long time to | ||
592 | * become true, or might depend on another thread taking the | ||
593 | * BTM. In either case, we need to drop the BTM to guarantee | ||
594 | * forward progress. This is a leftover from the conversion | ||
595 | * from the BKL and should eventually get removed as the BTM | ||
596 | * falls out of use. | ||
597 | * | ||
598 | * Do not use in new code. | ||
599 | */ | ||
600 | #define wait_event_interruptible_tty(wq, condition) \ | ||
601 | ({ \ | ||
602 | int __ret = 0; \ | ||
603 | if (!(condition)) { \ | ||
604 | __wait_event_interruptible_tty(wq, condition, __ret); \ | ||
605 | } \ | ||
606 | __ret; \ | ||
607 | }) | ||
608 | |||
609 | #define __wait_event_interruptible_tty(wq, condition, ret) \ | ||
610 | do { \ | ||
611 | DEFINE_WAIT(__wait); \ | ||
612 | \ | ||
613 | for (;;) { \ | ||
614 | prepare_to_wait(&wq, &__wait, TASK_INTERRUPTIBLE); \ | ||
615 | if (condition) \ | ||
616 | break; \ | ||
617 | if (!signal_pending(current)) { \ | ||
618 | tty_unlock(); \ | ||
619 | schedule(); \ | ||
620 | tty_lock(); \ | ||
621 | continue; \ | ||
622 | } \ | ||
623 | ret = -ERESTARTSYS; \ | ||
624 | break; \ | ||
625 | } \ | ||
626 | finish_wait(&wq, &__wait); \ | ||
627 | } while (0) | ||
628 | |||
629 | |||
578 | #endif /* __KERNEL__ */ | 630 | #endif /* __KERNEL__ */ |
579 | #endif | 631 | #endif |
diff --git a/include/linux/types.h b/include/linux/types.h index 331d8baabcf2..01a082f56ef4 100644 --- a/include/linux/types.h +++ b/include/linux/types.h | |||
@@ -200,6 +200,18 @@ typedef struct { | |||
200 | } atomic64_t; | 200 | } atomic64_t; |
201 | #endif | 201 | #endif |
202 | 202 | ||
203 | struct list_head { | ||
204 | struct list_head *next, *prev; | ||
205 | }; | ||
206 | |||
207 | struct hlist_head { | ||
208 | struct hlist_node *first; | ||
209 | }; | ||
210 | |||
211 | struct hlist_node { | ||
212 | struct hlist_node *next, **pprev; | ||
213 | }; | ||
214 | |||
203 | struct ustat { | 215 | struct ustat { |
204 | __kernel_daddr_t f_tfree; | 216 | __kernel_daddr_t f_tfree; |
205 | __kernel_ino_t f_tinode; | 217 | __kernel_ino_t f_tinode; |
diff --git a/include/linux/usb.h b/include/linux/usb.h index d5922a877994..35fe6ab222bb 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -127,6 +127,8 @@ enum usb_interface_condition { | |||
127 | * queued reset so that usb_cancel_queued_reset() doesn't try to | 127 | * queued reset so that usb_cancel_queued_reset() doesn't try to |
128 | * remove from the workqueue when running inside the worker | 128 | * remove from the workqueue when running inside the worker |
129 | * thread. See __usb_queue_reset_device(). | 129 | * thread. See __usb_queue_reset_device(). |
130 | * @resetting_device: USB core reset the device, so use alt setting 0 as | ||
131 | * current; needs bandwidth alloc after reset. | ||
130 | * | 132 | * |
131 | * USB device drivers attach to interfaces on a physical device. Each | 133 | * USB device drivers attach to interfaces on a physical device. Each |
132 | * interface encapsulates a single high level function, such as feeding | 134 | * interface encapsulates a single high level function, such as feeding |
@@ -843,7 +845,7 @@ struct usb_driver { | |||
843 | 845 | ||
844 | void (*disconnect) (struct usb_interface *intf); | 846 | void (*disconnect) (struct usb_interface *intf); |
845 | 847 | ||
846 | int (*ioctl) (struct usb_interface *intf, unsigned int code, | 848 | int (*unlocked_ioctl) (struct usb_interface *intf, unsigned int code, |
847 | void *buf); | 849 | void *buf); |
848 | 850 | ||
849 | int (*suspend) (struct usb_interface *intf, pm_message_t message); | 851 | int (*suspend) (struct usb_interface *intf, pm_message_t message); |
@@ -1015,6 +1017,7 @@ typedef void (*usb_complete_t)(struct urb *); | |||
1015 | * is a different endpoint (and pipe) from "out" endpoint two. | 1017 | * is a different endpoint (and pipe) from "out" endpoint two. |
1016 | * The current configuration controls the existence, type, and | 1018 | * The current configuration controls the existence, type, and |
1017 | * maximum packet size of any given endpoint. | 1019 | * maximum packet size of any given endpoint. |
1020 | * @stream_id: the endpoint's stream ID for bulk streams | ||
1018 | * @dev: Identifies the USB device to perform the request. | 1021 | * @dev: Identifies the USB device to perform the request. |
1019 | * @status: This is read in non-iso completion functions to get the | 1022 | * @status: This is read in non-iso completion functions to get the |
1020 | * status of the particular request. ISO requests only use it | 1023 | * status of the particular request. ISO requests only use it |
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h index 139353efad34..890bc1472190 100644 --- a/include/linux/usb/composite.h +++ b/include/linux/usb/composite.h | |||
@@ -276,6 +276,8 @@ struct usb_composite_driver { | |||
276 | int (*bind)(struct usb_composite_dev *); | 276 | int (*bind)(struct usb_composite_dev *); |
277 | int (*unbind)(struct usb_composite_dev *); | 277 | int (*unbind)(struct usb_composite_dev *); |
278 | 278 | ||
279 | void (*disconnect)(struct usb_composite_dev *); | ||
280 | |||
279 | /* global suspend hooks */ | 281 | /* global suspend hooks */ |
280 | void (*suspend)(struct usb_composite_dev *); | 282 | void (*suspend)(struct usb_composite_dev *); |
281 | void (*resume)(struct usb_composite_dev *); | 283 | void (*resume)(struct usb_composite_dev *); |
@@ -342,6 +344,10 @@ struct usb_composite_dev { | |||
342 | }; | 344 | }; |
343 | 345 | ||
344 | extern int usb_string_id(struct usb_composite_dev *c); | 346 | extern int usb_string_id(struct usb_composite_dev *c); |
347 | extern int usb_string_ids_tab(struct usb_composite_dev *c, | ||
348 | struct usb_string *str); | ||
349 | extern int usb_string_ids_n(struct usb_composite_dev *c, unsigned n); | ||
350 | |||
345 | 351 | ||
346 | /* messaging utils */ | 352 | /* messaging utils */ |
347 | #define DBG(d, fmt, args...) \ | 353 | #define DBG(d, fmt, args...) \ |
diff --git a/include/linux/usb/ehci_def.h b/include/linux/usb/ehci_def.h index 80287af2a738..2e262cb15425 100644 --- a/include/linux/usb/ehci_def.h +++ b/include/linux/usb/ehci_def.h | |||
@@ -39,6 +39,12 @@ struct ehci_caps { | |||
39 | #define HCS_N_PORTS(p) (((p)>>0)&0xf) /* bits 3:0, ports on HC */ | 39 | #define HCS_N_PORTS(p) (((p)>>0)&0xf) /* bits 3:0, ports on HC */ |
40 | 40 | ||
41 | u32 hcc_params; /* HCCPARAMS - offset 0x8 */ | 41 | u32 hcc_params; /* HCCPARAMS - offset 0x8 */ |
42 | /* EHCI 1.1 addendum */ | ||
43 | #define HCC_32FRAME_PERIODIC_LIST(p) ((p)&(1 << 19)) | ||
44 | #define HCC_PER_PORT_CHANGE_EVENT(p) ((p)&(1 << 18)) | ||
45 | #define HCC_LPM(p) ((p)&(1 << 17)) | ||
46 | #define HCC_HW_PREFETCH(p) ((p)&(1 << 16)) | ||
47 | |||
42 | #define HCC_EXT_CAPS(p) (((p)>>8)&0xff) /* for pci extended caps */ | 48 | #define HCC_EXT_CAPS(p) (((p)>>8)&0xff) /* for pci extended caps */ |
43 | #define HCC_ISOC_CACHE(p) ((p)&(1 << 7)) /* true: can cache isoc frame */ | 49 | #define HCC_ISOC_CACHE(p) ((p)&(1 << 7)) /* true: can cache isoc frame */ |
44 | #define HCC_ISOC_THRES(p) (((p)>>4)&0x7) /* bits 6:4, uframes cached */ | 50 | #define HCC_ISOC_THRES(p) (((p)>>4)&0x7) /* bits 6:4, uframes cached */ |
@@ -54,6 +60,13 @@ struct ehci_regs { | |||
54 | 60 | ||
55 | /* USBCMD: offset 0x00 */ | 61 | /* USBCMD: offset 0x00 */ |
56 | u32 command; | 62 | u32 command; |
63 | |||
64 | /* EHCI 1.1 addendum */ | ||
65 | #define CMD_HIRD (0xf<<24) /* host initiated resume duration */ | ||
66 | #define CMD_PPCEE (1<<15) /* per port change event enable */ | ||
67 | #define CMD_FSP (1<<14) /* fully synchronized prefetch */ | ||
68 | #define CMD_ASPE (1<<13) /* async schedule prefetch enable */ | ||
69 | #define CMD_PSPE (1<<12) /* periodic schedule prefetch enable */ | ||
57 | /* 23:16 is r/w intr rate, in microframes; default "8" == 1/msec */ | 70 | /* 23:16 is r/w intr rate, in microframes; default "8" == 1/msec */ |
58 | #define CMD_PARK (1<<11) /* enable "park" on async qh */ | 71 | #define CMD_PARK (1<<11) /* enable "park" on async qh */ |
59 | #define CMD_PARK_CNT(c) (((c)>>8)&3) /* how many transfers to park for */ | 72 | #define CMD_PARK_CNT(c) (((c)>>8)&3) /* how many transfers to park for */ |
@@ -67,6 +80,7 @@ struct ehci_regs { | |||
67 | 80 | ||
68 | /* USBSTS: offset 0x04 */ | 81 | /* USBSTS: offset 0x04 */ |
69 | u32 status; | 82 | u32 status; |
83 | #define STS_PPCE_MASK (0xff<<16) /* Per-Port change event 1-16 */ | ||
70 | #define STS_ASS (1<<15) /* Async Schedule Status */ | 84 | #define STS_ASS (1<<15) /* Async Schedule Status */ |
71 | #define STS_PSS (1<<14) /* Periodic Schedule Status */ | 85 | #define STS_PSS (1<<14) /* Periodic Schedule Status */ |
72 | #define STS_RECL (1<<13) /* Reclamation */ | 86 | #define STS_RECL (1<<13) /* Reclamation */ |
@@ -100,6 +114,14 @@ struct ehci_regs { | |||
100 | 114 | ||
101 | /* PORTSC: offset 0x44 */ | 115 | /* PORTSC: offset 0x44 */ |
102 | u32 port_status[0]; /* up to N_PORTS */ | 116 | u32 port_status[0]; /* up to N_PORTS */ |
117 | /* EHCI 1.1 addendum */ | ||
118 | #define PORTSC_SUSPEND_STS_ACK 0 | ||
119 | #define PORTSC_SUSPEND_STS_NYET 1 | ||
120 | #define PORTSC_SUSPEND_STS_STALL 2 | ||
121 | #define PORTSC_SUSPEND_STS_ERR 3 | ||
122 | |||
123 | #define PORT_DEV_ADDR (0x7f<<25) /* device address */ | ||
124 | #define PORT_SSTS (0x3<<23) /* suspend status */ | ||
103 | /* 31:23 reserved */ | 125 | /* 31:23 reserved */ |
104 | #define PORT_WKOC_E (1<<22) /* wake on overcurrent (enable) */ | 126 | #define PORT_WKOC_E (1<<22) /* wake on overcurrent (enable) */ |
105 | #define PORT_WKDISC_E (1<<21) /* wake on disconnect (enable) */ | 127 | #define PORT_WKDISC_E (1<<21) /* wake on disconnect (enable) */ |
@@ -115,6 +137,7 @@ struct ehci_regs { | |||
115 | #define PORT_USB11(x) (((x)&(3<<10)) == (1<<10)) /* USB 1.1 device */ | 137 | #define PORT_USB11(x) (((x)&(3<<10)) == (1<<10)) /* USB 1.1 device */ |
116 | /* 11:10 for detecting lowspeed devices (reset vs release ownership) */ | 138 | /* 11:10 for detecting lowspeed devices (reset vs release ownership) */ |
117 | /* 9 reserved */ | 139 | /* 9 reserved */ |
140 | #define PORT_LPM (1<<9) /* LPM transaction */ | ||
118 | #define PORT_RESET (1<<8) /* reset port */ | 141 | #define PORT_RESET (1<<8) /* reset port */ |
119 | #define PORT_SUSPEND (1<<7) /* suspend port */ | 142 | #define PORT_SUSPEND (1<<7) /* suspend port */ |
120 | #define PORT_RESUME (1<<6) /* resume it */ | 143 | #define PORT_RESUME (1<<6) /* resume it */ |
diff --git a/include/linux/usb/functionfs.h b/include/linux/usb/functionfs.h index a34a2a043b21..6f649c13193b 100644 --- a/include/linux/usb/functionfs.h +++ b/include/linux/usb/functionfs.h | |||
@@ -180,9 +180,9 @@ static int functionfs_bind(struct ffs_data *ffs, struct usb_composite_dev *cdev) | |||
180 | static void functionfs_unbind(struct ffs_data *ffs) | 180 | static void functionfs_unbind(struct ffs_data *ffs) |
181 | __attribute__((nonnull)); | 181 | __attribute__((nonnull)); |
182 | 182 | ||
183 | static int functionfs_add(struct usb_composite_dev *cdev, | 183 | static int functionfs_bind_config(struct usb_composite_dev *cdev, |
184 | struct usb_configuration *c, | 184 | struct usb_configuration *c, |
185 | struct ffs_data *ffs) | 185 | struct ffs_data *ffs) |
186 | __attribute__((warn_unused_result, nonnull)); | 186 | __attribute__((warn_unused_result, nonnull)); |
187 | 187 | ||
188 | 188 | ||
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index 2e3a4ea1a3da..3b571f1ffbb3 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h | |||
@@ -89,18 +89,33 @@ struct usb_hcd { | |||
89 | */ | 89 | */ |
90 | const struct hc_driver *driver; /* hw-specific hooks */ | 90 | const struct hc_driver *driver; /* hw-specific hooks */ |
91 | 91 | ||
92 | /* Flags that need to be manipulated atomically */ | 92 | /* Flags that need to be manipulated atomically because they can |
93 | * change while the host controller is running. Always use | ||
94 | * set_bit() or clear_bit() to change their values. | ||
95 | */ | ||
93 | unsigned long flags; | 96 | unsigned long flags; |
94 | #define HCD_FLAG_HW_ACCESSIBLE 0x00000001 | 97 | #define HCD_FLAG_HW_ACCESSIBLE 0 /* at full power */ |
95 | #define HCD_FLAG_SAW_IRQ 0x00000002 | 98 | #define HCD_FLAG_SAW_IRQ 1 |
99 | #define HCD_FLAG_POLL_RH 2 /* poll for rh status? */ | ||
100 | #define HCD_FLAG_POLL_PENDING 3 /* status has changed? */ | ||
101 | #define HCD_FLAG_WAKEUP_PENDING 4 /* root hub is resuming? */ | ||
102 | |||
103 | /* The flags can be tested using these macros; they are likely to | ||
104 | * be slightly faster than test_bit(). | ||
105 | */ | ||
106 | #define HCD_HW_ACCESSIBLE(hcd) ((hcd)->flags & (1U << HCD_FLAG_HW_ACCESSIBLE)) | ||
107 | #define HCD_SAW_IRQ(hcd) ((hcd)->flags & (1U << HCD_FLAG_SAW_IRQ)) | ||
108 | #define HCD_POLL_RH(hcd) ((hcd)->flags & (1U << HCD_FLAG_POLL_RH)) | ||
109 | #define HCD_POLL_PENDING(hcd) ((hcd)->flags & (1U << HCD_FLAG_POLL_PENDING)) | ||
110 | #define HCD_WAKEUP_PENDING(hcd) ((hcd)->flags & (1U << HCD_FLAG_WAKEUP_PENDING)) | ||
96 | 111 | ||
112 | /* Flags that get set only during HCD registration or removal. */ | ||
97 | unsigned rh_registered:1;/* is root hub registered? */ | 113 | unsigned rh_registered:1;/* is root hub registered? */ |
114 | unsigned rh_pollable:1; /* may we poll the root hub? */ | ||
98 | 115 | ||
99 | /* The next flag is a stopgap, to be removed when all the HCDs | 116 | /* The next flag is a stopgap, to be removed when all the HCDs |
100 | * support the new root-hub polling mechanism. */ | 117 | * support the new root-hub polling mechanism. */ |
101 | unsigned uses_new_polling:1; | 118 | unsigned uses_new_polling:1; |
102 | unsigned poll_rh:1; /* poll for rh status? */ | ||
103 | unsigned poll_pending:1; /* status has changed? */ | ||
104 | unsigned wireless:1; /* Wireless USB HCD */ | 119 | unsigned wireless:1; /* Wireless USB HCD */ |
105 | unsigned authorized_default:1; | 120 | unsigned authorized_default:1; |
106 | unsigned has_tt:1; /* Integrated TT in root hub */ | 121 | unsigned has_tt:1; /* Integrated TT in root hub */ |
@@ -198,7 +213,7 @@ struct hc_driver { | |||
198 | * a whole, not just the root hub; they're for PCI bus glue. | 213 | * a whole, not just the root hub; they're for PCI bus glue. |
199 | */ | 214 | */ |
200 | /* called after suspending the hub, before entering D3 etc */ | 215 | /* called after suspending the hub, before entering D3 etc */ |
201 | int (*pci_suspend)(struct usb_hcd *hcd); | 216 | int (*pci_suspend)(struct usb_hcd *hcd, bool do_wakeup); |
202 | 217 | ||
203 | /* called after entering D0 (etc), before resuming the hub */ | 218 | /* called after entering D0 (etc), before resuming the hub */ |
204 | int (*pci_resume)(struct usb_hcd *hcd, bool hibernated); | 219 | int (*pci_resume)(struct usb_hcd *hcd, bool hibernated); |
@@ -299,6 +314,10 @@ struct hc_driver { | |||
299 | int (*update_hub_device)(struct usb_hcd *, struct usb_device *hdev, | 314 | int (*update_hub_device)(struct usb_hcd *, struct usb_device *hdev, |
300 | struct usb_tt *tt, gfp_t mem_flags); | 315 | struct usb_tt *tt, gfp_t mem_flags); |
301 | int (*reset_device)(struct usb_hcd *, struct usb_device *); | 316 | int (*reset_device)(struct usb_hcd *, struct usb_device *); |
317 | /* Notifies the HCD after a device is connected and its | ||
318 | * address is set | ||
319 | */ | ||
320 | int (*update_device)(struct usb_hcd *, struct usb_device *); | ||
302 | }; | 321 | }; |
303 | 322 | ||
304 | extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb); | 323 | extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb); |
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h index f8302d036a76..545cba73ccaf 100644 --- a/include/linux/usb/otg.h +++ b/include/linux/usb/otg.h | |||
@@ -43,13 +43,6 @@ enum usb_xceiv_events { | |||
43 | USB_EVENT_ENUMERATED, /* gadget driver enumerated */ | 43 | USB_EVENT_ENUMERATED, /* gadget driver enumerated */ |
44 | }; | 44 | }; |
45 | 45 | ||
46 | #define USB_OTG_PULLUP_ID (1 << 0) | ||
47 | #define USB_OTG_PULLDOWN_DP (1 << 1) | ||
48 | #define USB_OTG_PULLDOWN_DM (1 << 2) | ||
49 | #define USB_OTG_EXT_VBUS_INDICATOR (1 << 3) | ||
50 | #define USB_OTG_DRV_VBUS (1 << 4) | ||
51 | #define USB_OTG_DRV_VBUS_EXT (1 << 5) | ||
52 | |||
53 | struct otg_transceiver; | 46 | struct otg_transceiver; |
54 | 47 | ||
55 | /* for transceivers connected thru an ULPI interface, the user must | 48 | /* for transceivers connected thru an ULPI interface, the user must |
@@ -146,10 +139,10 @@ static inline int otg_io_read(struct otg_transceiver *otg, u32 reg) | |||
146 | return -EINVAL; | 139 | return -EINVAL; |
147 | } | 140 | } |
148 | 141 | ||
149 | static inline int otg_io_write(struct otg_transceiver *otg, u32 reg, u32 val) | 142 | static inline int otg_io_write(struct otg_transceiver *otg, u32 val, u32 reg) |
150 | { | 143 | { |
151 | if (otg->io_ops && otg->io_ops->write) | 144 | if (otg->io_ops && otg->io_ops->write) |
152 | return otg->io_ops->write(otg, reg, val); | 145 | return otg->io_ops->write(otg, val, reg); |
153 | 146 | ||
154 | return -EINVAL; | 147 | return -EINVAL; |
155 | } | 148 | } |
diff --git a/include/linux/usb/quirks.h b/include/linux/usb/quirks.h index 16b7f3347545..3e93de7ecbc3 100644 --- a/include/linux/usb/quirks.h +++ b/include/linux/usb/quirks.h | |||
@@ -26,4 +26,8 @@ | |||
26 | and can't handle talking to these interfaces */ | 26 | and can't handle talking to these interfaces */ |
27 | #define USB_QUIRK_HONOR_BNUMINTERFACES 0x00000020 | 27 | #define USB_QUIRK_HONOR_BNUMINTERFACES 0x00000020 |
28 | 28 | ||
29 | /* device needs a pause during initialization, after we read the device | ||
30 | descriptor */ | ||
31 | #define USB_QUIRK_DELAY_INIT 0x00000040 | ||
32 | |||
29 | #endif /* __LINUX_USB_QUIRKS_H */ | 33 | #endif /* __LINUX_USB_QUIRKS_H */ |
diff --git a/include/linux/usb/ulpi.h b/include/linux/usb/ulpi.h index 2369d07c3c87..82b1507f4735 100644 --- a/include/linux/usb/ulpi.h +++ b/include/linux/usb/ulpi.h | |||
@@ -11,6 +11,42 @@ | |||
11 | #ifndef __LINUX_USB_ULPI_H | 11 | #ifndef __LINUX_USB_ULPI_H |
12 | #define __LINUX_USB_ULPI_H | 12 | #define __LINUX_USB_ULPI_H |
13 | 13 | ||
14 | #include <linux/usb/otg.h> | ||
15 | /*-------------------------------------------------------------------------*/ | ||
16 | |||
17 | /* | ||
18 | * ULPI Flags | ||
19 | */ | ||
20 | #define ULPI_OTG_ID_PULLUP (1 << 0) | ||
21 | #define ULPI_OTG_DP_PULLDOWN_DIS (1 << 1) | ||
22 | #define ULPI_OTG_DM_PULLDOWN_DIS (1 << 2) | ||
23 | #define ULPI_OTG_DISCHRGVBUS (1 << 3) | ||
24 | #define ULPI_OTG_CHRGVBUS (1 << 4) | ||
25 | #define ULPI_OTG_DRVVBUS (1 << 5) | ||
26 | #define ULPI_OTG_DRVVBUS_EXT (1 << 6) | ||
27 | #define ULPI_OTG_EXTVBUSIND (1 << 7) | ||
28 | |||
29 | #define ULPI_IC_6PIN_SERIAL (1 << 8) | ||
30 | #define ULPI_IC_3PIN_SERIAL (1 << 9) | ||
31 | #define ULPI_IC_CARKIT (1 << 10) | ||
32 | #define ULPI_IC_CLKSUSPM (1 << 11) | ||
33 | #define ULPI_IC_AUTORESUME (1 << 12) | ||
34 | #define ULPI_IC_EXTVBUS_INDINV (1 << 13) | ||
35 | #define ULPI_IC_IND_PASSTHRU (1 << 14) | ||
36 | #define ULPI_IC_PROTECT_DIS (1 << 15) | ||
37 | |||
38 | #define ULPI_FC_HS (1 << 16) | ||
39 | #define ULPI_FC_FS (1 << 17) | ||
40 | #define ULPI_FC_LS (1 << 18) | ||
41 | #define ULPI_FC_FS4LS (1 << 19) | ||
42 | #define ULPI_FC_TERMSEL (1 << 20) | ||
43 | #define ULPI_FC_OP_NORM (1 << 21) | ||
44 | #define ULPI_FC_OP_NODRV (1 << 22) | ||
45 | #define ULPI_FC_OP_DIS_NRZI (1 << 23) | ||
46 | #define ULPI_FC_OP_NSYNC_NEOP (1 << 24) | ||
47 | #define ULPI_FC_RST (1 << 25) | ||
48 | #define ULPI_FC_SUSPM (1 << 26) | ||
49 | |||
14 | /*-------------------------------------------------------------------------*/ | 50 | /*-------------------------------------------------------------------------*/ |
15 | 51 | ||
16 | /* | 52 | /* |
@@ -58,6 +94,10 @@ | |||
58 | 94 | ||
59 | /*-------------------------------------------------------------------------*/ | 95 | /*-------------------------------------------------------------------------*/ |
60 | 96 | ||
97 | /* | ||
98 | * Register Bits | ||
99 | */ | ||
100 | |||
61 | /* Function Control */ | 101 | /* Function Control */ |
62 | #define ULPI_FUNC_CTRL_XCVRSEL (1 << 0) | 102 | #define ULPI_FUNC_CTRL_XCVRSEL (1 << 0) |
63 | #define ULPI_FUNC_CTRL_XCVRSEL_MASK (3 << 0) | 103 | #define ULPI_FUNC_CTRL_XCVRSEL_MASK (3 << 0) |
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h index 7f56db4a79f0..6625cc1ab758 100644 --- a/include/linux/vt_kern.h +++ b/include/linux/vt_kern.h | |||
@@ -76,17 +76,52 @@ int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc); | |||
76 | #define vc_translate(vc, c) ((vc)->vc_translate[(c) | \ | 76 | #define vc_translate(vc, c) ((vc)->vc_translate[(c) | \ |
77 | ((vc)->vc_toggle_meta ? 0x80 : 0)]) | 77 | ((vc)->vc_toggle_meta ? 0x80 : 0)]) |
78 | #else | 78 | #else |
79 | #define con_set_trans_old(arg) (0) | 79 | static inline int con_set_trans_old(unsigned char __user *table) |
80 | #define con_get_trans_old(arg) (-EINVAL) | 80 | { |
81 | #define con_set_trans_new(arg) (0) | 81 | return 0; |
82 | #define con_get_trans_new(arg) (-EINVAL) | 82 | } |
83 | #define con_clear_unimap(vc, ui) (0) | 83 | static inline int con_get_trans_old(unsigned char __user *table) |
84 | #define con_set_unimap(vc, ct, list) (0) | 84 | { |
85 | #define con_set_default_unimap(vc) (0) | 85 | return -EINVAL; |
86 | #define con_copy_unimap(d, s) (0) | 86 | } |
87 | #define con_get_unimap(vc, ct, uct, list) (-EINVAL) | 87 | static inline int con_set_trans_new(unsigned short __user *table) |
88 | #define con_free_unimap(vc) do { ; } while (0) | 88 | { |
89 | #define con_protect_unimap(vc, rdonly) do { ; } while (0) | 89 | return 0; |
90 | } | ||
91 | static inline int con_get_trans_new(unsigned short __user *table) | ||
92 | { | ||
93 | return -EINVAL; | ||
94 | } | ||
95 | static inline int con_clear_unimap(struct vc_data *vc, struct unimapinit *ui) | ||
96 | { | ||
97 | return 0; | ||
98 | } | ||
99 | static inline | ||
100 | int con_set_unimap(struct vc_data *vc, ushort ct, struct unipair __user *list) | ||
101 | { | ||
102 | return 0; | ||
103 | } | ||
104 | static inline | ||
105 | int con_get_unimap(struct vc_data *vc, ushort ct, ushort __user *uct, | ||
106 | struct unipair __user *list) | ||
107 | { | ||
108 | return -EINVAL; | ||
109 | } | ||
110 | static inline int con_set_default_unimap(struct vc_data *vc) | ||
111 | { | ||
112 | return 0; | ||
113 | } | ||
114 | static inline void con_free_unimap(struct vc_data *vc) | ||
115 | { | ||
116 | } | ||
117 | static inline void con_protect_unimap(struct vc_data *vc, int rdonly) | ||
118 | { | ||
119 | } | ||
120 | static inline | ||
121 | int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc) | ||
122 | { | ||
123 | return 0; | ||
124 | } | ||
90 | 125 | ||
91 | #define vc_translate(vc, c) (c) | 126 | #define vc_translate(vc, c) (c) |
92 | #endif | 127 | #endif |
@@ -100,6 +135,13 @@ extern int unbind_con_driver(const struct consw *csw, int first, int last, | |||
100 | int deflt); | 135 | int deflt); |
101 | int vty_init(const struct file_operations *console_fops); | 136 | int vty_init(const struct file_operations *console_fops); |
102 | 137 | ||
138 | static inline bool vt_force_oops_output(struct vc_data *vc) | ||
139 | { | ||
140 | if (oops_in_progress && vc->vc_panic_force_write) | ||
141 | return true; | ||
142 | return false; | ||
143 | } | ||
144 | |||
103 | /* | 145 | /* |
104 | * vc_screen.c shares this temporary buffer with the console write code so that | 146 | * vc_screen.c shares this temporary buffer with the console write code so that |
105 | * we can easily avoid touching user space while holding the console spinlock. | 147 | * we can easily avoid touching user space while holding the console spinlock. |