Skip to content

Commit bd4c625

Browse files
author
Linus Torvalds
committed
reiserfs: run scripts/Lindent on reiserfs code
This was a pure indentation change, using: scripts/Lindent fs/reiserfs/*.c include/linux/reiserfs_*.h to make reiserfs match the regular Linux indentation style. As Jeff Mahoney <[email protected]> writes: The ReiserFS code is a mix of a number of different coding styles, sometimes different even from line-to-line. Since the code has been relatively stable for quite some time and there are few outstanding patches to be applied, it is time to reformat the code to conform to the Linux style standard outlined in Documentation/CodingStyle. This patch contains the result of running scripts/Lindent against fs/reiserfs/*.c and include/linux/reiserfs_*.h. There are places where the code can be made to look better, but I'd rather keep those patches separate so that there isn't a subtle by-hand hand accident in the middle of a huge patch. To be clear: This patch is reformatting *only*. A number of patches may follow that continue to make the code more consistent with the Linux coding style. Hans wasn't particularly enthusiastic about these patches, but said he wouldn't really oppose them either. Signed-off-by: Linus Torvalds <[email protected]>
1 parent 7fa94c8 commit bd4c625

30 files changed

+24447
-22681
lines changed

fs/reiserfs/bitmap.c

Lines changed: 969 additions & 873 deletions
Large diffs are not rendered by default.

fs/reiserfs/dir.c

Lines changed: 255 additions & 233 deletions
Large diffs are not rendered by default.

fs/reiserfs/do_balan.c

Lines changed: 1888 additions & 1348 deletions
Large diffs are not rendered by default.

fs/reiserfs/file.c

Lines changed: 1362 additions & 1202 deletions
Large diffs are not rendered by default.

fs/reiserfs/fix_node.c

Lines changed: 2079 additions & 1972 deletions
Large diffs are not rendered by default.

fs/reiserfs/hashes.c

Lines changed: 83 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include <asm/types.h>
2323
#include <asm/bug.h>
2424

25-
2625
#define DELTA 0x9E3779B9
2726
#define FULLROUNDS 10 /* 32 is overkill, 16 is strong crypto */
2827
#define PARTROUNDS 6 /* 6 gets complete mixing */
@@ -48,105 +47,75 @@
4847
h1 += b1; \
4948
} while(0)
5049

