Update 2.6.38 to 2.6.38.2
[openwrt/openwrt.git] / target / linux / generic / patches-2.6.38 / 980-vm_exports.patch
1 Index: linux-2.6.38.2/mm/shmem.c
2 ===================================================================
3 --- linux-2.6.38.2.orig/mm/shmem.c 2011-03-27 20:37:20.000000000 +0200
4 +++ linux-2.6.38.2/mm/shmem.c 2011-03-28 17:18:35.142293910 +0200
5 @@ -30,6 +30,7 @@
6 #include <linux/module.h>
7 #include <linux/percpu_counter.h>
8 #include <linux/swap.h>
9 +#include <linux/ima.h>
10
11 static struct vfsmount *shm_mnt;
12
13 @@ -2710,6 +2711,16 @@ out:
14
15 /* common code */
16
17 +void shmem_set_file(struct vm_area_struct *vma, struct file *file)
18 +{
19 + ima_counts_get(file);
20 + if (vma->vm_file)
21 + fput(vma->vm_file);
22 + vma->vm_file = file;
23 + vma->vm_ops = &shmem_vm_ops;
24 +}
25 +EXPORT_SYMBOL_GPL(shmem_set_file);
26 +
27 /**
28 * shmem_file_setup - get an unlinked file living in tmpfs
29 * @name: name for dentry (to be seen in /proc/<pid>/maps
30 @@ -2787,10 +2798,7 @@ int shmem_zero_setup(struct vm_area_stru
31 if (IS_ERR(file))
32 return PTR_ERR(file);
33
34 - if (vma->vm_file)
35 - fput(vma->vm_file);
36 - vma->vm_file = file;
37 - vma->vm_ops = &shmem_vm_ops;
38 + shmem_set_file(vma, file);
39 vma->vm_flags |= VM_CAN_NONLINEAR;
40 return 0;
41 }
42 Index: linux-2.6.38.2/fs/file.c
43 ===================================================================
44 --- linux-2.6.38.2.orig/fs/file.c 2011-03-27 20:37:20.000000000 +0200
45 +++ linux-2.6.38.2/fs/file.c 2011-03-28 17:18:24.755353654 +0200
46 @@ -264,6 +264,7 @@ int expand_files(struct files_struct *fi
47 /* All good, so we try */
48 return expand_fdtable(files, nr);
49 }
50 +EXPORT_SYMBOL_GPL(expand_files);
51
52 static int count_open_files(struct fdtable *fdt)
53 {
54 Index: linux-2.6.38.2/kernel/exit.c
55 ===================================================================
56 --- linux-2.6.38.2.orig/kernel/exit.c 2011-03-27 20:37:20.000000000 +0200
57 +++ linux-2.6.38.2/kernel/exit.c 2011-03-28 17:18:24.755353654 +0200
58 @@ -513,6 +513,7 @@ struct files_struct *get_files_struct(st
59
60 return files;
61 }
62 +EXPORT_SYMBOL_GPL(get_files_struct);
63
64 void put_files_struct(struct files_struct *files)
65 {
66 @@ -534,6 +535,7 @@ void put_files_struct(struct files_struc
67 rcu_read_unlock();
68 }
69 }
70 +EXPORT_SYMBOL_GPL(put_files_struct);
71
72 void reset_files_struct(struct files_struct *files)
73 {
74 Index: linux-2.6.38.2/kernel/fork.c
75 ===================================================================
76 --- linux-2.6.38.2.orig/kernel/fork.c 2011-03-27 20:37:20.000000000 +0200
77 +++ linux-2.6.38.2/kernel/fork.c 2011-03-28 17:18:24.755353654 +0200
78 @@ -193,6 +193,7 @@ void __put_task_struct(struct task_struc
79 if (!profile_handoff_task(tsk))
80 free_task(tsk);
81 }
82 +EXPORT_SYMBOL_GPL(__put_task_struct);
83
84 /*
85 * macro override instead of weak attribute alias, to workaround
86 Index: linux-2.6.38.2/kernel/sched.c
87 ===================================================================
88 --- linux-2.6.38.2.orig/kernel/sched.c 2011-03-27 20:37:20.000000000 +0200
89 +++ linux-2.6.38.2/kernel/sched.c 2011-03-28 17:18:24.757353643 +0200
90 @@ -4641,6 +4641,7 @@ int can_nice(const struct task_struct *p
91 return (nice_rlim <= task_rlimit(p, RLIMIT_NICE) ||
92 capable(CAP_SYS_NICE));
93 }
94 +EXPORT_SYMBOL_GPL(can_nice);
95
96 #ifdef __ARCH_WANT_SYS_NICE
97
98 Index: linux-2.6.38.2/mm/memory.c
99 ===================================================================
100 --- linux-2.6.38.2.orig/mm/memory.c 2011-03-27 20:37:20.000000000 +0200
101 +++ linux-2.6.38.2/mm/memory.c 2011-03-28 17:18:24.757353643 +0200
102 @@ -1229,6 +1229,7 @@ unsigned long zap_page_range(struct vm_a
103 tlb_finish_mmu(tlb, address, end);
104 return end;
105 }
106 +EXPORT_SYMBOL_GPL(zap_page_range);
107
108 /**
109 * zap_vma_ptes - remove ptes mapping the vma
110 @@ -2692,6 +2693,7 @@ int vmtruncate_range(struct inode *inode
111
112 return 0;
113 }
114 +EXPORT_SYMBOL_GPL(vmtruncate_range);
115
116 /*
117 * We enter with non-exclusive mmap_sem (to exclude vma changes,
118 Index: linux-2.6.38.2/mm/vmalloc.c
119 ===================================================================
120 --- linux-2.6.38.2.orig/mm/vmalloc.c 2011-03-27 20:37:20.000000000 +0200
121 +++ linux-2.6.38.2/mm/vmalloc.c 2011-03-28 17:18:24.758353638 +0200
122 @@ -1193,6 +1193,7 @@ void unmap_kernel_range(unsigned long ad
123 vunmap_page_range(addr, end);
124 flush_tlb_kernel_range(addr, end);
125 }
126 +EXPORT_SYMBOL_GPL(unmap_kernel_range);
127
128 int map_vm_area(struct vm_struct *area, pgprot_t prot, struct page ***pages)
129 {
130 @@ -1308,6 +1309,7 @@ struct vm_struct *get_vm_area(unsigned l
131 return __get_vm_area_node(size, 1, flags, VMALLOC_START, VMALLOC_END,
132 -1, GFP_KERNEL, __builtin_return_address(0));
133 }
134 +EXPORT_SYMBOL_GPL(get_vm_area);
135
136 struct vm_struct *get_vm_area_caller(unsigned long size, unsigned long flags,
137 void *caller)
138 Index: linux-2.6.38.2/include/linux/mm.h
139 ===================================================================
140 --- linux-2.6.38.2.orig/include/linux/mm.h 2011-03-27 20:37:20.000000000 +0200
141 +++ linux-2.6.38.2/include/linux/mm.h 2011-03-28 17:18:24.758353638 +0200
142 @@ -863,6 +863,7 @@ extern void show_free_areas(void);
143
144 int shmem_lock(struct file *file, int lock, struct user_struct *user);
145 struct file *shmem_file_setup(const char *name, loff_t size, unsigned long flags);
146 +void shmem_set_file(struct vm_area_struct *vma, struct file *file);
147 int shmem_zero_setup(struct vm_area_struct *);
148
149 #ifndef CONFIG_MMU