]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/suse-2.6.27.25/patches.suse/reiserfs-rename-._.diff
Added missing SuSE-Xen-Patches.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.suse / reiserfs-rename-._.diff
1 From: Jeff Mahoney <jeffm@suse.com>
2 Subject: reiserfs: rename [cn]_* variables
3
4 This patch renames n_, c_, etc variables to something more sane. This is
5 the sixth in a series of patches to rip out some of the awful variable
6 naming in reiserfs.
7
8 Signed-off-by: Jeff Mahoney <jeffm@suse.com>
9
10 ---
11
12 fs/reiserfs/file.c | 6
13 fs/reiserfs/fix_node.c | 474 +++++++++++++++++++++---------------------
14 fs/reiserfs/stree.c | 370 ++++++++++++++++----------------
15 fs/reiserfs/tail_conversion.c | 30 +-
16 4 files changed, 438 insertions(+), 442 deletions(-)
17
18 --- a/fs/reiserfs/file.c
19 +++ b/fs/reiserfs/file.c
20 @@ -138,11 +138,11 @@ static int reiserfs_sync_file(struct fil
21 struct dentry *dentry, int datasync)
22 {
23 struct inode *inode = dentry->d_inode;
24 - int n_err;
25 + int err;
26 int barrier_done;
27
28 BUG_ON(!S_ISREG(inode->i_mode));
29 - n_err = sync_mapping_buffers(inode->i_mapping);
30 + err = sync_mapping_buffers(inode->i_mapping);
31 reiserfs_write_lock(inode->i_sb);
32 barrier_done = reiserfs_commit_for_inode(inode);
33 reiserfs_write_unlock(inode->i_sb);
34 @@ -150,7 +150,7 @@ static int reiserfs_sync_file(struct fil
35 blkdev_issue_flush(inode->i_sb->s_bdev, NULL);
36 if (barrier_done < 0)
37 return barrier_done;
38 - return (n_err < 0) ? -EIO : 0;
39 + return (err < 0) ? -EIO : 0;
40 }
41
42 /* taken fs/buffer.c:__block_commit_write */
43 --- a/fs/reiserfs/fix_node.c
44 +++ b/fs/reiserfs/fix_node.c
45 @@ -751,24 +751,24 @@ else \
46
47 static void free_buffers_in_tb(struct tree_balance *tb)
48 {
49 - int n_counter;
50 + int i;
51
52 pathrelse(tb->tb_path);
53
54 - for (n_counter = 0; n_counter < MAX_HEIGHT; n_counter++) {
55 - brelse(tb->L[n_counter]);
56 - brelse(tb->R[n_counter]);
57 - brelse(tb->FL[n_counter]);
58 - brelse(tb->FR[n_counter]);
59 - brelse(tb->CFL[n_counter]);
60 - brelse(tb->CFR[n_counter]);
61 -
62 - tb->L[n_counter] = NULL;
63 - tb->R[n_counter] = NULL;
64 - tb->FL[n_counter] = NULL;
65 - tb->FR[n_counter] = NULL;
66 - tb->CFL[n_counter] = NULL;
67 - tb->CFR[n_counter] = NULL;
68 + for (i = 0; i < MAX_HEIGHT; i++) {
69 + brelse(tb->L[i]);
70 + brelse(tb->R[i]);
71 + brelse(tb->FL[i]);
72 + brelse(tb->FR[i]);
73 + brelse(tb->CFL[i]);
74 + brelse(tb->CFR[i]);
75 +
76 + tb->L[i] = NULL;
77 + tb->R[i] = NULL;
78 + tb->FL[i] = NULL;
79 + tb->FR[i] = NULL;
80 + tb->CFL[i] = NULL;
81 + tb->CFR[i] = NULL;
82 }
83 }
84
85 @@ -778,13 +778,13 @@ static void free_buffers_in_tb(struct tr
86 * NO_DISK_SPACE - no disk space.
87 */
88 /* The function is NOT SCHEDULE-SAFE! */
89 -static int get_empty_nodes(struct tree_balance *tb, int n_h)
90 +static int get_empty_nodes(struct tree_balance *tb, int h)
91 {
92 struct buffer_head *new_bh,
93 - *Sh = PATH_H_PBUFFER(tb->tb_path, n_h);
94 - b_blocknr_t *blocknr, a_n_blocknrs[MAX_AMOUNT_NEEDED] = { 0, };
95 - int n_counter, n_number_of_freeblk, n_amount_needed, /* number of needed empty blocks */
96 - n_retval = CARRY_ON;
97 + *Sh = PATH_H_PBUFFER(tb->tb_path, h);
98 + b_blocknr_t *blocknr, blocknrs[MAX_AMOUNT_NEEDED] = { 0, };
99 + int counter, number_of_freeblk, amount_needed, /* number of needed empty blocks */
100 + retval = CARRY_ON;
101 struct super_block *sb = tb->tb_sb;
102
103 /* number_of_freeblk is the number of empty blocks which have been
104 @@ -793,7 +793,7 @@ static int get_empty_nodes(struct tree_b
105 number_of_freeblk = tb->cur_blknum can be non-zero if a schedule occurs
106 after empty blocks are acquired, and the balancing analysis is
107 then restarted, amount_needed is the number needed by this level
108 - (n_h) of the balancing analysis.
109 + (h) of the balancing analysis.
110
111 Note that for systems with many processes writing, it would be
112 more layout optimal to calculate the total number needed by all
113 @@ -801,31 +801,31 @@ static int get_empty_nodes(struct tree_b
114
115 /* Initiate number_of_freeblk to the amount acquired prior to the restart of
116 the analysis or 0 if not restarted, then subtract the amount needed
117 - by all of the levels of the tree below n_h. */
118 - /* blknum includes S[n_h], so we subtract 1 in this calculation */
119 - for (n_counter = 0, n_number_of_freeblk = tb->cur_blknum;
120 - n_counter < n_h; n_counter++)
121 - n_number_of_freeblk -=
122 - (tb->blknum[n_counter]) ? (tb->blknum[n_counter] -
123 + by all of the levels of the tree below h. */
124 + /* blknum includes S[h], so we subtract 1 in this calculation */
125 + for (counter = 0, number_of_freeblk = tb->cur_blknum;
126 + counter < h; counter++)
127 + number_of_freeblk -=
128 + (tb->blknum[counter]) ? (tb->blknum[counter] -
129 1) : 0;
130
131 /* Allocate missing empty blocks. */
132 /* if Sh == 0 then we are getting a new root */
133 - n_amount_needed = (Sh) ? (tb->blknum[n_h] - 1) : 1;
134 + amount_needed = (Sh) ? (tb->blknum[h] - 1) : 1;
135 /* Amount_needed = the amount that we need more than the amount that we have. */
136 - if (n_amount_needed > n_number_of_freeblk)
137 - n_amount_needed -= n_number_of_freeblk;
138 + if (amount_needed > number_of_freeblk)
139 + amount_needed -= number_of_freeblk;
140 else /* If we have enough already then there is nothing to do. */
141 return CARRY_ON;
142
143 /* No need to check quota - is not allocated for blocks used for formatted nodes */
144 - if (reiserfs_new_form_blocknrs(tb, a_n_blocknrs,
145 - n_amount_needed) == NO_DISK_SPACE)
146 + if (reiserfs_new_form_blocknrs(tb, blocknrs,
147 + amount_needed) == NO_DISK_SPACE)
148 return NO_DISK_SPACE;
149
150 /* for each blocknumber we just got, get a buffer and stick it on FEB */
151 - for (blocknr = a_n_blocknrs, n_counter = 0;
152 - n_counter < n_amount_needed; blocknr++, n_counter++) {
153 + for (blocknr = blocknrs, counter = 0;
154 + counter < amount_needed; blocknr++, counter++) {
155
156 RFALSE(!*blocknr,
157 "PAP-8135: reiserfs_new_blocknrs failed when got new blocks");
158 @@ -845,10 +845,10 @@ static int get_empty_nodes(struct tree_b
159 tb->FEB[tb->cur_blknum++] = new_bh;
160 }
161
162 - if (n_retval == CARRY_ON && FILESYSTEM_CHANGED_TB(tb))
163 - n_retval = REPEAT_SEARCH;
164 + if (retval == CARRY_ON && FILESYSTEM_CHANGED_TB(tb))
165 + retval = REPEAT_SEARCH;
166
167 - return n_retval;
168 + return retval;
169 }
170
171 /* Get free space of the left neighbor, which is stored in the parent
172 @@ -896,36 +896,36 @@ static int get_rfree(struct tree_balance
173 }
174
175 /* Check whether left neighbor is in memory. */
176 -static int is_left_neighbor_in_cache(struct tree_balance *tb, int n_h)
177 +static int is_left_neighbor_in_cache(struct tree_balance *tb, int h)
178 {
179 struct buffer_head *father, *left;
180 struct super_block *sb = tb->tb_sb;
181 - b_blocknr_t n_left_neighbor_blocknr;
182 - int n_left_neighbor_position;
183 + b_blocknr_t left_neighbor_blocknr;
184 + int left_neighbor_position;
185
186 /* Father of the left neighbor does not exist. */
187 - if (!tb->FL[n_h])
188 + if (!tb->FL[h])
189 return 0;
190
191 /* Calculate father of the node to be balanced. */
192 - father = PATH_H_PBUFFER(tb->tb_path, n_h + 1);
193 + father = PATH_H_PBUFFER(tb->tb_path, h + 1);
194
195 RFALSE(!father ||
196 !B_IS_IN_TREE(father) ||
197 - !B_IS_IN_TREE(tb->FL[n_h]) ||
198 + !B_IS_IN_TREE(tb->FL[h]) ||
199 !buffer_uptodate(father) ||
200 - !buffer_uptodate(tb->FL[n_h]),
201 + !buffer_uptodate(tb->FL[h]),
202 "vs-8165: F[h] (%b) or FL[h] (%b) is invalid",
203 - father, tb->FL[n_h]);
204 + father, tb->FL[h]);
205
206 /* Get position of the pointer to the left neighbor into the left father. */
207 - n_left_neighbor_position = (father == tb->FL[n_h]) ?
208 - tb->lkey[n_h] : B_NR_ITEMS(tb->FL[n_h]);
209 + left_neighbor_position = (father == tb->FL[h]) ?
210 + tb->lkey[h] : B_NR_ITEMS(tb->FL[h]);
211 /* Get left neighbor block number. */
212 - n_left_neighbor_blocknr =
213 - B_N_CHILD_NUM(tb->FL[n_h], n_left_neighbor_position);
214 + left_neighbor_blocknr =
215 + B_N_CHILD_NUM(tb->FL[h], left_neighbor_position);
216 /* Look for the left neighbor in the cache. */
217 - if ((left = sb_find_get_block(sb, n_left_neighbor_blocknr))) {
218 + if ((left = sb_find_get_block(sb, left_neighbor_blocknr))) {
219
220 RFALSE(buffer_uptodate(left) && !B_IS_IN_TREE(left),
221 "vs-8170: left neighbor (%b %z) is not in the tree",
222 @@ -955,7 +955,7 @@ static void decrement_key(struct cpu_key
223 * CARRY_ON - schedule didn't occur while the function worked;
224 */
225 static int get_far_parent(struct tree_balance *tb,
226 - int n_h,
227 + int h,
228 struct buffer_head **pfather,
229 struct buffer_head **pcom_father, char c_lr_par)
230 {
231 @@ -963,38 +963,38 @@ static int get_far_parent(struct tree_ba
232 INITIALIZE_PATH(s_path_to_neighbor_father);
233 struct treepath *path = tb->tb_path;
234 struct cpu_key s_lr_father_key;
235 - int n_counter,
236 - n_position = INT_MAX,
237 - n_first_last_position = 0,
238 - n_path_offset = PATH_H_PATH_OFFSET(path, n_h);
239 + int counter,
240 + position = INT_MAX,
241 + first_last_position = 0,
242 + path_offset = PATH_H_PATH_OFFSET(path, h);
243
244 - /* Starting from F[n_h] go upwards in the tree, and look for the common
245 - ancestor of F[n_h], and its neighbor l/r, that should be obtained. */
246 + /* Starting from F[h] go upwards in the tree, and look for the common
247 + ancestor of F[h], and its neighbor l/r, that should be obtained. */
248
249 - n_counter = n_path_offset;
250 + counter = path_offset;
251
252 - RFALSE(n_counter < FIRST_PATH_ELEMENT_OFFSET,
253 + RFALSE(counter < FIRST_PATH_ELEMENT_OFFSET,
254 "PAP-8180: invalid path length");
255
256 - for (; n_counter > FIRST_PATH_ELEMENT_OFFSET; n_counter--) {
257 + for (; counter > FIRST_PATH_ELEMENT_OFFSET; counter--) {
258 /* Check whether parent of the current buffer in the path is really parent in the tree. */
259 if (!B_IS_IN_TREE
260 - (parent = PATH_OFFSET_PBUFFER(path, n_counter - 1)))
261 + (parent = PATH_OFFSET_PBUFFER(path, counter - 1)))
262 return REPEAT_SEARCH;
263 /* Check whether position in the parent is correct. */
264 - if ((n_position =
265 + if ((position =
266 PATH_OFFSET_POSITION(path,
267 - n_counter - 1)) >
268 + counter - 1)) >
269 B_NR_ITEMS(parent))
270 return REPEAT_SEARCH;
271 /* Check whether parent at the path really points to the child. */
272 - if (B_N_CHILD_NUM(parent, n_position) !=
273 - PATH_OFFSET_PBUFFER(path, n_counter)->b_blocknr)
274 + if (B_N_CHILD_NUM(parent, position) !=
275 + PATH_OFFSET_PBUFFER(path, counter)->b_blocknr)
276 return REPEAT_SEARCH;
277 /* Return delimiting key if position in the parent is not equal to first/last one. */
278 if (c_lr_par == RIGHT_PARENTS)
279 - n_first_last_position = B_NR_ITEMS(parent);
280 - if (n_position != n_first_last_position) {
281 + first_last_position = B_NR_ITEMS(parent);
282 + if (position != first_last_position) {
283 *pcom_father = parent;
284 get_bh(*pcom_father);
285 /*(*pcom_father = parent)->b_count++; */
286 @@ -1003,7 +1003,7 @@ static int get_far_parent(struct tree_ba
287 }
288
289 /* if we are in the root of the tree, then there is no common father */
290 - if (n_counter == FIRST_PATH_ELEMENT_OFFSET) {
291 + if (counter == FIRST_PATH_ELEMENT_OFFSET) {
292 /* Check whether first buffer in the path is the root of the tree. */
293 if (PATH_OFFSET_PBUFFER
294 (tb->tb_path,
295 @@ -1036,18 +1036,18 @@ static int get_far_parent(struct tree_ba
296 le_key2cpu_key(&s_lr_father_key,
297 B_N_PDELIM_KEY(*pcom_father,
298 (c_lr_par ==
299 - LEFT_PARENTS) ? (tb->lkey[n_h - 1] =
300 - n_position -
301 - 1) : (tb->rkey[n_h -
302 + LEFT_PARENTS) ? (tb->lkey[h - 1] =
303 + position -
304 + 1) : (tb->rkey[h -
305 1] =
306 - n_position)));
307 + position)));
308
309 if (c_lr_par == LEFT_PARENTS)
310 decrement_key(&s_lr_father_key);
311
312 if (search_by_key
313 (tb->tb_sb, &s_lr_father_key, &s_path_to_neighbor_father,
314 - n_h + 1) == IO_ERROR)
315 + h + 1) == IO_ERROR)
316 // path is released
317 return IO_ERROR;
318
319 @@ -1059,7 +1059,7 @@ static int get_far_parent(struct tree_ba
320
321 *pfather = PATH_PLAST_BUFFER(&s_path_to_neighbor_father);
322
323 - RFALSE(B_LEVEL(*pfather) != n_h + 1,
324 + RFALSE(B_LEVEL(*pfather) != h + 1,
325 "PAP-8190: (%b %z) level too small", *pfather, *pfather);
326 RFALSE(s_path_to_neighbor_father.path_length <
327 FIRST_PATH_ELEMENT_OFFSET, "PAP-8192: path length is too small");
328 @@ -1069,92 +1069,92 @@ static int get_far_parent(struct tree_ba
329 return CARRY_ON;
330 }
331
332 -/* Get parents of neighbors of node in the path(S[n_path_offset]) and common parents of
333 - * S[n_path_offset] and L[n_path_offset]/R[n_path_offset]: F[n_path_offset], FL[n_path_offset],
334 - * FR[n_path_offset], CFL[n_path_offset], CFR[n_path_offset].
335 - * Calculate numbers of left and right delimiting keys position: lkey[n_path_offset], rkey[n_path_offset].
336 +/* Get parents of neighbors of node in the path(S[path_offset]) and common parents of
337 + * S[path_offset] and L[path_offset]/R[path_offset]: F[path_offset], FL[path_offset],
338 + * FR[path_offset], CFL[path_offset], CFR[path_offset].
339 + * Calculate numbers of left and right delimiting keys position: lkey[path_offset], rkey[path_offset].
340 * Returns: SCHEDULE_OCCURRED - schedule occurred while the function worked;
341 * CARRY_ON - schedule didn't occur while the function worked;
342 */
343 -static int get_parents(struct tree_balance *tb, int n_h)
344 +static int get_parents(struct tree_balance *tb, int h)
345 {
346 struct treepath *path = tb->tb_path;
347 - int n_position,
348 - n_ret_value,
349 - n_path_offset = PATH_H_PATH_OFFSET(tb->tb_path, n_h);
350 + int position,
351 + ret,
352 + path_offset = PATH_H_PATH_OFFSET(tb->tb_path, h);
353 struct buffer_head *curf, *curcf;
354
355 /* Current node is the root of the tree or will be root of the tree */
356 - if (n_path_offset <= FIRST_PATH_ELEMENT_OFFSET) {
357 + if (path_offset <= FIRST_PATH_ELEMENT_OFFSET) {
358 /* The root can not have parents.
359 Release nodes which previously were obtained as parents of the current node neighbors. */
360 - brelse(tb->FL[n_h]);
361 - brelse(tb->CFL[n_h]);
362 - brelse(tb->FR[n_h]);
363 - brelse(tb->CFR[n_h]);
364 - tb->FL[n_h] = NULL;
365 - tb->CFL[n_h] = NULL;
366 - tb->FR[n_h] = NULL;
367 - tb->CFR[n_h] = NULL;
368 + brelse(tb->FL[h]);
369 + brelse(tb->CFL[h]);
370 + brelse(tb->FR[h]);
371 + brelse(tb->CFR[h]);
372 + tb->FL[h] = NULL;
373 + tb->CFL[h] = NULL;
374 + tb->FR[h] = NULL;
375 + tb->CFR[h] = NULL;
376 return CARRY_ON;
377 }
378
379 - /* Get parent FL[n_path_offset] of L[n_path_offset]. */
380 - n_position = PATH_OFFSET_POSITION(path, n_path_offset - 1);
381 - if (n_position) {
382 + /* Get parent FL[path_offset] of L[path_offset]. */
383 + position = PATH_OFFSET_POSITION(path, path_offset - 1);
384 + if (position) {
385 /* Current node is not the first child of its parent. */
386 - curf = PATH_OFFSET_PBUFFER(path, n_path_offset - 1);
387 - curcf = PATH_OFFSET_PBUFFER(path, n_path_offset - 1);
388 + curf = PATH_OFFSET_PBUFFER(path, path_offset - 1);
389 + curcf = PATH_OFFSET_PBUFFER(path, path_offset - 1);
390 get_bh(curf);
391 get_bh(curf);
392 - tb->lkey[n_h] = n_position - 1;
393 + tb->lkey[h] = position - 1;
394 } else {
395 - /* Calculate current parent of L[n_path_offset], which is the left neighbor of the current node.
396 - Calculate current common parent of L[n_path_offset] and the current node. Note that
397 - CFL[n_path_offset] not equal FL[n_path_offset] and CFL[n_path_offset] not equal F[n_path_offset].
398 - Calculate lkey[n_path_offset]. */
399 - if ((n_ret_value = get_far_parent(tb, n_h + 1, &curf,
400 + /* Calculate current parent of L[path_offset], which is the left neighbor of the current node.
401 + Calculate current common parent of L[path_offset] and the current node. Note that
402 + CFL[path_offset] not equal FL[path_offset] and CFL[path_offset] not equal F[path_offset].
403 + Calculate lkey[path_offset]. */
404 + if ((ret = get_far_parent(tb, h + 1, &curf,
405 &curcf,
406 LEFT_PARENTS)) != CARRY_ON)
407 - return n_ret_value;
408 + return ret;
409 }
410
411 - brelse(tb->FL[n_h]);
412 - tb->FL[n_h] = curf; /* New initialization of FL[n_h]. */
413 - brelse(tb->CFL[n_h]);
414 - tb->CFL[n_h] = curcf; /* New initialization of CFL[n_h]. */
415 + brelse(tb->FL[h]);
416 + tb->FL[h] = curf; /* New initialization of FL[h]. */
417 + brelse(tb->CFL[h]);
418 + tb->CFL[h] = curcf; /* New initialization of CFL[h]. */
419
420 RFALSE((curf && !B_IS_IN_TREE(curf)) ||
421 (curcf && !B_IS_IN_TREE(curcf)),
422 "PAP-8195: FL (%b) or CFL (%b) is invalid", curf, curcf);
423
424 -/* Get parent FR[n_h] of R[n_h]. */
425 +/* Get parent FR[h] of R[h]. */
426
427 -/* Current node is the last child of F[n_h]. FR[n_h] != F[n_h]. */
428 - if (n_position == B_NR_ITEMS(PATH_H_PBUFFER(path, n_h + 1))) {
429 -/* Calculate current parent of R[n_h], which is the right neighbor of F[n_h].
430 - Calculate current common parent of R[n_h] and current node. Note that CFR[n_h]
431 - not equal FR[n_path_offset] and CFR[n_h] not equal F[n_h]. */
432 - if ((n_ret_value =
433 - get_far_parent(tb, n_h + 1, &curf, &curcf,
434 +/* Current node is the last child of F[h]. FR[h] != F[h]. */
435 + if (position == B_NR_ITEMS(PATH_H_PBUFFER(path, h + 1))) {
436 +/* Calculate current parent of R[h], which is the right neighbor of F[h].
437 + Calculate current common parent of R[h] and current node. Note that CFR[h]
438 + not equal FR[path_offset] and CFR[h] not equal F[h]. */
439 + if ((ret =
440 + get_far_parent(tb, h + 1, &curf, &curcf,
441 RIGHT_PARENTS)) != CARRY_ON)
442 - return n_ret_value;
443 + return ret;
444 } else {
445 -/* Current node is not the last child of its parent F[n_h]. */
446 - curf = PATH_OFFSET_PBUFFER(path, n_path_offset - 1);
447 - curcf = PATH_OFFSET_PBUFFER(path, n_path_offset - 1);
448 +/* Current node is not the last child of its parent F[h]. */
449 + curf = PATH_OFFSET_PBUFFER(path, path_offset - 1);
450 + curcf = PATH_OFFSET_PBUFFER(path, path_offset - 1);
451 get_bh(curf);
452 get_bh(curf);
453 - tb->rkey[n_h] = n_position;
454 + tb->rkey[h] = position;
455 }
456
457 - brelse(tb->FR[n_h]);
458 - /* New initialization of FR[n_path_offset]. */
459 - tb->FR[n_h] = curf;
460 + brelse(tb->FR[h]);
461 + /* New initialization of FR[path_offset]. */
462 + tb->FR[h] = curf;
463
464 - brelse(tb->CFR[n_h]);
465 - /* New initialization of CFR[n_path_offset]. */
466 - tb->CFR[n_h] = curcf;
467 + brelse(tb->CFR[h]);
468 + /* New initialization of CFR[path_offset]. */
469 + tb->CFR[h] = curcf;
470
471 RFALSE((curf && !B_IS_IN_TREE(curf)) ||
472 (curcf && !B_IS_IN_TREE(curcf)),
473 @@ -1222,7 +1222,7 @@ static int ip_check_balance(struct tree_
474 contains node being balanced. The mnemonic is
475 that the attempted change in node space used level
476 is levbytes bytes. */
477 - n_ret_value;
478 + ret;
479
480 int lfree, sfree, rfree /* free space in L, S and R */ ;
481
482 @@ -1262,22 +1262,22 @@ static int ip_check_balance(struct tree_
483 if (!h)
484 reiserfs_panic(tb->tb_sb, "vs-8210",
485 "S[0] can not be 0");
486 - switch (n_ret_value = get_empty_nodes(tb, h)) {
487 + switch (ret = get_empty_nodes(tb, h)) {
488 case CARRY_ON:
489 set_parameters(tb, h, 0, 0, 1, NULL, -1, -1);
490 return NO_BALANCING_NEEDED; /* no balancing for higher levels needed */
491
492 case NO_DISK_SPACE:
493 case REPEAT_SEARCH:
494 - return n_ret_value;
495 + return ret;
496 default:
497 reiserfs_panic(tb->tb_sb, "vs-8215", "incorrect "
498 "return value of get_empty_nodes");
499 }
500 }
501
502 - if ((n_ret_value = get_parents(tb, h)) != CARRY_ON) /* get parents of S[h] neighbors. */
503 - return n_ret_value;
504 + if ((ret = get_parents(tb, h)) != CARRY_ON) /* get parents of S[h] neighbors. */
505 + return ret;
506
507 sfree = B_FREE_SPACE(Sh);
508
509 @@ -1564,7 +1564,7 @@ static int dc_check_balance_internal(str
510 /* Sh is the node whose balance is currently being checked,
511 and Fh is its father. */
512 struct buffer_head *Sh, *Fh;
513 - int maxsize, n_ret_value;
514 + int maxsize, ret;
515 int lfree, rfree /* free space in L and R */ ;
516
517 Sh = PATH_H_PBUFFER(tb->tb_path, h);
518 @@ -1589,8 +1589,8 @@ static int dc_check_balance_internal(str
519 return CARRY_ON;
520 }
521
522 - if ((n_ret_value = get_parents(tb, h)) != CARRY_ON)
523 - return n_ret_value;
524 + if ((ret = get_parents(tb, h)) != CARRY_ON)
525 + return ret;
526
527 /* get free space of neighbors */
528 rfree = get_rfree(tb, h);
529 @@ -1747,7 +1747,7 @@ static int dc_check_balance_leaf(struct
530 attempted change in node space used level is levbytes bytes. */
531 int levbytes;
532 /* the maximal item size */
533 - int maxsize, n_ret_value;
534 + int maxsize, ret;
535 /* S0 is the node whose balance is currently being checked,
536 and F0 is its father. */
537 struct buffer_head *S0, *F0;
538 @@ -1769,8 +1769,8 @@ static int dc_check_balance_leaf(struct
539 return NO_BALANCING_NEEDED;
540 }
541
542 - if ((n_ret_value = get_parents(tb, h)) != CARRY_ON)
543 - return n_ret_value;
544 + if ((ret = get_parents(tb, h)) != CARRY_ON)
545 + return ret;
546
547 /* get free space of neighbors */
548 rfree = get_rfree(tb, h);
549 @@ -1889,40 +1889,40 @@ static int check_balance(int mode,
550 }
551
552 /* Check whether parent at the path is the really parent of the current node.*/
553 -static int get_direct_parent(struct tree_balance *tb, int n_h)
554 +static int get_direct_parent(struct tree_balance *tb, int h)
555 {
556 struct buffer_head *bh;
557 struct treepath *path = tb->tb_path;
558 - int n_position,
559 - n_path_offset = PATH_H_PATH_OFFSET(tb->tb_path, n_h);
560 + int position,
561 + path_offset = PATH_H_PATH_OFFSET(tb->tb_path, h);
562
563 /* We are in the root or in the new root. */
564 - if (n_path_offset <= FIRST_PATH_ELEMENT_OFFSET) {
565 + if (path_offset <= FIRST_PATH_ELEMENT_OFFSET) {
566
567 - RFALSE(n_path_offset < FIRST_PATH_ELEMENT_OFFSET - 1,
568 + RFALSE(path_offset < FIRST_PATH_ELEMENT_OFFSET - 1,
569 "PAP-8260: invalid offset in the path");
570
571 if (PATH_OFFSET_PBUFFER(path, FIRST_PATH_ELEMENT_OFFSET)->
572 b_blocknr == SB_ROOT_BLOCK(tb->tb_sb)) {
573 /* Root is not changed. */
574 - PATH_OFFSET_PBUFFER(path, n_path_offset - 1) = NULL;
575 - PATH_OFFSET_POSITION(path, n_path_offset - 1) = 0;
576 + PATH_OFFSET_PBUFFER(path, path_offset - 1) = NULL;
577 + PATH_OFFSET_POSITION(path, path_offset - 1) = 0;
578 return CARRY_ON;
579 }
580 return REPEAT_SEARCH; /* Root is changed and we must recalculate the path. */
581 }
582
583 if (!B_IS_IN_TREE
584 - (bh = PATH_OFFSET_PBUFFER(path, n_path_offset - 1)))
585 + (bh = PATH_OFFSET_PBUFFER(path, path_offset - 1)))
586 return REPEAT_SEARCH; /* Parent in the path is not in the tree. */
587
588 - if ((n_position =
589 + if ((position =
590 PATH_OFFSET_POSITION(path,
591 - n_path_offset - 1)) > B_NR_ITEMS(bh))
592 + path_offset - 1)) > B_NR_ITEMS(bh))
593 return REPEAT_SEARCH;
594
595 - if (B_N_CHILD_NUM(bh, n_position) !=
596 - PATH_OFFSET_PBUFFER(path, n_path_offset)->b_blocknr)
597 + if (B_N_CHILD_NUM(bh, position) !=
598 + PATH_OFFSET_PBUFFER(path, path_offset)->b_blocknr)
599 /* Parent in the path is not parent of the current node in the tree. */
600 return REPEAT_SEARCH;
601
602 @@ -1935,92 +1935,92 @@ static int get_direct_parent(struct tree
603 return CARRY_ON; /* Parent in the path is unlocked and really parent of the current node. */
604 }
605
606 -/* Using lnum[n_h] and rnum[n_h] we should determine what neighbors
607 - * of S[n_h] we
608 - * need in order to balance S[n_h], and get them if necessary.
609 +/* Using lnum[h] and rnum[h] we should determine what neighbors
610 + * of S[h] we
611 + * need in order to balance S[h], and get them if necessary.
612 * Returns: SCHEDULE_OCCURRED - schedule occurred while the function worked;
613 * CARRY_ON - schedule didn't occur while the function worked;
614 */
615 -static int get_neighbors(struct tree_balance *tb, int n_h)
616 +static int get_neighbors(struct tree_balance *tb, int h)
617 {
618 - int n_child_position,
619 - n_path_offset = PATH_H_PATH_OFFSET(tb->tb_path, n_h + 1);
620 - unsigned long n_son_number;
621 + int child_position,
622 + path_offset = PATH_H_PATH_OFFSET(tb->tb_path, h + 1);
623 + unsigned long son_number;
624 struct super_block *sb = tb->tb_sb;
625 struct buffer_head *bh;
626
627 - PROC_INFO_INC(sb, get_neighbors[n_h]);
628 + PROC_INFO_INC(sb, get_neighbors[h]);
629
630 - if (tb->lnum[n_h]) {
631 - /* We need left neighbor to balance S[n_h]. */
632 - PROC_INFO_INC(sb, need_l_neighbor[n_h]);
633 - bh = PATH_OFFSET_PBUFFER(tb->tb_path, n_path_offset);
634 + if (tb->lnum[h]) {
635 + /* We need left neighbor to balance S[h]. */
636 + PROC_INFO_INC(sb, need_l_neighbor[h]);
637 + bh = PATH_OFFSET_PBUFFER(tb->tb_path, path_offset);
638
639 - RFALSE(bh == tb->FL[n_h] &&
640 - !PATH_OFFSET_POSITION(tb->tb_path, n_path_offset),
641 + RFALSE(bh == tb->FL[h] &&
642 + !PATH_OFFSET_POSITION(tb->tb_path, path_offset),
643 "PAP-8270: invalid position in the parent");
644
645 - n_child_position =
646 + child_position =
647 (bh ==
648 - tb->FL[n_h]) ? tb->lkey[n_h] : B_NR_ITEMS(tb->
649 - FL[n_h]);
650 - n_son_number = B_N_CHILD_NUM(tb->FL[n_h], n_child_position);
651 - bh = sb_bread(sb, n_son_number);
652 + tb->FL[h]) ? tb->lkey[h] : B_NR_ITEMS(tb->
653 + FL[h]);
654 + son_number = B_N_CHILD_NUM(tb->FL[h], child_position);
655 + bh = sb_bread(sb, son_number);
656 if (!bh)
657 return IO_ERROR;
658 if (FILESYSTEM_CHANGED_TB(tb)) {
659 brelse(bh);
660 - PROC_INFO_INC(sb, get_neighbors_restart[n_h]);
661 + PROC_INFO_INC(sb, get_neighbors_restart[h]);
662 return REPEAT_SEARCH;
663 }
664
665 - RFALSE(!B_IS_IN_TREE(tb->FL[n_h]) ||
666 - n_child_position > B_NR_ITEMS(tb->FL[n_h]) ||
667 - B_N_CHILD_NUM(tb->FL[n_h], n_child_position) !=
668 + RFALSE(!B_IS_IN_TREE(tb->FL[h]) ||
669 + child_position > B_NR_ITEMS(tb->FL[h]) ||
670 + B_N_CHILD_NUM(tb->FL[h], child_position) !=
671 bh->b_blocknr, "PAP-8275: invalid parent");
672 RFALSE(!B_IS_IN_TREE(bh), "PAP-8280: invalid child");
673 - RFALSE(!n_h &&
674 + RFALSE(!h &&
675 B_FREE_SPACE(bh) !=
676 MAX_CHILD_SIZE(bh) -
677 - dc_size(B_N_CHILD(tb->FL[0], n_child_position)),
678 + dc_size(B_N_CHILD(tb->FL[0], child_position)),
679 "PAP-8290: invalid child size of left neighbor");
680
681 - brelse(tb->L[n_h]);
682 - tb->L[n_h] = bh;
683 + brelse(tb->L[h]);
684 + tb->L[h] = bh;
685 }
686
687 - /* We need right neighbor to balance S[n_path_offset]. */
688 - if (tb->rnum[n_h]) {
689 - PROC_INFO_INC(sb, need_r_neighbor[n_h]);
690 - bh = PATH_OFFSET_PBUFFER(tb->tb_path, n_path_offset);
691 + /* We need right neighbor to balance S[path_offset]. */
692 + if (tb->rnum[h]) { /* We need right neighbor to balance S[path_offset]. */
693 + PROC_INFO_INC(sb, need_r_neighbor[h]);
694 + bh = PATH_OFFSET_PBUFFER(tb->tb_path, path_offset);
695
696 - RFALSE(bh == tb->FR[n_h] &&
697 + RFALSE(bh == tb->FR[h] &&
698 PATH_OFFSET_POSITION(tb->tb_path,
699 - n_path_offset) >=
700 + path_offset) >=
701 B_NR_ITEMS(bh),
702 "PAP-8295: invalid position in the parent");
703
704 - n_child_position =
705 - (bh == tb->FR[n_h]) ? tb->rkey[n_h] + 1 : 0;
706 - n_son_number = B_N_CHILD_NUM(tb->FR[n_h], n_child_position);
707 - bh = sb_bread(sb, n_son_number);
708 + child_position =
709 + (bh == tb->FR[h]) ? tb->rkey[h] + 1 : 0;
710 + son_number = B_N_CHILD_NUM(tb->FR[h], child_position);
711 + bh = sb_bread(sb, son_number);
712 if (!bh)
713 return IO_ERROR;
714 if (FILESYSTEM_CHANGED_TB(tb)) {
715 brelse(bh);
716 - PROC_INFO_INC(sb, get_neighbors_restart[n_h]);
717 + PROC_INFO_INC(sb, get_neighbors_restart[h]);
718 return REPEAT_SEARCH;
719 }
720 - brelse(tb->R[n_h]);
721 - tb->R[n_h] = bh;
722 + brelse(tb->R[h]);
723 + tb->R[h] = bh;
724
725 - RFALSE(!n_h
726 + RFALSE(!h
727 && B_FREE_SPACE(bh) !=
728 MAX_CHILD_SIZE(bh) -
729 - dc_size(B_N_CHILD(tb->FR[0], n_child_position)),
730 + dc_size(B_N_CHILD(tb->FR[0], child_position)),
731 "PAP-8300: invalid child size of right neighbor (%d != %d - %d)",
732 B_FREE_SPACE(bh), MAX_CHILD_SIZE(bh),
733 - dc_size(B_N_CHILD(tb->FR[0], n_child_position)));
734 + dc_size(B_N_CHILD(tb->FR[0], child_position)));
735
736 }
737 return CARRY_ON;
738 @@ -2317,11 +2317,11 @@ static int wait_tb_buffers_until_unlocke
739 * -1 - if no_disk_space
740 */
741
742 -int fix_nodes(int n_op_mode, struct tree_balance *tb,
743 +int fix_nodes(int op_mode, struct tree_balance *tb,
744 struct item_head *ins_ih, const void *data)
745 {
746 - int n_ret_value, n_h, n_item_num = PATH_LAST_POSITION(tb->tb_path);
747 - int n_pos_in_item;
748 + int ret, h, item_num = PATH_LAST_POSITION(tb->tb_path);
749 + int pos_in_item;
750
751 /* we set wait_tb_buffers_run when we have to restore any dirty bits cleared
752 ** during wait_tb_buffers_run
753 @@ -2331,7 +2331,7 @@ int fix_nodes(int n_op_mode, struct tree
754
755 ++REISERFS_SB(tb->tb_sb)->s_fix_nodes;
756
757 - n_pos_in_item = tb->tb_path->pos_in_item;
758 + pos_in_item = tb->tb_path->pos_in_item;
759
760 tb->fs_gen = get_generation(tb->tb_sb);
761
762 @@ -2364,26 +2364,26 @@ int fix_nodes(int n_op_mode, struct tree
763 reiserfs_panic(tb->tb_sb, "PAP-8320", "S[0] (%b %z) is "
764 "not uptodate at the beginning of fix_nodes "
765 "or not in tree (mode %c)",
766 - tbS0, tbS0, n_op_mode);
767 + tbS0, tbS0, op_mode);
768
769 /* Check parameters. */
770 - switch (n_op_mode) {
771 + switch (op_mode) {
772 case M_INSERT:
773 - if (n_item_num <= 0 || n_item_num > B_NR_ITEMS(tbS0))
774 + if (item_num <= 0 || item_num > B_NR_ITEMS(tbS0))
775 reiserfs_panic(tb->tb_sb, "PAP-8330", "Incorrect "
776 "item number %d (in S0 - %d) in case "
777 - "of insert", n_item_num,
778 + "of insert", item_num,
779 B_NR_ITEMS(tbS0));
780 break;
781 case M_PASTE:
782 case M_DELETE:
783 case M_CUT:
784 - if (n_item_num < 0 || n_item_num >= B_NR_ITEMS(tbS0)) {
785 + if (item_num < 0 || item_num >= B_NR_ITEMS(tbS0)) {
786 print_block(tbS0, 0, -1, -1);
787 reiserfs_panic(tb->tb_sb, "PAP-8335", "Incorrect "
788 "item number(%d); mode = %c "
789 "insert_size = %d",
790 - n_item_num, n_op_mode,
791 + item_num, op_mode,
792 tb->insert_size[0]);
793 }
794 break;
795 @@ -2397,73 +2397,73 @@ int fix_nodes(int n_op_mode, struct tree
796 // FIXME: maybe -ENOMEM when tb->vn_buf == 0? Now just repeat
797 return REPEAT_SEARCH;
798
799 - /* Starting from the leaf level; for all levels n_h of the tree. */
800 - for (n_h = 0; n_h < MAX_HEIGHT && tb->insert_size[n_h]; n_h++) {
801 - n_ret_value = get_direct_parent(tb, n_h);
802 - if (n_ret_value != CARRY_ON)
803 + /* Starting from the leaf level; for all levels h of the tree. */
804 + for (h = 0; h < MAX_HEIGHT && tb->insert_size[h]; h++) {
805 + ret = get_direct_parent(tb, h);
806 + if (ret != CARRY_ON)
807 goto repeat;
808
809 - n_ret_value = check_balance(n_op_mode, tb, n_h, n_item_num,
810 - n_pos_in_item, ins_ih, data);
811 - if (n_ret_value != CARRY_ON) {
812 - if (n_ret_value == NO_BALANCING_NEEDED) {
813 + ret = check_balance(op_mode, tb, h, item_num,
814 + pos_in_item, ins_ih, data);
815 + if (ret != CARRY_ON) {
816 + if (ret == NO_BALANCING_NEEDED) {
817 /* No balancing for higher levels needed. */
818 - n_ret_value = get_neighbors(tb, n_h);
819 - if (n_ret_value != CARRY_ON)
820 + ret = get_neighbors(tb, h);
821 + if (ret != CARRY_ON)
822 goto repeat;
823 - if (n_h != MAX_HEIGHT - 1)
824 - tb->insert_size[n_h + 1] = 0;
825 + if (h != MAX_HEIGHT - 1)
826 + tb->insert_size[h + 1] = 0;
827 /* ok, analysis and resource gathering are complete */
828 break;
829 }
830 goto repeat;
831 }
832
833 - n_ret_value = get_neighbors(tb, n_h);
834 - if (n_ret_value != CARRY_ON)
835 + ret = get_neighbors(tb, h);
836 + if (ret != CARRY_ON)
837 goto repeat;
838
839 /* No disk space, or schedule occurred and analysis may be
840 * invalid and needs to be redone. */
841 - n_ret_value = get_empty_nodes(tb, n_h);
842 - if (n_ret_value != CARRY_ON)
843 + ret = get_empty_nodes(tb, h);
844 + if (ret != CARRY_ON)
845 goto repeat;
846
847 - if (!PATH_H_PBUFFER(tb->tb_path, n_h)) {
848 + if (!PATH_H_PBUFFER(tb->tb_path, h)) {
849 /* We have a positive insert size but no nodes exist on this
850 level, this means that we are creating a new root. */
851
852 - RFALSE(tb->blknum[n_h] != 1,
853 + RFALSE(tb->blknum[h] != 1,
854 "PAP-8350: creating new empty root");
855
856 - if (n_h < MAX_HEIGHT - 1)
857 - tb->insert_size[n_h + 1] = 0;
858 - } else if (!PATH_H_PBUFFER(tb->tb_path, n_h + 1)) {
859 - if (tb->blknum[n_h] > 1) {
860 - /* The tree needs to be grown, so this node S[n_h]
861 + if (h < MAX_HEIGHT - 1)
862 + tb->insert_size[h + 1] = 0;
863 + } else if (!PATH_H_PBUFFER(tb->tb_path, h + 1)) {
864 + if (tb->blknum[h] > 1) {
865 + /* The tree needs to be grown, so this node S[h]
866 which is the root node is split into two nodes,
867 - and a new node (S[n_h+1]) will be created to
868 + and a new node (S[h+1]) will be created to
869 become the root node. */
870
871 - RFALSE(n_h == MAX_HEIGHT - 1,
872 + RFALSE(h == MAX_HEIGHT - 1,
873 "PAP-8355: attempt to create too high of a tree");
874
875 - tb->insert_size[n_h + 1] =
876 + tb->insert_size[h + 1] =
877 (DC_SIZE +
878 - KEY_SIZE) * (tb->blknum[n_h] - 1) +
879 + KEY_SIZE) * (tb->blknum[h] - 1) +
880 DC_SIZE;
881 - } else if (n_h < MAX_HEIGHT - 1)
882 - tb->insert_size[n_h + 1] = 0;
883 + } else if (h < MAX_HEIGHT - 1)
884 + tb->insert_size[h + 1] = 0;
885 } else
886 - tb->insert_size[n_h + 1] =
887 - (DC_SIZE + KEY_SIZE) * (tb->blknum[n_h] - 1);
888 + tb->insert_size[h + 1] =
889 + (DC_SIZE + KEY_SIZE) * (tb->blknum[h] - 1);
890 }
891
892 - n_ret_value = wait_tb_buffers_until_unlocked(tb);
893 - if (n_ret_value == CARRY_ON) {
894 + ret = wait_tb_buffers_until_unlocked(tb);
895 + if (ret == CARRY_ON) {
896 if (FILESYSTEM_CHANGED_TB(tb)) {
897 wait_tb_buffers_run = 1;
898 - n_ret_value = REPEAT_SEARCH;
899 + ret = REPEAT_SEARCH;
900 goto repeat;
901 } else {
902 return CARRY_ON;
903 @@ -2529,7 +2529,7 @@ int fix_nodes(int n_op_mode, struct tree
904 (tb->tb_sb, tb->FEB[i]);
905 }
906 }
907 - return n_ret_value;
908 + return ret;
909 }
910
911 }
912 --- a/fs/reiserfs/stree.c
913 +++ b/fs/reiserfs/stree.c
914 @@ -136,11 +136,11 @@ inline int comp_short_le_keys(const stru
915 const struct reiserfs_key *key2)
916 {
917 __u32 *k1_u32, *k2_u32;
918 - int n_key_length = REISERFS_SHORT_KEY_LEN;
919 + int key_length = REISERFS_SHORT_KEY_LEN;
920
921 k1_u32 = (__u32 *) key1;
922 k2_u32 = (__u32 *) key2;
923 - for (; n_key_length--; ++k1_u32, ++k2_u32) {
924 + for (; key_length--; ++k1_u32, ++k2_u32) {
925 if (le32_to_cpu(*k1_u32) < le32_to_cpu(*k2_u32))
926 return -1;
927 if (le32_to_cpu(*k1_u32) > le32_to_cpu(*k2_u32))
928 @@ -177,10 +177,10 @@ inline int comp_le_keys(const struct rei
929 * *pos = number of the searched element if found, else the *
930 * number of the first element that is larger than key. *
931 **************************************************************************/
932 -/* For those not familiar with binary search: n_lbound is the leftmost item that it
933 - could be, n_rbound the rightmost item that it could be. We examine the item
934 - halfway between n_lbound and n_rbound, and that tells us either that we can increase
935 - n_lbound, or decrease n_rbound, or that we have found it, or if n_lbound <= n_rbound that
936 +/* For those not familiar with binary search: lbound is the leftmost item that it
937 + could be, rbound the rightmost item that it could be. We examine the item
938 + halfway between lbound and rbound, and that tells us either that we can increase
939 + lbound, or decrease rbound, or that we have found it, or if lbound <= rbound that
940 there are no possible items, and we have not found it. With each examination we
941 cut the number of possible items it could be by one more than half rounded down,
942 or we find it. */
943 @@ -198,28 +198,27 @@ static inline int bin_search(const void
944 int *pos /* Number of the searched for element. */
945 )
946 {
947 - int n_rbound, n_lbound, n_j;
948 + int rbound, lbound, j;
949
950 - for (n_j = ((n_rbound = num - 1) + (n_lbound = 0)) / 2;
951 - n_lbound <= n_rbound; n_j = (n_rbound + n_lbound) / 2)
952 + for (j = ((rbound = num - 1) + (lbound = 0)) / 2;
953 + lbound <= rbound; j = (rbound + lbound) / 2)
954 switch (comp_keys
955 - ((struct reiserfs_key *)((char *)base +
956 - n_j * width),
957 + ((struct reiserfs_key *)((char *)base + j * width),
958 (struct cpu_key *)key)) {
959 case -1:
960 - n_lbound = n_j + 1;
961 + lbound = j + 1;
962 continue;
963 case 1:
964 - n_rbound = n_j - 1;
965 + rbound = j - 1;
966 continue;
967 case 0:
968 - *pos = n_j;
969 + *pos = j;
970 return ITEM_FOUND; /* Key found in the array. */
971 }
972
973 /* bin_search did not find given key, it returns position of key,
974 that is minimal and greater than the given one. */
975 - *pos = n_lbound;
976 + *pos = lbound;
977 return ITEM_NOT_FOUND;
978 }
979
980 @@ -242,43 +241,41 @@ static const struct reiserfs_key MAX_KEY
981 of the path, and going upwards. We must check the path's validity at each step. If the key is not in
982 the path, there is no delimiting key in the tree (buffer is first or last buffer in tree), and in this
983 case we return a special key, either MIN_KEY or MAX_KEY. */
984 -static inline const struct reiserfs_key *get_lkey(const struct treepath
985 - *chk_path,
986 - const struct super_block
987 - *sb)
988 +static inline const struct reiserfs_key *get_lkey(const struct treepath *chk_path,
989 + const struct super_block *sb)
990 {
991 - int n_position, n_path_offset = chk_path->path_length;
992 + int position, path_offset = chk_path->path_length;
993 struct buffer_head *parent;
994
995 - RFALSE(n_path_offset < FIRST_PATH_ELEMENT_OFFSET,
996 + RFALSE(path_offset < FIRST_PATH_ELEMENT_OFFSET,
997 "PAP-5010: invalid offset in the path");
998
999 /* While not higher in path than first element. */
1000 - while (n_path_offset-- > FIRST_PATH_ELEMENT_OFFSET) {
1001 + while (path_offset-- > FIRST_PATH_ELEMENT_OFFSET) {
1002
1003 RFALSE(!buffer_uptodate
1004 - (PATH_OFFSET_PBUFFER(chk_path, n_path_offset)),
1005 + (PATH_OFFSET_PBUFFER(chk_path, path_offset)),
1006 "PAP-5020: parent is not uptodate");
1007
1008 /* Parent at the path is not in the tree now. */
1009 if (!B_IS_IN_TREE
1010 (parent =
1011 - PATH_OFFSET_PBUFFER(chk_path, n_path_offset)))
1012 + PATH_OFFSET_PBUFFER(chk_path, path_offset)))
1013 return &MAX_KEY;
1014 /* Check whether position in the parent is correct. */
1015 - if ((n_position =
1016 + if ((position =
1017 PATH_OFFSET_POSITION(chk_path,
1018 - n_path_offset)) >
1019 + path_offset)) >
1020 B_NR_ITEMS(parent))
1021 return &MAX_KEY;
1022 /* Check whether parent at the path really points to the child. */
1023 - if (B_N_CHILD_NUM(parent, n_position) !=
1024 + if (B_N_CHILD_NUM(parent, position) !=
1025 PATH_OFFSET_PBUFFER(chk_path,
1026 - n_path_offset + 1)->b_blocknr)
1027 + path_offset + 1)->b_blocknr)
1028 return &MAX_KEY;
1029 /* Return delimiting key if position in the parent is not equal to zero. */
1030 - if (n_position)
1031 - return B_N_PDELIM_KEY(parent, n_position - 1);
1032 + if (position)
1033 + return B_N_PDELIM_KEY(parent, position - 1);
1034 }
1035 /* Return MIN_KEY if we are in the root of the buffer tree. */
1036 if (PATH_OFFSET_PBUFFER(chk_path, FIRST_PATH_ELEMENT_OFFSET)->
1037 @@ -291,37 +288,37 @@ static inline const struct reiserfs_key
1038 inline const struct reiserfs_key *get_rkey(const struct treepath *chk_path,
1039 const struct super_block *sb)
1040 {
1041 - int n_position, n_path_offset = chk_path->path_length;
1042 + int position, path_offset = chk_path->path_length;
1043 struct buffer_head *parent;
1044
1045 - RFALSE(n_path_offset < FIRST_PATH_ELEMENT_OFFSET,
1046 + RFALSE(path_offset < FIRST_PATH_ELEMENT_OFFSET,
1047 "PAP-5030: invalid offset in the path");
1048
1049 - while (n_path_offset-- > FIRST_PATH_ELEMENT_OFFSET) {
1050 + while (path_offset-- > FIRST_PATH_ELEMENT_OFFSET) {
1051
1052 RFALSE(!buffer_uptodate
1053 - (PATH_OFFSET_PBUFFER(chk_path, n_path_offset)),
1054 + (PATH_OFFSET_PBUFFER(chk_path, path_offset)),
1055 "PAP-5040: parent is not uptodate");
1056
1057 /* Parent at the path is not in the tree now. */
1058 if (!B_IS_IN_TREE
1059 (parent =
1060 - PATH_OFFSET_PBUFFER(chk_path, n_path_offset)))
1061 + PATH_OFFSET_PBUFFER(chk_path, path_offset)))
1062 return &MIN_KEY;
1063 /* Check whether position in the parent is correct. */
1064 - if ((n_position =
1065 + if ((position =
1066 PATH_OFFSET_POSITION(chk_path,
1067 - n_path_offset)) >
1068 + path_offset)) >
1069 B_NR_ITEMS(parent))
1070 return &MIN_KEY;
1071 /* Check whether parent at the path really points to the child. */
1072 - if (B_N_CHILD_NUM(parent, n_position) !=
1073 + if (B_N_CHILD_NUM(parent, position) !=
1074 PATH_OFFSET_PBUFFER(chk_path,
1075 - n_path_offset + 1)->b_blocknr)
1076 + path_offset + 1)->b_blocknr)
1077 return &MIN_KEY;
1078 /* Return delimiting key if position in the parent is not the last one. */
1079 - if (n_position != B_NR_ITEMS(parent))
1080 - return B_N_PDELIM_KEY(parent, n_position);
1081 + if (position != B_NR_ITEMS(parent))
1082 + return B_N_PDELIM_KEY(parent, position);
1083 }
1084 /* Return MAX_KEY if we are in the root of the buffer tree. */
1085 if (PATH_OFFSET_PBUFFER(chk_path, FIRST_PATH_ELEMENT_OFFSET)->
1086 @@ -371,14 +368,14 @@ int reiserfs_check_path(struct treepath
1087 void pathrelse_and_restore(struct super_block *sb,
1088 struct treepath *search_path)
1089 {
1090 - int n_path_offset = search_path->path_length;
1091 + int path_offset = search_path->path_length;
1092
1093 - RFALSE(n_path_offset < ILLEGAL_PATH_ELEMENT_OFFSET,
1094 + RFALSE(path_offset < ILLEGAL_PATH_ELEMENT_OFFSET,
1095 "clm-4000: invalid path offset");
1096
1097 - while (n_path_offset > ILLEGAL_PATH_ELEMENT_OFFSET) {
1098 + while (path_offset > ILLEGAL_PATH_ELEMENT_OFFSET) {
1099 struct buffer_head *bh;
1100 - bh = PATH_OFFSET_PBUFFER(search_path, n_path_offset--);
1101 + bh = PATH_OFFSET_PBUFFER(search_path, path_offset--);
1102 reiserfs_restore_prepared_buffer(sb, bh);
1103 brelse(bh);
1104 }
1105 @@ -388,13 +385,13 @@ void pathrelse_and_restore(struct super_
1106 /* Drop the reference to each buffer in a path */
1107 void pathrelse(struct treepath *search_path)
1108 {
1109 - int n_path_offset = search_path->path_length;
1110 + int path_offset = search_path->path_length;
1111
1112 - RFALSE(n_path_offset < ILLEGAL_PATH_ELEMENT_OFFSET,
1113 + RFALSE(path_offset < ILLEGAL_PATH_ELEMENT_OFFSET,
1114 "PAP-5090: invalid path offset");
1115
1116 - while (n_path_offset > ILLEGAL_PATH_ELEMENT_OFFSET)
1117 - brelse(PATH_OFFSET_PBUFFER(search_path, n_path_offset--));
1118 + while (path_offset > ILLEGAL_PATH_ELEMENT_OFFSET)
1119 + brelse(PATH_OFFSET_PBUFFER(search_path, path_offset--));
1120
1121 search_path->path_length = ILLEGAL_PATH_ELEMENT_OFFSET;
1122 }
1123 @@ -572,16 +569,16 @@ int search_by_key(struct super_block *sb
1124 by the calling
1125 function. It is filled up
1126 by this function. */
1127 - int n_stop_level /* How far down the tree to search. To
1128 + int stop_level /* How far down the tree to search. To
1129 stop at leaf level - set to
1130 DISK_LEAF_NODE_LEVEL */
1131 )
1132 {
1133 - b_blocknr_t n_block_number;
1134 + b_blocknr_t block_number;
1135 int expected_level;
1136 struct buffer_head *bh;
1137 struct path_element *last_element;
1138 - int n_node_level, n_retval;
1139 + int node_level, retval;
1140 int right_neighbor_of_leaf_node;
1141 int fs_gen;
1142 struct buffer_head *reada_bh[SEARCH_BY_KEY_READA];
1143 @@ -589,7 +586,7 @@ int search_by_key(struct super_block *sb
1144 int reada_count = 0;
1145
1146 #ifdef CONFIG_REISERFS_CHECK
1147 - int n_repeat_counter = 0;
1148 + int repeat_counter = 0;
1149 #endif
1150
1151 PROC_INFO_INC(sb, search_by_key);
1152 @@ -605,16 +602,16 @@ int search_by_key(struct super_block *sb
1153 /* With each iteration of this loop we search through the items in the
1154 current node, and calculate the next current node(next path element)
1155 for the next iteration of this loop.. */
1156 - n_block_number = SB_ROOT_BLOCK(sb);
1157 + block_number = SB_ROOT_BLOCK(sb);
1158 expected_level = -1;
1159 while (1) {
1160
1161 #ifdef CONFIG_REISERFS_CHECK
1162 - if (!(++n_repeat_counter % 50000))
1163 + if (!(++repeat_counter % 50000))
1164 reiserfs_warning(sb, "PAP-5100",
1165 "%s: there were %d iterations of "
1166 "while loop looking for key %K",
1167 - current->comm, n_repeat_counter,
1168 + current->comm, repeat_counter,
1169 key);
1170 #endif
1171
1172 @@ -627,7 +624,7 @@ int search_by_key(struct super_block *sb
1173 /* Read the next tree node, and set the last element in the path to
1174 have a pointer to it. */
1175 if ((bh = last_element->pe_buffer =
1176 - sb_getblk(sb, n_block_number))) {
1177 + sb_getblk(sb, block_number))) {
1178 if (!buffer_uptodate(bh) && reada_count > 1)
1179 search_by_key_reada(sb, reada_bh,
1180 reada_blocks, reada_count);
1181 @@ -661,7 +658,7 @@ int search_by_key(struct super_block *sb
1182
1183 /* Get the root block number so that we can repeat the search
1184 starting from the root. */
1185 - n_block_number = SB_ROOT_BLOCK(sb);
1186 + block_number = SB_ROOT_BLOCK(sb);
1187 expected_level = -1;
1188 right_neighbor_of_leaf_node = 0;
1189
1190 @@ -694,26 +691,26 @@ int search_by_key(struct super_block *sb
1191 }
1192
1193 /* ok, we have acquired next formatted node in the tree */
1194 - n_node_level = B_LEVEL(bh);
1195 + node_level = B_LEVEL(bh);
1196
1197 - PROC_INFO_BH_STAT(sb, bh, n_node_level - 1);
1198 + PROC_INFO_BH_STAT(sb, bh, node_level - 1);
1199
1200 - RFALSE(n_node_level < n_stop_level,
1201 + RFALSE(node_level < stop_level,
1202 "vs-5152: tree level (%d) is less than stop level (%d)",
1203 - n_node_level, n_stop_level);
1204 + node_level, stop_level);
1205
1206 - n_retval = bin_search(key, B_N_PITEM_HEAD(bh, 0),
1207 + retval = bin_search(key, B_N_PITEM_HEAD(bh, 0),
1208 B_NR_ITEMS(bh),
1209 - (n_node_level ==
1210 + (node_level ==
1211 DISK_LEAF_NODE_LEVEL) ? IH_SIZE :
1212 KEY_SIZE,
1213 &(last_element->pe_position));
1214 - if (n_node_level == n_stop_level) {
1215 - return n_retval;
1216 + if (node_level == stop_level) {
1217 + return retval;
1218 }
1219
1220 /* we are not in the stop level */
1221 - if (n_retval == ITEM_FOUND)
1222 + if (retval == ITEM_FOUND)
1223 /* item has been found, so we choose the pointer which is to the right of the found one */
1224 last_element->pe_position++;
1225
1226 @@ -724,12 +721,12 @@ int search_by_key(struct super_block *sb
1227 /* So we have chosen a position in the current node which is
1228 an internal node. Now we calculate child block number by
1229 position in the node. */
1230 - n_block_number =
1231 + block_number =
1232 B_N_CHILD_NUM(bh, last_element->pe_position);
1233
1234 /* if we are going to read leaf nodes, try for read ahead as well */
1235 if ((search_path->reada & PATH_READA) &&
1236 - n_node_level == DISK_LEAF_NODE_LEVEL + 1) {
1237 + node_level == DISK_LEAF_NODE_LEVEL + 1) {
1238 int pos = last_element->pe_position;
1239 int limit = B_NR_ITEMS(bh);
1240 struct reiserfs_key *le_key;
1241 @@ -781,7 +778,7 @@ int search_for_position_by_key(struct su
1242 )
1243 {
1244 struct item_head *p_le_ih; /* pointer to on-disk structure */
1245 - int n_blk_size;
1246 + int blk_size;
1247 loff_t item_offset, offset;
1248 struct reiserfs_dir_entry de;
1249 int retval;
1250 @@ -816,7 +813,7 @@ int search_for_position_by_key(struct su
1251 p_le_ih =
1252 B_N_PITEM_HEAD(PATH_PLAST_BUFFER(search_path),
1253 --PATH_LAST_POSITION(search_path));
1254 - n_blk_size = sb->s_blocksize;
1255 + blk_size = sb->s_blocksize;
1256
1257 if (comp_short_keys(&(p_le_ih->ih_key), p_cpu_key)) {
1258 return FILE_NOT_FOUND;
1259 @@ -828,10 +825,10 @@ int search_for_position_by_key(struct su
1260
1261 /* Needed byte is contained in the item pointed to by the path. */
1262 if (item_offset <= offset &&
1263 - item_offset + op_bytes_number(p_le_ih, n_blk_size) > offset) {
1264 + item_offset + op_bytes_number(p_le_ih, blk_size) > offset) {
1265 pos_in_item(search_path) = offset - item_offset;
1266 if (is_indirect_le_ih(p_le_ih)) {
1267 - pos_in_item(search_path) /= n_blk_size;
1268 + pos_in_item(search_path) /= blk_size;
1269 }
1270 return POSITION_FOUND;
1271 }
1272 @@ -891,7 +888,7 @@ static inline int prepare_for_direct_ite
1273 if (get_inode_item_key_version(inode) == KEY_FORMAT_3_6) {
1274 //
1275 round_len = ROUND_UP(new_file_length);
1276 - /* this was n_new_file_length < le_ih ... */
1277 + /* this was new_file_length < le_ih ... */
1278 if (round_len < le_ih_k_offset(le_ih)) {
1279 *cut_size = -(IH_SIZE + ih_item_len(le_ih));
1280 return M_DELETE; /* Delete this item. */
1281 @@ -953,7 +950,7 @@ static inline int prepare_for_direntry_i
1282 This function returns a determination of what balance mode the calling function should employ. */
1283 static char prepare_for_delete_or_cut(struct reiserfs_transaction_handle *th, struct inode *inode, struct treepath *path, const struct cpu_key *item_key, int *removed, /* Number of unformatted nodes which were removed
1284 from end of the file. */
1285 - int *cut_size, unsigned long long n_new_file_length /* MAX_KEY_OFFSET in case of delete. */
1286 + int *cut_size, unsigned long long new_file_length /* MAX_KEY_OFFSET in case of delete. */
1287 )
1288 {
1289 struct super_block *sb = inode->i_sb;
1290 @@ -965,7 +962,7 @@ static char prepare_for_delete_or_cut(st
1291 /* Stat_data item. */
1292 if (is_statdata_le_ih(p_le_ih)) {
1293
1294 - RFALSE(n_new_file_length != max_reiserfs_offset(inode),
1295 + RFALSE(new_file_length != max_reiserfs_offset(inode),
1296 "PAP-5210: mode must be M_DELETE");
1297
1298 *cut_size = -(IH_SIZE + ih_item_len(p_le_ih));
1299 @@ -975,13 +972,13 @@ static char prepare_for_delete_or_cut(st
1300 /* Directory item. */
1301 if (is_direntry_le_ih(p_le_ih))
1302 return prepare_for_direntry_item(path, p_le_ih, inode,
1303 - n_new_file_length,
1304 + new_file_length,
1305 cut_size);
1306
1307 /* Direct item. */
1308 if (is_direct_le_ih(p_le_ih))
1309 return prepare_for_direct_item(path, p_le_ih, inode,
1310 - n_new_file_length, cut_size);
1311 + new_file_length, cut_size);
1312
1313 /* Case of an indirect item. */
1314 {
1315 @@ -992,10 +989,10 @@ static char prepare_for_delete_or_cut(st
1316 int result = M_CUT;
1317 int pos = 0;
1318
1319 - if ( n_new_file_length == max_reiserfs_offset (inode) ) {
1320 + if ( new_file_length == max_reiserfs_offset (inode) ) {
1321 /* prepare_for_delete_or_cut() is called by
1322 * reiserfs_delete_item() */
1323 - n_new_file_length = 0;
1324 + new_file_length = 0;
1325 delete = 1;
1326 }
1327
1328 @@ -1006,7 +1003,7 @@ static char prepare_for_delete_or_cut(st
1329 copy_item_head(&s_ih, PATH_PITEM_HEAD(path));
1330 pos = I_UNFM_NUM(&s_ih);
1331
1332 - while (le_ih_k_offset (&s_ih) + (pos - 1) * blk_size > n_new_file_length) {
1333 + while (le_ih_k_offset (&s_ih) + (pos - 1) * blk_size > new_file_length) {
1334 __le32 *unfm;
1335 __u32 block;
1336
1337 @@ -1062,35 +1059,34 @@ static char prepare_for_delete_or_cut(st
1338 }
1339
1340 /* Calculate number of bytes which will be deleted or cut during balance */
1341 -static int calc_deleted_bytes_number(struct tree_balance *tb, char c_mode)
1342 +static int calc_deleted_bytes_number(struct tree_balance *tb, char mode)
1343 {
1344 - int n_del_size;
1345 + int del_size;
1346 struct item_head *p_le_ih = PATH_PITEM_HEAD(tb->tb_path);
1347
1348 if (is_statdata_le_ih(p_le_ih))
1349 return 0;
1350
1351 - n_del_size =
1352 - (c_mode ==
1353 + del_size =
1354 + (mode ==
1355 M_DELETE) ? ih_item_len(p_le_ih) : -tb->insert_size[0];
1356 if (is_direntry_le_ih(p_le_ih)) {
1357 - // return EMPTY_DIR_SIZE; /* We delete emty directoris only. */
1358 - // we can't use EMPTY_DIR_SIZE, as old format dirs have a different
1359 - // empty size. ick. FIXME, is this right?
1360 - //
1361 - return n_del_size;
1362 + /* return EMPTY_DIR_SIZE; We delete emty directoris only.
1363 + * we can't use EMPTY_DIR_SIZE, as old format dirs have a different
1364 + * empty size. ick. FIXME, is this right? */
1365 + return del_size;
1366 }
1367
1368 if (is_indirect_le_ih(p_le_ih))
1369 - n_del_size = (n_del_size / UNFM_P_SIZE) *
1370 + del_size = (del_size / UNFM_P_SIZE) *
1371 (PATH_PLAST_BUFFER(tb->tb_path)->b_size);
1372 - return n_del_size;
1373 + return del_size;
1374 }
1375
1376 static void init_tb_struct(struct reiserfs_transaction_handle *th,
1377 struct tree_balance *tb,
1378 struct super_block *sb,
1379 - struct treepath *path, int n_size)
1380 + struct treepath *path, int size)
1381 {
1382
1383 BUG_ON(!th->t_trans_id);
1384 @@ -1101,7 +1097,7 @@ static void init_tb_struct(struct reiser
1385 tb->tb_path = path;
1386 PATH_OFFSET_PBUFFER(path, ILLEGAL_PATH_ELEMENT_OFFSET) = NULL;
1387 PATH_OFFSET_POSITION(path, ILLEGAL_PATH_ELEMENT_OFFSET) = 0;
1388 - tb->insert_size[0] = n_size;
1389 + tb->insert_size[0] = size;
1390 }
1391
1392 void padd_item(char *item, int total_length, int length)
1393 @@ -1156,11 +1152,11 @@ int reiserfs_delete_item(struct reiserfs
1394 struct item_head s_ih;
1395 struct item_head *q_ih;
1396 int quota_cut_bytes;
1397 - int n_ret_value, n_del_size, n_removed;
1398 + int ret_value, del_size, removed;
1399
1400 #ifdef CONFIG_REISERFS_CHECK
1401 - char c_mode;
1402 - int n_iter = 0;
1403 + char mode;
1404 + int iter = 0;
1405 #endif
1406
1407 BUG_ON(!th->t_trans_id);
1408 @@ -1169,34 +1165,34 @@ int reiserfs_delete_item(struct reiserfs
1409 0 /*size is unknown */ );
1410
1411 while (1) {
1412 - n_removed = 0;
1413 + removed = 0;
1414
1415 #ifdef CONFIG_REISERFS_CHECK
1416 - n_iter++;
1417 - c_mode =
1418 + iter++;
1419 + mode =
1420 #endif
1421 prepare_for_delete_or_cut(th, inode, path,
1422 - item_key, &n_removed,
1423 - &n_del_size,
1424 + item_key, &removed,
1425 + &del_size,
1426 max_reiserfs_offset(inode));
1427
1428 - RFALSE(c_mode != M_DELETE, "PAP-5320: mode must be M_DELETE");
1429 + RFALSE(mode != M_DELETE, "PAP-5320: mode must be M_DELETE");
1430
1431 copy_item_head(&s_ih, PATH_PITEM_HEAD(path));
1432 - s_del_balance.insert_size[0] = n_del_size;
1433 + s_del_balance.insert_size[0] = del_size;
1434
1435 - n_ret_value = fix_nodes(M_DELETE, &s_del_balance, NULL, NULL);
1436 - if (n_ret_value != REPEAT_SEARCH)
1437 + ret_value = fix_nodes(M_DELETE, &s_del_balance, NULL, NULL);
1438 + if (ret_value != REPEAT_SEARCH)
1439 break;
1440
1441 PROC_INFO_INC(sb, delete_item_restarted);
1442
1443 // file system changed, repeat search
1444 - n_ret_value =
1445 + ret_value =
1446 search_for_position_by_key(sb, item_key, path);
1447 - if (n_ret_value == IO_ERROR)
1448 + if (ret_value == IO_ERROR)
1449 break;
1450 - if (n_ret_value == FILE_NOT_FOUND) {
1451 + if (ret_value == FILE_NOT_FOUND) {
1452 reiserfs_warning(sb, "vs-5340",
1453 "no items of the file %K found",
1454 item_key);
1455 @@ -1204,12 +1200,12 @@ int reiserfs_delete_item(struct reiserfs
1456 }
1457 } /* while (1) */
1458
1459 - if (n_ret_value != CARRY_ON) {
1460 + if (ret_value != CARRY_ON) {
1461 unfix_nodes(&s_del_balance);
1462 return 0;
1463 }
1464 // reiserfs_delete_item returns item length when success
1465 - n_ret_value = calc_deleted_bytes_number(&s_del_balance, M_DELETE);
1466 + ret_value = calc_deleted_bytes_number(&s_del_balance, M_DELETE);
1467 q_ih = get_ih(path);
1468 quota_cut_bytes = ih_item_len(q_ih);
1469
1470 @@ -1255,7 +1251,7 @@ int reiserfs_delete_item(struct reiserfs
1471 off = ((le_ih_k_offset(&s_ih) - 1) & (PAGE_CACHE_SIZE - 1));
1472 memcpy(data + off,
1473 B_I_PITEM(PATH_PLAST_BUFFER(path), &s_ih),
1474 - n_ret_value);
1475 + ret_value);
1476 kunmap_atomic(data, KM_USER0);
1477 }
1478 /* Perform balancing after all resources have been collected at once. */
1479 @@ -1269,7 +1265,7 @@ int reiserfs_delete_item(struct reiserfs
1480 DQUOT_FREE_SPACE_NODIRTY(inode, quota_cut_bytes);
1481
1482 /* Return deleted body length */
1483 - return n_ret_value;
1484 + return ret_value;
1485 }
1486
1487 /* Summary Of Mechanisms For Handling Collisions Between Processes:
1488 @@ -1432,13 +1428,13 @@ static int maybe_indirect_to_direct(stru
1489 struct page *page,
1490 struct treepath *path,
1491 const struct cpu_key *item_key,
1492 - loff_t n_new_file_size, char *mode)
1493 + loff_t new_file_size, char *mode)
1494 {
1495 struct super_block *sb = inode->i_sb;
1496 - int n_block_size = sb->s_blocksize;
1497 + int block_size = sb->s_blocksize;
1498 int cut_bytes;
1499 BUG_ON(!th->t_trans_id);
1500 - BUG_ON(n_new_file_size != inode->i_size);
1501 + BUG_ON(new_file_size != inode->i_size);
1502
1503 /* the page being sent in could be NULL if there was an i/o error
1504 ** reading in the last block. The user will hit problems trying to
1505 @@ -1450,15 +1446,15 @@ static int maybe_indirect_to_direct(stru
1506 /* leave tail in an unformatted node */
1507 *mode = M_SKIP_BALANCING;
1508 cut_bytes =
1509 - n_block_size - (n_new_file_size & (n_block_size - 1));
1510 + block_size - (new_file_size & (block_size - 1));
1511 pathrelse(path);
1512 return cut_bytes;
1513 }
1514 /* Perform the conversion to a direct_item. */
1515 /* return indirect_to_direct(inode, path, item_key,
1516 - n_new_file_size, mode); */
1517 + new_file_size, mode); */
1518 return indirect2direct(th, inode, page, path, item_key,
1519 - n_new_file_size, mode);
1520 + new_file_size, mode);
1521 }
1522
1523 /* we did indirect_to_direct conversion. And we have inserted direct
1524 @@ -1512,7 +1508,7 @@ int reiserfs_cut_from_item(struct reiser
1525 struct treepath *path,
1526 struct cpu_key *item_key,
1527 struct inode *inode,
1528 - struct page *page, loff_t n_new_file_size)
1529 + struct page *page, loff_t new_file_size)
1530 {
1531 struct super_block *sb = inode->i_sb;
1532 /* Every function which is going to call do_balance must first
1533 @@ -1521,10 +1517,10 @@ int reiserfs_cut_from_item(struct reiser
1534 After that we can make tree balancing. */
1535 struct tree_balance s_cut_balance;
1536 struct item_head *p_le_ih;
1537 - int n_cut_size = 0, /* Amount to be cut. */
1538 - n_ret_value = CARRY_ON, n_removed = 0, /* Number of the removed unformatted nodes. */
1539 - n_is_inode_locked = 0;
1540 - char c_mode; /* Mode of the balance. */
1541 + int cut_size = 0, /* Amount to be cut. */
1542 + ret_value = CARRY_ON, removed = 0, /* Number of the removed unformatted nodes. */
1543 + is_inode_locked = 0;
1544 + char mode; /* Mode of the balance. */
1545 int retval2 = -1;
1546 int quota_cut_bytes;
1547 loff_t tail_pos = 0;
1548 @@ -1532,7 +1528,7 @@ int reiserfs_cut_from_item(struct reiser
1549 BUG_ON(!th->t_trans_id);
1550
1551 init_tb_struct(th, &s_cut_balance, inode->i_sb, path,
1552 - n_cut_size);
1553 + cut_size);
1554
1555 /* Repeat this loop until we either cut the item without needing
1556 to balance, or we fix_nodes without schedule occurring */
1557 @@ -1542,30 +1538,30 @@ int reiserfs_cut_from_item(struct reiser
1558 free unformatted nodes which are pointed to by the cut
1559 pointers. */
1560
1561 - c_mode =
1562 + mode =
1563 prepare_for_delete_or_cut(th, inode, path,
1564 - item_key, &n_removed,
1565 - &n_cut_size, n_new_file_size);
1566 - if (c_mode == M_CONVERT) {
1567 + item_key, &removed,
1568 + &cut_size, new_file_size);
1569 + if (mode == M_CONVERT) {
1570 /* convert last unformatted node to direct item or leave
1571 tail in the unformatted node */
1572 - RFALSE(n_ret_value != CARRY_ON,
1573 + RFALSE(ret_value != CARRY_ON,
1574 "PAP-5570: can not convert twice");
1575
1576 - n_ret_value =
1577 + ret_value =
1578 maybe_indirect_to_direct(th, inode, page,
1579 path, item_key,
1580 - n_new_file_size, &c_mode);
1581 - if (c_mode == M_SKIP_BALANCING)
1582 + new_file_size, &mode);
1583 + if (mode == M_SKIP_BALANCING)
1584 /* tail has been left in the unformatted node */
1585 - return n_ret_value;
1586 + return ret_value;
1587
1588 - n_is_inode_locked = 1;
1589 + is_inode_locked = 1;
1590
1591 /* removing of last unformatted node will change value we
1592 have to return to truncate. Save it */
1593 - retval2 = n_ret_value;
1594 - /*retval2 = sb->s_blocksize - (n_new_file_size & (sb->s_blocksize - 1)); */
1595 + retval2 = ret_value;
1596 + /*retval2 = sb->s_blocksize - (new_file_size & (sb->s_blocksize - 1)); */
1597
1598 /* So, we have performed the first part of the conversion:
1599 inserting the new direct item. Now we are removing the
1600 @@ -1573,10 +1569,10 @@ int reiserfs_cut_from_item(struct reiser
1601 it. */
1602 set_cpu_key_k_type(item_key, TYPE_INDIRECT);
1603 item_key->key_length = 4;
1604 - n_new_file_size -=
1605 - (n_new_file_size & (sb->s_blocksize - 1));
1606 - tail_pos = n_new_file_size;
1607 - set_cpu_key_k_offset(item_key, n_new_file_size + 1);
1608 + new_file_size -=
1609 + (new_file_size & (sb->s_blocksize - 1));
1610 + tail_pos = new_file_size;
1611 + set_cpu_key_k_offset(item_key, new_file_size + 1);
1612 if (search_for_position_by_key
1613 (sb, item_key,
1614 path) == POSITION_NOT_FOUND) {
1615 @@ -1589,38 +1585,38 @@ int reiserfs_cut_from_item(struct reiser
1616 }
1617 continue;
1618 }
1619 - if (n_cut_size == 0) {
1620 + if (cut_size == 0) {
1621 pathrelse(path);
1622 return 0;
1623 }
1624
1625 - s_cut_balance.insert_size[0] = n_cut_size;
1626 + s_cut_balance.insert_size[0] = cut_size;
1627
1628 - n_ret_value = fix_nodes(c_mode, &s_cut_balance, NULL, NULL);
1629 - if (n_ret_value != REPEAT_SEARCH)
1630 + ret_value = fix_nodes(mode, &s_cut_balance, NULL, NULL);
1631 + if (ret_value != REPEAT_SEARCH)
1632 break;
1633
1634 PROC_INFO_INC(sb, cut_from_item_restarted);
1635
1636 - n_ret_value =
1637 + ret_value =
1638 search_for_position_by_key(sb, item_key, path);
1639 - if (n_ret_value == POSITION_FOUND)
1640 + if (ret_value == POSITION_FOUND)
1641 continue;
1642
1643 reiserfs_warning(sb, "PAP-5610", "item %K not found",
1644 item_key);
1645 unfix_nodes(&s_cut_balance);
1646 - return (n_ret_value == IO_ERROR) ? -EIO : -ENOENT;
1647 + return (ret_value == IO_ERROR) ? -EIO : -ENOENT;
1648 } /* while */
1649
1650 // check fix_nodes results (IO_ERROR or NO_DISK_SPACE)
1651 - if (n_ret_value != CARRY_ON) {
1652 - if (n_is_inode_locked) {
1653 + if (ret_value != CARRY_ON) {
1654 + if (is_inode_locked) {
1655 // FIXME: this seems to be not needed: we are always able
1656 // to cut item
1657 indirect_to_direct_roll_back(th, inode, path);
1658 }
1659 - if (n_ret_value == NO_DISK_SPACE)
1660 + if (ret_value == NO_DISK_SPACE)
1661 reiserfs_warning(sb, "reiserfs-5092",
1662 "NO_DISK_SPACE");
1663 unfix_nodes(&s_cut_balance);
1664 @@ -1629,24 +1625,24 @@ int reiserfs_cut_from_item(struct reiser
1665
1666 /* go ahead and perform balancing */
1667
1668 - RFALSE(c_mode == M_PASTE || c_mode == M_INSERT, "invalid mode");
1669 + RFALSE(mode == M_PASTE || mode == M_INSERT, "invalid mode");
1670
1671 /* Calculate number of bytes that need to be cut from the item. */
1672 quota_cut_bytes =
1673 - (c_mode ==
1674 + (mode ==
1675 M_DELETE) ? ih_item_len(get_ih(path)) : -s_cut_balance.
1676 insert_size[0];
1677 if (retval2 == -1)
1678 - n_ret_value = calc_deleted_bytes_number(&s_cut_balance, c_mode);
1679 + ret_value = calc_deleted_bytes_number(&s_cut_balance, mode);
1680 else
1681 - n_ret_value = retval2;
1682 + ret_value = retval2;
1683
1684 /* For direct items, we only change the quota when deleting the last
1685 ** item.
1686 */
1687 p_le_ih = PATH_PITEM_HEAD(s_cut_balance.tb_path);
1688 if (!S_ISLNK(inode->i_mode) && is_direct_le_ih(p_le_ih)) {
1689 - if (c_mode == M_DELETE &&
1690 + if (mode == M_DELETE &&
1691 (le_ih_k_offset(p_le_ih) & (sb->s_blocksize - 1)) ==
1692 1) {
1693 // FIXME: this is to keep 3.5 happy
1694 @@ -1657,7 +1653,7 @@ int reiserfs_cut_from_item(struct reiser
1695 }
1696 }
1697 #ifdef CONFIG_REISERFS_CHECK
1698 - if (n_is_inode_locked) {
1699 + if (is_inode_locked) {
1700 struct item_head *le_ih =
1701 PATH_PITEM_HEAD(s_cut_balance.tb_path);
1702 /* we are going to complete indirect2direct conversion. Make
1703 @@ -1667,13 +1663,13 @@ int reiserfs_cut_from_item(struct reiser
1704 reiserfs_panic(sb, "vs-5652",
1705 "item must be indirect %h", le_ih);
1706
1707 - if (c_mode == M_DELETE && ih_item_len(le_ih) != UNFM_P_SIZE)
1708 + if (mode == M_DELETE && ih_item_len(le_ih) != UNFM_P_SIZE)
1709 reiserfs_panic(sb, "vs-5653", "completing "
1710 "indirect2direct conversion indirect "
1711 "item %h being deleted must be of "
1712 "4 byte long", le_ih);
1713
1714 - if (c_mode == M_CUT
1715 + if (mode == M_CUT
1716 && s_cut_balance.insert_size[0] != -UNFM_P_SIZE) {
1717 reiserfs_panic(sb, "vs-5654", "can not complete "
1718 "indirect2direct conversion of %h "
1719 @@ -1685,8 +1681,8 @@ int reiserfs_cut_from_item(struct reiser
1720 }
1721 #endif
1722
1723 - do_balance(&s_cut_balance, NULL, NULL, c_mode);
1724 - if (n_is_inode_locked) {
1725 + do_balance(&s_cut_balance, NULL, NULL, mode);
1726 + if (is_inode_locked) {
1727 /* we've done an indirect->direct conversion. when the data block
1728 ** was freed, it was removed from the list of blocks that must
1729 ** be flushed before the transaction commits, make sure to
1730 @@ -1701,7 +1697,7 @@ int reiserfs_cut_from_item(struct reiser
1731 quota_cut_bytes, inode->i_uid, '?');
1732 #endif
1733 DQUOT_FREE_SPACE_NODIRTY(inode, quota_cut_bytes);
1734 - return n_ret_value;
1735 + return ret_value;
1736 }
1737
1738 static void truncate_directory(struct reiserfs_transaction_handle *th,
1739 @@ -1733,9 +1729,9 @@ int reiserfs_do_truncate(struct reiserfs
1740 INITIALIZE_PATH(s_search_path); /* Path to the current object item. */
1741 struct item_head *p_le_ih; /* Pointer to an item header. */
1742 struct cpu_key s_item_key; /* Key to search for a previous file item. */
1743 - loff_t n_file_size, /* Old file size. */
1744 - n_new_file_size; /* New file size. */
1745 - int n_deleted; /* Number of deleted or truncated bytes. */
1746 + loff_t file_size, /* Old file size. */
1747 + new_file_size; /* New file size. */
1748 + int deleted; /* Number of deleted or truncated bytes. */
1749 int retval;
1750 int err = 0;
1751
1752 @@ -1752,7 +1748,7 @@ int reiserfs_do_truncate(struct reiserfs
1753 }
1754
1755 /* Get new file size. */
1756 - n_new_file_size = inode->i_size;
1757 + new_file_size = inode->i_size;
1758
1759 // FIXME: note, that key type is unimportant here
1760 make_cpu_key(&s_item_key, inode, max_reiserfs_offset(inode),
1761 @@ -1782,7 +1778,7 @@ int reiserfs_do_truncate(struct reiserfs
1762 /* Get real file size (total length of all file items) */
1763 p_le_ih = PATH_PITEM_HEAD(&s_search_path);
1764 if (is_statdata_le_ih(p_le_ih))
1765 - n_file_size = 0;
1766 + file_size = 0;
1767 else {
1768 loff_t offset = le_ih_k_offset(p_le_ih);
1769 int bytes =
1770 @@ -1791,42 +1787,42 @@ int reiserfs_do_truncate(struct reiserfs
1771 /* this may mismatch with real file size: if last direct item
1772 had no padding zeros and last unformatted node had no free
1773 space, this file would have this file size */
1774 - n_file_size = offset + bytes - 1;
1775 + file_size = offset + bytes - 1;
1776 }
1777 /*
1778 * are we doing a full truncate or delete, if so
1779 * kick in the reada code
1780 */
1781 - if (n_new_file_size == 0)
1782 + if (new_file_size == 0)
1783 s_search_path.reada = PATH_READA | PATH_READA_BACK;
1784
1785 - if (n_file_size == 0 || n_file_size < n_new_file_size) {
1786 + if (file_size == 0 || file_size < new_file_size) {
1787 goto update_and_out;
1788 }
1789
1790 /* Update key to search for the last file item. */
1791 - set_cpu_key_k_offset(&s_item_key, n_file_size);
1792 + set_cpu_key_k_offset(&s_item_key, file_size);
1793
1794 do {
1795 /* Cut or delete file item. */
1796 - n_deleted =
1797 + deleted =
1798 reiserfs_cut_from_item(th, &s_search_path, &s_item_key,
1799 - inode, page, n_new_file_size);
1800 - if (n_deleted < 0) {
1801 + inode, page, new_file_size);
1802 + if (deleted < 0) {
1803 reiserfs_warning(inode->i_sb, "vs-5665",
1804 "reiserfs_cut_from_item failed");
1805 reiserfs_check_path(&s_search_path);
1806 return 0;
1807 }
1808
1809 - RFALSE(n_deleted > n_file_size,
1810 + RFALSE(deleted > file_size,
1811 "PAP-5670: reiserfs_cut_from_item: too many bytes deleted: deleted %d, file_size %lu, item_key %K",
1812 - n_deleted, n_file_size, &s_item_key);
1813 + deleted, file_size, &s_item_key);
1814
1815 /* Change key to search the last file item. */
1816 - n_file_size -= n_deleted;
1817 + file_size -= deleted;
1818
1819 - set_cpu_key_k_offset(&s_item_key, n_file_size);
1820 + set_cpu_key_k_offset(&s_item_key, file_size);
1821
1822 /* While there are bytes to truncate and previous file item is presented in the tree. */
1823
1824 @@ -1857,13 +1853,13 @@ int reiserfs_do_truncate(struct reiserfs
1825 goto out;
1826 reiserfs_update_inode_transaction(inode);
1827 }
1828 - } while (n_file_size > ROUND_UP(n_new_file_size) &&
1829 + } while (file_size > ROUND_UP(new_file_size) &&
1830 search_for_position_by_key(inode->i_sb, &s_item_key,
1831 &s_search_path) == POSITION_FOUND);
1832
1833 - RFALSE(n_file_size > ROUND_UP(n_new_file_size),
1834 + RFALSE(file_size > ROUND_UP(new_file_size),
1835 "PAP-5680: truncate did not finish: new_file_size %Ld, current %Ld, oid %d",
1836 - n_new_file_size, n_file_size, s_item_key.on_disk_key.k_objectid);
1837 + new_file_size, file_size, s_item_key.on_disk_key.k_objectid);
1838
1839 update_and_out:
1840 if (update_timestamps) {
1841 @@ -1918,7 +1914,7 @@ int reiserfs_paste_into_item(struct reis
1842 const struct cpu_key *key, /* Key to search for the needed item. */
1843 struct inode *inode, /* Inode item belongs to */
1844 const char *body, /* Pointer to the bytes to paste. */
1845 - int n_pasted_size)
1846 + int pasted_size)
1847 { /* Size of pasted bytes. */
1848 struct tree_balance s_paste_balance;
1849 int retval;
1850 @@ -1931,16 +1927,16 @@ int reiserfs_paste_into_item(struct reis
1851 #ifdef REISERQUOTA_DEBUG
1852 reiserfs_debug(inode->i_sb, REISERFS_DEBUG_CODE,
1853 "reiserquota paste_into_item(): allocating %u id=%u type=%c",
1854 - n_pasted_size, inode->i_uid,
1855 + pasted_size, inode->i_uid,
1856 key2type(&(key->on_disk_key)));
1857 #endif
1858
1859 - if (DQUOT_ALLOC_SPACE_NODIRTY(inode, n_pasted_size)) {
1860 + if (DQUOT_ALLOC_SPACE_NODIRTY(inode, pasted_size)) {
1861 pathrelse(search_path);
1862 return -EDQUOT;
1863 }
1864 init_tb_struct(th, &s_paste_balance, th->t_super, search_path,
1865 - n_pasted_size);
1866 + pasted_size);
1867 #ifdef DISPLACE_NEW_PACKING_LOCALITIES
1868 s_paste_balance.key = key->on_disk_key;
1869 #endif
1870 @@ -1988,10 +1984,10 @@ int reiserfs_paste_into_item(struct reis
1871 #ifdef REISERQUOTA_DEBUG
1872 reiserfs_debug(inode->i_sb, REISERFS_DEBUG_CODE,
1873 "reiserquota paste_into_item(): freeing %u id=%u type=%c",
1874 - n_pasted_size, inode->i_uid,
1875 + pasted_size, inode->i_uid,
1876 key2type(&(key->on_disk_key)));
1877 #endif
1878 - DQUOT_FREE_SPACE_NODIRTY(inode, n_pasted_size);
1879 + DQUOT_FREE_SPACE_NODIRTY(inode, pasted_size);
1880 return retval;
1881 }
1882
1883 --- a/fs/reiserfs/tail_conversion.c
1884 +++ b/fs/reiserfs/tail_conversion.c
1885 @@ -26,7 +26,7 @@ int direct2indirect(struct reiserfs_tran
1886 converted item. */
1887 struct item_head ind_ih; /* new indirect item to be inserted or
1888 key of unfm pointer to be pasted */
1889 - int n_blk_size, n_retval; /* returned value for reiserfs_insert_item and clones */
1890 + int blk_size, retval; /* returned value for reiserfs_insert_item and clones */
1891 unp_t unfm_ptr; /* Handle on an unformatted node
1892 that will be inserted in the
1893 tree. */
1894 @@ -35,7 +35,7 @@ int direct2indirect(struct reiserfs_tran
1895
1896 REISERFS_SB(sb)->s_direct2indirect++;
1897
1898 - n_blk_size = sb->s_blocksize;
1899 + blk_size = sb->s_blocksize;
1900
1901 /* and key to search for append or insert pointer to the new
1902 unformatted node. */
1903 @@ -64,17 +64,17 @@ int direct2indirect(struct reiserfs_tran
1904 set_ih_free_space(&ind_ih, 0); /* delete at nearest future */
1905 put_ih_item_len(&ind_ih, UNFM_P_SIZE);
1906 PATH_LAST_POSITION(path)++;
1907 - n_retval =
1908 + retval =
1909 reiserfs_insert_item(th, path, &end_key, &ind_ih, inode,
1910 (char *)&unfm_ptr);
1911 } else {
1912 /* Paste into last indirect item of an object. */
1913 - n_retval = reiserfs_paste_into_item(th, path, &end_key, inode,
1914 + retval = reiserfs_paste_into_item(th, path, &end_key, inode,
1915 (char *)&unfm_ptr,
1916 UNFM_P_SIZE);
1917 }
1918 - if (n_retval) {
1919 - return n_retval;
1920 + if (retval) {
1921 + return retval;
1922 }
1923 // note: from here there are two keys which have matching first
1924 // three key components. They only differ by the fourth one.
1925 @@ -98,7 +98,7 @@ int direct2indirect(struct reiserfs_tran
1926 RFALSE(!is_direct_le_ih(p_le_ih),
1927 "vs-14055: direct item expected(%K), found %h",
1928 &end_key, p_le_ih);
1929 - tail_size = (le_ih_k_offset(p_le_ih) & (n_blk_size - 1))
1930 + tail_size = (le_ih_k_offset(p_le_ih) & (blk_size - 1))
1931 + ih_item_len(p_le_ih) - 1;
1932
1933 /* we only send the unbh pointer if the buffer is not up to date.
1934 @@ -113,11 +113,11 @@ int direct2indirect(struct reiserfs_tran
1935 } else {
1936 up_to_date_bh = unbh;
1937 }
1938 - n_retval = reiserfs_delete_item(th, path, &end_key, inode,
1939 + retval = reiserfs_delete_item(th, path, &end_key, inode,
1940 up_to_date_bh);
1941
1942 - total_tail += n_retval;
1943 - if (tail_size == n_retval)
1944 + total_tail += retval;
1945 + if (tail_size == retval)
1946 // done: file does not have direct items anymore
1947 break;
1948
1949 @@ -129,7 +129,7 @@ int direct2indirect(struct reiserfs_tran
1950 unsigned pgoff =
1951 (tail_offset + total_tail - 1) & (PAGE_CACHE_SIZE - 1);
1952 char *kaddr = kmap_atomic(up_to_date_bh->b_page, KM_USER0);
1953 - memset(kaddr + pgoff, 0, n_blk_size - total_tail);
1954 + memset(kaddr + pgoff, 0, blk_size - total_tail);
1955 kunmap_atomic(kaddr, KM_USER0);
1956 }
1957
1958 @@ -181,7 +181,7 @@ int indirect2direct(struct reiserfs_tran
1959 {
1960 struct super_block *sb = inode->i_sb;
1961 struct item_head s_ih;
1962 - unsigned long n_block_size = sb->s_blocksize;
1963 + unsigned long block_size = sb->s_blocksize;
1964 char *tail;
1965 int tail_len, round_tail_len;
1966 loff_t pos, pos1; /* position of first byte of the tail */
1967 @@ -196,7 +196,7 @@ int indirect2direct(struct reiserfs_tran
1968 /* store item head path points to. */
1969 copy_item_head(&s_ih, PATH_PITEM_HEAD(path));
1970
1971 - tail_len = (n_new_file_size & (n_block_size - 1));
1972 + tail_len = (n_new_file_size & (block_size - 1));
1973 if (get_inode_sd_version(inode) == STAT_DATA_V2)
1974 round_tail_len = ROUND_UP(tail_len);
1975 else
1976 @@ -257,7 +257,7 @@ int indirect2direct(struct reiserfs_tran
1977 unformatted node. For now i_size is considered as guard for
1978 going out of file size */
1979 kunmap(page);
1980 - return n_block_size - round_tail_len;
1981 + return block_size - round_tail_len;
1982 }
1983 kunmap(page);
1984
1985 @@ -276,5 +276,5 @@ int indirect2direct(struct reiserfs_tran
1986 /* mark_file_with_tail (inode, pos1 + 1); */
1987 REISERFS_I(inode)->i_first_direct_byte = pos1 + 1;
1988
1989 - return n_block_size - round_tail_len;
1990 + return block_size - round_tail_len;
1991 }