diff options
Diffstat (limited to 'include')
86 files changed, 878 insertions, 2609 deletions
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h index 204bed37e82d..485eeb6c4ef3 100644 --- a/include/asm-generic/gpio.h +++ b/include/asm-generic/gpio.h | |||
@@ -145,6 +145,7 @@ extern int __gpio_to_irq(unsigned gpio); | |||
145 | extern int gpio_export(unsigned gpio, bool direction_may_change); | 145 | extern int gpio_export(unsigned gpio, bool direction_may_change); |
146 | extern int gpio_export_link(struct device *dev, const char *name, | 146 | extern int gpio_export_link(struct device *dev, const char *name, |
147 | unsigned gpio); | 147 | unsigned gpio); |
148 | extern int gpio_sysfs_set_active_low(unsigned gpio, int value); | ||
148 | extern void gpio_unexport(unsigned gpio); | 149 | extern void gpio_unexport(unsigned gpio); |
149 | 150 | ||
150 | #endif /* CONFIG_GPIO_SYSFS */ | 151 | #endif /* CONFIG_GPIO_SYSFS */ |
@@ -197,6 +198,11 @@ static inline int gpio_export_link(struct device *dev, const char *name, | |||
197 | return -ENOSYS; | 198 | return -ENOSYS; |
198 | } | 199 | } |
199 | 200 | ||
201 | static inline int gpio_sysfs_set_active_low(unsigned gpio, int value) | ||
202 | { | ||
203 | return -ENOSYS; | ||
204 | } | ||
205 | |||
200 | static inline void gpio_unexport(unsigned gpio) | 206 | static inline void gpio_unexport(unsigned gpio) |
201 | { | 207 | { |
202 | } | 208 | } |
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index b6e818f4b247..67e652068e0e 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
@@ -52,8 +52,12 @@ | |||
52 | #define LOAD_OFFSET 0 | 52 | #define LOAD_OFFSET 0 |
53 | #endif | 53 | #endif |
54 | 54 | ||
55 | #ifndef VMLINUX_SYMBOL | 55 | #ifndef SYMBOL_PREFIX |
56 | #define VMLINUX_SYMBOL(_sym_) _sym_ | 56 | #define VMLINUX_SYMBOL(sym) sym |
57 | #else | ||
58 | #define PASTE2(x,y) x##y | ||
59 | #define PASTE(x,y) PASTE2(x,y) | ||
60 | #define VMLINUX_SYMBOL(sym) PASTE(SYMBOL_PREFIX, sym) | ||
57 | #endif | 61 | #endif |
58 | 62 | ||
59 | /* Align . to a 8 byte boundary equals to maximum function alignment. */ | 63 | /* Align . to a 8 byte boundary equals to maximum function alignment. */ |
diff --git a/include/linux/aio.h b/include/linux/aio.h index aea219d7d8d1..811dbb369379 100644 --- a/include/linux/aio.h +++ b/include/linux/aio.h | |||
@@ -102,7 +102,6 @@ struct kiocb { | |||
102 | } ki_obj; | 102 | } ki_obj; |
103 | 103 | ||
104 | __u64 ki_user_data; /* user's data for completion */ | 104 | __u64 ki_user_data; /* user's data for completion */ |
105 | wait_queue_t ki_wait; | ||
106 | loff_t ki_pos; | 105 | loff_t ki_pos; |
107 | 106 | ||
108 | void *private; | 107 | void *private; |
@@ -140,7 +139,6 @@ struct kiocb { | |||
140 | (x)->ki_dtor = NULL; \ | 139 | (x)->ki_dtor = NULL; \ |
141 | (x)->ki_obj.tsk = tsk; \ | 140 | (x)->ki_obj.tsk = tsk; \ |
142 | (x)->ki_user_data = 0; \ | 141 | (x)->ki_user_data = 0; \ |
143 | init_wait((&(x)->ki_wait)); \ | ||
144 | } while (0) | 142 | } while (0) |
145 | 143 | ||
146 | #define AIO_RING_MAGIC 0xa10a10a1 | 144 | #define AIO_RING_MAGIC 0xa10a10a1 |
@@ -223,8 +221,6 @@ struct mm_struct; | |||
223 | static inline void exit_aio(struct mm_struct *mm) { } | 221 | static inline void exit_aio(struct mm_struct *mm) { } |
224 | #endif /* CONFIG_AIO */ | 222 | #endif /* CONFIG_AIO */ |
225 | 223 | ||
226 | #define io_wait_to_kiocb(wait) container_of(wait, struct kiocb, ki_wait) | ||
227 | |||
228 | static inline struct kiocb *list_kiocb(struct list_head *h) | 224 | static inline struct kiocb *list_kiocb(struct list_head *h) |
229 | { | 225 | { |
230 | return list_entry(h, struct kiocb, ki_list); | 226 | return list_entry(h, struct kiocb, ki_list); |
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h index 756d78b8c1c5..daf8c480c786 100644 --- a/include/linux/bitmap.h +++ b/include/linux/bitmap.h | |||
@@ -42,6 +42,9 @@ | |||
42 | * bitmap_empty(src, nbits) Are all bits zero in *src? | 42 | * bitmap_empty(src, nbits) Are all bits zero in *src? |
43 | * bitmap_full(src, nbits) Are all bits set in *src? | 43 | * bitmap_full(src, nbits) Are all bits set in *src? |
44 | * bitmap_weight(src, nbits) Hamming Weight: number set bits | 44 | * bitmap_weight(src, nbits) Hamming Weight: number set bits |
45 | * bitmap_set(dst, pos, nbits) Set specified bit area | ||
46 | * bitmap_clear(dst, pos, nbits) Clear specified bit area | ||
47 | * bitmap_find_next_zero_area(buf, len, pos, n, mask) Find bit free area | ||
45 | * bitmap_shift_right(dst, src, n, nbits) *dst = *src >> n | 48 | * bitmap_shift_right(dst, src, n, nbits) *dst = *src >> n |
46 | * bitmap_shift_left(dst, src, n, nbits) *dst = *src << n | 49 | * bitmap_shift_left(dst, src, n, nbits) *dst = *src << n |
47 | * bitmap_remap(dst, src, old, new, nbits) *dst = map(old, new)(src) | 50 | * bitmap_remap(dst, src, old, new, nbits) *dst = map(old, new)(src) |
@@ -108,6 +111,14 @@ extern int __bitmap_subset(const unsigned long *bitmap1, | |||
108 | const unsigned long *bitmap2, int bits); | 111 | const unsigned long *bitmap2, int bits); |
109 | extern int __bitmap_weight(const unsigned long *bitmap, int bits); | 112 | extern int __bitmap_weight(const unsigned long *bitmap, int bits); |
110 | 113 | ||
114 | extern void bitmap_set(unsigned long *map, int i, int len); | ||
115 | extern void bitmap_clear(unsigned long *map, int start, int nr); | ||
116 | extern unsigned long bitmap_find_next_zero_area(unsigned long *map, | ||
117 | unsigned long size, | ||
118 | unsigned long start, | ||
119 | unsigned int nr, | ||
120 | unsigned long align_mask); | ||
121 | |||
111 | extern int bitmap_scnprintf(char *buf, unsigned int len, | 122 | extern int bitmap_scnprintf(char *buf, unsigned int len, |
112 | const unsigned long *src, int nbits); | 123 | const unsigned long *src, int nbits); |
113 | extern int __bitmap_parse(const char *buf, unsigned int buflen, int is_user, | 124 | extern int __bitmap_parse(const char *buf, unsigned int buflen, int is_user, |
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h index 1ed2a5cc03f5..3db7767d2a17 100644 --- a/include/linux/can/dev.h +++ b/include/linux/can/dev.h | |||
@@ -51,6 +51,15 @@ struct can_priv { | |||
51 | struct sk_buff **echo_skb; | 51 | struct sk_buff **echo_skb; |
52 | }; | 52 | }; |
53 | 53 | ||
54 | /* | ||
55 | * get_can_dlc(value) - helper macro to cast a given data length code (dlc) | ||
56 | * to __u8 and ensure the dlc value to be max. 8 bytes. | ||
57 | * | ||
58 | * To be used in the CAN netdriver receive path to ensure conformance with | ||
59 | * ISO 11898-1 Chapter 8.4.2.3 (DLC field) | ||
60 | */ | ||
61 | #define get_can_dlc(i) (min_t(__u8, (i), 8)) | ||
62 | |||
54 | struct net_device *alloc_candev(int sizeof_priv, unsigned int echo_skb_max); | 63 | struct net_device *alloc_candev(int sizeof_priv, unsigned int echo_skb_max); |
55 | void free_candev(struct net_device *dev); | 64 | void free_candev(struct net_device *dev); |
56 | 65 | ||
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 2b9f2ac7ed60..78784982b33e 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
@@ -74,7 +74,7 @@ enum dma_transaction_type { | |||
74 | * control completion, and communicate status. | 74 | * control completion, and communicate status. |
75 | * @DMA_PREP_INTERRUPT - trigger an interrupt (callback) upon completion of | 75 | * @DMA_PREP_INTERRUPT - trigger an interrupt (callback) upon completion of |
76 | * this transaction | 76 | * this transaction |
77 | * @DMA_CTRL_ACK - the descriptor cannot be reused until the client | 77 | * @DMA_CTRL_ACK - if clear, the descriptor cannot be reused until the client |
78 | * acknowledges receipt, i.e. has has a chance to establish any dependency | 78 | * acknowledges receipt, i.e. has has a chance to establish any dependency |
79 | * chains | 79 | * chains |
80 | * @DMA_COMPL_SKIP_SRC_UNMAP - set to disable dma-unmapping the source buffer(s) | 80 | * @DMA_COMPL_SKIP_SRC_UNMAP - set to disable dma-unmapping the source buffer(s) |
diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h index 27e772cefb6a..dc12f416a49f 100644 --- a/include/linux/exportfs.h +++ b/include/linux/exportfs.h | |||
@@ -97,7 +97,7 @@ struct fid { | |||
97 | * @get_name: find the name for a given inode in a given directory | 97 | * @get_name: find the name for a given inode in a given directory |
98 | * @get_parent: find the parent of a given directory | 98 | * @get_parent: find the parent of a given directory |
99 | * | 99 | * |
100 | * See Documentation/filesystems/Exporting for details on how to use | 100 | * See Documentation/filesystems/nfs/Exporting for details on how to use |
101 | * this interface correctly. | 101 | * this interface correctly. |
102 | * | 102 | * |
103 | * encode_fh: | 103 | * encode_fh: |
diff --git a/include/linux/fs.h b/include/linux/fs.h index a057f48eb156..b23a7018eb90 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -2264,9 +2264,11 @@ ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, | |||
2264 | int lock_type); | 2264 | int lock_type); |
2265 | 2265 | ||
2266 | enum { | 2266 | enum { |
2267 | DIO_LOCKING = 1, /* need locking between buffered and direct access */ | 2267 | /* need locking between buffered and direct access */ |
2268 | DIO_NO_LOCKING, /* bdev; no locking at all between buffered/direct */ | 2268 | DIO_LOCKING = 0x01, |
2269 | DIO_OWN_LOCKING, /* filesystem locks buffered and direct internally */ | 2269 | |
2270 | /* filesystem does not support filling holes */ | ||
2271 | DIO_SKIP_HOLES = 0x02, | ||
2270 | }; | 2272 | }; |
2271 | 2273 | ||
2272 | static inline ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb, | 2274 | static inline ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb, |
@@ -2275,7 +2277,8 @@ static inline ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb, | |||
2275 | dio_iodone_t end_io) | 2277 | dio_iodone_t end_io) |
2276 | { | 2278 | { |
2277 | return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, | 2279 | return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, |
2278 | nr_segs, get_block, end_io, DIO_LOCKING); | 2280 | nr_segs, get_block, end_io, |
2281 | DIO_LOCKING | DIO_SKIP_HOLES); | ||
2279 | } | 2282 | } |
2280 | 2283 | ||
2281 | static inline ssize_t blockdev_direct_IO_no_locking(int rw, struct kiocb *iocb, | 2284 | static inline ssize_t blockdev_direct_IO_no_locking(int rw, struct kiocb *iocb, |
@@ -2284,16 +2287,7 @@ static inline ssize_t blockdev_direct_IO_no_locking(int rw, struct kiocb *iocb, | |||
2284 | dio_iodone_t end_io) | 2287 | dio_iodone_t end_io) |
2285 | { | 2288 | { |
2286 | return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, | 2289 | return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, |
2287 | nr_segs, get_block, end_io, DIO_NO_LOCKING); | 2290 | nr_segs, get_block, end_io, 0); |
2288 | } | ||
2289 | |||
2290 | static inline ssize_t blockdev_direct_IO_own_locking(int rw, struct kiocb *iocb, | ||
2291 | struct inode *inode, struct block_device *bdev, const struct iovec *iov, | ||
2292 | loff_t offset, unsigned long nr_segs, get_block_t get_block, | ||
2293 | dio_iodone_t end_io) | ||
2294 | { | ||
2295 | return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, | ||
2296 | nr_segs, get_block, end_io, DIO_OWN_LOCKING); | ||
2297 | } | 2291 | } |
2298 | #endif | 2292 | #endif |
2299 | 2293 | ||
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 38f8d6553831..2233c98d80df 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
@@ -131,7 +131,7 @@ struct ftrace_event_call { | |||
131 | void *mod; | 131 | void *mod; |
132 | void *data; | 132 | void *data; |
133 | 133 | ||
134 | atomic_t profile_count; | 134 | int profile_count; |
135 | int (*profile_enable)(struct ftrace_event_call *); | 135 | int (*profile_enable)(struct ftrace_event_call *); |
136 | void (*profile_disable)(struct ftrace_event_call *); | 136 | void (*profile_disable)(struct ftrace_event_call *); |
137 | }; | 137 | }; |
@@ -158,7 +158,7 @@ enum { | |||
158 | FILTER_PTR_STRING, | 158 | FILTER_PTR_STRING, |
159 | }; | 159 | }; |
160 | 160 | ||
161 | extern int trace_define_common_fields(struct ftrace_event_call *call); | 161 | extern int trace_event_raw_init(struct ftrace_event_call *call); |
162 | extern int trace_define_field(struct ftrace_event_call *call, const char *type, | 162 | extern int trace_define_field(struct ftrace_event_call *call, const char *type, |
163 | const char *name, int offset, int size, | 163 | const char *name, int offset, int size, |
164 | int is_signed, int filter_type); | 164 | int is_signed, int filter_type); |
diff --git a/include/linux/gpio.h b/include/linux/gpio.h index 059bd189d35d..4e949a5b5b85 100644 --- a/include/linux/gpio.h +++ b/include/linux/gpio.h | |||
@@ -99,6 +99,12 @@ static inline int gpio_export_link(struct device *dev, const char *name, | |||
99 | return -EINVAL; | 99 | return -EINVAL; |
100 | } | 100 | } |
101 | 101 | ||
102 | static inline int gpio_sysfs_set_active_low(unsigned gpio, int value) | ||
103 | { | ||
104 | /* GPIO can never have been requested */ | ||
105 | WARN_ON(1); | ||
106 | return -EINVAL; | ||
107 | } | ||
102 | 108 | ||
103 | static inline void gpio_unexport(unsigned gpio) | 109 | static inline void gpio_unexport(unsigned gpio) |
104 | { | 110 | { |
diff --git a/include/linux/i8042.h b/include/linux/i8042.h index 60c3360ef6ad..9bf6870ee5f4 100644 --- a/include/linux/i8042.h +++ b/include/linux/i8042.h | |||
@@ -39,6 +39,10 @@ void i8042_lock_chip(void); | |||
39 | void i8042_unlock_chip(void); | 39 | void i8042_unlock_chip(void); |
40 | int i8042_command(unsigned char *param, int command); | 40 | int i8042_command(unsigned char *param, int command); |
41 | bool i8042_check_port_owner(const struct serio *); | 41 | bool i8042_check_port_owner(const struct serio *); |
42 | int i8042_install_filter(bool (*filter)(unsigned char data, unsigned char str, | ||
43 | struct serio *serio)); | ||
44 | int i8042_remove_filter(bool (*filter)(unsigned char data, unsigned char str, | ||
45 | struct serio *serio)); | ||
42 | 46 | ||
43 | #else | 47 | #else |
44 | 48 | ||
@@ -52,7 +56,7 @@ void i8042_unlock_chip(void) | |||
52 | 56 | ||
53 | int i8042_command(unsigned char *param, int command) | 57 | int i8042_command(unsigned char *param, int command) |
54 | { | 58 | { |
55 | return -ENOSYS; | 59 | return -ENODEV; |
56 | } | 60 | } |
57 | 61 | ||
58 | bool i8042_check_port_owner(const struct serio *serio) | 62 | bool i8042_check_port_owner(const struct serio *serio) |
@@ -60,6 +64,18 @@ bool i8042_check_port_owner(const struct serio *serio) | |||
60 | return false; | 64 | return false; |
61 | } | 65 | } |
62 | 66 | ||
67 | int i8042_install_filter(bool (*filter)(unsigned char data, unsigned char str, | ||
68 | struct serio *serio)) | ||
69 | { | ||
70 | return -ENODEV; | ||
71 | } | ||
72 | |||
73 | int i8042_remove_filter(bool (*filter)(unsigned char data, unsigned char str, | ||
74 | struct serio *serio)) | ||
75 | { | ||
76 | return -ENODEV; | ||
77 | } | ||
78 | |||
63 | #endif | 79 | #endif |
64 | 80 | ||
65 | #endif | 81 | #endif |
diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h index 4f0a72a9740c..9310c699a37d 100644 --- a/include/linux/intel-iommu.h +++ b/include/linux/intel-iommu.h | |||
@@ -332,6 +332,7 @@ struct intel_iommu { | |||
332 | #ifdef CONFIG_INTR_REMAP | 332 | #ifdef CONFIG_INTR_REMAP |
333 | struct ir_table *ir_table; /* Interrupt remapping info */ | 333 | struct ir_table *ir_table; /* Interrupt remapping info */ |
334 | #endif | 334 | #endif |
335 | int node; | ||
335 | }; | 336 | }; |
336 | 337 | ||
337 | static inline void __iommu_flush_cache( | 338 | static inline void __iommu_flush_cache( |
diff --git a/include/linux/iommu-helper.h b/include/linux/iommu-helper.h index 3b068e5b5671..64d1b638745d 100644 --- a/include/linux/iommu-helper.h +++ b/include/linux/iommu-helper.h | |||
@@ -14,14 +14,11 @@ static inline unsigned long iommu_device_max_index(unsigned long size, | |||
14 | extern int iommu_is_span_boundary(unsigned int index, unsigned int nr, | 14 | extern int iommu_is_span_boundary(unsigned int index, unsigned int nr, |
15 | unsigned long shift, | 15 | unsigned long shift, |
16 | unsigned long boundary_size); | 16 | unsigned long boundary_size); |
17 | extern void iommu_area_reserve(unsigned long *map, unsigned long i, int len); | ||
18 | extern unsigned long iommu_area_alloc(unsigned long *map, unsigned long size, | 17 | extern unsigned long iommu_area_alloc(unsigned long *map, unsigned long size, |
19 | unsigned long start, unsigned int nr, | 18 | unsigned long start, unsigned int nr, |
20 | unsigned long shift, | 19 | unsigned long shift, |
21 | unsigned long boundary_size, | 20 | unsigned long boundary_size, |
22 | unsigned long align_mask); | 21 | unsigned long align_mask); |
23 | extern void iommu_area_free(unsigned long *map, unsigned long start, | ||
24 | unsigned int nr); | ||
25 | 22 | ||
26 | extern unsigned long iommu_num_pages(unsigned long addr, unsigned long len, | 23 | extern unsigned long iommu_num_pages(unsigned long addr, unsigned long len, |
27 | unsigned long io_page_size); | 24 | unsigned long io_page_size); |
diff --git a/include/linux/ioport.h b/include/linux/ioport.h index 83aa81297ea3..7129504e053d 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h | |||
@@ -126,11 +126,11 @@ extern int allocate_resource(struct resource *root, struct resource *new, | |||
126 | int adjust_resource(struct resource *res, resource_size_t start, | 126 | int adjust_resource(struct resource *res, resource_size_t start, |
127 | resource_size_t size); | 127 | resource_size_t size); |
128 | resource_size_t resource_alignment(struct resource *res); | 128 | resource_size_t resource_alignment(struct resource *res); |
129 | static inline resource_size_t resource_size(struct resource *res) | 129 | static inline resource_size_t resource_size(const struct resource *res) |
130 | { | 130 | { |
131 | return res->end - res->start + 1; | 131 | return res->end - res->start + 1; |
132 | } | 132 | } |
133 | static inline unsigned long resource_type(struct resource *res) | 133 | static inline unsigned long resource_type(const struct resource *res) |
134 | { | 134 | { |
135 | return res->flags & IORESOURCE_TYPE_BITS; | 135 | return res->flags & IORESOURCE_TYPE_BITS; |
136 | } | 136 | } |
diff --git a/include/linux/ipc_namespace.h b/include/linux/ipc_namespace.h index e408722a84c7..07baa38bce37 100644 --- a/include/linux/ipc_namespace.h +++ b/include/linux/ipc_namespace.h | |||
@@ -87,7 +87,7 @@ extern int mq_init_ns(struct ipc_namespace *ns); | |||
87 | /* default values */ | 87 | /* default values */ |
88 | #define DFLT_QUEUESMAX 256 /* max number of message queues */ | 88 | #define DFLT_QUEUESMAX 256 /* max number of message queues */ |
89 | #define DFLT_MSGMAX 10 /* max number of messages in each queue */ | 89 | #define DFLT_MSGMAX 10 /* max number of messages in each queue */ |
90 | #define HARD_MSGMAX (131072/sizeof(void *)) | 90 | #define HARD_MSGMAX (32768*sizeof(void *)/4) |
91 | #define DFLT_MSGSIZEMAX 8192 /* max message size */ | 91 | #define DFLT_MSGSIZEMAX 8192 /* max message size */ |
92 | #else | 92 | #else |
93 | static inline int mq_init_ns(struct ipc_namespace *ns) { return 0; } | 93 | static inline int mq_init_ns(struct ipc_namespace *ns) { return 0; } |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 4d9c916d06d9..3fc9f5aab5f8 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -535,6 +535,8 @@ extern int | |||
535 | __trace_printk(unsigned long ip, const char *fmt, ...) | 535 | __trace_printk(unsigned long ip, const char *fmt, ...) |
536 | __attribute__ ((format (printf, 2, 3))); | 536 | __attribute__ ((format (printf, 2, 3))); |
537 | 537 | ||
538 | extern void trace_dump_stack(void); | ||
539 | |||
538 | /* | 540 | /* |
539 | * The double __builtin_constant_p is because gcc will give us an error | 541 | * The double __builtin_constant_p is because gcc will give us an error |
540 | * if we try to allocate the static variable to fmt if it is not a | 542 | * if we try to allocate the static variable to fmt if it is not a |
@@ -568,6 +570,7 @@ trace_printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); | |||
568 | static inline void tracing_start(void) { } | 570 | static inline void tracing_start(void) { } |
569 | static inline void tracing_stop(void) { } | 571 | static inline void tracing_stop(void) { } |
570 | static inline void ftrace_off_permanent(void) { } | 572 | static inline void ftrace_off_permanent(void) { } |
573 | static inline void trace_dump_stack(void) { } | ||
571 | static inline int | 574 | static inline int |
572 | trace_printk(const char *fmt, ...) | 575 | trace_printk(const char *fmt, ...) |
573 | { | 576 | { |
diff --git a/include/linux/kexec.h b/include/linux/kexec.h index adc34f2c6eff..c356b6914ffd 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h | |||
@@ -206,6 +206,8 @@ extern size_t vmcoreinfo_max_size; | |||
206 | 206 | ||
207 | int __init parse_crashkernel(char *cmdline, unsigned long long system_ram, | 207 | int __init parse_crashkernel(char *cmdline, unsigned long long system_ram, |
208 | unsigned long long *crash_size, unsigned long long *crash_base); | 208 | unsigned long long *crash_size, unsigned long long *crash_base); |
209 | int crash_shrink_memory(unsigned long new_size); | ||
210 | size_t crash_get_memory_size(void); | ||
209 | 211 | ||
210 | #else /* !CONFIG_KEXEC */ | 212 | #else /* !CONFIG_KEXEC */ |
211 | struct pt_regs; | 213 | struct pt_regs; |
diff --git a/include/linux/kmsg_dump.h b/include/linux/kmsg_dump.h new file mode 100644 index 000000000000..e32aa268efac --- /dev/null +++ b/include/linux/kmsg_dump.h | |||
@@ -0,0 +1,60 @@ | |||
1 | /* | ||
2 | * linux/include/kmsg_dump.h | ||
3 | * | ||
4 | * Copyright (C) 2009 Net Insight AB | ||
5 | * | ||
6 | * Author: Simon Kagstrom <simon.kagstrom@netinsight.net> | ||
7 | * | ||
8 | * This file is subject to the terms and conditions of the GNU General Public | ||
9 | * License. See the file COPYING in the main directory of this archive | ||
10 | * for more details. | ||
11 | */ | ||
12 | #ifndef _LINUX_KMSG_DUMP_H | ||
13 | #define _LINUX_KMSG_DUMP_H | ||
14 | |||
15 | #include <linux/list.h> | ||
16 | |||
17 | enum kmsg_dump_reason { | ||
18 | KMSG_DUMP_OOPS, | ||
19 | KMSG_DUMP_PANIC, | ||
20 | }; | ||
21 | |||
22 | /** | ||
23 | * struct kmsg_dumper - kernel crash message dumper structure | ||
24 | * @dump: The callback which gets called on crashes. The buffer is passed | ||
25 | * as two sections, where s1 (length l1) contains the older | ||
26 | * messages and s2 (length l2) contains the newer. | ||
27 | * @list: Entry in the dumper list (private) | ||
28 | * @registered: Flag that specifies if this is already registered | ||
29 | */ | ||
30 | struct kmsg_dumper { | ||
31 | void (*dump)(struct kmsg_dumper *dumper, enum kmsg_dump_reason reason, | ||
32 | const char *s1, unsigned long l1, | ||
33 | const char *s2, unsigned long l2); | ||
34 | struct list_head list; | ||
35 | int registered; | ||
36 | }; | ||
37 | |||
38 | #ifdef CONFIG_PRINTK | ||
39 | void kmsg_dump(enum kmsg_dump_reason reason); | ||
40 | |||
41 | int kmsg_dump_register(struct kmsg_dumper *dumper); | ||
42 | |||
43 | int kmsg_dump_unregister(struct kmsg_dumper *dumper); | ||
44 | #else | ||
45 | static inline void kmsg_dump(enum kmsg_dump_reason reason) | ||
46 | { | ||
47 | } | ||
48 | |||
49 | static inline int kmsg_dump_register(struct kmsg_dumper *dumper) | ||
50 | { | ||
51 | return -EINVAL; | ||
52 | } | ||
53 | |||
54 | static inline int kmsg_dump_unregister(struct kmsg_dumper *dumper) | ||
55 | { | ||
56 | return -EINVAL; | ||
57 | } | ||
58 | #endif | ||
59 | |||
60 | #endif /* _LINUX_KMSG_DUMP_H */ | ||
diff --git a/include/linux/ksm.h b/include/linux/ksm.h index bed5f16ba827..43bdab769fc3 100644 --- a/include/linux/ksm.h +++ b/include/linux/ksm.h | |||
@@ -94,12 +94,6 @@ void ksm_migrate_page(struct page *newpage, struct page *oldpage); | |||
94 | 94 | ||
95 | #else /* !CONFIG_KSM */ | 95 | #else /* !CONFIG_KSM */ |
96 | 96 | ||
97 | static inline int ksm_madvise(struct vm_area_struct *vma, unsigned long start, | ||
98 | unsigned long end, int advice, unsigned long *vm_flags) | ||
99 | { | ||
100 | return 0; | ||
101 | } | ||
102 | |||
103 | static inline int ksm_fork(struct mm_struct *mm, struct mm_struct *oldmm) | 97 | static inline int ksm_fork(struct mm_struct *mm, struct mm_struct *oldmm) |
104 | { | 98 | { |
105 | return 0; | 99 | return 0; |
@@ -114,6 +108,13 @@ static inline int PageKsm(struct page *page) | |||
114 | return 0; | 108 | return 0; |
115 | } | 109 | } |
116 | 110 | ||
111 | #ifdef CONFIG_MMU | ||
112 | static inline int ksm_madvise(struct vm_area_struct *vma, unsigned long start, | ||
113 | unsigned long end, int advice, unsigned long *vm_flags) | ||
114 | { | ||
115 | return 0; | ||
116 | } | ||
117 | |||
117 | static inline struct page *ksm_might_need_to_copy(struct page *page, | 118 | static inline struct page *ksm_might_need_to_copy(struct page *page, |
118 | struct vm_area_struct *vma, unsigned long address) | 119 | struct vm_area_struct *vma, unsigned long address) |
119 | { | 120 | { |
@@ -140,6 +141,7 @@ static inline int rmap_walk_ksm(struct page *page, int (*rmap_one)(struct page*, | |||
140 | static inline void ksm_migrate_page(struct page *newpage, struct page *oldpage) | 141 | static inline void ksm_migrate_page(struct page *newpage, struct page *oldpage) |
141 | { | 142 | { |
142 | } | 143 | } |
144 | #endif /* CONFIG_MMU */ | ||
143 | #endif /* !CONFIG_KSM */ | 145 | #endif /* !CONFIG_KSM */ |
144 | 146 | ||
145 | #endif /* __LINUX_KSM_H */ | 147 | #endif /* __LINUX_KSM_H */ |
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index bf9213b2db8f..0b46c2068b96 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -54,6 +54,11 @@ extern void mem_cgroup_rotate_lru_list(struct page *page, enum lru_list lru); | |||
54 | extern void mem_cgroup_del_lru(struct page *page); | 54 | extern void mem_cgroup_del_lru(struct page *page); |
55 | extern void mem_cgroup_move_lists(struct page *page, | 55 | extern void mem_cgroup_move_lists(struct page *page, |
56 | enum lru_list from, enum lru_list to); | 56 | enum lru_list from, enum lru_list to); |
57 | |||
58 | /* For coalescing uncharge for reducing memcg' overhead*/ | ||
59 | extern void mem_cgroup_uncharge_start(void); | ||
60 | extern void mem_cgroup_uncharge_end(void); | ||
61 | |||
57 | extern void mem_cgroup_uncharge_page(struct page *page); | 62 | extern void mem_cgroup_uncharge_page(struct page *page); |
58 | extern void mem_cgroup_uncharge_cache_page(struct page *page); | 63 | extern void mem_cgroup_uncharge_cache_page(struct page *page); |
59 | extern int mem_cgroup_shmem_charge_fallback(struct page *page, | 64 | extern int mem_cgroup_shmem_charge_fallback(struct page *page, |
@@ -117,7 +122,7 @@ static inline bool mem_cgroup_disabled(void) | |||
117 | } | 122 | } |
118 | 123 | ||
119 | extern bool mem_cgroup_oom_called(struct task_struct *task); | 124 | extern bool mem_cgroup_oom_called(struct task_struct *task); |
120 | void mem_cgroup_update_mapped_file_stat(struct page *page, int val); | 125 | void mem_cgroup_update_file_mapped(struct page *page, int val); |
121 | unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order, | 126 | unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order, |
122 | gfp_t gfp_mask, int nid, | 127 | gfp_t gfp_mask, int nid, |
123 | int zid); | 128 | int zid); |
@@ -151,6 +156,14 @@ static inline void mem_cgroup_cancel_charge_swapin(struct mem_cgroup *ptr) | |||
151 | { | 156 | { |
152 | } | 157 | } |
153 | 158 | ||
159 | static inline void mem_cgroup_uncharge_start(void) | ||
160 | { | ||
161 | } | ||
162 | |||
163 | static inline void mem_cgroup_uncharge_end(void) | ||
164 | { | ||
165 | } | ||
166 | |||
154 | static inline void mem_cgroup_uncharge_page(struct page *page) | 167 | static inline void mem_cgroup_uncharge_page(struct page *page) |
155 | { | 168 | { |
156 | } | 169 | } |
@@ -274,7 +287,7 @@ mem_cgroup_print_oom_info(struct mem_cgroup *memcg, struct task_struct *p) | |||
274 | { | 287 | { |
275 | } | 288 | } |
276 | 289 | ||
277 | static inline void mem_cgroup_update_mapped_file_stat(struct page *page, | 290 | static inline void mem_cgroup_update_file_mapped(struct page *page, |
278 | int val) | 291 | int val) |
279 | { | 292 | { |
280 | } | 293 | } |
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index ce7cc6c7bcbb..e92d1bfdb330 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
@@ -61,6 +61,7 @@ enum { | |||
61 | MLX4_DEV_CAP_FLAG_BAD_PKEY_CNTR = 1 << 8, | 61 | MLX4_DEV_CAP_FLAG_BAD_PKEY_CNTR = 1 << 8, |
62 | MLX4_DEV_CAP_FLAG_BAD_QKEY_CNTR = 1 << 9, | 62 | MLX4_DEV_CAP_FLAG_BAD_QKEY_CNTR = 1 << 9, |
63 | MLX4_DEV_CAP_FLAG_DPDP = 1 << 12, | 63 | MLX4_DEV_CAP_FLAG_DPDP = 1 << 12, |
64 | MLX4_DEV_CAP_FLAG_BLH = 1 << 15, | ||
64 | MLX4_DEV_CAP_FLAG_MEM_WINDOW = 1 << 16, | 65 | MLX4_DEV_CAP_FLAG_MEM_WINDOW = 1 << 16, |
65 | MLX4_DEV_CAP_FLAG_APM = 1 << 17, | 66 | MLX4_DEV_CAP_FLAG_APM = 1 << 17, |
66 | MLX4_DEV_CAP_FLAG_ATOMIC = 1 << 18, | 67 | MLX4_DEV_CAP_FLAG_ATOMIC = 1 << 18, |
diff --git a/include/linux/module.h b/include/linux/module.h index 482efc865acf..6cb1a3cab5d3 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -25,8 +25,10 @@ | |||
25 | /* Not Yet Implemented */ | 25 | /* Not Yet Implemented */ |
26 | #define MODULE_SUPPORTED_DEVICE(name) | 26 | #define MODULE_SUPPORTED_DEVICE(name) |
27 | 27 | ||
28 | /* some toolchains uses a `_' prefix for all user symbols */ | 28 | /* Some toolchains use a `_' prefix for all user symbols. */ |
29 | #ifndef MODULE_SYMBOL_PREFIX | 29 | #ifdef CONFIG_SYMBOL_PREFIX |
30 | #define MODULE_SYMBOL_PREFIX CONFIG_SYMBOL_PREFIX | ||
31 | #else | ||
30 | #define MODULE_SYMBOL_PREFIX "" | 32 | #define MODULE_SYMBOL_PREFIX "" |
31 | #endif | 33 | #endif |
32 | 34 | ||
diff --git a/include/linux/mtd/bbm.h b/include/linux/mtd/bbm.h index fff8c53e5434..9c3757c5759d 100644 --- a/include/linux/mtd/bbm.h +++ b/include/linux/mtd/bbm.h | |||
@@ -19,22 +19,21 @@ | |||
19 | 19 | ||
20 | /** | 20 | /** |
21 | * struct nand_bbt_descr - bad block table descriptor | 21 | * struct nand_bbt_descr - bad block table descriptor |
22 | * @options: options for this descriptor | 22 | * @options: options for this descriptor |
23 | * @pages: the page(s) where we find the bbt, used with | 23 | * @pages: the page(s) where we find the bbt, used with option BBT_ABSPAGE |
24 | * option BBT_ABSPAGE when bbt is searched, | 24 | * when bbt is searched, then we store the found bbts pages here. |
25 | * then we store the found bbts pages here. | 25 | * Its an array and supports up to 8 chips now |
26 | * Its an array and supports up to 8 chips now | 26 | * @offs: offset of the pattern in the oob area of the page |
27 | * @offs: offset of the pattern in the oob area of the page | 27 | * @veroffs: offset of the bbt version counter in the oob are of the page |
28 | * @veroffs: offset of the bbt version counter in the oob area of the page | 28 | * @version: version read from the bbt page during scan |
29 | * @version: version read from the bbt page during scan | 29 | * @len: length of the pattern, if 0 no pattern check is performed |
30 | * @len: length of the pattern, if 0 no pattern check is performed | 30 | * @maxblocks: maximum number of blocks to search for a bbt. This number of |
31 | * @maxblocks: maximum number of blocks to search for a bbt. This | 31 | * blocks is reserved at the end of the device where the tables are |
32 | * number of blocks is reserved at the end of the device | 32 | * written. |
33 | * where the tables are written. | 33 | * @reserved_block_code: if non-0, this pattern denotes a reserved (rather than |
34 | * @reserved_block_code: if non-0, this pattern denotes a reserved | 34 | * bad) block in the stored bbt |
35 | * (rather than bad) block in the stored bbt | 35 | * @pattern: pattern to identify bad block table or factory marked good / |
36 | * @pattern: pattern to identify bad block table or factory marked | 36 | * bad blocks, can be NULL, if len = 0 |
37 | * good / bad blocks, can be NULL, if len = 0 | ||
38 | * | 37 | * |
39 | * Descriptor for the bad block table marker and the descriptor for the | 38 | * Descriptor for the bad block table marker and the descriptor for the |
40 | * pattern which identifies good and bad blocks. The assumption is made | 39 | * pattern which identifies good and bad blocks. The assumption is made |
@@ -90,7 +89,9 @@ struct nand_bbt_descr { | |||
90 | /* | 89 | /* |
91 | * Constants for oob configuration | 90 | * Constants for oob configuration |
92 | */ | 91 | */ |
93 | #define ONENAND_BADBLOCK_POS 0 | 92 | #define NAND_SMALL_BADBLOCK_POS 5 |
93 | #define NAND_LARGE_BADBLOCK_POS 0 | ||
94 | #define ONENAND_BADBLOCK_POS 0 | ||
94 | 95 | ||
95 | /* | 96 | /* |
96 | * Bad block scanning errors | 97 | * Bad block scanning errors |
diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h index 88d3d8fbf9f2..df89f4275232 100644 --- a/include/linux/mtd/cfi.h +++ b/include/linux/mtd/cfi.h | |||
@@ -518,10 +518,11 @@ struct cfi_fixup { | |||
518 | #define CFI_MFR_ANY 0xffff | 518 | #define CFI_MFR_ANY 0xffff |
519 | #define CFI_ID_ANY 0xffff | 519 | #define CFI_ID_ANY 0xffff |
520 | 520 | ||
521 | #define CFI_MFR_AMD 0x0001 | 521 | #define CFI_MFR_AMD 0x0001 |
522 | #define CFI_MFR_ATMEL 0x001F | 522 | #define CFI_MFR_INTEL 0x0089 |
523 | #define CFI_MFR_SAMSUNG 0x00EC | 523 | #define CFI_MFR_ATMEL 0x001F |
524 | #define CFI_MFR_ST 0x0020 /* STMicroelectronics */ | 524 | #define CFI_MFR_SAMSUNG 0x00EC |
525 | #define CFI_MFR_ST 0x0020 /* STMicroelectronics */ | ||
525 | 526 | ||
526 | void cfi_fixup(struct mtd_info *mtd, struct cfi_fixup* fixups); | 527 | void cfi_fixup(struct mtd_info *mtd, struct cfi_fixup* fixups); |
527 | 528 | ||
diff --git a/include/linux/mtd/flashchip.h b/include/linux/mtd/flashchip.h index d4f38c5fd44e..d0bf422ae374 100644 --- a/include/linux/mtd/flashchip.h +++ b/include/linux/mtd/flashchip.h | |||
@@ -38,6 +38,15 @@ typedef enum { | |||
38 | FL_XIP_WHILE_ERASING, | 38 | FL_XIP_WHILE_ERASING, |
39 | FL_XIP_WHILE_WRITING, | 39 | FL_XIP_WHILE_WRITING, |
40 | FL_SHUTDOWN, | 40 | FL_SHUTDOWN, |
41 | /* These 2 come from nand_state_t, which has been unified here */ | ||
42 | FL_READING, | ||
43 | FL_CACHEDPRG, | ||
44 | /* These 4 come from onenand_state_t, which has been unified here */ | ||
45 | FL_RESETING, | ||
46 | FL_OTPING, | ||
47 | FL_PREPARING_ERASE, | ||
48 | FL_VERIFYING_ERASE, | ||
49 | |||
41 | FL_UNKNOWN | 50 | FL_UNKNOWN |
42 | } flstate_t; | 51 | } flstate_t; |
43 | 52 | ||
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 7a232a9bdd62..ccab9dfc5217 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
@@ -21,6 +21,8 @@ | |||
21 | #include <linux/wait.h> | 21 | #include <linux/wait.h> |
22 | #include <linux/spinlock.h> | 22 | #include <linux/spinlock.h> |
23 | #include <linux/mtd/mtd.h> | 23 | #include <linux/mtd/mtd.h> |
24 | #include <linux/mtd/flashchip.h> | ||
25 | #include <linux/mtd/bbm.h> | ||
24 | 26 | ||
25 | struct mtd_info; | 27 | struct mtd_info; |
26 | /* Scan and identify a NAND device */ | 28 | /* Scan and identify a NAND device */ |
@@ -168,7 +170,6 @@ typedef enum { | |||
168 | /* Chip does not allow subpage writes */ | 170 | /* Chip does not allow subpage writes */ |
169 | #define NAND_NO_SUBPAGE_WRITE 0x00000200 | 171 | #define NAND_NO_SUBPAGE_WRITE 0x00000200 |
170 | 172 | ||
171 | |||
172 | /* Options valid for Samsung large page devices */ | 173 | /* Options valid for Samsung large page devices */ |
173 | #define NAND_SAMSUNG_LP_OPTIONS \ | 174 | #define NAND_SAMSUNG_LP_OPTIONS \ |
174 | (NAND_NO_PADDING | NAND_CACHEPRG | NAND_COPYBACK) | 175 | (NAND_NO_PADDING | NAND_CACHEPRG | NAND_COPYBACK) |
@@ -194,6 +195,9 @@ typedef enum { | |||
194 | /* This option is defined if the board driver allocates its own buffers | 195 | /* This option is defined if the board driver allocates its own buffers |
195 | (e.g. because it needs them DMA-coherent */ | 196 | (e.g. because it needs them DMA-coherent */ |
196 | #define NAND_OWN_BUFFERS 0x00040000 | 197 | #define NAND_OWN_BUFFERS 0x00040000 |
198 | /* Chip may not exist, so silence any errors in scan */ | ||
199 | #define NAND_SCAN_SILENT_NODEV 0x00080000 | ||
200 | |||
197 | /* Options set by nand scan */ | 201 | /* Options set by nand scan */ |
198 | /* Nand scan has allocated controller struct */ | 202 | /* Nand scan has allocated controller struct */ |
199 | #define NAND_CONTROLLER_ALLOC 0x80000000 | 203 | #define NAND_CONTROLLER_ALLOC 0x80000000 |
@@ -202,20 +206,6 @@ typedef enum { | |||
202 | #define NAND_CI_CHIPNR_MSK 0x03 | 206 | #define NAND_CI_CHIPNR_MSK 0x03 |
203 | #define NAND_CI_CELLTYPE_MSK 0x0C | 207 | #define NAND_CI_CELLTYPE_MSK 0x0C |
204 | 208 | ||
205 | /* | ||
206 | * nand_state_t - chip states | ||
207 | * Enumeration for NAND flash chip state | ||
208 | */ | ||
209 | typedef enum { | ||
210 | FL_READY, | ||
211 | FL_READING, | ||
212 | FL_WRITING, | ||
213 | FL_ERASING, | ||
214 | FL_SYNCING, | ||
215 | FL_CACHEDPRG, | ||
216 | FL_PM_SUSPENDED, | ||
217 | } nand_state_t; | ||
218 | |||
219 | /* Keep gcc happy */ | 209 | /* Keep gcc happy */ |
220 | struct nand_chip; | 210 | struct nand_chip; |
221 | 211 | ||
@@ -402,7 +392,7 @@ struct nand_chip { | |||
402 | uint8_t cellinfo; | 392 | uint8_t cellinfo; |
403 | int badblockpos; | 393 | int badblockpos; |
404 | 394 | ||
405 | nand_state_t state; | 395 | flstate_t state; |
406 | 396 | ||
407 | uint8_t *oob_poi; | 397 | uint8_t *oob_poi; |
408 | struct nand_hw_control *controller; | 398 | struct nand_hw_control *controller; |
@@ -470,75 +460,6 @@ struct nand_manufacturers { | |||
470 | extern struct nand_flash_dev nand_flash_ids[]; | 460 | extern struct nand_flash_dev nand_flash_ids[]; |
471 | extern struct nand_manufacturers nand_manuf_ids[]; | 461 | extern struct nand_manufacturers nand_manuf_ids[]; |
472 | 462 | ||
473 | /** | ||
474 | * struct nand_bbt_descr - bad block table descriptor | ||
475 | * @options: options for this descriptor | ||
476 | * @pages: the page(s) where we find the bbt, used with option BBT_ABSPAGE | ||
477 | * when bbt is searched, then we store the found bbts pages here. | ||
478 | * Its an array and supports up to 8 chips now | ||
479 | * @offs: offset of the pattern in the oob area of the page | ||
480 | * @veroffs: offset of the bbt version counter in the oob are of the page | ||
481 | * @version: version read from the bbt page during scan | ||
482 | * @len: length of the pattern, if 0 no pattern check is performed | ||
483 | * @maxblocks: maximum number of blocks to search for a bbt. This number of | ||
484 | * blocks is reserved at the end of the device where the tables are | ||
485 | * written. | ||
486 | * @reserved_block_code: if non-0, this pattern denotes a reserved (rather than | ||
487 | * bad) block in the stored bbt | ||
488 | * @pattern: pattern to identify bad block table or factory marked good / | ||
489 | * bad blocks, can be NULL, if len = 0 | ||
490 | * | ||
491 | * Descriptor for the bad block table marker and the descriptor for the | ||
492 | * pattern which identifies good and bad blocks. The assumption is made | ||
493 | * that the pattern and the version count are always located in the oob area | ||
494 | * of the first block. | ||
495 | */ | ||
496 | struct nand_bbt_descr { | ||
497 | int options; | ||
498 | int pages[NAND_MAX_CHIPS]; | ||
499 | int offs; | ||
500 | int veroffs; | ||
501 | uint8_t version[NAND_MAX_CHIPS]; | ||
502 | int len; | ||
503 | int maxblocks; | ||
504 | int reserved_block_code; | ||
505 | uint8_t *pattern; | ||
506 | }; | ||
507 | |||
508 | /* Options for the bad block table descriptors */ | ||
509 | |||
510 | /* The number of bits used per block in the bbt on the device */ | ||
511 | #define NAND_BBT_NRBITS_MSK 0x0000000F | ||
512 | #define NAND_BBT_1BIT 0x00000001 | ||
513 | #define NAND_BBT_2BIT 0x00000002 | ||
514 | #define NAND_BBT_4BIT 0x00000004 | ||
515 | #define NAND_BBT_8BIT 0x00000008 | ||
516 | /* The bad block table is in the last good block of the device */ | ||
517 | #define NAND_BBT_LASTBLOCK 0x00000010 | ||
518 | /* The bbt is at the given page, else we must scan for the bbt */ | ||
519 | #define NAND_BBT_ABSPAGE 0x00000020 | ||
520 | /* The bbt is at the given page, else we must scan for the bbt */ | ||
521 | #define NAND_BBT_SEARCH 0x00000040 | ||
522 | /* bbt is stored per chip on multichip devices */ | ||
523 | #define NAND_BBT_PERCHIP 0x00000080 | ||
524 | /* bbt has a version counter at offset veroffs */ | ||
525 | #define NAND_BBT_VERSION 0x00000100 | ||
526 | /* Create a bbt if none axists */ | ||
527 | #define NAND_BBT_CREATE 0x00000200 | ||
528 | /* Search good / bad pattern through all pages of a block */ | ||
529 | #define NAND_BBT_SCANALLPAGES 0x00000400 | ||
530 | /* Scan block empty during good / bad block scan */ | ||
531 | #define NAND_BBT_SCANEMPTY 0x00000800 | ||
532 | /* Write bbt if neccecary */ | ||
533 | #define NAND_BBT_WRITE 0x00001000 | ||
534 | /* Read and write back block contents when writing bbt */ | ||
535 | #define NAND_BBT_SAVECONTENT 0x00002000 | ||
536 | /* Search good / bad pattern on the first and the second page */ | ||
537 | #define NAND_BBT_SCAN2NDPAGE 0x00004000 | ||
538 | |||
539 | /* The maximum number of blocks to scan for a bbt */ | ||
540 | #define NAND_BBT_SCAN_MAXBLOCKS 4 | ||
541 | |||
542 | extern int nand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd); | 463 | extern int nand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd); |
543 | extern int nand_update_bbt(struct mtd_info *mtd, loff_t offs); | 464 | extern int nand_update_bbt(struct mtd_info *mtd, loff_t offs); |
544 | extern int nand_default_bbt(struct mtd_info *mtd); | 465 | extern int nand_default_bbt(struct mtd_info *mtd); |
@@ -548,12 +469,6 @@ extern int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr, | |||
548 | extern int nand_do_read(struct mtd_info *mtd, loff_t from, size_t len, | 469 | extern int nand_do_read(struct mtd_info *mtd, loff_t from, size_t len, |
549 | size_t * retlen, uint8_t * buf); | 470 | size_t * retlen, uint8_t * buf); |
550 | 471 | ||
551 | /* | ||
552 | * Constants for oob configuration | ||
553 | */ | ||
554 | #define NAND_SMALL_BADBLOCK_POS 5 | ||
555 | #define NAND_LARGE_BADBLOCK_POS 0 | ||
556 | |||
557 | /** | 472 | /** |
558 | * struct platform_nand_chip - chip level device structure | 473 | * struct platform_nand_chip - chip level device structure |
559 | * @nr_chips: max. number of chips to scan for | 474 | * @nr_chips: max. number of chips to scan for |
diff --git a/include/linux/mtd/nand_ecc.h b/include/linux/mtd/nand_ecc.h index 052ea8ca2434..41bc013571d0 100644 --- a/include/linux/mtd/nand_ecc.h +++ b/include/linux/mtd/nand_ecc.h | |||
@@ -16,7 +16,13 @@ | |||
16 | struct mtd_info; | 16 | struct mtd_info; |
17 | 17 | ||
18 | /* | 18 | /* |
19 | * Calculate 3 byte ECC code for 256 byte block | 19 | * Calculate 3 byte ECC code for eccsize byte block |
20 | */ | ||
21 | void __nand_calculate_ecc(const u_char *dat, unsigned int eccsize, | ||
22 | u_char *ecc_code); | ||
23 | |||
24 | /* | ||
25 | * Calculate 3 byte ECC code for 256/512 byte block | ||
20 | */ | 26 | */ |
21 | int nand_calculate_ecc(struct mtd_info *mtd, const u_char *dat, u_char *ecc_code); | 27 | int nand_calculate_ecc(struct mtd_info *mtd, const u_char *dat, u_char *ecc_code); |
22 | 28 | ||
@@ -27,7 +33,7 @@ int __nand_correct_data(u_char *dat, u_char *read_ecc, u_char *calc_ecc, | |||
27 | unsigned int eccsize); | 33 | unsigned int eccsize); |
28 | 34 | ||
29 | /* | 35 | /* |
30 | * Detect and correct a 1 bit error for 256 byte block | 36 | * Detect and correct a 1 bit error for 256/512 byte block |
31 | */ | 37 | */ |
32 | int nand_correct_data(struct mtd_info *mtd, u_char *dat, u_char *read_ecc, u_char *calc_ecc); | 38 | int nand_correct_data(struct mtd_info *mtd, u_char *dat, u_char *read_ecc, u_char *calc_ecc); |
33 | 39 | ||
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h index 4e49f3350678..5509eb06b326 100644 --- a/include/linux/mtd/onenand.h +++ b/include/linux/mtd/onenand.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * linux/include/linux/mtd/onenand.h | 2 | * linux/include/linux/mtd/onenand.h |
3 | * | 3 | * |
4 | * Copyright (C) 2005-2007 Samsung Electronics | 4 | * Copyright © 2005-2009 Samsung Electronics |
5 | * Kyungmin Park <kyungmin.park@samsung.com> | 5 | * Kyungmin Park <kyungmin.park@samsung.com> |
6 | * | 6 | * |
7 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
@@ -14,6 +14,7 @@ | |||
14 | 14 | ||
15 | #include <linux/spinlock.h> | 15 | #include <linux/spinlock.h> |
16 | #include <linux/completion.h> | 16 | #include <linux/completion.h> |
17 | #include <linux/mtd/flashchip.h> | ||
17 | #include <linux/mtd/onenand_regs.h> | 18 | #include <linux/mtd/onenand_regs.h> |
18 | #include <linux/mtd/bbm.h> | 19 | #include <linux/mtd/bbm.h> |
19 | 20 | ||
@@ -25,22 +26,6 @@ extern int onenand_scan(struct mtd_info *mtd, int max_chips); | |||
25 | /* Free resources held by the OneNAND device */ | 26 | /* Free resources held by the OneNAND device */ |
26 | extern void onenand_release(struct mtd_info *mtd); | 27 | extern void onenand_release(struct mtd_info *mtd); |
27 | 28 | ||
28 | /* | ||
29 | * onenand_state_t - chip states | ||
30 | * Enumeration for OneNAND flash chip state | ||
31 | */ | ||
32 | typedef enum { | ||
33 | FL_READY, | ||
34 | FL_READING, | ||
35 | FL_WRITING, | ||
36 | FL_ERASING, | ||
37 | FL_SYNCING, | ||
38 | FL_LOCKING, | ||
39 | FL_RESETING, | ||
40 | FL_OTPING, | ||
41 | FL_PM_SUSPENDED, | ||
42 | } onenand_state_t; | ||
43 | |||
44 | /** | 29 | /** |
45 | * struct onenand_bufferram - OneNAND BufferRAM Data | 30 | * struct onenand_bufferram - OneNAND BufferRAM Data |
46 | * @blockpage: block & page address in BufferRAM | 31 | * @blockpage: block & page address in BufferRAM |
@@ -137,7 +122,7 @@ struct onenand_chip { | |||
137 | 122 | ||
138 | spinlock_t chip_lock; | 123 | spinlock_t chip_lock; |
139 | wait_queue_head_t wq; | 124 | wait_queue_head_t wq; |
140 | onenand_state_t state; | 125 | flstate_t state; |
141 | unsigned char *page_buf; | 126 | unsigned char *page_buf; |
142 | unsigned char *oob_buf; | 127 | unsigned char *oob_buf; |
143 | 128 | ||
@@ -152,6 +137,8 @@ struct onenand_chip { | |||
152 | /* | 137 | /* |
153 | * Helper macros | 138 | * Helper macros |
154 | */ | 139 | */ |
140 | #define ONENAND_PAGES_PER_BLOCK (1<<6) | ||
141 | |||
155 | #define ONENAND_CURRENT_BUFFERRAM(this) (this->bufferram_index) | 142 | #define ONENAND_CURRENT_BUFFERRAM(this) (this->bufferram_index) |
156 | #define ONENAND_NEXT_BUFFERRAM(this) (this->bufferram_index ^ 1) | 143 | #define ONENAND_NEXT_BUFFERRAM(this) (this->bufferram_index ^ 1) |
157 | #define ONENAND_SET_NEXT_BUFFERRAM(this) (this->bufferram_index ^= 1) | 144 | #define ONENAND_SET_NEXT_BUFFERRAM(this) (this->bufferram_index ^= 1) |
diff --git a/include/linux/mtd/onenand_regs.h b/include/linux/mtd/onenand_regs.h index acadbf53a69f..cd6f3b431195 100644 --- a/include/linux/mtd/onenand_regs.h +++ b/include/linux/mtd/onenand_regs.h | |||
@@ -131,6 +131,8 @@ | |||
131 | #define ONENAND_CMD_LOCK_TIGHT (0x2C) | 131 | #define ONENAND_CMD_LOCK_TIGHT (0x2C) |
132 | #define ONENAND_CMD_UNLOCK_ALL (0x27) | 132 | #define ONENAND_CMD_UNLOCK_ALL (0x27) |
133 | #define ONENAND_CMD_ERASE (0x94) | 133 | #define ONENAND_CMD_ERASE (0x94) |
134 | #define ONENAND_CMD_MULTIBLOCK_ERASE (0x95) | ||
135 | #define ONENAND_CMD_ERASE_VERIFY (0x71) | ||
134 | #define ONENAND_CMD_RESET (0xF0) | 136 | #define ONENAND_CMD_RESET (0xF0) |
135 | #define ONENAND_CMD_OTP_ACCESS (0x65) | 137 | #define ONENAND_CMD_OTP_ACCESS (0x65) |
136 | #define ONENAND_CMD_READID (0x90) | 138 | #define ONENAND_CMD_READID (0x90) |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 51071b335751..89b28812ec24 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _LINUX_NFS_XDR_H | 2 | #define _LINUX_NFS_XDR_H |
3 | 3 | ||
4 | #include <linux/nfsacl.h> | 4 | #include <linux/nfsacl.h> |
5 | #include <linux/nfs3.h> | ||
5 | 6 | ||
6 | /* | 7 | /* |
7 | * To change the maximum rsize and wsize supported by the NFS client, adjust | 8 | * To change the maximum rsize and wsize supported by the NFS client, adjust |
diff --git a/include/linux/nfsacl.h b/include/linux/nfsacl.h index 43011b69297c..f321b578edeb 100644 --- a/include/linux/nfsacl.h +++ b/include/linux/nfsacl.h | |||
@@ -29,6 +29,7 @@ | |||
29 | #ifdef __KERNEL__ | 29 | #ifdef __KERNEL__ |
30 | 30 | ||
31 | #include <linux/posix_acl.h> | 31 | #include <linux/posix_acl.h> |
32 | #include <linux/sunrpc/xdr.h> | ||
32 | 33 | ||
33 | /* Maximum number of ACL entries over NFS */ | 34 | /* Maximum number of ACL entries over NFS */ |
34 | #define NFS_ACL_MAX_ENTRIES 1024 | 35 | #define NFS_ACL_MAX_ENTRIES 1024 |
diff --git a/include/linux/nfsd/cache.h b/include/linux/nfsd/cache.h deleted file mode 100644 index 3a3f58934f5e..000000000000 --- a/include/linux/nfsd/cache.h +++ /dev/null | |||
@@ -1,86 +0,0 @@ | |||
1 | /* | ||
2 | * include/linux/nfsd/cache.h | ||
3 | * | ||
4 | * Request reply cache. This was heavily inspired by the | ||
5 | * implementation in 4.3BSD/4.4BSD. | ||
6 | * | ||
7 | * Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de> | ||
8 | */ | ||
9 | |||
10 | #ifndef NFSCACHE_H | ||
11 | #define NFSCACHE_H | ||
12 | |||
13 | #include <linux/in.h> | ||
14 | #include <linux/uio.h> | ||
15 | |||
16 | /* | ||
17 | * Representation of a reply cache entry. | ||
18 | */ | ||
19 | struct svc_cacherep { | ||
20 | struct hlist_node c_hash; | ||
21 | struct list_head c_lru; | ||
22 | |||
23 | unsigned char c_state, /* unused, inprog, done */ | ||
24 | c_type, /* status, buffer */ | ||
25 | c_secure : 1; /* req came from port < 1024 */ | ||
26 | struct sockaddr_in c_addr; | ||
27 | __be32 c_xid; | ||
28 | u32 c_prot; | ||
29 | u32 c_proc; | ||
30 | u32 c_vers; | ||
31 | unsigned long c_timestamp; | ||
32 | union { | ||
33 | struct kvec u_vec; | ||
34 | __be32 u_status; | ||
35 | } c_u; | ||
36 | }; | ||
37 | |||
38 | #define c_replvec c_u.u_vec | ||
39 | #define c_replstat c_u.u_status | ||
40 | |||
41 | /* cache entry states */ | ||
42 | enum { | ||
43 | RC_UNUSED, | ||
44 | RC_INPROG, | ||
45 | RC_DONE | ||
46 | }; | ||
47 | |||
48 | /* return values */ | ||
49 | enum { | ||
50 | RC_DROPIT, | ||
51 | RC_REPLY, | ||
52 | RC_DOIT, | ||
53 | RC_INTR | ||
54 | }; | ||
55 | |||
56 | /* | ||
57 | * Cache types. | ||
58 | * We may want to add more types one day, e.g. for diropres and | ||
59 | * attrstat replies. Using cache entries with fixed length instead | ||
60 | * of buffer pointers may be more efficient. | ||
61 | */ | ||
62 | enum { | ||
63 | RC_NOCACHE, | ||
64 | RC_REPLSTAT, | ||
65 | RC_REPLBUFF, | ||
66 | }; | ||
67 | |||
68 | /* | ||
69 | * If requests are retransmitted within this interval, they're dropped. | ||
70 | */ | ||
71 | #define RC_DELAY (HZ/5) | ||
72 | |||
73 | int nfsd_reply_cache_init(void); | ||
74 | void nfsd_reply_cache_shutdown(void); | ||
75 | int nfsd_cache_lookup(struct svc_rqst *, int); | ||
76 | void nfsd_cache_update(struct svc_rqst *, int, __be32 *); | ||
77 | |||
78 | #ifdef CONFIG_NFSD_V4 | ||
79 | void nfsd4_set_statp(struct svc_rqst *rqstp, __be32 *statp); | ||
80 | #else /* CONFIG_NFSD_V4 */ | ||
81 | static inline void nfsd4_set_statp(struct svc_rqst *rqstp, __be32 *statp) | ||
82 | { | ||
83 | } | ||
84 | #endif /* CONFIG_NFSD_V4 */ | ||
85 | |||
86 | #endif /* NFSCACHE_H */ | ||
diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h index a6d9ef2bb34a..8ae78a61eea4 100644 --- a/include/linux/nfsd/export.h +++ b/include/linux/nfsd/export.h | |||
@@ -12,7 +12,7 @@ | |||
12 | 12 | ||
13 | # include <linux/types.h> | 13 | # include <linux/types.h> |
14 | #ifdef __KERNEL__ | 14 | #ifdef __KERNEL__ |
15 | # include <linux/in.h> | 15 | # include <linux/nfsd/nfsfh.h> |
16 | #endif | 16 | #endif |
17 | 17 | ||
18 | /* | 18 | /* |
@@ -39,11 +39,23 @@ | |||
39 | #define NFSEXP_FSID 0x2000 | 39 | #define NFSEXP_FSID 0x2000 |
40 | #define NFSEXP_CROSSMOUNT 0x4000 | 40 | #define NFSEXP_CROSSMOUNT 0x4000 |
41 | #define NFSEXP_NOACL 0x8000 /* reserved for possible ACL related use */ | 41 | #define NFSEXP_NOACL 0x8000 /* reserved for possible ACL related use */ |
42 | #define NFSEXP_ALLFLAGS 0xFE3F | 42 | /* |
43 | * The NFSEXP_V4ROOT flag causes the kernel to give access only to NFSv4 | ||
44 | * clients, and only to the single directory that is the root of the | ||
45 | * export; further lookup and readdir operations are treated as if every | ||
46 | * subdirectory was a mountpoint, and ignored if they are not themselves | ||
47 | * exported. This is used by nfsd and mountd to construct the NFSv4 | ||
48 | * pseudofilesystem, which provides access only to paths leading to each | ||
49 | * exported filesystem. | ||
50 | */ | ||
51 | #define NFSEXP_V4ROOT 0x10000 | ||
52 | /* All flags that we claim to support. (Note we don't support NOACL.) */ | ||
53 | #define NFSEXP_ALLFLAGS 0x17E3F | ||
43 | 54 | ||
44 | /* The flags that may vary depending on security flavor: */ | 55 | /* The flags that may vary depending on security flavor: */ |
45 | #define NFSEXP_SECINFO_FLAGS (NFSEXP_READONLY | NFSEXP_ROOTSQUASH \ | 56 | #define NFSEXP_SECINFO_FLAGS (NFSEXP_READONLY | NFSEXP_ROOTSQUASH \ |
46 | | NFSEXP_ALLSQUASH) | 57 | | NFSEXP_ALLSQUASH \ |
58 | | NFSEXP_INSECURE_PORT) | ||
47 | 59 | ||
48 | #ifdef __KERNEL__ | 60 | #ifdef __KERNEL__ |
49 | 61 | ||
@@ -108,7 +120,6 @@ struct svc_expkey { | |||
108 | struct path ek_path; | 120 | struct path ek_path; |
109 | }; | 121 | }; |
110 | 122 | ||
111 | #define EX_SECURE(exp) (!((exp)->ex_flags & NFSEXP_INSECURE_PORT)) | ||
112 | #define EX_ISSYNC(exp) (!((exp)->ex_flags & NFSEXP_ASYNC)) | 123 | #define EX_ISSYNC(exp) (!((exp)->ex_flags & NFSEXP_ASYNC)) |
113 | #define EX_NOHIDE(exp) ((exp)->ex_flags & NFSEXP_NOHIDE) | 124 | #define EX_NOHIDE(exp) ((exp)->ex_flags & NFSEXP_NOHIDE) |
114 | #define EX_WGATHER(exp) ((exp)->ex_flags & NFSEXP_GATHERED_WRITES) | 125 | #define EX_WGATHER(exp) ((exp)->ex_flags & NFSEXP_GATHERED_WRITES) |
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h deleted file mode 100644 index 510ffdd5020e..000000000000 --- a/include/linux/nfsd/nfsd.h +++ /dev/null | |||
@@ -1,424 +0,0 @@ | |||
1 | /* | ||
2 | * linux/include/linux/nfsd/nfsd.h | ||
3 | * | ||
4 | * Hodge-podge collection of knfsd-related stuff. | ||
5 | * I will sort this out later. | ||
6 | * | ||
7 | * Copyright (C) 1995-1997 Olaf Kirch <okir@monad.swb.de> | ||
8 | */ | ||
9 | |||
10 | #ifndef LINUX_NFSD_NFSD_H | ||
11 | #define LINUX_NFSD_NFSD_H | ||
12 | |||
13 | #include <linux/types.h> | ||
14 | #include <linux/unistd.h> | ||
15 | #include <linux/fs.h> | ||
16 | #include <linux/posix_acl.h> | ||
17 | #include <linux/mount.h> | ||
18 | |||
19 | #include <linux/nfsd/debug.h> | ||
20 | #include <linux/nfsd/nfsfh.h> | ||
21 | #include <linux/nfsd/export.h> | ||
22 | #include <linux/nfsd/stats.h> | ||
23 | /* | ||
24 | * nfsd version | ||
25 | */ | ||
26 | #define NFSD_SUPPORTED_MINOR_VERSION 1 | ||
27 | |||
28 | /* | ||
29 | * Flags for nfsd_permission | ||
30 | */ | ||
31 | #define NFSD_MAY_NOP 0 | ||
32 | #define NFSD_MAY_EXEC 1 /* == MAY_EXEC */ | ||
33 | #define NFSD_MAY_WRITE 2 /* == MAY_WRITE */ | ||
34 | #define NFSD_MAY_READ 4 /* == MAY_READ */ | ||
35 | #define NFSD_MAY_SATTR 8 | ||
36 | #define NFSD_MAY_TRUNC 16 | ||
37 | #define NFSD_MAY_LOCK 32 | ||
38 | #define NFSD_MAY_OWNER_OVERRIDE 64 | ||
39 | #define NFSD_MAY_LOCAL_ACCESS 128 /* IRIX doing local access check on device special file*/ | ||
40 | #define NFSD_MAY_BYPASS_GSS_ON_ROOT 256 | ||
41 | |||
42 | #define NFSD_MAY_CREATE (NFSD_MAY_EXEC|NFSD_MAY_WRITE) | ||
43 | #define NFSD_MAY_REMOVE (NFSD_MAY_EXEC|NFSD_MAY_WRITE|NFSD_MAY_TRUNC) | ||
44 | |||
45 | /* | ||
46 | * Callback function for readdir | ||
47 | */ | ||
48 | struct readdir_cd { | ||
49 | __be32 err; /* 0, nfserr, or nfserr_eof */ | ||
50 | }; | ||
51 | typedef int (*nfsd_dirop_t)(struct inode *, struct dentry *, int, int); | ||
52 | |||
53 | extern struct svc_program nfsd_program; | ||
54 | extern struct svc_version nfsd_version2, nfsd_version3, | ||
55 | nfsd_version4; | ||
56 | extern u32 nfsd_supported_minorversion; | ||
57 | extern struct mutex nfsd_mutex; | ||
58 | extern struct svc_serv *nfsd_serv; | ||
59 | extern spinlock_t nfsd_drc_lock; | ||
60 | extern unsigned int nfsd_drc_max_mem; | ||
61 | extern unsigned int nfsd_drc_mem_used; | ||
62 | |||
63 | extern const struct seq_operations nfs_exports_op; | ||
64 | |||
65 | /* | ||
66 | * Function prototypes. | ||
67 | */ | ||
68 | int nfsd_svc(unsigned short port, int nrservs); | ||
69 | int nfsd_dispatch(struct svc_rqst *rqstp, __be32 *statp); | ||
70 | |||
71 | int nfsd_nrthreads(void); | ||
72 | int nfsd_nrpools(void); | ||
73 | int nfsd_get_nrthreads(int n, int *); | ||
74 | int nfsd_set_nrthreads(int n, int *); | ||
75 | |||
76 | /* nfsd/vfs.c */ | ||
77 | int fh_lock_parent(struct svc_fh *, struct dentry *); | ||
78 | int nfsd_racache_init(int); | ||
79 | void nfsd_racache_shutdown(void); | ||
80 | int nfsd_cross_mnt(struct svc_rqst *rqstp, struct dentry **dpp, | ||
81 | struct svc_export **expp); | ||
82 | __be32 nfsd_lookup(struct svc_rqst *, struct svc_fh *, | ||
83 | const char *, unsigned int, struct svc_fh *); | ||
84 | __be32 nfsd_lookup_dentry(struct svc_rqst *, struct svc_fh *, | ||
85 | const char *, unsigned int, | ||
86 | struct svc_export **, struct dentry **); | ||
87 | __be32 nfsd_setattr(struct svc_rqst *, struct svc_fh *, | ||
88 | struct iattr *, int, time_t); | ||
89 | #ifdef CONFIG_NFSD_V4 | ||
90 | __be32 nfsd4_set_nfs4_acl(struct svc_rqst *, struct svc_fh *, | ||
91 | struct nfs4_acl *); | ||
92 | int nfsd4_get_nfs4_acl(struct svc_rqst *, struct dentry *, struct nfs4_acl **); | ||
93 | #endif /* CONFIG_NFSD_V4 */ | ||
94 | __be32 nfsd_create(struct svc_rqst *, struct svc_fh *, | ||
95 | char *name, int len, struct iattr *attrs, | ||
96 | int type, dev_t rdev, struct svc_fh *res); | ||
97 | #ifdef CONFIG_NFSD_V3 | ||
98 | __be32 nfsd_access(struct svc_rqst *, struct svc_fh *, u32 *, u32 *); | ||
99 | __be32 nfsd_create_v3(struct svc_rqst *, struct svc_fh *, | ||
100 | char *name, int len, struct iattr *attrs, | ||
101 | struct svc_fh *res, int createmode, | ||
102 | u32 *verifier, int *truncp, int *created); | ||
103 | __be32 nfsd_commit(struct svc_rqst *, struct svc_fh *, | ||
104 | loff_t, unsigned long); | ||
105 | #endif /* CONFIG_NFSD_V3 */ | ||
106 | __be32 nfsd_open(struct svc_rqst *, struct svc_fh *, int, | ||
107 | int, struct file **); | ||
108 | void nfsd_close(struct file *); | ||
109 | __be32 nfsd_read(struct svc_rqst *, struct svc_fh *, struct file *, | ||
110 | loff_t, struct kvec *, int, unsigned long *); | ||
111 | __be32 nfsd_write(struct svc_rqst *, struct svc_fh *,struct file *, | ||
112 | loff_t, struct kvec *,int, unsigned long *, int *); | ||
113 | __be32 nfsd_readlink(struct svc_rqst *, struct svc_fh *, | ||
114 | char *, int *); | ||
115 | __be32 nfsd_symlink(struct svc_rqst *, struct svc_fh *, | ||
116 | char *name, int len, char *path, int plen, | ||
117 | struct svc_fh *res, struct iattr *); | ||
118 | __be32 nfsd_link(struct svc_rqst *, struct svc_fh *, | ||
119 | char *, int, struct svc_fh *); | ||
120 | __be32 nfsd_rename(struct svc_rqst *, | ||
121 | struct svc_fh *, char *, int, | ||
122 | struct svc_fh *, char *, int); | ||
123 | __be32 nfsd_remove(struct svc_rqst *, | ||
124 | struct svc_fh *, char *, int); | ||
125 | __be32 nfsd_unlink(struct svc_rqst *, struct svc_fh *, int type, | ||
126 | char *name, int len); | ||
127 | int nfsd_truncate(struct svc_rqst *, struct svc_fh *, | ||
128 | unsigned long size); | ||
129 | __be32 nfsd_readdir(struct svc_rqst *, struct svc_fh *, | ||
130 | loff_t *, struct readdir_cd *, filldir_t); | ||
131 | __be32 nfsd_statfs(struct svc_rqst *, struct svc_fh *, | ||
132 | struct kstatfs *, int access); | ||
133 | |||
134 | int nfsd_notify_change(struct inode *, struct iattr *); | ||
135 | __be32 nfsd_permission(struct svc_rqst *, struct svc_export *, | ||
136 | struct dentry *, int); | ||
137 | int nfsd_sync_dir(struct dentry *dp); | ||
138 | |||
139 | #if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL) | ||
140 | #ifdef CONFIG_NFSD_V2_ACL | ||
141 | extern struct svc_version nfsd_acl_version2; | ||
142 | #else | ||
143 | #define nfsd_acl_version2 NULL | ||
144 | #endif | ||
145 | #ifdef CONFIG_NFSD_V3_ACL | ||
146 | extern struct svc_version nfsd_acl_version3; | ||
147 | #else | ||
148 | #define nfsd_acl_version3 NULL | ||
149 | #endif | ||
150 | struct posix_acl *nfsd_get_posix_acl(struct svc_fh *, int); | ||
151 | int nfsd_set_posix_acl(struct svc_fh *, int, struct posix_acl *); | ||
152 | #endif | ||
153 | |||
154 | enum vers_op {NFSD_SET, NFSD_CLEAR, NFSD_TEST, NFSD_AVAIL }; | ||
155 | int nfsd_vers(int vers, enum vers_op change); | ||
156 | int nfsd_minorversion(u32 minorversion, enum vers_op change); | ||
157 | void nfsd_reset_versions(void); | ||
158 | int nfsd_create_serv(void); | ||
159 | |||
160 | extern int nfsd_max_blksize; | ||
161 | |||
162 | /* | ||
163 | * NFSv4 State | ||
164 | */ | ||
165 | #ifdef CONFIG_NFSD_V4 | ||
166 | extern unsigned int max_delegations; | ||
167 | int nfs4_state_init(void); | ||
168 | void nfsd4_free_slabs(void); | ||
169 | int nfs4_state_start(void); | ||
170 | void nfs4_state_shutdown(void); | ||
171 | time_t nfs4_lease_time(void); | ||
172 | void nfs4_reset_lease(time_t leasetime); | ||
173 | int nfs4_reset_recoverydir(char *recdir); | ||
174 | #else | ||
175 | static inline int nfs4_state_init(void) { return 0; } | ||
176 | static inline void nfsd4_free_slabs(void) { } | ||
177 | static inline int nfs4_state_start(void) { return 0; } | ||
178 | static inline void nfs4_state_shutdown(void) { } | ||
179 | static inline time_t nfs4_lease_time(void) { return 0; } | ||
180 | static inline void nfs4_reset_lease(time_t leasetime) { } | ||
181 | static inline int nfs4_reset_recoverydir(char *recdir) { return 0; } | ||
182 | #endif | ||
183 | |||
184 | /* | ||
185 | * lockd binding | ||
186 | */ | ||
187 | void nfsd_lockd_init(void); | ||
188 | void nfsd_lockd_shutdown(void); | ||
189 | |||
190 | |||
191 | /* | ||
192 | * These macros provide pre-xdr'ed values for faster operation. | ||
193 | */ | ||
194 | #define nfs_ok cpu_to_be32(NFS_OK) | ||
195 | #define nfserr_perm cpu_to_be32(NFSERR_PERM) | ||
196 | #define nfserr_noent cpu_to_be32(NFSERR_NOENT) | ||
197 | #define nfserr_io cpu_to_be32(NFSERR_IO) | ||
198 | #define nfserr_nxio cpu_to_be32(NFSERR_NXIO) | ||
199 | #define nfserr_eagain cpu_to_be32(NFSERR_EAGAIN) | ||
200 | #define nfserr_acces cpu_to_be32(NFSERR_ACCES) | ||
201 | #define nfserr_exist cpu_to_be32(NFSERR_EXIST) | ||
202 | #define nfserr_xdev cpu_to_be32(NFSERR_XDEV) | ||
203 | #define nfserr_nodev cpu_to_be32(NFSERR_NODEV) | ||
204 | #define nfserr_notdir cpu_to_be32(NFSERR_NOTDIR) | ||
205 | #define nfserr_isdir cpu_to_be32(NFSERR_ISDIR) | ||
206 | #define nfserr_inval cpu_to_be32(NFSERR_INVAL) | ||
207 | #define nfserr_fbig cpu_to_be32(NFSERR_FBIG) | ||
208 | #define nfserr_nospc cpu_to_be32(NFSERR_NOSPC) | ||
209 | #define nfserr_rofs cpu_to_be32(NFSERR_ROFS) | ||
210 | #define nfserr_mlink cpu_to_be32(NFSERR_MLINK) | ||
211 | #define nfserr_opnotsupp cpu_to_be32(NFSERR_OPNOTSUPP) | ||
212 | #define nfserr_nametoolong cpu_to_be32(NFSERR_NAMETOOLONG) | ||
213 | #define nfserr_notempty cpu_to_be32(NFSERR_NOTEMPTY) | ||
214 | #define nfserr_dquot cpu_to_be32(NFSERR_DQUOT) | ||
215 | #define nfserr_stale cpu_to_be32(NFSERR_STALE) | ||
216 | #define nfserr_remote cpu_to_be32(NFSERR_REMOTE) | ||
217 | #define nfserr_wflush cpu_to_be32(NFSERR_WFLUSH) | ||
218 | #define nfserr_badhandle cpu_to_be32(NFSERR_BADHANDLE) | ||
219 | #define nfserr_notsync cpu_to_be32(NFSERR_NOT_SYNC) | ||
220 | #define nfserr_badcookie cpu_to_be32(NFSERR_BAD_COOKIE) | ||
221 | #define nfserr_notsupp cpu_to_be32(NFSERR_NOTSUPP) | ||
222 | #define nfserr_toosmall cpu_to_be32(NFSERR_TOOSMALL) | ||
223 | #define nfserr_serverfault cpu_to_be32(NFSERR_SERVERFAULT) | ||
224 | #define nfserr_badtype cpu_to_be32(NFSERR_BADTYPE) | ||
225 | #define nfserr_jukebox cpu_to_be32(NFSERR_JUKEBOX) | ||
226 | #define nfserr_denied cpu_to_be32(NFSERR_DENIED) | ||
227 | #define nfserr_deadlock cpu_to_be32(NFSERR_DEADLOCK) | ||
228 | #define nfserr_expired cpu_to_be32(NFSERR_EXPIRED) | ||
229 | #define nfserr_bad_cookie cpu_to_be32(NFSERR_BAD_COOKIE) | ||
230 | #define nfserr_same cpu_to_be32(NFSERR_SAME) | ||
231 | #define nfserr_clid_inuse cpu_to_be32(NFSERR_CLID_INUSE) | ||
232 | #define nfserr_stale_clientid cpu_to_be32(NFSERR_STALE_CLIENTID) | ||
233 | #define nfserr_resource cpu_to_be32(NFSERR_RESOURCE) | ||
234 | #define nfserr_moved cpu_to_be32(NFSERR_MOVED) | ||
235 | #define nfserr_nofilehandle cpu_to_be32(NFSERR_NOFILEHANDLE) | ||
236 | #define nfserr_minor_vers_mismatch cpu_to_be32(NFSERR_MINOR_VERS_MISMATCH) | ||
237 | #define nfserr_share_denied cpu_to_be32(NFSERR_SHARE_DENIED) | ||
238 | #define nfserr_stale_stateid cpu_to_be32(NFSERR_STALE_STATEID) | ||
239 | #define nfserr_old_stateid cpu_to_be32(NFSERR_OLD_STATEID) | ||
240 | #define nfserr_bad_stateid cpu_to_be32(NFSERR_BAD_STATEID) | ||
241 | #define nfserr_bad_seqid cpu_to_be32(NFSERR_BAD_SEQID) | ||
242 | #define nfserr_symlink cpu_to_be32(NFSERR_SYMLINK) | ||
243 | #define nfserr_not_same cpu_to_be32(NFSERR_NOT_SAME) | ||
244 | #define nfserr_restorefh cpu_to_be32(NFSERR_RESTOREFH) | ||
245 | #define nfserr_attrnotsupp cpu_to_be32(NFSERR_ATTRNOTSUPP) | ||
246 | #define nfserr_bad_xdr cpu_to_be32(NFSERR_BAD_XDR) | ||
247 | #define nfserr_openmode cpu_to_be32(NFSERR_OPENMODE) | ||
248 | #define nfserr_locks_held cpu_to_be32(NFSERR_LOCKS_HELD) | ||
249 | #define nfserr_op_illegal cpu_to_be32(NFSERR_OP_ILLEGAL) | ||
250 | #define nfserr_grace cpu_to_be32(NFSERR_GRACE) | ||
251 | #define nfserr_no_grace cpu_to_be32(NFSERR_NO_GRACE) | ||
252 | #define nfserr_reclaim_bad cpu_to_be32(NFSERR_RECLAIM_BAD) | ||
253 | #define nfserr_badname cpu_to_be32(NFSERR_BADNAME) | ||
254 | #define nfserr_cb_path_down cpu_to_be32(NFSERR_CB_PATH_DOWN) | ||
255 | #define nfserr_locked cpu_to_be32(NFSERR_LOCKED) | ||
256 | #define nfserr_wrongsec cpu_to_be32(NFSERR_WRONGSEC) | ||
257 | #define nfserr_badiomode cpu_to_be32(NFS4ERR_BADIOMODE) | ||
258 | #define nfserr_badlayout cpu_to_be32(NFS4ERR_BADLAYOUT) | ||
259 | #define nfserr_bad_session_digest cpu_to_be32(NFS4ERR_BAD_SESSION_DIGEST) | ||
260 | #define nfserr_badsession cpu_to_be32(NFS4ERR_BADSESSION) | ||
261 | #define nfserr_badslot cpu_to_be32(NFS4ERR_BADSLOT) | ||
262 | #define nfserr_complete_already cpu_to_be32(NFS4ERR_COMPLETE_ALREADY) | ||
263 | #define nfserr_conn_not_bound_to_session cpu_to_be32(NFS4ERR_CONN_NOT_BOUND_TO_SESSION) | ||
264 | #define nfserr_deleg_already_wanted cpu_to_be32(NFS4ERR_DELEG_ALREADY_WANTED) | ||
265 | #define nfserr_back_chan_busy cpu_to_be32(NFS4ERR_BACK_CHAN_BUSY) | ||
266 | #define nfserr_layouttrylater cpu_to_be32(NFS4ERR_LAYOUTTRYLATER) | ||
267 | #define nfserr_layoutunavailable cpu_to_be32(NFS4ERR_LAYOUTUNAVAILABLE) | ||
268 | #define nfserr_nomatching_layout cpu_to_be32(NFS4ERR_NOMATCHING_LAYOUT) | ||
269 | #define nfserr_recallconflict cpu_to_be32(NFS4ERR_RECALLCONFLICT) | ||
270 | #define nfserr_unknown_layouttype cpu_to_be32(NFS4ERR_UNKNOWN_LAYOUTTYPE) | ||
271 | #define nfserr_seq_misordered cpu_to_be32(NFS4ERR_SEQ_MISORDERED) | ||
272 | #define nfserr_sequence_pos cpu_to_be32(NFS4ERR_SEQUENCE_POS) | ||
273 | #define nfserr_req_too_big cpu_to_be32(NFS4ERR_REQ_TOO_BIG) | ||
274 | #define nfserr_rep_too_big cpu_to_be32(NFS4ERR_REP_TOO_BIG) | ||
275 | #define nfserr_rep_too_big_to_cache cpu_to_be32(NFS4ERR_REP_TOO_BIG_TO_CACHE) | ||
276 | #define nfserr_retry_uncached_rep cpu_to_be32(NFS4ERR_RETRY_UNCACHED_REP) | ||
277 | #define nfserr_unsafe_compound cpu_to_be32(NFS4ERR_UNSAFE_COMPOUND) | ||
278 | #define nfserr_too_many_ops cpu_to_be32(NFS4ERR_TOO_MANY_OPS) | ||
279 | #define nfserr_op_not_in_session cpu_to_be32(NFS4ERR_OP_NOT_IN_SESSION) | ||
280 | #define nfserr_hash_alg_unsupp cpu_to_be32(NFS4ERR_HASH_ALG_UNSUPP) | ||
281 | #define nfserr_clientid_busy cpu_to_be32(NFS4ERR_CLIENTID_BUSY) | ||
282 | #define nfserr_pnfs_io_hole cpu_to_be32(NFS4ERR_PNFS_IO_HOLE) | ||
283 | #define nfserr_seq_false_retry cpu_to_be32(NFS4ERR_SEQ_FALSE_RETRY) | ||
284 | #define nfserr_bad_high_slot cpu_to_be32(NFS4ERR_BAD_HIGH_SLOT) | ||
285 | #define nfserr_deadsession cpu_to_be32(NFS4ERR_DEADSESSION) | ||
286 | #define nfserr_encr_alg_unsupp cpu_to_be32(NFS4ERR_ENCR_ALG_UNSUPP) | ||
287 | #define nfserr_pnfs_no_layout cpu_to_be32(NFS4ERR_PNFS_NO_LAYOUT) | ||
288 | #define nfserr_not_only_op cpu_to_be32(NFS4ERR_NOT_ONLY_OP) | ||
289 | #define nfserr_wrong_cred cpu_to_be32(NFS4ERR_WRONG_CRED) | ||
290 | #define nfserr_wrong_type cpu_to_be32(NFS4ERR_WRONG_TYPE) | ||
291 | #define nfserr_dirdeleg_unavail cpu_to_be32(NFS4ERR_DIRDELEG_UNAVAIL) | ||
292 | #define nfserr_reject_deleg cpu_to_be32(NFS4ERR_REJECT_DELEG) | ||
293 | #define nfserr_returnconflict cpu_to_be32(NFS4ERR_RETURNCONFLICT) | ||
294 | #define nfserr_deleg_revoked cpu_to_be32(NFS4ERR_DELEG_REVOKED) | ||
295 | |||
296 | /* error codes for internal use */ | ||
297 | /* if a request fails due to kmalloc failure, it gets dropped. | ||
298 | * Client should resend eventually | ||
299 | */ | ||
300 | #define nfserr_dropit cpu_to_be32(30000) | ||
301 | /* end-of-file indicator in readdir */ | ||
302 | #define nfserr_eof cpu_to_be32(30001) | ||
303 | /* replay detected */ | ||
304 | #define nfserr_replay_me cpu_to_be32(11001) | ||
305 | /* nfs41 replay detected */ | ||
306 | #define nfserr_replay_cache cpu_to_be32(11002) | ||
307 | |||
308 | /* Check for dir entries '.' and '..' */ | ||
309 | #define isdotent(n, l) (l < 3 && n[0] == '.' && (l == 1 || n[1] == '.')) | ||
310 | |||
311 | /* | ||
312 | * Time of server startup | ||
313 | */ | ||
314 | extern struct timeval nfssvc_boot; | ||
315 | |||
316 | #ifdef CONFIG_NFSD_V4 | ||
317 | |||
318 | /* before processing a COMPOUND operation, we have to check that there | ||
319 | * is enough space in the buffer for XDR encode to succeed. otherwise, | ||
320 | * we might process an operation with side effects, and be unable to | ||
321 | * tell the client that the operation succeeded. | ||
322 | * | ||
323 | * COMPOUND_SLACK_SPACE - this is the minimum bytes of buffer space | ||
324 | * needed to encode an "ordinary" _successful_ operation. (GETATTR, | ||
325 | * READ, READDIR, and READLINK have their own buffer checks.) if we | ||
326 | * fall below this level, we fail the next operation with NFS4ERR_RESOURCE. | ||
327 | * | ||
328 | * COMPOUND_ERR_SLACK_SPACE - this is the minimum bytes of buffer space | ||
329 | * needed to encode an operation which has failed with NFS4ERR_RESOURCE. | ||
330 | * care is taken to ensure that we never fall below this level for any | ||
331 | * reason. | ||
332 | */ | ||
333 | #define COMPOUND_SLACK_SPACE 140 /* OP_GETFH */ | ||
334 | #define COMPOUND_ERR_SLACK_SPACE 12 /* OP_SETATTR */ | ||
335 | |||
336 | #define NFSD_LEASE_TIME (nfs4_lease_time()) | ||
337 | #define NFSD_LAUNDROMAT_MINTIMEOUT 10 /* seconds */ | ||
338 | |||
339 | /* | ||
340 | * The following attributes are currently not supported by the NFSv4 server: | ||
341 | * ARCHIVE (deprecated anyway) | ||
342 | * HIDDEN (unlikely to be supported any time soon) | ||
343 | * MIMETYPE (unlikely to be supported any time soon) | ||
344 | * QUOTA_* (will be supported in a forthcoming patch) | ||
345 | * SYSTEM (unlikely to be supported any time soon) | ||
346 | * TIME_BACKUP (unlikely to be supported any time soon) | ||
347 | * TIME_CREATE (unlikely to be supported any time soon) | ||
348 | */ | ||
349 | #define NFSD4_SUPPORTED_ATTRS_WORD0 \ | ||
350 | (FATTR4_WORD0_SUPPORTED_ATTRS | FATTR4_WORD0_TYPE | FATTR4_WORD0_FH_EXPIRE_TYPE \ | ||
351 | | FATTR4_WORD0_CHANGE | FATTR4_WORD0_SIZE | FATTR4_WORD0_LINK_SUPPORT \ | ||
352 | | FATTR4_WORD0_SYMLINK_SUPPORT | FATTR4_WORD0_NAMED_ATTR | FATTR4_WORD0_FSID \ | ||
353 | | FATTR4_WORD0_UNIQUE_HANDLES | FATTR4_WORD0_LEASE_TIME | FATTR4_WORD0_RDATTR_ERROR \ | ||
354 | | FATTR4_WORD0_ACLSUPPORT | FATTR4_WORD0_CANSETTIME | FATTR4_WORD0_CASE_INSENSITIVE \ | ||
355 | | FATTR4_WORD0_CASE_PRESERVING | FATTR4_WORD0_CHOWN_RESTRICTED \ | ||
356 | | FATTR4_WORD0_FILEHANDLE | FATTR4_WORD0_FILEID | FATTR4_WORD0_FILES_AVAIL \ | ||
357 | | FATTR4_WORD0_FILES_FREE | FATTR4_WORD0_FILES_TOTAL | FATTR4_WORD0_FS_LOCATIONS | FATTR4_WORD0_HOMOGENEOUS \ | ||
358 | | FATTR4_WORD0_MAXFILESIZE | FATTR4_WORD0_MAXLINK | FATTR4_WORD0_MAXNAME \ | ||
359 | | FATTR4_WORD0_MAXREAD | FATTR4_WORD0_MAXWRITE | FATTR4_WORD0_ACL) | ||
360 | |||
361 | #define NFSD4_SUPPORTED_ATTRS_WORD1 \ | ||
362 | (FATTR4_WORD1_MODE | FATTR4_WORD1_NO_TRUNC | FATTR4_WORD1_NUMLINKS \ | ||
363 | | FATTR4_WORD1_OWNER | FATTR4_WORD1_OWNER_GROUP | FATTR4_WORD1_RAWDEV \ | ||
364 | | FATTR4_WORD1_SPACE_AVAIL | FATTR4_WORD1_SPACE_FREE | FATTR4_WORD1_SPACE_TOTAL \ | ||
365 | | FATTR4_WORD1_SPACE_USED | FATTR4_WORD1_TIME_ACCESS | FATTR4_WORD1_TIME_ACCESS_SET \ | ||
366 | | FATTR4_WORD1_TIME_DELTA | FATTR4_WORD1_TIME_METADATA \ | ||
367 | | FATTR4_WORD1_TIME_MODIFY | FATTR4_WORD1_TIME_MODIFY_SET | FATTR4_WORD1_MOUNTED_ON_FILEID) | ||
368 | |||
369 | #define NFSD4_SUPPORTED_ATTRS_WORD2 0 | ||
370 | |||
371 | #define NFSD4_1_SUPPORTED_ATTRS_WORD0 \ | ||
372 | NFSD4_SUPPORTED_ATTRS_WORD0 | ||
373 | |||
374 | #define NFSD4_1_SUPPORTED_ATTRS_WORD1 \ | ||
375 | NFSD4_SUPPORTED_ATTRS_WORD1 | ||
376 | |||
377 | #define NFSD4_1_SUPPORTED_ATTRS_WORD2 \ | ||
378 | (NFSD4_SUPPORTED_ATTRS_WORD2 | FATTR4_WORD2_SUPPATTR_EXCLCREAT) | ||
379 | |||
380 | static inline u32 nfsd_suppattrs0(u32 minorversion) | ||
381 | { | ||
382 | return minorversion ? NFSD4_1_SUPPORTED_ATTRS_WORD0 | ||
383 | : NFSD4_SUPPORTED_ATTRS_WORD0; | ||
384 | } | ||
385 | |||
386 | static inline u32 nfsd_suppattrs1(u32 minorversion) | ||
387 | { | ||
388 | return minorversion ? NFSD4_1_SUPPORTED_ATTRS_WORD1 | ||
389 | : NFSD4_SUPPORTED_ATTRS_WORD1; | ||
390 | } | ||
391 | |||
392 | static inline u32 nfsd_suppattrs2(u32 minorversion) | ||
393 | { | ||
394 | return minorversion ? NFSD4_1_SUPPORTED_ATTRS_WORD2 | ||
395 | : NFSD4_SUPPORTED_ATTRS_WORD2; | ||
396 | } | ||
397 | |||
398 | /* These will return ERR_INVAL if specified in GETATTR or READDIR. */ | ||
399 | #define NFSD_WRITEONLY_ATTRS_WORD1 \ | ||
400 | (FATTR4_WORD1_TIME_ACCESS_SET | FATTR4_WORD1_TIME_MODIFY_SET) | ||
401 | |||
402 | /* These are the only attrs allowed in CREATE/OPEN/SETATTR. */ | ||
403 | #define NFSD_WRITEABLE_ATTRS_WORD0 \ | ||
404 | (FATTR4_WORD0_SIZE | FATTR4_WORD0_ACL ) | ||
405 | #define NFSD_WRITEABLE_ATTRS_WORD1 \ | ||
406 | (FATTR4_WORD1_MODE | FATTR4_WORD1_OWNER | FATTR4_WORD1_OWNER_GROUP \ | ||
407 | | FATTR4_WORD1_TIME_ACCESS_SET | FATTR4_WORD1_TIME_MODIFY_SET) | ||
408 | #define NFSD_WRITEABLE_ATTRS_WORD2 0 | ||
409 | |||
410 | #define NFSD_SUPPATTR_EXCLCREAT_WORD0 \ | ||
411 | NFSD_WRITEABLE_ATTRS_WORD0 | ||
412 | /* | ||
413 | * we currently store the exclusive create verifier in the v_{a,m}time | ||
414 | * attributes so the client can't set these at create time using EXCLUSIVE4_1 | ||
415 | */ | ||
416 | #define NFSD_SUPPATTR_EXCLCREAT_WORD1 \ | ||
417 | (NFSD_WRITEABLE_ATTRS_WORD1 & \ | ||
418 | ~(FATTR4_WORD1_TIME_ACCESS_SET | FATTR4_WORD1_TIME_MODIFY_SET)) | ||
419 | #define NFSD_SUPPATTR_EXCLCREAT_WORD2 \ | ||
420 | NFSD_WRITEABLE_ATTRS_WORD2 | ||
421 | |||
422 | #endif /* CONFIG_NFSD_V4 */ | ||
423 | |||
424 | #endif /* LINUX_NFSD_NFSD_H */ | ||
diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h index 8f641c908450..65e333afaee4 100644 --- a/include/linux/nfsd/nfsfh.h +++ b/include/linux/nfsd/nfsfh.h | |||
@@ -16,11 +16,9 @@ | |||
16 | 16 | ||
17 | # include <linux/types.h> | 17 | # include <linux/types.h> |
18 | #ifdef __KERNEL__ | 18 | #ifdef __KERNEL__ |
19 | # include <linux/string.h> | 19 | # include <linux/sunrpc/svc.h> |
20 | # include <linux/fs.h> | ||
21 | #endif | 20 | #endif |
22 | #include <linux/nfsd/const.h> | 21 | #include <linux/nfsd/const.h> |
23 | #include <linux/nfsd/debug.h> | ||
24 | 22 | ||
25 | /* | 23 | /* |
26 | * This is the old "dentry style" Linux NFSv2 file handle. | 24 | * This is the old "dentry style" Linux NFSv2 file handle. |
@@ -164,208 +162,6 @@ typedef struct svc_fh { | |||
164 | 162 | ||
165 | } svc_fh; | 163 | } svc_fh; |
166 | 164 | ||
167 | enum nfsd_fsid { | ||
168 | FSID_DEV = 0, | ||
169 | FSID_NUM, | ||
170 | FSID_MAJOR_MINOR, | ||
171 | FSID_ENCODE_DEV, | ||
172 | FSID_UUID4_INUM, | ||
173 | FSID_UUID8, | ||
174 | FSID_UUID16, | ||
175 | FSID_UUID16_INUM, | ||
176 | }; | ||
177 | |||
178 | enum fsid_source { | ||
179 | FSIDSOURCE_DEV, | ||
180 | FSIDSOURCE_FSID, | ||
181 | FSIDSOURCE_UUID, | ||
182 | }; | ||
183 | extern enum fsid_source fsid_source(struct svc_fh *fhp); | ||
184 | |||
185 | |||
186 | /* This might look a little large to "inline" but in all calls except | ||
187 | * one, 'vers' is constant so moste of the function disappears. | ||
188 | */ | ||
189 | static inline void mk_fsid(int vers, u32 *fsidv, dev_t dev, ino_t ino, | ||
190 | u32 fsid, unsigned char *uuid) | ||
191 | { | ||
192 | u32 *up; | ||
193 | switch(vers) { | ||
194 | case FSID_DEV: | ||
195 | fsidv[0] = htonl((MAJOR(dev)<<16) | | ||
196 | MINOR(dev)); | ||
197 | fsidv[1] = ino_t_to_u32(ino); | ||
198 | break; | ||
199 | case FSID_NUM: | ||
200 | fsidv[0] = fsid; | ||
201 | break; | ||
202 | case FSID_MAJOR_MINOR: | ||
203 | fsidv[0] = htonl(MAJOR(dev)); | ||
204 | fsidv[1] = htonl(MINOR(dev)); | ||
205 | fsidv[2] = ino_t_to_u32(ino); | ||
206 | break; | ||
207 | |||
208 | case FSID_ENCODE_DEV: | ||
209 | fsidv[0] = new_encode_dev(dev); | ||
210 | fsidv[1] = ino_t_to_u32(ino); | ||
211 | break; | ||
212 | |||
213 | case FSID_UUID4_INUM: | ||
214 | /* 4 byte fsid and inode number */ | ||
215 | up = (u32*)uuid; | ||
216 | fsidv[0] = ino_t_to_u32(ino); | ||
217 | fsidv[1] = up[0] ^ up[1] ^ up[2] ^ up[3]; | ||
218 | break; | ||
219 | |||
220 | case FSID_UUID8: | ||
221 | /* 8 byte fsid */ | ||
222 | up = (u32*)uuid; | ||
223 | fsidv[0] = up[0] ^ up[2]; | ||
224 | fsidv[1] = up[1] ^ up[3]; | ||
225 | break; | ||
226 | |||
227 | case FSID_UUID16: | ||
228 | /* 16 byte fsid - NFSv3+ only */ | ||
229 | memcpy(fsidv, uuid, 16); | ||
230 | break; | ||
231 | |||
232 | case FSID_UUID16_INUM: | ||
233 | /* 8 byte inode and 16 byte fsid */ | ||
234 | *(u64*)fsidv = (u64)ino; | ||
235 | memcpy(fsidv+2, uuid, 16); | ||
236 | break; | ||
237 | default: BUG(); | ||
238 | } | ||
239 | } | ||
240 | |||
241 | static inline int key_len(int type) | ||
242 | { | ||
243 | switch(type) { | ||
244 | case FSID_DEV: return 8; | ||
245 | case FSID_NUM: return 4; | ||
246 | case FSID_MAJOR_MINOR: return 12; | ||
247 | case FSID_ENCODE_DEV: return 8; | ||
248 | case FSID_UUID4_INUM: return 8; | ||
249 | case FSID_UUID8: return 8; | ||
250 | case FSID_UUID16: return 16; | ||
251 | case FSID_UUID16_INUM: return 24; | ||
252 | default: return 0; | ||
253 | } | ||
254 | } | ||
255 | |||
256 | /* | ||
257 | * Shorthand for dprintk()'s | ||
258 | */ | ||
259 | extern char * SVCFH_fmt(struct svc_fh *fhp); | ||
260 | |||
261 | /* | ||
262 | * Function prototypes | ||
263 | */ | ||
264 | __be32 fh_verify(struct svc_rqst *, struct svc_fh *, int, int); | ||
265 | __be32 fh_compose(struct svc_fh *, struct svc_export *, struct dentry *, struct svc_fh *); | ||
266 | __be32 fh_update(struct svc_fh *); | ||
267 | void fh_put(struct svc_fh *); | ||
268 | |||
269 | static __inline__ struct svc_fh * | ||
270 | fh_copy(struct svc_fh *dst, struct svc_fh *src) | ||
271 | { | ||
272 | WARN_ON(src->fh_dentry || src->fh_locked); | ||
273 | |||
274 | *dst = *src; | ||
275 | return dst; | ||
276 | } | ||
277 | |||
278 | static inline void | ||
279 | fh_copy_shallow(struct knfsd_fh *dst, struct knfsd_fh *src) | ||
280 | { | ||
281 | dst->fh_size = src->fh_size; | ||
282 | memcpy(&dst->fh_base, &src->fh_base, src->fh_size); | ||
283 | } | ||
284 | |||
285 | static __inline__ struct svc_fh * | ||
286 | fh_init(struct svc_fh *fhp, int maxsize) | ||
287 | { | ||
288 | memset(fhp, 0, sizeof(*fhp)); | ||
289 | fhp->fh_maxsize = maxsize; | ||
290 | return fhp; | ||
291 | } | ||
292 | |||
293 | #ifdef CONFIG_NFSD_V3 | ||
294 | /* | ||
295 | * Fill in the pre_op attr for the wcc data | ||
296 | */ | ||
297 | static inline void | ||
298 | fill_pre_wcc(struct svc_fh *fhp) | ||
299 | { | ||
300 | struct inode *inode; | ||
301 | |||
302 | inode = fhp->fh_dentry->d_inode; | ||
303 | if (!fhp->fh_pre_saved) { | ||
304 | fhp->fh_pre_mtime = inode->i_mtime; | ||
305 | fhp->fh_pre_ctime = inode->i_ctime; | ||
306 | fhp->fh_pre_size = inode->i_size; | ||
307 | fhp->fh_pre_change = inode->i_version; | ||
308 | fhp->fh_pre_saved = 1; | ||
309 | } | ||
310 | } | ||
311 | |||
312 | extern void fill_post_wcc(struct svc_fh *); | ||
313 | #else | ||
314 | #define fill_pre_wcc(ignored) | ||
315 | #define fill_post_wcc(notused) | ||
316 | #endif /* CONFIG_NFSD_V3 */ | ||
317 | |||
318 | |||
319 | /* | ||
320 | * Lock a file handle/inode | ||
321 | * NOTE: both fh_lock and fh_unlock are done "by hand" in | ||
322 | * vfs.c:nfsd_rename as it needs to grab 2 i_mutex's at once | ||
323 | * so, any changes here should be reflected there. | ||
324 | */ | ||
325 | |||
326 | static inline void | ||
327 | fh_lock_nested(struct svc_fh *fhp, unsigned int subclass) | ||
328 | { | ||
329 | struct dentry *dentry = fhp->fh_dentry; | ||
330 | struct inode *inode; | ||
331 | |||
332 | dfprintk(FILEOP, "nfsd: fh_lock(%s) locked = %d\n", | ||
333 | SVCFH_fmt(fhp), fhp->fh_locked); | ||
334 | |||
335 | BUG_ON(!dentry); | ||
336 | |||
337 | if (fhp->fh_locked) { | ||
338 | printk(KERN_WARNING "fh_lock: %s/%s already locked!\n", | ||
339 | dentry->d_parent->d_name.name, dentry->d_name.name); | ||
340 | return; | ||
341 | } | ||
342 | |||
343 | inode = dentry->d_inode; | ||
344 | mutex_lock_nested(&inode->i_mutex, subclass); | ||
345 | fill_pre_wcc(fhp); | ||
346 | fhp->fh_locked = 1; | ||
347 | } | ||
348 | |||
349 | static inline void | ||
350 | fh_lock(struct svc_fh *fhp) | ||
351 | { | ||
352 | fh_lock_nested(fhp, I_MUTEX_NORMAL); | ||
353 | } | ||
354 | |||
355 | /* | ||
356 | * Unlock a file handle/inode | ||
357 | */ | ||
358 | static inline void | ||
359 | fh_unlock(struct svc_fh *fhp) | ||
360 | { | ||
361 | BUG_ON(!fhp->fh_dentry); | ||
362 | |||
363 | if (fhp->fh_locked) { | ||
364 | fill_post_wcc(fhp); | ||
365 | mutex_unlock(&fhp->fh_dentry->d_inode->i_mutex); | ||
366 | fhp->fh_locked = 0; | ||
367 | } | ||
368 | } | ||
369 | #endif /* __KERNEL__ */ | 165 | #endif /* __KERNEL__ */ |
370 | 166 | ||
371 | 167 | ||
diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h deleted file mode 100644 index b38d11324189..000000000000 --- a/include/linux/nfsd/state.h +++ /dev/null | |||
@@ -1,404 +0,0 @@ | |||
1 | /* | ||
2 | * linux/include/nfsd/state.h | ||
3 | * | ||
4 | * Copyright (c) 2001 The Regents of the University of Michigan. | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * Kendrick Smith <kmsmith@umich.edu> | ||
8 | * Andy Adamson <andros@umich.edu> | ||
9 | * | ||
10 | * Redistribution and use in source and binary forms, with or without | ||
11 | * modification, are permitted provided that the following conditions | ||
12 | * are met: | ||
13 | * | ||
14 | * 1. Redistributions of source code must retain the above copyright | ||
15 | * notice, this list of conditions and the following disclaimer. | ||
16 | * 2. Redistributions in binary form must reproduce the above copyright | ||
17 | * notice, this list of conditions and the following disclaimer in the | ||
18 | * documentation and/or other materials provided with the distribution. | ||
19 | * 3. Neither the name of the University nor the names of its | ||
20 | * contributors may be used to endorse or promote products derived | ||
21 | * from this software without specific prior written permission. | ||
22 | * | ||
23 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
24 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
25 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
26 | * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
27 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
28 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
29 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR | ||
30 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
31 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
32 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
33 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
34 | * | ||
35 | */ | ||
36 | |||
37 | #ifndef _NFSD4_STATE_H | ||
38 | #define _NFSD4_STATE_H | ||
39 | |||
40 | #include <linux/list.h> | ||
41 | #include <linux/kref.h> | ||
42 | #include <linux/sunrpc/clnt.h> | ||
43 | |||
44 | typedef struct { | ||
45 | u32 cl_boot; | ||
46 | u32 cl_id; | ||
47 | } clientid_t; | ||
48 | |||
49 | typedef struct { | ||
50 | u32 so_boot; | ||
51 | u32 so_stateownerid; | ||
52 | u32 so_fileid; | ||
53 | } stateid_opaque_t; | ||
54 | |||
55 | typedef struct { | ||
56 | u32 si_generation; | ||
57 | stateid_opaque_t si_opaque; | ||
58 | } stateid_t; | ||
59 | #define si_boot si_opaque.so_boot | ||
60 | #define si_stateownerid si_opaque.so_stateownerid | ||
61 | #define si_fileid si_opaque.so_fileid | ||
62 | |||
63 | struct nfsd4_cb_sequence { | ||
64 | /* args/res */ | ||
65 | u32 cbs_minorversion; | ||
66 | struct nfs4_client *cbs_clp; | ||
67 | }; | ||
68 | |||
69 | struct nfs4_delegation { | ||
70 | struct list_head dl_perfile; | ||
71 | struct list_head dl_perclnt; | ||
72 | struct list_head dl_recall_lru; /* delegation recalled */ | ||
73 | atomic_t dl_count; /* ref count */ | ||
74 | struct nfs4_client *dl_client; | ||
75 | struct nfs4_file *dl_file; | ||
76 | struct file_lock *dl_flock; | ||
77 | struct file *dl_vfs_file; | ||
78 | u32 dl_type; | ||
79 | time_t dl_time; | ||
80 | /* For recall: */ | ||
81 | u32 dl_ident; | ||
82 | stateid_t dl_stateid; | ||
83 | struct knfsd_fh dl_fh; | ||
84 | int dl_retries; | ||
85 | }; | ||
86 | |||
87 | /* client delegation callback info */ | ||
88 | struct nfs4_cb_conn { | ||
89 | /* SETCLIENTID info */ | ||
90 | struct sockaddr_storage cb_addr; | ||
91 | size_t cb_addrlen; | ||
92 | u32 cb_prog; | ||
93 | u32 cb_minorversion; | ||
94 | u32 cb_ident; /* minorversion 0 only */ | ||
95 | /* RPC client info */ | ||
96 | atomic_t cb_set; /* successful CB_NULL call */ | ||
97 | struct rpc_clnt * cb_client; | ||
98 | }; | ||
99 | |||
100 | /* Maximum number of slots per session. 160 is useful for long haul TCP */ | ||
101 | #define NFSD_MAX_SLOTS_PER_SESSION 160 | ||
102 | /* Maximum number of operations per session compound */ | ||
103 | #define NFSD_MAX_OPS_PER_COMPOUND 16 | ||
104 | /* Maximum session per slot cache size */ | ||
105 | #define NFSD_SLOT_CACHE_SIZE 1024 | ||
106 | /* Maximum number of NFSD_SLOT_CACHE_SIZE slots per session */ | ||
107 | #define NFSD_CACHE_SIZE_SLOTS_PER_SESSION 32 | ||
108 | #define NFSD_MAX_MEM_PER_SESSION \ | ||
109 | (NFSD_CACHE_SIZE_SLOTS_PER_SESSION * NFSD_SLOT_CACHE_SIZE) | ||
110 | |||
111 | struct nfsd4_slot { | ||
112 | bool sl_inuse; | ||
113 | bool sl_cachethis; | ||
114 | u16 sl_opcnt; | ||
115 | u32 sl_seqid; | ||
116 | __be32 sl_status; | ||
117 | u32 sl_datalen; | ||
118 | char sl_data[]; | ||
119 | }; | ||
120 | |||
121 | struct nfsd4_channel_attrs { | ||
122 | u32 headerpadsz; | ||
123 | u32 maxreq_sz; | ||
124 | u32 maxresp_sz; | ||
125 | u32 maxresp_cached; | ||
126 | u32 maxops; | ||
127 | u32 maxreqs; | ||
128 | u32 nr_rdma_attrs; | ||
129 | u32 rdma_attrs; | ||
130 | }; | ||
131 | |||
132 | struct nfsd4_create_session { | ||
133 | clientid_t clientid; | ||
134 | struct nfs4_sessionid sessionid; | ||
135 | u32 seqid; | ||
136 | u32 flags; | ||
137 | struct nfsd4_channel_attrs fore_channel; | ||
138 | struct nfsd4_channel_attrs back_channel; | ||
139 | u32 callback_prog; | ||
140 | u32 uid; | ||
141 | u32 gid; | ||
142 | }; | ||
143 | |||
144 | /* The single slot clientid cache structure */ | ||
145 | struct nfsd4_clid_slot { | ||
146 | u32 sl_seqid; | ||
147 | __be32 sl_status; | ||
148 | struct nfsd4_create_session sl_cr_ses; | ||
149 | }; | ||
150 | |||
151 | struct nfsd4_session { | ||
152 | struct kref se_ref; | ||
153 | struct list_head se_hash; /* hash by sessionid */ | ||
154 | struct list_head se_perclnt; | ||
155 | u32 se_flags; | ||
156 | struct nfs4_client *se_client; /* for expire_client */ | ||
157 | struct nfs4_sessionid se_sessionid; | ||
158 | struct nfsd4_channel_attrs se_fchannel; | ||
159 | struct nfsd4_channel_attrs se_bchannel; | ||
160 | struct nfsd4_slot *se_slots[]; /* forward channel slots */ | ||
161 | }; | ||
162 | |||
163 | static inline void | ||
164 | nfsd4_put_session(struct nfsd4_session *ses) | ||
165 | { | ||
166 | extern void free_session(struct kref *kref); | ||
167 | kref_put(&ses->se_ref, free_session); | ||
168 | } | ||
169 | |||
170 | static inline void | ||
171 | nfsd4_get_session(struct nfsd4_session *ses) | ||
172 | { | ||
173 | kref_get(&ses->se_ref); | ||
174 | } | ||
175 | |||
176 | /* formatted contents of nfs4_sessionid */ | ||
177 | struct nfsd4_sessionid { | ||
178 | clientid_t clientid; | ||
179 | u32 sequence; | ||
180 | u32 reserved; | ||
181 | }; | ||
182 | |||
183 | #define HEXDIR_LEN 33 /* hex version of 16 byte md5 of cl_name plus '\0' */ | ||
184 | |||
185 | /* | ||
186 | * struct nfs4_client - one per client. Clientids live here. | ||
187 | * o Each nfs4_client is hashed by clientid. | ||
188 | * | ||
189 | * o Each nfs4_clients is also hashed by name | ||
190 | * (the opaque quantity initially sent by the client to identify itself). | ||
191 | * | ||
192 | * o cl_perclient list is used to ensure no dangling stateowner references | ||
193 | * when we expire the nfs4_client | ||
194 | */ | ||
195 | struct nfs4_client { | ||
196 | struct list_head cl_idhash; /* hash by cl_clientid.id */ | ||
197 | struct list_head cl_strhash; /* hash by cl_name */ | ||
198 | struct list_head cl_openowners; | ||
199 | struct list_head cl_delegations; | ||
200 | struct list_head cl_lru; /* tail queue */ | ||
201 | struct xdr_netobj cl_name; /* id generated by client */ | ||
202 | char cl_recdir[HEXDIR_LEN]; /* recovery dir */ | ||
203 | nfs4_verifier cl_verifier; /* generated by client */ | ||
204 | time_t cl_time; /* time of last lease renewal */ | ||
205 | struct sockaddr_storage cl_addr; /* client ipaddress */ | ||
206 | u32 cl_flavor; /* setclientid pseudoflavor */ | ||
207 | char *cl_principal; /* setclientid principal name */ | ||
208 | struct svc_cred cl_cred; /* setclientid principal */ | ||
209 | clientid_t cl_clientid; /* generated by server */ | ||
210 | nfs4_verifier cl_confirm; /* generated by server */ | ||
211 | struct nfs4_cb_conn cl_cb_conn; /* callback info */ | ||
212 | atomic_t cl_count; /* ref count */ | ||
213 | u32 cl_firststate; /* recovery dir creation */ | ||
214 | |||
215 | /* for nfs41 */ | ||
216 | struct list_head cl_sessions; | ||
217 | struct nfsd4_clid_slot cl_cs_slot; /* create_session slot */ | ||
218 | u32 cl_exchange_flags; | ||
219 | struct nfs4_sessionid cl_sessionid; | ||
220 | |||
221 | /* for nfs41 callbacks */ | ||
222 | /* We currently support a single back channel with a single slot */ | ||
223 | unsigned long cl_cb_slot_busy; | ||
224 | u32 cl_cb_seq_nr; | ||
225 | struct svc_xprt *cl_cb_xprt; /* 4.1 callback transport */ | ||
226 | struct rpc_wait_queue cl_cb_waitq; /* backchannel callers may */ | ||
227 | /* wait here for slots */ | ||
228 | }; | ||
229 | |||
230 | /* struct nfs4_client_reset | ||
231 | * one per old client. Populates reset_str_hashtbl. Filled from conf_id_hashtbl | ||
232 | * upon lease reset, or from upcall to state_daemon (to read in state | ||
233 | * from non-volitile storage) upon reboot. | ||
234 | */ | ||
235 | struct nfs4_client_reclaim { | ||
236 | struct list_head cr_strhash; /* hash by cr_name */ | ||
237 | char cr_recdir[HEXDIR_LEN]; /* recover dir */ | ||
238 | }; | ||
239 | |||
240 | static inline void | ||
241 | update_stateid(stateid_t *stateid) | ||
242 | { | ||
243 | stateid->si_generation++; | ||
244 | } | ||
245 | |||
246 | /* A reasonable value for REPLAY_ISIZE was estimated as follows: | ||
247 | * The OPEN response, typically the largest, requires | ||
248 | * 4(status) + 8(stateid) + 20(changeinfo) + 4(rflags) + 8(verifier) + | ||
249 | * 4(deleg. type) + 8(deleg. stateid) + 4(deleg. recall flag) + | ||
250 | * 20(deleg. space limit) + ~32(deleg. ace) = 112 bytes | ||
251 | */ | ||
252 | |||
253 | #define NFSD4_REPLAY_ISIZE 112 | ||
254 | |||
255 | /* | ||
256 | * Replay buffer, where the result of the last seqid-mutating operation | ||
257 | * is cached. | ||
258 | */ | ||
259 | struct nfs4_replay { | ||
260 | __be32 rp_status; | ||
261 | unsigned int rp_buflen; | ||
262 | char *rp_buf; | ||
263 | unsigned intrp_allocated; | ||
264 | struct knfsd_fh rp_openfh; | ||
265 | char rp_ibuf[NFSD4_REPLAY_ISIZE]; | ||
266 | }; | ||
267 | |||
268 | /* | ||
269 | * nfs4_stateowner can either be an open_owner, or a lock_owner | ||
270 | * | ||
271 | * so_idhash: stateid_hashtbl[] for open owner, lockstateid_hashtbl[] | ||
272 | * for lock_owner | ||
273 | * so_strhash: ownerstr_hashtbl[] for open_owner, lock_ownerstr_hashtbl[] | ||
274 | * for lock_owner | ||
275 | * so_perclient: nfs4_client->cl_perclient entry - used when nfs4_client | ||
276 | * struct is reaped. | ||
277 | * so_perfilestate: heads the list of nfs4_stateid (either open or lock) | ||
278 | * and is used to ensure no dangling nfs4_stateid references when we | ||
279 | * release a stateowner. | ||
280 | * so_perlockowner: (open) nfs4_stateid->st_perlockowner entry - used when | ||
281 | * close is called to reap associated byte-range locks | ||
282 | * so_close_lru: (open) stateowner is placed on this list instead of being | ||
283 | * reaped (when so_perfilestate is empty) to hold the last close replay. | ||
284 | * reaped by laundramat thread after lease period. | ||
285 | */ | ||
286 | struct nfs4_stateowner { | ||
287 | struct kref so_ref; | ||
288 | struct list_head so_idhash; /* hash by so_id */ | ||
289 | struct list_head so_strhash; /* hash by op_name */ | ||
290 | struct list_head so_perclient; | ||
291 | struct list_head so_stateids; | ||
292 | struct list_head so_perstateid; /* for lockowners only */ | ||
293 | struct list_head so_close_lru; /* tail queue */ | ||
294 | time_t so_time; /* time of placement on so_close_lru */ | ||
295 | int so_is_open_owner; /* 1=openowner,0=lockowner */ | ||
296 | u32 so_id; | ||
297 | struct nfs4_client * so_client; | ||
298 | /* after increment in ENCODE_SEQID_OP_TAIL, represents the next | ||
299 | * sequence id expected from the client: */ | ||
300 | u32 so_seqid; | ||
301 | struct xdr_netobj so_owner; /* open owner name */ | ||
302 | int so_confirmed; /* successful OPEN_CONFIRM? */ | ||
303 | struct nfs4_replay so_replay; | ||
304 | }; | ||
305 | |||
306 | /* | ||
307 | * nfs4_file: a file opened by some number of (open) nfs4_stateowners. | ||
308 | * o fi_perfile list is used to search for conflicting | ||
309 | * share_acces, share_deny on the file. | ||
310 | */ | ||
311 | struct nfs4_file { | ||
312 | atomic_t fi_ref; | ||
313 | struct list_head fi_hash; /* hash by "struct inode *" */ | ||
314 | struct list_head fi_stateids; | ||
315 | struct list_head fi_delegations; | ||
316 | struct inode *fi_inode; | ||
317 | u32 fi_id; /* used with stateowner->so_id | ||
318 | * for stateid_hashtbl hash */ | ||
319 | bool fi_had_conflict; | ||
320 | }; | ||
321 | |||
322 | /* | ||
323 | * nfs4_stateid can either be an open stateid or (eventually) a lock stateid | ||
324 | * | ||
325 | * (open)nfs4_stateid: one per (open)nfs4_stateowner, nfs4_file | ||
326 | * | ||
327 | * st_hash: stateid_hashtbl[] entry or lockstateid_hashtbl entry | ||
328 | * st_perfile: file_hashtbl[] entry. | ||
329 | * st_perfile_state: nfs4_stateowner->so_perfilestate | ||
330 | * st_perlockowner: (open stateid) list of lock nfs4_stateowners | ||
331 | * st_access_bmap: used only for open stateid | ||
332 | * st_deny_bmap: used only for open stateid | ||
333 | * st_openstp: open stateid lock stateid was derived from | ||
334 | * | ||
335 | * XXX: open stateids and lock stateids have diverged sufficiently that | ||
336 | * we should consider defining separate structs for the two cases. | ||
337 | */ | ||
338 | |||
339 | struct nfs4_stateid { | ||
340 | struct list_head st_hash; | ||
341 | struct list_head st_perfile; | ||
342 | struct list_head st_perstateowner; | ||
343 | struct list_head st_lockowners; | ||
344 | struct nfs4_stateowner * st_stateowner; | ||
345 | struct nfs4_file * st_file; | ||
346 | stateid_t st_stateid; | ||
347 | struct file * st_vfs_file; | ||
348 | unsigned long st_access_bmap; | ||
349 | unsigned long st_deny_bmap; | ||
350 | struct nfs4_stateid * st_openstp; | ||
351 | }; | ||
352 | |||
353 | /* flags for preprocess_seqid_op() */ | ||
354 | #define HAS_SESSION 0x00000001 | ||
355 | #define CONFIRM 0x00000002 | ||
356 | #define OPEN_STATE 0x00000004 | ||
357 | #define LOCK_STATE 0x00000008 | ||
358 | #define RD_STATE 0x00000010 | ||
359 | #define WR_STATE 0x00000020 | ||
360 | #define CLOSE_STATE 0x00000040 | ||
361 | |||
362 | #define seqid_mutating_err(err) \ | ||
363 | (((err) != nfserr_stale_clientid) && \ | ||
364 | ((err) != nfserr_bad_seqid) && \ | ||
365 | ((err) != nfserr_stale_stateid) && \ | ||
366 | ((err) != nfserr_bad_stateid)) | ||
367 | |||
368 | struct nfsd4_compound_state; | ||
369 | |||
370 | extern __be32 nfs4_preprocess_stateid_op(struct nfsd4_compound_state *cstate, | ||
371 | stateid_t *stateid, int flags, struct file **filp); | ||
372 | extern void nfs4_lock_state(void); | ||
373 | extern void nfs4_unlock_state(void); | ||
374 | extern int nfs4_in_grace(void); | ||
375 | extern __be32 nfs4_check_open_reclaim(clientid_t *clid); | ||
376 | extern void put_nfs4_client(struct nfs4_client *clp); | ||
377 | extern void nfs4_free_stateowner(struct kref *kref); | ||
378 | extern int set_callback_cred(void); | ||
379 | extern void nfsd4_probe_callback(struct nfs4_client *clp); | ||
380 | extern void nfsd4_cb_recall(struct nfs4_delegation *dp); | ||
381 | extern void nfs4_put_delegation(struct nfs4_delegation *dp); | ||
382 | extern __be32 nfs4_make_rec_clidname(char *clidname, struct xdr_netobj *clname); | ||
383 | extern void nfsd4_init_recdir(char *recdir_name); | ||
384 | extern int nfsd4_recdir_load(void); | ||
385 | extern void nfsd4_shutdown_recdir(void); | ||
386 | extern int nfs4_client_to_reclaim(const char *name); | ||
387 | extern int nfs4_has_reclaimed_state(const char *name, bool use_exchange_id); | ||
388 | extern void nfsd4_recdir_purge_old(void); | ||
389 | extern int nfsd4_create_clid_dir(struct nfs4_client *clp); | ||
390 | extern void nfsd4_remove_clid_dir(struct nfs4_client *clp); | ||
391 | |||
392 | static inline void | ||
393 | nfs4_put_stateowner(struct nfs4_stateowner *so) | ||
394 | { | ||
395 | kref_put(&so->so_ref, nfs4_free_stateowner); | ||
396 | } | ||
397 | |||
398 | static inline void | ||
399 | nfs4_get_stateowner(struct nfs4_stateowner *so) | ||
400 | { | ||
401 | kref_get(&so->so_ref); | ||
402 | } | ||
403 | |||
404 | #endif /* NFSD4_STATE_H */ | ||
diff --git a/include/linux/nfsd/syscall.h b/include/linux/nfsd/syscall.h index 7a3b565b898f..812bc1e160dc 100644 --- a/include/linux/nfsd/syscall.h +++ b/include/linux/nfsd/syscall.h | |||
@@ -9,14 +9,8 @@ | |||
9 | #ifndef NFSD_SYSCALL_H | 9 | #ifndef NFSD_SYSCALL_H |
10 | #define NFSD_SYSCALL_H | 10 | #define NFSD_SYSCALL_H |
11 | 11 | ||
12 | # include <linux/types.h> | 12 | #include <linux/types.h> |
13 | #ifdef __KERNEL__ | ||
14 | # include <linux/in.h> | ||
15 | #endif | ||
16 | #include <linux/posix_types.h> | ||
17 | #include <linux/nfsd/const.h> | ||
18 | #include <linux/nfsd/export.h> | 13 | #include <linux/nfsd/export.h> |
19 | #include <linux/nfsd/nfsfh.h> | ||
20 | 14 | ||
21 | /* | 15 | /* |
22 | * Version of the syscall interface | 16 | * Version of the syscall interface |
diff --git a/include/linux/nfsd/xdr.h b/include/linux/nfsd/xdr.h deleted file mode 100644 index a0132ef58f21..000000000000 --- a/include/linux/nfsd/xdr.h +++ /dev/null | |||
@@ -1,177 +0,0 @@ | |||
1 | /* | ||
2 | * linux/include/linux/nfsd/xdr.h | ||
3 | * | ||
4 | * XDR types for nfsd. This is mainly a typing exercise. | ||
5 | */ | ||
6 | |||
7 | #ifndef LINUX_NFSD_H | ||
8 | #define LINUX_NFSD_H | ||
9 | |||
10 | #include <linux/fs.h> | ||
11 | #include <linux/vfs.h> | ||
12 | #include <linux/nfs.h> | ||
13 | |||
14 | struct nfsd_fhandle { | ||
15 | struct svc_fh fh; | ||
16 | }; | ||
17 | |||
18 | struct nfsd_sattrargs { | ||
19 | struct svc_fh fh; | ||
20 | struct iattr attrs; | ||
21 | }; | ||
22 | |||
23 | struct nfsd_diropargs { | ||
24 | struct svc_fh fh; | ||
25 | char * name; | ||
26 | unsigned int len; | ||
27 | }; | ||
28 | |||
29 | struct nfsd_readargs { | ||
30 | struct svc_fh fh; | ||
31 | __u32 offset; | ||
32 | __u32 count; | ||
33 | int vlen; | ||
34 | }; | ||
35 | |||
36 | struct nfsd_writeargs { | ||
37 | svc_fh fh; | ||
38 | __u32 offset; | ||
39 | int len; | ||
40 | int vlen; | ||
41 | }; | ||
42 | |||
43 | struct nfsd_createargs { | ||
44 | struct svc_fh fh; | ||
45 | char * name; | ||
46 | unsigned int len; | ||
47 | struct iattr attrs; | ||
48 | }; | ||
49 | |||
50 | struct nfsd_renameargs { | ||
51 | struct svc_fh ffh; | ||
52 | char * fname; | ||
53 | unsigned int flen; | ||
54 | struct svc_fh tfh; | ||
55 | char * tname; | ||
56 | unsigned int tlen; | ||
57 | }; | ||
58 | |||
59 | struct nfsd_readlinkargs { | ||
60 | struct svc_fh fh; | ||
61 | char * buffer; | ||
62 | }; | ||
63 | |||
64 | struct nfsd_linkargs { | ||
65 | struct svc_fh ffh; | ||
66 | struct svc_fh tfh; | ||
67 | char * tname; | ||
68 | unsigned int tlen; | ||
69 | }; | ||
70 | |||
71 | struct nfsd_symlinkargs { | ||
72 | struct svc_fh ffh; | ||
73 | char * fname; | ||
74 | unsigned int flen; | ||
75 | char * tname; | ||
76 | unsigned int tlen; | ||
77 | struct iattr attrs; | ||
78 | }; | ||
79 | |||
80 | struct nfsd_readdirargs { | ||
81 | struct svc_fh fh; | ||
82 | __u32 cookie; | ||
83 | __u32 count; | ||
84 | __be32 * buffer; | ||
85 | }; | ||
86 | |||
87 | struct nfsd_attrstat { | ||
88 | struct svc_fh fh; | ||
89 | struct kstat stat; | ||
90 | }; | ||
91 | |||
92 | struct nfsd_diropres { | ||
93 | struct svc_fh fh; | ||
94 | struct kstat stat; | ||
95 | }; | ||
96 | |||
97 | struct nfsd_readlinkres { | ||
98 | int len; | ||
99 | }; | ||
100 | |||
101 | struct nfsd_readres { | ||
102 | struct svc_fh fh; | ||
103 | unsigned long count; | ||
104 | struct kstat stat; | ||
105 | }; | ||
106 | |||
107 | struct nfsd_readdirres { | ||
108 | int count; | ||
109 | |||
110 | struct readdir_cd common; | ||
111 | __be32 * buffer; | ||
112 | int buflen; | ||
113 | __be32 * offset; | ||
114 | }; | ||
115 | |||
116 | struct nfsd_statfsres { | ||
117 | struct kstatfs stats; | ||
118 | }; | ||
119 | |||
120 | /* | ||
121 | * Storage requirements for XDR arguments and results. | ||
122 | */ | ||
123 | union nfsd_xdrstore { | ||
124 | struct nfsd_sattrargs sattr; | ||
125 | struct nfsd_diropargs dirop; | ||
126 | struct nfsd_readargs read; | ||
127 | struct nfsd_writeargs write; | ||
128 | struct nfsd_createargs create; | ||
129 | struct nfsd_renameargs rename; | ||
130 | struct nfsd_linkargs link; | ||
131 | struct nfsd_symlinkargs symlink; | ||
132 | struct nfsd_readdirargs readdir; | ||
133 | }; | ||
134 | |||
135 | #define NFS2_SVC_XDRSIZE sizeof(union nfsd_xdrstore) | ||
136 | |||
137 | |||
138 | int nfssvc_decode_void(struct svc_rqst *, __be32 *, void *); | ||
139 | int nfssvc_decode_fhandle(struct svc_rqst *, __be32 *, struct nfsd_fhandle *); | ||
140 | int nfssvc_decode_sattrargs(struct svc_rqst *, __be32 *, | ||
141 | struct nfsd_sattrargs *); | ||
142 | int nfssvc_decode_diropargs(struct svc_rqst *, __be32 *, | ||
143 | struct nfsd_diropargs *); | ||
144 | int nfssvc_decode_readargs(struct svc_rqst *, __be32 *, | ||
145 | struct nfsd_readargs *); | ||
146 | int nfssvc_decode_writeargs(struct svc_rqst *, __be32 *, | ||
147 | struct nfsd_writeargs *); | ||
148 | int nfssvc_decode_createargs(struct svc_rqst *, __be32 *, | ||
149 | struct nfsd_createargs *); | ||
150 | int nfssvc_decode_renameargs(struct svc_rqst *, __be32 *, | ||
151 | struct nfsd_renameargs *); | ||
152 | int nfssvc_decode_readlinkargs(struct svc_rqst *, __be32 *, | ||
153 | struct nfsd_readlinkargs *); | ||
154 | int nfssvc_decode_linkargs(struct svc_rqst *, __be32 *, | ||
155 | struct nfsd_linkargs *); | ||
156 | int nfssvc_decode_symlinkargs(struct svc_rqst *, __be32 *, | ||
157 | struct nfsd_symlinkargs *); | ||
158 | int nfssvc_decode_readdirargs(struct svc_rqst *, __be32 *, | ||
159 | struct nfsd_readdirargs *); | ||
160 | int nfssvc_encode_void(struct svc_rqst *, __be32 *, void *); | ||
161 | int nfssvc_encode_attrstat(struct svc_rqst *, __be32 *, struct nfsd_attrstat *); | ||
162 | int nfssvc_encode_diropres(struct svc_rqst *, __be32 *, struct nfsd_diropres *); | ||
163 | int nfssvc_encode_readlinkres(struct svc_rqst *, __be32 *, struct nfsd_readlinkres *); | ||
164 | int nfssvc_encode_readres(struct svc_rqst *, __be32 *, struct nfsd_readres *); | ||
165 | int nfssvc_encode_statfsres(struct svc_rqst *, __be32 *, struct nfsd_statfsres *); | ||
166 | int nfssvc_encode_readdirres(struct svc_rqst *, __be32 *, struct nfsd_readdirres *); | ||
167 | |||
168 | int nfssvc_encode_entry(void *, const char *name, | ||
169 | int namlen, loff_t offset, u64 ino, unsigned int); | ||
170 | |||
171 | int nfssvc_release_fhandle(struct svc_rqst *, __be32 *, struct nfsd_fhandle *); | ||
172 | |||
173 | /* Helper functions for NFSv2 ACL code */ | ||
174 | __be32 *nfs2svc_encode_fattr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp); | ||
175 | __be32 *nfs2svc_decode_fh(__be32 *p, struct svc_fh *fhp); | ||
176 | |||
177 | #endif /* LINUX_NFSD_H */ | ||
diff --git a/include/linux/nfsd/xdr3.h b/include/linux/nfsd/xdr3.h deleted file mode 100644 index 421eddd65a25..000000000000 --- a/include/linux/nfsd/xdr3.h +++ /dev/null | |||
@@ -1,346 +0,0 @@ | |||
1 | /* | ||
2 | * linux/include/linux/nfsd/xdr3.h | ||
3 | * | ||
4 | * XDR types for NFSv3 in nfsd. | ||
5 | * | ||
6 | * Copyright (C) 1996-1998, Olaf Kirch <okir@monad.swb.de> | ||
7 | */ | ||
8 | |||
9 | #ifndef _LINUX_NFSD_XDR3_H | ||
10 | #define _LINUX_NFSD_XDR3_H | ||
11 | |||
12 | #include <linux/nfsd/xdr.h> | ||
13 | |||
14 | struct nfsd3_sattrargs { | ||
15 | struct svc_fh fh; | ||
16 | struct iattr attrs; | ||
17 | int check_guard; | ||
18 | time_t guardtime; | ||
19 | }; | ||
20 | |||
21 | struct nfsd3_diropargs { | ||
22 | struct svc_fh fh; | ||
23 | char * name; | ||
24 | unsigned int len; | ||
25 | }; | ||
26 | |||
27 | struct nfsd3_accessargs { | ||
28 | struct svc_fh fh; | ||
29 | unsigned int access; | ||
30 | }; | ||
31 | |||
32 | struct nfsd3_readargs { | ||
33 | struct svc_fh fh; | ||
34 | __u64 offset; | ||
35 | __u32 count; | ||
36 | int vlen; | ||
37 | }; | ||
38 | |||
39 | struct nfsd3_writeargs { | ||
40 | svc_fh fh; | ||
41 | __u64 offset; | ||
42 | __u32 count; | ||
43 | int stable; | ||
44 | __u32 len; | ||
45 | int vlen; | ||
46 | }; | ||
47 | |||
48 | struct nfsd3_createargs { | ||
49 | struct svc_fh fh; | ||
50 | char * name; | ||
51 | unsigned int len; | ||
52 | int createmode; | ||
53 | struct iattr attrs; | ||
54 | __be32 * verf; | ||
55 | }; | ||
56 | |||
57 | struct nfsd3_mknodargs { | ||
58 | struct svc_fh fh; | ||
59 | char * name; | ||
60 | unsigned int len; | ||
61 | __u32 ftype; | ||
62 | __u32 major, minor; | ||
63 | struct iattr attrs; | ||
64 | }; | ||
65 | |||
66 | struct nfsd3_renameargs { | ||
67 | struct svc_fh ffh; | ||
68 | char * fname; | ||
69 | unsigned int flen; | ||
70 | struct svc_fh tfh; | ||
71 | char * tname; | ||
72 | unsigned int tlen; | ||
73 | }; | ||
74 | |||
75 | struct nfsd3_readlinkargs { | ||
76 | struct svc_fh fh; | ||
77 | char * buffer; | ||
78 | }; | ||
79 | |||
80 | struct nfsd3_linkargs { | ||
81 | struct svc_fh ffh; | ||
82 | struct svc_fh tfh; | ||
83 | char * tname; | ||
84 | unsigned int tlen; | ||
85 | }; | ||
86 | |||
87 | struct nfsd3_symlinkargs { | ||
88 | struct svc_fh ffh; | ||
89 | char * fname; | ||
90 | unsigned int flen; | ||
91 | char * tname; | ||
92 | unsigned int tlen; | ||
93 | struct iattr attrs; | ||
94 | }; | ||
95 | |||
96 | struct nfsd3_readdirargs { | ||
97 | struct svc_fh fh; | ||
98 | __u64 cookie; | ||
99 | __u32 dircount; | ||
100 | __u32 count; | ||
101 | __be32 * verf; | ||
102 | __be32 * buffer; | ||
103 | }; | ||
104 | |||
105 | struct nfsd3_commitargs { | ||
106 | struct svc_fh fh; | ||
107 | __u64 offset; | ||
108 | __u32 count; | ||
109 | }; | ||
110 | |||
111 | struct nfsd3_getaclargs { | ||
112 | struct svc_fh fh; | ||
113 | int mask; | ||
114 | }; | ||
115 | |||
116 | struct posix_acl; | ||
117 | struct nfsd3_setaclargs { | ||
118 | struct svc_fh fh; | ||
119 | int mask; | ||
120 | struct posix_acl *acl_access; | ||
121 | struct posix_acl *acl_default; | ||
122 | }; | ||
123 | |||
124 | struct nfsd3_attrstat { | ||
125 | __be32 status; | ||
126 | struct svc_fh fh; | ||
127 | struct kstat stat; | ||
128 | }; | ||
129 | |||
130 | /* LOOKUP, CREATE, MKDIR, SYMLINK, MKNOD */ | ||
131 | struct nfsd3_diropres { | ||
132 | __be32 status; | ||
133 | struct svc_fh dirfh; | ||
134 | struct svc_fh fh; | ||
135 | }; | ||
136 | |||
137 | struct nfsd3_accessres { | ||
138 | __be32 status; | ||
139 | struct svc_fh fh; | ||
140 | __u32 access; | ||
141 | }; | ||
142 | |||
143 | struct nfsd3_readlinkres { | ||
144 | __be32 status; | ||
145 | struct svc_fh fh; | ||
146 | __u32 len; | ||
147 | }; | ||
148 | |||
149 | struct nfsd3_readres { | ||
150 | __be32 status; | ||
151 | struct svc_fh fh; | ||
152 | unsigned long count; | ||
153 | int eof; | ||
154 | }; | ||
155 | |||
156 | struct nfsd3_writeres { | ||
157 | __be32 status; | ||
158 | struct svc_fh fh; | ||
159 | unsigned long count; | ||
160 | int committed; | ||
161 | }; | ||
162 | |||
163 | struct nfsd3_renameres { | ||
164 | __be32 status; | ||
165 | struct svc_fh ffh; | ||
166 | struct svc_fh tfh; | ||
167 | }; | ||
168 | |||
169 | struct nfsd3_linkres { | ||
170 | __be32 status; | ||
171 | struct svc_fh tfh; | ||
172 | struct svc_fh fh; | ||
173 | }; | ||
174 | |||
175 | struct nfsd3_readdirres { | ||
176 | __be32 status; | ||
177 | struct svc_fh fh; | ||
178 | int count; | ||
179 | __be32 verf[2]; | ||
180 | |||
181 | struct readdir_cd common; | ||
182 | __be32 * buffer; | ||
183 | int buflen; | ||
184 | __be32 * offset; | ||
185 | __be32 * offset1; | ||
186 | struct svc_rqst * rqstp; | ||
187 | |||
188 | }; | ||
189 | |||
190 | struct nfsd3_fsstatres { | ||
191 | __be32 status; | ||
192 | struct kstatfs stats; | ||
193 | __u32 invarsec; | ||
194 | }; | ||
195 | |||
196 | struct nfsd3_fsinfores { | ||
197 | __be32 status; | ||
198 | __u32 f_rtmax; | ||
199 | __u32 f_rtpref; | ||
200 | __u32 f_rtmult; | ||
201 | __u32 f_wtmax; | ||
202 | __u32 f_wtpref; | ||
203 | __u32 f_wtmult; | ||
204 | __u32 f_dtpref; | ||
205 | __u64 f_maxfilesize; | ||
206 | __u32 f_properties; | ||
207 | }; | ||
208 | |||
209 | struct nfsd3_pathconfres { | ||
210 | __be32 status; | ||
211 | __u32 p_link_max; | ||
212 | __u32 p_name_max; | ||
213 | __u32 p_no_trunc; | ||
214 | __u32 p_chown_restricted; | ||
215 | __u32 p_case_insensitive; | ||
216 | __u32 p_case_preserving; | ||
217 | }; | ||
218 | |||
219 | struct nfsd3_commitres { | ||
220 | __be32 status; | ||
221 | struct svc_fh fh; | ||
222 | }; | ||
223 | |||
224 | struct nfsd3_getaclres { | ||
225 | __be32 status; | ||
226 | struct svc_fh fh; | ||
227 | int mask; | ||
228 | struct posix_acl *acl_access; | ||
229 | struct posix_acl *acl_default; | ||
230 | }; | ||
231 | |||
232 | /* dummy type for release */ | ||
233 | struct nfsd3_fhandle_pair { | ||
234 | __u32 dummy; | ||
235 | struct svc_fh fh1; | ||
236 | struct svc_fh fh2; | ||
237 | }; | ||
238 | |||
239 | /* | ||
240 | * Storage requirements for XDR arguments and results. | ||
241 | */ | ||
242 | union nfsd3_xdrstore { | ||
243 | struct nfsd3_sattrargs sattrargs; | ||
244 | struct nfsd3_diropargs diropargs; | ||
245 | struct nfsd3_readargs readargs; | ||
246 | struct nfsd3_writeargs writeargs; | ||
247 | struct nfsd3_createargs createargs; | ||
248 | struct nfsd3_renameargs renameargs; | ||
249 | struct nfsd3_linkargs linkargs; | ||
250 | struct nfsd3_symlinkargs symlinkargs; | ||
251 | struct nfsd3_readdirargs readdirargs; | ||
252 | struct nfsd3_diropres diropres; | ||
253 | struct nfsd3_accessres accessres; | ||
254 | struct nfsd3_readlinkres readlinkres; | ||
255 | struct nfsd3_readres readres; | ||
256 | struct nfsd3_writeres writeres; | ||
257 | struct nfsd3_renameres renameres; | ||
258 | struct nfsd3_linkres linkres; | ||
259 | struct nfsd3_readdirres readdirres; | ||
260 | struct nfsd3_fsstatres fsstatres; | ||
261 | struct nfsd3_fsinfores fsinfores; | ||
262 | struct nfsd3_pathconfres pathconfres; | ||
263 | struct nfsd3_commitres commitres; | ||
264 | struct nfsd3_getaclres getaclres; | ||
265 | }; | ||
266 | |||
267 | #define NFS3_SVC_XDRSIZE sizeof(union nfsd3_xdrstore) | ||
268 | |||
269 | int nfs3svc_decode_fhandle(struct svc_rqst *, __be32 *, struct nfsd_fhandle *); | ||
270 | int nfs3svc_decode_sattrargs(struct svc_rqst *, __be32 *, | ||
271 | struct nfsd3_sattrargs *); | ||
272 | int nfs3svc_decode_diropargs(struct svc_rqst *, __be32 *, | ||
273 | struct nfsd3_diropargs *); | ||
274 | int nfs3svc_decode_accessargs(struct svc_rqst *, __be32 *, | ||
275 | struct nfsd3_accessargs *); | ||
276 | int nfs3svc_decode_readargs(struct svc_rqst *, __be32 *, | ||
277 | struct nfsd3_readargs *); | ||
278 | int nfs3svc_decode_writeargs(struct svc_rqst *, __be32 *, | ||
279 | struct nfsd3_writeargs *); | ||
280 | int nfs3svc_decode_createargs(struct svc_rqst *, __be32 *, | ||
281 | struct nfsd3_createargs *); | ||
282 | int nfs3svc_decode_mkdirargs(struct svc_rqst *, __be32 *, | ||
283 | struct nfsd3_createargs *); | ||
284 | int nfs3svc_decode_mknodargs(struct svc_rqst *, __be32 *, | ||
285 | struct nfsd3_mknodargs *); | ||
286 | int nfs3svc_decode_renameargs(struct svc_rqst *, __be32 *, | ||
287 | struct nfsd3_renameargs *); | ||
288 | int nfs3svc_decode_readlinkargs(struct svc_rqst *, __be32 *, | ||
289 | struct nfsd3_readlinkargs *); | ||
290 | int nfs3svc_decode_linkargs(struct svc_rqst *, __be32 *, | ||
291 | struct nfsd3_linkargs *); | ||
292 | int nfs3svc_decode_symlinkargs(struct svc_rqst *, __be32 *, | ||
293 | struct nfsd3_symlinkargs *); | ||
294 | int nfs3svc_decode_readdirargs(struct svc_rqst *, __be32 *, | ||
295 | struct nfsd3_readdirargs *); | ||
296 | int nfs3svc_decode_readdirplusargs(struct svc_rqst *, __be32 *, | ||
297 | struct nfsd3_readdirargs *); | ||
298 | int nfs3svc_decode_commitargs(struct svc_rqst *, __be32 *, | ||
299 | struct nfsd3_commitargs *); | ||
300 | int nfs3svc_encode_voidres(struct svc_rqst *, __be32 *, void *); | ||
301 | int nfs3svc_encode_attrstat(struct svc_rqst *, __be32 *, | ||
302 | struct nfsd3_attrstat *); | ||
303 | int nfs3svc_encode_wccstat(struct svc_rqst *, __be32 *, | ||
304 | struct nfsd3_attrstat *); | ||
305 | int nfs3svc_encode_diropres(struct svc_rqst *, __be32 *, | ||
306 | struct nfsd3_diropres *); | ||
307 | int nfs3svc_encode_accessres(struct svc_rqst *, __be32 *, | ||
308 | struct nfsd3_accessres *); | ||
309 | int nfs3svc_encode_readlinkres(struct svc_rqst *, __be32 *, | ||
310 | struct nfsd3_readlinkres *); | ||
311 | int nfs3svc_encode_readres(struct svc_rqst *, __be32 *, struct nfsd3_readres *); | ||
312 | int nfs3svc_encode_writeres(struct svc_rqst *, __be32 *, struct nfsd3_writeres *); | ||
313 | int nfs3svc_encode_createres(struct svc_rqst *, __be32 *, | ||
314 | struct nfsd3_diropres *); | ||
315 | int nfs3svc_encode_renameres(struct svc_rqst *, __be32 *, | ||
316 | struct nfsd3_renameres *); | ||
317 | int nfs3svc_encode_linkres(struct svc_rqst *, __be32 *, | ||
318 | struct nfsd3_linkres *); | ||
319 | int nfs3svc_encode_readdirres(struct svc_rqst *, __be32 *, | ||
320 | struct nfsd3_readdirres *); | ||
321 | int nfs3svc_encode_fsstatres(struct svc_rqst *, __be32 *, | ||
322 | struct nfsd3_fsstatres *); | ||
323 | int nfs3svc_encode_fsinfores(struct svc_rqst *, __be32 *, | ||
324 | struct nfsd3_fsinfores *); | ||
325 | int nfs3svc_encode_pathconfres(struct svc_rqst *, __be32 *, | ||
326 | struct nfsd3_pathconfres *); | ||
327 | int nfs3svc_encode_commitres(struct svc_rqst *, __be32 *, | ||
328 | struct nfsd3_commitres *); | ||
329 | |||
330 | int nfs3svc_release_fhandle(struct svc_rqst *, __be32 *, | ||
331 | struct nfsd3_attrstat *); | ||
332 | int nfs3svc_release_fhandle2(struct svc_rqst *, __be32 *, | ||
333 | struct nfsd3_fhandle_pair *); | ||
334 | int nfs3svc_encode_entry(void *, const char *name, | ||
335 | int namlen, loff_t offset, u64 ino, | ||
336 | unsigned int); | ||
337 | int nfs3svc_encode_entry_plus(void *, const char *name, | ||
338 | int namlen, loff_t offset, u64 ino, | ||
339 | unsigned int); | ||
340 | /* Helper functions for NFSv3 ACL code */ | ||
341 | __be32 *nfs3svc_encode_post_op_attr(struct svc_rqst *rqstp, __be32 *p, | ||
342 | struct svc_fh *fhp); | ||
343 | __be32 *nfs3svc_decode_fh(__be32 *p, struct svc_fh *fhp); | ||
344 | |||
345 | |||
346 | #endif /* _LINUX_NFSD_XDR3_H */ | ||
diff --git a/include/linux/nfsd/xdr4.h b/include/linux/nfsd/xdr4.h deleted file mode 100644 index 73164c2b3d29..000000000000 --- a/include/linux/nfsd/xdr4.h +++ /dev/null | |||
@@ -1,563 +0,0 @@ | |||
1 | /* | ||
2 | * include/linux/nfsd/xdr4.h | ||
3 | * | ||
4 | * Server-side types for NFSv4. | ||
5 | * | ||
6 | * Copyright (c) 2002 The Regents of the University of Michigan. | ||
7 | * All rights reserved. | ||
8 | * | ||
9 | * Kendrick Smith <kmsmith@umich.edu> | ||
10 | * Andy Adamson <andros@umich.edu> | ||
11 | * | ||
12 | * Redistribution and use in source and binary forms, with or without | ||
13 | * modification, are permitted provided that the following conditions | ||
14 | * are met: | ||
15 | * | ||
16 | * 1. Redistributions of source code must retain the above copyright | ||
17 | * notice, this list of conditions and the following disclaimer. | ||
18 | * 2. Redistributions in binary form must reproduce the above copyright | ||
19 | * notice, this list of conditions and the following disclaimer in the | ||
20 | * documentation and/or other materials provided with the distribution. | ||
21 | * 3. Neither the name of the University nor the names of its | ||
22 | * contributors may be used to endorse or promote products derived | ||
23 | * from this software without specific prior written permission. | ||
24 | * | ||
25 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
26 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
27 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
28 | * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | ||
29 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
30 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
31 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR | ||
32 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
33 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
34 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
35 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
36 | * | ||
37 | */ | ||
38 | |||
39 | #ifndef _LINUX_NFSD_XDR4_H | ||
40 | #define _LINUX_NFSD_XDR4_H | ||
41 | |||
42 | #include <linux/nfs4.h> | ||
43 | |||
44 | #define NFSD4_MAX_TAGLEN 128 | ||
45 | #define XDR_LEN(n) (((n) + 3) & ~3) | ||
46 | |||
47 | struct nfsd4_compound_state { | ||
48 | struct svc_fh current_fh; | ||
49 | struct svc_fh save_fh; | ||
50 | struct nfs4_stateowner *replay_owner; | ||
51 | /* For sessions DRC */ | ||
52 | struct nfsd4_session *session; | ||
53 | struct nfsd4_slot *slot; | ||
54 | __be32 *datap; | ||
55 | size_t iovlen; | ||
56 | u32 minorversion; | ||
57 | u32 status; | ||
58 | }; | ||
59 | |||
60 | static inline bool nfsd4_has_session(struct nfsd4_compound_state *cs) | ||
61 | { | ||
62 | return cs->slot != NULL; | ||
63 | } | ||
64 | |||
65 | struct nfsd4_change_info { | ||
66 | u32 atomic; | ||
67 | bool change_supported; | ||
68 | u32 before_ctime_sec; | ||
69 | u32 before_ctime_nsec; | ||
70 | u64 before_change; | ||
71 | u32 after_ctime_sec; | ||
72 | u32 after_ctime_nsec; | ||
73 | u64 after_change; | ||
74 | }; | ||
75 | |||
76 | struct nfsd4_access { | ||
77 | u32 ac_req_access; /* request */ | ||
78 | u32 ac_supported; /* response */ | ||
79 | u32 ac_resp_access; /* response */ | ||
80 | }; | ||
81 | |||
82 | struct nfsd4_close { | ||
83 | u32 cl_seqid; /* request */ | ||
84 | stateid_t cl_stateid; /* request+response */ | ||
85 | struct nfs4_stateowner * cl_stateowner; /* response */ | ||
86 | }; | ||
87 | |||
88 | struct nfsd4_commit { | ||
89 | u64 co_offset; /* request */ | ||
90 | u32 co_count; /* request */ | ||
91 | nfs4_verifier co_verf; /* response */ | ||
92 | }; | ||
93 | |||
94 | struct nfsd4_create { | ||
95 | u32 cr_namelen; /* request */ | ||
96 | char * cr_name; /* request */ | ||
97 | u32 cr_type; /* request */ | ||
98 | union { /* request */ | ||
99 | struct { | ||
100 | u32 namelen; | ||
101 | char *name; | ||
102 | } link; /* NF4LNK */ | ||
103 | struct { | ||
104 | u32 specdata1; | ||
105 | u32 specdata2; | ||
106 | } dev; /* NF4BLK, NF4CHR */ | ||
107 | } u; | ||
108 | u32 cr_bmval[3]; /* request */ | ||
109 | struct iattr cr_iattr; /* request */ | ||
110 | struct nfsd4_change_info cr_cinfo; /* response */ | ||
111 | struct nfs4_acl *cr_acl; | ||
112 | }; | ||
113 | #define cr_linklen u.link.namelen | ||
114 | #define cr_linkname u.link.name | ||
115 | #define cr_specdata1 u.dev.specdata1 | ||
116 | #define cr_specdata2 u.dev.specdata2 | ||
117 | |||
118 | struct nfsd4_delegreturn { | ||
119 | stateid_t dr_stateid; | ||
120 | }; | ||
121 | |||
122 | struct nfsd4_getattr { | ||
123 | u32 ga_bmval[3]; /* request */ | ||
124 | struct svc_fh *ga_fhp; /* response */ | ||
125 | }; | ||
126 | |||
127 | struct nfsd4_link { | ||
128 | u32 li_namelen; /* request */ | ||
129 | char * li_name; /* request */ | ||
130 | struct nfsd4_change_info li_cinfo; /* response */ | ||
131 | }; | ||
132 | |||
133 | struct nfsd4_lock_denied { | ||
134 | clientid_t ld_clientid; | ||
135 | struct nfs4_stateowner *ld_sop; | ||
136 | u64 ld_start; | ||
137 | u64 ld_length; | ||
138 | u32 ld_type; | ||
139 | }; | ||
140 | |||
141 | struct nfsd4_lock { | ||
142 | /* request */ | ||
143 | u32 lk_type; | ||
144 | u32 lk_reclaim; /* boolean */ | ||
145 | u64 lk_offset; | ||
146 | u64 lk_length; | ||
147 | u32 lk_is_new; | ||
148 | union { | ||
149 | struct { | ||
150 | u32 open_seqid; | ||
151 | stateid_t open_stateid; | ||
152 | u32 lock_seqid; | ||
153 | clientid_t clientid; | ||
154 | struct xdr_netobj owner; | ||
155 | } new; | ||
156 | struct { | ||
157 | stateid_t lock_stateid; | ||
158 | u32 lock_seqid; | ||
159 | } old; | ||
160 | } v; | ||
161 | |||
162 | /* response */ | ||
163 | union { | ||
164 | struct { | ||
165 | stateid_t stateid; | ||
166 | } ok; | ||
167 | struct nfsd4_lock_denied denied; | ||
168 | } u; | ||
169 | /* The lk_replay_owner is the open owner in the open_to_lock_owner | ||
170 | * case and the lock owner otherwise: */ | ||
171 | struct nfs4_stateowner *lk_replay_owner; | ||
172 | }; | ||
173 | #define lk_new_open_seqid v.new.open_seqid | ||
174 | #define lk_new_open_stateid v.new.open_stateid | ||
175 | #define lk_new_lock_seqid v.new.lock_seqid | ||
176 | #define lk_new_clientid v.new.clientid | ||
177 | #define lk_new_owner v.new.owner | ||
178 | #define lk_old_lock_stateid v.old.lock_stateid | ||
179 | #define lk_old_lock_seqid v.old.lock_seqid | ||
180 | |||
181 | #define lk_rflags u.ok.rflags | ||
182 | #define lk_resp_stateid u.ok.stateid | ||
183 | #define lk_denied u.denied | ||
184 | |||
185 | |||
186 | struct nfsd4_lockt { | ||
187 | u32 lt_type; | ||
188 | clientid_t lt_clientid; | ||
189 | struct xdr_netobj lt_owner; | ||
190 | u64 lt_offset; | ||
191 | u64 lt_length; | ||
192 | struct nfs4_stateowner * lt_stateowner; | ||
193 | struct nfsd4_lock_denied lt_denied; | ||
194 | }; | ||
195 | |||
196 | |||
197 | struct nfsd4_locku { | ||
198 | u32 lu_type; | ||
199 | u32 lu_seqid; | ||
200 | stateid_t lu_stateid; | ||
201 | u64 lu_offset; | ||
202 | u64 lu_length; | ||
203 | struct nfs4_stateowner *lu_stateowner; | ||
204 | }; | ||
205 | |||
206 | |||
207 | struct nfsd4_lookup { | ||
208 | u32 lo_len; /* request */ | ||
209 | char * lo_name; /* request */ | ||
210 | }; | ||
211 | |||
212 | struct nfsd4_putfh { | ||
213 | u32 pf_fhlen; /* request */ | ||
214 | char *pf_fhval; /* request */ | ||
215 | }; | ||
216 | |||
217 | struct nfsd4_open { | ||
218 | u32 op_claim_type; /* request */ | ||
219 | struct xdr_netobj op_fname; /* request - everything but CLAIM_PREV */ | ||
220 | u32 op_delegate_type; /* request - CLAIM_PREV only */ | ||
221 | stateid_t op_delegate_stateid; /* request - response */ | ||
222 | u32 op_create; /* request */ | ||
223 | u32 op_createmode; /* request */ | ||
224 | u32 op_bmval[3]; /* request */ | ||
225 | struct iattr iattr; /* UNCHECKED4, GUARDED4, EXCLUSIVE4_1 */ | ||
226 | nfs4_verifier verf; /* EXCLUSIVE4 */ | ||
227 | clientid_t op_clientid; /* request */ | ||
228 | struct xdr_netobj op_owner; /* request */ | ||
229 | u32 op_seqid; /* request */ | ||
230 | u32 op_share_access; /* request */ | ||
231 | u32 op_share_deny; /* request */ | ||
232 | stateid_t op_stateid; /* response */ | ||
233 | u32 op_recall; /* recall */ | ||
234 | struct nfsd4_change_info op_cinfo; /* response */ | ||
235 | u32 op_rflags; /* response */ | ||
236 | int op_truncate; /* used during processing */ | ||
237 | struct nfs4_stateowner *op_stateowner; /* used during processing */ | ||
238 | struct nfs4_acl *op_acl; | ||
239 | }; | ||
240 | #define op_iattr iattr | ||
241 | #define op_verf verf | ||
242 | |||
243 | struct nfsd4_open_confirm { | ||
244 | stateid_t oc_req_stateid /* request */; | ||
245 | u32 oc_seqid /* request */; | ||
246 | stateid_t oc_resp_stateid /* response */; | ||
247 | struct nfs4_stateowner * oc_stateowner; /* response */ | ||
248 | }; | ||
249 | |||
250 | struct nfsd4_open_downgrade { | ||
251 | stateid_t od_stateid; | ||
252 | u32 od_seqid; | ||
253 | u32 od_share_access; | ||
254 | u32 od_share_deny; | ||
255 | struct nfs4_stateowner *od_stateowner; | ||
256 | }; | ||
257 | |||
258 | |||
259 | struct nfsd4_read { | ||
260 | stateid_t rd_stateid; /* request */ | ||
261 | u64 rd_offset; /* request */ | ||
262 | u32 rd_length; /* request */ | ||
263 | int rd_vlen; | ||
264 | struct file *rd_filp; | ||
265 | |||
266 | struct svc_rqst *rd_rqstp; /* response */ | ||
267 | struct svc_fh * rd_fhp; /* response */ | ||
268 | }; | ||
269 | |||
270 | struct nfsd4_readdir { | ||
271 | u64 rd_cookie; /* request */ | ||
272 | nfs4_verifier rd_verf; /* request */ | ||
273 | u32 rd_dircount; /* request */ | ||
274 | u32 rd_maxcount; /* request */ | ||
275 | u32 rd_bmval[3]; /* request */ | ||
276 | struct svc_rqst *rd_rqstp; /* response */ | ||
277 | struct svc_fh * rd_fhp; /* response */ | ||
278 | |||
279 | struct readdir_cd common; | ||
280 | __be32 * buffer; | ||
281 | int buflen; | ||
282 | __be32 * offset; | ||
283 | }; | ||
284 | |||
285 | struct nfsd4_release_lockowner { | ||
286 | clientid_t rl_clientid; | ||
287 | struct xdr_netobj rl_owner; | ||
288 | }; | ||
289 | struct nfsd4_readlink { | ||
290 | struct svc_rqst *rl_rqstp; /* request */ | ||
291 | struct svc_fh * rl_fhp; /* request */ | ||
292 | }; | ||
293 | |||
294 | struct nfsd4_remove { | ||
295 | u32 rm_namelen; /* request */ | ||
296 | char * rm_name; /* request */ | ||
297 | struct nfsd4_change_info rm_cinfo; /* response */ | ||
298 | }; | ||
299 | |||
300 | struct nfsd4_rename { | ||
301 | u32 rn_snamelen; /* request */ | ||
302 | char * rn_sname; /* request */ | ||
303 | u32 rn_tnamelen; /* request */ | ||
304 | char * rn_tname; /* request */ | ||
305 | struct nfsd4_change_info rn_sinfo; /* response */ | ||
306 | struct nfsd4_change_info rn_tinfo; /* response */ | ||
307 | }; | ||
308 | |||
309 | struct nfsd4_secinfo { | ||
310 | u32 si_namelen; /* request */ | ||
311 | char *si_name; /* request */ | ||
312 | struct svc_export *si_exp; /* response */ | ||
313 | }; | ||
314 | |||
315 | struct nfsd4_setattr { | ||
316 | stateid_t sa_stateid; /* request */ | ||
317 | u32 sa_bmval[3]; /* request */ | ||
318 | struct iattr sa_iattr; /* request */ | ||
319 | struct nfs4_acl *sa_acl; | ||
320 | }; | ||
321 | |||
322 | struct nfsd4_setclientid { | ||
323 | nfs4_verifier se_verf; /* request */ | ||
324 | u32 se_namelen; /* request */ | ||
325 | char * se_name; /* request */ | ||
326 | u32 se_callback_prog; /* request */ | ||
327 | u32 se_callback_netid_len; /* request */ | ||
328 | char * se_callback_netid_val; /* request */ | ||
329 | u32 se_callback_addr_len; /* request */ | ||
330 | char * se_callback_addr_val; /* request */ | ||
331 | u32 se_callback_ident; /* request */ | ||
332 | clientid_t se_clientid; /* response */ | ||
333 | nfs4_verifier se_confirm; /* response */ | ||
334 | }; | ||
335 | |||
336 | struct nfsd4_setclientid_confirm { | ||
337 | clientid_t sc_clientid; | ||
338 | nfs4_verifier sc_confirm; | ||
339 | }; | ||
340 | |||
341 | /* also used for NVERIFY */ | ||
342 | struct nfsd4_verify { | ||
343 | u32 ve_bmval[3]; /* request */ | ||
344 | u32 ve_attrlen; /* request */ | ||
345 | char * ve_attrval; /* request */ | ||
346 | }; | ||
347 | |||
348 | struct nfsd4_write { | ||
349 | stateid_t wr_stateid; /* request */ | ||
350 | u64 wr_offset; /* request */ | ||
351 | u32 wr_stable_how; /* request */ | ||
352 | u32 wr_buflen; /* request */ | ||
353 | int wr_vlen; | ||
354 | |||
355 | u32 wr_bytes_written; /* response */ | ||
356 | u32 wr_how_written; /* response */ | ||
357 | nfs4_verifier wr_verifier; /* response */ | ||
358 | }; | ||
359 | |||
360 | struct nfsd4_exchange_id { | ||
361 | nfs4_verifier verifier; | ||
362 | struct xdr_netobj clname; | ||
363 | u32 flags; | ||
364 | clientid_t clientid; | ||
365 | u32 seqid; | ||
366 | int spa_how; | ||
367 | }; | ||
368 | |||
369 | struct nfsd4_sequence { | ||
370 | struct nfs4_sessionid sessionid; /* request/response */ | ||
371 | u32 seqid; /* request/response */ | ||
372 | u32 slotid; /* request/response */ | ||
373 | u32 maxslots; /* request/response */ | ||
374 | u32 cachethis; /* request */ | ||
375 | #if 0 | ||
376 | u32 target_maxslots; /* response */ | ||
377 | u32 status_flags; /* response */ | ||
378 | #endif /* not yet */ | ||
379 | }; | ||
380 | |||
381 | struct nfsd4_destroy_session { | ||
382 | struct nfs4_sessionid sessionid; | ||
383 | }; | ||
384 | |||
385 | struct nfsd4_op { | ||
386 | int opnum; | ||
387 | __be32 status; | ||
388 | union { | ||
389 | struct nfsd4_access access; | ||
390 | struct nfsd4_close close; | ||
391 | struct nfsd4_commit commit; | ||
392 | struct nfsd4_create create; | ||
393 | struct nfsd4_delegreturn delegreturn; | ||
394 | struct nfsd4_getattr getattr; | ||
395 | struct svc_fh * getfh; | ||
396 | struct nfsd4_link link; | ||
397 | struct nfsd4_lock lock; | ||
398 | struct nfsd4_lockt lockt; | ||
399 | struct nfsd4_locku locku; | ||
400 | struct nfsd4_lookup lookup; | ||
401 | struct nfsd4_verify nverify; | ||
402 | struct nfsd4_open open; | ||
403 | struct nfsd4_open_confirm open_confirm; | ||
404 | struct nfsd4_open_downgrade open_downgrade; | ||
405 | struct nfsd4_putfh putfh; | ||
406 | struct nfsd4_read read; | ||
407 | struct nfsd4_readdir readdir; | ||
408 | struct nfsd4_readlink readlink; | ||
409 | struct nfsd4_remove remove; | ||
410 | struct nfsd4_rename rename; | ||
411 | clientid_t renew; | ||
412 | struct nfsd4_secinfo secinfo; | ||
413 | struct nfsd4_setattr setattr; | ||
414 | struct nfsd4_setclientid setclientid; | ||
415 | struct nfsd4_setclientid_confirm setclientid_confirm; | ||
416 | struct nfsd4_verify verify; | ||
417 | struct nfsd4_write write; | ||
418 | struct nfsd4_release_lockowner release_lockowner; | ||
419 | |||
420 | /* NFSv4.1 */ | ||
421 | struct nfsd4_exchange_id exchange_id; | ||
422 | struct nfsd4_create_session create_session; | ||
423 | struct nfsd4_destroy_session destroy_session; | ||
424 | struct nfsd4_sequence sequence; | ||
425 | } u; | ||
426 | struct nfs4_replay * replay; | ||
427 | }; | ||
428 | |||
429 | struct nfsd4_compoundargs { | ||
430 | /* scratch variables for XDR decode */ | ||
431 | __be32 * p; | ||
432 | __be32 * end; | ||
433 | struct page ** pagelist; | ||
434 | int pagelen; | ||
435 | __be32 tmp[8]; | ||
436 | __be32 * tmpp; | ||
437 | struct tmpbuf { | ||
438 | struct tmpbuf *next; | ||
439 | void (*release)(const void *); | ||
440 | void *buf; | ||
441 | } *to_free; | ||
442 | |||
443 | struct svc_rqst *rqstp; | ||
444 | |||
445 | u32 taglen; | ||
446 | char * tag; | ||
447 | u32 minorversion; | ||
448 | u32 opcnt; | ||
449 | struct nfsd4_op *ops; | ||
450 | struct nfsd4_op iops[8]; | ||
451 | }; | ||
452 | |||
453 | struct nfsd4_compoundres { | ||
454 | /* scratch variables for XDR encode */ | ||
455 | __be32 * p; | ||
456 | __be32 * end; | ||
457 | struct xdr_buf * xbuf; | ||
458 | struct svc_rqst * rqstp; | ||
459 | |||
460 | u32 taglen; | ||
461 | char * tag; | ||
462 | u32 opcnt; | ||
463 | __be32 * tagp; /* tag, opcount encode location */ | ||
464 | struct nfsd4_compound_state cstate; | ||
465 | }; | ||
466 | |||
467 | static inline bool nfsd4_is_solo_sequence(struct nfsd4_compoundres *resp) | ||
468 | { | ||
469 | struct nfsd4_compoundargs *args = resp->rqstp->rq_argp; | ||
470 | return resp->opcnt == 1 && args->ops[0].opnum == OP_SEQUENCE; | ||
471 | } | ||
472 | |||
473 | static inline bool nfsd4_not_cached(struct nfsd4_compoundres *resp) | ||
474 | { | ||
475 | return !resp->cstate.slot->sl_cachethis || nfsd4_is_solo_sequence(resp); | ||
476 | } | ||
477 | |||
478 | #define NFS4_SVC_XDRSIZE sizeof(struct nfsd4_compoundargs) | ||
479 | |||
480 | static inline void | ||
481 | set_change_info(struct nfsd4_change_info *cinfo, struct svc_fh *fhp) | ||
482 | { | ||
483 | BUG_ON(!fhp->fh_pre_saved || !fhp->fh_post_saved); | ||
484 | cinfo->atomic = 1; | ||
485 | cinfo->change_supported = IS_I_VERSION(fhp->fh_dentry->d_inode); | ||
486 | if (cinfo->change_supported) { | ||
487 | cinfo->before_change = fhp->fh_pre_change; | ||
488 | cinfo->after_change = fhp->fh_post_change; | ||
489 | } else { | ||
490 | cinfo->before_ctime_sec = fhp->fh_pre_ctime.tv_sec; | ||
491 | cinfo->before_ctime_nsec = fhp->fh_pre_ctime.tv_nsec; | ||
492 | cinfo->after_ctime_sec = fhp->fh_post_attr.ctime.tv_sec; | ||
493 | cinfo->after_ctime_nsec = fhp->fh_post_attr.ctime.tv_nsec; | ||
494 | } | ||
495 | } | ||
496 | |||
497 | int nfs4svc_encode_voidres(struct svc_rqst *, __be32 *, void *); | ||
498 | int nfs4svc_decode_compoundargs(struct svc_rqst *, __be32 *, | ||
499 | struct nfsd4_compoundargs *); | ||
500 | int nfs4svc_encode_compoundres(struct svc_rqst *, __be32 *, | ||
501 | struct nfsd4_compoundres *); | ||
502 | void nfsd4_encode_operation(struct nfsd4_compoundres *, struct nfsd4_op *); | ||
503 | void nfsd4_encode_replay(struct nfsd4_compoundres *resp, struct nfsd4_op *op); | ||
504 | __be32 nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp, | ||
505 | struct dentry *dentry, __be32 *buffer, int *countp, | ||
506 | u32 *bmval, struct svc_rqst *, int ignore_crossmnt); | ||
507 | extern __be32 nfsd4_setclientid(struct svc_rqst *rqstp, | ||
508 | struct nfsd4_compound_state *, | ||
509 | struct nfsd4_setclientid *setclid); | ||
510 | extern __be32 nfsd4_setclientid_confirm(struct svc_rqst *rqstp, | ||
511 | struct nfsd4_compound_state *, | ||
512 | struct nfsd4_setclientid_confirm *setclientid_confirm); | ||
513 | extern void nfsd4_store_cache_entry(struct nfsd4_compoundres *resp); | ||
514 | extern __be32 nfsd4_replay_cache_entry(struct nfsd4_compoundres *resp, | ||
515 | struct nfsd4_sequence *seq); | ||
516 | extern __be32 nfsd4_exchange_id(struct svc_rqst *rqstp, | ||
517 | struct nfsd4_compound_state *, | ||
518 | struct nfsd4_exchange_id *); | ||
519 | extern __be32 nfsd4_create_session(struct svc_rqst *, | ||
520 | struct nfsd4_compound_state *, | ||
521 | struct nfsd4_create_session *); | ||
522 | extern __be32 nfsd4_sequence(struct svc_rqst *, | ||
523 | struct nfsd4_compound_state *, | ||
524 | struct nfsd4_sequence *); | ||
525 | extern __be32 nfsd4_destroy_session(struct svc_rqst *, | ||
526 | struct nfsd4_compound_state *, | ||
527 | struct nfsd4_destroy_session *); | ||
528 | extern __be32 nfsd4_process_open1(struct nfsd4_compound_state *, | ||
529 | struct nfsd4_open *open); | ||
530 | extern __be32 nfsd4_process_open2(struct svc_rqst *rqstp, | ||
531 | struct svc_fh *current_fh, struct nfsd4_open *open); | ||
532 | extern __be32 nfsd4_open_confirm(struct svc_rqst *rqstp, | ||
533 | struct nfsd4_compound_state *, struct nfsd4_open_confirm *oc); | ||
534 | extern __be32 nfsd4_close(struct svc_rqst *rqstp, | ||
535 | struct nfsd4_compound_state *, | ||
536 | struct nfsd4_close *close); | ||
537 | extern __be32 nfsd4_open_downgrade(struct svc_rqst *rqstp, | ||
538 | struct nfsd4_compound_state *, | ||
539 | struct nfsd4_open_downgrade *od); | ||
540 | extern __be32 nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *, | ||
541 | struct nfsd4_lock *lock); | ||
542 | extern __be32 nfsd4_lockt(struct svc_rqst *rqstp, | ||
543 | struct nfsd4_compound_state *, | ||
544 | struct nfsd4_lockt *lockt); | ||
545 | extern __be32 nfsd4_locku(struct svc_rqst *rqstp, | ||
546 | struct nfsd4_compound_state *, | ||
547 | struct nfsd4_locku *locku); | ||
548 | extern __be32 | ||
549 | nfsd4_release_lockowner(struct svc_rqst *rqstp, | ||
550 | struct nfsd4_compound_state *, | ||
551 | struct nfsd4_release_lockowner *rlockowner); | ||
552 | extern void nfsd4_release_compoundargs(struct nfsd4_compoundargs *); | ||
553 | extern __be32 nfsd4_delegreturn(struct svc_rqst *rqstp, | ||
554 | struct nfsd4_compound_state *, struct nfsd4_delegreturn *dr); | ||
555 | extern __be32 nfsd4_renew(struct svc_rqst *rqstp, | ||
556 | struct nfsd4_compound_state *, clientid_t *clid); | ||
557 | #endif | ||
558 | |||
559 | /* | ||
560 | * Local variables: | ||
561 | * c-basic-offset: 8 | ||
562 | * End: | ||
563 | */ | ||
diff --git a/include/linux/oom.h b/include/linux/oom.h index 6aac5fe4f6f1..537662315627 100644 --- a/include/linux/oom.h +++ b/include/linux/oom.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #ifdef __KERNEL__ | 10 | #ifdef __KERNEL__ |
11 | 11 | ||
12 | #include <linux/types.h> | 12 | #include <linux/types.h> |
13 | #include <linux/nodemask.h> | ||
13 | 14 | ||
14 | struct zonelist; | 15 | struct zonelist; |
15 | struct notifier_block; | 16 | struct notifier_block; |
@@ -26,7 +27,8 @@ enum oom_constraint { | |||
26 | extern int try_set_zone_oom(struct zonelist *zonelist, gfp_t gfp_flags); | 27 | extern int try_set_zone_oom(struct zonelist *zonelist, gfp_t gfp_flags); |
27 | extern void clear_zonelist_oom(struct zonelist *zonelist, gfp_t gfp_flags); | 28 | extern void clear_zonelist_oom(struct zonelist *zonelist, gfp_t gfp_flags); |
28 | 29 | ||
29 | extern void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order); | 30 | extern void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, |
31 | int order, nodemask_t *mask); | ||
30 | extern int register_oom_notifier(struct notifier_block *nb); | 32 | extern int register_oom_notifier(struct notifier_block *nb); |
31 | extern int unregister_oom_notifier(struct notifier_block *nb); | 33 | extern int unregister_oom_notifier(struct notifier_block *nb); |
32 | 34 | ||
diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h index 4b938d4f3ac2..b0e4eb126236 100644 --- a/include/linux/page_cgroup.h +++ b/include/linux/page_cgroup.h | |||
@@ -57,6 +57,8 @@ static inline void ClearPageCgroup##uname(struct page_cgroup *pc) \ | |||
57 | static inline int TestClearPageCgroup##uname(struct page_cgroup *pc) \ | 57 | static inline int TestClearPageCgroup##uname(struct page_cgroup *pc) \ |
58 | { return test_and_clear_bit(PCG_##lname, &pc->flags); } | 58 | { return test_and_clear_bit(PCG_##lname, &pc->flags); } |
59 | 59 | ||
60 | TESTPCGFLAG(Locked, LOCK) | ||
61 | |||
60 | /* Cache flag is set only once (at allocation) */ | 62 | /* Cache flag is set only once (at allocation) */ |
61 | TESTPCGFLAG(Cache, CACHE) | 63 | TESTPCGFLAG(Cache, CACHE) |
62 | CLEARPCGFLAG(Cache, CACHE) | 64 | CLEARPCGFLAG(Cache, CACHE) |
@@ -86,11 +88,6 @@ static inline void lock_page_cgroup(struct page_cgroup *pc) | |||
86 | bit_spin_lock(PCG_LOCK, &pc->flags); | 88 | bit_spin_lock(PCG_LOCK, &pc->flags); |
87 | } | 89 | } |
88 | 90 | ||
89 | static inline int trylock_page_cgroup(struct page_cgroup *pc) | ||
90 | { | ||
91 | return bit_spin_trylock(PCG_LOCK, &pc->flags); | ||
92 | } | ||
93 | |||
94 | static inline void unlock_page_cgroup(struct page_cgroup *pc) | 91 | static inline void unlock_page_cgroup(struct page_cgroup *pc) |
95 | { | 92 | { |
96 | bit_spin_unlock(PCG_LOCK, &pc->flags); | 93 | bit_spin_unlock(PCG_LOCK, &pc->flags); |
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index 7456d7d87a19..56f2d63a5cbb 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h | |||
@@ -105,12 +105,7 @@ static inline int ptrace_reparented(struct task_struct *child) | |||
105 | { | 105 | { |
106 | return child->real_parent != child->parent; | 106 | return child->real_parent != child->parent; |
107 | } | 107 | } |
108 | static inline void ptrace_link(struct task_struct *child, | 108 | |
109 | struct task_struct *new_parent) | ||
110 | { | ||
111 | if (unlikely(child->ptrace)) | ||
112 | __ptrace_link(child, new_parent); | ||
113 | } | ||
114 | static inline void ptrace_unlink(struct task_struct *child) | 109 | static inline void ptrace_unlink(struct task_struct *child) |
115 | { | 110 | { |
116 | if (unlikely(child->ptrace)) | 111 | if (unlikely(child->ptrace)) |
@@ -169,9 +164,9 @@ static inline void ptrace_init_task(struct task_struct *child, bool ptrace) | |||
169 | INIT_LIST_HEAD(&child->ptraced); | 164 | INIT_LIST_HEAD(&child->ptraced); |
170 | child->parent = child->real_parent; | 165 | child->parent = child->real_parent; |
171 | child->ptrace = 0; | 166 | child->ptrace = 0; |
172 | if (unlikely(ptrace)) { | 167 | if (unlikely(ptrace) && (current->ptrace & PT_PTRACED)) { |
173 | child->ptrace = current->ptrace; | 168 | child->ptrace = current->ptrace; |
174 | ptrace_link(child, current->parent); | 169 | __ptrace_link(child, current->parent); |
175 | } | 170 | } |
176 | } | 171 | } |
177 | 172 | ||
@@ -278,6 +273,18 @@ static inline void user_enable_block_step(struct task_struct *task) | |||
278 | } | 273 | } |
279 | #endif /* arch_has_block_step */ | 274 | #endif /* arch_has_block_step */ |
280 | 275 | ||
276 | #ifdef ARCH_HAS_USER_SINGLE_STEP_INFO | ||
277 | extern void user_single_step_siginfo(struct task_struct *tsk, | ||
278 | struct pt_regs *regs, siginfo_t *info); | ||
279 | #else | ||
280 | static inline void user_single_step_siginfo(struct task_struct *tsk, | ||
281 | struct pt_regs *regs, siginfo_t *info) | ||
282 | { | ||
283 | memset(info, 0, sizeof(*info)); | ||
284 | info->si_signo = SIGTRAP; | ||
285 | } | ||
286 | #endif | ||
287 | |||
281 | #ifndef arch_ptrace_stop_needed | 288 | #ifndef arch_ptrace_stop_needed |
282 | /** | 289 | /** |
283 | * arch_ptrace_stop_needed - Decide whether arch_ptrace_stop() should be called | 290 | * arch_ptrace_stop_needed - Decide whether arch_ptrace_stop() should be called |
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index a05b4a20768d..c96c1858fe2c 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h | |||
@@ -2051,25 +2051,12 @@ void set_de_name_and_namelen(struct reiserfs_dir_entry *de); | |||
2051 | int search_by_entry_key(struct super_block *sb, const struct cpu_key *key, | 2051 | int search_by_entry_key(struct super_block *sb, const struct cpu_key *key, |
2052 | struct treepath *path, struct reiserfs_dir_entry *de); | 2052 | struct treepath *path, struct reiserfs_dir_entry *de); |
2053 | struct dentry *reiserfs_get_parent(struct dentry *); | 2053 | struct dentry *reiserfs_get_parent(struct dentry *); |
2054 | /* procfs.c */ | ||
2055 | |||
2056 | #if defined( CONFIG_PROC_FS ) && defined( CONFIG_REISERFS_PROC_INFO ) | ||
2057 | #define REISERFS_PROC_INFO | ||
2058 | #else | ||
2059 | #undef REISERFS_PROC_INFO | ||
2060 | #endif | ||
2061 | 2054 | ||
2055 | #ifdef CONFIG_REISERFS_PROC_INFO | ||
2062 | int reiserfs_proc_info_init(struct super_block *sb); | 2056 | int reiserfs_proc_info_init(struct super_block *sb); |
2063 | int reiserfs_proc_info_done(struct super_block *sb); | 2057 | int reiserfs_proc_info_done(struct super_block *sb); |
2064 | struct proc_dir_entry *reiserfs_proc_register_global(char *name, | ||
2065 | read_proc_t * func); | ||
2066 | void reiserfs_proc_unregister_global(const char *name); | ||
2067 | int reiserfs_proc_info_global_init(void); | 2058 | int reiserfs_proc_info_global_init(void); |
2068 | int reiserfs_proc_info_global_done(void); | 2059 | int reiserfs_proc_info_global_done(void); |
2069 | int reiserfs_global_version_in_proc(char *buffer, char **start, off_t offset, | ||
2070 | int count, int *eof, void *data); | ||
2071 | |||
2072 | #if defined( REISERFS_PROC_INFO ) | ||
2073 | 2060 | ||
2074 | #define PROC_EXP( e ) e | 2061 | #define PROC_EXP( e ) e |
2075 | 2062 | ||
@@ -2084,6 +2071,26 @@ int reiserfs_global_version_in_proc(char *buffer, char **start, off_t offset, | |||
2084 | PROC_INFO_ADD( sb, free_at[ ( level ) ], B_FREE_SPACE( bh ) ); \ | 2071 | PROC_INFO_ADD( sb, free_at[ ( level ) ], B_FREE_SPACE( bh ) ); \ |
2085 | PROC_INFO_ADD( sb, items_at[ ( level ) ], B_NR_ITEMS( bh ) ) | 2072 | PROC_INFO_ADD( sb, items_at[ ( level ) ], B_NR_ITEMS( bh ) ) |
2086 | #else | 2073 | #else |
2074 | static inline int reiserfs_proc_info_init(struct super_block *sb) | ||
2075 | { | ||
2076 | return 0; | ||
2077 | } | ||
2078 | |||
2079 | static inline int reiserfs_proc_info_done(struct super_block *sb) | ||
2080 | { | ||
2081 | return 0; | ||
2082 | } | ||
2083 | |||
2084 | static inline int reiserfs_proc_info_global_init(void) | ||
2085 | { | ||
2086 | return 0; | ||
2087 | } | ||
2088 | |||
2089 | static inline int reiserfs_proc_info_global_done(void) | ||
2090 | { | ||
2091 | return 0; | ||
2092 | } | ||
2093 | |||
2087 | #define PROC_EXP( e ) | 2094 | #define PROC_EXP( e ) |
2088 | #define VOID_V ( ( void ) 0 ) | 2095 | #define VOID_V ( ( void ) 0 ) |
2089 | #define PROC_INFO_MAX( sb, field, value ) VOID_V | 2096 | #define PROC_INFO_MAX( sb, field, value ) VOID_V |
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 14fc906ed602..05330fc5b436 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
@@ -368,11 +368,9 @@ enum { | |||
368 | #define RTAX_MAX (__RTAX_MAX - 1) | 368 | #define RTAX_MAX (__RTAX_MAX - 1) |
369 | 369 | ||
370 | #define RTAX_FEATURE_ECN 0x00000001 | 370 | #define RTAX_FEATURE_ECN 0x00000001 |
371 | #define RTAX_FEATURE_NO_SACK 0x00000002 | 371 | #define RTAX_FEATURE_SACK 0x00000002 |
372 | #define RTAX_FEATURE_NO_TSTAMP 0x00000004 | 372 | #define RTAX_FEATURE_TIMESTAMP 0x00000004 |
373 | #define RTAX_FEATURE_ALLFRAG 0x00000008 | 373 | #define RTAX_FEATURE_ALLFRAG 0x00000008 |
374 | #define RTAX_FEATURE_NO_WSCALE 0x00000010 | ||
375 | #define RTAX_FEATURE_NO_DSACK 0x00000020 | ||
376 | 374 | ||
377 | struct rta_session { | 375 | struct rta_session { |
378 | __u8 proto; | 376 | __u8 proto; |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 5c858f38e81a..244c287a5ac1 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -1544,6 +1544,14 @@ struct task_struct { | |||
1544 | unsigned long trace_recursion; | 1544 | unsigned long trace_recursion; |
1545 | #endif /* CONFIG_TRACING */ | 1545 | #endif /* CONFIG_TRACING */ |
1546 | unsigned long stack_start; | 1546 | unsigned long stack_start; |
1547 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR /* memcg uses this to do batch job */ | ||
1548 | struct memcg_batch_info { | ||
1549 | int do_batch; /* incremented when batch uncharge started */ | ||
1550 | struct mem_cgroup *memcg; /* target memcg of uncharge */ | ||
1551 | unsigned long bytes; /* uncharged usage */ | ||
1552 | unsigned long memsw_bytes; /* uncharged mem+swap usage */ | ||
1553 | } memcg_batch; | ||
1554 | #endif | ||
1547 | }; | 1555 | }; |
1548 | 1556 | ||
1549 | /* Future-safe accessor for struct task_struct's cpus_allowed. */ | 1557 | /* Future-safe accessor for struct task_struct's cpus_allowed. */ |
@@ -2075,7 +2083,6 @@ extern int kill_proc_info(int, struct siginfo *, pid_t); | |||
2075 | extern int do_notify_parent(struct task_struct *, int); | 2083 | extern int do_notify_parent(struct task_struct *, int); |
2076 | extern void __wake_up_parent(struct task_struct *p, struct task_struct *parent); | 2084 | extern void __wake_up_parent(struct task_struct *p, struct task_struct *parent); |
2077 | extern void force_sig(int, struct task_struct *); | 2085 | extern void force_sig(int, struct task_struct *); |
2078 | extern void force_sig_specific(int, struct task_struct *); | ||
2079 | extern int send_sig(int, struct task_struct *, int); | 2086 | extern int send_sig(int, struct task_struct *, int); |
2080 | extern void zap_other_threads(struct task_struct *p); | 2087 | extern void zap_other_threads(struct task_struct *p); |
2081 | extern struct sigqueue *sigqueue_alloc(void); | 2088 | extern struct sigqueue *sigqueue_alloc(void); |
@@ -2094,11 +2101,6 @@ static inline int kill_cad_pid(int sig, int priv) | |||
2094 | #define SEND_SIG_PRIV ((struct siginfo *) 1) | 2101 | #define SEND_SIG_PRIV ((struct siginfo *) 1) |
2095 | #define SEND_SIG_FORCED ((struct siginfo *) 2) | 2102 | #define SEND_SIG_FORCED ((struct siginfo *) 2) |
2096 | 2103 | ||
2097 | static inline int is_si_special(const struct siginfo *info) | ||
2098 | { | ||
2099 | return info <= SEND_SIG_FORCED; | ||
2100 | } | ||
2101 | |||
2102 | /* | 2104 | /* |
2103 | * True if we are on the alternate signal stack. | 2105 | * True if we are on the alternate signal stack. |
2104 | */ | 2106 | */ |
diff --git a/include/linux/sem.h b/include/linux/sem.h index 1b191c176bcd..8a4adbef8a0f 100644 --- a/include/linux/sem.h +++ b/include/linux/sem.h | |||
@@ -86,6 +86,7 @@ struct task_struct; | |||
86 | struct sem { | 86 | struct sem { |
87 | int semval; /* current value */ | 87 | int semval; /* current value */ |
88 | int sempid; /* pid of last operation */ | 88 | int sempid; /* pid of last operation */ |
89 | struct list_head sem_pending; /* pending single-sop operations */ | ||
89 | }; | 90 | }; |
90 | 91 | ||
91 | /* One sem_array data structure for each set of semaphores in the system. */ | 92 | /* One sem_array data structure for each set of semaphores in the system. */ |
@@ -96,11 +97,13 @@ struct sem_array { | |||
96 | struct sem *sem_base; /* ptr to first semaphore in array */ | 97 | struct sem *sem_base; /* ptr to first semaphore in array */ |
97 | struct list_head sem_pending; /* pending operations to be processed */ | 98 | struct list_head sem_pending; /* pending operations to be processed */ |
98 | struct list_head list_id; /* undo requests on this array */ | 99 | struct list_head list_id; /* undo requests on this array */ |
99 | unsigned long sem_nsems; /* no. of semaphores in array */ | 100 | int sem_nsems; /* no. of semaphores in array */ |
101 | int complex_count; /* pending complex operations */ | ||
100 | }; | 102 | }; |
101 | 103 | ||
102 | /* One queue for each sleeping process in the system. */ | 104 | /* One queue for each sleeping process in the system. */ |
103 | struct sem_queue { | 105 | struct sem_queue { |
106 | struct list_head simple_list; /* queue of pending operations */ | ||
104 | struct list_head list; /* queue of pending operations */ | 107 | struct list_head list; /* queue of pending operations */ |
105 | struct task_struct *sleeper; /* this process */ | 108 | struct task_struct *sleeper; /* this process */ |
106 | struct sem_undo *undo; /* undo structure */ | 109 | struct sem_undo *undo; /* undo structure */ |
diff --git a/include/linux/sm501-regs.h b/include/linux/sm501-regs.h index d53642d2d899..67ed2c542831 100644 --- a/include/linux/sm501-regs.h +++ b/include/linux/sm501-regs.h | |||
@@ -31,6 +31,8 @@ | |||
31 | #define SM501_SYSCTRL_PCI_SUBSYS_LOCK (1<<11) | 31 | #define SM501_SYSCTRL_PCI_SUBSYS_LOCK (1<<11) |
32 | #define SM501_SYSCTRL_PCI_BURST_READ_EN (1<<15) | 32 | #define SM501_SYSCTRL_PCI_BURST_READ_EN (1<<15) |
33 | 33 | ||
34 | #define SM501_SYSCTRL_2D_ENGINE_STATUS (1<<19) | ||
35 | |||
34 | /* miscellaneous control */ | 36 | /* miscellaneous control */ |
35 | 37 | ||
36 | #define SM501_MISC_CONTROL (0x000004) | 38 | #define SM501_MISC_CONTROL (0x000004) |
diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h index 10709cbe96fd..c2786f20016f 100644 --- a/include/linux/sunrpc/debug.h +++ b/include/linux/sunrpc/debug.h | |||
@@ -28,9 +28,6 @@ | |||
28 | 28 | ||
29 | #ifdef __KERNEL__ | 29 | #ifdef __KERNEL__ |
30 | 30 | ||
31 | #include <linux/timer.h> | ||
32 | #include <linux/workqueue.h> | ||
33 | |||
34 | /* | 31 | /* |
35 | * Enable RPC debugging/profiling. | 32 | * Enable RPC debugging/profiling. |
36 | */ | 33 | */ |
diff --git a/include/linux/sunrpc/rpc_rdma.h b/include/linux/sunrpc/rpc_rdma.h index 87b895d5c786..b78f16b1dea3 100644 --- a/include/linux/sunrpc/rpc_rdma.h +++ b/include/linux/sunrpc/rpc_rdma.h | |||
@@ -40,6 +40,8 @@ | |||
40 | #ifndef _LINUX_SUNRPC_RPC_RDMA_H | 40 | #ifndef _LINUX_SUNRPC_RPC_RDMA_H |
41 | #define _LINUX_SUNRPC_RPC_RDMA_H | 41 | #define _LINUX_SUNRPC_RPC_RDMA_H |
42 | 42 | ||
43 | #include <linux/types.h> | ||
44 | |||
43 | struct rpcrdma_segment { | 45 | struct rpcrdma_segment { |
44 | __be32 rs_handle; /* Registered memory handle */ | 46 | __be32 rs_handle; /* Registered memory handle */ |
45 | __be32 rs_length; /* Length of the chunk in bytes */ | 47 | __be32 rs_length; /* Length of the chunk in bytes */ |
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index 1906782ec86b..7bc7fd5291ce 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h | |||
@@ -173,7 +173,8 @@ struct rpc_task_setup { | |||
173 | #define RPC_PRIORITY_LOW (-1) | 173 | #define RPC_PRIORITY_LOW (-1) |
174 | #define RPC_PRIORITY_NORMAL (0) | 174 | #define RPC_PRIORITY_NORMAL (0) |
175 | #define RPC_PRIORITY_HIGH (1) | 175 | #define RPC_PRIORITY_HIGH (1) |
176 | #define RPC_NR_PRIORITY (1 + RPC_PRIORITY_HIGH - RPC_PRIORITY_LOW) | 176 | #define RPC_PRIORITY_PRIVILEGED (2) |
177 | #define RPC_NR_PRIORITY (1 + RPC_PRIORITY_PRIVILEGED - RPC_PRIORITY_LOW) | ||
177 | 178 | ||
178 | struct rpc_timer { | 179 | struct rpc_timer { |
179 | struct timer_list timer; | 180 | struct timer_list timer; |
@@ -229,6 +230,7 @@ void rpc_wake_up_queued_task(struct rpc_wait_queue *, | |||
229 | void rpc_wake_up(struct rpc_wait_queue *); | 230 | void rpc_wake_up(struct rpc_wait_queue *); |
230 | struct rpc_task *rpc_wake_up_next(struct rpc_wait_queue *); | 231 | struct rpc_task *rpc_wake_up_next(struct rpc_wait_queue *); |
231 | void rpc_wake_up_status(struct rpc_wait_queue *, int); | 232 | void rpc_wake_up_status(struct rpc_wait_queue *, int); |
233 | int rpc_queue_empty(struct rpc_wait_queue *); | ||
232 | void rpc_delay(struct rpc_task *, unsigned long); | 234 | void rpc_delay(struct rpc_task *, unsigned long); |
233 | void * rpc_malloc(struct rpc_task *, size_t); | 235 | void * rpc_malloc(struct rpc_task *, size_t); |
234 | void rpc_free(void *); | 236 | void rpc_free(void *); |
@@ -254,6 +256,16 @@ static inline int rpc_wait_for_completion_task(struct rpc_task *task) | |||
254 | return __rpc_wait_for_completion_task(task, NULL); | 256 | return __rpc_wait_for_completion_task(task, NULL); |
255 | } | 257 | } |
256 | 258 | ||
259 | static inline void rpc_task_set_priority(struct rpc_task *task, unsigned char prio) | ||
260 | { | ||
261 | task->tk_priority = prio - RPC_PRIORITY_LOW; | ||
262 | } | ||
263 | |||
264 | static inline int rpc_task_has_priority(struct rpc_task *task, unsigned char prio) | ||
265 | { | ||
266 | return (task->tk_priority + RPC_PRIORITY_LOW == prio); | ||
267 | } | ||
268 | |||
257 | #ifdef RPC_DEBUG | 269 | #ifdef RPC_DEBUG |
258 | static inline const char * rpc_qname(struct rpc_wait_queue *q) | 270 | static inline const char * rpc_qname(struct rpc_wait_queue *q) |
259 | { | 271 | { |
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 52e8cb0a7569..5a3085b9b394 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
@@ -29,7 +29,6 @@ struct svc_pool_stats { | |||
29 | unsigned long packets; | 29 | unsigned long packets; |
30 | unsigned long sockets_queued; | 30 | unsigned long sockets_queued; |
31 | unsigned long threads_woken; | 31 | unsigned long threads_woken; |
32 | unsigned long overloads_avoided; | ||
33 | unsigned long threads_timedout; | 32 | unsigned long threads_timedout; |
34 | }; | 33 | }; |
35 | 34 | ||
@@ -50,7 +49,6 @@ struct svc_pool { | |||
50 | struct list_head sp_sockets; /* pending sockets */ | 49 | struct list_head sp_sockets; /* pending sockets */ |
51 | unsigned int sp_nrthreads; /* # of threads in pool */ | 50 | unsigned int sp_nrthreads; /* # of threads in pool */ |
52 | struct list_head sp_all_threads; /* all server threads */ | 51 | struct list_head sp_all_threads; /* all server threads */ |
53 | int sp_nwaking; /* number of threads woken but not yet active */ | ||
54 | struct svc_pool_stats sp_stats; /* statistics on pool operation */ | 52 | struct svc_pool_stats sp_stats; /* statistics on pool operation */ |
55 | } ____cacheline_aligned_in_smp; | 53 | } ____cacheline_aligned_in_smp; |
56 | 54 | ||
@@ -275,16 +273,11 @@ struct svc_rqst { | |||
275 | struct auth_domain * rq_client; /* RPC peer info */ | 273 | struct auth_domain * rq_client; /* RPC peer info */ |
276 | struct auth_domain * rq_gssclient; /* "gss/"-style peer info */ | 274 | struct auth_domain * rq_gssclient; /* "gss/"-style peer info */ |
277 | struct svc_cacherep * rq_cacherep; /* cache info */ | 275 | struct svc_cacherep * rq_cacherep; /* cache info */ |
278 | struct knfsd_fh * rq_reffh; /* Referrence filehandle, used to | ||
279 | * determine what device number | ||
280 | * to report (real or virtual) | ||
281 | */ | ||
282 | int rq_splice_ok; /* turned off in gss privacy | 276 | int rq_splice_ok; /* turned off in gss privacy |
283 | * to prevent encrypting page | 277 | * to prevent encrypting page |
284 | * cache pages */ | 278 | * cache pages */ |
285 | wait_queue_head_t rq_wait; /* synchronization */ | 279 | wait_queue_head_t rq_wait; /* synchronization */ |
286 | struct task_struct *rq_task; /* service thread */ | 280 | struct task_struct *rq_task; /* service thread */ |
287 | int rq_waking; /* 1 if thread is being woken */ | ||
288 | }; | 281 | }; |
289 | 282 | ||
290 | /* | 283 | /* |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 939a61507ac5..65793e90d6f6 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -102,12 +102,10 @@ struct perf_event_attr; | |||
102 | #ifdef CONFIG_EVENT_PROFILE | 102 | #ifdef CONFIG_EVENT_PROFILE |
103 | 103 | ||
104 | #define TRACE_SYS_ENTER_PROFILE_INIT(sname) \ | 104 | #define TRACE_SYS_ENTER_PROFILE_INIT(sname) \ |
105 | .profile_count = ATOMIC_INIT(-1), \ | ||
106 | .profile_enable = prof_sysenter_enable, \ | 105 | .profile_enable = prof_sysenter_enable, \ |
107 | .profile_disable = prof_sysenter_disable, | 106 | .profile_disable = prof_sysenter_disable, |
108 | 107 | ||
109 | #define TRACE_SYS_EXIT_PROFILE_INIT(sname) \ | 108 | #define TRACE_SYS_EXIT_PROFILE_INIT(sname) \ |
110 | .profile_count = ATOMIC_INIT(-1), \ | ||
111 | .profile_enable = prof_sysexit_enable, \ | 109 | .profile_enable = prof_sysexit_enable, \ |
112 | .profile_disable = prof_sysexit_disable, | 110 | .profile_disable = prof_sysexit_disable, |
113 | #else | 111 | #else |
@@ -145,7 +143,7 @@ struct perf_event_attr; | |||
145 | .name = "sys_enter"#sname, \ | 143 | .name = "sys_enter"#sname, \ |
146 | .system = "syscalls", \ | 144 | .system = "syscalls", \ |
147 | .event = &enter_syscall_print_##sname, \ | 145 | .event = &enter_syscall_print_##sname, \ |
148 | .raw_init = init_syscall_trace, \ | 146 | .raw_init = trace_event_raw_init, \ |
149 | .show_format = syscall_enter_format, \ | 147 | .show_format = syscall_enter_format, \ |
150 | .define_fields = syscall_enter_define_fields, \ | 148 | .define_fields = syscall_enter_define_fields, \ |
151 | .regfunc = reg_event_syscall_enter, \ | 149 | .regfunc = reg_event_syscall_enter, \ |
@@ -167,7 +165,7 @@ struct perf_event_attr; | |||
167 | .name = "sys_exit"#sname, \ | 165 | .name = "sys_exit"#sname, \ |
168 | .system = "syscalls", \ | 166 | .system = "syscalls", \ |
169 | .event = &exit_syscall_print_##sname, \ | 167 | .event = &exit_syscall_print_##sname, \ |
170 | .raw_init = init_syscall_trace, \ | 168 | .raw_init = trace_event_raw_init, \ |
171 | .show_format = syscall_exit_format, \ | 169 | .show_format = syscall_exit_format, \ |
172 | .define_fields = syscall_exit_define_fields, \ | 170 | .define_fields = syscall_exit_define_fields, \ |
173 | .regfunc = reg_event_syscall_exit, \ | 171 | .regfunc = reg_event_syscall_exit, \ |
diff --git a/include/linux/timb_gpio.h b/include/linux/timb_gpio.h new file mode 100644 index 000000000000..ce456eaae861 --- /dev/null +++ b/include/linux/timb_gpio.h | |||
@@ -0,0 +1,37 @@ | |||
1 | /* | ||
2 | * timb_gpio.h timberdale FPGA GPIO driver, platform data definition | ||
3 | * Copyright (c) 2009 Intel Corporation | ||
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 version 2 as | ||
7 | * published by the Free Software Foundation. | ||
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., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
17 | */ | ||
18 | |||
19 | #ifndef _LINUX_TIMB_GPIO_H | ||
20 | #define _LINUX_TIMB_GPIO_H | ||
21 | |||
22 | /** | ||
23 | * struct timbgpio_platform_data - Platform data of the Timberdale GPIO driver | ||
24 | * @gpio_base The number of the first GPIO pin, set to -1 for | ||
25 | * dynamic number allocation. | ||
26 | * @nr_pins Number of pins that is supported by the hardware (1-32) | ||
27 | * @irq_base If IRQ is supported by the hardware, this is the base | ||
28 | * number of IRQ:s. One IRQ per pin will be used. Set to | ||
29 | * -1 if IRQ:s is not supported. | ||
30 | */ | ||
31 | struct timbgpio_platform_data { | ||
32 | int gpio_base; | ||
33 | int nr_pins; | ||
34 | int irq_base; | ||
35 | }; | ||
36 | |||
37 | #endif | ||
diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h index 1eb44a924e56..10db0102a890 100644 --- a/include/linux/tracehook.h +++ b/include/linux/tracehook.h | |||
@@ -134,6 +134,13 @@ static inline __must_check int tracehook_report_syscall_entry( | |||
134 | */ | 134 | */ |
135 | static inline void tracehook_report_syscall_exit(struct pt_regs *regs, int step) | 135 | static inline void tracehook_report_syscall_exit(struct pt_regs *regs, int step) |
136 | { | 136 | { |
137 | if (step) { | ||
138 | siginfo_t info; | ||
139 | user_single_step_siginfo(current, regs, &info); | ||
140 | force_sig_info(SIGTRAP, &info, current); | ||
141 | return; | ||
142 | } | ||
143 | |||
137 | ptrace_report_syscall(regs); | 144 | ptrace_report_syscall(regs); |
138 | } | 145 | } |
139 | 146 | ||
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 32b92298fd79..d4962a782b8a 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -294,6 +294,7 @@ struct v4l2_pix_format { | |||
294 | 294 | ||
295 | /* Grey formats */ | 295 | /* Grey formats */ |
296 | #define V4L2_PIX_FMT_GREY v4l2_fourcc('G', 'R', 'E', 'Y') /* 8 Greyscale */ | 296 | #define V4L2_PIX_FMT_GREY v4l2_fourcc('G', 'R', 'E', 'Y') /* 8 Greyscale */ |
297 | #define V4L2_PIX_FMT_Y10 v4l2_fourcc('Y', '1', '0', ' ') /* 10 Greyscale */ | ||
297 | #define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */ | 298 | #define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */ |
298 | 299 | ||
299 | /* Palette formats */ | 300 | /* Palette formats */ |
@@ -329,7 +330,11 @@ struct v4l2_pix_format { | |||
329 | #define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */ | 330 | #define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */ |
330 | #define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */ | 331 | #define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */ |
331 | #define V4L2_PIX_FMT_SGRBG8 v4l2_fourcc('G', 'R', 'B', 'G') /* 8 GRGR.. BGBG.. */ | 332 | #define V4L2_PIX_FMT_SGRBG8 v4l2_fourcc('G', 'R', 'B', 'G') /* 8 GRGR.. BGBG.. */ |
332 | #define V4L2_PIX_FMT_SGRBG10 v4l2_fourcc('B', 'A', '1', '0') /* 10bit raw bayer */ | 333 | #define V4L2_PIX_FMT_SRGGB8 v4l2_fourcc('R', 'G', 'G', 'B') /* 8 RGRG.. GBGB.. */ |
334 | #define V4L2_PIX_FMT_SBGGR10 v4l2_fourcc('B', 'G', '1', '0') /* 10 BGBG.. GRGR.. */ | ||
335 | #define V4L2_PIX_FMT_SGBRG10 v4l2_fourcc('G', 'B', '1', '0') /* 10 GBGB.. RGRG.. */ | ||
336 | #define V4L2_PIX_FMT_SGRBG10 v4l2_fourcc('B', 'A', '1', '0') /* 10 GRGR.. BGBG.. */ | ||
337 | #define V4L2_PIX_FMT_SRGGB10 v4l2_fourcc('R', 'G', '1', '0') /* 10 RGRG.. GBGB.. */ | ||
333 | /* 10bit raw bayer DPCM compressed to 8 bits */ | 338 | /* 10bit raw bayer DPCM compressed to 8 bits */ |
334 | #define V4L2_PIX_FMT_SGRBG10DPCM8 v4l2_fourcc('B', 'D', '1', '0') | 339 | #define V4L2_PIX_FMT_SGRBG10DPCM8 v4l2_fourcc('B', 'D', '1', '0') |
335 | /* | 340 | /* |
@@ -732,6 +737,99 @@ struct v4l2_standard { | |||
732 | }; | 737 | }; |
733 | 738 | ||
734 | /* | 739 | /* |
740 | * V I D E O T I M I N G S D V P R E S E T | ||
741 | */ | ||
742 | struct v4l2_dv_preset { | ||
743 | __u32 preset; | ||
744 | __u32 reserved[4]; | ||
745 | }; | ||
746 | |||
747 | /* | ||
748 | * D V P R E S E T S E N U M E R A T I O N | ||
749 | */ | ||
750 | struct v4l2_dv_enum_preset { | ||
751 | __u32 index; | ||
752 | __u32 preset; | ||
753 | __u8 name[32]; /* Name of the preset timing */ | ||
754 | __u32 width; | ||
755 | __u32 height; | ||
756 | __u32 reserved[4]; | ||
757 | }; | ||
758 | |||
759 | /* | ||
760 | * D V P R E S E T V A L U E S | ||
761 | */ | ||
762 | #define V4L2_DV_INVALID 0 | ||
763 | #define V4L2_DV_480P59_94 1 /* BT.1362 */ | ||
764 | #define V4L2_DV_576P50 2 /* BT.1362 */ | ||
765 | #define V4L2_DV_720P24 3 /* SMPTE 296M */ | ||
766 | #define V4L2_DV_720P25 4 /* SMPTE 296M */ | ||
767 | #define V4L2_DV_720P30 5 /* SMPTE 296M */ | ||
768 | #define V4L2_DV_720P50 6 /* SMPTE 296M */ | ||
769 | #define V4L2_DV_720P59_94 7 /* SMPTE 274M */ | ||
770 | #define V4L2_DV_720P60 8 /* SMPTE 274M/296M */ | ||
771 | #define V4L2_DV_1080I29_97 9 /* BT.1120/ SMPTE 274M */ | ||
772 | #define V4L2_DV_1080I30 10 /* BT.1120/ SMPTE 274M */ | ||
773 | #define V4L2_DV_1080I25 11 /* BT.1120 */ | ||
774 | #define V4L2_DV_1080I50 12 /* SMPTE 296M */ | ||
775 | #define V4L2_DV_1080I60 13 /* SMPTE 296M */ | ||
776 | #define V4L2_DV_1080P24 14 /* SMPTE 296M */ | ||
777 | #define V4L2_DV_1080P25 15 /* SMPTE 296M */ | ||
778 | #define V4L2_DV_1080P30 16 /* SMPTE 296M */ | ||
779 | #define V4L2_DV_1080P50 17 /* BT.1120 */ | ||
780 | #define V4L2_DV_1080P60 18 /* BT.1120 */ | ||
781 | |||
782 | /* | ||
783 | * D V B T T I M I N G S | ||
784 | */ | ||
785 | |||
786 | /* BT.656/BT.1120 timing data */ | ||
787 | struct v4l2_bt_timings { | ||
788 | __u32 width; /* width in pixels */ | ||
789 | __u32 height; /* height in lines */ | ||
790 | __u32 interlaced; /* Interlaced or progressive */ | ||
791 | __u32 polarities; /* Positive or negative polarity */ | ||
792 | __u64 pixelclock; /* Pixel clock in HZ. Ex. 74.25MHz->74250000 */ | ||
793 | __u32 hfrontporch; /* Horizpontal front porch in pixels */ | ||
794 | __u32 hsync; /* Horizontal Sync length in pixels */ | ||
795 | __u32 hbackporch; /* Horizontal back porch in pixels */ | ||
796 | __u32 vfrontporch; /* Vertical front porch in pixels */ | ||
797 | __u32 vsync; /* Vertical Sync length in lines */ | ||
798 | __u32 vbackporch; /* Vertical back porch in lines */ | ||
799 | __u32 il_vfrontporch; /* Vertical front porch for bottom field of | ||
800 | * interlaced field formats | ||
801 | */ | ||
802 | __u32 il_vsync; /* Vertical sync length for bottom field of | ||
803 | * interlaced field formats | ||
804 | */ | ||
805 | __u32 il_vbackporch; /* Vertical back porch for bottom field of | ||
806 | * interlaced field formats | ||
807 | */ | ||
808 | __u32 reserved[16]; | ||
809 | } __attribute__ ((packed)); | ||
810 | |||
811 | /* Interlaced or progressive format */ | ||
812 | #define V4L2_DV_PROGRESSIVE 0 | ||
813 | #define V4L2_DV_INTERLACED 1 | ||
814 | |||
815 | /* Polarities. If bit is not set, it is assumed to be negative polarity */ | ||
816 | #define V4L2_DV_VSYNC_POS_POL 0x00000001 | ||
817 | #define V4L2_DV_HSYNC_POS_POL 0x00000002 | ||
818 | |||
819 | |||
820 | /* DV timings */ | ||
821 | struct v4l2_dv_timings { | ||
822 | __u32 type; | ||
823 | union { | ||
824 | struct v4l2_bt_timings bt; | ||
825 | __u32 reserved[32]; | ||
826 | }; | ||
827 | } __attribute__ ((packed)); | ||
828 | |||
829 | /* Values for the type field */ | ||
830 | #define V4L2_DV_BT_656_1120 0 /* BT.656/1120 timing type */ | ||
831 | |||
832 | /* | ||
735 | * V I D E O I N P U T S | 833 | * V I D E O I N P U T S |
736 | */ | 834 | */ |
737 | struct v4l2_input { | 835 | struct v4l2_input { |
@@ -742,7 +840,8 @@ struct v4l2_input { | |||
742 | __u32 tuner; /* Associated tuner */ | 840 | __u32 tuner; /* Associated tuner */ |
743 | v4l2_std_id std; | 841 | v4l2_std_id std; |
744 | __u32 status; | 842 | __u32 status; |
745 | __u32 reserved[4]; | 843 | __u32 capabilities; |
844 | __u32 reserved[3]; | ||
746 | }; | 845 | }; |
747 | 846 | ||
748 | /* Values for the 'type' field */ | 847 | /* Values for the 'type' field */ |
@@ -773,6 +872,11 @@ struct v4l2_input { | |||
773 | #define V4L2_IN_ST_NO_ACCESS 0x02000000 /* Conditional access denied */ | 872 | #define V4L2_IN_ST_NO_ACCESS 0x02000000 /* Conditional access denied */ |
774 | #define V4L2_IN_ST_VTR 0x04000000 /* VTR time constant */ | 873 | #define V4L2_IN_ST_VTR 0x04000000 /* VTR time constant */ |
775 | 874 | ||
875 | /* capabilities flags */ | ||
876 | #define V4L2_IN_CAP_PRESETS 0x00000001 /* Supports S_DV_PRESET */ | ||
877 | #define V4L2_IN_CAP_CUSTOM_TIMINGS 0x00000002 /* Supports S_DV_TIMINGS */ | ||
878 | #define V4L2_IN_CAP_STD 0x00000004 /* Supports S_STD */ | ||
879 | |||
776 | /* | 880 | /* |
777 | * V I D E O O U T P U T S | 881 | * V I D E O O U T P U T S |
778 | */ | 882 | */ |
@@ -783,13 +887,19 @@ struct v4l2_output { | |||
783 | __u32 audioset; /* Associated audios (bitfield) */ | 887 | __u32 audioset; /* Associated audios (bitfield) */ |
784 | __u32 modulator; /* Associated modulator */ | 888 | __u32 modulator; /* Associated modulator */ |
785 | v4l2_std_id std; | 889 | v4l2_std_id std; |
786 | __u32 reserved[4]; | 890 | __u32 capabilities; |
891 | __u32 reserved[3]; | ||
787 | }; | 892 | }; |
788 | /* Values for the 'type' field */ | 893 | /* Values for the 'type' field */ |
789 | #define V4L2_OUTPUT_TYPE_MODULATOR 1 | 894 | #define V4L2_OUTPUT_TYPE_MODULATOR 1 |
790 | #define V4L2_OUTPUT_TYPE_ANALOG 2 | 895 | #define V4L2_OUTPUT_TYPE_ANALOG 2 |
791 | #define V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY 3 | 896 | #define V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY 3 |
792 | 897 | ||
898 | /* capabilities flags */ | ||
899 | #define V4L2_OUT_CAP_PRESETS 0x00000001 /* Supports S_DV_PRESET */ | ||
900 | #define V4L2_OUT_CAP_CUSTOM_TIMINGS 0x00000002 /* Supports S_DV_TIMINGS */ | ||
901 | #define V4L2_OUT_CAP_STD 0x00000004 /* Supports S_STD */ | ||
902 | |||
793 | /* | 903 | /* |
794 | * C O N T R O L S | 904 | * C O N T R O L S |
795 | */ | 905 | */ |
@@ -1624,6 +1734,13 @@ struct v4l2_dbg_chip_ident { | |||
1624 | #endif | 1734 | #endif |
1625 | 1735 | ||
1626 | #define VIDIOC_S_HW_FREQ_SEEK _IOW('V', 82, struct v4l2_hw_freq_seek) | 1736 | #define VIDIOC_S_HW_FREQ_SEEK _IOW('V', 82, struct v4l2_hw_freq_seek) |
1737 | #define VIDIOC_ENUM_DV_PRESETS _IOWR('V', 83, struct v4l2_dv_enum_preset) | ||
1738 | #define VIDIOC_S_DV_PRESET _IOWR('V', 84, struct v4l2_dv_preset) | ||
1739 | #define VIDIOC_G_DV_PRESET _IOWR('V', 85, struct v4l2_dv_preset) | ||
1740 | #define VIDIOC_QUERY_DV_PRESET _IOR('V', 86, struct v4l2_dv_preset) | ||
1741 | #define VIDIOC_S_DV_TIMINGS _IOWR('V', 87, struct v4l2_dv_timings) | ||
1742 | #define VIDIOC_G_DV_TIMINGS _IOWR('V', 88, struct v4l2_dv_timings) | ||
1743 | |||
1627 | /* Reminder: when adding new ioctls please add support for them to | 1744 | /* Reminder: when adding new ioctls please add support for them to |
1628 | drivers/media/video/v4l2-compat-ioctl32.c as well! */ | 1745 | drivers/media/video/v4l2-compat-ioctl32.c as well! */ |
1629 | 1746 | ||
diff --git a/include/media/ir-common.h b/include/media/ir-common.h index e41a99ee353e..2c6af24b905e 100644 --- a/include/media/ir-common.h +++ b/include/media/ir-common.h | |||
@@ -26,26 +26,7 @@ | |||
26 | #include <linux/input.h> | 26 | #include <linux/input.h> |
27 | #include <linux/workqueue.h> | 27 | #include <linux/workqueue.h> |
28 | #include <linux/interrupt.h> | 28 | #include <linux/interrupt.h> |
29 | #include <linux/spinlock.h> | 29 | #include <media/ir-core.h> |
30 | |||
31 | extern int media_ir_debug; /* media_ir_debug level (0,1,2) */ | ||
32 | #define IR_dprintk(level, fmt, arg...) if (media_ir_debug >= level) \ | ||
33 | printk(KERN_DEBUG "%s: " fmt , __func__, ## arg) | ||
34 | |||
35 | #define IR_TYPE_RC5 1 | ||
36 | #define IR_TYPE_PD 2 /* Pulse distance encoded IR */ | ||
37 | #define IR_TYPE_OTHER 99 | ||
38 | |||
39 | struct ir_scancode { | ||
40 | u16 scancode; | ||
41 | u32 keycode; | ||
42 | }; | ||
43 | |||
44 | struct ir_scancode_table { | ||
45 | struct ir_scancode *scan; | ||
46 | int size; | ||
47 | spinlock_t lock; | ||
48 | }; | ||
49 | 30 | ||
50 | #define RC5_START(x) (((x)>>12)&3) | 31 | #define RC5_START(x) (((x)>>12)&3) |
51 | #define RC5_TOGGLE(x) (((x)>>11)&1) | 32 | #define RC5_TOGGLE(x) (((x)>>11)&1) |
@@ -56,8 +37,6 @@ struct ir_input_state { | |||
56 | /* configuration */ | 37 | /* configuration */ |
57 | int ir_type; | 38 | int ir_type; |
58 | 39 | ||
59 | struct ir_scancode_table keytable; | ||
60 | |||
61 | /* key info */ | 40 | /* key info */ |
62 | u32 ir_key; /* ir scancode */ | 41 | u32 ir_key; /* ir scancode */ |
63 | u32 keycode; /* linux key code */ | 42 | u32 keycode; /* linux key code */ |
@@ -105,7 +84,7 @@ struct card_ir { | |||
105 | /* Routines from ir-functions.c */ | 84 | /* Routines from ir-functions.c */ |
106 | 85 | ||
107 | int ir_input_init(struct input_dev *dev, struct ir_input_state *ir, | 86 | int ir_input_init(struct input_dev *dev, struct ir_input_state *ir, |
108 | int ir_type, struct ir_scancode_table *ir_codes); | 87 | int ir_type); |
109 | void ir_input_nokey(struct input_dev *dev, struct ir_input_state *ir); | 88 | void ir_input_nokey(struct input_dev *dev, struct ir_input_state *ir); |
110 | void ir_input_keydown(struct input_dev *dev, struct ir_input_state *ir, | 89 | void ir_input_keydown(struct input_dev *dev, struct ir_input_state *ir, |
111 | u32 ir_key); | 90 | u32 ir_key); |
@@ -118,19 +97,6 @@ u32 ir_rc5_decode(unsigned int code); | |||
118 | void ir_rc5_timer_end(unsigned long data); | 97 | void ir_rc5_timer_end(unsigned long data); |
119 | void ir_rc5_timer_keyup(unsigned long data); | 98 | void ir_rc5_timer_keyup(unsigned long data); |
120 | 99 | ||
121 | /* Routines from ir-keytable.c */ | ||
122 | |||
123 | u32 ir_g_keycode_from_table(struct input_dev *input_dev, | ||
124 | u32 scancode); | ||
125 | |||
126 | int ir_set_keycode_table(struct input_dev *input_dev, | ||
127 | struct ir_scancode_table *rc_tab); | ||
128 | |||
129 | int ir_roundup_tablesize(int n_elems); | ||
130 | int ir_copy_table(struct ir_scancode_table *destin, | ||
131 | const struct ir_scancode_table *origin); | ||
132 | void ir_input_free(struct input_dev *input_dev); | ||
133 | |||
134 | /* scancode->keycode map tables from ir-keymaps.c */ | 100 | /* scancode->keycode map tables from ir-keymaps.c */ |
135 | 101 | ||
136 | extern struct ir_scancode_table ir_codes_empty_table; | 102 | extern struct ir_scancode_table ir_codes_empty_table; |
@@ -195,4 +161,5 @@ extern struct ir_scancode_table ir_codes_evga_indtube_table; | |||
195 | extern struct ir_scancode_table ir_codes_terratec_cinergy_xs_table; | 161 | extern struct ir_scancode_table ir_codes_terratec_cinergy_xs_table; |
196 | extern struct ir_scancode_table ir_codes_videomate_s350_table; | 162 | extern struct ir_scancode_table ir_codes_videomate_s350_table; |
197 | extern struct ir_scancode_table ir_codes_gadmei_rm008z_table; | 163 | extern struct ir_scancode_table ir_codes_gadmei_rm008z_table; |
164 | extern struct ir_scancode_table ir_codes_nec_terratec_cinergy_xs_table; | ||
198 | #endif | 165 | #endif |
diff --git a/include/media/ir-core.h b/include/media/ir-core.h new file mode 100644 index 000000000000..299d201e1339 --- /dev/null +++ b/include/media/ir-core.h | |||
@@ -0,0 +1,62 @@ | |||
1 | /* | ||
2 | * Remote Controller core header | ||
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 version 2 of the License. | ||
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 | |||
14 | #ifndef _IR_CORE | ||
15 | #define _IR_CORE | ||
16 | |||
17 | #include <linux/input.h> | ||
18 | #include <linux/spinlock.h> | ||
19 | |||
20 | extern int ir_core_debug; | ||
21 | #define IR_dprintk(level, fmt, arg...) if (ir_core_debug >= level) \ | ||
22 | printk(KERN_DEBUG "%s: " fmt , __func__, ## arg) | ||
23 | |||
24 | enum ir_type { | ||
25 | IR_TYPE_UNKNOWN = 0, | ||
26 | IR_TYPE_RC5 = 1, | ||
27 | IR_TYPE_PD = 2, /* Pulse distance encoded IR */ | ||
28 | IR_TYPE_NEC = 3, | ||
29 | IR_TYPE_OTHER = 99, | ||
30 | }; | ||
31 | |||
32 | struct ir_scancode { | ||
33 | u16 scancode; | ||
34 | u32 keycode; | ||
35 | }; | ||
36 | |||
37 | struct ir_scancode_table { | ||
38 | struct ir_scancode *scan; | ||
39 | int size; | ||
40 | enum ir_type ir_type; | ||
41 | spinlock_t lock; | ||
42 | }; | ||
43 | |||
44 | struct ir_input_dev { | ||
45 | struct input_dev *dev; | ||
46 | struct ir_scancode_table rc_tab; | ||
47 | }; | ||
48 | |||
49 | /* Routines from ir-keytable.c */ | ||
50 | |||
51 | u32 ir_g_keycode_from_table(struct input_dev *input_dev, | ||
52 | u32 scancode); | ||
53 | |||
54 | int ir_set_keycode_table(struct input_dev *input_dev, | ||
55 | struct ir_scancode_table *rc_tab); | ||
56 | |||
57 | int ir_roundup_tablesize(int n_elems); | ||
58 | int ir_input_register(struct input_dev *dev, | ||
59 | struct ir_scancode_table *ir_codes); | ||
60 | void ir_input_unregister(struct input_dev *input_dev); | ||
61 | |||
62 | #endif | ||
diff --git a/include/media/mt9t112.h b/include/media/mt9t112.h new file mode 100644 index 000000000000..a43c74ab05ec --- /dev/null +++ b/include/media/mt9t112.h | |||
@@ -0,0 +1,30 @@ | |||
1 | /* mt9t112 Camera | ||
2 | * | ||
3 | * Copyright (C) 2009 Renesas Solutions Corp. | ||
4 | * Kuninori Morimoto <morimoto.kuninori@renesas.com> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef __MT9T112_H__ | ||
12 | #define __MT9T112_H__ | ||
13 | |||
14 | #define MT9T112_FLAG_PCLK_RISING_EDGE (1 << 0) | ||
15 | #define MT9T112_FLAG_DATAWIDTH_8 (1 << 1) /* default width is 10 */ | ||
16 | |||
17 | struct mt9t112_pll_divider { | ||
18 | u8 m, n; | ||
19 | u8 p1, p2, p3, p4, p5, p6, p7; | ||
20 | }; | ||
21 | |||
22 | /* | ||
23 | * mt9t112 camera info | ||
24 | */ | ||
25 | struct mt9t112_camera_info { | ||
26 | u32 flags; | ||
27 | struct mt9t112_pll_divider divider; | ||
28 | }; | ||
29 | |||
30 | #endif /* __MT9T112_H__ */ | ||
diff --git a/include/media/ov772x.h b/include/media/ov772x.h index 30d9629198ef..14c77efd6a85 100644 --- a/include/media/ov772x.h +++ b/include/media/ov772x.h | |||
@@ -1,4 +1,5 @@ | |||
1 | /* ov772x Camera | 1 | /* |
2 | * ov772x Camera | ||
2 | * | 3 | * |
3 | * Copyright (C) 2008 Renesas Solutions Corp. | 4 | * Copyright (C) 2008 Renesas Solutions Corp. |
4 | * Kuninori Morimoto <morimoto.kuninori@renesas.com> | 5 | * Kuninori Morimoto <morimoto.kuninori@renesas.com> |
@@ -54,7 +55,6 @@ struct ov772x_edge_ctrl { | |||
54 | struct ov772x_camera_info { | 55 | struct ov772x_camera_info { |
55 | unsigned long buswidth; | 56 | unsigned long buswidth; |
56 | unsigned long flags; | 57 | unsigned long flags; |
57 | struct soc_camera_link link; | ||
58 | struct ov772x_edge_ctrl edgectrl; | 58 | struct ov772x_edge_ctrl edgectrl; |
59 | }; | 59 | }; |
60 | 60 | ||
diff --git a/include/media/rj54n1cb0c.h b/include/media/rj54n1cb0c.h new file mode 100644 index 000000000000..8ae3288ae925 --- /dev/null +++ b/include/media/rj54n1cb0c.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * RJ54N1CB0C Private data | ||
3 | * | ||
4 | * Copyright (C) 2009, Guennadi Liakhovetski <g.liakhovetski@gmx.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 version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef __RJ54N1CB0C_H__ | ||
12 | #define __RJ54N1CB0C_H__ | ||
13 | |||
14 | struct rj54n1_pdata { | ||
15 | unsigned int mclk_freq; | ||
16 | bool ioctl_high; | ||
17 | }; | ||
18 | |||
19 | #endif | ||
diff --git a/include/media/saa7146_vv.h b/include/media/saa7146_vv.h index eed5fccc83f3..4aeff96ff7d8 100644 --- a/include/media/saa7146_vv.h +++ b/include/media/saa7146_vv.h | |||
@@ -108,8 +108,6 @@ struct saa7146_fh { | |||
108 | 108 | ||
109 | struct saa7146_vv | 109 | struct saa7146_vv |
110 | { | 110 | { |
111 | int vbi_minor; | ||
112 | |||
113 | /* vbi capture */ | 111 | /* vbi capture */ |
114 | struct saa7146_dmaqueue vbi_q; | 112 | struct saa7146_dmaqueue vbi_q; |
115 | /* vbi workaround interrupt queue */ | 113 | /* vbi workaround interrupt queue */ |
@@ -117,8 +115,6 @@ struct saa7146_vv | |||
117 | int vbi_fieldcount; | 115 | int vbi_fieldcount; |
118 | struct saa7146_fh *vbi_streaming; | 116 | struct saa7146_fh *vbi_streaming; |
119 | 117 | ||
120 | int video_minor; | ||
121 | |||
122 | int video_status; | 118 | int video_status; |
123 | struct saa7146_fh *video_fh; | 119 | struct saa7146_fh *video_fh; |
124 | 120 | ||
diff --git a/include/media/sh_mobile_ceu.h b/include/media/sh_mobile_ceu.h index 0f3524cff435..b67747836878 100644 --- a/include/media/sh_mobile_ceu.h +++ b/include/media/sh_mobile_ceu.h | |||
@@ -3,6 +3,8 @@ | |||
3 | 3 | ||
4 | #define SH_CEU_FLAG_USE_8BIT_BUS (1 << 0) /* use 8bit bus width */ | 4 | #define SH_CEU_FLAG_USE_8BIT_BUS (1 << 0) /* use 8bit bus width */ |
5 | #define SH_CEU_FLAG_USE_16BIT_BUS (1 << 1) /* use 16bit bus width */ | 5 | #define SH_CEU_FLAG_USE_16BIT_BUS (1 << 1) /* use 16bit bus width */ |
6 | #define SH_CEU_FLAG_HSYNC_LOW (1 << 2) /* default High if possible */ | ||
7 | #define SH_CEU_FLAG_VSYNC_LOW (1 << 3) /* default High if possible */ | ||
6 | 8 | ||
7 | struct sh_mobile_ceu_info { | 9 | struct sh_mobile_ceu_info { |
8 | unsigned long flags; | 10 | unsigned long flags; |
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h index 3d74e60032dd..dcc5b86bcb6c 100644 --- a/include/media/soc_camera.h +++ b/include/media/soc_camera.h | |||
@@ -24,18 +24,13 @@ struct soc_camera_device { | |||
24 | struct device *pdev; /* Platform device */ | 24 | struct device *pdev; /* Platform device */ |
25 | s32 user_width; | 25 | s32 user_width; |
26 | s32 user_height; | 26 | s32 user_height; |
27 | unsigned short width_min; | 27 | enum v4l2_colorspace colorspace; |
28 | unsigned short height_min; | ||
29 | unsigned short y_skip_top; /* Lines to skip at the top */ | ||
30 | unsigned char iface; /* Host number */ | 28 | unsigned char iface; /* Host number */ |
31 | unsigned char devnum; /* Device number per host */ | 29 | unsigned char devnum; /* Device number per host */ |
32 | unsigned char buswidth; /* See comment in .c */ | ||
33 | struct soc_camera_sense *sense; /* See comment in struct definition */ | 30 | struct soc_camera_sense *sense; /* See comment in struct definition */ |
34 | struct soc_camera_ops *ops; | 31 | struct soc_camera_ops *ops; |
35 | struct video_device *vdev; | 32 | struct video_device *vdev; |
36 | const struct soc_camera_data_format *current_fmt; | 33 | const struct soc_camera_format_xlate *current_fmt; |
37 | const struct soc_camera_data_format *formats; | ||
38 | int num_formats; | ||
39 | struct soc_camera_format_xlate *user_formats; | 34 | struct soc_camera_format_xlate *user_formats; |
40 | int num_user_formats; | 35 | int num_user_formats; |
41 | enum v4l2_field field; /* Preserve field over close() */ | 36 | enum v4l2_field field; /* Preserve field over close() */ |
@@ -107,6 +102,8 @@ struct soc_camera_link { | |||
107 | int i2c_adapter_id; | 102 | int i2c_adapter_id; |
108 | struct i2c_board_info *board_info; | 103 | struct i2c_board_info *board_info; |
109 | const char *module_name; | 104 | const char *module_name; |
105 | void *priv; | ||
106 | |||
110 | /* | 107 | /* |
111 | * For non-I2C devices platform platform has to provide methods to | 108 | * For non-I2C devices platform platform has to provide methods to |
112 | * add a device to the system and to remove | 109 | * add a device to the system and to remove |
@@ -162,23 +159,13 @@ static inline struct v4l2_subdev *soc_camera_to_subdev( | |||
162 | int soc_camera_host_register(struct soc_camera_host *ici); | 159 | int soc_camera_host_register(struct soc_camera_host *ici); |
163 | void soc_camera_host_unregister(struct soc_camera_host *ici); | 160 | void soc_camera_host_unregister(struct soc_camera_host *ici); |
164 | 161 | ||
165 | const struct soc_camera_data_format *soc_camera_format_by_fourcc( | ||
166 | struct soc_camera_device *icd, unsigned int fourcc); | ||
167 | const struct soc_camera_format_xlate *soc_camera_xlate_by_fourcc( | 162 | const struct soc_camera_format_xlate *soc_camera_xlate_by_fourcc( |
168 | struct soc_camera_device *icd, unsigned int fourcc); | 163 | struct soc_camera_device *icd, unsigned int fourcc); |
169 | 164 | ||
170 | struct soc_camera_data_format { | ||
171 | const char *name; | ||
172 | unsigned int depth; | ||
173 | __u32 fourcc; | ||
174 | enum v4l2_colorspace colorspace; | ||
175 | }; | ||
176 | |||
177 | /** | 165 | /** |
178 | * struct soc_camera_format_xlate - match between host and sensor formats | 166 | * struct soc_camera_format_xlate - match between host and sensor formats |
179 | * @cam_fmt: sensor format provided by the sensor | 167 | * @code: code of a sensor provided format |
180 | * @host_fmt: host format after host translation from cam_fmt | 168 | * @host_fmt: host format after host translation from code |
181 | * @buswidth: bus width for this format | ||
182 | * | 169 | * |
183 | * Host and sensor translation structure. Used in table of host and sensor | 170 | * Host and sensor translation structure. Used in table of host and sensor |
184 | * formats matchings in soc_camera_device. A host can override the generic list | 171 | * formats matchings in soc_camera_device. A host can override the generic list |
@@ -186,9 +173,8 @@ struct soc_camera_data_format { | |||
186 | * format setup. | 173 | * format setup. |
187 | */ | 174 | */ |
188 | struct soc_camera_format_xlate { | 175 | struct soc_camera_format_xlate { |
189 | const struct soc_camera_data_format *cam_fmt; | 176 | enum v4l2_mbus_pixelcode code; |
190 | const struct soc_camera_data_format *host_fmt; | 177 | const struct soc_mbus_pixelfmt *host_fmt; |
191 | unsigned char buswidth; | ||
192 | }; | 178 | }; |
193 | 179 | ||
194 | struct soc_camera_ops { | 180 | struct soc_camera_ops { |
diff --git a/include/media/soc_camera_platform.h b/include/media/soc_camera_platform.h index bb70401b8141..0ecefe227b76 100644 --- a/include/media/soc_camera_platform.h +++ b/include/media/soc_camera_platform.h | |||
@@ -19,11 +19,10 @@ struct device; | |||
19 | struct soc_camera_platform_info { | 19 | struct soc_camera_platform_info { |
20 | const char *format_name; | 20 | const char *format_name; |
21 | unsigned long format_depth; | 21 | unsigned long format_depth; |
22 | struct v4l2_pix_format format; | 22 | struct v4l2_mbus_framefmt format; |
23 | unsigned long bus_param; | 23 | unsigned long bus_param; |
24 | struct device *dev; | 24 | struct device *dev; |
25 | int (*set_capture)(struct soc_camera_platform_info *info, int enable); | 25 | int (*set_capture)(struct soc_camera_platform_info *info, int enable); |
26 | struct soc_camera_link link; | ||
27 | }; | 26 | }; |
28 | 27 | ||
29 | #endif /* __SOC_CAMERA_H__ */ | 28 | #endif /* __SOC_CAMERA_H__ */ |
diff --git a/include/media/soc_mediabus.h b/include/media/soc_mediabus.h new file mode 100644 index 000000000000..037cd7be001e --- /dev/null +++ b/include/media/soc_mediabus.h | |||
@@ -0,0 +1,65 @@ | |||
1 | /* | ||
2 | * SoC-camera Media Bus API extensions | ||
3 | * | ||
4 | * Copyright (C) 2009, Guennadi Liakhovetski <g.liakhovetski@gmx.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 version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef SOC_MEDIABUS_H | ||
12 | #define SOC_MEDIABUS_H | ||
13 | |||
14 | #include <linux/videodev2.h> | ||
15 | |||
16 | #include <media/v4l2-mediabus.h> | ||
17 | |||
18 | /** | ||
19 | * enum soc_mbus_packing - data packing types on the media-bus | ||
20 | * @SOC_MBUS_PACKING_NONE: no packing, bit-for-bit transfer to RAM | ||
21 | * @SOC_MBUS_PACKING_2X8_PADHI: 16 bits transferred in 2 8-bit samples, in the | ||
22 | * possibly incomplete byte high bits are padding | ||
23 | * @SOC_MBUS_PACKING_2X8_PADLO: as above, but low bits are padding | ||
24 | * @SOC_MBUS_PACKING_EXTEND16: sample width (e.g., 10 bits) has to be extended | ||
25 | * to 16 bits | ||
26 | */ | ||
27 | enum soc_mbus_packing { | ||
28 | SOC_MBUS_PACKING_NONE, | ||
29 | SOC_MBUS_PACKING_2X8_PADHI, | ||
30 | SOC_MBUS_PACKING_2X8_PADLO, | ||
31 | SOC_MBUS_PACKING_EXTEND16, | ||
32 | }; | ||
33 | |||
34 | /** | ||
35 | * enum soc_mbus_order - sample order on the media bus | ||
36 | * @SOC_MBUS_ORDER_LE: least significant sample first | ||
37 | * @SOC_MBUS_ORDER_BE: most significant sample first | ||
38 | */ | ||
39 | enum soc_mbus_order { | ||
40 | SOC_MBUS_ORDER_LE, | ||
41 | SOC_MBUS_ORDER_BE, | ||
42 | }; | ||
43 | |||
44 | /** | ||
45 | * struct soc_mbus_pixelfmt - Data format on the media bus | ||
46 | * @name: Name of the format | ||
47 | * @fourcc: Fourcc code, that will be obtained if the data is | ||
48 | * stored in memory in the following way: | ||
49 | * @packing: Type of sample-packing, that has to be used | ||
50 | * @order: Sample order when storing in memory | ||
51 | * @bits_per_sample: How many bits the bridge has to sample | ||
52 | */ | ||
53 | struct soc_mbus_pixelfmt { | ||
54 | const char *name; | ||
55 | u32 fourcc; | ||
56 | enum soc_mbus_packing packing; | ||
57 | enum soc_mbus_order order; | ||
58 | u8 bits_per_sample; | ||
59 | }; | ||
60 | |||
61 | const struct soc_mbus_pixelfmt *soc_mbus_get_fmtdesc( | ||
62 | enum v4l2_mbus_pixelcode code); | ||
63 | s32 soc_mbus_bytes_per_line(u32 width, const struct soc_mbus_pixelfmt *mf); | ||
64 | |||
65 | #endif | ||
diff --git a/include/media/tw9910.h b/include/media/tw9910.h index 73231e7880d8..5e2895a05e6b 100644 --- a/include/media/tw9910.h +++ b/include/media/tw9910.h | |||
@@ -32,7 +32,6 @@ enum tw9910_mpout_pin { | |||
32 | struct tw9910_video_info { | 32 | struct tw9910_video_info { |
33 | unsigned long buswidth; | 33 | unsigned long buswidth; |
34 | enum tw9910_mpout_pin mpout; | 34 | enum tw9910_mpout_pin mpout; |
35 | struct soc_camera_link link; | ||
36 | }; | 35 | }; |
37 | 36 | ||
38 | 37 | ||
diff --git a/include/media/v4l2-chip-ident.h b/include/media/v4l2-chip-ident.h index 91942dbe64e3..6cc107d198a0 100644 --- a/include/media/v4l2-chip-ident.h +++ b/include/media/v4l2-chip-ident.h | |||
@@ -267,6 +267,8 @@ enum { | |||
267 | V4L2_IDENT_MT9V022IX7ATC = 45010, /* No way to detect "normal" I77ATx */ | 267 | V4L2_IDENT_MT9V022IX7ATC = 45010, /* No way to detect "normal" I77ATx */ |
268 | V4L2_IDENT_MT9V022IX7ATM = 45015, /* and "lead free" IA7ATx chips */ | 268 | V4L2_IDENT_MT9V022IX7ATM = 45015, /* and "lead free" IA7ATx chips */ |
269 | V4L2_IDENT_MT9T031 = 45020, | 269 | V4L2_IDENT_MT9T031 = 45020, |
270 | V4L2_IDENT_MT9T111 = 45021, | ||
271 | V4L2_IDENT_MT9T112 = 45022, | ||
270 | V4L2_IDENT_MT9V111 = 45031, | 272 | V4L2_IDENT_MT9V111 = 45031, |
271 | V4L2_IDENT_MT9V112 = 45032, | 273 | V4L2_IDENT_MT9V112 = 45032, |
272 | 274 | ||
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h index 1c25b10da34b..1c7b259f341c 100644 --- a/include/media/v4l2-common.h +++ b/include/media/v4l2-common.h | |||
@@ -212,5 +212,5 @@ void v4l_bound_align_image(unsigned int *w, unsigned int wmin, | |||
212 | unsigned int *h, unsigned int hmin, | 212 | unsigned int *h, unsigned int hmin, |
213 | unsigned int hmax, unsigned int halign, | 213 | unsigned int hmax, unsigned int halign, |
214 | unsigned int salign); | 214 | unsigned int salign); |
215 | 215 | int v4l_fill_dv_preset_info(u32 preset, struct v4l2_dv_enum_preset *info); | |
216 | #endif /* V4L2_COMMON_H_ */ | 216 | #endif /* V4L2_COMMON_H_ */ |
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h index 73c9867d744c..2dee93892ea2 100644 --- a/include/media/v4l2-dev.h +++ b/include/media/v4l2-dev.h | |||
@@ -28,10 +28,10 @@ struct v4l2_ioctl_callbacks; | |||
28 | struct video_device; | 28 | struct video_device; |
29 | struct v4l2_device; | 29 | struct v4l2_device; |
30 | 30 | ||
31 | /* Flag to mark the video_device struct as unregistered. | 31 | /* Flag to mark the video_device struct as registered. |
32 | Drivers can set this flag if they want to block all future | 32 | Drivers can clear this flag if they want to block all future |
33 | device access. It is set by video_unregister_device. */ | 33 | device access. It is cleared by video_unregister_device. */ |
34 | #define V4L2_FL_UNREGISTERED (0) | 34 | #define V4L2_FL_REGISTERED (0) |
35 | 35 | ||
36 | struct v4l2_file_operations { | 36 | struct v4l2_file_operations { |
37 | struct module *owner; | 37 | struct module *owner; |
@@ -96,9 +96,7 @@ struct video_device | |||
96 | /* Register video devices. Note that if video_register_device fails, | 96 | /* Register video devices. Note that if video_register_device fails, |
97 | the release() callback of the video_device structure is *not* called, so | 97 | the release() callback of the video_device structure is *not* called, so |
98 | the caller is responsible for freeing any data. Usually that means that | 98 | the caller is responsible for freeing any data. Usually that means that |
99 | you call video_device_release() on failure. | 99 | you call video_device_release() on failure. */ |
100 | |||
101 | Also note that vdev->minor is set to -1 if the registration failed. */ | ||
102 | int __must_check video_register_device(struct video_device *vdev, int type, int nr); | 100 | int __must_check video_register_device(struct video_device *vdev, int type, int nr); |
103 | 101 | ||
104 | /* Same as video_register_device, but no warning is issued if the desired | 102 | /* Same as video_register_device, but no warning is issued if the desired |
@@ -106,7 +104,7 @@ int __must_check video_register_device(struct video_device *vdev, int type, int | |||
106 | int __must_check video_register_device_no_warn(struct video_device *vdev, int type, int nr); | 104 | int __must_check video_register_device_no_warn(struct video_device *vdev, int type, int nr); |
107 | 105 | ||
108 | /* Unregister video devices. Will do nothing if vdev == NULL or | 106 | /* Unregister video devices. Will do nothing if vdev == NULL or |
109 | vdev->minor < 0. */ | 107 | video_is_registered() returns false. */ |
110 | void video_unregister_device(struct video_device *vdev); | 108 | void video_unregister_device(struct video_device *vdev); |
111 | 109 | ||
112 | /* helper functions to alloc/release struct video_device, the | 110 | /* helper functions to alloc/release struct video_device, the |
@@ -141,9 +139,14 @@ static inline void *video_drvdata(struct file *file) | |||
141 | return video_get_drvdata(video_devdata(file)); | 139 | return video_get_drvdata(video_devdata(file)); |
142 | } | 140 | } |
143 | 141 | ||
144 | static inline int video_is_unregistered(struct video_device *vdev) | 142 | static inline const char *video_device_node_name(struct video_device *vdev) |
143 | { | ||
144 | return dev_name(&vdev->dev); | ||
145 | } | ||
146 | |||
147 | static inline int video_is_registered(struct video_device *vdev) | ||
145 | { | 148 | { |
146 | return test_bit(V4L2_FL_UNREGISTERED, &vdev->flags); | 149 | return test_bit(V4L2_FL_REGISTERED, &vdev->flags); |
147 | } | 150 | } |
148 | 151 | ||
149 | #endif /* _V4L2_DEV_H */ | 152 | #endif /* _V4L2_DEV_H */ |
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h index 7a4529defa88..e8ba0f2efbae 100644 --- a/include/media/v4l2-ioctl.h +++ b/include/media/v4l2-ioctl.h | |||
@@ -239,6 +239,21 @@ struct v4l2_ioctl_ops { | |||
239 | int (*vidioc_enum_frameintervals) (struct file *file, void *fh, | 239 | int (*vidioc_enum_frameintervals) (struct file *file, void *fh, |
240 | struct v4l2_frmivalenum *fival); | 240 | struct v4l2_frmivalenum *fival); |
241 | 241 | ||
242 | /* DV Timings IOCTLs */ | ||
243 | int (*vidioc_enum_dv_presets) (struct file *file, void *fh, | ||
244 | struct v4l2_dv_enum_preset *preset); | ||
245 | |||
246 | int (*vidioc_s_dv_preset) (struct file *file, void *fh, | ||
247 | struct v4l2_dv_preset *preset); | ||
248 | int (*vidioc_g_dv_preset) (struct file *file, void *fh, | ||
249 | struct v4l2_dv_preset *preset); | ||
250 | int (*vidioc_query_dv_preset) (struct file *file, void *fh, | ||
251 | struct v4l2_dv_preset *qpreset); | ||
252 | int (*vidioc_s_dv_timings) (struct file *file, void *fh, | ||
253 | struct v4l2_dv_timings *timings); | ||
254 | int (*vidioc_g_dv_timings) (struct file *file, void *fh, | ||
255 | struct v4l2_dv_timings *timings); | ||
256 | |||
242 | /* For other private ioctls */ | 257 | /* For other private ioctls */ |
243 | long (*vidioc_default) (struct file *file, void *fh, | 258 | long (*vidioc_default) (struct file *file, void *fh, |
244 | int cmd, void *arg); | 259 | int cmd, void *arg); |
diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h new file mode 100644 index 000000000000..0dbe02ada259 --- /dev/null +++ b/include/media/v4l2-mediabus.h | |||
@@ -0,0 +1,61 @@ | |||
1 | /* | ||
2 | * Media Bus API header | ||
3 | * | ||
4 | * Copyright (C) 2009, Guennadi Liakhovetski <g.liakhovetski@gmx.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 version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef V4L2_MEDIABUS_H | ||
12 | #define V4L2_MEDIABUS_H | ||
13 | |||
14 | /* | ||
15 | * These pixel codes uniquely identify data formats on the media bus. Mostly | ||
16 | * they correspond to similarly named V4L2_PIX_FMT_* formats, format 0 is | ||
17 | * reserved, V4L2_MBUS_FMT_FIXED shall be used by host-client pairs, where the | ||
18 | * data format is fixed. Additionally, "2X8" means that one pixel is transferred | ||
19 | * in two 8-bit samples, "BE" or "LE" specify in which order those samples are | ||
20 | * transferred over the bus: "LE" means that the least significant bits are | ||
21 | * transferred first, "BE" means that the most significant bits are transferred | ||
22 | * first, and "PADHI" and "PADLO" define which bits - low or high, in the | ||
23 | * incomplete high byte, are filled with padding bits. | ||
24 | */ | ||
25 | enum v4l2_mbus_pixelcode { | ||
26 | V4L2_MBUS_FMT_FIXED = 1, | ||
27 | V4L2_MBUS_FMT_YUYV8_2X8_LE, | ||
28 | V4L2_MBUS_FMT_YVYU8_2X8_LE, | ||
29 | V4L2_MBUS_FMT_YUYV8_2X8_BE, | ||
30 | V4L2_MBUS_FMT_YVYU8_2X8_BE, | ||
31 | V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE, | ||
32 | V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE, | ||
33 | V4L2_MBUS_FMT_RGB565_2X8_LE, | ||
34 | V4L2_MBUS_FMT_RGB565_2X8_BE, | ||
35 | V4L2_MBUS_FMT_SBGGR8_1X8, | ||
36 | V4L2_MBUS_FMT_SBGGR10_1X10, | ||
37 | V4L2_MBUS_FMT_GREY8_1X8, | ||
38 | V4L2_MBUS_FMT_Y10_1X10, | ||
39 | V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_LE, | ||
40 | V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_LE, | ||
41 | V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_BE, | ||
42 | V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_BE, | ||
43 | }; | ||
44 | |||
45 | /** | ||
46 | * struct v4l2_mbus_framefmt - frame format on the media bus | ||
47 | * @width: frame width | ||
48 | * @height: frame height | ||
49 | * @code: data format code | ||
50 | * @field: used interlacing type | ||
51 | * @colorspace: colorspace of the data | ||
52 | */ | ||
53 | struct v4l2_mbus_framefmt { | ||
54 | __u32 width; | ||
55 | __u32 height; | ||
56 | enum v4l2_mbus_pixelcode code; | ||
57 | enum v4l2_field field; | ||
58 | enum v4l2_colorspace colorspace; | ||
59 | }; | ||
60 | |||
61 | #endif | ||
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index 00bf17608453..9ba99cd39ee7 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #define _V4L2_SUBDEV_H | 22 | #define _V4L2_SUBDEV_H |
23 | 23 | ||
24 | #include <media/v4l2-common.h> | 24 | #include <media/v4l2-common.h> |
25 | #include <media/v4l2-mediabus.h> | ||
25 | 26 | ||
26 | /* generic v4l2_device notify callback notification values */ | 27 | /* generic v4l2_device notify callback notification values */ |
27 | #define V4L2_SUBDEV_IR_RX_NOTIFY _IOW('v', 0, u32) | 28 | #define V4L2_SUBDEV_IR_RX_NOTIFY _IOW('v', 0, u32) |
@@ -207,7 +208,7 @@ struct v4l2_subdev_audio_ops { | |||
207 | s_std_output: set v4l2_std_id for video OUTPUT devices. This is ignored by | 208 | s_std_output: set v4l2_std_id for video OUTPUT devices. This is ignored by |
208 | video input devices. | 209 | video input devices. |
209 | 210 | ||
210 | s_crystal_freq: sets the frequency of the crystal used to generate the | 211 | s_crystal_freq: sets the frequency of the crystal used to generate the |
211 | clocks in Hz. An extra flags field allows device specific configuration | 212 | clocks in Hz. An extra flags field allows device specific configuration |
212 | regarding clock frequency dividers, etc. If not used, then set flags | 213 | regarding clock frequency dividers, etc. If not used, then set flags |
213 | to 0. If the frequency is not supported, then -EINVAL is returned. | 214 | to 0. If the frequency is not supported, then -EINVAL is returned. |
@@ -217,6 +218,26 @@ struct v4l2_subdev_audio_ops { | |||
217 | 218 | ||
218 | s_routing: see s_routing in audio_ops, except this version is for video | 219 | s_routing: see s_routing in audio_ops, except this version is for video |
219 | devices. | 220 | devices. |
221 | |||
222 | s_dv_preset: set dv (Digital Video) preset in the sub device. Similar to | ||
223 | s_std() | ||
224 | |||
225 | query_dv_preset: query dv preset in the sub device. This is similar to | ||
226 | querystd() | ||
227 | |||
228 | s_dv_timings(): Set custom dv timings in the sub device. This is used | ||
229 | when sub device is capable of setting detailed timing information | ||
230 | in the hardware to generate/detect the video signal. | ||
231 | |||
232 | g_dv_timings(): Get custom dv timings in the sub device. | ||
233 | |||
234 | enum_mbus_fmt: enumerate pixel formats, provided by a video data source | ||
235 | |||
236 | g_mbus_fmt: get the current pixel format, provided by a video data source | ||
237 | |||
238 | try_mbus_fmt: try to set a pixel format on a video data source | ||
239 | |||
240 | s_mbus_fmt: set a pixel format on a video data source | ||
220 | */ | 241 | */ |
221 | struct v4l2_subdev_video_ops { | 242 | struct v4l2_subdev_video_ops { |
222 | int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config); | 243 | int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config); |
@@ -240,6 +261,33 @@ struct v4l2_subdev_video_ops { | |||
240 | int (*s_parm)(struct v4l2_subdev *sd, struct v4l2_streamparm *param); | 261 | int (*s_parm)(struct v4l2_subdev *sd, struct v4l2_streamparm *param); |
241 | int (*enum_framesizes)(struct v4l2_subdev *sd, struct v4l2_frmsizeenum *fsize); | 262 | int (*enum_framesizes)(struct v4l2_subdev *sd, struct v4l2_frmsizeenum *fsize); |
242 | int (*enum_frameintervals)(struct v4l2_subdev *sd, struct v4l2_frmivalenum *fival); | 263 | int (*enum_frameintervals)(struct v4l2_subdev *sd, struct v4l2_frmivalenum *fival); |
264 | int (*s_dv_preset)(struct v4l2_subdev *sd, | ||
265 | struct v4l2_dv_preset *preset); | ||
266 | int (*query_dv_preset)(struct v4l2_subdev *sd, | ||
267 | struct v4l2_dv_preset *preset); | ||
268 | int (*s_dv_timings)(struct v4l2_subdev *sd, | ||
269 | struct v4l2_dv_timings *timings); | ||
270 | int (*g_dv_timings)(struct v4l2_subdev *sd, | ||
271 | struct v4l2_dv_timings *timings); | ||
272 | int (*enum_mbus_fmt)(struct v4l2_subdev *sd, int index, | ||
273 | enum v4l2_mbus_pixelcode *code); | ||
274 | int (*g_mbus_fmt)(struct v4l2_subdev *sd, | ||
275 | struct v4l2_mbus_framefmt *fmt); | ||
276 | int (*try_mbus_fmt)(struct v4l2_subdev *sd, | ||
277 | struct v4l2_mbus_framefmt *fmt); | ||
278 | int (*s_mbus_fmt)(struct v4l2_subdev *sd, | ||
279 | struct v4l2_mbus_framefmt *fmt); | ||
280 | }; | ||
281 | |||
282 | /** | ||
283 | * struct v4l2_subdev_sensor_ops - v4l2-subdev sensor operations | ||
284 | * @g_skip_top_lines: number of lines at the top of the image to be skipped. | ||
285 | * This is needed for some sensors, which always corrupt | ||
286 | * several top lines of the output image, or which send their | ||
287 | * metadata in them. | ||
288 | */ | ||
289 | struct v4l2_subdev_sensor_ops { | ||
290 | int (*g_skip_top_lines)(struct v4l2_subdev *sd, u32 *lines); | ||
243 | }; | 291 | }; |
244 | 292 | ||
245 | /* | 293 | /* |
@@ -326,11 +374,12 @@ struct v4l2_subdev_ir_ops { | |||
326 | }; | 374 | }; |
327 | 375 | ||
328 | struct v4l2_subdev_ops { | 376 | struct v4l2_subdev_ops { |
329 | const struct v4l2_subdev_core_ops *core; | 377 | const struct v4l2_subdev_core_ops *core; |
330 | const struct v4l2_subdev_tuner_ops *tuner; | 378 | const struct v4l2_subdev_tuner_ops *tuner; |
331 | const struct v4l2_subdev_audio_ops *audio; | 379 | const struct v4l2_subdev_audio_ops *audio; |
332 | const struct v4l2_subdev_video_ops *video; | 380 | const struct v4l2_subdev_video_ops *video; |
333 | const struct v4l2_subdev_ir_ops *ir; | 381 | const struct v4l2_subdev_ir_ops *ir; |
382 | const struct v4l2_subdev_sensor_ops *sensor; | ||
334 | }; | 383 | }; |
335 | 384 | ||
336 | #define V4L2_SUBDEV_NAME_SIZE 32 | 385 | #define V4L2_SUBDEV_NAME_SIZE 32 |
diff --git a/include/net/dst.h b/include/net/dst.h index 387cb3cfde7e..39c4a5963e12 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
@@ -113,7 +113,7 @@ dst_metric(const struct dst_entry *dst, int metric) | |||
113 | static inline u32 | 113 | static inline u32 |
114 | dst_feature(const struct dst_entry *dst, u32 feature) | 114 | dst_feature(const struct dst_entry *dst, u32 feature) |
115 | { | 115 | { |
116 | return (dst ? dst_metric(dst, RTAX_FEATURES) & feature : 0); | 116 | return dst_metric(dst, RTAX_FEATURES) & feature; |
117 | } | 117 | } |
118 | 118 | ||
119 | static inline u32 dst_mtu(const struct dst_entry *dst) | 119 | static inline u32 dst_mtu(const struct dst_entry *dst) |
diff --git a/include/net/ip.h b/include/net/ip.h index e6b9d12d5f62..85108cfbb1ae 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -337,6 +337,7 @@ enum ip_defrag_users { | |||
337 | IP_DEFRAG_CALL_RA_CHAIN, | 337 | IP_DEFRAG_CALL_RA_CHAIN, |
338 | IP_DEFRAG_CONNTRACK_IN, | 338 | IP_DEFRAG_CONNTRACK_IN, |
339 | IP_DEFRAG_CONNTRACK_OUT, | 339 | IP_DEFRAG_CONNTRACK_OUT, |
340 | IP_DEFRAG_CONNTRACK_BRIDGE_IN, | ||
340 | IP_DEFRAG_VS_IN, | 341 | IP_DEFRAG_VS_IN, |
341 | IP_DEFRAG_VS_OUT, | 342 | IP_DEFRAG_VS_OUT, |
342 | IP_DEFRAG_VS_FWD | 343 | IP_DEFRAG_VS_FWD |
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 92db8617d188..ccab5946c830 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
@@ -350,8 +350,16 @@ static inline int ipv6_prefix_equal(const struct in6_addr *a1, | |||
350 | 350 | ||
351 | struct inet_frag_queue; | 351 | struct inet_frag_queue; |
352 | 352 | ||
353 | enum ip6_defrag_users { | ||
354 | IP6_DEFRAG_LOCAL_DELIVER, | ||
355 | IP6_DEFRAG_CONNTRACK_IN, | ||
356 | IP6_DEFRAG_CONNTRACK_OUT, | ||
357 | IP6_DEFRAG_CONNTRACK_BRIDGE_IN, | ||
358 | }; | ||
359 | |||
353 | struct ip6_create_arg { | 360 | struct ip6_create_arg { |
354 | __be32 id; | 361 | __be32 id; |
362 | u32 user; | ||
355 | struct in6_addr *src; | 363 | struct in6_addr *src; |
356 | struct in6_addr *dst; | 364 | struct in6_addr *dst; |
357 | }; | 365 | }; |
diff --git a/include/net/netfilter/ipv6/nf_conntrack_ipv6.h b/include/net/netfilter/ipv6/nf_conntrack_ipv6.h index abc55ad75c2b..1ee717eb5b09 100644 --- a/include/net/netfilter/ipv6/nf_conntrack_ipv6.h +++ b/include/net/netfilter/ipv6/nf_conntrack_ipv6.h | |||
@@ -9,7 +9,7 @@ extern struct nf_conntrack_l4proto nf_conntrack_l4proto_icmpv6; | |||
9 | 9 | ||
10 | extern int nf_ct_frag6_init(void); | 10 | extern int nf_ct_frag6_init(void); |
11 | extern void nf_ct_frag6_cleanup(void); | 11 | extern void nf_ct_frag6_cleanup(void); |
12 | extern struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb); | 12 | extern struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb, u32 user); |
13 | extern void nf_ct_frag6_output(unsigned int hooknum, struct sk_buff *skb, | 13 | extern void nf_ct_frag6_output(unsigned int hooknum, struct sk_buff *skb, |
14 | struct net_device *in, | 14 | struct net_device *in, |
15 | struct net_device *out, | 15 | struct net_device *out, |
diff --git a/include/net/tcp.h b/include/net/tcp.h index 1b6f7d348cee..34f5cc24d903 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -408,8 +408,7 @@ extern int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, | |||
408 | extern void tcp_parse_options(struct sk_buff *skb, | 408 | extern void tcp_parse_options(struct sk_buff *skb, |
409 | struct tcp_options_received *opt_rx, | 409 | struct tcp_options_received *opt_rx, |
410 | u8 **hvpp, | 410 | u8 **hvpp, |
411 | int estab, | 411 | int estab); |
412 | struct dst_entry *dst); | ||
413 | 412 | ||
414 | extern u8 *tcp_parse_md5sig_option(struct tcphdr *th); | 413 | extern u8 *tcp_parse_md5sig_option(struct tcphdr *th); |
415 | 414 | ||
diff --git a/include/rdma/ib_addr.h b/include/rdma/ib_addr.h index 483057b2f4b4..fa0d52b8e622 100644 --- a/include/rdma/ib_addr.h +++ b/include/rdma/ib_addr.h | |||
@@ -36,6 +36,7 @@ | |||
36 | 36 | ||
37 | #include <linux/in.h> | 37 | #include <linux/in.h> |
38 | #include <linux/in6.h> | 38 | #include <linux/in6.h> |
39 | #include <linux/if_arp.h> | ||
39 | #include <linux/netdevice.h> | 40 | #include <linux/netdevice.h> |
40 | #include <linux/socket.h> | 41 | #include <linux/socket.h> |
41 | #include <rdma/ib_verbs.h> | 42 | #include <rdma/ib_verbs.h> |
@@ -60,8 +61,8 @@ struct rdma_dev_addr { | |||
60 | unsigned char src_dev_addr[MAX_ADDR_LEN]; | 61 | unsigned char src_dev_addr[MAX_ADDR_LEN]; |
61 | unsigned char dst_dev_addr[MAX_ADDR_LEN]; | 62 | unsigned char dst_dev_addr[MAX_ADDR_LEN]; |
62 | unsigned char broadcast[MAX_ADDR_LEN]; | 63 | unsigned char broadcast[MAX_ADDR_LEN]; |
63 | enum rdma_node_type dev_type; | 64 | unsigned short dev_type; |
64 | struct net_device *src_dev; | 65 | int bound_dev_if; |
65 | }; | 66 | }; |
66 | 67 | ||
67 | /** | 68 | /** |
@@ -121,40 +122,29 @@ static inline void ib_addr_get_mgid(struct rdma_dev_addr *dev_addr, | |||
121 | memcpy(gid, dev_addr->broadcast + 4, sizeof *gid); | 122 | memcpy(gid, dev_addr->broadcast + 4, sizeof *gid); |
122 | } | 123 | } |
123 | 124 | ||
124 | static inline void ib_addr_get_sgid(struct rdma_dev_addr *dev_addr, | 125 | static inline int rdma_addr_gid_offset(struct rdma_dev_addr *dev_addr) |
125 | union ib_gid *gid) | ||
126 | { | 126 | { |
127 | memcpy(gid, dev_addr->src_dev_addr + 4, sizeof *gid); | 127 | return dev_addr->dev_type == ARPHRD_INFINIBAND ? 4 : 0; |
128 | } | 128 | } |
129 | 129 | ||
130 | static inline void ib_addr_set_sgid(struct rdma_dev_addr *dev_addr, | 130 | static inline void rdma_addr_get_sgid(struct rdma_dev_addr *dev_addr, union ib_gid *gid) |
131 | union ib_gid *gid) | ||
132 | { | 131 | { |
133 | memcpy(dev_addr->src_dev_addr + 4, gid, sizeof *gid); | 132 | memcpy(gid, dev_addr->src_dev_addr + rdma_addr_gid_offset(dev_addr), sizeof *gid); |
134 | } | 133 | } |
135 | 134 | ||
136 | static inline void ib_addr_get_dgid(struct rdma_dev_addr *dev_addr, | 135 | static inline void rdma_addr_set_sgid(struct rdma_dev_addr *dev_addr, union ib_gid *gid) |
137 | union ib_gid *gid) | ||
138 | { | 136 | { |
139 | memcpy(gid, dev_addr->dst_dev_addr + 4, sizeof *gid); | 137 | memcpy(dev_addr->src_dev_addr + rdma_addr_gid_offset(dev_addr), gid, sizeof *gid); |
140 | } | 138 | } |
141 | 139 | ||
142 | static inline void ib_addr_set_dgid(struct rdma_dev_addr *dev_addr, | 140 | static inline void rdma_addr_get_dgid(struct rdma_dev_addr *dev_addr, union ib_gid *gid) |
143 | union ib_gid *gid) | ||
144 | { | 141 | { |
145 | memcpy(dev_addr->dst_dev_addr + 4, gid, sizeof *gid); | 142 | memcpy(gid, dev_addr->dst_dev_addr + rdma_addr_gid_offset(dev_addr), sizeof *gid); |
146 | } | 143 | } |
147 | 144 | ||
148 | static inline void iw_addr_get_sgid(struct rdma_dev_addr *dev_addr, | 145 | static inline void rdma_addr_set_dgid(struct rdma_dev_addr *dev_addr, union ib_gid *gid) |
149 | union ib_gid *gid) | ||
150 | { | ||
151 | memcpy(gid, dev_addr->src_dev_addr, sizeof *gid); | ||
152 | } | ||
153 | |||
154 | static inline void iw_addr_get_dgid(struct rdma_dev_addr *dev_addr, | ||
155 | union ib_gid *gid) | ||
156 | { | 146 | { |
157 | memcpy(gid, dev_addr->dst_dev_addr, sizeof *gid); | 147 | memcpy(dev_addr->dst_dev_addr + rdma_addr_gid_offset(dev_addr), gid, sizeof *gid); |
158 | } | 148 | } |
159 | 149 | ||
160 | #endif /* IB_ADDR_H */ | 150 | #endif /* IB_ADDR_H */ |
diff --git a/include/rdma/ib_sa.h b/include/rdma/ib_sa.h index 3841c1aff692..1082afaed158 100644 --- a/include/rdma/ib_sa.h +++ b/include/rdma/ib_sa.h | |||
@@ -379,4 +379,10 @@ int ib_init_ah_from_path(struct ib_device *device, u8 port_num, | |||
379 | struct ib_sa_path_rec *rec, | 379 | struct ib_sa_path_rec *rec, |
380 | struct ib_ah_attr *ah_attr); | 380 | struct ib_ah_attr *ah_attr); |
381 | 381 | ||
382 | /** | ||
383 | * ib_sa_unpack_path - Convert a path record from MAD format to struct | ||
384 | * ib_sa_path_rec. | ||
385 | */ | ||
386 | void ib_sa_unpack_path(void *attribute, struct ib_sa_path_rec *rec); | ||
387 | |||
382 | #endif /* IB_SA_H */ | 388 | #endif /* IB_SA_H */ |
diff --git a/include/rdma/ib_user_sa.h b/include/rdma/ib_user_sa.h index 659120157e14..cfc7c9ba781e 100644 --- a/include/rdma/ib_user_sa.h +++ b/include/rdma/ib_user_sa.h | |||
@@ -35,6 +35,22 @@ | |||
35 | 35 | ||
36 | #include <linux/types.h> | 36 | #include <linux/types.h> |
37 | 37 | ||
38 | enum { | ||
39 | IB_PATH_GMP = 1, | ||
40 | IB_PATH_PRIMARY = (1<<1), | ||
41 | IB_PATH_ALTERNATE = (1<<2), | ||
42 | IB_PATH_OUTBOUND = (1<<3), | ||
43 | IB_PATH_INBOUND = (1<<4), | ||
44 | IB_PATH_INBOUND_REVERSE = (1<<5), | ||
45 | IB_PATH_BIDIRECTIONAL = IB_PATH_OUTBOUND | IB_PATH_INBOUND_REVERSE | ||
46 | }; | ||
47 | |||
48 | struct ib_path_rec_data { | ||
49 | __u32 flags; | ||
50 | __u32 reserved; | ||
51 | __u32 path_rec[16]; | ||
52 | }; | ||
53 | |||
38 | struct ib_user_path_rec { | 54 | struct ib_user_path_rec { |
39 | __u8 dgid[16]; | 55 | __u8 dgid[16]; |
40 | __u8 sgid[16]; | 56 | __u8 sgid[16]; |
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index c179318edd92..09509edb1c5f 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h | |||
@@ -1425,6 +1425,11 @@ int ib_destroy_qp(struct ib_qp *qp); | |||
1425 | * @send_wr: A list of work requests to post on the send queue. | 1425 | * @send_wr: A list of work requests to post on the send queue. |
1426 | * @bad_send_wr: On an immediate failure, this parameter will reference | 1426 | * @bad_send_wr: On an immediate failure, this parameter will reference |
1427 | * the work request that failed to be posted on the QP. | 1427 | * the work request that failed to be posted on the QP. |
1428 | * | ||
1429 | * While IBA Vol. 1 section 11.4.1.1 specifies that if an immediate | ||
1430 | * error is returned, the QP state shall not be affected, | ||
1431 | * ib_post_send() will return an immediate error after queueing any | ||
1432 | * earlier work requests in the list. | ||
1428 | */ | 1433 | */ |
1429 | static inline int ib_post_send(struct ib_qp *qp, | 1434 | static inline int ib_post_send(struct ib_qp *qp, |
1430 | struct ib_send_wr *send_wr, | 1435 | struct ib_send_wr *send_wr, |
diff --git a/include/rdma/rdma_user_cm.h b/include/rdma/rdma_user_cm.h index c55705460b87..1d165022c02d 100644 --- a/include/rdma/rdma_user_cm.h +++ b/include/rdma/rdma_user_cm.h | |||
@@ -215,12 +215,14 @@ struct rdma_ucm_event_resp { | |||
215 | 215 | ||
216 | /* Option levels */ | 216 | /* Option levels */ |
217 | enum { | 217 | enum { |
218 | RDMA_OPTION_ID = 0 | 218 | RDMA_OPTION_ID = 0, |
219 | RDMA_OPTION_IB = 1 | ||
219 | }; | 220 | }; |
220 | 221 | ||
221 | /* Option details */ | 222 | /* Option details */ |
222 | enum { | 223 | enum { |
223 | RDMA_OPTION_ID_TOS = 0 | 224 | RDMA_OPTION_ID_TOS = 0, |
225 | RDMA_OPTION_IB_PATH = 1 | ||
224 | }; | 226 | }; |
225 | 227 | ||
226 | struct rdma_ucm_set_option { | 228 | struct rdma_ucm_set_option { |
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index d1b3de9c1a71..73523151a731 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
@@ -436,10 +436,6 @@ ftrace_define_fields_##call(struct ftrace_event_call *event_call) \ | |||
436 | struct ftrace_raw_##call field; \ | 436 | struct ftrace_raw_##call field; \ |
437 | int ret; \ | 437 | int ret; \ |
438 | \ | 438 | \ |
439 | ret = trace_define_common_fields(event_call); \ | ||
440 | if (ret) \ | ||
441 | return ret; \ | ||
442 | \ | ||
443 | tstruct; \ | 439 | tstruct; \ |
444 | \ | 440 | \ |
445 | return ret; \ | 441 | return ret; \ |
@@ -559,13 +555,7 @@ static void ftrace_profile_disable_##name(struct ftrace_event_call *unused)\ | |||
559 | * | 555 | * |
560 | * static int ftrace_reg_event_<call>(struct ftrace_event_call *unused) | 556 | * static int ftrace_reg_event_<call>(struct ftrace_event_call *unused) |
561 | * { | 557 | * { |
562 | * int ret; | 558 | * return register_trace_<call>(ftrace_event_<call>); |
563 | * | ||
564 | * ret = register_trace_<call>(ftrace_event_<call>); | ||
565 | * if (!ret) | ||
566 | * pr_info("event trace: Could not activate trace point " | ||
567 | * "probe to <call>"); | ||
568 | * return ret; | ||
569 | * } | 559 | * } |
570 | * | 560 | * |
571 | * static void ftrace_unreg_event_<call>(struct ftrace_event_call *unused) | 561 | * static void ftrace_unreg_event_<call>(struct ftrace_event_call *unused) |
@@ -623,23 +613,12 @@ static void ftrace_profile_disable_##name(struct ftrace_event_call *unused)\ | |||
623 | * .trace = ftrace_raw_output_<call>, <-- stage 2 | 613 | * .trace = ftrace_raw_output_<call>, <-- stage 2 |
624 | * }; | 614 | * }; |
625 | * | 615 | * |
626 | * static int ftrace_raw_init_event_<call>(struct ftrace_event_call *unused) | ||
627 | * { | ||
628 | * int id; | ||
629 | * | ||
630 | * id = register_ftrace_event(&ftrace_event_type_<call>); | ||
631 | * if (!id) | ||
632 | * return -ENODEV; | ||
633 | * event_<call>.id = id; | ||
634 | * return 0; | ||
635 | * } | ||
636 | * | ||
637 | * static struct ftrace_event_call __used | 616 | * static struct ftrace_event_call __used |
638 | * __attribute__((__aligned__(4))) | 617 | * __attribute__((__aligned__(4))) |
639 | * __attribute__((section("_ftrace_events"))) event_<call> = { | 618 | * __attribute__((section("_ftrace_events"))) event_<call> = { |
640 | * .name = "<call>", | 619 | * .name = "<call>", |
641 | * .system = "<system>", | 620 | * .system = "<system>", |
642 | * .raw_init = ftrace_raw_init_event_<call>, | 621 | * .raw_init = trace_event_raw_init, |
643 | * .regfunc = ftrace_reg_event_<call>, | 622 | * .regfunc = ftrace_reg_event_<call>, |
644 | * .unregfunc = ftrace_unreg_event_<call>, | 623 | * .unregfunc = ftrace_unreg_event_<call>, |
645 | * .show_format = ftrace_format_<call>, | 624 | * .show_format = ftrace_format_<call>, |
@@ -647,13 +626,9 @@ static void ftrace_profile_disable_##name(struct ftrace_event_call *unused)\ | |||
647 | * | 626 | * |
648 | */ | 627 | */ |
649 | 628 | ||
650 | #undef TP_FMT | ||
651 | #define TP_FMT(fmt, args...) fmt "\n", ##args | ||
652 | |||
653 | #ifdef CONFIG_EVENT_PROFILE | 629 | #ifdef CONFIG_EVENT_PROFILE |
654 | 630 | ||
655 | #define _TRACE_PROFILE_INIT(call) \ | 631 | #define _TRACE_PROFILE_INIT(call) \ |
656 | .profile_count = ATOMIC_INIT(-1), \ | ||
657 | .profile_enable = ftrace_profile_enable_##call, \ | 632 | .profile_enable = ftrace_profile_enable_##call, \ |
658 | .profile_disable = ftrace_profile_disable_##call, | 633 | .profile_disable = ftrace_profile_disable_##call, |
659 | 634 | ||
@@ -728,13 +703,7 @@ static void ftrace_raw_event_##call(proto) \ | |||
728 | \ | 703 | \ |
729 | static int ftrace_raw_reg_event_##call(struct ftrace_event_call *unused)\ | 704 | static int ftrace_raw_reg_event_##call(struct ftrace_event_call *unused)\ |
730 | { \ | 705 | { \ |
731 | int ret; \ | 706 | return register_trace_##call(ftrace_raw_event_##call); \ |
732 | \ | ||
733 | ret = register_trace_##call(ftrace_raw_event_##call); \ | ||
734 | if (ret) \ | ||
735 | pr_info("event trace: Could not activate trace point " \ | ||
736 | "probe to " #call "\n"); \ | ||
737 | return ret; \ | ||
738 | } \ | 707 | } \ |
739 | \ | 708 | \ |
740 | static void ftrace_raw_unreg_event_##call(struct ftrace_event_call *unused)\ | 709 | static void ftrace_raw_unreg_event_##call(struct ftrace_event_call *unused)\ |
@@ -744,19 +713,7 @@ static void ftrace_raw_unreg_event_##call(struct ftrace_event_call *unused)\ | |||
744 | \ | 713 | \ |
745 | static struct trace_event ftrace_event_type_##call = { \ | 714 | static struct trace_event ftrace_event_type_##call = { \ |
746 | .trace = ftrace_raw_output_##call, \ | 715 | .trace = ftrace_raw_output_##call, \ |
747 | }; \ | 716 | }; |
748 | \ | ||
749 | static int ftrace_raw_init_event_##call(struct ftrace_event_call *unused)\ | ||
750 | { \ | ||
751 | int id; \ | ||
752 | \ | ||
753 | id = register_ftrace_event(&ftrace_event_type_##call); \ | ||
754 | if (!id) \ | ||
755 | return -ENODEV; \ | ||
756 | event_##call.id = id; \ | ||
757 | INIT_LIST_HEAD(&event_##call.fields); \ | ||
758 | return 0; \ | ||
759 | } | ||
760 | 717 | ||
761 | #undef DEFINE_EVENT_PRINT | 718 | #undef DEFINE_EVENT_PRINT |
762 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ | 719 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ |
@@ -776,7 +733,7 @@ __attribute__((section("_ftrace_events"))) event_##call = { \ | |||
776 | .name = #call, \ | 733 | .name = #call, \ |
777 | .system = __stringify(TRACE_SYSTEM), \ | 734 | .system = __stringify(TRACE_SYSTEM), \ |
778 | .event = &ftrace_event_type_##call, \ | 735 | .event = &ftrace_event_type_##call, \ |
779 | .raw_init = ftrace_raw_init_event_##call, \ | 736 | .raw_init = trace_event_raw_init, \ |
780 | .regfunc = ftrace_raw_reg_event_##call, \ | 737 | .regfunc = ftrace_raw_reg_event_##call, \ |
781 | .unregfunc = ftrace_raw_unreg_event_##call, \ | 738 | .unregfunc = ftrace_raw_unreg_event_##call, \ |
782 | .show_format = ftrace_format_##template, \ | 739 | .show_format = ftrace_format_##template, \ |
@@ -793,7 +750,7 @@ __attribute__((section("_ftrace_events"))) event_##call = { \ | |||
793 | .name = #call, \ | 750 | .name = #call, \ |
794 | .system = __stringify(TRACE_SYSTEM), \ | 751 | .system = __stringify(TRACE_SYSTEM), \ |
795 | .event = &ftrace_event_type_##call, \ | 752 | .event = &ftrace_event_type_##call, \ |
796 | .raw_init = ftrace_raw_init_event_##call, \ | 753 | .raw_init = trace_event_raw_init, \ |
797 | .regfunc = ftrace_raw_reg_event_##call, \ | 754 | .regfunc = ftrace_raw_reg_event_##call, \ |
798 | .unregfunc = ftrace_raw_unreg_event_##call, \ | 755 | .unregfunc = ftrace_raw_unreg_event_##call, \ |
799 | .show_format = ftrace_format_##call, \ | 756 | .show_format = ftrace_format_##call, \ |
@@ -953,7 +910,6 @@ end: \ | |||
953 | perf_swevent_put_recursion_context(rctx); \ | 910 | perf_swevent_put_recursion_context(rctx); \ |
954 | end_recursion: \ | 911 | end_recursion: \ |
955 | local_irq_restore(irq_flags); \ | 912 | local_irq_restore(irq_flags); \ |
956 | \ | ||
957 | } | 913 | } |
958 | 914 | ||
959 | #undef DEFINE_EVENT | 915 | #undef DEFINE_EVENT |
diff --git a/include/video/da8xx-fb.h b/include/video/da8xx-fb.h index c051a50ed528..89d43b3d4cb9 100644 --- a/include/video/da8xx-fb.h +++ b/include/video/da8xx-fb.h | |||
@@ -38,6 +38,7 @@ struct da8xx_lcdc_platform_data { | |||
38 | const char manu_name[10]; | 38 | const char manu_name[10]; |
39 | void *controller_data; | 39 | void *controller_data; |
40 | const char type[25]; | 40 | const char type[25]; |
41 | void (*panel_power_ctrl)(int); | ||
41 | }; | 42 | }; |
42 | 43 | ||
43 | struct lcd_ctrl_config { | 44 | struct lcd_ctrl_config { |
diff --git a/include/video/sh_mobile_lcdc.h b/include/video/sh_mobile_lcdc.h index 25144ab22b95..288205457713 100644 --- a/include/video/sh_mobile_lcdc.h +++ b/include/video/sh_mobile_lcdc.h | |||
@@ -50,6 +50,8 @@ struct sh_mobile_lcdc_board_cfg { | |||
50 | void *board_data; | 50 | void *board_data; |
51 | int (*setup_sys)(void *board_data, void *sys_ops_handle, | 51 | int (*setup_sys)(void *board_data, void *sys_ops_handle, |
52 | struct sh_mobile_lcdc_sys_bus_ops *sys_ops); | 52 | struct sh_mobile_lcdc_sys_bus_ops *sys_ops); |
53 | void (*start_transfer)(void *board_data, void *sys_ops_handle, | ||
54 | struct sh_mobile_lcdc_sys_bus_ops *sys_ops); | ||
53 | void (*display_on)(void *board_data); | 55 | void (*display_on)(void *board_data); |
54 | void (*display_off)(void *board_data); | 56 | void (*display_off)(void *board_data); |
55 | }; | 57 | }; |