lkml.org 
[lkml]   [2014]   [Sep]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] fat: Simplify calc_fat_clusters code
Date
Seunghun Lee <waydi1@gmail.com> writes:

> diff --git a/fs/fat/inode.c b/fs/fat/inode.c
> index 756aead..6992dea 100644
> --- a/fs/fat/inode.c
> +++ b/fs/fat/inode.c
> @@ -1307,12 +1307,9 @@ static unsigned long calc_fat_clusters(struct super_block *sb)
> struct msdos_sb_info *sbi = MSDOS_SB(sb);
>
> /* Divide first to avoid overflow */
> - if (sbi->fat_bits != 12) {
> - unsigned long ent_per_sec = sb->s_blocksize * 8 / sbi->fat_bits;
> - return ent_per_sec * sbi->fat_length;
> - }
> + unsigned long ent_per_sec = sb->s_blocksize * 8 / sbi->fat_bits;
>
> - return sbi->fat_length * sb->s_blocksize * 8 / sbi->fat_bits;
> + return ent_per_sec * sbi->fat_length;
> }

When sbi->fat_bits == 12, it doesn't work, right? (there is the remainder)

Thanks.
--
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>


\
 
 \ /
  Last update: 2014-09-02 18:41    [W:0.039 / U:3.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site