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