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