Whamcloud - gitweb
LU-2955 tests: make replay-ost-single/8b SLOW for ZFS
[fs/lustre-release.git] / build / libcfs_cleanup.sed
1 #!/bin/sed -f
2
3 # Script to cleanup libcfs macros, it runs against the tree at build time.
4 # Migrate libcfs to emulate Linux kernel APIs.
5 # http://jira.whamcloud.com/browse/LU-1346
6
7
8 ################################################################################
9 # lock - spinlock, rw_semaphore, rwlock, completion, semaphore, mutex
10 #      - lock_kernel, unlock_kernel, lockdep
11
12 # spinlock
13 /typedef  *spinlock_t  *cfs_spinlock_t;/d
14 s/\bcfs_spinlock_t\b/spinlock_t/g
15 s/\bcfs_spin_lock_init\b/spin_lock_init/g
16 /#[ \t]*define[ \t]*\bspin_lock_init\b *( *\w* *)[ \t]*\bspin_lock_init\b *( *\w* *)/d
17 s/\bcfs_spin_lock\b/spin_lock/g
18 /#[ \t]*define[ \t]*\bspin_lock\b *( *\w* *)[ \t]*\bspin_lock\b *( *\w* *)/d
19 s/\bcfs_spin_lock_bh\b/spin_lock_bh/g
20 /#[ \t]*define[ \t]*\bspin_lock_bh\b *( *\w* *)[ \t]*\bspin_lock_bh\b *( *\w* *)/d
21 s/\bcfs_spin_lock_bh_init\b/spin_lock_bh_init/g
22 /#[ \t]*define[ \t]*\bspin_lock_bh_init\b *( *\w* *)[ \t]*\bspin_lock_bh_init\b *( *\w* *)/d
23 s/\bcfs_spin_unlock\b/spin_unlock/g
24 /#[ \t]*define[ \t]*\bspin_unlock\b *( *\w* *)[ \t]*\bspin_unlock\b *( *\w* *)/d
25 s/\bcfs_spin_unlock_bh\b/spin_unlock_bh/g
26 /#[ \t]*define[ \t]*\bspin_unlock_bh\b *( *\w* *)[ \t]*\bspin_unlock_bh\b *( *\w* *)/d
27 s/\bcfs_spin_trylock\b/spin_trylock/g
28 /#[ \t]*define[ \t]*\bspin_trylock\b *( *\w* *)[ \t]*\bspin_trylock\b *( *\w* *)/d
29 s/\bcfs_spin_is_locked\b/spin_is_locked/g
30 /#[ \t]*define[ \t]*\bspin_is_locked\b *( *\w* *)[ \t]*\bspin_is_locked\b *( *\w* *)/d
31
32 s/\bcfs_spin_lock_irq\b/spin_lock_irq/g
33 /#[ \t]*define[ \t]*\bspin_lock_irq\b *( *\w* *)[ \t]*\bspin_lock_irq\b *( *\w* *)/d
34 s/\bcfs_spin_unlock_irq\b/spin_unlock_irq/g
35 /#[ \t]*define[ \t]*\bspin_unlock_irq\b *( *\w* *)[ \t]*\bspin_unlock_irq\b *( *\w* *)/d
36 s/\bcfs_read_lock_irqsave\b/read_lock_irqsave/g
37 /#[ \t]*define[ \t]*\bread_lock_irqsave\b *( *\w* *, *\w* *)[ \t]*\bread_lock_irqsave\b *( *\w* *, *\w* *)/d
38 s/\bcfs_write_lock_irqsave\b/write_lock_irqsave/g
39 /#[ \t]*define[ \t]*\bwrite_lock_irqsave\b *( *\w* *, *\w* *)[ \t]*\bwrite_lock_irqsave\b *( *\w* *, *\w* *)/d
40 s/\bcfs_write_unlock_irqrestore\b/write_unlock_irqrestore/g
41 /#[ \t]*define[ \t]*\bwrite_unlock_irqrestore\b *( *\w* *, *\w* *)[ \t]*\bwrite_unlock_irqrestore\b *( *\w* *, *\w* *)/d
42 s/\bcfs_spin_lock_irqsave\b/spin_lock_irqsave/g
43 /#[ \t]*define[ \t]*\bspin_lock_irqsave\b *( *\w* *, *\w* *)[ \t]*\bspin_lock_irqsave\b *( *\w* *, *\w* *)/d
44 s/\bcfs_spin_unlock_irqrestore\b/spin_unlock_irqrestore/g
45 /#[ \t]*define[ \t]*\bspin_unlock_irqrestore\b *( *\w* *, *\w* *)[ \t]*\bspin_unlock_irqrestore\b *( *\w* *, *\w* *)/d
46 s/\bCFS_SPIN_LOCK_UNLOCKED\b/SPIN_LOCK_UNLOCKED/g
47 /#[ \t]*define[ \t]*\bSPIN_LOCK_UNLOCKED\b[ \t]*\bSPIN_LOCK_UNLOCKED\b/d
48
49 # rw_semaphore
50 s/\bcfs_semaphore\b/semaphore/g
51 s/\bcfs_rw_semaphore_t\b/struct rw_semaphore/g
52 s/\bcfs_init_rwsem\b/init_rwsem/g
53 /#[ \t]*define[ \t]*\binit_rwsem\b *( *\w* *)[ \t]*\binit_rwsem\b *( *\w* *)/d
54 s/\bcfs_down_read\b/down_read/g
55 /#[ \t]*define[ \t]*\bdown_read\b *( *\w* *)[ \t]*\bdown_read\b *( *\w* *)/d
56 s/\bcfs_down_read_trylock\b/down_read_trylock/g
57 /#[ \t]*define[ \t]*\bdown_read_trylock\b *( *\w* *)[ \t]*\bdown_read_trylock\b *( *\w* *)/d
58 s/\bcfs_up_read\b/up_read/g
59 /#[ \t]*define[ \t]*\bup_read\b *( *\w* *)[ \t]*\bup_read\b *( *\w* *)/d
60 s/\bcfs_down_write\b/down_write/g
61 /#[ \t]*define[ \t]*\bdown_write\b *( *\w* *)[ \t]*\bdown_write\b *( *\w* *)/d
62 s/\bcfs_down_write_trylock\b/down_write_trylock/g
63 /#[ \t]*define[ \t]*\bdown_write_trylock\b *( *\w* *)[ \t]*\bdown_write_trylock\b *( *\w* *)/d
64 s/\bcfs_up_write\b/up_write/g
65 /#[ \t]*define[ \t]*\bup_write\b *( *\w* *)[ \t]*\bup_write\b *( *\w* *)/d
66 s/\bcfs_fini_rwsem\b/fini_rwsem/g
67 s/\bCFS_DECLARE_RWSEM\b/DECLARE_RWSEM/g
68 /#[ \t]*define[ \t]*\bDECLARE_RWSEM\b *( *\w* *)[ \t]*\bDECLARE_RWSEM\b *( *\w* *)/d
69
70 #finish this with other atomics
71 #s/\bcfs_mt_atomic_t\b/atomic_t/g
72 #s/\bcfs_mt_atomic_read\b/atomic_read/g
73 #s/\bcfs_mt_atomic_set\b/atomic_set/g
74 #s/\bcfs_mt_atomic_dec_and_test\b/atomic_dec_and_test/g
75 #s/\bcfs_mt_atomic_inc\b/atomic_inc/g
76 #s/\bcfs_mt_atomic_dec\b/atomic_dec/g
77 #s/\bcfs_mt_atomic_add\b/atomic_add/g
78 #s/\bcfs_mt_atomic_sub\b/atomic_sub/g
79
80 # rwlock
81 /typedef  *rwlock_t  *cfs_rwlock_t;/d
82 s/\bcfs_rwlock_t\b/rwlock_t/g
83 s/\bcfs_rwlock_init\b/rwlock_init/g
84 /#[ \t]*define[ \t]*\brwlock_init\b *( *\w* *)[ \t]*\brwlock_init\b *( *\w* *)/d
85 s/\bcfs_read_lock\b/read_lock/g
86 /#[ \t]*define[ \t]*\bread_lock\b *( *\w* *)[ \t]*\bread_lock\b *( *\w* *)/d
87 s/\bcfs_read_unlock\b/read_unlock/g
88 /#[ \t]*define[ \t]*\bread_unlock\b *( *\w* *)[ \t]*\bread_unlock\b *( *\w* *)/d
89 s/\bcfs_read_unlock_irqrestore\b/read_unlock_irqrestore/g
90 #/#[ \t]*define[ \t]*\bread_unlock_irqrestore\b *( *\w* *)[ \t]*\bread_unlock_irqrestore\b *( *\w* *)/d
91 /#define read_unlock_irqrestore(lock,flags) \\/{N;d}
92 s/\bcfs_write_lock\b/write_lock/g
93 /#[ \t]*define[ \t]*\bwrite_lock\b *( *\w* *)[ \t]*\bwrite_lock\b *( *\w* *)/d
94 s/\bcfs_write_unlock\b/write_unlock/g
95 /#[ \t]*define[ \t]*\bwrite_unlock\b *( *\w* *)[ \t]*\bwrite_unlock\b *( *\w* *)/d
96 s/\bcfs_write_lock_bh\b/write_lock_bh/g
97 /#[ \t]*define[ \t]*\bwrite_lock_bh\b *( *\w* *)[ \t]*\bwrite_lock_bh\b *( *\w* *)/d
98 s/\bcfs_write_unlock_bh\b/write_unlock_bh/g
99 /#[ \t]*define[ \t]*\bwrite_unlock_bh\b *( *\w* *)[ \t]*\bwrite_unlock_bh\b *( *\w* *)/d
100 s/\bCFS_RW_LOCK_UNLOCKED\b/RW_LOCK_UNLOCKED/g
101 /#[ \t]*define[ \t]*\bRW_LOCK_UNLOCKED\b  *\bRW_LOCK_UNLOCKED\b */d
102
103 # completion
104 s/\bcfs_completion_t\b/struct completion/g
105 s/\bcfs_mt_completion_t\b/struct completion/g
106 s/\bcfs_mt_init_completion\b/init_completion/g
107 s/\bcfs_mt_wait_for_completion\b/wait_for_completion/g
108 s/\bcfs_mt_complete\b/complete/g
109 s/\bcfs_mt_fini_completion\b/fini_completion/g
110 s/\bCFS_DECLARE_COMPLETION\b/DECLARE_COMPLETION/g
111 /#[ \t]*define[ \t]*\bDECLARE_COMPLETION\b *( *\w* *)[ \t]*\bDECLARE_COMPLETION\b *( *\w* *)/d
112 s/\bCFS_INIT_COMPLETION\b/INIT_COMPLETION/g
113 /#[ \t]*define[ \t]*\bINIT_COMPLETION\b *( *\w* *)[ \t]*\bINIT_COMPLETION\b *( *\w* *)/d
114 s/\bCFS_COMPLETION_INITIALIZER\b/COMPLETION_INITIALIZER/g
115 /#[ \t]*define[ \t]*\bCOMPLETION_INITIALIZER\b *( *\w* *)[ \t]*\bCOMPLETION_INITIALIZER\b *( *\w* *)/d
116 s/\bcfs_init_completion\b/init_completion/g
117 /#[ \t]*define[ \t]*\binit_completion\b *( *\w* *)[ \t]*\binit_completion\b *( *\w* *)/d
118 s/\bcfs_complete\b/complete/g
119 /#[ \t]*define[ \t]*\bcomplete\b *( *\w* *)[ \t]*\bcomplete\b *( *\w* *)/d
120 s/\bcfs_wait_for_completion\b/wait_for_completion/g
121 /#[ \t]*define[ \t]*\bwait_for_completion\b *( *\w* *)[ \t]*\bwait_for_completion\b *( *\w* *)/d
122 s/\bcfs_wait_for_completion_interruptible\b/wait_for_completion_interruptible/g
123 /#define wait_for_completion_interruptible(c) \\/{N;d}
124 s/\bcfs_complete_and_exit\b/complete_and_exit/g
125 /#[ \t]*define[ \t]*\bcomplete_and_exit\b *( *\w* *, *\w* *)[ \t]*\bcomplete_and_exit\b *( *\w* *, *\w* *)/d
126 s/\bcfs_fini_completion\b/fini_completion/g
127
128 # semaphore
129 s/\bcfs_semaphore_t\b/struct semaphore/g
130 s/\bCFS_DEFINE_SEMAPHORE\b/DEFINE_SEMAPHORE/g
131 /#[ \t]*define[ \t]*\bDEFINE_SEMAPHORE\b *( *\w* *)[ \t]*\bDEFINE_SEMAPHORE\b *( *\w* *)/d
132 s/\bcfs_sema_init\b/sema_init/g
133 /#[ \t]*define[ \t]*\bsema_init\b *( *\w* *, *\w* *)[ \t]*\bsema_init\b *( *\w* *, *\w* *)/d
134 s/\bcfs_up\b/up/g
135 /#[ \t]*define[ \t]*\bup\b *( *\w* *)[ \t]*\bup\b *( *\w* *)/d
136 s/\bcfs_down\b/down/g
137 /#[ \t]*define[ \t]*\bdown\b *( *\w* *)[ \t]*\bdown\b *( *\w* *)/d
138 s/\bcfs_down_interruptible\b/down_interruptible/g
139 /#[ \t]*define[ \t]*\bdown_interruptible\b *( *\w* *)[ \t]*\bdown_interruptible\b *( *\w* *)/d
140 s/\bcfs_down_trylock\b/down_trylock/g
141 /#[ \t]*define[ \t]*\bdown_trylock\b *( *\w* *)[ \t]*\bdown_trylock\b *( *\w* *)/d
142
143 # mutex
144 s/\bcfs_mutex_t\b/struct mutex/g
145 s/\bCFS_DEFINE_MUTEX\b/DEFINE_MUTEX/g
146 /#[ \t]*define[ \t]*\DEFINE_MUTEX\b *( *name *)[ \t]*\bDEFINE_MUTEX\b *( *name *)/d
147 s/\bcfs_mutex_init\b/mutex_init/g
148 /#[ \t]*define[ \t]*\bmutex_init\b *( *\w* *)[ \t]*\bmutex_init\b *( *\w* *)/d
149 s/\bcfs_mutex_lock\b/mutex_lock/g
150 /#[ \t]*define[ \t]*\bmutex_lock\b *( *\w* *)[ \t]*\bmutex_lock\b *( *\w* *)/d
151 s/\bcfs_mutex_unlock\b/mutex_unlock/g
152 /#[ \t]*define[ \t]*\bmutex_unlock\b *( *\w* *)[ \t]*\bmutex_unlock\b *( *\w* *)/d
153 s/\bcfs_mutex_lock_interruptible\b/mutex_lock_interruptible/g
154 /#[ \t]*define[ \t]*\bmutex_lock_interruptible\b *( *\w* *)[ \t]*\bmutex_lock_interruptible\b *( *\w* *)/d
155 s/\bcfs_mutex_trylock\b/mutex_trylock/g
156 /#[ \t]*define[ \t]*\bmutex_trylock\b *( *\w* *)[ \t]*\bmutex_trylock\b *( *\w* *)/d
157 s/\bcfs_mutex_is_locked\b/mutex_is_locked/g
158 /#[ \t]*define[ \t]*\bmutex_is_locked\b *( *\w* *)[ \t]*\bmutex_is_locked\b *( *\w* *)/d
159 s/\bcfs_mutex_destroy\b/mutex_destroy/g
160 /#[ \t]*define[ \t]*\bmutex_destroy\b *( *\w* *)[ \t]*\bmutex_destroy\b *( *\w* *)/d
161
162 # lock_kernel, unlock_kernel
163 # s/\bcfs_lock_kernel\b/lock_kernel/g
164 # /#[ \t]*define[ \t]*\block_kernel\b *( *)[ \t]*\block_kernel\b *( *)/d
165 # s/\bcfs_unlock_kernel\b/unlock_kernel/g
166 # /#[ \t]*define[ \t]*\bunlock_kernel\b *( *)[ \t]*\bunlock_kernel\b *( *)/d
167
168 # lockdep
169 s/\bcfs_lock_class_key\b/lock_class_key/g
170 s/\bcfs_lock_class_key_t\b/struct lock_class_key/g
171 s/\bcfs_lockdep_set_class\b/lockdep_set_class/g
172 s/\bcfs_lockdep_off\b/lockdep_off/g
173 s/\bcfs_lockdep_on\b/lockdep_on/g
174 /#[ \t]*define[ \t]*\blockdep_off\b *( *)[ \t]*\blockdep_off\b *( *)/d
175 /#[ \t]*define[ \t]*\blockdep_on\b *( *)[ \t]*\blockdep_on\b *( *)/d
176 /#[ \t]*define[ \t]*\blockdep_set_class\b *( *\w* *, *\w* *)[ \t]*\blockdep_set_class\b *( *\w* *, *\w* *)/d
177
178 s/\bcfs_mutex_lock_nested\b/mutex_lock_nested/g
179 #/#[ \t]*define[ \t]*\bmutex_lock_nested\b *( *\w* *, *\w* *)[ \t]*\bmutex_lock_nested\b *( *\w* *, *\w* *)/d
180 /#define mutex_lock_nested(mutex, subclass) \\/{N;d}
181 s/\bcfs_spin_lock_nested\b/spin_lock_nested/g
182 /#[ \t]*define[ \t]*\bspin_lock_nested\b *( *\w* *, *\w* *)[ \t]*\bspin_lock_nested\b *( *\w* *, *\w* *)/d
183 s/\bcfs_down_read_nested\b/down_read_nested/g
184 /#[ \t]*define[ \t]*\bdown_read_nested\b *( *\w* *, *\w* *)[ \t]*\bdown_read_nested\b *( *\w* *, *\w* *)/d
185 s/\bcfs_down_write_nested\b/down_write_nested/g
186 /#[ \t]*define[ \t]*\bdown_write_nested\b *( *\w* *, *\w* *)[ \t]*\bdown_write_nested\b *( *\w* *, *\w* *)/d
187
188 ###############################################################################
189 # bitops
190
191 s/\bcfs_test_bit\b/test_bit/g
192 /#[ \t]*define[ \t]*\btest_bit\b *( *\w* *, *\w* *)[ \t]*\btest_bit\b *( *\w* *, *\w* *)/d
193 s/\bcfs_set_bit\b/set_bit/g
194 /#[ \t]*define[ \t]*\bset_bit\b *( *\w* *, *\w* *)[ \t]*\bset_bit\b *( *\w* *, *\w* *)/d
195 s/\bcfs_clear_bit\b/clear_bit/g
196 /#[ \t]*define[ \t]*\bclear_bit\b *( *\w* *, *\w* *)[ \t]*\bclear_bit\b *( *\w* *, *\w* *)/d
197 s/\bcfs_test_and_set_bit\b/test_and_set_bit/g
198 /#[ \t]*define[ \t]*\btest_and_set_bit\b *( *\w* *, *\w* *)[ \t]*\btest_and_set_bit\b *( *\w* *, *\w* *)/d
199 s/\bcfs_test_and_clear_bit\b/test_and_clear_bit/g
200 /#[ \t]*define[ \t]*\btest_and_clear_bit\b *( *\w* *, *\w* *)[ \t]*\btest_and_clear_bit\b *( *\w* *, *\w* *)/d
201 s/\bcfs_find_first_bit\b/find_first_bit/g
202 /#[ \t]*define[ \t]*\bfind_first_bit\b *( *\w* *, *\w* *)[ \t]*\bfind_first_bit\b *( *\w* *, *\w* *)/d
203 s/\bcfs_find_first_zero_bit\b/find_first_zero_bit/g
204 /#[ \t]*define[ \t]*\bfind_first_zero_bit\b *( *\w* *, *\w* *)[ \t]*\bfind_first_zero_bit\b *( *\w* *, *\w* *)/d
205 s/\bcfs_find_next_bit\b/find_next_bit/g
206 /#[ \t]*define[ \t]*\bfind_next_bit\b *( *\w* *, *\w* *, *\w* *)[ \t]*\bfind_next_bit\b *( *\w* *, *\w* *, *\w* *)/d
207 s/\bcfs_find_next_zero_bit\b/find_next_zero_bit/g
208 /#define find_next_zero_bit(addr, size, off) \\/{N;d}
209 s/\bcfs_ffz\b/ffz/g
210 /#[ \t]*define[ \t]*\bffz\b *( *\w* *)[ \t]*\bffz\b *( *\w* *)/d
211 s/\bcfs_ffs\b/ffs/g
212 /#[ \t]*define[ \t]*\bffs\b *( *\w* *)[ \t]*\bffs\b *( *\w* *)/d
213 s/\bcfs_fls\b/fls/g
214 /#[ \t]*define[ \t]*\bfls\b *( *\w* *)[ \t]*\bfls\b *( *\w* *)/d
215
216 ################################################################################
217 # file operations
218
219 s/\bcfs_file_t\b/struct file/g
220 s/\bcfs_dentry_t\b/struct dentry/g
221 s/\bcfs_dirent_t\b/struct dirent64/g
222 s/\bcfs_kstatfs_t\b/struct kstatfs/g
223 s/\bcfs_filp_size\b/filp_size/g
224 s/\bcfs_filp_poff\b/filp_poff/g
225 s/\bcfs_filp_open\b/filp_open/g
226 /#[ \t]*define[ \t]*\bfilp_open\b *( *\w* *, *\w* *, *\w* *)[ \t]*\bfilp_open\b *( *\w* *, *\w* *, *\w* *)/d
227 s/\bcfs_do_fsync\b/do_fsync/g
228 s/\bcfs_filp_close\b/filp_close/g
229 /#[ \t]*define[ \t]*\bfilp_close\b *( *\w* *, *\w* *)[ \t]*\bfilp_close\b *( *\w* *, *\w* *)/d
230 s/\bcfs_filp_read\b/filp_read/g
231 s/\bcfs_filp_write\b/filp_write/g
232 s/\bcfs_filp_fsync\b/filp_fsync/g
233 s/\bcfs_get_file\b/get_file/g
234 /#[ \t]*define[ \t]*\bget_file\b *( *\w* *)[ \t]*\bget_file\b *( *\w* *)/d
235 s/\bcfs_get_fd\b/fget/g
236 /#[ \t]*define[ \t]*\bfget\b *( *\w* *)[ \t]*\bfget\b *( *\w* *)/d
237 s/\bcfs_put_file\b/fput/g
238 /#[ \t]*define[ \t]*\bfput\b *( *\w* *)[ \t]*\bfput\b *( *\w* *)/d
239 s/\bcfs_file_count\b/file_count/g
240 /#[ \t]*define[ \t]*\bfile_count\b *( *\w* *)[ \t]*\bfile_count\b *( *\w* *)/d
241 s/\bCFS_INT_LIMIT\b/INT_LIMIT/g
242 s/\bCFS_OFFSET_MAX\b/OFFSET_MAX/g
243 s/\bcfs_flock_t\b/struct file_lock/g
244 s/\bcfs_flock_type\b/flock_type/g
245 s/\bcfs_flock_set_type\b/flock_set_type/g
246 s/\bcfs_flock_pid\b/flock_pid/g
247 s/\bcfs_flock_set_pid\b/flock_set_pid/g
248 s/\bcfs_flock_start\b/flock_start/g
249 s/\bcfs_flock_set_start\b/flock_set_start/g
250 s/\bcfs_flock_end\b/flock_end/g
251 s/\bcfs_flock_set_end\b/flock_set_end/g
252 s/\bcfs_user_write\b/user_write/g
253 s/\bCFS_IFSHIFT\b/IFSHIFT/g
254 s/\bCFS_IFTODT\b/IFTODT/g
255 s/\bCFS_DTTOIF\b/DTTOIF/g
256
257 ################################################################################
258 # memory operations
259
260 #s/\bcfs_page_t\b/struct page/g
261 #s/\bCFS_PAGE_SIZE\b/PAGE_CACHE_SIZE/g
262 #/#[ \t]*define[ \t]*\bPAGE_CACHE_SIZE\b[ \t]*\bPAGE_CACHE_SIZE\b/d
263 #s/\bCFS_PAGE_SHIFT\b/PAGE_CACHE_SHIFT/g
264 #/#[ \t]*define[ \t]*\bPAGE_CACHE_SHIFT\b[ \t]*\bPAGE_CACHE_SHIFT\b/d
265 #s/\bCFS_PAGE_MASK\b/PAGE_CACHE_MASK/g
266 #/#[ \t]*define[ \t]*\bPAGE_CACHE_MASK\b[ \t]*\bPAGE_CACHE_MASK\b/d
267 #s/\bcfs_num_physpages\b/num_physpages/g
268 #/#[ \t]*define[ \t]*\bnum_physpages\b[ \t]*\bnum_physpages\b/d
269 #s/\bcfs_copy_from_user\b/copy_from_user/g
270 #/#[ \t]*define[ \t]*\bcopy_from_user\b *( *\w* *, *\w* *, *\w* *)[ \t]*\bcopy_from_user\b *( *\w* *, *\w* *, *\w* *)/d
271 #s/\bcfs_copy_to_user\b/copy_to_user/g
272 #/#[ \t]*define[ \t]*\bcopy_to_user\b *( *\w* *, *\w* *, *\w* *)[ \t]*\bcopy_to_user\b *( *\w* *, *\w* *, *\w* *)/d
273 #s/\bcfs_page_address\b/page_address/g
274 #/#[ \t]*define[ \t]*\bpage_address\b *( *\w* *)[ \t]*\bpage_address\b *( *\w* *)/d
275 #s/\bcfs_kmap\b/kmap/g
276 #/#[ \t]*define[ \t]*\bkmap\b *( *\w* *)[ \t]*\bkmap\b *( *\w* *)/d
277 #s/\bcfs_kunmap\b/kunmap/g
278 #/#[ \t]*define[ \t]*\bkunmap\b *( *\w* *)[ \t]*\bkunmap\b *( *\w* *)/d
279 #s/\bcfs_get_page\b/get_page/g
280 #/#[ \t]*define[ \t]*\bget_page\b *( *\w* *)[ \t]*\bget_page\b *( *\w* *)/d
281 #s/\bcfs_page_count\b/page_count/g
282 #/#[ \t]*define[ \t]*\bpage_count\b *( *\w* *)[ \t]*\bpage_count\b *( *\w* *)/d
283 #s/\bcfs_page_index\b/page_index/g
284 #/#[ \t]*define[ \t]*\bpage_index\b *( *\w* *)[ \t]*\bpage_index\b *( *\w* *)/d
285 #s/\bcfs_page_pin\b/page_cache_get/g
286 #/#[ \t]*define[ \t]*\bpage_cache_get\b *( *\w* *)[ \t]*\bpage_cache_get\b *( *\w* *)/d
287 #s/\bcfs_page_unpin\b/page_cache_release/g
288 #/#[ \t]*define[ \t]*\bpage_cache_release\b *( *\w* *)[ \t]*\bpage_cache_release\b *( *\w* *)/d
289 #s/\bcfs_memory_pressure_get\b/memory_pressure_get/g
290 #s/\bcfs_memory_pressure_set\b/memory_pressure_set/g
291 #s/\bcfs_memory_pressure_clr\b/memory_pressure_clr/g
292 #s/\bCFS_NUM_CACHEPAGES\b/NUM_CACHEPAGES/g
293 # memory allocator
294 #s/\bCFS_ALLOC_ATOMIC\b/GFP_ATOMIC/g
295 #/#[ \t]*define[ \t]*\bGFP_ATOMIC\b[ \t]*\bGFP_ATOMIC\b/d
296 #s/\bCFS_ALLOC_WAIT\b/__GFP_WAIT/g
297 #/#[ \t]*define[ \t]*\b__GFP_WAIT\b[ \t]*\b__GFP_WAIT\b/d
298 #s/\bCFS_ALLOC_ZERO\b/__GFP_ZERO/g
299 #/#[ \t]*define[ \t]*\b__GFP_ZERO\b[ \t]*\b__GFP_ZERO\b/d
300 #s/\bCFS_ALLOC_FS\b/__GFP_FS/g
301 #/#[ \t]*define[ \t]*\b__GFP_FS\b[ \t]*\b__GFP_FS\b/d
302 #s/\bCFS_ALLOC_IO\b/__GFP_IO/g
303 #/#[ \t]*define[ \t]*\b__GFP_IO\b[ \t]*\b__GFP_IO\b/d
304 #s/\bCFS_ALLOC_NOWARN\b/__GFP_NOWARN/g
305 #/#[ \t]*define[ \t]*\b__GFP_NOWARN\b[ \t]*\b__GFP_NOWARN\b/d
306 #s/\bCFS_ALLOC_STD\b/GFP_IOFS/g
307 #/#[ \t]*define[ \t]*\bGFP_IOFS\b[ \t]*\bGFP_IOFS\b/d
308 #s/\bCFS_ALLOC_USER\b/GFP_KERNEL/g
309 #/#[ \t]*define[ \t]*\bGFP_KERNEL\b[ \t]*\bGFP_KERNEL\b/d
310 #s/\bCFS_ALLOC_HIGHMEM\b/__GFP_HIGHMEM/g
311 #/#[ \t]*define[ \t]*\b__GFP_HIGHMEM\b[ \t]*\b__GFP_HIGHMEM\b/d
312 #s/\bCFS_ALLOC_HIGHUSER\b/GFP_HIGHUSER/g
313 #/#[ \t]*define[ \t]*\bGFP_HIGHUSER\b[ \t]*\bGFP_HIGHUSER\b/d
314 #s/\bCFS_ALLOC_ATOMIC_TRY\b/ALLOC_ATOMIC_TRY/g
315 #s/\bcfs_alloc\b/kmalloc/g
316 #/#[ \t]*define[ \t]*\bkmalloc\b *( *\w* *, *\w* *)[ \t]*\bkmalloc\b *( *\w* *, *\w* *)/d
317 #s/\bcfs_free\b/kfree/g
318 #/#[ \t]*define[ \t]*\bkfree\b *( *\w* *)[ \t]*\bkfree\b *( *\w* *)/d
319 #s/\bcfs_alloc_large\b/vmalloc/g
320 #/#[ \t]*define[ \t]*\bvmalloc\b *( *\w* *)[ \t]*\bvmalloc\b *( *\w* *)/d
321 #s/\bcfs_free_large\b/vfree/g
322 #/#[ \t]*define[ \t]*\bvfree\b *( *\w* *)[ \t]*\bvfree\b *( *\w* *)/d
323 #s/\bcfs_alloc_page\b/alloc_page/g
324 #/#[ \t]*define[ \t]*\balloc_page\b *( *\w* *)[ \t]*\balloc_page\b *( *\w* *)/d
325 #s/\bcfs_free_page\b/__free_page/g
326 #/#[ \t]*define[ \t]*\b__free_page\b *( *\w* *)[ \t]*\b__free_page\b *( *\w* *)/d
327 # TODO: SLAB allocator
328 #s/\bCFS_DECL_MMSPACE\b/DECL_MMSPACE/g
329 #s/\bCFS_MMSPACE_OPEN\b/MMSPACE_OPEN/g
330 #s/\bCFS_MMSPACE_CLOSE\b/MMSPACE_CLOSE/g
331 #s/\bCFS_SLAB_HWCACHE_ALIGN\b/SLAB_HWCACHE_ALIGN/g
332 #/#[ \t]*define[ \t]*\bSLAB_HWCACHE_ALIGN\b[ \t]*\bSLAB_HWCACHE_ALIGN\b/d
333 #s/\bCFS_SLAB_KERNEL\b/SLAB_KERNEL/g
334 #/#[ \t]*define[ \t]*\bSLAB_KERNEL\b[ \t]*\bSLAB_KERNEL\b/d
335 #s/\bCFS_SLAB_NOFS\b/SLAB_NOFS/g
336 #/#[ \t]*define[ \t]*\bSLAB_NOFS\b[ \t]*\bSLAB_NOFS\b/d
337 #s/\bcfs_shrinker\b/shrinker/g
338 #/#[ \t]*define[ \t]*\bshrinker\b[ \t]*\bshrinker\b/d
339 #s/\bcfs_shrinker_t\b/struct shrinkert/g
340 #/typedef[ \t]*\bshrinker_t\b[ \t]*\bshrinker_t\b/d
341 #s/\bcfs_set_shrinker\b/set_shrinker/g
342 #/#[ \t]*define[ \t]*\bset_shrinker\b *( *\w* *, *\w* *)[ \t]*\bset_shrinker\b *( *\w* *, *\w* *)/d
343 #s/\bcfs_remove_shrinker\b/remove_shrinker/g
344 #/#[ \t]*define[ \t]*\bremove_shrinker\b *( *\w* *)[ \t]*\bremove_shrinker\b *( *\w* *)/d
345 #s/\bCFS_DEFAULT_SEEKS\b/DEFAULT_SEEKS/g
346 #/#[ \t]*define[ \t]*\bDEFAULT_SEEKS\b[ \t]*\bDEFAULT_SEEKS\b/d