Re: [PATCH] Set size of partition correctly in grub_disk_open()

2006-07-11 Thread Yoshinori K. Okuji
On Sunday 09 July 2006 23:37, Jeroen Dekkers wrote: > Well, if you consider the total_sectors a private variable, and you > want to have accessor functions for accessing it, then I can > understand your point a bit, but such things will make the kernel > bigger and I thought it was a goal to keep i

Re: [PATCH] Set size of partition correctly in grub_disk_open()

2006-07-09 Thread Jeroen Dekkers
At Sun, 9 Jul 2006 15:29:17 +0200, Yoshinori K. Okuji wrote: > > On Sunday 09 July 2006 14:01, Jeroen Dekkers wrote: > > I don't see anything like that in the code when I grep for > > total_sectors. The only code that is using total_sectors as the size > > of the disk is the grub_disk_check_range(

Re: [PATCH] Set size of partition correctly in grub_disk_open()

2006-07-09 Thread Tomáš Ebenlendr
Maybe Jeroen (and me) thinks that a 'disk' and 'partition' does not differ, as there can be some strange disk with filesystem directly on it (some flash memories, etc.) and also partitions containing another partitions. Standard terminology typically defines 'disk' as "root" partition. I.e. its pa

Re: [PATCH] Set size of partition correctly in grub_disk_open()

2006-07-09 Thread Yoshinori K. Okuji
On Sunday 09 July 2006 14:01, Jeroen Dekkers wrote: > I don't see anything like that in the code when I grep for > total_sectors. The only code that is using total_sectors as the size > of the disk is the grub_disk_check_range(), but that function is also > interested in whether the offset/size fit

Re: [PATCH] Set size of partition correctly in grub_disk_open()

2006-07-09 Thread Jeroen Dekkers
At Sun, 9 Jul 2006 03:11:33 +0200, Yoshinori K. Okuji wrote: > > > No. When you open something, you usually have no interest in the size. > > > > Yes, but those unusual places that do have interest in it want to know > > the size of the partition and not the size of the disk that contains > > the p

Re: [PATCH] Set size of partition correctly in grub_disk_open()

2006-07-08 Thread Yoshinori K. Okuji
On Sunday 09 July 2006 01:35, Jeroen Dekkers wrote: > The illogical thing for me is: You ask to open a partition, you get > back a structure that has half the properties of the partition, and > the other half has the properties of the disk the partition is on. I don't see this. When you open a par

Re: [PATCH] Set size of partition correctly in grub_disk_open()

2006-07-08 Thread Jeroen Dekkers
At Sat, 8 Jul 2006 23:10:56 +0200, Yoshinori K. Okuji wrote: > > 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 illo

Re: [PATCH] Set size of partition correctly in grub_disk_open()

2006-07-08 Thread Yoshinori K. Okuji
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 informa

Re: [PATCH] Set size of partition correctly in grub_disk_open()

2006-07-08 Thread Jeroen Dekkers
At Sat, 8 Jul 2006 18:07:44 +0200, Yoshinori K. Okuji wrote: > > Hi Jeroen, > > On Wednesday 05 July 2006 22:54, Jeroen Dekkers wrote: > > + > > + disk->total_sectors = grub_partition_get_len (disk->partition); > > +} > > But I don't agree with this part. The member "total_sectors" must

Re: [PATCH] Set size of partition correctly in grub_disk_open()

2006-07-08 Thread Yoshinori K. Okuji
Hi Jeroen, On Wednesday 05 July 2006 22:54, Jeroen Dekkers wrote: >if (p) > -disk->partition = grub_partition_probe (disk, p + 1); > +{ > + disk->partition = grub_partition_probe (disk, p + 1); > + if (! disk->partition) > + { > + grub_error (GRUB_ERR_UNKNOWN_DEVICE

[PATCH] Set size of partition correctly in grub_disk_open()

2006-07-05 Thread Jeroen Dekkers
Hi, When we open a partition grub_disk_open() sets disk->total_sectors to the size of the disk, not the size of the partition. We also don't check whether we grub_partition_probe() actually finds a partition. See the patch below. Jeroen Dekkers 2006-07-05 Jeroen Dekkers <[EMAIL PROTECTED]>