All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yoshinori K. Okuji" <okuji@enbug.org>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [PATCH] Set size of partition correctly in grub_disk_open()
Date: Sat, 8 Jul 2006 23:10:56 +0200	[thread overview]
Message-ID: <200607082310.56584.okuji@enbug.org> (raw)
In-Reply-To: <87ac7jg7bb.wl%jeroen@vrijschrift.org>

On Saturday 08 July 2006 22:39, Jeroen Dekkers wrote:
> But it's a little bit illogical that the size you get from the same
> disk structure isn't the size of the partition, but the size of
> something else.

It is not illogical from my point of view. The disk structure should describe 
the information on a disk but not on a partition. Your way looks illogical to 
me.

> It's also not really useful: if you're opening a 
> partition, your are interested in the size of the partition most of
> the time, not the size of the disk the partition is on.

No. When you open something, you usually have no interest in the size.

> The AFFS code 
> already assumes that the total_sectors is the size of the partition
> and the blocklist code does that too, if you want to allow to read a
> blocklist from a partition.

blocklist does not. I fixed this bug some weeks ago.

I don't remember about AFFS. I haven't proofread the code carefully.

> Not having total_sectors the size of the partition also makes it
> impossible to write generic code for both disks and
> partitions. Everytime you want to get the size of a device, you've to
> check whether the device is a disk or a partition. This will enlarge
> the code unnecessary.

Tell me why you need to know the size. The range check is automatically done 
by the disk interface, so you won't have to deal with such a check in the 
filesystem code.

> So I don't really see why total_sectors should be the size of the disk
> the partition is on instead of the size of the partition.

Because the disk structure is for disks, and the partition structure is for 
partitions. Overwriting total_sectors in a disk means that you only lose 
information. If your concern is only the conditional that checks if a disk 
contains a partition or not, you can write a functional such as 
grub_device_get_size.

Okuji 



  reply	other threads:[~2006-07-08 21:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-05 20:54 [PATCH] Set size of partition correctly in grub_disk_open() Jeroen Dekkers
2006-07-08 16:07 ` Yoshinori K. Okuji
2006-07-08 20:39   ` Jeroen Dekkers
2006-07-08 21:10     ` Yoshinori K. Okuji [this message]
2006-07-08 23:35       ` Jeroen Dekkers
2006-07-09  1:11         ` Yoshinori K. Okuji
2006-07-09 12:01           ` Jeroen Dekkers
2006-07-09 13:29             ` Yoshinori K. Okuji
2006-07-09 14:38               ` Tomáš Ebenlendr
2006-07-09 21:37               ` Jeroen Dekkers
2006-07-11 17:06                 ` Yoshinori K. Okuji

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=200607082310.56584.okuji@enbug.org \
    --to=okuji@enbug.org \
    --cc=grub-devel@gnu.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.