Whamcloud - gitweb
LU-13090 utils: fix lfs_migrate -p for file with pool
[fs/lustre-release.git] / contrib / scripts / 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 # https://jira.whamcloud.com/browse/LU-1346
6
7 # Run this script like:
8 #       find libcfs lnet lustre -name "*.[ch]" | grep -v gnilnd |
9 #               xargs sed -i "" -f contrib/scripts/libcfs_cleanup.sed
10
11
12 ################################################################################
13 # lock - spinlock, rw_semaphore, rwlock, completion, semaphore, mutex
14 #      - lock_kernel, unlock_kernel, lockdep
15
16 # spinlock
17 /typedef  *spinlock_t  *cfs_spinlock_t;/d
18 s/\bcfs_spinlock_t\b/spinlock_t/g
19 s/\bcfs_spin_lock_init\b/spin_lock_init/g
20 /#[ \t]*define[ \t]*\bspin_lock_init\b *( *\w* *)[ \t]*\bspin_lock_init\b *( *\w* *)/d
21 s/\bcfs_spin_lock\b/spin_lock/g
22 /#[ \t]*define[ \t]*\bspin_lock\b *( *\w* *)[ \t]*\bspin_lock\b *( *\w* *)/d
23 s/\bcfs_spin_lock_bh\b/spin_lock_bh/g
24 /#[ \t]*define[ \t]*\bspin_lock_bh\b *( *\w* *)[ \t]*\bspin_lock_bh\b *( *\w* *)/d
25 s/\bcfs_spin_lock_bh_init\b/spin_lock_bh_init/g
26 /#[ \t]*define[ \t]*\bspin_lock_bh_init\b *( *\w* *)[ \t]*\bspin_lock_bh_init\b *( *\w* *)/d
27 s/\bcfs_spin_unlock\b/spin_unlock/g
28 /#[ \t]*define[ \t]*\bspin_unlock\b *( *\w* *)[ \t]*\bspin_unlock\b *( *\w* *)/d
29 s/\bcfs_spin_unlock_bh\b/spin_unlock_bh/g
30 /#[ \t]*define[ \t]*\bspin_unlock_bh\b *( *\w* *)[ \t]*\bspin_unlock_bh\b *( *\w* *)/d
31 s/\bcfs_spin_trylock\b/spin_trylock/g
32 /#[ \t]*define[ \t]*\bspin_trylock\b *( *\w* *)[ \t]*\bspin_trylock\b *( *\w* *)/d
33 s/\bcfs_spin_is_locked\b/spin_is_locked/g
34 /#[ \t]*define[ \t]*\bspin_is_locked\b *( *\w* *)[ \t]*\bspin_is_locked\b *( *\w* *)/d
35
36 s/\bcfs_spin_lock_irq\b/spin_lock_irq/g
37 /#[ \t]*define[ \t]*\bspin_lock_irq\b *( *\w* *)[ \t]*\bspin_lock_irq\b *( *\w* *)/d
38 s/\bcfs_spin_unlock_irq\b/spin_unlock_irq/g
39 /#[ \t]*define[ \t]*\bspin_unlock_irq\b *( *\w* *)[ \t]*\bspin_unlock_irq\b *( *\w* *)/d
40 s/\bcfs_read_lock_irqsave\b/read_lock_irqsave/g
41 /#[ \t]*define[ \t]*\bread_lock_irqsave\b *( *\w* *, *\w* *)[ \t]*\bread_lock_irqsave\b *( *\w* *, *\w* *)/d
42 s/\bcfs_write_lock_irqsave\b/write_lock_irqsave/g
43 /#[ \t]*define[ \t]*\bwrite_lock_irqsave\b *( *\w* *, *\w* *)[ \t]*\bwrite_lock_irqsave\b *( *\w* *, *\w* *)/d
44 s/\bcfs_write_unlock_irqrestore\b/write_unlock_irqrestore/g
45 /#[ \t]*define[ \t]*\bwrite_unlock_irqrestore\b *( *\w* *, *\w* *)[ \t]*\bwrite_unlock_irqrestore\b *( *\w* *, *\w* *)/d
46 s/\bcfs_spin_lock_irqsave\b/spin_lock_irqsave/g
47 /#[ \t]*define[ \t]*\bspin_lock_irqsave\b *( *\w* *, *\w* *)[ \t]*\bspin_lock_irqsave\b *( *\w* *, *\w* *)/d
48 s/\bcfs_spin_unlock_irqrestore\b/spin_unlock_irqrestore/g
49 /#[ \t]*define[ \t]*\bspin_unlock_irqrestore\b *( *\w* *, *\w* *)[ \t]*\bspin_unlock_irqrestore\b *( *\w* *, *\w* *)/d
50 s/\bCFS_SPIN_LOCK_UNLOCKED\b/SPIN_LOCK_UNLOCKED/g
51 /#[ \t]*define[ \t]*\bSPIN_LOCK_UNLOCKED\b[ \t]*\bSPIN_LOCK_UNLOCKED\b/d
52
53 # rw_semaphore
54 s/\bcfs_semaphore\b/semaphore/g
55 s/\bcfs_rw_semaphore_t\b/struct rw_semaphore/g
56 s/\bcfs_init_rwsem\b/init_rwsem/g
57 /#[ \t]*define[ \t]*\binit_rwsem\b *( *\w* *)[ \t]*\binit_rwsem\b *( *\w* *)/d
58 s/\bcfs_down_read\b/down_read/g
59 /#[ \t]*define[ \t]*\bdown_read\b *( *\w* *)[ \t]*\bdown_read\b *( *\w* *)/d
60 s/\bcfs_down_read_trylock\b/down_read_trylock/g
61 /#[ \t]*define[ \t]*\bdown_read_trylock\b *( *\w* *)[ \t]*\bdown_read_trylock\b *( *\w* *)/d
62 s/\bcfs_up_read\b/up_read/g
63 /#[ \t]*define[ \t]*\bup_read\b *( *\w* *)[ \t]*\bup_read\b *( *\w* *)/d
64 s/\bcfs_down_write\b/down_write/g
65 /#[ \t]*define[ \t]*\bdown_write\b *( *\w* *)[ \t]*\bdown_write\b *( *\w* *)/d
66 s/\bcfs_down_write_trylock\b/down_write_trylock/g
67 /#[ \t]*define[ \t]*\bdown_write_trylock\b *( *\w* *)[ \t]*\bdown_write_trylock\b *( *\w* *)/d
68 s/\bcfs_up_write\b/up_write/g
69 /#[ \t]*define[ \t]*\bup_write\b *( *\w* *)[ \t]*\bup_write\b *( *\w* *)/d
70 s/\bcfs_fini_rwsem\b/fini_rwsem/g
71 s/\bCFS_DECLARE_RWSEM\b/DECLARE_RWSEM/g
72 /#[ \t]*define[ \t]*\bDECLARE_RWSEM\b *( *\w* *)[ \t]*\bDECLARE_RWSEM\b *( *\w* *)/d
73
74 #finish this with other atomics
75 #s/\bcfs_mt_atomic_t\b/atomic_t/g
76 #s/\bcfs_mt_atomic_read\b/atomic_read/g
77 #s/\bcfs_mt_atomic_set\b/atomic_set/g
78 #s/\bcfs_mt_atomic_dec_and_test\b/atomic_dec_and_test/g
79 #s/\bcfs_mt_atomic_inc\b/atomic_inc/g
80 #s/\bcfs_mt_atomic_dec\b/atomic_dec/g
81 #s/\bcfs_mt_atomic_add\b/atomic_add/g
82 #s/\bcfs_mt_atomic_sub\b/atomic_sub/g
83
84 # rwlock
85 /typedef  *rwlock_t  *cfs_rwlock_t;/d
86 s/\bcfs_rwlock_t\b/rwlock_t/g
87 s/\bcfs_rwlock_init\b/rwlock_init/g
88 /#[ \t]*define[ \t]*\brwlock_init\b *( *\w* *)[ \t]*\brwlock_init\b *( *\w* *)/d
89 s/\bcfs_read_lock\b/read_lock/g
90 /#[ \t]*define[ \t]*\bread_lock\b *( *\w* *)[ \t]*\bread_lock\b *( *\w* *)/d
91 s/\bcfs_read_unlock\b/read_unlock/g
92 /#[ \t]*define[ \t]*\bread_unlock\b *( *\w* *)[ \t]*\bread_unlock\b *( *\w* *)/d
93 s/\bcfs_read_unlock_irqrestore\b/read_unlock_irqrestore/g
94 #/#[ \t]*define[ \t]*\bread_unlock_irqrestore\b *( *\w* *)[ \t]*\bread_unlock_irqrestore\b *( *\w* *)/d
95 /#define read_unlock_irqrestore(lock,flags) \\/{N;d;}
96 s/\bcfs_write_lock\b/write_lock/g
97 /#[ \t]*define[ \t]*\bwrite_lock\b *( *\w* *)[ \t]*\bwrite_lock\b *( *\w* *)/d
98 s/\bcfs_write_unlock\b/write_unlock/g
99 /#[ \t]*define[ \t]*\bwrite_unlock\b *( *\w* *)[ \t]*\bwrite_unlock\b *( *\w* *)/d
100 s/\bcfs_write_lock_bh\b/write_lock_bh/g
101 /#[ \t]*define[ \t]*\bwrite_lock_bh\b *( *\w* *)[ \t]*\bwrite_lock_bh\b *( *\w* *)/d
102 s/\bcfs_write_unlock_bh\b/write_unlock_bh/g
103 /#[ \t]*define[ \t]*\bwrite_unlock_bh\b *( *\w* *)[ \t]*\bwrite_unlock_bh\b *( *\w* *)/d
104 s/\bCFS_RW_LOCK_UNLOCKED\b/RW_LOCK_UNLOCKED/g
105 /#[ \t]*define[ \t]*\bRW_LOCK_UNLOCKED\b  *\bRW_LOCK_UNLOCKED\b */d
106
107 # completion
108 s/\bcfs_completion_t\b/struct completion/g
109 s/\bcfs_mt_completion_t\b/struct completion/g
110 s/\bcfs_mt_init_completion\b/init_completion/g
111 s/\bcfs_mt_wait_for_completion\b/wait_for_completion/g
112 s/\bcfs_mt_complete\b/complete/g
113 s/\bcfs_mt_fini_completion\b/fini_completion/g
114 s/\bCFS_DECLARE_COMPLETION\b/DECLARE_COMPLETION/g
115 /#[ \t]*define[ \t]*\bDECLARE_COMPLETION\b *( *\w* *)[ \t]*\bDECLARE_COMPLETION\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_COMPLETION_INITIALIZER\b/COMPLETION_INITIALIZER/g
119 /#[ \t]*define[ \t]*\bCOMPLETION_INITIALIZER\b *( *\w* *)[ \t]*\bCOMPLETION_INITIALIZER\b *( *\w* *)/d
120 s/\bcfs_init_completion\b/init_completion/g
121 /#[ \t]*define[ \t]*\binit_completion\b *( *\w* *)[ \t]*\binit_completion\b *( *\w* *)/d
122 s/\bcfs_complete\b/complete/g
123 /#[ \t]*define[ \t]*\bcomplete\b *( *\w* *)[ \t]*\bcomplete\b *( *\w* *)/d
124 s/\bcfs_wait_for_completion\b/wait_for_completion/g
125 /#[ \t]*define[ \t]*\bwait_for_completion\b *( *\w* *)[ \t]*\bwait_for_completion\b *( *\w* *)/d
126 s/\bcfs_wait_for_completion_interruptible\b/wait_for_completion_interruptible/g
127 /#define wait_for_completion_interruptible(c) \\/{N;d;}
128 s/\bcfs_complete_and_exit\b/complete_and_exit/g
129 /#[ \t]*define[ \t]*\bcomplete_and_exit\b *( *\w* *, *\w* *)[ \t]*\bcomplete_and_exit\b *( *\w* *, *\w* *)/d
130 s/\bcfs_fini_completion\b/fini_completion/g
131
132 # semaphore
133 s/\bcfs_semaphore_t\b/struct semaphore/g
134 s/\bCFS_DEFINE_SEMAPHORE\b/DEFINE_SEMAPHORE/g
135 /#[ \t]*define[ \t]*\bDEFINE_SEMAPHORE\b *( *\w* *)[ \t]*\bDEFINE_SEMAPHORE\b *( *\w* *)/d
136 s/\bcfs_sema_init\b/sema_init/g
137 /#[ \t]*define[ \t]*\bsema_init\b *( *\w* *, *\w* *)[ \t]*\bsema_init\b *( *\w* *, *\w* *)/d
138 s/\bcfs_up\b/up/g
139 /#[ \t]*define[ \t]*\bup\b *( *\w* *)[ \t]*\bup\b *( *\w* *)/d
140 s/\bcfs_down\b/down/g
141 /#[ \t]*define[ \t]*\bdown\b *( *\w* *)[ \t]*\bdown\b *( *\w* *)/d
142 s/\bcfs_down_interruptible\b/down_interruptible/g
143 /#[ \t]*define[ \t]*\bdown_interruptible\b *( *\w* *)[ \t]*\bdown_interruptible\b *( *\w* *)/d
144 s/\bcfs_down_trylock\b/down_trylock/g
145 /#[ \t]*define[ \t]*\bdown_trylock\b *( *\w* *)[ \t]*\bdown_trylock\b *( *\w* *)/d
146
147 # mutex
148 s/\bcfs_mutex_t\b/struct mutex/g
149 s/\bCFS_DEFINE_MUTEX\b/DEFINE_MUTEX/g
150 /#[ \t]*define[ \t]*\DEFINE_MUTEX\b *( *name *)[ \t]*\bDEFINE_MUTEX\b *( *name *)/d
151 s/\bcfs_mutex_init\b/mutex_init/g
152 /#[ \t]*define[ \t]*\bmutex_init\b *( *\w* *)[ \t]*\bmutex_init\b *( *\w* *)/d
153 s/\bcfs_mutex_lock\b/mutex_lock/g
154 /#[ \t]*define[ \t]*\bmutex_lock\b *( *\w* *)[ \t]*\bmutex_lock\b *( *\w* *)/d
155 s/\bcfs_mutex_unlock\b/mutex_unlock/g
156 /#[ \t]*define[ \t]*\bmutex_unlock\b *( *\w* *)[ \t]*\bmutex_unlock\b *( *\w* *)/d
157 s/\bcfs_mutex_lock_interruptible\b/mutex_lock_interruptible/g
158 /#[ \t]*define[ \t]*\bmutex_lock_interruptible\b *( *\w* *)[ \t]*\bmutex_lock_interruptible\b *( *\w* *)/d
159 s/\bcfs_mutex_trylock\b/mutex_trylock/g
160 /#[ \t]*define[ \t]*\bmutex_trylock\b *( *\w* *)[ \t]*\bmutex_trylock\b *( *\w* *)/d
161 s/\bcfs_mutex_is_locked\b/mutex_is_locked/g
162 /#[ \t]*define[ \t]*\bmutex_is_locked\b *( *\w* *)[ \t]*\bmutex_is_locked\b *( *\w* *)/d
163 s/\bcfs_mutex_destroy\b/mutex_destroy/g
164 /#[ \t]*define[ \t]*\bmutex_destroy\b *( *\w* *)[ \t]*\bmutex_destroy\b *( *\w* *)/d
165
166 # lock_kernel, unlock_kernel
167 # s/\bcfs_lock_kernel\b/lock_kernel/g
168 # /#[ \t]*define[ \t]*\block_kernel\b *( *)[ \t]*\block_kernel\b *( *)/d
169 # s/\bcfs_unlock_kernel\b/unlock_kernel/g
170 # /#[ \t]*define[ \t]*\bunlock_kernel\b *( *)[ \t]*\bunlock_kernel\b *( *)/d
171
172 # lockdep
173 s/\bcfs_lock_class_key\b/lock_class_key/g
174 s/\bcfs_lock_class_key_t\b/struct lock_class_key/g
175 s/\bcfs_lockdep_set_class\b/lockdep_set_class/g
176 s/\bcfs_lockdep_off\b/lockdep_off/g
177 s/\bcfs_lockdep_on\b/lockdep_on/g
178 /#[ \t]*define[ \t]*\blockdep_off\b *( *)[ \t]*\blockdep_off\b *( *)/d
179 /#[ \t]*define[ \t]*\blockdep_on\b *( *)[ \t]*\blockdep_on\b *( *)/d
180 /#[ \t]*define[ \t]*\blockdep_set_class\b *( *\w* *, *\w* *)[ \t]*\blockdep_set_class\b *( *\w* *, *\w* *)/d
181
182 s/\bcfs_mutex_lock_nested\b/mutex_lock_nested/g
183 #/#[ \t]*define[ \t]*\bmutex_lock_nested\b *( *\w* *, *\w* *)[ \t]*\bmutex_lock_nested\b *( *\w* *, *\w* *)/d
184 /#define mutex_lock_nested(mutex, subclass) \\/{N;d;}
185 s/\bcfs_spin_lock_nested\b/spin_lock_nested/g
186 /#[ \t]*define[ \t]*\bspin_lock_nested\b *( *\w* *, *\w* *)[ \t]*\bspin_lock_nested\b *( *\w* *, *\w* *)/d
187 s/\bcfs_down_read_nested\b/down_read_nested/g
188 /#[ \t]*define[ \t]*\bdown_read_nested\b *( *\w* *, *\w* *)[ \t]*\bdown_read_nested\b *( *\w* *, *\w* *)/d
189 s/\bcfs_down_write_nested\b/down_write_nested/g
190 /#[ \t]*define[ \t]*\bdown_write_nested\b *( *\w* *, *\w* *)[ \t]*\bdown_write_nested\b *( *\w* *, *\w* *)/d
191
192 ###############################################################################
193 # bitops
194
195 s/\bcfs_test_bit\b/test_bit/g
196 /#[ \t]*define[ \t]*\btest_bit\b *( *\w* *, *\w* *)[ \t]*\btest_bit\b *( *\w* *, *\w* *)/d
197 s/\bcfs_set_bit\b/set_bit/g
198 /#[ \t]*define[ \t]*\bset_bit\b *( *\w* *, *\w* *)[ \t]*\bset_bit\b *( *\w* *, *\w* *)/d
199 s/\bcfs_clear_bit\b/clear_bit/g
200 /#[ \t]*define[ \t]*\bclear_bit\b *( *\w* *, *\w* *)[ \t]*\bclear_bit\b *( *\w* *, *\w* *)/d
201 s/\bcfs_test_and_set_bit\b/test_and_set_bit/g
202 /#[ \t]*define[ \t]*\btest_and_set_bit\b *( *\w* *, *\w* *)[ \t]*\btest_and_set_bit\b *( *\w* *, *\w* *)/d
203 s/\bcfs_test_and_clear_bit\b/test_and_clear_bit/g
204 /#[ \t]*define[ \t]*\btest_and_clear_bit\b *( *\w* *, *\w* *)[ \t]*\btest_and_clear_bit\b *( *\w* *, *\w* *)/d
205 s/\bcfs_find_first_bit\b/find_first_bit/g
206 /#[ \t]*define[ \t]*\bfind_first_bit\b *( *\w* *, *\w* *)[ \t]*\bfind_first_bit\b *( *\w* *, *\w* *)/d
207 s/\bcfs_find_first_zero_bit\b/find_first_zero_bit/g
208 /#[ \t]*define[ \t]*\bfind_first_zero_bit\b *( *\w* *, *\w* *)[ \t]*\bfind_first_zero_bit\b *( *\w* *, *\w* *)/d
209 s/\bcfs_find_next_bit\b/find_next_bit/g
210 /#[ \t]*define[ \t]*\bfind_next_bit\b *( *\w* *, *\w* *, *\w* *)[ \t]*\bfind_next_bit\b *( *\w* *, *\w* *, *\w* *)/d
211 s/\bcfs_find_next_zero_bit\b/find_next_zero_bit/g
212 /#define find_next_zero_bit(addr, size, off) \\/{N;d;}
213 s/\bcfs_ffz\b/ffz/g
214 /#[ \t]*define[ \t]*\bffz\b *( *\w* *)[ \t]*\bffz\b *( *\w* *)/d
215 s/\bcfs_ffs\b/ffs/g
216 /#[ \t]*define[ \t]*\bffs\b *( *\w* *)[ \t]*\bffs\b *( *\w* *)/d
217 s/\bcfs_fls\b/fls/g
218 /#[ \t]*define[ \t]*\bfls\b *( *\w* *)[ \t]*\bfls\b *( *\w* *)/d
219
220 ################################################################################
221 # file operations
222
223 s/\bcfs_file_t\b/struct file/g
224 s/\bcfs_dentry_t\b/struct dentry/g
225 s/\bcfs_dirent_t\b/struct dirent64/g
226 s/\bcfs_kstatfs_t\b/struct kstatfs/g
227 s/\bcfs_filp_size\b/filp_size/g
228 s/\bcfs_filp_poff\b/filp_poff/g
229 s/\bcfs_filp_open\b/filp_open/g
230 /#[ \t]*define[ \t]*\bfilp_open\b *( *\w* *, *\w* *, *\w* *)[ \t]*\bfilp_open\b *( *\w* *, *\w* *, *\w* *)/d
231 s/\bcfs_do_fsync\b/do_fsync/g
232 s/\bcfs_filp_close\b/filp_close/g
233 /#[ \t]*define[ \t]*\bfilp_close\b *( *\w* *, *\w* *)[ \t]*\bfilp_close\b *( *\w* *, *\w* *)/d
234 s/\bcfs_filp_read\b/filp_read/g
235 s/\bcfs_filp_write\b/filp_write/g
236 s/\bcfs_filp_fsync\b/filp_fsync/g
237 s/\bcfs_get_file\b/get_file/g
238 /#[ \t]*define[ \t]*\bget_file\b *( *\w* *)[ \t]*\bget_file\b *( *\w* *)/d
239 s/\bcfs_get_fd\b/fget/g
240 /#[ \t]*define[ \t]*\bfget\b *( *\w* *)[ \t]*\bfget\b *( *\w* *)/d
241 s/\bcfs_put_file\b/fput/g
242 /#[ \t]*define[ \t]*\bfput\b *( *\w* *)[ \t]*\bfput\b *( *\w* *)/d
243 s/\bcfs_file_count\b/file_count/g
244 /#[ \t]*define[ \t]*\bfile_count\b *( *\w* *)[ \t]*\bfile_count\b *( *\w* *)/d
245 s/\bCFS_INT_LIMIT\b/INT_LIMIT/g
246 s/\bCFS_OFFSET_MAX\b/OFFSET_MAX/g
247 s/\bcfs_flock_t\b/struct file_lock/g
248 s/\b[cfs_]*flock_type(\([^)]*\))\b/\1->fl_type/g
249 s/\b[cfs_]*flock_set_type(\([^,]*\), \([^)]*\))\b/\1->fl_type = \2/g
250 s/\b[cfs_]*flock_pid(\([^)]*\))\b/\1->fl_pid/g
251 s/\b[cfs_]*flock_set_pid(\([^,]*\), \([^)]*\))\b/\1->fl_pid = \2/g
252 s/\b[cfs_]*flock_start(\([^)]*\))\b/\1->fl_start/g
253 s/\b[cfs_]*flock_set_start(\([^,]*\), \([^)]*\))\b/\1->fl_start = \2/g
254 s/\b[cfs_]*flock_end(\([^)]*\))\b/\1->fl_end/g
255 s/\b[cfs_]*flock_set_end(\([^,]*\), \([^)]*\))\b/\1->fl_end = \2/g
256 s/\bcfs_user_write\b/user_write/g
257 s/\bCFS_IFSHIFT\b/IFSHIFT/g
258 s/\bCFS_IFTODT\b/IFTODT/g
259 s/\bCFS_DTTOIF\b/DTTOIF/g
260
261 ################################################################################
262 # memory operations
263 s/\bcfs_page_t\b/struct page/g
264 /typedef[ \t]*\bstruct page\b[ \t]*\bstruct page\b/d
265 s/\bCFS_PAGE_SIZE\b/PAGE_CACHE_SIZE/g
266 /#[ \t]*define[ \t]*\bPAGE_CACHE_SIZE\b[ \t]*\bPAGE_CACHE_SIZE\b/d
267 s/\bCFS_PAGE_SHIFT\b/PAGE_CACHE_SHIFT/g
268 /#[ \t]*define[ \t]*\bPAGE_CACHE_SHIFT\b[ \t]*\bPAGE_CACHE_SHIFT\b/d
269 s/\bcfs_num_physpages\b/num_physpages/g
270 /#[ \t]*define[ \t]*\bnum_physpages\b[ \t]*\bnum_physpages\b/d
271 s/\bcfs_copy_from_user\b/copy_from_user/g
272 /#[ \t]*define[ \t]*\bcopy_from_user\b *( *\w* *, *\w* *, *\w* *)[ \t]*\bcopy_from_user\b *( *\w* *, *\w* *, *\w* *)/d
273 s/\bcfs_copy_to_user\b/copy_to_user/g
274 /#[ \t]*define[ \t]*\bcopy_to_user\b *( *\w* *, *\w* *, *\w* *)[ \t]*\bcopy_to_user\b *( *\w* *, *\w* *, *\w* *)/d
275 s/\bcfs_page_address\b/page_address/g
276 /#[ \t]*define[ \t]*\bpage_address\b *( *\w* *)[ \t]*\bpage_address\b *( *\w* *)/d
277 s/\bcfs_kmap\b/kmap/g
278 /#[ \t]*define[ \t]*\bkmap\b *( *\w* *)[ \t]*\bkmap\b *( *\w* *)/d
279 s/\bcfs_kunmap\b/kunmap/g
280 /#[ \t]*define[ \t]*\bkunmap\b *( *\w* *)[ \t]*\bkunmap\b *( *\w* *)/d
281 s/\bcfs_get_page\b/get_page/g
282 /#[ \t]*define[ \t]*\bget_page\b *( *\w* *)[ \t]*\bget_page\b *( *\w* *)/d
283 s/\bcfs_page_count\b/page_count/g
284 /#[ \t]*define[ \t]*\bpage_count\b *( *\w* *)[ \t]*\bpage_count\b *( *\w* *)/d
285 s/\bcfs_page_index\b/page_index/g
286 /#[ \t]*define[ \t]*\bpage_index\b *( *\w* *)[ \t]*\bpage_index\b *( *\w* *)/d
287 s/\bcfs_page_pin\b/page_cache_get/g
288 /#[ \t]*define[ \t]*\bpage_cache_get\b *( *\w* *)[ \t]*\bpage_cache_get\b *( *\w* *)/d
289 s/\bcfs_page_unpin\b/page_cache_release/g
290 /#[ \t]*define[ \t]*\bpage_cache_release\b *( *\w* *)[ \t]*\bpage_cache_release\b *( *\w* *)/d
291 s/\bcfs_memory_pressure_get\b/memory_pressure_get/g
292 s/\bcfs_memory_pressure_set\b/memory_pressure_set/g
293 s/\bcfs_memory_pressure_clr\b/memory_pressure_clr/g
294 s/\bCFS_NUM_CACHEPAGES\b/NUM_CACHEPAGES/g
295  # memory allocator
296 s/\bCFS_ALLOC_ATOMIC\b/GFP_ATOMIC/g
297 /#[ \t]*define[ \t]*\bGFP_ATOMIC\b[ \t]*\bGFP_ATOMIC\b/d
298 s/\bCFS_ALLOC_WAIT\b/__GFP_WAIT/g
299 /#[ \t]*define[ \t]*\b__GFP_WAIT\b[ \t]*\b__GFP_WAIT\b/d
300 s/\bCFS_ALLOC_ZERO\b/__GFP_ZERO/g
301 /#[ \t]*define[ \t]*\b__GFP_ZERO\b[ \t]*\b__GFP_ZERO\b/d
302 s/\bCFS_ALLOC_FS\b/__GFP_FS/g
303 /#[ \t]*define[ \t]*\b__GFP_FS\b[ \t]*\b__GFP_FS\b/d
304 s/\bCFS_ALLOC_IO\b/__GFP_IO/g
305 /#[ \t]*define[ \t]*\b__GFP_IO\b[ \t]*\b__GFP_IO\b/d
306 s/\bCFS_ALLOC_NOWARN\b/__GFP_NOWARN/g
307 /#[ \t]*define[ \t]*\b__GFP_NOWARN\b[ \t]*\b__GFP_NOWARN\b/d
308 s/\bCFS_ALLOC_STD\b/GFP_IOFS/g
309 /#[ \t]*define[ \t]*\bGFP_IOFS\b[ \t]*\bGFP_IOFS\b/d
310 s/\bCFS_ALLOC_USER\b/GFP_USER/g
311 /#[ \t]*define[ \t]*\bGFP_USER\b[ \t]*\bGFP_USER\b/d
312 s/\bCFS_ALLOC_KERNEL\b/GFP_KERNEL/g
313 /#[ \t]*define[ \t]*\bGFP_KERNEL\b[ \t]*\bGFP_KERNEL\b/d
314 s/\bCFS_ALLOC_NOFS\b/GFP_NOFS/g
315 /#[ \t]*define[ \t]*\bGFP_NOFS\b[ \t]*\bGFP_NOFS\b/d
316 s/\bCFS_ALLOC_HIGHMEM\b/__GFP_HIGHMEM/g
317 /#[ \t]*define[ \t]*\b__GFP_HIGHMEM\b[ \t]*\b__GFP_HIGHMEM\b/d
318 s/\bCFS_ALLOC_HIGHUSER\b/GFP_HIGHUSER/g
319 /#[ \t]*define[ \t]*\bGFP_HIGHUSER\b[ \t]*\bGFP_HIGHUSER\b/d
320 s/\bCFS_ALLOC_ATOMIC_TRY\b/ALLOC_ATOMIC_TRY/g
321 s/\bcfs_alloc\b/kmalloc/g
322 /#[ \t]*define[ \t]*\bkmalloc\b *( *\w* *, *\w* *)[ \t]*\bkmalloc\b *( *\w* *, *\w* *)/d
323 s/\bcfs_free\b/kfree/g
324 /#[ \t]*define[ \t]*\bkfree\b *( *\w* *)[ \t]*\bkfree\b *( *\w* *)/d
325 s/\bcfs_alloc_large\b/vmalloc/g
326 /#[ \t]*define[ \t]*\bvmalloc\b *( *\w* *)[ \t]*\bvmalloc\b *( *\w* *)/d
327 s/\bcfs_free_large\b/vfree/g
328 /#[ \t]*define[ \t]*\bvfree\b *( *\w* *)[ \t]*\bvfree\b *( *\w* *)/d
329 s/\bcfs_alloc_page\b/alloc_page/g
330 /#[ \t]*define[ \t]*\balloc_page\b *( *\w* *)[ \t]*\balloc_page\b *( *\w* *)/d
331 s/\bcfs_free_page\b/__free_page/g
332 /#[ \t]*define[ \t]*\b__free_page\b *( *\w* *)[ \t]*\b__free_page\b *( *\w* *)/d
333 # TODO: SLAB allocator
334 s/\bCFS_DECL_MMSPACE\b/DECL_MMSPACE/g
335 s/\bCFS_MMSPACE_OPEN\b/MMSPACE_OPEN/g
336 s/\bCFS_MMSPACE_CLOSE\b/MMSPACE_CLOSE/g
337 s/\bCFS_SLAB_HWCACHE_ALIGN\b/SLAB_HWCACHE_ALIGN/g
338 /#[ \t]*define[ \t]*\bSLAB_HWCACHE_ALIGN\b[ \t]*\bSLAB_HWCACHE_ALIGN\b/d
339 s/\bCFS_SLAB_KERNEL\b/SLAB_KERNEL/g
340 /#[ \t]*define[ \t]*\bSLAB_KERNEL\b[ \t]*\bSLAB_KERNEL\b/d
341 s/\bCFS_SLAB_NOFS\b/SLAB_NOFS/g
342 /#[ \t]*define[ \t]*\bSLAB_NOFS\b[ \t]*\bSLAB_NOFS\b/d
343 s/\bcfs_shrinker\b/shrinker/g
344 /#[ \t]*define[ \t]*\bshrinker\b[ \t]*\bshrinker\b/d
345 s/\bcfs_shrinker_t\b/shrinker_t/g
346 /typedef[ \t]*\bshrinker_t\b[ \t]*\bshrinker_t\b/d
347 s/\bcfs_set_shrinker\b/set_shrinker/g
348 /#[ \t]*define[ \t]*\bset_shrinker\b *( *\w* *, *\w* *)[ \t]*\bset_shrinker\b *( *\w* *, *\w* *)/d
349 s/\bcfs_remove_shrinker\b/remove_shrinker/g
350 /#[ \t]*define[ \t]*\bremove_shrinker\b *( *\w* *)[ \t]*\bremove_shrinker\b *( *\w* *)/d
351 s/\bCFS_DEFAULT_SEEKS\b/DEFAULT_SEEKS/g
352 /#[ \t]*define[ \t]*\bDEFAULT_SEEKS\b[ \t]*\bDEFAULT_SEEKS\b/d
353 s/cfs_mem_cache_t/struct kmem_cache/g
354 s/cfs_mem_cache_create/kmem_cache_create/g
355 s/\w+[ =]*cfs_mem_cache_destroy/kmem_cache_destroy/g
356 s/cfs_mem_cache_destroy/kmem_cache_destroy/g
357 s/cfs_mem_cache_alloc/kmem_cache_alloc/g
358 s/cfs_mem_cache_free/kmem_cache_free/g
359 s/cfs_mem_is_in_cache/kmem_is_in_cache/g
360
361 ################################################################################
362 # macros in kp30.h
363
364 s/\bcfs_num_online_cpus\b/num_online_cpus/g
365 /#[ \t]*define[ \t]*\bnum_online_cpus\b *( *)[ \t]*\bnum_online_cpus\b *( *)/d
366 s/\bwait_on_page\b/wait_on_page_locked/g
367 /#[ \t]*define[ \t]*\bwait_on_page_locked\b[ \t]*\bwait_on_page_locked\b/d
368 s/^\([ \t]*\)LASSERT_SPIN_LOCKED\b *\((.*)\)/\1LASSERT(spin_is_locked\2)/g
369 /#[ \t]*define[ \t]*\bLASSERT_SPIN_LOCKED\b/d
370 s/^\([ \t]*\)LINVRNT_SPIN_LOCKED\b *\((.*)\)/\1LINVRNT(spin_is_locked\2)/g
371 /#[ \t]*define[ \t]*\bLINVRNT_SPIN_LOCKED\b/d
372 s/^\([ \t]*\)LASSERT_SEM_LOCKED\b *\((.*)\)/\1LASSERT(down_trylock\2 != 0)/g
373 /#[ \t]*define[ \t]*\bLASSERT_SEM_LOCKED\b/d
374 s/^\([ \t]*\)LASSERT_MUTEX_LOCKED\b *\((.*)\)/\1LASSERT(mutex_is_locked\2)/g
375 /#[ \t]*define[ \t]*\bLASSERT_MUTEX_LOCKED\b/d
376 s/\bLIBCFS_PANIC\b/panic/g
377 /#[ \t]*define[ \t]*\bpanic\b *( *\w* *)[ \t]*\bpanic\b *( *\w* *)/d
378 s/\bcfs_num_possible_cpus\b/num_possible_cpus/g
379 /#[ \t]*define[ \t]*\bnum_possible_cpus\b *( *)[ \t]*\bnum_possible_cpus\b *( *)/d
380 s/\bcfs_smp_processor_id\b/smp_processor_id/g
381 /#[ \t]*define[ \t]*\bsmp_processor_id\b *( *)[ \t]*\bsmp_processor_id\b *( *)/d
382 s/\bcfs_get_cpu\b/get_cpu/g
383 /#[ \t]*define[ \t]*\bget_cpu\b *( *)[ \t]*\bget_cpu\b *( *)/d
384 s/\bcfs_put_cpu\b/put_cpu/g
385 /#[ \t]*define[ \t]*\bput_cpu\b *( *)[ \t]*\bput_cpu\b *( *)/d
386
387 ################################################################################
388 # macros in linux-time.h
389 s/\bCFS_HZ\b/HZ/g
390 /#[ \t]*define[ \t]*\bHZ\b[ \t]*\bHZ\b/d
391 s/\bCURRENT_KERN_TIME\b/CURRENT_TIME/g
392 /#[ \t]*define[ \t]*\bCURRENT_TIME\b[ \t]*\bCURRENT_TIME\b/d
393 s/\bcfs_gettimeofday\b/do_gettimeofday/g
394 /#[ \t]*define[ \t]*\bdo_gettimeofday\b *( *\w* *)[ \t]*\bdo_gettimeofday\b *( *\w* *)/d
395
396 ################################################################################
397 # macros in linux-type.h
398 s/\bcfs_umode_t\b/umode_t/g
399 /typedef[ \t]*\bumode_t\b[ \t]*\bumode_t\b/d
400
401 ################################################################################
402 # macros in libcfs/include/libcfs/linux/libcfs.h
403 s/\bCFS_THREAD_SIZE\b/THREAD_SIZE/g
404 /#[ \t]*define[ \t]*\bTHREAD_SIZE\b[ \t]*\bTHREAD_SIZE\b/d
405 s/\bcfs_kernel_cap_t\b/kernel_cap_t/g
406 /typedef[ \t]*\bkernel_cap_t\b[ \t]*\bkernel_cap_t\b/d
407
408 ################################################################################
409 # macros in libcfs/include/libcfs/linux/portals_compat25.h
410 s/\bRECALC_SIGPENDING\b/recalc_sigpending()/g
411 /#[ \t]*define[ \t]*\brecalc_sigpending\b *( *)[ \t]*\brecalc_sigpending\b *( *)/d
412 s/\bCLEAR_SIGPENDING\b/clear_tsk_thread_flag(current, TIF_SIGPENDING)/g
413 /#[ \t]*define[ \t]*\bclear_tsk_thread_flag\b *( *\w* *, *\w* *)[ \t]*\bclear_tsk_thread_flag\b *( *\w* *, *\w* *)/d
414 s/\bCURRENT_SECONDS\b/get_seconds()/g
415 /#[ \t]*define[ \t]*\bget_seconds\b *( *)[ \t]*\bget_seconds\b *( *)/d
416 s/\bCFS_NR_CPUS\b/NR_CPUS/g
417 /#[ \t]*define[ \t]*\bNR_CPUS\b[ \t]*\bNR_CPUS\b/d
418
419 ################################################################################
420 # cfs_curproc_xxx macros
421 s/\bcfs_curproc_uid\b/current_uid/g
422 /#[ \t]*define[ \t]*\bcurrent_uid\b *( *)[ \t]*\bcurrent_uid\b *( *)/d
423 s/\bcfs_curproc_gid\b/current_gid/g
424 /#[ \t]*define[ \t]*\bcurrent_gid\b *( *)[ \t]*\bcurrent_gid\b *( *)/d
425 s/\bcfs_curproc_euid\b/current_euid/g
426 /#[ \t]*define[ \t]*\bcurrent_euid\b *( *)[ \t]*\bcurrent_euid\b *( *)/d
427 s/\bcfs_curproc_egid\b/current_egid/g
428 /#[ \t]*define[ \t]*\bcurrent_egid\b *( *)[ \t]*\bcurrent_egid\b *( *)/d
429 s/\bcfs_curproc_fsuid\b/current_fsuid/g
430 /#[ \t]*define[ \t]*\bcurrent_fsuid\b *( *)[ \t]*\bcurrent_fsuid\b *( *)/d
431 s/\bcfs_curproc_fsgid\b/current_fsgid/g
432 /#[ \t]*define[ \t]*\bcurrent_fsgid\b *( *)[ \t]*\bcurrent_fsgid\b *( *)/d
433 s/\bcfs_curproc_pid\b/current_pid/g
434 s/\bcfs_curproc_is_in_groups\b/in_group_p/g
435 s/\bcfs_curproc_umask\b/current_umask/g
436 s/\bcfs_curproc_comm\b/current_comm/g
437 s/\bcfs_curproc_is_32bit\b/current_is_32bit/g
438
439 ################################################################################
440 # linux primitives (linux-prim.h)
441 # debug level
442 s/\bCFS_KERN_EMERG\b/KERN_EMERG/g
443 /#[ \t]*define[ \t]*\bKERN_EMERG\b[ \t]*\bKERN_EMERG\b/d
444 s/\bCFS_KERN_ALERT\b/KERN_ALERT/g
445 /#[ \t]*define[ \t]*\bKERN_ALERT\b[ \t]*\bKERN_ALERT\b/d
446 s/\bCFS_KERN_CRIT\b/KERN_CRIT/g
447 /#[ \t]*define[ \t]*\bKERN_CRIT\b[ \t]*\bKERN_CRIT\b/d
448 s/\bCFS_KERN_ERR\b/KERN_ERR/g
449 /#[ \t]*define[ \t]*\bKERN_ERR\b[ \t]*\bKERN_ERR\b/d
450 s/\bCFS_KERN_WARNING\b/KERN_WARNING/g
451 /#[ \t]*define[ \t]*\bKERN_WARNING\b[ \t]*\bKERN_WARNING\b/d
452 s/\bCFS_KERN_NOTICE\b/KERN_NOTICE/g
453 /#[ \t]*define[ \t]*\bKERN_NOTICE\b[ \t]*\bKERN_NOTICE\b/d
454 s/\bCFS_KERN_INFO\b/KERN_INFO/g
455 /#[ \t]*define[ \t]*\bKERN_INFO\b[ \t]*\bKERN_INFO\b/d
456 s/\bCFS_KERN_DEBUG\b/KERN_DEBUG/g
457 /#[ \t]*define[ \t]*\bKERN_DEBUG\b[ \t]*\bKERN_DEBUG\b/d
458 # cache
459 s/\bCFS_L1_CACHE_ALIGN\b/L1_CACHE_ALIGN/g
460 /#[ \t]*define[ \t]*\bL1_CACHE_ALIGN\b *( *\w* *)[ \t]*\bL1_CACHE_ALIGN\b *( *\w* *)/d
461 # IRQs
462 s/\bCFS_NR_IRQS\b/NR_IRQS/g
463 /#[ \t]*define[ \t]*\bNR_IRQS\b[ \t]*\bNR_IRQS\b/d
464 s/\bCFS_EXPORT_SYMBOL\b/EXPORT_SYMBOL/g
465 /#[ \t]*define[ \t]*\bEXPORT_SYMBOL\b *( *\w* *)[ \t]*\bEXPORT_SYMBOL\b *( *\w* *)/d
466 # Pseudo device register
467 s/\bcfs_psdev_t\b/struct miscdevice/g
468 s/\bcfs_psdev_register\b/misc_register/g
469 /#[ \t]*define[ \t]*\bmisc_register\b *( *\w* *)[ \t]*\bmisc_register\b *( *\w* *)/d
470 s/\bcfs_psdev_deregister\b/misc_deregister/g
471 /#[ \t]*define[ \t]*\bmisc_deregister\b *( *\w* *)[ \t]*\bmisc_deregister\b *( *\w* *)/d
472 # Sysctl register
473 s/\bcfs_sysctl_table_t\b/struct ctl_table/g
474 s/\bcfs_sysctl_table_header_t\b/struct ctl_table_header/g
475 # Symbol register
476 s/\bcfs_register_sysctl_table\b/register_sysctl_table/g
477 s/\bcfs_unregister_sysctl_table\b/unregister_sysctl_table/g
478 /#[ \t]*define[ \t]*\bunregister_sysctl_table\b *( *\w* *)[ \t]*\bunregister_sysctl_table\b *( *\w* *)/d
479 s/\bPORTAL_SYMBOL_PUT\b/symbol_put/g
480 /#[ \t]*define[ \t]*\bsymbol_put\b *( *\w* *)[ \t]*\bsymbol_put\b *( *\w* *)/d
481 s/\bPORTAL_SYMBOL_GET\b/symbol_get/g
482 /#[ \t]*define[ \t]*\bsymbol_get\b *( *\w* *)[ \t]*\bsymbol_get\b *( *\w* *)/d
483 # Module interfaces
484 s/\bPORTAL_MODULE_USE\b/cfs_module_get()/g
485 s/\bcfs_module_get()/try_module_get(THIS_MODULE)/g
486 s/\bcfs_try_module_get\b/try_module_get/g
487 /#[ \t]*define[ \t]*\btry_module_get\b.*\btry_module_get\b/d
488 s/\bPORTAL_MODULE_UNUSE\b/cfs_module_put(THIS_MODULE)/g
489 s/\bcfs_module_put\b/module_put/g
490 /#[ \t]*define[ \t]*\bmodule_put\b *( *\w* *)[ \t]*\bmodule_put\b *( *\w* *)/d
491 s/\b__cfs_module_get\b/__module_get/g
492 /#[ \t]*define[ \t]*\b__module_get\b *( *\w* *)[ \t]*\b__module_get\b *( *\w* *)/d
493 s/\bcfs_module_refcount\b/module_refcount/g
494 /#[ \t]*define[ \t]*\bmodule_refcount\b *( *\w* *)[ \t]*\bmodule_refcount\b *( *\w* *)/d
495 s/\bcfs_module_t\b/struct module/g
496 # s/\bcfs_module\b/declare_module/g
497 s/\bcfs_request_module\b/request_module/g
498 /#[ \t]*define[ \t]*\brequest_module\b[ \t]*\brequest_module\b/d
499 # Wait Queue
500 s/\bCFS_TASK_INTERRUPTIBLE\b/TASK_INTERRUPTIBLE/g
501 /#[ \t]*define[ \t]*\bTASK_INTERRUPTIBLE\b[ \t]*\bTASK_INTERRUPTIBLE\b/d
502 s/\bCFS_TASK_UNINT\b/TASK_UNINTERRUPTIBLE/g
503 /#[ \t]*define[ \t]*\bTASK_UNINTERRUPTIBLE\b[ \t]*\bTASK_UNINTERRUPTIBLE\b/d
504 s/\bCFS_TASK_RUNNING\b/TASK_RUNNING/g
505 /#[ \t]*define[ \t]*\bTASK_RUNNING\b[ \t]*\bTASK_RUNNING\b/d
506 s/\bcfs_set_current_state\b/set_current_state/g
507 /#[ \t]*define[ \t]*\bset_current_state\b *( *\w* *)[ \t]*\bset_current_state\b *( *\w* *)/d
508 s/\bcfs_wait_event\b/wait_event/g
509 /#[ \t]*define[ \t]*\bwait_event\b *( *\w* *, *\w* *)[ \t]*\bwait_event\b *( *\w* *, *\w* *)/d
510 s/\bcfs_waitlink_t\b/wait_queue_t/g
511 /typedef[ \t]*\bwait_queue_t\b[ \t]*\bwait_queue_t\b/d
512 s/\bcfs_waitq_t\b/wait_queue_head_t/g
513 /typedef[ \t]*\bwait_queue_head_t\b[ \t]*\bwait_queue_head_t\b/d
514 #s/\bcfs_task_state_t\b/task_state_t/g
515 s/\bcfs_waitq_init\b/init_waitqueue_head/g
516 /#[ \t]*define[ \t]*\binit_waitqueue_head\b *( *\w* *)[ \t]*\binit_waitqueue_head\b *( *\w* *)/d
517 s/\bcfs_waitlink_init\b/init_waitqueue_entry_current/g
518 s/\bcfs_waitq_add\b/add_wait_queue/g
519 /#[ \t]*define[ \t]*\badd_wait_queue\b *( *\w* *, *\w* *)[ \t]*\badd_wait_queue\b *( *\w* *, *\w* *)/d
520 s/\bcfs_waitq_add_exclusive\b/add_wait_queue_exclusive/g
521 /#[ \t]*define[ \t]*\badd_wait_queue_exclusive\b *( *\w* *, *\w* *)[ \t]*\badd_wait_queue_exclusive\b *( *\w* *, *\w* *)/d
522 s/\bcfs_waitq_del\b/remove_wait_queue/g
523 /#[ \t]*define[ \t]*\bremove_wait_queue\b *( *\w* *, *\w* *)[ \t]*\bremove_wait_queue\b *( *\w* *, *\w* *)/d
524 s/\bcfs_waitq_active\b/waitqueue_active/g
525 /#[ \t]*define[ \t]*\bwaitqueue_active\b *( *\w* *)[ \t]*\bwaitqueue_active\b *( *\w* *)/d
526 s/\bcfs_waitq_signal\b/wake_up/g
527 /#[ \t]*define[ \t]*\bwake_up\b *( *\w* *)[ \t]*\bwake_up\b *( *\w* *)/d
528 s/\bcfs_waitq_signal_nr\b/wake_up_nr/g
529 /#[ \t]*define[ \t]*\bwake_up_nr\b *( *\w* *, *\w* *)[ \t]*\bwake_up_nr\b *( *\w* *, *\w* *)/d
530 s/\bcfs_waitq_broadcast\b/wake_up_all/g
531 /#[ \t]*define[ \t]*\bwake_up_all\b *( *\w* *)[ \t]*\bwake_up_all\b *( *\w* *)/d
532 s/\bcfs_waitq_wait\b/waitq_wait/g
533 s/\bcfs_waitq_timedwait\b/waitq_timedwait/g
534 s/\bcfs_schedule_timeout\b/schedule_timeout/g
535 /#[ \t]*define[ \t]*\bschedule_timeout\b *( *\w* *)[ \t]*\bschedule_timeout\b *( *\w* *)/d
536 s/\bcfs_schedule\b/schedule/g
537 /#[ \t]*define[ \t]*\bschedule\b *( *)[ \t]*\bschedule\b *( *)/d
538 s/\bcfs_need_resched\b/need_resched/g
539 /#[ \t]*define[ \t]*\bneed_resched\b *( *)[ \t]*\bneed_resched\b *( *)/d
540 s/\bcfs_cond_resched\b/cond_resched/g
541 /#[ \t]*define[ \t]*\bcond_resched\b *( *)[ \t]*\bcond_resched\b *( *)/d
542 s/\bcfs_waitq_add_exclusive_head\b/add_wait_queue_exclusive_head/g
543 s/\bcfs_schedule_timeout_and_set_state\b/schedule_timeout_and_set_state/g
544 s/\bCFS_MAX_SCHEDULE_TIMEOUT\b/MAX_SCHEDULE_TIMEOUT/g
545 s/\bcfs_task_state_t\b/long/g
546
547 # Kernel thread
548 s/\bcfs_kthread_run\b/kthread_run/g
549 /#[ \t]*define[ \t]*\bkthread_run\b.*\bkthread_run\b/d
550 #s/\bcfs_thread_t\b/thread_t/g
551 s/\bCFS_DAEMON_FLAGS\b/DAEMON_FLAGS/g
552 #s/\bcfs_create_thread\b/create_thread/g
553 # Task struct
554 s/\bcfs_task_t\b/struct task_struct/g
555 s/\bcfs_current()/current/g
556 /#[ \t]*define[ \t]*\bcurrent\b[ \t]*\bcurrent\b/d
557 s/\bcfs_task_lock\b/task_lock/g
558 /#[ \t]*define[ \t]*\btask_lock\b *( *\w* *)[ \t]*\btask_lock\b *( *\w* *)/d
559 s/\bcfs_task_unlock\b/task_unlock/g
560 /#[ \t]*define[ \t]*\btask_unlock\b *( *\w* *)[ \t]*\btask_unlock\b *( *\w* *)/d
561 s/\bCFS_DECL_JOURNAL_DATA\b/DECL_JOURNAL_DATA/g
562 s/\bCFS_PUSH_JOURNAL\b/PUSH_JOURNAL/g
563 s/\bCFS_POP_JOURNAL\b/POP_JOURNAL/g
564 # Signal
565 s/\bcfs_sigset_t\b/sigset_t/g
566 /typedef[ \t]*\bsigset_t\b[ \t]*\bsigset_t\b/d
567 # Timer
568 s/\bcfs_timer_t\b/struct timer_list/g
569 s/\bCFS_MAX_SCHEDULE_TIMEOUT\b/MAX_SCHEDULE_TIMEOUT/g
570 /#[ \t]*define[ \t]*\bMAX_SCHEDULE_TIMEOUT\b[ \t]*\bMAX_SCHEDULE_TIMEOUT\b/d
571
572 # membar
573 s/\bcfs_mb\b/smp_mb/g
574 /#[ \t]*define[ \t]*\bmb\b *( *)[ \t]*\bmb\b *( *)/d
575 # interrupt
576 s/\bcfs_in_interrupt\b/in_interrupt/g
577 /#[ \t]*define[ \t]*\bin_interrupt\b *( *)[ \t]*\bin_interrupt\b *( *)/d
578 # might_sleep
579 s/\bcfs_might_sleep\b/might_sleep/g
580 /#[ \t]*define[ \t]*\bmight_sleep\b *( *)[ \t]*\bmight_sleep\b *( *)/d
581 # group_info
582 s/\bcfs_group_info_t\b/struct group_info/g
583 s/\bcfs_get_group_info\b/get_group_info/g
584 /#[ \t]*define[ \t]*\bget_group_info\b *( *\w* *)[ \t]*\bget_group_info\b *( *\w* *)/d
585 s/\bcfs_put_group_info\b/put_group_info/g
586 /#[ \t]*define[ \t]*\bput_group_info\b *( *\w* *)[ \t]*\bput_group_info\b *( *\w* *)/d
587 s/\bcfs_set_current_groups\b/set_current_groups/g
588 /#[ \t]*define[ \t]*\bset_current_groups\b *( *\w* *)[ \t]*\bset_current_groups\b *( *\w* *)/d
589 s/\bcfs_groups_free\b/groups_free/g
590 /#[ \t]*define[ \t]*\bgroups_free\b *( *\w* *)[ \t]*\bgroups_free\b *( *\w* *)/d
591 s/\bcfs_groups_alloc\b/groups_alloc/g
592 /#[ \t]*define[ \t]*\bgroups_alloc\b *( *\w* *)[ \t]*\bgroups_alloc\b *( *\w* *)/d
593 # Random bytes
594 s/\bcfs_get_random_bytes_prim\b/get_random_bytes/g
595 /#[ \t]*define[ \t]*\bget_random_bytes\b *( *\w* *, *\w* *)[ \t]*\bget_random_bytes\b *( *\w* *, *\w* *)/d
596
597 ################################################################################
598 # list operations
599 s/\bcfs_hlist_for_each\b/hlist_for_each/g
600 /#[ \t]*define[ \t]*\bhlist_for_each\b *(.*)[ \t]*\bhlist_for_each\b *(.*)/d
601 s/\bcfs_hlist_for_each_safe\b/hlist_for_each_safe/g
602 /#[ \t]*define[ \t]*\bhlist_for_each_safe\b *(.*)[ \t]*\bhlist_for_each_safe\b *(.*)/d
603 s/\bcfs_hlist_for_each_entry_continue\b/hlist_for_each_entry_continue/g
604 /#[ \t]*define[ \t]*\bhlist_for_each_entry_continue\b *(.*)[ \t]*\bhlist_for_each_entry_continue\b *(.*)/d
605 s/\bcfs_hlist_for_each_entry_from\b/hlist_for_each_entry_from/g
606 /#[ \t]*define[ \t]*\bhlist_for_each_entry_from\b *(.*)[ \t]*\bhlist_for_each_entry_from\b *(.*)/d