diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-11-05 14:38:55 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-11-05 14:38:55 -0500 |
commit | 328198acb7407301ddf6005c0fa1e04bd0c539c8 (patch) | |
tree | 9936112bd195bfbaacc9a75f2ea7ff757a2c0546 /include/linux/msdos_fs.h | |
parent | 9e0cb06b17be7e562cbdaba2768649f025826dc6 (diff) | |
parent | fecb4a0c87c2bcaee1f3cf800126eef752a07ed3 (diff) |
Merge branch 'master'
Diffstat (limited to 'include/linux/msdos_fs.h')
-rw-r--r-- | include/linux/msdos_fs.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/msdos_fs.h b/include/linux/msdos_fs.h index 9a3d27257984..941da5c016a0 100644 --- a/include/linux/msdos_fs.h +++ b/include/linux/msdos_fs.h @@ -282,6 +282,17 @@ static inline u8 fat_attr(struct inode *inode) MSDOS_I(inode)->i_attrs; } +static inline unsigned char fat_checksum(const __u8 *name) +{ + unsigned char s = name[0]; + s = (s<<7) + (s>>1) + name[1]; s = (s<<7) + (s>>1) + name[2]; + s = (s<<7) + (s>>1) + name[3]; s = (s<<7) + (s>>1) + name[4]; + s = (s<<7) + (s>>1) + name[5]; s = (s<<7) + (s>>1) + name[6]; + s = (s<<7) + (s>>1) + name[7]; s = (s<<7) + (s>>1) + name[8]; + s = (s<<7) + (s>>1) + name[9]; s = (s<<7) + (s>>1) + name[10]; + return s; +} + static inline sector_t fat_clus_to_blknr(struct msdos_sb_info *sbi, int clus) { return ((sector_t)clus - FAT_START_ENT) * sbi->sec_per_clus |