aboutsummaryrefslogtreecommitdiffstats
path: root/fs/reiserfs/lbalance.c
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2014-04-23 10:00:42 -0400
committerJan Kara <jack@suse.cz>2014-05-06 17:18:16 -0400
commita228bf8f0a3e5f1406edbd61f7400e87e23af5f7 (patch)
tree44b6806245ad0c93f607c4df73ab7c26a404347d /fs/reiserfs/lbalance.c
parentcf776a7a4dafa330dd371a6a301ddf9e38747d93 (diff)
reiserfs: cleanup, remove unnecessary parens
The reiserfs code is littered with extra parens in places where the authors may not have been certain about precedence of & vs ->. This patch cleans them out. Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/reiserfs/lbalance.c')
-rw-r--r--fs/reiserfs/lbalance.c76
1 files changed, 38 insertions, 38 deletions
diff --git a/fs/reiserfs/lbalance.c b/fs/reiserfs/lbalance.c
index d48a9e7507a1..d6744c8b24e1 100644
--- a/fs/reiserfs/lbalance.c
+++ b/fs/reiserfs/lbalance.c
@@ -38,12 +38,12 @@ static void leaf_copy_dir_entries(struct buffer_info *dest_bi,
38 */ 38 */
39 deh = B_I_DEH(source, ih); 39 deh = B_I_DEH(source, ih);
40 if (copy_count) { 40 if (copy_count) {
41 copy_records_len = (from ? deh_location(&(deh[from - 1])) : 41 copy_records_len = (from ? deh_location(&deh[from - 1]) :
42 ih_item_len(ih)) - 42 ih_item_len(ih)) -
43 deh_location(&(deh[from + copy_count - 1])); 43 deh_location(&deh[from + copy_count - 1]);
44 records = 44 records =
45 source->b_data + ih_location(ih) + 45 source->b_data + ih_location(ih) +
46 deh_location(&(deh[from + copy_count - 1])); 46 deh_location(&deh[from + copy_count - 1]);
47 } else { 47 } else {
48 copy_records_len = 0; 48 copy_records_len = 0;
49 records = NULL; 49 records = NULL;
@@ -81,7 +81,7 @@ static void leaf_copy_dir_entries(struct buffer_info *dest_bi,
81 /* form key by the following way */ 81 /* form key by the following way */
82 if (from < ih_entry_count(ih)) { 82 if (from < ih_entry_count(ih)) {
83 set_le_ih_k_offset(&new_ih, 83 set_le_ih_k_offset(&new_ih,
84 deh_offset(&(deh[from]))); 84 deh_offset(&deh[from]));
85 } else { 85 } else {
86 /* 86 /*
87 * no entries will be copied to this 87 * no entries will be copied to this
@@ -94,7 +94,7 @@ static void leaf_copy_dir_entries(struct buffer_info *dest_bi,
94 * for it, so we -1 94 * for it, so we -1
95 */ 95 */
96 } 96 }
97 set_le_key_k_type(KEY_FORMAT_3_5, &(new_ih.ih_key), 97 set_le_key_k_type(KEY_FORMAT_3_5, &new_ih.ih_key,
98 TYPE_DIRENTRY); 98 TYPE_DIRENTRY);
99 } 99 }
100 100
@@ -155,7 +155,7 @@ static int leaf_copy_boundary_item(struct buffer_info *dest_bi,
155 155
156 /* there is nothing to merge */ 156 /* there is nothing to merge */
157 if (!dest_nr_item 157 if (!dest_nr_item
158 || (!op_is_left_mergeable(&(ih->ih_key), src->b_size))) 158 || (!op_is_left_mergeable(&ih->ih_key, src->b_size)))
159 return 0; 159 return 0;
160 160
161 RFALSE(!ih_item_len(ih), 161 RFALSE(!ih_item_len(ih),
@@ -221,7 +221,7 @@ static int leaf_copy_boundary_item(struct buffer_info *dest_bi,
221 ih = item_head(src, src_nr_item - 1); 221 ih = item_head(src, src_nr_item - 1);
222 dih = item_head(dest, 0); 222 dih = item_head(dest, 0);
223 223
224 if (!dest_nr_item || !op_is_left_mergeable(&(dih->ih_key), src->b_size)) 224 if (!dest_nr_item || !op_is_left_mergeable(&dih->ih_key, src->b_size))
225 return 0; 225 return 0;
226 226
227 if (is_direntry_le_ih(ih)) { 227 if (is_direntry_le_ih(ih)) {
@@ -368,8 +368,8 @@ static void leaf_copy_items_entirely(struct buffer_info *dest_bi,
368 } 368 }
369 369
370 /* prepare space for items */ 370 /* prepare space for items */
371 last_loc = ih_location(&(ih[nr + cpy_num - 1 - dest_before])); 371 last_loc = ih_location(&ih[nr + cpy_num - 1 - dest_before]);
372 last_inserted_loc = ih_location(&(ih[cpy_num - 1])); 372 last_inserted_loc = ih_location(&ih[cpy_num - 1]);
373 373
374 /* check free space */ 374 /* check free space */
375 RFALSE(free_space < j - last_inserted_loc, 375 RFALSE(free_space < j - last_inserted_loc,
@@ -449,7 +449,7 @@ static void leaf_item_bottle(struct buffer_info *dest_bi,
449 set_ih_free_space(&n_ih, 0); 449 set_ih_free_space(&n_ih, 0);
450 } 450 }
451 451
452 RFALSE(op_is_left_mergeable(&(ih->ih_key), src->b_size), 452 RFALSE(op_is_left_mergeable(&ih->ih_key, src->b_size),
453 "vs-10190: bad mergeability of item %h", ih); 453 "vs-10190: bad mergeability of item %h", ih);
454 n_ih.ih_version = ih->ih_version; /* JDM Endian safe, both le */ 454 n_ih.ih_version = ih->ih_version; /* JDM Endian safe, both le */
455 leaf_insert_into_buf(dest_bi, B_NR_ITEMS(dest), &n_ih, 455 leaf_insert_into_buf(dest_bi, B_NR_ITEMS(dest), &n_ih,
@@ -926,7 +926,7 @@ void leaf_insert_into_buf(struct buffer_info *bi, int before,
926 ih = item_head(bh, before); 926 ih = item_head(bh, before);
927 927
928 /* prepare space for the body of new item */ 928 /* prepare space for the body of new item */
929 last_loc = nr ? ih_location(&(ih[nr - before - 1])) : bh->b_size; 929 last_loc = nr ? ih_location(&ih[nr - before - 1]) : bh->b_size;
930 unmoved_loc = before ? ih_location(ih - 1) : bh->b_size; 930 unmoved_loc = before ? ih_location(ih - 1) : bh->b_size;
931 931
932 memmove(bh->b_data + last_loc - ih_item_len(inserted_item_ih), 932 memmove(bh->b_data + last_loc - ih_item_len(inserted_item_ih),
@@ -949,8 +949,8 @@ void leaf_insert_into_buf(struct buffer_info *bi, int before,
949 949
950 /* change locations */ 950 /* change locations */
951 for (i = before; i < nr + 1; i++) { 951 for (i = before; i < nr + 1; i++) {
952 unmoved_loc -= ih_item_len(&(ih[i - before])); 952 unmoved_loc -= ih_item_len(&ih[i - before]);
953 put_ih_location(&(ih[i - before]), unmoved_loc); 953 put_ih_location(&ih[i - before], unmoved_loc);
954 } 954 }
955 955
956 /* sizes, free space, item number */ 956 /* sizes, free space, item number */
@@ -1009,7 +1009,7 @@ void leaf_paste_in_buffer(struct buffer_info *bi, int affected_item_num,
1009 /* item to be appended */ 1009 /* item to be appended */
1010 ih = item_head(bh, affected_item_num); 1010 ih = item_head(bh, affected_item_num);
1011 1011
1012 last_loc = ih_location(&(ih[nr - affected_item_num - 1])); 1012 last_loc = ih_location(&ih[nr - affected_item_num - 1]);
1013 unmoved_loc = affected_item_num ? ih_location(ih - 1) : bh->b_size; 1013 unmoved_loc = affected_item_num ? ih_location(ih - 1) : bh->b_size;
1014 1014
1015 /* prepare space */ 1015 /* prepare space */
@@ -1018,8 +1018,8 @@ void leaf_paste_in_buffer(struct buffer_info *bi, int affected_item_num,
1018 1018
1019 /* change locations */ 1019 /* change locations */
1020 for (i = affected_item_num; i < nr; i++) 1020 for (i = affected_item_num; i < nr; i++)
1021 put_ih_location(&(ih[i - affected_item_num]), 1021 put_ih_location(&ih[i - affected_item_num],
1022 ih_location(&(ih[i - affected_item_num])) - 1022 ih_location(&ih[i - affected_item_num]) -
1023 paste_size); 1023 paste_size);
1024 1024
1025 if (body) { 1025 if (body) {
@@ -1101,19 +1101,19 @@ static int leaf_cut_entries(struct buffer_head *bh,
1101 * (prev_record) and length of all removed records (cut_records_len) 1101 * (prev_record) and length of all removed records (cut_records_len)
1102 */ 1102 */
1103 prev_record_offset = 1103 prev_record_offset =
1104 (from ? deh_location(&(deh[from - 1])) : ih_item_len(ih)); 1104 (from ? deh_location(&deh[from - 1]) : ih_item_len(ih));
1105 cut_records_len = prev_record_offset /*from_record */ - 1105 cut_records_len = prev_record_offset /*from_record */ -
1106 deh_location(&(deh[from + del_count - 1])); 1106 deh_location(&deh[from + del_count - 1]);
1107 prev_record = item + prev_record_offset; 1107 prev_record = item + prev_record_offset;
1108 1108
1109 /* adjust locations of remaining entries */ 1109 /* adjust locations of remaining entries */
1110 for (i = ih_entry_count(ih) - 1; i > from + del_count - 1; i--) 1110 for (i = ih_entry_count(ih) - 1; i > from + del_count - 1; i--)
1111 put_deh_location(&(deh[i]), 1111 put_deh_location(&deh[i],
1112 deh_location(&deh[i]) - 1112 deh_location(&deh[i]) -
1113 (DEH_SIZE * del_count)); 1113 (DEH_SIZE * del_count));
1114 1114
1115 for (i = 0; i < from; i++) 1115 for (i = 0; i < from; i++)
1116 put_deh_location(&(deh[i]), 1116 put_deh_location(&deh[i],
1117 deh_location(&deh[i]) - (DEH_SIZE * del_count + 1117 deh_location(&deh[i]) - (DEH_SIZE * del_count +
1118 cut_records_len)); 1118 cut_records_len));
1119 1119
@@ -1200,7 +1200,7 @@ void leaf_cut_from_buffer(struct buffer_info *bi, int cut_item_num,
1200 } 1200 }
1201 1201
1202 /* location of the last item */ 1202 /* location of the last item */
1203 last_loc = ih_location(&(ih[nr - cut_item_num - 1])); 1203 last_loc = ih_location(&ih[nr - cut_item_num - 1]);
1204 1204
1205 /* location of the item, which is remaining at the same place */ 1205 /* location of the item, which is remaining at the same place */
1206 unmoved_loc = cut_item_num ? ih_location(ih - 1) : bh->b_size; 1206 unmoved_loc = cut_item_num ? ih_location(ih - 1) : bh->b_size;
@@ -1219,7 +1219,7 @@ void leaf_cut_from_buffer(struct buffer_info *bi, int cut_item_num,
1219 1219
1220 /* change locations */ 1220 /* change locations */
1221 for (i = cut_item_num; i < nr; i++) 1221 for (i = cut_item_num; i < nr; i++)
1222 put_ih_location(&(ih[i - cut_item_num]), 1222 put_ih_location(&ih[i - cut_item_num],
1223 ih_location(&ih[i - cut_item_num]) + cut_size); 1223 ih_location(&ih[i - cut_item_num]) + cut_size);
1224 1224
1225 /* size, free space */ 1225 /* size, free space */
@@ -1273,8 +1273,8 @@ static void leaf_delete_items_entirely(struct buffer_info *bi,
1273 j = (first == 0) ? bh->b_size : ih_location(ih - 1); 1273 j = (first == 0) ? bh->b_size : ih_location(ih - 1);
1274 1274
1275 /* delete items */ 1275 /* delete items */
1276 last_loc = ih_location(&(ih[nr - 1 - first])); 1276 last_loc = ih_location(&ih[nr - 1 - first]);
1277 last_removed_loc = ih_location(&(ih[del_num - 1])); 1277 last_removed_loc = ih_location(&ih[del_num - 1]);
1278 1278
1279 memmove(bh->b_data + last_loc + j - last_removed_loc, 1279 memmove(bh->b_data + last_loc + j - last_removed_loc,
1280 bh->b_data + last_loc, last_removed_loc - last_loc); 1280 bh->b_data + last_loc, last_removed_loc - last_loc);
@@ -1284,8 +1284,8 @@ static void leaf_delete_items_entirely(struct buffer_info *bi,
1284 1284
1285 /* change item location */ 1285 /* change item location */
1286 for (i = first; i < nr - del_num; i++) 1286 for (i = first; i < nr - del_num; i++)
1287 put_ih_location(&(ih[i - first]), 1287 put_ih_location(&ih[i - first],
1288 ih_location(&(ih[i - first])) + (j - 1288 ih_location(&ih[i - first]) + (j -
1289 last_removed_loc)); 1289 last_removed_loc));
1290 1290
1291 /* sizes, item number */ 1291 /* sizes, item number */
@@ -1347,19 +1347,19 @@ void leaf_paste_entries(struct buffer_info *bi,
1347 /* new records will be pasted at this point */ 1347 /* new records will be pasted at this point */
1348 insert_point = 1348 insert_point =
1349 item + 1349 item +
1350 (before ? deh_location(&(deh[before - 1])) 1350 (before ? deh_location(&deh[before - 1])
1351 : (ih_item_len(ih) - paste_size)); 1351 : (ih_item_len(ih) - paste_size));
1352 1352
1353 /* adjust locations of records that will be AFTER new records */ 1353 /* adjust locations of records that will be AFTER new records */
1354 for (i = ih_entry_count(ih) - 1; i >= before; i--) 1354 for (i = ih_entry_count(ih) - 1; i >= before; i--)
1355 put_deh_location(&(deh[i]), 1355 put_deh_location(&deh[i],
1356 deh_location(&(deh[i])) + 1356 deh_location(&deh[i]) +
1357 (DEH_SIZE * new_entry_count)); 1357 (DEH_SIZE * new_entry_count));
1358 1358
1359 /* adjust locations of records that will be BEFORE new records */ 1359 /* adjust locations of records that will be BEFORE new records */
1360 for (i = 0; i < before; i++) 1360 for (i = 0; i < before; i++)
1361 put_deh_location(&(deh[i]), 1361 put_deh_location(&deh[i],
1362 deh_location(&(deh[i])) + paste_size); 1362 deh_location(&deh[i]) + paste_size);
1363 1363
1364 old_entry_num = ih_entry_count(ih); 1364 old_entry_num = ih_entry_count(ih);
1365 put_ih_entry_count(ih, ih_entry_count(ih) + new_entry_count); 1365 put_ih_entry_count(ih, ih_entry_count(ih) + new_entry_count);
@@ -1383,10 +1383,10 @@ void leaf_paste_entries(struct buffer_info *bi,
1383 1383
1384 /* set locations of new records */ 1384 /* set locations of new records */
1385 for (i = 0; i < new_entry_count; i++) { 1385 for (i = 0; i < new_entry_count; i++) {
1386 put_deh_location(&(deh[i]), 1386 put_deh_location(&deh[i],
1387 deh_location(&(deh[i])) + 1387 deh_location(&deh[i]) +
1388 (-deh_location 1388 (-deh_location
1389 (&(new_dehs[new_entry_count - 1])) + 1389 (&new_dehs[new_entry_count - 1]) +
1390 insert_point + DEH_SIZE * new_entry_count - 1390 insert_point + DEH_SIZE * new_entry_count -
1391 item)); 1391 item));
1392 } 1392 }
@@ -1404,16 +1404,16 @@ void leaf_paste_entries(struct buffer_info *bi,
1404 next = 1404 next =
1405 (i < 1405 (i <
1406 ih_entry_count(ih) - 1406 ih_entry_count(ih) -
1407 1) ? deh_location(&(deh[i + 1])) : 0; 1407 1) ? deh_location(&deh[i + 1]) : 0;
1408 prev = (i != 0) ? deh_location(&(deh[i - 1])) : 0; 1408 prev = (i != 0) ? deh_location(&deh[i - 1]) : 0;
1409 1409
1410 if (prev && prev <= deh_location(&(deh[i]))) 1410 if (prev && prev <= deh_location(&deh[i]))
1411 reiserfs_error(sb_from_bi(bi), "vs-10240", 1411 reiserfs_error(sb_from_bi(bi), "vs-10240",
1412 "directory item (%h) " 1412 "directory item (%h) "
1413 "corrupted (prev %a, " 1413 "corrupted (prev %a, "
1414 "cur(%d) %a)", 1414 "cur(%d) %a)",
1415 ih, deh + i - 1, i, deh + i); 1415 ih, deh + i - 1, i, deh + i);
1416 if (next && next >= deh_location(&(deh[i]))) 1416 if (next && next >= deh_location(&deh[i]))
1417 reiserfs_error(sb_from_bi(bi), "vs-10250", 1417 reiserfs_error(sb_from_bi(bi), "vs-10250",
1418 "directory item (%h) " 1418 "directory item (%h) "
1419 "corrupted (cur(%d) %a, " 1419 "corrupted (cur(%d) %a, "