]>
Commit | Line | Data |
---|---|---|
4d1e5b62 AF |
1 | From: Jeff Mahoney <jeffm@suse.com> |
2 | Subject: reiserfs: rename p_s_bh to bh | |
3 | ||
4 | This patch is a simple s/p_s_bh/bh/g to the reiserfs code. This is the second | |
5 | in a series of patches to rip out some of the awful variable naming in | |
6 | reiserfs. | |
7 | ||
8 | Signed-off-by: Jeff Mahoney <jeffm@suse.com> | |
9 | ||
10 | --- | |
11 | ||
12 | fs/reiserfs/fix_node.c | 94 ++++++++++++++++++++------------------------ | |
13 | fs/reiserfs/stree.c | 63 ++++++++++++++--------------- | |
14 | include/linux/reiserfs_fs.h | 37 ++++++++--------- | |
15 | 3 files changed, 94 insertions(+), 100 deletions(-) | |
16 | ||
17 | --- a/fs/reiserfs/fix_node.c | |
18 | +++ b/fs/reiserfs/fix_node.c | |
19 | @@ -1887,7 +1887,7 @@ static int check_balance(int mode, | |
20 | /* Check whether parent at the path is the really parent of the current node.*/ | |
21 | static int get_direct_parent(struct tree_balance *p_s_tb, int n_h) | |
22 | { | |
23 | - struct buffer_head *p_s_bh; | |
24 | + struct buffer_head *bh; | |
25 | struct treepath *p_s_path = p_s_tb->tb_path; | |
26 | int n_position, | |
27 | n_path_offset = PATH_H_PATH_OFFSET(p_s_tb->tb_path, n_h); | |
28 | @@ -1909,21 +1909,21 @@ static int get_direct_parent(struct tree | |
29 | } | |
30 | ||
31 | if (!B_IS_IN_TREE | |
32 | - (p_s_bh = PATH_OFFSET_PBUFFER(p_s_path, n_path_offset - 1))) | |
33 | + (bh = PATH_OFFSET_PBUFFER(p_s_path, n_path_offset - 1))) | |
34 | return REPEAT_SEARCH; /* Parent in the path is not in the tree. */ | |
35 | ||
36 | if ((n_position = | |
37 | PATH_OFFSET_POSITION(p_s_path, | |
38 | - n_path_offset - 1)) > B_NR_ITEMS(p_s_bh)) | |
39 | + n_path_offset - 1)) > B_NR_ITEMS(bh)) | |
40 | return REPEAT_SEARCH; | |
41 | ||
42 | - if (B_N_CHILD_NUM(p_s_bh, n_position) != | |
43 | + if (B_N_CHILD_NUM(bh, n_position) != | |
44 | PATH_OFFSET_PBUFFER(p_s_path, n_path_offset)->b_blocknr) | |
45 | /* Parent in the path is not parent of the current node in the tree. */ | |
46 | return REPEAT_SEARCH; | |
47 | ||
48 | - if (buffer_locked(p_s_bh)) { | |
49 | - __wait_on_buffer(p_s_bh); | |
50 | + if (buffer_locked(bh)) { | |
51 | + __wait_on_buffer(bh); | |
52 | if (FILESYSTEM_CHANGED_TB(p_s_tb)) | |
53 | return REPEAT_SEARCH; | |
54 | } | |
55 | @@ -1943,29 +1943,29 @@ static int get_neighbors(struct tree_bal | |
56 | n_path_offset = PATH_H_PATH_OFFSET(p_s_tb->tb_path, n_h + 1); | |
57 | unsigned long n_son_number; | |
58 | struct super_block *sb = p_s_tb->tb_sb; | |
59 | - struct buffer_head *p_s_bh; | |
60 | + struct buffer_head *bh; | |
61 | ||
62 | PROC_INFO_INC(sb, get_neighbors[n_h]); | |
63 | ||
64 | if (p_s_tb->lnum[n_h]) { | |
65 | /* We need left neighbor to balance S[n_h]. */ | |
66 | PROC_INFO_INC(sb, need_l_neighbor[n_h]); | |
67 | - p_s_bh = PATH_OFFSET_PBUFFER(p_s_tb->tb_path, n_path_offset); | |
68 | + bh = PATH_OFFSET_PBUFFER(p_s_tb->tb_path, n_path_offset); | |
69 | ||
70 | - RFALSE(p_s_bh == p_s_tb->FL[n_h] && | |
71 | + RFALSE(bh == p_s_tb->FL[n_h] && | |
72 | !PATH_OFFSET_POSITION(p_s_tb->tb_path, n_path_offset), | |
73 | "PAP-8270: invalid position in the parent"); | |
74 | ||
75 | n_child_position = | |
76 | - (p_s_bh == | |
77 | + (bh == | |
78 | p_s_tb->FL[n_h]) ? p_s_tb->lkey[n_h] : B_NR_ITEMS(p_s_tb-> | |
79 | FL[n_h]); | |
80 | n_son_number = B_N_CHILD_NUM(p_s_tb->FL[n_h], n_child_position); | |
81 | - p_s_bh = sb_bread(sb, n_son_number); | |
82 | - if (!p_s_bh) | |
83 | + bh = sb_bread(sb, n_son_number); | |
84 | + if (!bh) | |
85 | return IO_ERROR; | |
86 | if (FILESYSTEM_CHANGED_TB(p_s_tb)) { | |
87 | - brelse(p_s_bh); | |
88 | + brelse(bh); | |
89 | PROC_INFO_INC(sb, get_neighbors_restart[n_h]); | |
90 | return REPEAT_SEARCH; | |
91 | } | |
92 | @@ -1973,48 +1973,48 @@ static int get_neighbors(struct tree_bal | |
93 | RFALSE(!B_IS_IN_TREE(p_s_tb->FL[n_h]) || | |
94 | n_child_position > B_NR_ITEMS(p_s_tb->FL[n_h]) || | |
95 | B_N_CHILD_NUM(p_s_tb->FL[n_h], n_child_position) != | |
96 | - p_s_bh->b_blocknr, "PAP-8275: invalid parent"); | |
97 | - RFALSE(!B_IS_IN_TREE(p_s_bh), "PAP-8280: invalid child"); | |
98 | + bh->b_blocknr, "PAP-8275: invalid parent"); | |
99 | + RFALSE(!B_IS_IN_TREE(bh), "PAP-8280: invalid child"); | |
100 | RFALSE(!n_h && | |
101 | - B_FREE_SPACE(p_s_bh) != | |
102 | - MAX_CHILD_SIZE(p_s_bh) - | |
103 | + B_FREE_SPACE(bh) != | |
104 | + MAX_CHILD_SIZE(bh) - | |
105 | dc_size(B_N_CHILD(p_s_tb->FL[0], n_child_position)), | |
106 | "PAP-8290: invalid child size of left neighbor"); | |
107 | ||
108 | brelse(p_s_tb->L[n_h]); | |
109 | - p_s_tb->L[n_h] = p_s_bh; | |
110 | + p_s_tb->L[n_h] = bh; | |
111 | } | |
112 | ||
113 | if (p_s_tb->rnum[n_h]) { /* We need right neighbor to balance S[n_path_offset]. */ | |
114 | PROC_INFO_INC(sb, need_r_neighbor[n_h]); | |
115 | - p_s_bh = PATH_OFFSET_PBUFFER(p_s_tb->tb_path, n_path_offset); | |
116 | + bh = PATH_OFFSET_PBUFFER(p_s_tb->tb_path, n_path_offset); | |
117 | ||
118 | - RFALSE(p_s_bh == p_s_tb->FR[n_h] && | |
119 | + RFALSE(bh == p_s_tb->FR[n_h] && | |
120 | PATH_OFFSET_POSITION(p_s_tb->tb_path, | |
121 | n_path_offset) >= | |
122 | - B_NR_ITEMS(p_s_bh), | |
123 | + B_NR_ITEMS(bh), | |
124 | "PAP-8295: invalid position in the parent"); | |
125 | ||
126 | n_child_position = | |
127 | - (p_s_bh == p_s_tb->FR[n_h]) ? p_s_tb->rkey[n_h] + 1 : 0; | |
128 | + (bh == p_s_tb->FR[n_h]) ? p_s_tb->rkey[n_h] + 1 : 0; | |
129 | n_son_number = B_N_CHILD_NUM(p_s_tb->FR[n_h], n_child_position); | |
130 | - p_s_bh = sb_bread(sb, n_son_number); | |
131 | - if (!p_s_bh) | |
132 | + bh = sb_bread(sb, n_son_number); | |
133 | + if (!bh) | |
134 | return IO_ERROR; | |
135 | if (FILESYSTEM_CHANGED_TB(p_s_tb)) { | |
136 | - brelse(p_s_bh); | |
137 | + brelse(bh); | |
138 | PROC_INFO_INC(sb, get_neighbors_restart[n_h]); | |
139 | return REPEAT_SEARCH; | |
140 | } | |
141 | brelse(p_s_tb->R[n_h]); | |
142 | - p_s_tb->R[n_h] = p_s_bh; | |
143 | + p_s_tb->R[n_h] = bh; | |
144 | ||
145 | RFALSE(!n_h | |
146 | - && B_FREE_SPACE(p_s_bh) != | |
147 | - MAX_CHILD_SIZE(p_s_bh) - | |
148 | + && B_FREE_SPACE(bh) != | |
149 | + MAX_CHILD_SIZE(bh) - | |
150 | dc_size(B_N_CHILD(p_s_tb->FR[0], n_child_position)), | |
151 | "PAP-8300: invalid child size of right neighbor (%d != %d - %d)", | |
152 | - B_FREE_SPACE(p_s_bh), MAX_CHILD_SIZE(p_s_bh), | |
153 | + B_FREE_SPACE(bh), MAX_CHILD_SIZE(bh), | |
154 | dc_size(B_N_CHILD(p_s_tb->FR[0], n_child_position))); | |
155 | ||
156 | } | |
157 | @@ -2090,51 +2090,45 @@ static int get_mem_for_virtual_node(stru | |
158 | ||
159 | #ifdef CONFIG_REISERFS_CHECK | |
160 | static void tb_buffer_sanity_check(struct super_block *sb, | |
161 | - struct buffer_head *p_s_bh, | |
162 | + struct buffer_head *bh, | |
163 | const char *descr, int level) | |
164 | { | |
165 | - if (p_s_bh) { | |
166 | - if (atomic_read(&(p_s_bh->b_count)) <= 0) { | |
167 | + if (bh) { | |
168 | + if (atomic_read(&(bh->b_count)) <= 0) | |
169 | ||
170 | reiserfs_panic(sb, "jmacd-1", "negative or zero " | |
171 | "reference counter for buffer %s[%d] " | |
172 | - "(%b)", descr, level, p_s_bh); | |
173 | - } | |
174 | + "(%b)", descr, level, bh); | |
175 | ||
176 | - if (!buffer_uptodate(p_s_bh)) { | |
177 | + if (!buffer_uptodate(bh)) | |
178 | reiserfs_panic(sb, "jmacd-2", "buffer is not up " | |
179 | "to date %s[%d] (%b)", | |
180 | - descr, level, p_s_bh); | |
181 | - } | |
182 | + descr, level, bh); | |
183 | ||
184 | - if (!B_IS_IN_TREE(p_s_bh)) { | |
185 | + if (!B_IS_IN_TREE(bh)) | |
186 | reiserfs_panic(sb, "jmacd-3", "buffer is not " | |
187 | "in tree %s[%d] (%b)", | |
188 | - descr, level, p_s_bh); | |
189 | - } | |
190 | + descr, level, bh); | |
191 | ||
192 | - if (p_s_bh->b_bdev != sb->s_bdev) { | |
193 | + if (bh->b_bdev != sb->s_bdev) | |
194 | reiserfs_panic(sb, "jmacd-4", "buffer has wrong " | |
195 | "device %s[%d] (%b)", | |
196 | - descr, level, p_s_bh); | |
197 | - } | |
198 | + descr, level, bh); | |
199 | ||
200 | - if (p_s_bh->b_size != sb->s_blocksize) { | |
201 | + if (bh->b_size != sb->s_blocksize) | |
202 | reiserfs_panic(sb, "jmacd-5", "buffer has wrong " | |
203 | "blocksize %s[%d] (%b)", | |
204 | - descr, level, p_s_bh); | |
205 | - } | |
206 | + descr, level, bh); | |
207 | ||
208 | - if (p_s_bh->b_blocknr > SB_BLOCK_COUNT(sb)) { | |
209 | + if (bh->b_blocknr > SB_BLOCK_COUNT(sb)) | |
210 | reiserfs_panic(sb, "jmacd-6", "buffer block " | |
211 | "number too high %s[%d] (%b)", | |
212 | - descr, level, p_s_bh); | |
213 | - } | |
214 | + descr, level, bh); | |
215 | } | |
216 | } | |
217 | #else | |
218 | static void tb_buffer_sanity_check(struct super_block *sb, | |
219 | - struct buffer_head *p_s_bh, | |
220 | + struct buffer_head *bh, | |
221 | const char *descr, int level) | |
222 | {; | |
223 | } | |
224 | --- a/fs/reiserfs/stree.c | |
225 | +++ b/fs/reiserfs/stree.c | |
226 | @@ -56,13 +56,13 @@ | |
227 | #include <linux/quotaops.h> | |
228 | ||
229 | /* Does the buffer contain a disk block which is in the tree. */ | |
230 | -inline int B_IS_IN_TREE(const struct buffer_head *p_s_bh) | |
231 | +inline int B_IS_IN_TREE(const struct buffer_head *bh) | |
232 | { | |
233 | ||
234 | - RFALSE(B_LEVEL(p_s_bh) > MAX_HEIGHT, | |
235 | - "PAP-1010: block (%b) has too big level (%z)", p_s_bh, p_s_bh); | |
236 | + RFALSE(B_LEVEL(bh) > MAX_HEIGHT, | |
237 | + "PAP-1010: block (%b) has too big level (%z)", bh, bh); | |
238 | ||
239 | - return (B_LEVEL(p_s_bh) != FREE_LEVEL); | |
240 | + return (B_LEVEL(bh) != FREE_LEVEL); | |
241 | } | |
242 | ||
243 | // | |
244 | @@ -579,7 +579,7 @@ int search_by_key(struct super_block *sb | |
245 | { | |
246 | b_blocknr_t n_block_number; | |
247 | int expected_level; | |
248 | - struct buffer_head *p_s_bh; | |
249 | + struct buffer_head *bh; | |
250 | struct path_element *p_s_last_element; | |
251 | int n_node_level, n_retval; | |
252 | int right_neighbor_of_leaf_node; | |
253 | @@ -626,15 +626,14 @@ int search_by_key(struct super_block *sb | |
254 | ||
255 | /* Read the next tree node, and set the last element in the path to | |
256 | have a pointer to it. */ | |
257 | - if ((p_s_bh = p_s_last_element->pe_buffer = | |
258 | + if ((bh = p_s_last_element->pe_buffer = | |
259 | sb_getblk(sb, n_block_number))) { | |
260 | - if (!buffer_uptodate(p_s_bh) && reada_count > 1) { | |
261 | + if (!buffer_uptodate(bh) && reada_count > 1) | |
262 | search_by_key_reada(sb, reada_bh, | |
263 | reada_blocks, reada_count); | |
264 | - } | |
265 | - ll_rw_block(READ, 1, &p_s_bh); | |
266 | - wait_on_buffer(p_s_bh); | |
267 | - if (!buffer_uptodate(p_s_bh)) | |
268 | + ll_rw_block(READ, 1, &bh); | |
269 | + wait_on_buffer(bh); | |
270 | + if (!buffer_uptodate(bh)) | |
271 | goto io_error; | |
272 | } else { | |
273 | io_error: | |
274 | @@ -651,8 +650,8 @@ int search_by_key(struct super_block *sb | |
275 | to search is still in the tree rooted from the current buffer. If | |
276 | not then repeat search from the root. */ | |
277 | if (fs_changed(fs_gen, sb) && | |
278 | - (!B_IS_IN_TREE(p_s_bh) || | |
279 | - B_LEVEL(p_s_bh) != expected_level || | |
280 | + (!B_IS_IN_TREE(bh) || | |
281 | + B_LEVEL(bh) != expected_level || | |
282 | !key_in_buffer(p_s_search_path, p_s_key, sb))) { | |
283 | PROC_INFO_INC(sb, search_by_key_fs_changed); | |
284 | PROC_INFO_INC(sb, search_by_key_restarted); | |
285 | @@ -686,25 +685,25 @@ int search_by_key(struct super_block *sb | |
286 | ||
287 | // make sure, that the node contents look like a node of | |
288 | // certain level | |
289 | - if (!is_tree_node(p_s_bh, expected_level)) { | |
290 | + if (!is_tree_node(bh, expected_level)) { | |
291 | reiserfs_error(sb, "vs-5150", | |
292 | "invalid format found in block %ld. " | |
293 | - "Fsck?", p_s_bh->b_blocknr); | |
294 | + "Fsck?", bh->b_blocknr); | |
295 | pathrelse(p_s_search_path); | |
296 | return IO_ERROR; | |
297 | } | |
298 | ||
299 | /* ok, we have acquired next formatted node in the tree */ | |
300 | - n_node_level = B_LEVEL(p_s_bh); | |
301 | + n_node_level = B_LEVEL(bh); | |
302 | ||
303 | - PROC_INFO_BH_STAT(sb, p_s_bh, n_node_level - 1); | |
304 | + PROC_INFO_BH_STAT(sb, bh, n_node_level - 1); | |
305 | ||
306 | RFALSE(n_node_level < n_stop_level, | |
307 | "vs-5152: tree level (%d) is less than stop level (%d)", | |
308 | n_node_level, n_stop_level); | |
309 | ||
310 | - n_retval = bin_search(p_s_key, B_N_PITEM_HEAD(p_s_bh, 0), | |
311 | - B_NR_ITEMS(p_s_bh), | |
312 | + n_retval = bin_search(p_s_key, B_N_PITEM_HEAD(bh, 0), | |
313 | + B_NR_ITEMS(bh), | |
314 | (n_node_level == | |
315 | DISK_LEAF_NODE_LEVEL) ? IH_SIZE : | |
316 | KEY_SIZE, | |
317 | @@ -726,13 +725,13 @@ int search_by_key(struct super_block *sb | |
318 | an internal node. Now we calculate child block number by | |
319 | position in the node. */ | |
320 | n_block_number = | |
321 | - B_N_CHILD_NUM(p_s_bh, p_s_last_element->pe_position); | |
322 | + B_N_CHILD_NUM(bh, p_s_last_element->pe_position); | |
323 | ||
324 | /* if we are going to read leaf nodes, try for read ahead as well */ | |
325 | if ((p_s_search_path->reada & PATH_READA) && | |
326 | n_node_level == DISK_LEAF_NODE_LEVEL + 1) { | |
327 | int pos = p_s_last_element->pe_position; | |
328 | - int limit = B_NR_ITEMS(p_s_bh); | |
329 | + int limit = B_NR_ITEMS(bh); | |
330 | struct reiserfs_key *le_key; | |
331 | ||
332 | if (p_s_search_path->reada & PATH_READA_BACK) | |
333 | @@ -741,7 +740,7 @@ int search_by_key(struct super_block *sb | |
334 | if (pos == limit) | |
335 | break; | |
336 | reada_blocks[reada_count++] = | |
337 | - B_N_CHILD_NUM(p_s_bh, pos); | |
338 | + B_N_CHILD_NUM(bh, pos); | |
339 | if (p_s_search_path->reada & PATH_READA_BACK) | |
340 | pos--; | |
341 | else | |
342 | @@ -750,7 +749,7 @@ int search_by_key(struct super_block *sb | |
343 | /* | |
344 | * check to make sure we're in the same object | |
345 | */ | |
346 | - le_key = B_N_PDELIM_KEY(p_s_bh, pos); | |
347 | + le_key = B_N_PDELIM_KEY(bh, pos); | |
348 | if (le32_to_cpu(le_key->k_objectid) != | |
349 | p_s_key->on_disk_key.k_objectid) { | |
350 | break; | |
351 | @@ -851,15 +850,15 @@ int search_for_position_by_key(struct su | |
352 | /* Compare given item and item pointed to by the path. */ | |
353 | int comp_items(const struct item_head *stored_ih, const struct treepath *p_s_path) | |
354 | { | |
355 | - struct buffer_head *p_s_bh; | |
356 | + struct buffer_head *bh = PATH_PLAST_BUFFER(p_s_path); | |
357 | struct item_head *ih; | |
358 | ||
359 | /* Last buffer at the path is not in the tree. */ | |
360 | - if (!B_IS_IN_TREE(p_s_bh = PATH_PLAST_BUFFER(p_s_path))) | |
361 | + if (!B_IS_IN_TREE(bh)) | |
362 | return 1; | |
363 | ||
364 | /* Last path position is invalid. */ | |
365 | - if (PATH_LAST_POSITION(p_s_path) >= B_NR_ITEMS(p_s_bh)) | |
366 | + if (PATH_LAST_POSITION(p_s_path) >= B_NR_ITEMS(bh)) | |
367 | return 1; | |
368 | ||
369 | /* we need only to know, whether it is the same item */ | |
370 | @@ -959,7 +958,7 @@ static char prepare_for_delete_or_cut(st | |
371 | { | |
372 | struct super_block *sb = inode->i_sb; | |
373 | struct item_head *p_le_ih = PATH_PITEM_HEAD(p_s_path); | |
374 | - struct buffer_head *p_s_bh = PATH_PLAST_BUFFER(p_s_path); | |
375 | + struct buffer_head *bh = PATH_PLAST_BUFFER(p_s_path); | |
376 | ||
377 | BUG_ON(!th->t_trans_id); | |
378 | ||
379 | @@ -1003,7 +1002,7 @@ static char prepare_for_delete_or_cut(st | |
380 | do { | |
381 | need_re_search = 0; | |
382 | *p_n_cut_size = 0; | |
383 | - p_s_bh = PATH_PLAST_BUFFER(p_s_path); | |
384 | + bh = PATH_PLAST_BUFFER(p_s_path); | |
385 | copy_item_head(&s_ih, PATH_PITEM_HEAD(p_s_path)); | |
386 | pos = I_UNFM_NUM(&s_ih); | |
387 | ||
388 | @@ -1019,13 +1018,13 @@ static char prepare_for_delete_or_cut(st | |
389 | break; | |
390 | } | |
391 | ||
392 | - unfm = (__le32 *)B_I_PITEM(p_s_bh, &s_ih) + pos - 1; | |
393 | + unfm = (__le32 *)B_I_PITEM(bh, &s_ih) + pos - 1; | |
394 | block = get_block_num(unfm, 0); | |
395 | ||
396 | if (block != 0) { | |
397 | - reiserfs_prepare_for_journal(sb, p_s_bh, 1); | |
398 | + reiserfs_prepare_for_journal(sb, bh, 1); | |
399 | put_block_num(unfm, 0, 0); | |
400 | - journal_mark_dirty (th, sb, p_s_bh); | |
401 | + journal_mark_dirty(th, sb, bh); | |
402 | reiserfs_free_block(th, inode, block, 1); | |
403 | } | |
404 | ||
405 | @@ -1049,7 +1048,7 @@ static char prepare_for_delete_or_cut(st | |
406 | /* a trick. If the buffer has been logged, this will do nothing. If | |
407 | ** we've broken the loop without logging it, it will restore the | |
408 | ** buffer */ | |
409 | - reiserfs_restore_prepared_buffer(sb, p_s_bh); | |
410 | + reiserfs_restore_prepared_buffer(sb, bh); | |
411 | } while (need_re_search && | |
412 | search_for_position_by_key(sb, p_s_item_key, p_s_path) == POSITION_FOUND); | |
413 | pos_in_item(p_s_path) = pos * UNFM_P_SIZE; | |
414 | --- a/include/linux/reiserfs_fs.h | |
415 | +++ b/include/linux/reiserfs_fs.h | |
416 | @@ -751,25 +751,25 @@ struct block_head { | |
417 | #define DISK_LEAF_NODE_LEVEL 1 /* Leaf node level. */ | |
418 | ||
419 | /* Given the buffer head of a formatted node, resolve to the block head of that node. */ | |
420 | -#define B_BLK_HEAD(p_s_bh) ((struct block_head *)((p_s_bh)->b_data)) | |
421 | +#define B_BLK_HEAD(bh) ((struct block_head *)((bh)->b_data)) | |
422 | /* Number of items that are in buffer. */ | |
423 | -#define B_NR_ITEMS(p_s_bh) (blkh_nr_item(B_BLK_HEAD(p_s_bh))) | |
424 | -#define B_LEVEL(p_s_bh) (blkh_level(B_BLK_HEAD(p_s_bh))) | |
425 | -#define B_FREE_SPACE(p_s_bh) (blkh_free_space(B_BLK_HEAD(p_s_bh))) | |
426 | - | |
427 | -#define PUT_B_NR_ITEMS(p_s_bh,val) do { set_blkh_nr_item(B_BLK_HEAD(p_s_bh),val); } while (0) | |
428 | -#define PUT_B_LEVEL(p_s_bh,val) do { set_blkh_level(B_BLK_HEAD(p_s_bh),val); } while (0) | |
429 | -#define PUT_B_FREE_SPACE(p_s_bh,val) do { set_blkh_free_space(B_BLK_HEAD(p_s_bh),val); } while (0) | |
430 | +#define B_NR_ITEMS(bh) (blkh_nr_item(B_BLK_HEAD(bh))) | |
431 | +#define B_LEVEL(bh) (blkh_level(B_BLK_HEAD(bh))) | |
432 | +#define B_FREE_SPACE(bh) (blkh_free_space(B_BLK_HEAD(bh))) | |
433 | + | |
434 | +#define PUT_B_NR_ITEMS(bh, val) do { set_blkh_nr_item(B_BLK_HEAD(bh), val); } while (0) | |
435 | +#define PUT_B_LEVEL(bh, val) do { set_blkh_level(B_BLK_HEAD(bh), val); } while (0) | |
436 | +#define PUT_B_FREE_SPACE(bh, val) do { set_blkh_free_space(B_BLK_HEAD(bh), val); } while (0) | |
437 | ||
438 | /* Get right delimiting key. -- little endian */ | |
439 | -#define B_PRIGHT_DELIM_KEY(p_s_bh) (&(blk_right_delim_key(B_BLK_HEAD(p_s_bh)))) | |
440 | +#define B_PRIGHT_DELIM_KEY(bh) (&(blk_right_delim_key(B_BLK_HEAD(bh)))) | |
441 | ||
442 | /* Does the buffer contain a disk leaf. */ | |
443 | -#define B_IS_ITEMS_LEVEL(p_s_bh) (B_LEVEL(p_s_bh) == DISK_LEAF_NODE_LEVEL) | |
444 | +#define B_IS_ITEMS_LEVEL(bh) (B_LEVEL(bh) == DISK_LEAF_NODE_LEVEL) | |
445 | ||
446 | /* Does the buffer contain a disk internal node */ | |
447 | -#define B_IS_KEYS_LEVEL(p_s_bh) (B_LEVEL(p_s_bh) > DISK_LEAF_NODE_LEVEL \ | |
448 | - && B_LEVEL(p_s_bh) <= MAX_HEIGHT) | |
449 | +#define B_IS_KEYS_LEVEL(bh) (B_LEVEL(bh) > DISK_LEAF_NODE_LEVEL \ | |
450 | + && B_LEVEL(bh) <= MAX_HEIGHT) | |
451 | ||
452 | /***************************************************************************/ | |
453 | /* STAT DATA */ | |
454 | @@ -1119,12 +1119,13 @@ struct disk_child { | |
455 | #define put_dc_size(dc_p, val) do { (dc_p)->dc_size = cpu_to_le16(val); } while(0) | |
456 | ||
457 | /* Get disk child by buffer header and position in the tree node. */ | |
458 | -#define B_N_CHILD(p_s_bh,n_pos) ((struct disk_child *)\ | |
459 | -((p_s_bh)->b_data+BLKH_SIZE+B_NR_ITEMS(p_s_bh)*KEY_SIZE+DC_SIZE*(n_pos))) | |
460 | +#define B_N_CHILD(bh, n_pos) ((struct disk_child *)\ | |
461 | +((bh)->b_data + BLKH_SIZE + B_NR_ITEMS(bh) * KEY_SIZE + DC_SIZE * (n_pos))) | |
462 | ||
463 | /* Get disk child number by buffer header and position in the tree node. */ | |
464 | -#define B_N_CHILD_NUM(p_s_bh,n_pos) (dc_block_number(B_N_CHILD(p_s_bh,n_pos))) | |
465 | -#define PUT_B_N_CHILD_NUM(p_s_bh,n_pos, val) (put_dc_block_number(B_N_CHILD(p_s_bh,n_pos), val )) | |
466 | +#define B_N_CHILD_NUM(bh, n_pos) (dc_block_number(B_N_CHILD(bh, n_pos))) | |
467 | +#define PUT_B_N_CHILD_NUM(bh, n_pos, val) \ | |
468 | + (put_dc_block_number(B_N_CHILD(bh, n_pos), val)) | |
469 | ||
470 | /* maximal value of field child_size in structure disk_child */ | |
471 | /* child size is the combined size of all items and their headers */ | |
472 | @@ -1837,7 +1838,7 @@ int search_by_key(struct super_block *, | |
473 | int search_for_position_by_key(struct super_block *sb, | |
474 | const struct cpu_key *p_s_cpu_key, | |
475 | struct treepath *p_s_search_path); | |
476 | -extern void decrement_bcount(struct buffer_head *p_s_bh); | |
477 | +extern void decrement_bcount(struct buffer_head *bh); | |
478 | void decrement_counters_in_path(struct treepath *p_s_search_path); | |
479 | void pathrelse(struct treepath *p_s_search_path); | |
480 | int reiserfs_check_path(struct treepath *p); | |
481 | @@ -1978,7 +1979,7 @@ int reiserfs_global_version_in_proc(char | |
482 | #define PROC_INFO_MAX( sb, field, value ) VOID_V | |
483 | #define PROC_INFO_INC( sb, field ) VOID_V | |
484 | #define PROC_INFO_ADD( sb, field, val ) VOID_V | |
485 | -#define PROC_INFO_BH_STAT(sb, p_s_bh, n_node_level) VOID_V | |
486 | +#define PROC_INFO_BH_STAT(sb, bh, n_node_level) VOID_V | |
487 | #endif | |
488 | ||
489 | /* dir.c */ |