mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hyeoncheol Lee <hyc.lee@gmail.com>
To: hirofumi@mail.parknet.co.jp
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: [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:50:38 +0900	[thread overview]
Message-ID: <1361274638-9534-1-git-send-email-hyc.lee@gmail.com> (raw)

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);
 
 	return 0;
 }
-- 
1.7.9.5


             reply	other threads:[~2013-02-19 11:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-19 11:50 Hyeoncheol Lee [this message]
2013-02-19 11:56 ` OGAWA Hirofumi

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=1361274638-9534-1-git-send-email-hyc.lee@gmail.com \
    --to=hyc.lee@gmail.com \
    --cc=hirofumi@mail.parknet.co.jp \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®