Re: [PATCH] fat: instead of constant number, use the i_blkbits of struct inode to calculate the number of blocks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hyeoncheol Lee <hyc.lee@xxxxxxxxx> writes:

> To calculate the number of blocks from the number of clusters,
> use the i_blkbits of struct inode instead of 9.
>
> Signed-off-by: Hyeoncheol Lee <hyc.lee@xxxxxxxxx>
> ---
>  fs/fat/misc.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/fat/misc.c b/fs/fat/misc.c
> index 6d93360..ccdf663 100644
> --- a/fs/fat/misc.c
> +++ b/fs/fat/misc.c
> @@ -156,7 +156,7 @@ int fat_chain_add(struct inode *inode, int new_dclus, int nr_cluster)
>  			     (llu)(inode->i_blocks >> (sbi->cluster_bits - 9)));
>  		fat_cache_inval_inode(inode);
>  	}
> -	inode->i_blocks += nr_cluster << (sbi->cluster_bits - 9);
> +	inode->i_blocks += nr_cluster << (sbi->cluster_bits - inode->i_blkbits);

No. Unit of ->i_blocks is 512bytes always. So, 9 is right number.

>  
>  	return 0;
>  }

-- 
OGAWA Hirofumi <hirofumi@xxxxxxxxxxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux