Whamcloud - gitweb
LU-15197 llite: Do not count tiny write twice
[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
258 ################################################################################
259 # memory operations
260 s/\bcfs_page_t\b/struct page/g
261 /typedef[ \t]*\bstruct page\b[ \t]*\bstruct page\b/d
262 s/\bCFS_PAGE_SIZE\b/PAGE_CACHE_SIZE/g
263 /#[ \t]*define[ \t]*\bPAGE_CACHE_SIZE\b[ \t]*\bPAGE_CACHE_SIZE\b/d
264 s/\bCFS_PAGE_SHIFT\b/PAGE_CACHE_SHIFT/g
265 /#[ \t]*define[ \t]*\bPAGE_CACHE_SHIFT\b[ \t]*\bPAGE_CACHE_SHIFT\b/d
266 s/\bcfs_num_physpages\b/num_physpages/g
267 /#[ \t]*define[ \t]*\bnum_physpages\b[ \t]*\bnum_physpages\b/d
268 s/\bcfs_copy_from_user\b/copy_from_user/g
269 /#[ \t]*define[ \t]*\bcopy_from_user\b *( *\w* *, *\w* *, *\w* *)[ \t]*\bcopy_from_user\b *( *\w* *, *\w* *, *\w* *)/d
270 s/\bcfs_copy_to_user\b/copy_to_user/g
271 /#[ \t]*define[ \t]*\bcopy_to_user\b *( *\w* *, *\w* *, *\w* *)[ \t]*\bcopy_to_user\b *( *\w* *, *\w* *, *\w* *)/d
272 s/\bcfs_page_address\b/page_address/g
273 /#[ \t]*define[ \t]*\bpage_address\b *( *\w* *)[ \t]*\bpage_address\b *( *\w* *)/d
274 s/\bcfs_kmap\b/kmap/g
275 /#[ \t]*define[ \t]*\bkmap\b *( *\w* *)[ \t]*\bkmap\b *( *\w* *)/d
276 s/\bcfs_kunmap\b/kunmap/g
277 /#[ \t]*define[ \t]*\bkunmap\b *( *\w* *)[ \t]*\bkunmap\b *( *\w* *)/d
278 s/\bcfs_get_page\b/get_page/g
279 /#[ \t]*define[ \t]*\bget_page\b *( *\w* *)[ \t]*\bget_page\b *( *\w* *)/d
280 s/\bcfs_page_count\b/page_count/g
281 /#[ \t]*define[ \t]*\bpage_count\b *( *\w* *)[ \t]*\bpage_count\b *( *\w* *)/d
282 s/\bcfs_page_index\b/page_index/g
283 /#[ \t]*define[ \t]*\bpage_index\b *( *\w* *)[ \t]*\bpage_index\b *( *\w* *)/d
284 s/\bcfs_page_pin\b/page_cache_get/g
285 /#[ \t]*define[ \t]*\bpage_cache_get\b *( *\w* *)[ \t]*\bpage_cache_get\b *( *\w* *)/d
286 s/\bcfs_page_unpin\b/page_cache_release/g
287 /#[ \t]*define[ \t]*\bpage_cache_release\b *( *\w* *)[ \t]*\bpage_cache_release\b *( *\w* *)/d
288 s/\bcfs_memory_pressure_get\b/memory_pressure_get/g
289 s/\bcfs_memory_pressure_set\b/memory_pressure_set/g
290 s/\bcfs_memory_pressure_clr\b/memory_pressure_clr/g
291 s/\bCFS_NUM_CACHEPAGES\b/NUM_CACHEPAGES/g
292  # memory allocator
293 s/\bCFS_ALLOC_ATOMIC\b/GFP_ATOMIC/g
294 /#[ \t]*define[ \t]*\bGFP_ATOMIC\b[ \t]*\bGFP_ATOMIC\b/d
295 s/\bCFS_ALLOC_WAIT\b/__GFP_WAIT/g
296 /#[ \t]*define[ \t]*\b__GFP_WAIT\b[ \t]*\b__GFP_WAIT\b/d
297 s/\bCFS_ALLOC_ZERO\b/__GFP_ZERO/g
298 /#[ \t]*define[ \t]*\b__GFP_ZERO\b[ \t]*\b__GFP_ZERO\b/d
299 s/\bCFS_ALLOC_FS\b/__GFP_FS/g
300 /#[ \t]*define[ \t]*\b__GFP_FS\b[ \t]*\b__GFP_FS\b/d
301 s/\bCFS_ALLOC_IO\b/__GFP_IO/g
302 /#[ \t]*define[ \t]*\b__GFP_IO\b[ \t]*\b__GFP_IO\b/d
303 s/\bCFS_ALLOC_NOWARN\b/__GFP_NOWARN/g
304 /#[ \t]*define[ \t]*\b__GFP_NOWARN\b[ \t]*\b__GFP_NOWARN\b/d
305 s/\bCFS_ALLOC_STD\b/GFP_IOFS/g
306 /#[ \t]*define[ \t]*\bGFP_IOFS\b[ \t]*\bGFP_IOFS\b/d
307 s/\bCFS_ALLOC_USER\b/GFP_USER/g
308 /#[ \t]*define[ \t]*\bGFP_USER\b[ \t]*\bGFP_USER\b/d
309 s/\bCFS_ALLOC_KERNEL\b/GFP_KERNEL/g
310 /#[ \t]*define[ \t]*\bGFP_KERNEL\b[ \t]*\bGFP_KERNEL\b/d
311 s/\bCFS_ALLOC_NOFS\b/GFP_NOFS/g
312 /#[ \t]*define[ \t]*\bGFP_NOFS\b[ \t]*\bGFP_NOFS\b/d
313 s/\bCFS_ALLOC_HIGHMEM\b/__GFP_HIGHMEM/g
314 /#[ \t]*define[ \t]*\b__GFP_HIGHMEM\b[ \t]*\b__GFP_HIGHMEM\b/d
315 s/\bCFS_ALLOC_HIGHUSER\b/GFP_HIGHUSER/g
316 /#[ \t]*define[ \t]*\bGFP_HIGHUSER\b[ \t]*\bGFP_HIGHUSER\b/d
317 s/\bCFS_ALLOC_ATOMIC_TRY\b/ALLOC_ATOMIC_TRY/g
318 s/\bcfs_alloc\b/kmalloc/g
319 /#[ \t]*define[ \t]*\bkmalloc\b *( *\w* *, *\w* *)[ \t]*\bkmalloc\b *( *\w* *, *\w* *)/d
320 s/\bcfs_free\b/kfree/g
321 /#[ \t]*define[ \t]*\bkfree\b *( *\w* *)[ \t]*\bkfree\b *( *\w* *)/d
322 s/\bcfs_alloc_large\b/vmalloc/g
323 /#[ \t]*define[ \t]*\bvmalloc\b *( *\w* *)[ \t]*\bvmalloc\b *( *\w* *)/d
324 s/\bcfs_free_large\b/vfree/g
325 /#[ \t]*define[ \t]*\bvfree\b *( *\w* *)[ \t]*\bvfree\b *( *\w* *)/d
326 s/\bcfs_alloc_page\b/alloc_page/g
327 /#[ \t]*define[ \t]*\balloc_page\b *( *\w* *)[ \t]*\balloc_page\b *( *\w* *)/d
328 s/\bcfs_free_page\b/__free_page/g
329 /#[ \t]*define[ \t]*\b__free_page\b *( *\w* *)[ \t]*\b__free_page\b *( *\w* *)/d
330 # TODO: SLAB allocator
331 s/\bCFS_DECL_MMSPACE\b/DECL_MMSPACE/g
332 s/\bCFS_MMSPACE_OPEN\b/MMSPACE_OPEN/g
333 s/\bCFS_MMSPACE_CLOSE\b/MMSPACE_CLOSE/g
334 s/\bCFS_SLAB_HWCACHE_ALIGN\b/SLAB_HWCACHE_ALIGN/g
335 /#[ \t]*define[ \t]*\bSLAB_HWCACHE_ALIGN\b[ \t]*\bSLAB_HWCACHE_ALIGN\b/d
336 s/\bCFS_SLAB_KERNEL\b/SLAB_KERNEL/g
337 /#[ \t]*define[ \t]*\bSLAB_KERNEL\b[ \t]*\bSLAB_KERNEL\b/d
338 s/\bCFS_SLAB_NOFS\b/SLAB_NOFS/g
339 /#[ \t]*define[ \t]*\bSLAB_NOFS\b[ \t]*\bSLAB_NOFS\b/d
340 s/\bcfs_shrinker\b/shrinker/g
341 /#[ \t]*define[ \t]*\bshrinker\b[ \t]*\bshrinker\b/d
342 s/\bcfs_shrinker_t\b/shrinker_t/g
343 /typedef[ \t]*\bshrinker_t\b[ \t]*\bshrinker_t\b/d
344 s/\bcfs_set_shrinker\b/set_shrinker/g
345 /#[ \t]*define[ \t]*\bset_shrinker\b *( *\w* *, *\w* *)[ \t]*\bset_shrinker\b *( *\w* *, *\w* *)/d
346 s/\bcfs_remove_shrinker\b/remove_shrinker/g
347 /#[ \t]*define[ \t]*\bremove_shrinker\b *( *\w* *)[ \t]*\bremove_shrinker\b *( *\w* *)/d
348 s/\bCFS_DEFAULT_SEEKS\b/DEFAULT_SEEKS/g
349 /#[ \t]*define[ \t]*\bDEFAULT_SEEKS\b[ \t]*\bDEFAULT_SEEKS\b/d
350 s/cfs_mem_cache_t/struct kmem_cache/g
351 s/cfs_mem_cache_create/kmem_cache_create/g
352 s/\w+[ =]*cfs_mem_cache_destroy/kmem_cache_destroy/g
353 s/cfs_mem_cache_destroy/kmem_cache_destroy/g
354 s/cfs_mem_cache_alloc/kmem_cache_alloc/g
355 s/cfs_mem_cache_free/kmem_cache_free/g
356 s/cfs_mem_is_in_cache/kmem_is_in_cache/g
357
358 ################################################################################
359 # macros in kp30.h
360
361 s/\bcfs_num_online_cpus\b/num_online_cpus/g
362 /#[ \t]*define[ \t]*\bnum_online_cpus\b *( *)[ \t]*\bnum_online_cpus\b *( *)/d
363 s/\bwait_on_page\b/wait_on_page_locked/g
364 /#[ \t]*define[ \t]*\bwait_on_page_locked\b[ \t]*\bwait_on_page_locked\b/d
365 s/^\([ \t]*\)LASSERT_SPIN_LOCKED\b *\((.*)\)/\1LASSERT(spin_is_locked\2)/g
366 /#[ \t]*define[ \t]*\bLASSERT_SPIN_LOCKED\b/d
367 s/^\([ \t]*\)LINVRNT_SPIN_LOCKED\b *\((.*)\)/\1LINVRNT(spin_is_locked\2)/g
368 /#[ \t]*define[ \t]*\bLINVRNT_SPIN_LOCKED\b/d
369 s/^\([ \t]*\)LASSERT_SEM_LOCKED\b *\((.*)\)/\1LASSERT(down_trylock\2 != 0)/g
370 /#[ \t]*define[ \t]*\bLASSERT_SEM_LOCKED\b/d
371 s/^\([ \t]*\)LASSERT_MUTEX_LOCKED\b *\((.*)\)/\1LASSERT(mutex_is_locked\2)/g
372 /#[ \t]*define[ \t]*\bLASSERT_MUTEX_LOCKED\b/d
373 s/\bLIBCFS_PANIC\b/panic/g
374 /#[ \t]*define[ \t]*\bpanic\b *( *\w* *)[ \t]*\bpanic\b *( *\w* *)/d
375 s/\bcfs_num_possible_cpus\b/num_possible_cpus/g
376 /#[ \t]*define[ \t]*\bnum_possible_cpus\b *( *)[ \t]*\bnum_possible_cpus\b *( *)/d
377 s/\bcfs_smp_processor_id\b/smp_processor_id/g
378 /#[ \t]*define[ \t]*\bsmp_processor_id\b *( *)[ \t]*\bsmp_processor_id\b *( *)/d
379 s/\bcfs_get_cpu\b/get_cpu/g
380 /#[ \t]*define[ \t]*\bget_cpu\b *( *)[ \t]*\bget_cpu\b *( *)/d
381 s/\bcfs_put_cpu\b/put_cpu/g
382 /#[ \t]*define[ \t]*\bput_cpu\b *( *)[ \t]*\bput_cpu\b *( *)/d
383
384 ################################################################################
385 # macros in linux-time.h
386 s/\bCFS_HZ\b/HZ/g
387 /#[ \t]*define[ \t]*\bHZ\b[ \t]*\bHZ\b/d
388 s/\bCURRENT_KERN_TIME\b/CURRENT_TIME/g
389 /#[ \t]*define[ \t]*\bCURRENT_TIME\b[ \t]*\bCURRENT_TIME\b/d
390 s/\bcfs_gettimeofday\b/do_gettimeofday/g
391 /#[ \t]*define[ \t]*\bdo_gettimeofday\b *( *\w* *)[ \t]*\bdo_gettimeofday\b *( *\w* *)/d
392
393 ################################################################################
394 # macros in linux-type.h
395 s/\bcfs_umode_t\b/umode_t/g
396 /typedef[ \t]*\bumode_t\b[ \t]*\bumode_t\b/d
397
398 ################################################################################
399 # macros in libcfs/include/libcfs/linux/libcfs.h
400 s/\bCFS_THREAD_SIZE\b/THREAD_SIZE/g
401 /#[ \t]*define[ \t]*\bTHREAD_SIZE\b[ \t]*\bTHREAD_SIZE\b/d
402 s/\bcfs_kernel_cap_t\b/kernel_cap_t/g
403 /typedef[ \t]*\bkernel_cap_t\b[ \t]*\bkernel_cap_t\b/d
404
405 ################################################################################
406 # macros in libcfs/include/libcfs/linux/portals_compat25.h
407 s/\bRECALC_SIGPENDING\b/recalc_sigpending()/g
408 /#[ \t]*define[ \t]*\brecalc_sigpending\b *( *)[ \t]*\brecalc_sigpending\b *( *)/d
409 s/\bCLEAR_SIGPENDING\b/clear_tsk_thread_flag(current, TIF_SIGPENDING)/g
410 /#[ \t]*define[ \t]*\bclear_tsk_thread_flag\b *( *\w* *, *\w* *)[ \t]*\bclear_tsk_thread_flag\b *( *\w* *, *\w* *)/d
411 s/\bCURRENT_SECONDS\b/get_seconds()/g
412 /#[ \t]*define[ \t]*\bget_seconds\b *( *)[ \t]*\bget_seconds\b *( *)/d
413 s/\bCFS_NR_CPUS\b/NR_CPUS/g
414 /#[ \t]*define[ \t]*\bNR_CPUS\b[ \t]*\bNR_CPUS\b/d
415
416 ################################################################################
417 # cfs_curproc_xxx macros
418 s/\bcfs_curproc_uid\b/current_uid/g
419 /#[ \t]*define[ \t]*\bcurrent_uid\b *( *)[ \t]*\bcurrent_uid\b *( *)/d
420 s/\bcfs_curproc_gid\b/current_gid/g
421 /#[ \t]*define[ \t]*\bcurrent_gid\b *( *)[ \t]*\bcurrent_gid\b *( *)/d
422 s/\bcfs_curproc_euid\b/current_euid/g
423 /#[ \t]*define[ \t]*\bcurrent_euid\b *( *)[ \t]*\bcurrent_euid\b *( *)/d
424 s/\bcfs_curproc_egid\b/current_egid/g
425 /#[ \t]*define[ \t]*\bcurrent_egid\b *( *)[ \t]*\bcurrent_egid\b *( *)/d
426 s/\bcfs_curproc_fsuid\b/current_fsuid/g
427 /#[ \t]*define[ \t]*\bcurrent_fsuid\b *( *)[ \t]*\bcurrent_fsuid\b *( *)/d
428 s/\bcfs_curproc_fsgid\b/current_fsgid/g
429 /#[ \t]*define[ \t]*\bcurrent_fsgid\b *( *)[ \t]*\bcurrent_fsgid\b *( *)/d
430 s/\bcfs_curproc_pid\b/current_pid/g
431 s/\bcfs_curproc_is_in_groups\b/in_group_p/g
432 s/\bcfs_curproc_umask\b/current_umask/g
433 s/\bcfs_curproc_comm\b/current_comm/g
434 s/\bcfs_curproc_is_32bit\b/current_is_32bit/g
435
436 ################################################################################
437 # linux primitives (linux-prim.h)
438 # debug level
439 s/\bCFS_KERN_EMERG\b/KERN_EMERG/g
440 /#[ \t]*define[ \t]*\bKERN_EMERG\b[ \t]*\bKERN_EMERG\b/d
441 s/\bCFS_KERN_ALERT\b/KERN_ALERT/g
442 /#[ \t]*define[ \t]*\bKERN_ALERT\b[ \t]*\bKERN_ALERT\b/d
443 s/\bCFS_KERN_CRIT\b/KERN_CRIT/g
444 /#[ \t]*define[ \t]*\bKERN_CRIT\b[ \t]*\bKERN_CRIT\b/d
445 s/\bCFS_KERN_ERR\b/KERN_ERR/g
446 /#[ \t]*define[ \t]*\bKERN_ERR\b[ \t]*\bKERN_ERR\b/d
447 s/\bCFS_KERN_WARNING\b/KERN_WARNING/g
448 /#[ \t]*define[ \t]*\bKERN_WARNING\b[ \t]*\bKERN_WARNING\b/d
449 s/\bCFS_KERN_NOTICE\b/KERN_NOTICE/g
450 /#[ \t]*define[ \t]*\bKERN_NOTICE\b[ \t]*\bKERN_NOTICE\b/d
451 s/\bCFS_KERN_INFO\b/KERN_INFO/g
452 /#[ \t]*define[ \t]*\bKERN_INFO\b[ \t]*\bKERN_INFO\b/d
453 s/\bCFS_KERN_DEBUG\b/KERN_DEBUG/g
454 /#[ \t]*define[ \t]*\bKERN_DEBUG\b[ \t]*\bKERN_DEBUG\b/d
455 # cache
456 s/\bCFS_L1_CACHE_ALIGN\b/L1_CACHE_ALIGN/g
457 /#[ \t]*define[ \t]*\bL1_CACHE_ALIGN\b *( *\w* *)[ \t]*\bL1_CACHE_ALIGN\b *( *\w* *)/d
458 # IRQs
459 s/\bCFS_NR_IRQS\b/NR_IRQS/g
460 /#[ \t]*define[ \t]*\bNR_IRQS\b[ \t]*\bNR_IRQS\b/d
461 s/\bCFS_EXPORT_SYMBOL\b/EXPORT_SYMBOL/g
462 /#[ \t]*define[ \t]*\bEXPORT_SYMBOL\b *( *\w* *)[ \t]*\bEXPORT_SYMBOL\b *( *\w* *)/d
463 # Pseudo device register
464 s/\bcfs_psdev_t\b/struct miscdevice/g
465 s/\bcfs_psdev_register\b/misc_register/g
466 /#[ \t]*define[ \t]*\bmisc_register\b *( *\w* *)[ \t]*\bmisc_register\b *( *\w* *)/d
467 s/\bcfs_psdev_deregister\b/misc_deregister/g
468 /#[ \t]*define[ \t]*\bmisc_deregister\b *( *\w* *)[ \t]*\bmisc_deregister\b *( *\w* *)/d
469 # Sysctl register
470 s/\bcfs_sysctl_table_t\b/struct ctl_table/g
471 s/\bcfs_sysctl_table_header_t\b/struct ctl_table_header/g
472 # Symbol register
473 s/\bcfs_register_sysctl_table\b/register_sysctl_table/g
474 s/\bcfs_unregister_sysctl_table\b/unregister_sysctl_table/g
475 /#[ \t]*define[ \t]*\bunregister_sysctl_table\b *( *\w* *)[ \t]*\bunregister_sysctl_table\b *( *\w* *)/d
476 s/\bPORTAL_SYMBOL_PUT\b/symbol_put/g
477 /#[ \t]*define[ \t]*\bsymbol_put\b *( *\w* *)[ \t]*\bsymbol_put\b *( *\w* *)/d
478 s/\bPORTAL_SYMBOL_GET\b/symbol_get/g
479 /#[ \t]*define[ \t]*\bsymbol_get\b *( *\w* *)[ \t]*\bsymbol_get\b *( *\w* *)/d
480 # Module interfaces
481 s/\bPORTAL_MODULE_USE\b/cfs_module_get()/g
482 s/\bcfs_module_get()/try_module_get(THIS_MODULE)/g
483 s/\bcfs_try_module_get\b/try_module_get/g
484 /#[ \t]*define[ \t]*\btry_module_get\b.*\btry_module_get\b/d
485 s/\bPORTAL_MODULE_UNUSE\b/cfs_module_put(THIS_MODULE)/g
486 s/\bcfs_module_put\b/module_put/g
487 /#[ \t]*define[ \t]*\bmodule_put\b *( *\w* *)[ \t]*\bmodule_put\b *( *\w* *)/d
488 s/\b__cfs_module_get\b/__module_get/g
489 /#[ \t]*define[ \t]*\b__module_get\b *( *\w* *)[ \t]*\b__module_get\b *( *\w* *)/d
490 s/\bcfs_module_refcount\b/module_refcount/g
491 /#[ \t]*define[ \t]*\bmodule_refcount\b *( *\w* *)[ \t]*\bmodule_refcount\b *( *\w* *)/d
492 s/\bcfs_module_t\b/struct module/g
493 # s/\bcfs_module\b/declare_module/g
494 s/\bcfs_request_module\b/request_module/g
495 /#[ \t]*define[ \t]*\brequest_module\b[ \t]*\brequest_module\b/d
496 # Wait Queue
497 s/\bCFS_TASK_INTERRUPTIBLE\b/TASK_INTERRUPTIBLE/g
498 /#[ \t]*define[ \t]*\bTASK_INTERRUPTIBLE\b[ \t]*\bTASK_INTERRUPTIBLE\b/d
499 s/\bCFS_TASK_UNINT\b/TASK_UNINTERRUPTIBLE/g
500 /#[ \t]*define[ \t]*\bTASK_UNINTERRUPTIBLE\b[ \t]*\bTASK_UNINTERRUPTIBLE\b/d
501 s/\bCFS_TASK_RUNNING\b/TASK_RUNNING/g
502 /#[ \t]*define[ \t]*\bTASK_RUNNING\b[ \t]*\bTASK_RUNNING\b/d
503 s/\bcfs_set_current_state\b/set_current_state/g
504 /#[ \t]*define[ \t]*\bset_current_state\b *( *\w* *)[ \t]*\bset_current_state\b *( *\w* *)/d
505 s/\bcfs_wait_event\b/wait_event/g
506 /#[ \t]*define[ \t]*\bwait_event\b *( *\w* *, *\w* *)[ \t]*\bwait_event\b *( *\w* *, *\w* *)/d
507 s/\bcfs_waitlink_t\b/wait_queue_t/g
508 /typedef[ \t]*\bwait_queue_t\b[ \t]*\bwait_queue_t\b/d
509 s/\bcfs_waitq_t\b/wait_queue_head_t/g
510 /typedef[ \t]*\bwait_queue_head_t\b[ \t]*\bwait_queue_head_t\b/d
511 #s/\bcfs_task_state_t\b/task_state_t/g
512 s/\bcfs_waitq_init\b/init_waitqueue_head/g
513 /#[ \t]*define[ \t]*\binit_waitqueue_head\b *( *\w* *)[ \t]*\binit_waitqueue_head\b *( *\w* *)/d
514 s/\bcfs_waitlink_init\b/init_waitqueue_entry_current/g
515 s/\bcfs_waitq_add\b/add_wait_queue/g
516 /#[ \t]*define[ \t]*\badd_wait_queue\b *( *\w* *, *\w* *)[ \t]*\badd_wait_queue\b *( *\w* *, *\w* *)/d
517 s/\bcfs_waitq_add_exclusive\b/add_wait_queue_exclusive/g
518 /#[ \t]*define[ \t]*\badd_wait_queue_exclusive\b *( *\w* *, *\w* *)[ \t]*\badd_wait_queue_exclusive\b *( *\w* *, *\w* *)/d
519 s/\bcfs_waitq_del\b/remove_wait_queue/g
520 /#[ \t]*define[ \t]*\bremove_wait_queue\b *( *\w* *, *\w* *)[ \t]*\bremove_wait_queue\b *( *\w* *, *\w* *)/d
521 s/\bcfs_waitq_active\b/waitqueue_active/g
522 /#[ \t]*define[ \t]*\bwaitqueue_active\b *( *\w* *)[ \t]*\bwaitqueue_active\b *( *\w* *)/d
523 s/\bcfs_waitq_signal\b/wake_up/g
524 /#[ \t]*define[ \t]*\bwake_up\b *( *\w* *)[ \t]*\bwake_up\b *( *\w* *)/d
525 s/\bcfs_waitq_signal_nr\b/wake_up_nr/g
526 /#[ \t]*define[ \t]*\bwake_up_nr\b *( *\w* *, *\w* *)[ \t]*\bwake_up_nr\b *( *\w* *, *\w* *)/d
527 s/\bcfs_waitq_broadcast\b/wake_up_all/g
528 /#[ \t]*define[ \t]*\bwake_up_all\b *( *\w* *)[ \t]*\bwake_up_all\b *( *\w* *)/d
529 s/\bcfs_waitq_wait\b/waitq_wait/g
530 s/\bcfs_waitq_timedwait\b/waitq_timedwait/g
531 s/\bcfs_schedule_timeout\b/schedule_timeout/g
532 /#[ \t]*define[ \t]*\bschedule_timeout\b *( *\w* *)[ \t]*\bschedule_timeout\b *( *\w* *)/d
533 s/\bcfs_schedule\b/schedule/g
534 /#[ \t]*define[ \t]*\bschedule\b *( *)[ \t]*\bschedule\b *( *)/d
535 s/\bcfs_need_resched\b/need_resched/g
536 /#[ \t]*define[ \t]*\bneed_resched\b *( *)[ \t]*\bneed_resched\b *( *)/d
537 s/\bcfs_cond_resched\b/cond_resched/g
538 /#[ \t]*define[ \t]*\bcond_resched\b *( *)[ \t]*\bcond_resched\b *( *)/d
539 s/\bcfs_waitq_add_exclusive_head\b/add_wait_queue_exclusive_head/g
540 s/\bcfs_schedule_timeout_and_set_state\b/schedule_timeout_and_set_state/g
541 s/\bCFS_MAX_SCHEDULE_TIMEOUT\b/MAX_SCHEDULE_TIMEOUT/g
542 s/\bcfs_task_state_t\b/long/g
543
544 # Kernel thread
545 s/\bcfs_kthread_run\b/kthread_run/g
546 /#[ \t]*define[ \t]*\bkthread_run\b.*\bkthread_run\b/d
547 #s/\bcfs_thread_t\b/thread_t/g
548 s/\bCFS_DAEMON_FLAGS\b/DAEMON_FLAGS/g
549 #s/\bcfs_create_thread\b/create_thread/g
550 # Task struct
551 s/\bcfs_task_t\b/struct task_struct/g
552 s/\bcfs_current()/current/g
553 /#[ \t]*define[ \t]*\bcurrent\b[ \t]*\bcurrent\b/d
554 s/\bcfs_task_lock\b/task_lock/g
555 /#[ \t]*define[ \t]*\btask_lock\b *( *\w* *)[ \t]*\btask_lock\b *( *\w* *)/d
556 s/\bcfs_task_unlock\b/task_unlock/g
557 /#[ \t]*define[ \t]*\btask_unlock\b *( *\w* *)[ \t]*\btask_unlock\b *( *\w* *)/d
558 s/\bCFS_DECL_JOURNAL_DATA\b/DECL_JOURNAL_DATA/g
559 s/\bCFS_PUSH_JOURNAL\b/PUSH_JOURNAL/g
560 s/\bCFS_POP_JOURNAL\b/POP_JOURNAL/g
561 # Signal
562 s/\bcfs_sigset_t\b/sigset_t/g
563 /typedef[ \t]*\bsigset_t\b[ \t]*\bsigset_t\b/d
564 # Timer
565 s/\bcfs_timer_t\b/struct timer_list/g
566 s/\bCFS_MAX_SCHEDULE_TIMEOUT\b/MAX_SCHEDULE_TIMEOUT/g
567 /#[ \t]*define[ \t]*\bMAX_SCHEDULE_TIMEOUT\b[ \t]*\bMAX_SCHEDULE_TIMEOUT\b/d
568
569 # membar
570 s/\bcfs_mb\b/smp_mb/g
571 /#[ \t]*define[ \t]*\bmb\b *( *)[ \t]*\bmb\b *( *)/d
572 # interrupt
573 s/\bcfs_in_interrupt\b/in_interrupt/g
574 /#[ \t]*define[ \t]*\bin_interrupt\b *( *)[ \t]*\bin_interrupt\b *( *)/d
575 # might_sleep
576 s/\bcfs_might_sleep\b/might_sleep/g
577 /#[ \t]*define[ \t]*\bmight_sleep\b *( *)[ \t]*\bmight_sleep\b *( *)/d
578 # group_info
579 s/\bcfs_group_info_t\b/struct group_info/g
580 s/\bcfs_get_group_info\b/get_group_info/g
581 /#[ \t]*define[ \t]*\bget_group_info\b *( *\w* *)[ \t]*\bget_group_info\b *( *\w* *)/d
582 s/\bcfs_put_group_info\b/put_group_info/g
583 /#[ \t]*define[ \t]*\bput_group_info\b *( *\w* *)[ \t]*\bput_group_info\b *( *\w* *)/d
584 s/\bcfs_set_current_groups\b/set_current_groups/g
585 /#[ \t]*define[ \t]*\bset_current_groups\b *( *\w* *)[ \t]*\bset_current_groups\b *( *\w* *)/d
586 s/\bcfs_groups_free\b/groups_free/g
587 /#[ \t]*define[ \t]*\bgroups_free\b *( *\w* *)[ \t]*\bgroups_free\b *( *\w* *)/d
588 s/\bcfs_groups_alloc\b/groups_alloc/g
589 /#[ \t]*define[ \t]*\bgroups_alloc\b *( *\w* *)[ \t]*\bgroups_alloc\b *( *\w* *)/d
590 # Random bytes
591 s/\bcfs_get_random_bytes_prim\b/get_random_bytes/g
592 /#[ \t]*define[ \t]*\bget_random_bytes\b *( *\w* *, *\w* *)[ \t]*\bget_random_bytes\b *( *\w* *, *\w* *)/d
593
594 ################################################################################
595 # list operations
596 s/\bcfs_hlist_for_each\b/hlist_for_each/g
597 /#[ \t]*define[ \t]*\bhlist_for_each\b *(.*)[ \t]*\bhlist_for_each\b *(.*)/d
598 s/\bcfs_hlist_for_each_safe\b/hlist_for_each_safe/g
599 /#[ \t]*define[ \t]*\bhlist_for_each_safe\b *(.*)[ \t]*\bhlist_for_each_safe\b *(.*)/d
600 s/\bcfs_hlist_for_each_entry_continue\b/hlist_for_each_entry_continue/g
601 /#[ \t]*define[ \t]*\bhlist_for_each_entry_continue\b *(.*)[ \t]*\bhlist_for_each_entry_continue\b *(.*)/d
602 s/\bcfs_hlist_for_each_entry_from\b/hlist_for_each_entry_from/g
603 /#[ \t]*define[ \t]*\bhlist_for_each_entry_from\b *(.*)[ \t]*\bhlist_for_each_entry_from\b *(.*)/d