Commit dc8b0932 authored by Hirofumi Ogawa's avatar Hirofumi Ogawa Committed by Linus Torvalds

[PATCH] FAT: small cleanup

parent 647ebfd1
...@@ -50,7 +50,7 @@ int fat_get_block(struct inode *inode, sector_t iblock, ...@@ -50,7 +50,7 @@ int fat_get_block(struct inode *inode, sector_t iblock,
BUG(); BUG();
return -EIO; return -EIO;
} }
if (!((unsigned long)iblock % MSDOS_SB(sb)->sec_per_clus)) { if (!((unsigned long)iblock & (MSDOS_SB(sb)->sec_per_clus - 1))) {
int error; int error;
error = fat_add_cluster(inode); error = fat_add_cluster(inode);
......
...@@ -205,7 +205,7 @@ struct buffer_head *fat_extend_dir(struct inode *inode) ...@@ -205,7 +205,7 @@ struct buffer_head *fat_extend_dir(struct inode *inode)
if (inode->i_size & (sb->s_blocksize - 1)) { if (inode->i_size & (sb->s_blocksize - 1)) {
fat_fs_panic(sb, "Odd directory size"); fat_fs_panic(sb, "Odd directory size");
inode->i_size = (inode->i_size + sb->s_blocksize) inode->i_size = (inode->i_size + sb->s_blocksize)
& ~(sb->s_blocksize - 1); & ~((loff_t)sb->s_blocksize - 1);
} }
inode->i_size += MSDOS_SB(sb)->cluster_size; inode->i_size += MSDOS_SB(sb)->cluster_size;
MSDOS_I(inode)->mmu_private += MSDOS_SB(sb)->cluster_size; MSDOS_I(inode)->mmu_private += MSDOS_SB(sb)->cluster_size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment