From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: Hyeoncheol Lee <hyc.lee@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] fat: instead of constant number, use the i_blkbits of struct inode to calculate the number of blocks
Date: Tue, 19 Feb 2013 20:56:51 +0900 [thread overview]
Message-ID: <87obfgy0sc.fsf@devron.myhome.or.jp> (raw)
In-Reply-To: <1361274638-9534-1-git-send-email-hyc.lee@gmail.com> (Hyeoncheol Lee's message of "Tue, 19 Feb 2013 20:50:38 +0900")
Hyeoncheol Lee <hyc.lee@gmail.com> 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@gmail.com>
> ---
> 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@mail.parknet.co.jp>
prev parent reply other threads:[~2013-02-19 11:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-19 11:50 [PATCH] fat: instead of constant number, use the i_blkbits of struct inode to calculate the number of blocks Hyeoncheol Lee
2013-02-19 11:56 ` OGAWA Hirofumi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87obfgy0sc.fsf@devron.myhome.or.jp \
--to=hirofumi@mail.parknet.co.jp \
--cc=hyc.lee@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.