aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fat
diff options
context:
space:
mode:
authorOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>2005-10-30 18:03:49 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-30 20:37:32 -0500
commit451cbaa1c328082832a8fbcc427cd4416c602c5a (patch)
tree139c3d33d0cf3f9eba214c504e4173f54c6cf66d /fs/fat
parent4e57b6817880946a3a78d5d8cad1ace363f7e449 (diff)
[PATCH] fat: cleanup and optimization of checksum
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/fat')
-rw-r--r--fs/fat/dir.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/fs/fat/dir.c b/fs/fat/dir.c
index 895049b2ac9c..204d8614406f 100644
--- a/fs/fat/dir.c
+++ b/fs/fat/dir.c
@@ -263,7 +263,6 @@ parse_record:
263 unsigned char id; 263 unsigned char id;
264 unsigned char slot; 264 unsigned char slot;
265 unsigned char slots; 265 unsigned char slots;
266 unsigned char sum;
267 unsigned char alias_checksum; 266 unsigned char alias_checksum;
268 267
269 if (!unicode) { 268 if (!unicode) {
@@ -317,9 +316,7 @@ parse_long:
317 goto parse_long; 316 goto parse_long;
318 if (IS_FREE(de->name) || (de->attr & ATTR_VOLUME)) 317 if (IS_FREE(de->name) || (de->attr & ATTR_VOLUME))
319 continue; 318 continue;
320 for (sum = 0, i = 0; i < 11; i++) 319 if (fat_checksum(de->name) != alias_checksum)
321 sum = (((sum&1)<<7)|((sum&0xfe)>>1)) + de->name[i];
322 if (sum != alias_checksum)
323 nr_slots = 0; 320 nr_slots = 0;
324 } 321 }
325 322
@@ -479,7 +476,6 @@ GetNew:
479 unsigned char id; 476 unsigned char id;
480 unsigned char slot; 477 unsigned char slot;
481 unsigned char slots; 478 unsigned char slots;
482 unsigned char sum;
483 unsigned char alias_checksum; 479 unsigned char alias_checksum;
484 480
485 if (!unicode) { 481 if (!unicode) {
@@ -534,9 +530,7 @@ ParseLong:
534 goto ParseLong; 530 goto ParseLong;
535 if (IS_FREE(de->name) || (de->attr & ATTR_VOLUME)) 531 if (IS_FREE(de->name) || (de->attr & ATTR_VOLUME))
536 goto RecEnd; 532 goto RecEnd;
537 for (sum = 0, i = 0; i < 11; i++) 533 if (fat_checksum(de->name) != alias_checksum)
538 sum = (((sum&1)<<7)|((sum&0xfe)>>1)) + de->name[i];
539 if (sum != alias_checksum)
540 long_slots = 0; 534 long_slots = 0;
541 } 535 }
542 536