From: William Park <opengeometry@yahoo.ca>
To: "Peter T. Breuer" <ptb@it.uc3m.es>
Cc: linux kernel <linux-kernel@vger.kernel.org>
Subject: Re: blocks or KB? (was: .. current meaning of blk_size array)
Date: Thu, 15 Nov 2001 00:34:34 -0500 [thread overview]
Message-ID: <20011115003434.A25883@node0.opengeometry.ca> (raw)
In-Reply-To: <3BF23D01.F7E879E8@evision-ventures.com> <200111142041.fAEKfBN15594@oboe.it.uc3m.es>
In-Reply-To: <200111142041.fAEKfBN15594@oboe.it.uc3m.es>; from ptb@it.uc3m.es on Wed, Nov 14, 2001 at 09:41:11PM +0100
On Wed, Nov 14, 2001 at 09:41:11PM +0100, Peter T. Breuer wrote:
> Am I making plain the difference between blk_size and blksize?
>
> blk_size is the number of blocks or KB (which?) in a device. blksize is
> the size of the blocks. Is blk_size in KB or blocks?
>
> It should be in blocks if the size of a device is to reach 8 or 16TB.
> If it is in KB, we are limited to 2 or 4TB.
I've been following this thread intensely. I need to use Network Block
Device to get very large network-RAID. And, resolution to this issue is
of great interest to me.
Judging by 'driver/block/nbd.c', it counts by BLOCK_SIZE=1204
(BLOCK_SIZE_BITS=10), even though you can set the block size to
[512,1024,...,PAGE_SIZE=4096]. Since NBD counts this 1KB block using
'u64' integer, the ultimate size of filesystem is determined by the
kernel block device support.
Looking at 'fs/block_dev.c', you can set the block size to
[512,1024,...,PAGE_SIZE=4096] also. But, 'max_block()' returns block
count in whatever block size of the device, not in BLOCK_SIZE:
static unsigned long max_block(kdev_t dev)
{
unsigned int retval = ~0U;
int major = MAJOR(dev);
if (blk_size[major]) {
int minor = MINOR(dev);
unsigned int blocks = blk_size[major][minor];
if (blocks) {
unsigned int size = block_size(dev);
unsigned int sizebits = blksize_bits(size);
blocks += (size-1) >> BLOCK_SIZE_BITS;
retval = blocks << (BLOCK_SIZE_BITS - sizebits);
if (sizebits > BLOCK_SIZE_BITS)
retval = blocks >> (sizebits - BLOCK_SIZE_BITS);
}
}
return retval;
}
In particular, if block size is 512, then the block count is multiplied
by 2; and if block size if 4096, then the block count is divided by 4.
It thinks that 'blk_size[][]' is block count in KB. So, I can only
deduce that block count is in KB.
Also, from 'include/linux/blkdev.h',
extern int * blk_size[MAX_BLKDEV];
'blk_size[][]' is 'int', which means maximum size of block device is
2^10 x 2^31 = 2^41 = 2TB. However, because it is always converted to
'unsigned int' for block count calculation, I think you can take it as
4TB.
Am I right?
--
William Park, Open Geometry Consulting, <opengeometry@yahoo.ca>.
8 CPU cluster, NAS, (Slackware) Linux, Python, LaTeX, Vim, Mutt, Tin
next prev parent reply other threads:[~2001-11-15 5:35 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-11-13 15:08 what is teh current meaning of blk_size? Peter T. Breuer
2001-11-13 18:51 ` blocks or KB? (was: .. current meaning of blk_size array) Peter T. Breuer
2001-11-14 9:44 ` Martin Dalecki
2001-11-14 20:41 ` Peter T. Breuer
2001-11-14 20:51 ` Martin Dalecki
2001-11-14 21:16 ` Andreas Dilger
2001-11-14 21:49 ` Benjamin LaHaise
2001-11-14 22:33 ` Scott Laird
2001-11-15 1:48 ` William Park
2001-11-15 4:58 ` Andreas Dilger
2001-11-15 5:34 ` William Park [this message]
2001-11-15 5:55 ` Andreas Dilger
2001-11-15 10:42 ` Anton Altaparmakov
2001-11-15 12:35 ` Peter T. Breuer
2001-11-15 18:31 ` William Park
2001-11-15 20:19 ` Andreas Dilger
2001-11-15 22:04 ` blocks or KB? William Park
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=20011115003434.A25883@node0.opengeometry.ca \
--to=opengeometry@yahoo.ca \
--cc=linux-kernel@vger.kernel.org \
--cc=ptb@it.uc3m.es \
/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