51-
5250
u32 keyed_hash(const signed char *msg, int len)
5351
{
54-
u32 k[] = { 0x9464a485, 0x542e1a94, 0x3e846bff, 0xb75bcfc3};
52+
u32 k[] = { 0x9464a485, 0x542e1a94, 0x3e846bff, 0xb75bcfc3 };
5553

5654
u32 h0 = k[0], h1 = k[1];
5755
u32 a, b, c, d;
5856
u32 pad;
5957
int i;
60-
61-
// assert(len >= 0 && len < 256);
6258

63-
pad = (u32)len | ((u32)len << 8);
59+
// assert(len >= 0 && len < 256);
60+
61+
pad = (u32) len | ((u32) len << 8);
6462
pad |= pad << 16;
6563

66-
while(len >= 16)
67-
{
68-
a = (u32)msg[ 0] |
69-
(u32)msg[ 1] << 8 |
70-
(u32)msg[ 2] << 16|
71-
(u32)msg[ 3] << 24;
72-
b = (u32)msg[ 4] |
73-
(u32)msg[ 5] << 8 |
74-
(u32)msg[ 6] << 16|
75-
(u32)msg[ 7] << 24;
76-
c = (u32)msg[ 8] |
77-
(u32)msg[ 9] << 8 |
78-
(u32)msg[10] << 16|
79-
(u32)msg[11] << 24;
80-
d = (u32)msg[12] |
81-
(u32)msg[13] << 8 |
82-
(u32)msg[14] << 16|
83-
(u32)msg[15] << 24;
84-
64+
while (len >= 16) {
65+
a = (u32) msg[0] |
66+
(u32) msg[1] << 8 | (u32) msg[2] << 16 | (u32) msg[3] << 24;
67+
b = (u32) msg[4] |
68+
(u32) msg[5] << 8 | (u32) msg[6] << 16 | (u32) msg[7] << 24;
69+
c = (u32) msg[8] |
70+
(u32) msg[9] << 8 |
71+
(u32) msg[10] << 16 | (u32) msg[11] << 24;
72+
d = (u32) msg[12] |
73+
(u32) msg[13] << 8 |
74+
(u32) msg[14] << 16 | (u32) msg[15] << 24;
75+
8576
TEACORE(PARTROUNDS);
8677

8778
len -= 16;
8879
msg += 16;
8980
}
9081

91-
if (len >= 12)
92-
{
93-
a = (u32)msg[ 0] |
94-
(u32)msg[ 1] << 8 |
95-
(u32)msg[ 2] << 16|
96-
(u32)msg[ 3] << 24;
97-
b = (u32)msg[ 4] |
98-
(u32)msg[ 5] << 8 |
99-
(u32)msg[ 6] << 16|
100-
(u32)msg[ 7] << 24;
101-
c = (u32)msg[ 8] |
102-
(u32)msg[ 9] << 8 |
103-
(u32)msg[10] << 16|
104-
(u32)msg[11] << 24;
82+
if (len >= 12) {
83+
a = (u32) msg[0] |
84+
(u32) msg[1] << 8 | (u32) msg[2] << 16 | (u32) msg[3] << 24;
85+
b = (u32) msg[4] |
86+
(u32) msg[5] << 8 | (u32) msg[6] << 16 | (u32) msg[7] << 24;
87+
c = (u32) msg[8] |
88+
(u32) msg[9] << 8 |
89+
(u32) msg[10] << 16 | (u32) msg[11] << 24;
10590

10691
d = pad;
107-
for(i = 12; i < len; i++)
108-
{
92+
for (i = 12; i < len; i++) {
10993
d <<= 8;
11094
d |= msg[i];
11195
}
112-
}
113-
else if (len >= 8)
114-
{
115-
a = (u32)msg[ 0] |
116-
(u32)msg[ 1] << 8 |
117-
(u32)msg[ 2] << 16|
118-
(u32)msg[ 3] << 24;
119-
b = (u32)msg[ 4] |
120-
(u32)msg[ 5] << 8 |
121-
(u32)msg[ 6] << 16|
122-
(u32)msg[ 7] << 24;
96+
} else if (len >= 8) {
97+
a = (u32) msg[0] |
98+
(u32) msg[1] << 8 | (u32) msg[2] << 16 | (u32) msg[3] << 24;
99+
b = (u32) msg[4] |
100+
(u32) msg[5] << 8 | (u32) msg[6] << 16 | (u32) msg[7] << 24;
123101

124102
c = d = pad;
125-
for(i = 8; i < len; i++)
126-
{
103+
for (i = 8; i < len; i++) {
127104
c <<= 8;
128105
c |= msg[i];
129106
}
130-
}
131-
else if (len >= 4)
132-
{
133-
a = (u32)msg[ 0] |
134-
(u32)msg[ 1] << 8 |
135-
(u32)msg[ 2] << 16|
136-
(u32)msg[ 3] << 24;
107+
} else if (len >= 4) {
108+
a = (u32) msg[0] |
109+
(u32) msg[1] << 8 | (u32) msg[2] << 16 | (u32) msg[3] << 24;
137110

138111
b = c = d = pad;
139-
for(i = 4; i < len; i++)
140-
{
112+
for (i = 4; i < len; i++) {
141113
b <<= 8;
142114
b |= msg[i];
143115
}
144-
}
145-
else
146-
{
116+
} else {
147117
a = b = c = d = pad;
148-
for(i = 0; i < len; i++)
149-
{
118+
for (i = 0; i < len; i++) {
150119
a <<= 8;
151120
a |= msg[i];
152121
}
@@ -155,55 +124,59 @@ u32 keyed_hash(const signed char *msg, int len)
155124
TEACORE(FULLROUNDS);
156125

157126
/* return 0;*/
158-
return h0^h1;
127+
return h0 ^ h1;
159128
}
160129

161130
/* What follows in this file is copyright 2000 by Hans Reiser, and the
162131
* licensing of what follows is governed by reiserfs/README */
163132

164-
u32 yura_hash (const signed char *msg, int len)
133+
u32 yura_hash(const signed char *msg, int len)
165134
{
166-
int j, pow;
167-
u32 a, c;
168-
int i;
169-
170-
for (pow=1,i=1; i < len; i++) pow = pow * 10;
171-
172-
if (len == 1)
173-
a = msg[0]-48;
174-
else
175-
a = (msg[0] - 48) * pow;
176-
177-
for (i=1; i < len; i++) {
178-
c = msg[i] - 48;
179-
for (pow=1,j=i; j < len-1; j++) pow = pow * 10;
180-
a = a + c * pow;
181-
}
182-
183-
for (; i < 40; i++) {
184-
c = '0' - 48;
185-
for (pow=1,j=i; j < len-1; j++) pow = pow * 10;
186-
a = a + c * pow;
187-
}
188-
189-
for (; i < 256; i++) {
190-
c = i;
191-
for (pow=1,j=i; j < len-1; j++) pow = pow * 10;
192-
a = a + c * pow;
193-
}
194-
195-
a = a << 7;
196-
return a;
135+
int j, pow;
136+
u32 a, c;
137+
int i;
138+
139+
for (pow = 1, i = 1; i < len; i++)
140+
pow = pow * 10;
141+
142+
if (len == 1)
143+
a = msg[0] - 48;
144+
else
145+
a = (msg[0] - 48) * pow;
146+
147+
for (i = 1; i < len; i++) {
148+
c = msg[i] - 48;
149+
for (pow = 1, j = i; j < len - 1; j++)
150+
pow = pow * 10;
151+
a = a + c * pow;
152+
}
153+
154+
for (; i < 40; i++) {
155+
c = '0' - 48;
156+
for (pow = 1, j = i; j < len - 1; j++)
157+
pow = pow * 10;
158+
a = a + c * pow;
159+
}
160+
161+
for (; i < 256; i++) {
162+
c = i;
163+
for (pow = 1, j = i; j < len - 1; j++)
164+
pow = pow * 10;
165+
a = a + c * pow;
166+
}
167+
168+
a = a << 7;
169+
return a;
197170
}
198171

199-
u32 r5_hash (const signed char *msg, int len)
172+
u32 r5_hash(const signed char *msg, int len)
200173
{
201-
u32 a=0;
202-
while(*msg) {
203-
a += *msg << 4;
204-
a += *msg >> 4;
205-
a *= 11;
206-
msg++;
207-
}
208-
return a;
174+
u32 a = 0;
175+
while (*msg) {
176+
a += *msg << 4;
177+
a += *msg >> 4;
178+
a *= 11;
179+
msg++;
180+
}
181+
return a;
209182
}

0 commit comments

Comments
 (0)