aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/io.h31
-rw-r--r--include/asm-generic/mmu.h6
-rw-r--r--include/linux/backing-dev.h1
-rw-r--r--include/linux/binfmts.h5
-rw-r--r--include/linux/ceph/libceph.h2
-rw-r--r--include/linux/ceph/osdmap.h1
-rw-r--r--include/linux/ceph/rados.h2
-rw-r--r--include/linux/compat.h62
-rw-r--r--include/linux/dcache.h8
-rw-r--r--include/linux/device-mapper.h55
-rw-r--r--include/linux/dma-debug.h7
-rw-r--r--include/linux/exportfs.h5
-rw-r--r--include/linux/f2fs_fs.h413
-rw-r--r--include/linux/fs.h6
-rw-r--r--include/linux/fscache-cache.h71
-rw-r--r--include/linux/fscache.h50
-rw-r--r--include/linux/fsnotify_backend.h31
-rw-r--r--include/linux/kernel.h6
-rw-r--r--include/linux/mlx4/device.h1
-rw-r--r--include/linux/mm.h1
-rw-r--r--include/linux/namei.h20
-rw-r--r--include/linux/platform_data/iommu-omap.h9
-rw-r--r--include/linux/ptrace.h4
-rw-r--r--include/linux/sched.h2
-rw-r--r--include/linux/signal.h3
-rw-r--r--include/linux/sunrpc/cache.h6
-rw-r--r--include/linux/sunrpc/svc.h6
-rw-r--r--include/linux/sunrpc/svcsock.h21
-rw-r--r--include/linux/syscalls.h15
-rw-r--r--include/uapi/asm-generic/signal.h6
-rw-r--r--include/uapi/linux/dm-ioctl.h4
-rw-r--r--include/uapi/linux/magic.h1
-rw-r--r--include/uapi/linux/signal.h2
33 files changed, 743 insertions, 120 deletions
diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
index d1e93284d72a..33bbbae4ddc6 100644
--- a/include/asm-generic/io.h
+++ b/include/asm-generic/io.h
@@ -12,7 +12,6 @@
12#define __ASM_GENERIC_IO_H 12#define __ASM_GENERIC_IO_H
13 13
14#include <asm/page.h> /* I/O is all done through memory accesses */ 14#include <asm/page.h> /* I/O is all done through memory accesses */
15#include <asm/cacheflush.h>
16#include <linux/types.h> 15#include <linux/types.h>
17 16
18#ifdef CONFIG_GENERIC_IOMAP 17#ifdef CONFIG_GENERIC_IOMAP
@@ -223,36 +222,6 @@ static inline void outsl(unsigned long addr, const void *buffer, int count)
223} 222}
224#endif 223#endif
225 224
226static inline void readsl(const void __iomem *addr, void *buf, int len)
227{
228 insl(addr - PCI_IOBASE, buf, len);
229}
230
231static inline void readsw(const void __iomem *addr, void *buf, int len)
232{
233 insw(addr - PCI_IOBASE, buf, len);
234}
235
236static inline void readsb(const void __iomem *addr, void *buf, int len)
237{
238 insb(addr - PCI_IOBASE, buf, len);
239}
240
241static inline void writesl(const void __iomem *addr, const void *buf, int len)
242{
243 outsl(addr - PCI_IOBASE, buf, len);
244}
245
246static inline void writesw(const void __iomem *addr, const void *buf, int len)
247{
248 outsw(addr - PCI_IOBASE, buf, len);
249}
250
251static inline void writesb(const void __iomem *addr, const void *buf, int len)
252{
253 outsb(addr - PCI_IOBASE, buf, len);
254}
255
256#ifndef CONFIG_GENERIC_IOMAP 225#ifndef CONFIG_GENERIC_IOMAP
257#define ioread8(addr) readb(addr) 226#define ioread8(addr) readb(addr)
258#define ioread16(addr) readw(addr) 227#define ioread16(addr) readw(addr)
diff --git a/include/asm-generic/mmu.h b/include/asm-generic/mmu.h
index 4f4aa56d6b52..0ed3f1cfb854 100644
--- a/include/asm-generic/mmu.h
+++ b/include/asm-generic/mmu.h
@@ -7,8 +7,12 @@
7 */ 7 */
8#ifndef __ASSEMBLY__ 8#ifndef __ASSEMBLY__
9typedef struct { 9typedef struct {
10 struct vm_list_struct *vmlist;
11 unsigned long end_brk; 10 unsigned long end_brk;
11
12#ifdef CONFIG_BINFMT_ELF_FDPIC
13 unsigned long exec_fdpic_loadmap;
14 unsigned long interp_fdpic_loadmap;
15#endif
12} mm_context_t; 16} mm_context_t;
13#endif 17#endif
14 18
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index 2a9a9abc9126..12731a19ef06 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -114,6 +114,7 @@ struct backing_dev_info {
114int bdi_init(struct backing_dev_info *bdi); 114int bdi_init(struct backing_dev_info *bdi);
115void bdi_destroy(struct backing_dev_info *bdi); 115void bdi_destroy(struct backing_dev_info *bdi);
116 116
117__printf(3, 4)
117int bdi_register(struct backing_dev_info *bdi, struct device *parent, 118int bdi_register(struct backing_dev_info *bdi, struct device *parent,
118 const char *fmt, ...); 119 const char *fmt, ...);
119int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev); 120int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev);
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h
index a4c2b565c835..0530b9860359 100644
--- a/include/linux/binfmts.h
+++ b/include/linux/binfmts.h
@@ -112,6 +112,7 @@ extern int setup_arg_pages(struct linux_binprm * bprm,
112 unsigned long stack_top, 112 unsigned long stack_top,
113 int executable_stack); 113 int executable_stack);
114extern int bprm_mm_init(struct linux_binprm *bprm); 114extern int bprm_mm_init(struct linux_binprm *bprm);
115extern int bprm_change_interp(char *interp, struct linux_binprm *bprm);
115extern int copy_strings_kernel(int argc, const char *const *argv, 116extern int copy_strings_kernel(int argc, const char *const *argv,
116 struct linux_binprm *bprm); 117 struct linux_binprm *bprm);
117extern int prepare_bprm_creds(struct linux_binprm *bprm); 118extern int prepare_bprm_creds(struct linux_binprm *bprm);
@@ -119,8 +120,4 @@ extern void install_exec_creds(struct linux_binprm *bprm);
119extern void set_binfmt(struct linux_binfmt *new); 120extern void set_binfmt(struct linux_binfmt *new);
120extern void free_bprm(struct linux_binprm *); 121extern void free_bprm(struct linux_binprm *);
121 122
122#ifdef __ARCH_WANT_KERNEL_EXECVE
123extern void ret_from_kernel_execve(struct pt_regs *normal) __noreturn;
124#endif
125
126#endif /* _LINUX_BINFMTS_H */ 123#endif /* _LINUX_BINFMTS_H */
diff --git a/include/linux/ceph/libceph.h b/include/linux/ceph/libceph.h
index 6470792b13d3..084d3c622b12 100644
--- a/include/linux/ceph/libceph.h
+++ b/include/linux/ceph/libceph.h
@@ -43,7 +43,6 @@ struct ceph_options {
43 struct ceph_entity_addr my_addr; 43 struct ceph_entity_addr my_addr;
44 int mount_timeout; 44 int mount_timeout;
45 int osd_idle_ttl; 45 int osd_idle_ttl;
46 int osd_timeout;
47 int osd_keepalive_timeout; 46 int osd_keepalive_timeout;
48 47
49 /* 48 /*
@@ -63,7 +62,6 @@ struct ceph_options {
63 * defaults 62 * defaults
64 */ 63 */
65#define CEPH_MOUNT_TIMEOUT_DEFAULT 60 64#define CEPH_MOUNT_TIMEOUT_DEFAULT 60
66#define CEPH_OSD_TIMEOUT_DEFAULT 60 /* seconds */
67#define CEPH_OSD_KEEPALIVE_DEFAULT 5 65#define CEPH_OSD_KEEPALIVE_DEFAULT 5
68#define CEPH_OSD_IDLE_TTL_DEFAULT 60 66#define CEPH_OSD_IDLE_TTL_DEFAULT 60
69 67
diff --git a/include/linux/ceph/osdmap.h b/include/linux/ceph/osdmap.h
index e37acbe989a9..10a417f9f76f 100644
--- a/include/linux/ceph/osdmap.h
+++ b/include/linux/ceph/osdmap.h
@@ -123,6 +123,7 @@ extern int ceph_calc_pg_acting(struct ceph_osdmap *osdmap, struct ceph_pg pgid,
123extern int ceph_calc_pg_primary(struct ceph_osdmap *osdmap, 123extern int ceph_calc_pg_primary(struct ceph_osdmap *osdmap,
124 struct ceph_pg pgid); 124 struct ceph_pg pgid);
125 125
126extern const char *ceph_pg_pool_name_by_id(struct ceph_osdmap *map, u64 id);
126extern int ceph_pg_poolid_by_name(struct ceph_osdmap *map, const char *name); 127extern int ceph_pg_poolid_by_name(struct ceph_osdmap *map, const char *name);
127 128
128#endif 129#endif
diff --git a/include/linux/ceph/rados.h b/include/linux/ceph/rados.h
index de91fbdf127e..2c04afeead1c 100644
--- a/include/linux/ceph/rados.h
+++ b/include/linux/ceph/rados.h
@@ -87,6 +87,8 @@ struct ceph_pg {
87 * 87 *
88 * lpgp_num -- as above. 88 * lpgp_num -- as above.
89 */ 89 */
90#define CEPH_NOPOOL ((__u64) (-1)) /* pool id not defined */
91
90#define CEPH_PG_TYPE_REP 1 92#define CEPH_PG_TYPE_REP 1
91#define CEPH_PG_TYPE_RAID4 2 93#define CEPH_PG_TYPE_RAID4 2
92#define CEPH_PG_POOL_VERSION 2 94#define CEPH_PG_POOL_VERSION 2
diff --git a/include/linux/compat.h b/include/linux/compat.h
index e4920bd58a47..dec7e2d18875 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -23,6 +23,61 @@
23#define COMPAT_USE_64BIT_TIME 0 23#define COMPAT_USE_64BIT_TIME 0
24#endif 24#endif
25 25
26#ifndef __SC_DELOUSE
27#define __SC_DELOUSE(t,v) ((t)(unsigned long)(v))
28#endif
29
30#define __SC_CCAST1(t1, a1) __SC_DELOUSE(t1,a1)
31#define __SC_CCAST2(t2, a2, ...) __SC_DELOUSE(t2,a2), __SC_CCAST1(__VA_ARGS__)
32#define __SC_CCAST3(t3, a3, ...) __SC_DELOUSE(t3,a3), __SC_CCAST2(__VA_ARGS__)
33#define __SC_CCAST4(t4, a4, ...) __SC_DELOUSE(t4,a4), __SC_CCAST3(__VA_ARGS__)
34#define __SC_CCAST5(t5, a5, ...) __SC_DELOUSE(t5,a5), __SC_CCAST4(__VA_ARGS__)
35#define __SC_CCAST6(t6, a6, ...) __SC_DELOUSE(t6,a6), __SC_CCAST5(__VA_ARGS__)
36#define COMPAT_SYSCALL_DEFINE1(name, ...) \
37 COMPAT_SYSCALL_DEFINEx(1, _##name, __VA_ARGS__)
38#define COMPAT_SYSCALL_DEFINE2(name, ...) \
39 COMPAT_SYSCALL_DEFINEx(2, _##name, __VA_ARGS__)
40#define COMPAT_SYSCALL_DEFINE3(name, ...) \
41 COMPAT_SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
42#define COMPAT_SYSCALL_DEFINE4(name, ...) \
43 COMPAT_SYSCALL_DEFINEx(4, _##name, __VA_ARGS__)
44#define COMPAT_SYSCALL_DEFINE5(name, ...) \
45 COMPAT_SYSCALL_DEFINEx(5, _##name, __VA_ARGS__)
46#define COMPAT_SYSCALL_DEFINE6(name, ...) \
47 COMPAT_SYSCALL_DEFINEx(6, _##name, __VA_ARGS__)
48
49#ifdef CONFIG_HAVE_SYSCALL_WRAPPERS
50
51#define COMPAT_SYSCALL_DEFINEx(x, name, ...) \
52 asmlinkage long compat_sys##name(__SC_DECL##x(__VA_ARGS__)); \
53 static inline long C_SYSC##name(__SC_DECL##x(__VA_ARGS__)); \
54 asmlinkage long compat_SyS##name(__SC_LONG##x(__VA_ARGS__)) \
55 { \
56 return (long) C_SYSC##name(__SC_CCAST##x(__VA_ARGS__)); \
57 } \
58 SYSCALL_ALIAS(compat_sys##name, compat_SyS##name); \
59 static inline long C_SYSC##name(__SC_DECL##x(__VA_ARGS__))
60
61#else /* CONFIG_HAVE_SYSCALL_WRAPPERS */
62
63#define COMPAT_SYSCALL_DEFINEx(x, name, ...) \
64 asmlinkage long compat_sys##name(__SC_DECL##x(__VA_ARGS__))
65
66#endif /* CONFIG_HAVE_SYSCALL_WRAPPERS */
67
68#ifndef compat_user_stack_pointer
69#define compat_user_stack_pointer() current_user_stack_pointer()
70#endif
71#ifdef CONFIG_GENERIC_SIGALTSTACK
72#ifndef compat_sigaltstack /* we'll need that for MIPS */
73typedef struct compat_sigaltstack {
74 compat_uptr_t ss_sp;
75 int ss_flags;
76 compat_size_t ss_size;
77} compat_stack_t;
78#endif
79#endif
80
26#define compat_jiffies_to_clock_t(x) \ 81#define compat_jiffies_to_clock_t(x) \
27 (((unsigned long)(x) * COMPAT_USER_HZ) / HZ) 82 (((unsigned long)(x) * COMPAT_USER_HZ) / HZ)
28 83
@@ -587,6 +642,13 @@ asmlinkage ssize_t compat_sys_process_vm_writev(compat_pid_t pid,
587 642
588asmlinkage long compat_sys_sendfile(int out_fd, int in_fd, 643asmlinkage long compat_sys_sendfile(int out_fd, int in_fd,
589 compat_off_t __user *offset, compat_size_t count); 644 compat_off_t __user *offset, compat_size_t count);
645#ifdef CONFIG_GENERIC_SIGALTSTACK
646asmlinkage long compat_sys_sigaltstack(const compat_stack_t __user *uss_ptr,
647 compat_stack_t __user *uoss_ptr);
648
649int compat_restore_altstack(const compat_stack_t __user *uss);
650int __compat_save_altstack(compat_stack_t __user *, unsigned long);
651#endif
590 652
591asmlinkage long compat_sys_sched_rr_get_interval(compat_pid_t pid, 653asmlinkage long compat_sys_sched_rr_get_interval(compat_pid_t pid,
592 struct compat_timespec __user *interval); 654 struct compat_timespec __user *interval);
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 59200795482e..c1754b59ddd3 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -202,7 +202,6 @@ struct dentry_operations {
202#define DCACHE_MOUNTED 0x10000 /* is a mountpoint */ 202#define DCACHE_MOUNTED 0x10000 /* is a mountpoint */
203#define DCACHE_NEED_AUTOMOUNT 0x20000 /* handle automount on this dir */ 203#define DCACHE_NEED_AUTOMOUNT 0x20000 /* handle automount on this dir */
204#define DCACHE_MANAGE_TRANSIT 0x40000 /* manage transit from this dirent */ 204#define DCACHE_MANAGE_TRANSIT 0x40000 /* manage transit from this dirent */
205#define DCACHE_NEED_LOOKUP 0x80000 /* dentry requires i_op->lookup */
206#define DCACHE_MANAGED_DENTRY \ 205#define DCACHE_MANAGED_DENTRY \
207 (DCACHE_MOUNTED|DCACHE_NEED_AUTOMOUNT|DCACHE_MANAGE_TRANSIT) 206 (DCACHE_MOUNTED|DCACHE_NEED_AUTOMOUNT|DCACHE_MANAGE_TRANSIT)
208 207
@@ -408,13 +407,6 @@ static inline bool d_mountpoint(struct dentry *dentry)
408 return dentry->d_flags & DCACHE_MOUNTED; 407 return dentry->d_flags & DCACHE_MOUNTED;
409} 408}
410 409
411static inline bool d_need_lookup(struct dentry *dentry)
412{
413 return dentry->d_flags & DCACHE_NEED_LOOKUP;
414}
415
416extern void d_clear_need_lookup(struct dentry *dentry);
417
418extern int sysctl_vfs_cache_pressure; 410extern int sysctl_vfs_cache_pressure;
419 411
420#endif /* __LINUX_DCACHE_H */ 412#endif /* __LINUX_DCACHE_H */
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index 38d27a10aa5d..bf6afa2fc432 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -23,7 +23,6 @@ typedef enum { STATUSTYPE_INFO, STATUSTYPE_TABLE } status_type_t;
23union map_info { 23union map_info {
24 void *ptr; 24 void *ptr;
25 unsigned long long ll; 25 unsigned long long ll;
26 unsigned target_request_nr;
27}; 26};
28 27
29/* 28/*
@@ -46,8 +45,7 @@ typedef void (*dm_dtr_fn) (struct dm_target *ti);
46 * = 1: simple remap complete 45 * = 1: simple remap complete
47 * = 2: The target wants to push back the io 46 * = 2: The target wants to push back the io
48 */ 47 */
49typedef int (*dm_map_fn) (struct dm_target *ti, struct bio *bio, 48typedef int (*dm_map_fn) (struct dm_target *ti, struct bio *bio);
50 union map_info *map_context);
51typedef int (*dm_map_request_fn) (struct dm_target *ti, struct request *clone, 49typedef int (*dm_map_request_fn) (struct dm_target *ti, struct request *clone,
52 union map_info *map_context); 50 union map_info *map_context);
53 51
@@ -60,8 +58,7 @@ typedef int (*dm_map_request_fn) (struct dm_target *ti, struct request *clone,
60 * 2 : The target wants to push back the io 58 * 2 : The target wants to push back the io
61 */ 59 */
62typedef int (*dm_endio_fn) (struct dm_target *ti, 60typedef int (*dm_endio_fn) (struct dm_target *ti,
63 struct bio *bio, int error, 61 struct bio *bio, int error);
64 union map_info *map_context);
65typedef int (*dm_request_endio_fn) (struct dm_target *ti, 62typedef int (*dm_request_endio_fn) (struct dm_target *ti,
66 struct request *clone, int error, 63 struct request *clone, int error,
67 union map_info *map_context); 64 union map_info *map_context);
@@ -193,18 +190,30 @@ struct dm_target {
193 * A number of zero-length barrier requests that will be submitted 190 * A number of zero-length barrier requests that will be submitted
194 * to the target for the purpose of flushing cache. 191 * to the target for the purpose of flushing cache.
195 * 192 *
196 * The request number will be placed in union map_info->target_request_nr. 193 * The request number can be accessed with dm_bio_get_target_request_nr.
197 * It is a responsibility of the target driver to remap these requests 194 * It is a responsibility of the target driver to remap these requests
198 * to the real underlying devices. 195 * to the real underlying devices.
199 */ 196 */
200 unsigned num_flush_requests; 197 unsigned num_flush_requests;
201 198
202 /* 199 /*
203 * The number of discard requests that will be submitted to the 200 * The number of discard requests that will be submitted to the target.
204 * target. map_info->request_nr is used just like num_flush_requests. 201 * The request number can be accessed with dm_bio_get_target_request_nr.
205 */ 202 */
206 unsigned num_discard_requests; 203 unsigned num_discard_requests;
207 204
205 /*
206 * The number of WRITE SAME requests that will be submitted to the target.
207 * The request number can be accessed with dm_bio_get_target_request_nr.
208 */
209 unsigned num_write_same_requests;
210
211 /*
212 * The minimum number of extra bytes allocated in each bio for the
213 * target to use. dm_per_bio_data returns the data location.
214 */
215 unsigned per_bio_data_size;
216
208 /* target specific data */ 217 /* target specific data */
209 void *private; 218 void *private;
210 219
@@ -241,6 +250,36 @@ struct dm_target_callbacks {
241 int (*congested_fn) (struct dm_target_callbacks *, int); 250 int (*congested_fn) (struct dm_target_callbacks *, int);
242}; 251};
243 252
253/*
254 * For bio-based dm.
255 * One of these is allocated for each bio.
256 * This structure shouldn't be touched directly by target drivers.
257 * It is here so that we can inline dm_per_bio_data and
258 * dm_bio_from_per_bio_data
259 */
260struct dm_target_io {
261 struct dm_io *io;
262 struct dm_target *ti;
263 union map_info info;
264 unsigned target_request_nr;
265 struct bio clone;
266};
267
268static inline void *dm_per_bio_data(struct bio *bio, size_t data_size)
269{
270 return (char *)bio - offsetof(struct dm_target_io, clone) - data_size;
271}
272
273static inline struct bio *dm_bio_from_per_bio_data(void *data, size_t data_size)
274{
275 return (struct bio *)((char *)data + data_size + offsetof(struct dm_target_io, clone));
276}
277
278static inline unsigned dm_bio_get_target_request_nr(const struct bio *bio)
279{
280 return container_of(bio, struct dm_target_io, clone)->target_request_nr;
281}
282
244int dm_register_target(struct target_type *t); 283int dm_register_target(struct target_type *t);
245void dm_unregister_target(struct target_type *t); 284void dm_unregister_target(struct target_type *t);
246 285
diff --git a/include/linux/dma-debug.h b/include/linux/dma-debug.h
index 171ad8aedc83..fc0e34ce038f 100644
--- a/include/linux/dma-debug.h
+++ b/include/linux/dma-debug.h
@@ -39,6 +39,8 @@ extern void debug_dma_map_page(struct device *dev, struct page *page,
39 int direction, dma_addr_t dma_addr, 39 int direction, dma_addr_t dma_addr,
40 bool map_single); 40 bool map_single);
41 41
42extern void debug_dma_mapping_error(struct device *dev, dma_addr_t dma_addr);
43
42extern void debug_dma_unmap_page(struct device *dev, dma_addr_t addr, 44extern void debug_dma_unmap_page(struct device *dev, dma_addr_t addr,
43 size_t size, int direction, bool map_single); 45 size_t size, int direction, bool map_single);
44 46
@@ -105,6 +107,11 @@ static inline void debug_dma_map_page(struct device *dev, struct page *page,
105{ 107{
106} 108}
107 109
110static inline void debug_dma_mapping_error(struct device *dev,
111 dma_addr_t dma_addr)
112{
113}
114
108static inline void debug_dma_unmap_page(struct device *dev, dma_addr_t addr, 115static inline void debug_dma_unmap_page(struct device *dev, dma_addr_t addr,
109 size_t size, int direction, 116 size_t size, int direction,
110 bool map_single) 117 bool map_single)
diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h
index c7e6b6392ab8..5b9b5b317180 100644
--- a/include/linux/exportfs.h
+++ b/include/linux/exportfs.h
@@ -83,6 +83,11 @@ enum fid_type {
83 * 64 bit parent inode number. 83 * 64 bit parent inode number.
84 */ 84 */
85 FILEID_NILFS_WITH_PARENT = 0x62, 85 FILEID_NILFS_WITH_PARENT = 0x62,
86
87 /*
88 * Filesystems must not use 0xff file ID.
89 */
90 FILEID_INVALID = 0xff,
86}; 91};
87 92
88struct fid { 93struct fid {
diff --git a/include/linux/f2fs_fs.h b/include/linux/f2fs_fs.h
new file mode 100644
index 000000000000..f9a12f6243a5
--- /dev/null
+++ b/include/linux/f2fs_fs.h
@@ -0,0 +1,413 @@
1/**
2 * include/linux/f2fs_fs.h
3 *
4 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com/
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#ifndef _LINUX_F2FS_FS_H
12#define _LINUX_F2FS_FS_H
13
14#include <linux/pagemap.h>
15#include <linux/types.h>
16
17#define F2FS_SUPER_OFFSET 1024 /* byte-size offset */
18#define F2FS_LOG_SECTOR_SIZE 9 /* 9 bits for 512 byte */
19#define F2FS_LOG_SECTORS_PER_BLOCK 3 /* 4KB: F2FS_BLKSIZE */
20#define F2FS_BLKSIZE 4096 /* support only 4KB block */
21#define F2FS_MAX_EXTENSION 64 /* # of extension entries */
22
23#define NULL_ADDR 0x0U
24#define NEW_ADDR -1U
25
26#define F2FS_ROOT_INO(sbi) (sbi->root_ino_num)
27#define F2FS_NODE_INO(sbi) (sbi->node_ino_num)
28#define F2FS_META_INO(sbi) (sbi->meta_ino_num)
29
30/* This flag is used by node and meta inodes, and by recovery */
31#define GFP_F2FS_ZERO (GFP_NOFS | __GFP_ZERO)
32
33/*
34 * For further optimization on multi-head logs, on-disk layout supports maximum
35 * 16 logs by default. The number, 16, is expected to cover all the cases
36 * enoughly. The implementaion currently uses no more than 6 logs.
37 * Half the logs are used for nodes, and the other half are used for data.
38 */
39#define MAX_ACTIVE_LOGS 16
40#define MAX_ACTIVE_NODE_LOGS 8
41#define MAX_ACTIVE_DATA_LOGS 8
42
43/*
44 * For superblock
45 */
46struct f2fs_super_block {
47 __le32 magic; /* Magic Number */
48 __le16 major_ver; /* Major Version */
49 __le16 minor_ver; /* Minor Version */
50 __le32 log_sectorsize; /* log2 sector size in bytes */
51 __le32 log_sectors_per_block; /* log2 # of sectors per block */
52 __le32 log_blocksize; /* log2 block size in bytes */
53 __le32 log_blocks_per_seg; /* log2 # of blocks per segment */
54 __le32 segs_per_sec; /* # of segments per section */
55 __le32 secs_per_zone; /* # of sections per zone */
56 __le32 checksum_offset; /* checksum offset inside super block */
57 __le64 block_count; /* total # of user blocks */
58 __le32 section_count; /* total # of sections */
59 __le32 segment_count; /* total # of segments */
60 __le32 segment_count_ckpt; /* # of segments for checkpoint */
61 __le32 segment_count_sit; /* # of segments for SIT */
62 __le32 segment_count_nat; /* # of segments for NAT */
63 __le32 segment_count_ssa; /* # of segments for SSA */
64 __le32 segment_count_main; /* # of segments for main area */
65 __le32 segment0_blkaddr; /* start block address of segment 0 */
66 __le32 cp_blkaddr; /* start block address of checkpoint */
67 __le32 sit_blkaddr; /* start block address of SIT */
68 __le32 nat_blkaddr; /* start block address of NAT */
69 __le32 ssa_blkaddr; /* start block address of SSA */
70 __le32 main_blkaddr; /* start block address of main area */
71 __le32 root_ino; /* root inode number */
72 __le32 node_ino; /* node inode number */
73 __le32 meta_ino; /* meta inode number */
74 __u8 uuid[16]; /* 128-bit uuid for volume */
75 __le16 volume_name[512]; /* volume name */
76 __le32 extension_count; /* # of extensions below */
77 __u8 extension_list[F2FS_MAX_EXTENSION][8]; /* extension array */
78} __packed;
79
80/*
81 * For checkpoint
82 */
83#define CP_ERROR_FLAG 0x00000008
84#define CP_COMPACT_SUM_FLAG 0x00000004
85#define CP_ORPHAN_PRESENT_FLAG 0x00000002
86#define CP_UMOUNT_FLAG 0x00000001
87
88struct f2fs_checkpoint {
89 __le64 checkpoint_ver; /* checkpoint block version number */
90 __le64 user_block_count; /* # of user blocks */
91 __le64 valid_block_count; /* # of valid blocks in main area */
92 __le32 rsvd_segment_count; /* # of reserved segments for gc */
93 __le32 overprov_segment_count; /* # of overprovision segments */
94 __le32 free_segment_count; /* # of free segments in main area */
95
96 /* information of current node segments */
97 __le32 cur_node_segno[MAX_ACTIVE_NODE_LOGS];
98 __le16 cur_node_blkoff[MAX_ACTIVE_NODE_LOGS];
99 /* information of current data segments */
100 __le32 cur_data_segno[MAX_ACTIVE_DATA_LOGS];
101 __le16 cur_data_blkoff[MAX_ACTIVE_DATA_LOGS];
102 __le32 ckpt_flags; /* Flags : umount and journal_present */
103 __le32 cp_pack_total_block_count; /* total # of one cp pack */
104 __le32 cp_pack_start_sum; /* start block number of data summary */
105 __le32 valid_node_count; /* Total number of valid nodes */
106 __le32 valid_inode_count; /* Total number of valid inodes */
107 __le32 next_free_nid; /* Next free node number */
108 __le32 sit_ver_bitmap_bytesize; /* Default value 64 */
109 __le32 nat_ver_bitmap_bytesize; /* Default value 256 */
110 __le32 checksum_offset; /* checksum offset inside cp block */
111 __le64 elapsed_time; /* mounted time */
112 /* allocation type of current segment */
113 unsigned char alloc_type[MAX_ACTIVE_LOGS];
114
115 /* SIT and NAT version bitmap */
116 unsigned char sit_nat_version_bitmap[1];
117} __packed;
118
119/*
120 * For orphan inode management
121 */
122#define F2FS_ORPHANS_PER_BLOCK 1020
123
124struct f2fs_orphan_block {
125 __le32 ino[F2FS_ORPHANS_PER_BLOCK]; /* inode numbers */
126 __le32 reserved; /* reserved */
127 __le16 blk_addr; /* block index in current CP */
128 __le16 blk_count; /* Number of orphan inode blocks in CP */
129 __le32 entry_count; /* Total number of orphan nodes in current CP */
130 __le32 check_sum; /* CRC32 for orphan inode block */
131} __packed;
132
133/*
134 * For NODE structure
135 */
136struct f2fs_extent {
137 __le32 fofs; /* start file offset of the extent */
138 __le32 blk_addr; /* start block address of the extent */
139 __le32 len; /* lengh of the extent */
140} __packed;
141
142#define F2FS_MAX_NAME_LEN 256
143#define ADDRS_PER_INODE 923 /* Address Pointers in an Inode */
144#define ADDRS_PER_BLOCK 1018 /* Address Pointers in a Direct Block */
145#define NIDS_PER_BLOCK 1018 /* Node IDs in an Indirect Block */
146
147struct f2fs_inode {
148 __le16 i_mode; /* file mode */
149 __u8 i_advise; /* file hints */
150 __u8 i_reserved; /* reserved */
151 __le32 i_uid; /* user ID */
152 __le32 i_gid; /* group ID */
153 __le32 i_links; /* links count */
154 __le64 i_size; /* file size in bytes */
155 __le64 i_blocks; /* file size in blocks */
156 __le64 i_atime; /* access time */
157 __le64 i_ctime; /* change time */
158 __le64 i_mtime; /* modification time */
159 __le32 i_atime_nsec; /* access time in nano scale */
160 __le32 i_ctime_nsec; /* change time in nano scale */
161 __le32 i_mtime_nsec; /* modification time in nano scale */
162 __le32 i_generation; /* file version (for NFS) */
163 __le32 i_current_depth; /* only for directory depth */
164 __le32 i_xattr_nid; /* nid to save xattr */
165 __le32 i_flags; /* file attributes */
166 __le32 i_pino; /* parent inode number */
167 __le32 i_namelen; /* file name length */
168 __u8 i_name[F2FS_MAX_NAME_LEN]; /* file name for SPOR */
169
170 struct f2fs_extent i_ext; /* caching a largest extent */
171
172 __le32 i_addr[ADDRS_PER_INODE]; /* Pointers to data blocks */
173
174 __le32 i_nid[5]; /* direct(2), indirect(2),
175 double_indirect(1) node id */
176} __packed;
177
178struct direct_node {
179 __le32 addr[ADDRS_PER_BLOCK]; /* array of data block address */
180} __packed;
181
182struct indirect_node {
183 __le32 nid[NIDS_PER_BLOCK]; /* array of data block address */
184} __packed;
185
186enum {
187 COLD_BIT_SHIFT = 0,
188 FSYNC_BIT_SHIFT,
189 DENT_BIT_SHIFT,
190 OFFSET_BIT_SHIFT
191};
192
193struct node_footer {
194 __le32 nid; /* node id */
195 __le32 ino; /* inode nunmber */
196 __le32 flag; /* include cold/fsync/dentry marks and offset */
197 __le64 cp_ver; /* checkpoint version */
198 __le32 next_blkaddr; /* next node page block address */
199} __packed;
200
201struct f2fs_node {
202 /* can be one of three types: inode, direct, and indirect types */
203 union {
204 struct f2fs_inode i;
205 struct direct_node dn;
206 struct indirect_node in;
207 };
208 struct node_footer footer;
209} __packed;
210
211/*
212 * For NAT entries
213 */
214#define NAT_ENTRY_PER_BLOCK (PAGE_CACHE_SIZE / sizeof(struct f2fs_nat_entry))
215
216struct f2fs_nat_entry {
217 __u8 version; /* latest version of cached nat entry */
218 __le32 ino; /* inode number */
219 __le32 block_addr; /* block address */
220} __packed;
221
222struct f2fs_nat_block {
223 struct f2fs_nat_entry entries[NAT_ENTRY_PER_BLOCK];
224} __packed;
225
226/*
227 * For SIT entries
228 *
229 * Each segment is 2MB in size by default so that a bitmap for validity of
230 * there-in blocks should occupy 64 bytes, 512 bits.
231 * Not allow to change this.
232 */
233#define SIT_VBLOCK_MAP_SIZE 64
234#define SIT_ENTRY_PER_BLOCK (PAGE_CACHE_SIZE / sizeof(struct f2fs_sit_entry))
235
236/*
237 * Note that f2fs_sit_entry->vblocks has the following bit-field information.
238 * [15:10] : allocation type such as CURSEG_XXXX_TYPE
239 * [9:0] : valid block count
240 */
241#define SIT_VBLOCKS_SHIFT 10
242#define SIT_VBLOCKS_MASK ((1 << SIT_VBLOCKS_SHIFT) - 1)
243#define GET_SIT_VBLOCKS(raw_sit) \
244 (le16_to_cpu((raw_sit)->vblocks) & SIT_VBLOCKS_MASK)
245#define GET_SIT_TYPE(raw_sit) \
246 ((le16_to_cpu((raw_sit)->vblocks) & ~SIT_VBLOCKS_MASK) \
247 >> SIT_VBLOCKS_SHIFT)
248
249struct f2fs_sit_entry {
250 __le16 vblocks; /* reference above */
251 __u8 valid_map[SIT_VBLOCK_MAP_SIZE]; /* bitmap for valid blocks */
252 __le64 mtime; /* segment age for cleaning */
253} __packed;
254
255struct f2fs_sit_block {
256 struct f2fs_sit_entry entries[SIT_ENTRY_PER_BLOCK];
257} __packed;
258
259/*
260 * For segment summary
261 *
262 * One summary block contains exactly 512 summary entries, which represents
263 * exactly 2MB segment by default. Not allow to change the basic units.
264 *
265 * NOTE: For initializing fields, you must use set_summary
266 *
267 * - If data page, nid represents dnode's nid
268 * - If node page, nid represents the node page's nid.
269 *
270 * The ofs_in_node is used by only data page. It represents offset
271 * from node's page's beginning to get a data block address.
272 * ex) data_blkaddr = (block_t)(nodepage_start_address + ofs_in_node)
273 */
274#define ENTRIES_IN_SUM 512
275#define SUMMARY_SIZE (7) /* sizeof(struct summary) */
276#define SUM_FOOTER_SIZE (5) /* sizeof(struct summary_footer) */
277#define SUM_ENTRY_SIZE (SUMMARY_SIZE * ENTRIES_IN_SUM)
278
279/* a summary entry for a 4KB-sized block in a segment */
280struct f2fs_summary {
281 __le32 nid; /* parent node id */
282 union {
283 __u8 reserved[3];
284 struct {
285 __u8 version; /* node version number */
286 __le16 ofs_in_node; /* block index in parent node */
287 } __packed;
288 };
289} __packed;
290
291/* summary block type, node or data, is stored to the summary_footer */
292#define SUM_TYPE_NODE (1)
293#define SUM_TYPE_DATA (0)
294
295struct summary_footer {
296 unsigned char entry_type; /* SUM_TYPE_XXX */
297 __u32 check_sum; /* summary checksum */
298} __packed;
299
300#define SUM_JOURNAL_SIZE (F2FS_BLKSIZE - SUM_FOOTER_SIZE -\
301 SUM_ENTRY_SIZE)
302#define NAT_JOURNAL_ENTRIES ((SUM_JOURNAL_SIZE - 2) /\
303 sizeof(struct nat_journal_entry))
304#define NAT_JOURNAL_RESERVED ((SUM_JOURNAL_SIZE - 2) %\
305 sizeof(struct nat_journal_entry))
306#define SIT_JOURNAL_ENTRIES ((SUM_JOURNAL_SIZE - 2) /\
307 sizeof(struct sit_journal_entry))
308#define SIT_JOURNAL_RESERVED ((SUM_JOURNAL_SIZE - 2) %\
309 sizeof(struct sit_journal_entry))
310/*
311 * frequently updated NAT/SIT entries can be stored in the spare area in
312 * summary blocks
313 */
314enum {
315 NAT_JOURNAL = 0,
316 SIT_JOURNAL
317};
318
319struct nat_journal_entry {
320 __le32 nid;
321 struct f2fs_nat_entry ne;
322} __packed;
323
324struct nat_journal {
325 struct nat_journal_entry entries[NAT_JOURNAL_ENTRIES];
326 __u8 reserved[NAT_JOURNAL_RESERVED];
327} __packed;
328
329struct sit_journal_entry {
330 __le32 segno;
331 struct f2fs_sit_entry se;
332} __packed;
333
334struct sit_journal {
335 struct sit_journal_entry entries[SIT_JOURNAL_ENTRIES];
336 __u8 reserved[SIT_JOURNAL_RESERVED];
337} __packed;
338
339/* 4KB-sized summary block structure */
340struct f2fs_summary_block {
341 struct f2fs_summary entries[ENTRIES_IN_SUM];
342 union {
343 __le16 n_nats;
344 __le16 n_sits;
345 };
346 /* spare area is used by NAT or SIT journals */
347 union {
348 struct nat_journal nat_j;
349 struct sit_journal sit_j;
350 };
351 struct summary_footer footer;
352} __packed;
353
354/*
355 * For directory operations
356 */
357#define F2FS_DOT_HASH 0
358#define F2FS_DDOT_HASH F2FS_DOT_HASH
359#define F2FS_MAX_HASH (~((0x3ULL) << 62))
360#define F2FS_HASH_COL_BIT ((0x1ULL) << 63)
361
362typedef __le32 f2fs_hash_t;
363
364/* One directory entry slot covers 8bytes-long file name */
365#define F2FS_NAME_LEN 8
366#define F2FS_NAME_LEN_BITS 3
367
368#define GET_DENTRY_SLOTS(x) ((x + F2FS_NAME_LEN - 1) >> F2FS_NAME_LEN_BITS)
369
370/* the number of dentry in a block */
371#define NR_DENTRY_IN_BLOCK 214
372
373/* MAX level for dir lookup */
374#define MAX_DIR_HASH_DEPTH 63
375
376#define SIZE_OF_DIR_ENTRY 11 /* by byte */
377#define SIZE_OF_DENTRY_BITMAP ((NR_DENTRY_IN_BLOCK + BITS_PER_BYTE - 1) / \
378 BITS_PER_BYTE)
379#define SIZE_OF_RESERVED (PAGE_SIZE - ((SIZE_OF_DIR_ENTRY + \
380 F2FS_NAME_LEN) * \
381 NR_DENTRY_IN_BLOCK + SIZE_OF_DENTRY_BITMAP))
382
383/* One directory entry slot representing F2FS_NAME_LEN-sized file name */
384struct f2fs_dir_entry {
385 __le32 hash_code; /* hash code of file name */
386 __le32 ino; /* inode number */
387 __le16 name_len; /* lengh of file name */
388 __u8 file_type; /* file type */
389} __packed;
390
391/* 4KB-sized directory entry block */
392struct f2fs_dentry_block {
393 /* validity bitmap for directory entries in each block */
394 __u8 dentry_bitmap[SIZE_OF_DENTRY_BITMAP];
395 __u8 reserved[SIZE_OF_RESERVED];
396 struct f2fs_dir_entry dentry[NR_DENTRY_IN_BLOCK];
397 __u8 filename[NR_DENTRY_IN_BLOCK][F2FS_NAME_LEN];
398} __packed;
399
400/* file types used in inode_info->flags */
401enum {
402 F2FS_FT_UNKNOWN,
403 F2FS_FT_REG_FILE,
404 F2FS_FT_DIR,
405 F2FS_FT_CHRDEV,
406 F2FS_FT_BLKDEV,
407 F2FS_FT_FIFO,
408 F2FS_FT_SOCK,
409 F2FS_FT_SYMLINK,
410 F2FS_FT_MAX
411};
412
413#endif /* _LINUX_F2FS_FS_H */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index a823d4be38e7..7617ee04f066 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1445,10 +1445,6 @@ static inline void sb_start_intwrite(struct super_block *sb)
1445 1445
1446extern bool inode_owner_or_capable(const struct inode *inode); 1446extern bool inode_owner_or_capable(const struct inode *inode);
1447 1447
1448/* not quite ready to be deprecated, but... */
1449extern void lock_super(struct super_block *);
1450extern void unlock_super(struct super_block *);
1451
1452/* 1448/*
1453 * VFS helper functions.. 1449 * VFS helper functions..
1454 */ 1450 */
@@ -1565,7 +1561,6 @@ struct inode_operations {
1565 int (*mknod) (struct inode *,struct dentry *,umode_t,dev_t); 1561 int (*mknod) (struct inode *,struct dentry *,umode_t,dev_t);
1566 int (*rename) (struct inode *, struct dentry *, 1562 int (*rename) (struct inode *, struct dentry *,
1567 struct inode *, struct dentry *); 1563 struct inode *, struct dentry *);
1568 void (*truncate) (struct inode *);
1569 int (*setattr) (struct dentry *, struct iattr *); 1564 int (*setattr) (struct dentry *, struct iattr *);
1570 int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *); 1565 int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *);
1571 int (*setxattr) (struct dentry *, const char *,const void *,size_t,int); 1566 int (*setxattr) (struct dentry *, const char *,const void *,size_t,int);
@@ -1999,6 +1994,7 @@ struct filename {
1999 bool separate; /* should "name" be freed? */ 1994 bool separate; /* should "name" be freed? */
2000}; 1995};
2001 1996
1997extern long vfs_truncate(struct path *, loff_t);
2002extern int do_truncate(struct dentry *, loff_t start, unsigned int time_attrs, 1998extern int do_truncate(struct dentry *, loff_t start, unsigned int time_attrs,
2003 struct file *filp); 1999 struct file *filp);
2004extern int do_fallocate(struct file *file, int mode, loff_t offset, 2000extern int do_fallocate(struct file *file, int mode, loff_t offset,
diff --git a/include/linux/fscache-cache.h b/include/linux/fscache-cache.h
index ce31408b1e47..5dfa0aa216b6 100644
--- a/include/linux/fscache-cache.h
+++ b/include/linux/fscache-cache.h
@@ -75,6 +75,16 @@ extern wait_queue_head_t fscache_cache_cleared_wq;
75typedef void (*fscache_operation_release_t)(struct fscache_operation *op); 75typedef void (*fscache_operation_release_t)(struct fscache_operation *op);
76typedef void (*fscache_operation_processor_t)(struct fscache_operation *op); 76typedef void (*fscache_operation_processor_t)(struct fscache_operation *op);
77 77
78enum fscache_operation_state {
79 FSCACHE_OP_ST_BLANK, /* Op is not yet submitted */
80 FSCACHE_OP_ST_INITIALISED, /* Op is initialised */
81 FSCACHE_OP_ST_PENDING, /* Op is blocked from running */
82 FSCACHE_OP_ST_IN_PROGRESS, /* Op is in progress */
83 FSCACHE_OP_ST_COMPLETE, /* Op is complete */
84 FSCACHE_OP_ST_CANCELLED, /* Op has been cancelled */
85 FSCACHE_OP_ST_DEAD /* Op is now dead */
86};
87
78struct fscache_operation { 88struct fscache_operation {
79 struct work_struct work; /* record for async ops */ 89 struct work_struct work; /* record for async ops */
80 struct list_head pend_link; /* link in object->pending_ops */ 90 struct list_head pend_link; /* link in object->pending_ops */
@@ -86,10 +96,10 @@ struct fscache_operation {
86#define FSCACHE_OP_MYTHREAD 0x0002 /* - processing is done be issuing thread, not pool */ 96#define FSCACHE_OP_MYTHREAD 0x0002 /* - processing is done be issuing thread, not pool */
87#define FSCACHE_OP_WAITING 4 /* cleared when op is woken */ 97#define FSCACHE_OP_WAITING 4 /* cleared when op is woken */
88#define FSCACHE_OP_EXCLUSIVE 5 /* exclusive op, other ops must wait */ 98#define FSCACHE_OP_EXCLUSIVE 5 /* exclusive op, other ops must wait */
89#define FSCACHE_OP_DEAD 6 /* op is now dead */ 99#define FSCACHE_OP_DEC_READ_CNT 6 /* decrement object->n_reads on destruction */
90#define FSCACHE_OP_DEC_READ_CNT 7 /* decrement object->n_reads on destruction */ 100#define FSCACHE_OP_KEEP_FLAGS 0x0070 /* flags to keep when repurposing an op */
91#define FSCACHE_OP_KEEP_FLAGS 0xc0 /* flags to keep when repurposing an op */
92 101
102 enum fscache_operation_state state;
93 atomic_t usage; 103 atomic_t usage;
94 unsigned debug_id; /* debugging ID */ 104 unsigned debug_id; /* debugging ID */
95 105
@@ -106,6 +116,7 @@ extern atomic_t fscache_op_debug_id;
106extern void fscache_op_work_func(struct work_struct *work); 116extern void fscache_op_work_func(struct work_struct *work);
107 117
108extern void fscache_enqueue_operation(struct fscache_operation *); 118extern void fscache_enqueue_operation(struct fscache_operation *);
119extern void fscache_op_complete(struct fscache_operation *, bool);
109extern void fscache_put_operation(struct fscache_operation *); 120extern void fscache_put_operation(struct fscache_operation *);
110 121
111/** 122/**
@@ -122,6 +133,7 @@ static inline void fscache_operation_init(struct fscache_operation *op,
122{ 133{
123 INIT_WORK(&op->work, fscache_op_work_func); 134 INIT_WORK(&op->work, fscache_op_work_func);
124 atomic_set(&op->usage, 1); 135 atomic_set(&op->usage, 1);
136 op->state = FSCACHE_OP_ST_INITIALISED;
125 op->debug_id = atomic_inc_return(&fscache_op_debug_id); 137 op->debug_id = atomic_inc_return(&fscache_op_debug_id);
126 op->processor = processor; 138 op->processor = processor;
127 op->release = release; 139 op->release = release;
@@ -138,6 +150,7 @@ struct fscache_retrieval {
138 void *context; /* netfs read context (pinned) */ 150 void *context; /* netfs read context (pinned) */
139 struct list_head to_do; /* list of things to be done by the backend */ 151 struct list_head to_do; /* list of things to be done by the backend */
140 unsigned long start_time; /* time at which retrieval started */ 152 unsigned long start_time; /* time at which retrieval started */
153 unsigned n_pages; /* number of pages to be retrieved */
141}; 154};
142 155
143typedef int (*fscache_page_retrieval_func_t)(struct fscache_retrieval *op, 156typedef int (*fscache_page_retrieval_func_t)(struct fscache_retrieval *op,
@@ -174,8 +187,22 @@ static inline void fscache_enqueue_retrieval(struct fscache_retrieval *op)
174} 187}
175 188
176/** 189/**
190 * fscache_retrieval_complete - Record (partial) completion of a retrieval
191 * @op: The retrieval operation affected
192 * @n_pages: The number of pages to account for
193 */
194static inline void fscache_retrieval_complete(struct fscache_retrieval *op,
195 int n_pages)
196{
197 op->n_pages -= n_pages;
198 if (op->n_pages <= 0)
199 fscache_op_complete(&op->op, true);
200}
201
202/**
177 * fscache_put_retrieval - Drop a reference to a retrieval operation 203 * fscache_put_retrieval - Drop a reference to a retrieval operation
178 * @op: The retrieval operation affected 204 * @op: The retrieval operation affected
205 * @n_pages: The number of pages to account for
179 * 206 *
180 * Drop a reference to a retrieval operation. 207 * Drop a reference to a retrieval operation.
181 */ 208 */
@@ -227,6 +254,9 @@ struct fscache_cache_ops {
227 /* store the updated auxiliary data on an object */ 254 /* store the updated auxiliary data on an object */
228 void (*update_object)(struct fscache_object *object); 255 void (*update_object)(struct fscache_object *object);
229 256
257 /* Invalidate an object */
258 void (*invalidate_object)(struct fscache_operation *op);
259
230 /* discard the resources pinned by an object and effect retirement if 260 /* discard the resources pinned by an object and effect retirement if
231 * necessary */ 261 * necessary */
232 void (*drop_object)(struct fscache_object *object); 262 void (*drop_object)(struct fscache_object *object);
@@ -301,11 +331,30 @@ struct fscache_cookie {
301#define FSCACHE_COOKIE_PENDING_FILL 3 /* T if pending initial fill on object */ 331#define FSCACHE_COOKIE_PENDING_FILL 3 /* T if pending initial fill on object */
302#define FSCACHE_COOKIE_FILLING 4 /* T if filling object incrementally */ 332#define FSCACHE_COOKIE_FILLING 4 /* T if filling object incrementally */
303#define FSCACHE_COOKIE_UNAVAILABLE 5 /* T if cookie is unavailable (error, etc) */ 333#define FSCACHE_COOKIE_UNAVAILABLE 5 /* T if cookie is unavailable (error, etc) */
334#define FSCACHE_COOKIE_WAITING_ON_READS 6 /* T if cookie is waiting on reads */
335#define FSCACHE_COOKIE_INVALIDATING 7 /* T if cookie is being invalidated */
304}; 336};
305 337
306extern struct fscache_cookie fscache_fsdef_index; 338extern struct fscache_cookie fscache_fsdef_index;
307 339
308/* 340/*
341 * Event list for fscache_object::{event_mask,events}
342 */
343enum {
344 FSCACHE_OBJECT_EV_REQUEUE, /* T if object should be requeued */
345 FSCACHE_OBJECT_EV_UPDATE, /* T if object should be updated */
346 FSCACHE_OBJECT_EV_INVALIDATE, /* T if cache requested object invalidation */
347 FSCACHE_OBJECT_EV_CLEARED, /* T if accessors all gone */
348 FSCACHE_OBJECT_EV_ERROR, /* T if fatal error occurred during processing */
349 FSCACHE_OBJECT_EV_RELEASE, /* T if netfs requested object release */
350 FSCACHE_OBJECT_EV_RETIRE, /* T if netfs requested object retirement */
351 FSCACHE_OBJECT_EV_WITHDRAW, /* T if cache requested object withdrawal */
352 NR_FSCACHE_OBJECT_EVENTS
353};
354
355#define FSCACHE_OBJECT_EVENTS_MASK ((1UL << NR_FSCACHE_OBJECT_EVENTS) - 1)
356
357/*
309 * on-disk cache file or index handle 358 * on-disk cache file or index handle
310 */ 359 */
311struct fscache_object { 360struct fscache_object {
@@ -317,6 +366,7 @@ struct fscache_object {
317 /* active states */ 366 /* active states */
318 FSCACHE_OBJECT_AVAILABLE, /* cleaning up object after creation */ 367 FSCACHE_OBJECT_AVAILABLE, /* cleaning up object after creation */
319 FSCACHE_OBJECT_ACTIVE, /* object is usable */ 368 FSCACHE_OBJECT_ACTIVE, /* object is usable */
369 FSCACHE_OBJECT_INVALIDATING, /* object is invalidating */
320 FSCACHE_OBJECT_UPDATING, /* object is updating */ 370 FSCACHE_OBJECT_UPDATING, /* object is updating */
321 371
322 /* terminal states */ 372 /* terminal states */
@@ -332,10 +382,10 @@ struct fscache_object {
332 382
333 int debug_id; /* debugging ID */ 383 int debug_id; /* debugging ID */
334 int n_children; /* number of child objects */ 384 int n_children; /* number of child objects */
335 int n_ops; /* number of ops outstanding on object */ 385 int n_ops; /* number of extant ops on object */
336 int n_obj_ops; /* number of object ops outstanding on object */ 386 int n_obj_ops; /* number of object ops outstanding on object */
337 int n_in_progress; /* number of ops in progress */ 387 int n_in_progress; /* number of ops in progress */
338 int n_exclusive; /* number of exclusive ops queued */ 388 int n_exclusive; /* number of exclusive ops queued or in progress */
339 atomic_t n_reads; /* number of read ops in progress */ 389 atomic_t n_reads; /* number of read ops in progress */
340 spinlock_t lock; /* state and operations lock */ 390 spinlock_t lock; /* state and operations lock */
341 391
@@ -343,14 +393,6 @@ struct fscache_object {
343 unsigned long event_mask; /* events this object is interested in */ 393 unsigned long event_mask; /* events this object is interested in */
344 unsigned long events; /* events to be processed by this object 394 unsigned long events; /* events to be processed by this object
345 * (order is important - using fls) */ 395 * (order is important - using fls) */
346#define FSCACHE_OBJECT_EV_REQUEUE 0 /* T if object should be requeued */
347#define FSCACHE_OBJECT_EV_UPDATE 1 /* T if object should be updated */
348#define FSCACHE_OBJECT_EV_CLEARED 2 /* T if accessors all gone */
349#define FSCACHE_OBJECT_EV_ERROR 3 /* T if fatal error occurred during processing */
350#define FSCACHE_OBJECT_EV_RELEASE 4 /* T if netfs requested object release */
351#define FSCACHE_OBJECT_EV_RETIRE 5 /* T if netfs requested object retirement */
352#define FSCACHE_OBJECT_EV_WITHDRAW 6 /* T if cache requested object withdrawal */
353#define FSCACHE_OBJECT_EVENTS_MASK 0x7f /* mask of all events*/
354 396
355 unsigned long flags; 397 unsigned long flags;
356#define FSCACHE_OBJECT_LOCK 0 /* T if object is busy being processed */ 398#define FSCACHE_OBJECT_LOCK 0 /* T if object is busy being processed */
@@ -504,6 +546,9 @@ extern void fscache_withdraw_cache(struct fscache_cache *cache);
504 546
505extern void fscache_io_error(struct fscache_cache *cache); 547extern void fscache_io_error(struct fscache_cache *cache);
506 548
549extern void fscache_mark_page_cached(struct fscache_retrieval *op,
550 struct page *page);
551
507extern void fscache_mark_pages_cached(struct fscache_retrieval *op, 552extern void fscache_mark_pages_cached(struct fscache_retrieval *op,
508 struct pagevec *pagevec); 553 struct pagevec *pagevec);
509 554
diff --git a/include/linux/fscache.h b/include/linux/fscache.h
index 9ec20dec3353..7a086235da4b 100644
--- a/include/linux/fscache.h
+++ b/include/linux/fscache.h
@@ -135,14 +135,14 @@ struct fscache_cookie_def {
135 */ 135 */
136 void (*put_context)(void *cookie_netfs_data, void *context); 136 void (*put_context)(void *cookie_netfs_data, void *context);
137 137
138 /* indicate pages that now have cache metadata retained 138 /* indicate page that now have cache metadata retained
139 * - this function should mark the specified pages as now being cached 139 * - this function should mark the specified page as now being cached
140 * - the pages will have been marked with PG_fscache before this is 140 * - the page will have been marked with PG_fscache before this is
141 * called, so this is optional 141 * called, so this is optional
142 */ 142 */
143 void (*mark_pages_cached)(void *cookie_netfs_data, 143 void (*mark_page_cached)(void *cookie_netfs_data,
144 struct address_space *mapping, 144 struct address_space *mapping,
145 struct pagevec *cached_pvec); 145 struct page *page);
146 146
147 /* indicate the cookie is no longer cached 147 /* indicate the cookie is no longer cached
148 * - this function is called when the backing store currently caching 148 * - this function is called when the backing store currently caching
@@ -185,6 +185,8 @@ extern struct fscache_cookie *__fscache_acquire_cookie(
185extern void __fscache_relinquish_cookie(struct fscache_cookie *, int); 185extern void __fscache_relinquish_cookie(struct fscache_cookie *, int);
186extern void __fscache_update_cookie(struct fscache_cookie *); 186extern void __fscache_update_cookie(struct fscache_cookie *);
187extern int __fscache_attr_changed(struct fscache_cookie *); 187extern int __fscache_attr_changed(struct fscache_cookie *);
188extern void __fscache_invalidate(struct fscache_cookie *);
189extern void __fscache_wait_on_invalidate(struct fscache_cookie *);
188extern int __fscache_read_or_alloc_page(struct fscache_cookie *, 190extern int __fscache_read_or_alloc_page(struct fscache_cookie *,
189 struct page *, 191 struct page *,
190 fscache_rw_complete_t, 192 fscache_rw_complete_t,
@@ -390,6 +392,42 @@ int fscache_attr_changed(struct fscache_cookie *cookie)
390} 392}
391 393
392/** 394/**
395 * fscache_invalidate - Notify cache that an object needs invalidation
396 * @cookie: The cookie representing the cache object
397 *
398 * Notify the cache that an object is needs to be invalidated and that it
399 * should abort any retrievals or stores it is doing on the cache. The object
400 * is then marked non-caching until such time as the invalidation is complete.
401 *
402 * This can be called with spinlocks held.
403 *
404 * See Documentation/filesystems/caching/netfs-api.txt for a complete
405 * description.
406 */
407static inline
408void fscache_invalidate(struct fscache_cookie *cookie)
409{
410 if (fscache_cookie_valid(cookie))
411 __fscache_invalidate(cookie);
412}
413
414/**
415 * fscache_wait_on_invalidate - Wait for invalidation to complete
416 * @cookie: The cookie representing the cache object
417 *
418 * Wait for the invalidation of an object to complete.
419 *
420 * See Documentation/filesystems/caching/netfs-api.txt for a complete
421 * description.
422 */
423static inline
424void fscache_wait_on_invalidate(struct fscache_cookie *cookie)
425{
426 if (fscache_cookie_valid(cookie))
427 __fscache_wait_on_invalidate(cookie);
428}
429
430/**
393 * fscache_reserve_space - Reserve data space for a cached object 431 * fscache_reserve_space - Reserve data space for a cached object
394 * @cookie: The cookie representing the cache object 432 * @cookie: The cookie representing the cache object
395 * @i_size: The amount of space to be reserved 433 * @i_size: The amount of space to be reserved
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h
index 63d966d5c2ea..d5b0910d4961 100644
--- a/include/linux/fsnotify_backend.h
+++ b/include/linux/fsnotify_backend.h
@@ -88,9 +88,10 @@ struct fsnotify_event_private_data;
88 * if the group is interested in this event. 88 * if the group is interested in this event.
89 * handle_event - main call for a group to handle an fs event 89 * handle_event - main call for a group to handle an fs event
90 * free_group_priv - called when a group refcnt hits 0 to clean up the private union 90 * free_group_priv - called when a group refcnt hits 0 to clean up the private union
91 * freeing-mark - this means that a mark has been flagged to die when everything 91 * freeing_mark - called when a mark is being destroyed for some reason. The group
92 * finishes using it. The function is supplied with what must be a 92 * MUST be holding a reference on each mark and that reference must be
93 * valid group and inode to use to clean up. 93 * dropped in this function. inotify uses this function to send
94 * userspace messages that marks have been removed.
94 */ 95 */
95struct fsnotify_ops { 96struct fsnotify_ops {
96 bool (*should_send_event)(struct fsnotify_group *group, struct inode *inode, 97 bool (*should_send_event)(struct fsnotify_group *group, struct inode *inode,
@@ -141,12 +142,14 @@ struct fsnotify_group {
141 unsigned int priority; 142 unsigned int priority;
142 143
143 /* stores all fastpath marks assoc with this group so they can be cleaned on unregister */ 144 /* stores all fastpath marks assoc with this group so they can be cleaned on unregister */
144 spinlock_t mark_lock; /* protect marks_list */ 145 struct mutex mark_mutex; /* protect marks_list */
145 atomic_t num_marks; /* 1 for each mark and 1 for not being 146 atomic_t num_marks; /* 1 for each mark and 1 for not being
146 * past the point of no return when freeing 147 * past the point of no return when freeing
147 * a group */ 148 * a group */
148 struct list_head marks_list; /* all inode marks for this group */ 149 struct list_head marks_list; /* all inode marks for this group */
149 150
151 struct fasync_struct *fsn_fa; /* async notification */
152
150 /* groups can define private fields here or use the void *private */ 153 /* groups can define private fields here or use the void *private */
151 union { 154 union {
152 void *private; 155 void *private;
@@ -155,7 +158,6 @@ struct fsnotify_group {
155 spinlock_t idr_lock; 158 spinlock_t idr_lock;
156 struct idr idr; 159 struct idr idr;
157 u32 last_wd; 160 u32 last_wd;
158 struct fasync_struct *fa; /* async notification */
159 struct user_struct *user; 161 struct user_struct *user;
160 } inotify_data; 162 } inotify_data;
161#endif 163#endif
@@ -287,7 +289,6 @@ struct fsnotify_mark {
287 struct fsnotify_inode_mark i; 289 struct fsnotify_inode_mark i;
288 struct fsnotify_vfsmount_mark m; 290 struct fsnotify_vfsmount_mark m;
289 }; 291 };
290 struct list_head free_g_list; /* tmp list used when freeing this mark */
291 __u32 ignored_mask; /* events types to ignore */ 292 __u32 ignored_mask; /* events types to ignore */
292#define FSNOTIFY_MARK_FLAG_INODE 0x01 293#define FSNOTIFY_MARK_FLAG_INODE 0x01
293#define FSNOTIFY_MARK_FLAG_VFSMOUNT 0x02 294#define FSNOTIFY_MARK_FLAG_VFSMOUNT 0x02
@@ -360,11 +361,16 @@ static inline void __fsnotify_d_instantiate(struct dentry *dentry, struct inode
360 361
361/* called from fsnotify listeners, such as fanotify or dnotify */ 362/* called from fsnotify listeners, such as fanotify or dnotify */
362 363
363/* get a reference to an existing or create a new group */ 364/* create a new group */
364extern struct fsnotify_group *fsnotify_alloc_group(const struct fsnotify_ops *ops); 365extern struct fsnotify_group *fsnotify_alloc_group(const struct fsnotify_ops *ops);
366/* get reference to a group */
367extern void fsnotify_get_group(struct fsnotify_group *group);
365/* drop reference on a group from fsnotify_alloc_group */ 368/* drop reference on a group from fsnotify_alloc_group */
366extern void fsnotify_put_group(struct fsnotify_group *group); 369extern void fsnotify_put_group(struct fsnotify_group *group);
367 370/* destroy group */
371extern void fsnotify_destroy_group(struct fsnotify_group *group);
372/* fasync handler function */
373extern int fsnotify_fasync(int fd, struct file *file, int on);
368/* take a reference to an event */ 374/* take a reference to an event */
369extern void fsnotify_get_event(struct fsnotify_event *event); 375extern void fsnotify_get_event(struct fsnotify_event *event);
370extern void fsnotify_put_event(struct fsnotify_event *event); 376extern void fsnotify_put_event(struct fsnotify_event *event);
@@ -405,8 +411,13 @@ extern void fsnotify_set_mark_mask_locked(struct fsnotify_mark *mark, __u32 mask
405/* attach the mark to both the group and the inode */ 411/* attach the mark to both the group and the inode */
406extern int fsnotify_add_mark(struct fsnotify_mark *mark, struct fsnotify_group *group, 412extern int fsnotify_add_mark(struct fsnotify_mark *mark, struct fsnotify_group *group,
407 struct inode *inode, struct vfsmount *mnt, int allow_dups); 413 struct inode *inode, struct vfsmount *mnt, int allow_dups);
408/* given a mark, flag it to be freed when all references are dropped */ 414extern int fsnotify_add_mark_locked(struct fsnotify_mark *mark, struct fsnotify_group *group,
409extern void fsnotify_destroy_mark(struct fsnotify_mark *mark); 415 struct inode *inode, struct vfsmount *mnt, int allow_dups);
416/* given a group and a mark, flag mark to be freed when all references are dropped */
417extern void fsnotify_destroy_mark(struct fsnotify_mark *mark,
418 struct fsnotify_group *group);
419extern void fsnotify_destroy_mark_locked(struct fsnotify_mark *mark,
420 struct fsnotify_group *group);
410/* run all the marks in a group, and clear all of the vfsmount marks */ 421/* run all the marks in a group, and clear all of the vfsmount marks */
411extern void fsnotify_clear_vfsmount_marks_by_group(struct fsnotify_group *group); 422extern void fsnotify_clear_vfsmount_marks_by_group(struct fsnotify_group *group);
412/* run all the marks in a group, and clear all of the inode marks */ 423/* run all the marks in a group, and clear all of the inode marks */
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index d140e8fb075f..c566927efcbd 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -77,13 +77,15 @@
77 77
78/* 78/*
79 * Divide positive or negative dividend by positive divisor and round 79 * Divide positive or negative dividend by positive divisor and round
80 * to closest integer. Result is undefined for negative divisors. 80 * to closest integer. Result is undefined for negative divisors and
81 * for negative dividends if the divisor variable type is unsigned.
81 */ 82 */
82#define DIV_ROUND_CLOSEST(x, divisor)( \ 83#define DIV_ROUND_CLOSEST(x, divisor)( \
83{ \ 84{ \
84 typeof(x) __x = x; \ 85 typeof(x) __x = x; \
85 typeof(divisor) __d = divisor; \ 86 typeof(divisor) __d = divisor; \
86 (((typeof(x))-1) > 0 || (__x) > 0) ? \ 87 (((typeof(x))-1) > 0 || \
88 ((typeof(divisor))-1) > 0 || (__x) > 0) ? \
87 (((__x) + ((__d) / 2)) / (__d)) : \ 89 (((__x) + ((__d) / 2)) / (__d)) : \
88 (((__x) - ((__d) / 2)) / (__d)); \ 90 (((__x) - ((__d) / 2)) / (__d)); \
89} \ 91} \
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 21821da2abfd..20ea939c22a6 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -625,6 +625,7 @@ struct mlx4_dev {
625 u8 rev_id; 625 u8 rev_id;
626 char board_id[MLX4_BOARD_ID_LEN]; 626 char board_id[MLX4_BOARD_ID_LEN];
627 int num_vfs; 627 int num_vfs;
628 int oper_log_mgm_entry_size;
628 u64 regid_promisc_array[MLX4_MAX_PORTS + 1]; 629 u64 regid_promisc_array[MLX4_MAX_PORTS + 1];
629 u64 regid_allmulti_array[MLX4_MAX_PORTS + 1]; 630 u64 regid_allmulti_array[MLX4_MAX_PORTS + 1];
630}; 631};
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 7f4f906190bd..63204078f72b 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1007,7 +1007,6 @@ static inline void unmap_shared_mapping_range(struct address_space *mapping,
1007 1007
1008extern void truncate_pagecache(struct inode *inode, loff_t old, loff_t new); 1008extern void truncate_pagecache(struct inode *inode, loff_t old, loff_t new);
1009extern void truncate_setsize(struct inode *inode, loff_t newsize); 1009extern void truncate_setsize(struct inode *inode, loff_t newsize);
1010extern int vmtruncate(struct inode *inode, loff_t offset);
1011void truncate_pagecache_range(struct inode *inode, loff_t offset, loff_t end); 1010void truncate_pagecache_range(struct inode *inode, loff_t offset, loff_t end);
1012int truncate_inode_page(struct address_space *mapping, struct page *page); 1011int truncate_inode_page(struct address_space *mapping, struct page *page);
1013int generic_error_remove_page(struct address_space *mapping, struct page *page); 1012int generic_error_remove_page(struct address_space *mapping, struct page *page);
diff --git a/include/linux/namei.h b/include/linux/namei.h
index 4bf19d8174ed..e998c030061d 100644
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -65,8 +65,8 @@ extern int user_path_at_empty(int, const char __user *, unsigned, struct path *,
65 65
66extern int kern_path(const char *, unsigned, struct path *); 66extern int kern_path(const char *, unsigned, struct path *);
67 67
68extern struct dentry *kern_path_create(int, const char *, struct path *, int); 68extern struct dentry *kern_path_create(int, const char *, struct path *, unsigned int);
69extern struct dentry *user_path_create(int, const char __user *, struct path *, int); 69extern struct dentry *user_path_create(int, const char __user *, struct path *, unsigned int);
70extern void done_path_create(struct path *, struct dentry *); 70extern void done_path_create(struct path *, struct dentry *);
71extern struct dentry *kern_path_locked(const char *, struct path *); 71extern struct dentry *kern_path_locked(const char *, struct path *);
72extern int vfs_path_lookup(struct dentry *, struct vfsmount *, 72extern int vfs_path_lookup(struct dentry *, struct vfsmount *,
@@ -98,4 +98,20 @@ static inline void nd_terminate_link(void *name, size_t len, size_t maxlen)
98 ((char *) name)[min(len, maxlen)] = '\0'; 98 ((char *) name)[min(len, maxlen)] = '\0';
99} 99}
100 100
101/**
102 * retry_estale - determine whether the caller should retry an operation
103 * @error: the error that would currently be returned
104 * @flags: flags being used for next lookup attempt
105 *
106 * Check to see if the error code was -ESTALE, and then determine whether
107 * to retry the call based on whether "flags" already has LOOKUP_REVAL set.
108 *
109 * Returns true if the caller should try the operation again.
110 */
111static inline bool
112retry_estale(const long error, const unsigned int flags)
113{
114 return error == -ESTALE && !(flags & LOOKUP_REVAL);
115}
116
101#endif /* _LINUX_NAMEI_H */ 117#endif /* _LINUX_NAMEI_H */
diff --git a/include/linux/platform_data/iommu-omap.h b/include/linux/platform_data/iommu-omap.h
index c677b9f2fefa..5b429c43a297 100644
--- a/include/linux/platform_data/iommu-omap.h
+++ b/include/linux/platform_data/iommu-omap.h
@@ -10,6 +10,8 @@
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11 */ 11 */
12 12
13#include <linux/platform_device.h>
14
13#define MMU_REG_SIZE 256 15#define MMU_REG_SIZE 256
14 16
15/** 17/**
@@ -42,8 +44,11 @@ struct omap_mmu_dev_attr {
42 44
43struct iommu_platform_data { 45struct iommu_platform_data {
44 const char *name; 46 const char *name;
45 const char *clk_name; 47 const char *reset_name;
46 const int nr_tlb_entries; 48 int nr_tlb_entries;
47 u32 da_start; 49 u32 da_start;
48 u32 da_end; 50 u32 da_end;
51
52 int (*assert_reset)(struct platform_device *pdev, const char *name);
53 int (*deassert_reset)(struct platform_device *pdev, const char *name);
49}; 54};
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index addfbe7c180e..1693775ecfe8 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
@@ -344,6 +344,10 @@ static inline void user_single_step_siginfo(struct task_struct *tsk,
344#define signal_pt_regs() task_pt_regs(current) 344#define signal_pt_regs() task_pt_regs(current)
345#endif 345#endif
346 346
347#ifndef current_user_stack_pointer
348#define current_user_stack_pointer() user_stack_pointer(current_pt_regs())
349#endif
350
347extern int task_current_syscall(struct task_struct *target, long *callno, 351extern int task_current_syscall(struct task_struct *target, long *callno,
348 unsigned long args[6], unsigned int maxargs, 352 unsigned long args[6], unsigned int maxargs,
349 unsigned long *sp, unsigned long *pc); 353 unsigned long *sp, unsigned long *pc);
diff --git a/include/linux/sched.h b/include/linux/sched.h
index f712465b05c5..206bb089c06b 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -2353,9 +2353,7 @@ extern int do_execve(const char *,
2353 const char __user * const __user *); 2353 const char __user * const __user *);
2354extern long do_fork(unsigned long, unsigned long, unsigned long, int __user *, int __user *); 2354extern long do_fork(unsigned long, unsigned long, unsigned long, int __user *, int __user *);
2355struct task_struct *fork_idle(int); 2355struct task_struct *fork_idle(int);
2356#ifdef CONFIG_GENERIC_KERNEL_THREAD
2357extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); 2356extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
2358#endif
2359 2357
2360extern void set_task_comm(struct task_struct *tsk, char *from); 2358extern void set_task_comm(struct task_struct *tsk, char *from);
2361extern char *get_task_comm(char *to, struct task_struct *tsk); 2359extern char *get_task_comm(char *to, struct task_struct *tsk);
diff --git a/include/linux/signal.h b/include/linux/signal.h
index e19a011b43b7..0a89ffc48466 100644
--- a/include/linux/signal.h
+++ b/include/linux/signal.h
@@ -385,4 +385,7 @@ int unhandled_signal(struct task_struct *tsk, int sig);
385 385
386void signals_init(void); 386void signals_init(void);
387 387
388int restore_altstack(const stack_t __user *);
389int __save_altstack(stack_t __user *, unsigned long);
390
388#endif /* _LINUX_SIGNAL_H */ 391#endif /* _LINUX_SIGNAL_H */
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h
index f792794f6634..5dc9ee4d616e 100644
--- a/include/linux/sunrpc/cache.h
+++ b/include/linux/sunrpc/cache.h
@@ -217,6 +217,8 @@ extern int qword_get(char **bpp, char *dest, int bufsize);
217static inline int get_int(char **bpp, int *anint) 217static inline int get_int(char **bpp, int *anint)
218{ 218{
219 char buf[50]; 219 char buf[50];
220 char *ep;
221 int rv;
220 int len = qword_get(bpp, buf, sizeof(buf)); 222 int len = qword_get(bpp, buf, sizeof(buf));
221 223
222 if (len < 0) 224 if (len < 0)
@@ -224,9 +226,11 @@ static inline int get_int(char **bpp, int *anint)
224 if (len == 0) 226 if (len == 0)
225 return -ENOENT; 227 return -ENOENT;
226 228
227 if (kstrtoint(buf, 0, anint)) 229 rv = simple_strtol(buf, &ep, 0);
230 if (*ep)
228 return -EINVAL; 231 return -EINVAL;
229 232
233 *anint = rv;
230 return 0; 234 return 0;
231} 235}
232 236
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index d83db800fe02..676ddf53b3ee 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -243,6 +243,7 @@ struct svc_rqst {
243 struct page * rq_pages[RPCSVC_MAXPAGES]; 243 struct page * rq_pages[RPCSVC_MAXPAGES];
244 struct page * *rq_respages; /* points into rq_pages */ 244 struct page * *rq_respages; /* points into rq_pages */
245 int rq_resused; /* number of pages used for result */ 245 int rq_resused; /* number of pages used for result */
246 struct page * *rq_next_page; /* next reply page to use */
246 247
247 struct kvec rq_vec[RPCSVC_MAXPAGES]; /* generally useful.. */ 248 struct kvec rq_vec[RPCSVC_MAXPAGES]; /* generally useful.. */
248 249
@@ -338,9 +339,8 @@ xdr_ressize_check(struct svc_rqst *rqstp, __be32 *p)
338 339
339static inline void svc_free_res_pages(struct svc_rqst *rqstp) 340static inline void svc_free_res_pages(struct svc_rqst *rqstp)
340{ 341{
341 while (rqstp->rq_resused) { 342 while (rqstp->rq_next_page != rqstp->rq_respages) {
342 struct page **pp = (rqstp->rq_respages + 343 struct page **pp = --rqstp->rq_next_page;
343 --rqstp->rq_resused);
344 if (*pp) { 344 if (*pp) {
345 put_page(*pp); 345 put_page(*pp);
346 *pp = NULL; 346 *pp = NULL;
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h
index 92ad02f0dcc0..62fd1b756e99 100644
--- a/include/linux/sunrpc/svcsock.h
+++ b/include/linux/sunrpc/svcsock.h
@@ -26,11 +26,28 @@ struct svc_sock {
26 void (*sk_owspace)(struct sock *); 26 void (*sk_owspace)(struct sock *);
27 27
28 /* private TCP part */ 28 /* private TCP part */
29 u32 sk_reclen; /* length of record */ 29 /* On-the-wire fragment header: */
30 u32 sk_tcplen; /* current read length */ 30 __be32 sk_reclen;
31 /* As we receive a record, this includes the length received so
32 * far (including the fragment header): */
33 u32 sk_tcplen;
34 /* Total length of the data (not including fragment headers)
35 * received so far in the fragments making up this rpc: */
36 u32 sk_datalen;
37
31 struct page * sk_pages[RPCSVC_MAXPAGES]; /* received data */ 38 struct page * sk_pages[RPCSVC_MAXPAGES]; /* received data */
32}; 39};
33 40
41static inline u32 svc_sock_reclen(struct svc_sock *svsk)
42{
43 return ntohl(svsk->sk_reclen) & RPC_FRAGMENT_SIZE_MASK;
44}
45
46static inline u32 svc_sock_final_rec(struct svc_sock *svsk)
47{
48 return ntohl(svsk->sk_reclen) & RPC_LAST_STREAM_FRAGMENT;
49}
50
34/* 51/*
35 * Function prototypes. 52 * Function prototypes.
36 */ 53 */
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 6caee34bf8a2..45e2db270255 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -63,6 +63,7 @@ struct getcpu_cache;
63struct old_linux_dirent; 63struct old_linux_dirent;
64struct perf_event_attr; 64struct perf_event_attr;
65struct file_handle; 65struct file_handle;
66struct sigaltstack;
66 67
67#include <linux/types.h> 68#include <linux/types.h>
68#include <linux/aio_abi.h> 69#include <linux/aio_abi.h>
@@ -299,6 +300,11 @@ asmlinkage long sys_personality(unsigned int personality);
299asmlinkage long sys_sigpending(old_sigset_t __user *set); 300asmlinkage long sys_sigpending(old_sigset_t __user *set);
300asmlinkage long sys_sigprocmask(int how, old_sigset_t __user *set, 301asmlinkage long sys_sigprocmask(int how, old_sigset_t __user *set,
301 old_sigset_t __user *oset); 302 old_sigset_t __user *oset);
303#ifdef CONFIG_GENERIC_SIGALTSTACK
304asmlinkage long sys_sigaltstack(const struct sigaltstack __user *uss,
305 struct sigaltstack __user *uoss);
306#endif
307
302asmlinkage long sys_getitimer(int which, struct itimerval __user *value); 308asmlinkage long sys_getitimer(int which, struct itimerval __user *value);
303asmlinkage long sys_setitimer(int which, 309asmlinkage long sys_setitimer(int which,
304 struct itimerval __user *value, 310 struct itimerval __user *value,
@@ -827,15 +833,6 @@ asmlinkage long sys_fanotify_mark(int fanotify_fd, unsigned int flags,
827 const char __user *pathname); 833 const char __user *pathname);
828asmlinkage long sys_syncfs(int fd); 834asmlinkage long sys_syncfs(int fd);
829 835
830#ifndef CONFIG_GENERIC_KERNEL_EXECVE
831int kernel_execve(const char *filename, const char *const argv[], const char *const envp[]);
832#else
833#define kernel_execve(filename, argv, envp) \
834 do_execve(filename, \
835 (const char __user *const __user *)argv, \
836 (const char __user *const __user *)envp)
837#endif
838
839asmlinkage long sys_fork(void); 836asmlinkage long sys_fork(void);
840asmlinkage long sys_vfork(void); 837asmlinkage long sys_vfork(void);
841#ifdef CONFIG_CLONE_BACKWARDS 838#ifdef CONFIG_CLONE_BACKWARDS
diff --git a/include/uapi/asm-generic/signal.h b/include/uapi/asm-generic/signal.h
index 0a78028984de..6fae30fd16ab 100644
--- a/include/uapi/asm-generic/signal.h
+++ b/include/uapi/asm-generic/signal.h
@@ -80,12 +80,6 @@
80 * SA_RESTORER 0x04000000 80 * SA_RESTORER 0x04000000
81 */ 81 */
82 82
83/*
84 * sigaltstack controls
85 */
86#define SS_ONSTACK 1
87#define SS_DISABLE 2
88
89#define MINSIGSTKSZ 2048 83#define MINSIGSTKSZ 2048
90#define SIGSTKSZ 8192 84#define SIGSTKSZ 8192
91 85
diff --git a/include/uapi/linux/dm-ioctl.h b/include/uapi/linux/dm-ioctl.h
index 91e3a360f611..539b179b349c 100644
--- a/include/uapi/linux/dm-ioctl.h
+++ b/include/uapi/linux/dm-ioctl.h
@@ -268,8 +268,8 @@ enum {
268 268
269#define DM_VERSION_MAJOR 4 269#define DM_VERSION_MAJOR 4
270#define DM_VERSION_MINOR 23 270#define DM_VERSION_MINOR 23
271#define DM_VERSION_PATCHLEVEL 0 271#define DM_VERSION_PATCHLEVEL 1
272#define DM_VERSION_EXTRA "-ioctl (2012-07-25)" 272#define DM_VERSION_EXTRA "-ioctl (2012-12-18)"
273 273
274/* Status bits */ 274/* Status bits */
275#define DM_READONLY_FLAG (1 << 0) /* In/Out */ 275#define DM_READONLY_FLAG (1 << 0) /* In/Out */
diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h
index 12f68c7ceba6..873e086ce3a1 100644
--- a/include/uapi/linux/magic.h
+++ b/include/uapi/linux/magic.h
@@ -23,6 +23,7 @@
23#define EXT4_SUPER_MAGIC 0xEF53 23#define EXT4_SUPER_MAGIC 0xEF53
24#define BTRFS_SUPER_MAGIC 0x9123683E 24#define BTRFS_SUPER_MAGIC 0x9123683E
25#define NILFS_SUPER_MAGIC 0x3434 25#define NILFS_SUPER_MAGIC 0x3434
26#define F2FS_SUPER_MAGIC 0xF2F52010
26#define HPFS_SUPER_MAGIC 0xf995e849 27#define HPFS_SUPER_MAGIC 0xf995e849
27#define ISOFS_SUPER_MAGIC 0x9660 28#define ISOFS_SUPER_MAGIC 0x9660
28#define JFFS2_SUPER_MAGIC 0x72b6 29#define JFFS2_SUPER_MAGIC 0x72b6
diff --git a/include/uapi/linux/signal.h b/include/uapi/linux/signal.h
index dff452ed6d00..e1bd50c29ded 100644
--- a/include/uapi/linux/signal.h
+++ b/include/uapi/linux/signal.h
@@ -4,5 +4,7 @@
4#include <asm/signal.h> 4#include <asm/signal.h>
5#include <asm/siginfo.h> 5#include <asm/siginfo.h>
6 6
7#define SS_ONSTACK 1
8#define SS_DISABLE 2
7 9
8#endif /* _UAPI_LINUX_SIGNAL_H */ 10#endif /* _UAPI_LINUX_SIGNAL_H */