mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Peter T. Breuer" <ptb@it.uc3m.es>
To: dalecki@evision.ag
Subject: Re: what is teh current meaning of blk_size?
Date: Mon, 12 Nov 2001 23:10:44 +0100 (MET)	[thread overview]
Message-ID: <200111122214.fACMEPd09762@oboe.it.uc3m.es> (raw)
In-Reply-To: <3BF0365E.46DAABB0@evision-ventures.com> from "Martin Dalecki" at "Nov 12, 2001 09:51:42 pm"

"A month of sundays ago Martin Dalecki wrote:"
> "Peter T. Breuer" wrote:
> > Is blk_size[][] supposed to contain the size in KB or blocks?
> There is no rumor it's in blocks.
> 
> There are three level of block size measurements in linux:
> 
> 1. FS level one.	(page chunks most of time main exceptions are dos and
> isofs)
> 2. Driver level one.	(nearly always 1024, main exception are ATAPI
> cdrom)
> 3. Hardware device level one. (nearly always 512, only prehistoric SCSI
> drives from the stone age are exceptional and providing 256 byte sized
> block. We discovered them druing our archeological efforts recently
> under 
> a thick layer of mood...)
> 
> It's left as an exercies to the reader which one of the sparse
> matrices in ll_rw_blk.c is declaring which ;-).
> ...

Uh, thanks! I was looking at fs/block_dev.c.

 if (blk_size[MAJOR(dev)])
  size = ((loff_t) blk_size[MAJOR(dev)][MINOR(dev)] << BLOCK_SIZE_BITS) >> blocksize_bits;

which sets the size to the entered blk_size << 10 - blksize_bits.

I missed that BLOCK_SIZE_BITS was constant but blksize_bits is variable.
Amongst other things.


> OK I was to fast to figure it out:
> 
> /*
>  * blk_size contains the size of all block-devices in units of 1024 byte
>  * sectors:

But this is not so .. it is the default, not the rule. And it is only
the default if the block size is the default value.

> int * blk_size[MAX_BLKDEV];
> 
> /*
>  * blksize_size contains the size of all block-devices:

Err .... they mean the BLOCK SIZE of all ...

> int * blksize_size[MAX_BLKDEV];
> 
> /*
>  * hardsect_size contains the size of the hardware sector of a device.

Never used. Thanks for clearing that up!

If you knew if the meaning of blk_size had ever changed, and when in
terms of kernel version, that would also be very very helpful.

Peter


  reply	other threads:[~2001-11-12 22:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-12 19:39 Peter T. Breuer
2001-11-12 20:51 ` Martin Dalecki
2001-11-12 22:10   ` Peter T. Breuer [this message]
2001-11-13 15:08 Peter T. Breuer

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=200111122214.fACMEPd09762@oboe.it.uc3m.es \
    --to=ptb@it.uc3m.es \
    --cc=dalecki@evision.ag \
    /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®