kernel: generic: add 3.10-rc1 support
[openwrt/svn-archive/archive.git] / target / linux / generic / patches-3.10 / 950-vm_exports.patch
1 --- a/mm/shmem.c
2 +++ b/mm/shmem.c
3 @@ -2889,6 +2889,15 @@ static struct dentry_operations anon_ops
4 .d_dname = shmem_dname
5 };
6
7 +void shmem_set_file(struct vm_area_struct *vma, struct file *file)
8 +{
9 + if (vma->vm_file)
10 + fput(vma->vm_file);
11 + vma->vm_file = file;
12 + vma->vm_ops = &shmem_vm_ops;
13 +}
14 +EXPORT_SYMBOL_GPL(shmem_set_file);
15 +
16 /**
17 * shmem_file_setup - get an unlinked file living in tmpfs
18 * @name: name for dentry (to be seen in /proc/<pid>/maps
19 @@ -2962,11 +2971,8 @@ int shmem_zero_setup(struct vm_area_stru
20 file = shmem_file_setup("dev/zero", size, vma->vm_flags);
21 if (IS_ERR(file))
22 return PTR_ERR(file);
23 + shmem_set_file(vma, file);
24
25 - if (vma->vm_file)
26 - fput(vma->vm_file);
27 - vma->vm_file = file;
28 - vma->vm_ops = &shmem_vm_ops;
29 return 0;
30 }
31
32 --- a/fs/file.c
33 +++ b/fs/file.c
34 @@ -218,6 +218,7 @@ static inline void __set_open_fd(int fd,
35 {
36 __set_bit(fd, fdt->open_fds);
37 }
38 +EXPORT_SYMBOL_GPL(expand_files);
39
40 static inline void __clear_open_fd(int fd, struct fdtable *fdt)
41 {
42 --- a/kernel/exit.c
43 +++ b/kernel/exit.c
44 @@ -501,6 +501,8 @@ static void exit_mm(struct task_struct *
45 mm_update_next_owner(mm);
46 mmput(mm);
47 }
48 +EXPORT_SYMBOL_GPL(get_files_struct);
49 +EXPORT_SYMBOL_GPL(put_files_struct);
50
51 /*
52 * When we die, we re-parent all our children, and try to:
53 --- a/kernel/sched/core.c
54 +++ b/kernel/sched/core.c
55 @@ -3694,6 +3694,7 @@ int can_nice(const struct task_struct *p
56 return (nice_rlim <= task_rlimit(p, RLIMIT_NICE) ||
57 capable(CAP_SYS_NICE));
58 }
59 +EXPORT_SYMBOL_GPL(can_nice);
60
61 #ifdef __ARCH_WANT_SYS_NICE
62
63 --- a/mm/memory.c
64 +++ b/mm/memory.c
65 @@ -1413,6 +1413,7 @@ void zap_page_range(struct vm_area_struc
66 mmu_notifier_invalidate_range_end(mm, start, end);
67 tlb_finish_mmu(&tlb, start, end);
68 }
69 +EXPORT_SYMBOL_GPL(zap_page_range);
70
71 /**
72 * zap_page_range_single - remove user pages in a given range
73 --- a/mm/vmalloc.c
74 +++ b/mm/vmalloc.c
75 @@ -1281,6 +1281,7 @@ void unmap_kernel_range(unsigned long ad
76 vunmap_page_range(addr, end);
77 flush_tlb_kernel_range(addr, end);
78 }
79 +EXPORT_SYMBOL_GPL(unmap_kernel_range);
80
81 int map_vm_area(struct vm_struct *area, pgprot_t prot, struct page ***pages)
82 {
83 @@ -1412,6 +1413,7 @@ struct vm_struct *get_vm_area(unsigned l
84 NUMA_NO_NODE, GFP_KERNEL,
85 __builtin_return_address(0));
86 }
87 +EXPORT_SYMBOL_GPL(get_vm_area);
88
89 struct vm_struct *get_vm_area_caller(unsigned long size, unsigned long flags,
90 const void *caller)
91 --- a/include/linux/shmem_fs.h
92 +++ b/include/linux/shmem_fs.h
93 @@ -47,6 +47,8 @@ extern int shmem_init(void);
94 extern int shmem_fill_super(struct super_block *sb, void *data, int silent);
95 extern struct file *shmem_file_setup(const char *name,
96 loff_t size, unsigned long flags);
97 +
98 +extern void shmem_set_file(struct vm_area_struct *vma, struct file *file);
99 extern int shmem_zero_setup(struct vm_area_struct *);
100 extern int shmem_lock(struct file *file, int lock, struct user_struct *user);
101 extern void shmem_unlock_mapping(struct address_space *mapping);